Categories
Core

Action Scheduler 3.0

Action Scheduler 3.0 is a major release, which means it breaks backward compatibility with previous versions. Before updating, we strongly recommend that you ensure your theme and plugins are compatible and make sufficient backups for peace of mind.

Major Enhancements

Custom Tables

Previously, Action Scheduler stored its data using a custom post type. Custom post types are a popular way for storing data among plugins which can result in large tables sizes and contention accessing those tables.

Version 3.0 migrates all ActionScheduler data from its current storage to custom tables. This results in a significant performance boost. While individual usage will vary, our tests showed the following:

  • 70% reduction in database space
  • 68% reduction in new action creation time
  • 65% reduction in sorted action list retrieval

Note that migration to custom tables requires PHP 5.6 or greater.

Async Queue Runner

Previous versions of Action Scheduler relied on WordPress Cron to process scheduled actions. Action Scheduler also provided WP CLI support so that sites requiring higher throughput could manually configure CLI processing.

The async queue runner initiates action processing when an admin user logs into the WordPress administration dashboard. It also uses loopback requests to process multiple batches of actions in a sequence of requests so that instead of processing actions in just one request, once a queue starts processing, it will continue to process actions in a new request until there are no actions to process, or loopback limits are reached.

This new queue runner both reduces the reliance on WP Cron and potentially eliminates the need to use WP CLI due to the higher throughput of action processing.

Minor Enhancements

Version 3.0 also includes a number of small enhancements:

  • Async action type – An new action type scheduled to run as soon as possible. These actions take priority over actions scheduler for a given time, even a time in the past, and are a great option for background processing jobs.
  • Context parameter – The context is included in log entries to indicate which queue runner processed the action. This may aid in troubleshooting.
  • Bulk cancel by hook or group – This action api function will allow third party plugins to cancel all of their scheduled actions in a single call.
  • Fixes for Cron and Recurring action types – recurring and cron action types were broken in prior versions, and have now been fixed.

This version also includes a number of fixes. Check out the change log.

Updating to Action Scheduler 3.0

In addition to making a backup of your site, we recommend testing on a staging site before upgrading to 3.0 on your live site.

Once installed, the database migration will be scheduled automatically if all dependencies are met. While the migration is in process, Action Scheduler will remain functional and supports adding, processing, and deleting actions. The migration process displays a migration in process notice in the Scheduled Action admin screen. The notice is removed once the migration is complete.

Much 💜 to All Contributors

A big thanks to everyone in the WooCommerce and WordPress communities who contributed via bug reports, commits, testing, spreading the word, and participating in community chats.

thenbrentrrennickclaudiosanches“james-allan”
thenbrentrrennickclaudiosanchesjames-allan
cliffordpJPryscottsoapbox“crstauf”
cliffordpJPryscottsoapboxcrstauf
“vendidero”“korndev”“salcode”“wvega”
vendiderokorndevsalcodewvega

2 replies on “Action Scheduler 3.0”

Comments are closed.