Changeset 3437283
- Timestamp:
- 01/12/2026 12:00:26 AM (3 months ago)
- Location:
- shieldclimb-fix-pending-and-past-due-tasks/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
shieldclimb-fix-pending-and-past-due-tasks.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shieldclimb-fix-pending-and-past-due-tasks/trunk/readme.txt
r3339141 r3437283 1 1 === ShieldClimb – Fix Pending and Past-due Tasks for WooCommerce === 2 2 Contributors: shieldclimb 3 Donate link: https://shieldclimb.com/ 3 Donate link: https://shieldclimb.com/product/donate-now/ 4 4 Tags: cron, scheduler, action scheduler, cron manager, wp cron 5 5 Requires at least: 5.8 6 Tested up to: 6. 87 Stable tag: 1.0. 36 Tested up to: 6.9 7 Stable tag: 1.0.4 8 8 Requires PHP: 7.2 9 9 WC requires at least: 5.8 10 WC tested up to: 10. 0.410 WC tested up to: 10.4.3 11 11 License: GPLv2 or later 12 12 License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html … … 41 41 == ChangeLog == 42 42 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 43 48 = V1.0.3 = 44 49 -
shieldclimb-fix-pending-and-past-due-tasks/trunk/shieldclimb-fix-pending-and-past-due-tasks.php
r3339141 r3437283 5 5 * Plugin URI: https://shieldclimb.com/free-woocommerce-plugins/fix-pending-and-past-due-tasks/ 6 6 * Description: Fix Pending and Past-due Tasks for WooCommerce – Speed up order processing, prevent stuck scheduled tasks, and optimize performance. 7 * Version: 1.0. 37 * Version: 1.0.4 8 8 * Requires Plugins: woocommerce 9 9 * Requires at least: 5.8 10 * Tested up to: 6. 810 * Tested up to: 6.9 11 11 * WC requires at least: 5.8 12 * WC tested up to: 10. 0.412 * WC tested up to: 10.4.3 13 13 * Requires PHP: 7.2 14 14 * Author: shieldclimb.com 15 * Author URI: https://shieldclimb.com/ about-us/15 * Author URI: https://shieldclimb.com/ 16 16 * License: GPLv2 or later 17 17 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html … … 22 22 } 23 23 24 add_filter('action_scheduler_queue_runner_concurrent_batches', 'shieldclimb_set_concurrent_batches'); 25 function shieldclimb_set_concurrent_batches() { 26 return 2; 27 } 24 add_filter( 'action_scheduler_queue_runner_concurrent_batches', function ( $default ) { 28 25 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 40 add_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; 31 53 return 15; 32 } 54 } ); 33 55 34 56 ?>
Note: See TracChangeset
for help on using the changeset viewer.