Plugin Directory

Changeset 3437283


Ignore:
Timestamp:
01/12/2026 12:00:26 AM (3 months ago)
Author:
shieldclimb
Message:

Updated plugin to version 1.0.4: Tested up to WordPress 6.9 and WooCommerce 10.4.3, Background task handling by dynamically adjusting Action Scheduler batch size and concurrency based on the number of pending tasks and this helps prevent stuck or overdue tasks while maintaining stable performance

Location:
shieldclimb-fix-pending-and-past-due-tasks/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • shieldclimb-fix-pending-and-past-due-tasks/trunk/readme.txt

    r3339141 r3437283  
    11=== ShieldClimb – Fix Pending and Past-due Tasks for WooCommerce ===
    22Contributors: shieldclimb
    3 Donate link: https://shieldclimb.com/
     3Donate link: https://shieldclimb.com/product/donate-now/
    44Tags: cron, scheduler, action scheduler, cron manager, wp cron
    55Requires at least: 5.8
    6 Tested up to: 6.8
    7 Stable tag: 1.0.3
     6Tested up to: 6.9
     7Stable tag: 1.0.4
    88Requires PHP: 7.2
    99WC requires at least: 5.8
    10 WC tested up to: 10.0.4
     10WC tested up to: 10.4.3
    1111License: GPLv2 or later
    1212License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     
    4141== ChangeLog ==
    4242
     43= V1.0.4 =
     44
     45* **Improved**: Background task handling by dynamically adjusting Action Scheduler batch size and concurrency based on the number of pending tasks. This helps prevent stuck or overdue tasks while maintaining stable performance.
     46* **Updated**: Tested up to WordPress 6.9 and WooCommerce 10.4.3
     47
    4348= V1.0.3 =
    4449
  • shieldclimb-fix-pending-and-past-due-tasks/trunk/shieldclimb-fix-pending-and-past-due-tasks.php

    r3339141 r3437283  
    55 * Plugin URI: https://shieldclimb.com/free-woocommerce-plugins/fix-pending-and-past-due-tasks/
    66 * Description: Fix Pending and Past-due Tasks for WooCommerce – Speed up order processing, prevent stuck scheduled tasks, and optimize performance.
    7  * Version: 1.0.3
     7 * Version: 1.0.4
    88 * Requires Plugins: woocommerce
    99 * Requires at least: 5.8
    10  * Tested up to: 6.8
     10 * Tested up to: 6.9
    1111 * WC requires at least: 5.8
    12  * WC tested up to: 10.0.4
     12 * WC tested up to: 10.4.3
    1313 * Requires PHP: 7.2
    1414 * Author: shieldclimb.com
    15  * Author URI: https://shieldclimb.com/about-us/
     15 * Author URI: https://shieldclimb.com/
    1616 * License: GPLv2 or later
    1717 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     
    2222}
    2323
    24 add_filter('action_scheduler_queue_runner_concurrent_batches', 'shieldclimb_set_concurrent_batches');
    25 function shieldclimb_set_concurrent_batches() {
    26     return 2;
    27 }
     24add_filter( 'action_scheduler_queue_runner_concurrent_batches', function ( $default ) {
    2825
    29 add_filter('action_scheduler_queue_runner_batch_size', 'shieldclimb_set_batch_size');
    30 function shieldclimb_set_batch_size() {
     26    if ( ! function_exists( 'as_get_scheduled_actions' ) ) {
     27        return $default;
     28    }
     29
     30    $pending = as_get_scheduled_actions( array(
     31        'status' => 'pending',
     32        'per_page' => 1,
     33    ), 'count' );
     34
     35    if ( $pending > 200 ) return 4;  // High volume
     36    if ( $pending > 100 ) return 3;  // Medium volume
     37    return 2;                        // Low volume
     38} );
     39
     40add_filter( 'action_scheduler_queue_runner_batch_size', function ( $default ) {
     41
     42    if ( ! function_exists( 'as_get_scheduled_actions' ) ) {
     43        return $default;
     44    }
     45
     46    $pending = as_get_scheduled_actions( array(
     47        'status' => 'pending',
     48        'per_page' => 1,
     49    ), 'count' );
     50
     51    if ( $pending > 200 ) return 50;
     52    if ( $pending > 100 ) return 30;
    3153    return 15;
    32 }
     54} );
    3355
    3456?>
Note: See TracChangeset for help on using the changeset viewer.