Plugin Directory

Changeset 3282993


Ignore:
Timestamp:
04/28/2025 04:00:26 AM (11 months ago)
Author:
easyprolabs
Message:

bug fix in background jobs

Location:
podcast-player
Files:
181 added
4 edited

Legend:

Unmodified
Added
Removed
  • podcast-player/trunk/README.txt

    r3277861 r3282993  
    55Tested up to: 6.8
    66Requires PHP: 5.6
    7 Stable tag: 7.7.3
     7Stable tag: 7.7.4
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    103103
    104104== Changelog ==
     105
     106= 7.7.4 =
     107* Bug Fix: Fixes in Background Jobs for Image Downloads
    105108
    106109= 7.7.3 =
  • podcast-player/trunk/helper/core/class-background-jobs.php

    r3135229 r3282993  
    6161        $unique_id  = substr( md5( $identifier . $task_type ), 0, 12 );
    6262        $queue      = $instance->get_tasks_queue( false );
     63
     64        // Do not add new download image jobs, if queue is already large. Also trim the backlog.
     65        if ( 'download_image' === $task_type && count( $queue ) > 50 ) {
     66            $queue = array_slice( $queue, 0, 50 );
     67            $instance->set_tasks_queue( $queue );
     68            return $instance;
     69        }
     70
    6371        $task_data  = array(
    6472            'identifier' => $identifier,
     
    8492    public function dispatch() {
    8593        $instance = self::get_instance();
    86         if ( $this->is_processing() || $this->is_queue_empty() ) {
     94        if ( $this->is_processing() || $this->is_queue_empty() || $this->recently_dispatched() ) {
    8795            return;
    8896        }
     97
     98        $this->set_recent_dispatch();
    8999
    90100        $url  = add_query_arg( $instance->get_query_args(), $instance->get_query_url() );
     
    92102
    93103        return wp_remote_post( esc_url_raw( $url ), $args );
     104    }
     105
     106    private function recently_dispatched() {
     107        return get_transient( $this->identifier . '_recent_dispatch' );
     108    }
     109   
     110    private function set_recent_dispatch() {
     111        set_transient( $this->identifier . '_recent_dispatch', 1, 60 ); // 60 seconds
    94112    }
    95113
  • podcast-player/trunk/helper/store/class-storageregister.php

    r3219458 r3282993  
    125125     */
    126126    public function __set( $name, $value ) {
    127         throw new Exception( esc_html( "Cannot add new property \$$name to instance of " ) . __CLASS__ );
     127        throw new \Exception( esc_html( "Cannot add new property \$$name to instance of " ) . __CLASS__ );
    128128    }
    129129
  • podcast-player/trunk/podcast-player.php

    r3274237 r3282993  
    1515 * Plugin URI:        https://easypodcastpro.com
    1616 * Description:       Host your podcast episodes anywhere, display them only using podcast feed url. Use custom widget or shortcode to display podcast player anywhere on your site.
    17  * Version:           7.7.3
     17 * Version:           7.7.4
    1818 * Author:            vedathemes
    1919 * Author URI:        https://easypodcastpro.com
     
    3030
    3131// Currently plugin version.
    32 define( 'PODCAST_PLAYER_VERSION', '7.7.3' );
     32define( 'PODCAST_PLAYER_VERSION', '7.7.4' );
    3333
    3434// Define plugin constants.
Note: See TracChangeset for help on using the changeset viewer.