-
Notifications
You must be signed in to change notification settings - Fork 1
Compatibility
Since Cronarchy exposes its own API and uses its own dedicated table for storage in the database, it does not interfere with (nor is it affected by) any other cron system on the same WordPress site, be it WP Cron, Cavalcade, or any other solution.
Multiple plugins and themes may use Cronarchy at the same time on the same WordPress site. Any database tables that Cronarchy needs, as well as entries in the wp_options table, are explicitly prefixed with your Cronarchy instance's ID, allowing multiple instances to coexist without altering each other's data or cron jobs.
If a 3rd party plugin or theme is also using Cronarchy, compatibility will depend on how you and the 3rd party have installed Cronarchy.
If you're using Composer for installation and autoloading, you're doing other plugin/theme developers are great service! With autoloading, only one version of Cronarchy will be loaded. More specifically, the first plugin to load will load its installed copy of Cronarchy. Themes are loaded before all plugins, so they automatically win when it comes to autoloading.
If the 3rd party is using Composer, their copy of Cronarchy might be loaded instead of your own copy. This is only a problem when your required version of Cronarchy is not compatible with the 3rd party's bundled version. This is, unfortunately, a problem that cannot be solved unless WordPress manages plugin and theme dependencies itself using Composer.
In the case of manual installation, the best you can do is to check if Cronarchy has already been loaded before proceeding to load it:
if (!class_exists('RebelCode\Cronarchy')) {
require_once 'includes/cronarchy/src/Cronarchy.php';
require_once 'includes/cronarchy/src/Runner.php';
require_once 'includes/cronarchy/src/JobManager.php';
// ...
}If a 3rd party is manually loading, pray that they've done the some. So make sure that your solution is a friendly 3rd party for other developers!