| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Action Scheduler |
| 4 |
* Plugin URI: https://actionscheduler.org |
| 5 |
* Description: A robust scheduling library for use in WordPress plugins. |
| 6 |
* Author: Automattic |
| 7 |
* Author URI: https://automattic.com/ |
| 8 |
* Version: 3.9.3 |
| 9 |
* License: GPLv3 |
| 10 |
* Requires at least: 6.5 |
| 11 |
* Tested up to: 6.8 |
| 12 |
* Requires PHP: 7.2 |
| 13 |
* |
| 14 |
* Copyright 2019 Automattic, Inc. (https://automattic.com/contact/) |
| 15 |
* |
| 16 |
* This program is free software: you can redistribute it and/or modify |
| 17 |
* it under the terms of the GNU General Public License as published by |
| 18 |
* the Free Software Foundation, either version 3 of the License, or |
| 19 |
* (at your option) any later version. |
| 20 |
* |
| 21 |
* This program is distributed in the hope that it will be useful, |
| 22 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 23 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 24 |
* GNU General Public License for more details. |
| 25 |
* |
| 26 |
* You should have received a copy of the GNU General Public License |
| 27 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 28 |
* |
| 29 |
* @package ActionScheduler |
| 30 |
*/ |
| 31 |
|
| 32 |
if ( ! function_exists( 'action_scheduler_register_3_dot_9_dot_3' ) && function_exists( 'add_action' ) ) { // WRCS: DEFINED_VERSION. |
| 33 |
|
| 34 |
if ( ! class_exists( 'ActionScheduler_Versions', false ) ) { |
| 35 |
require_once __DIR__ . '/classes/ActionScheduler_Versions.php'; |
| 36 |
add_action( 'plugins_loaded', array( 'ActionScheduler_Versions', 'initialize_latest_version' ), 1, 0 ); |
| 37 |
} |
| 38 |
|
| 39 |
add_action( 'plugins_loaded', 'action_scheduler_register_3_dot_9_dot_3', 0, 0 ); // WRCS: DEFINED_VERSION. |
| 40 |
|
| 41 |
// phpcs:disable Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace |
| 42 |
/** |
| 43 |
* Registers this version of Action Scheduler. |
| 44 |
*/ |
| 45 |
function action_scheduler_register_3_dot_9_dot_3() { // WRCS: DEFINED_VERSION. |
| 46 |
$versions = ActionScheduler_Versions::instance(); |
| 47 |
$versions->register( '3.9.3', 'action_scheduler_initialize_3_dot_9_dot_3' ); // WRCS: DEFINED_VERSION. |
| 48 |
} |
| 49 |
|
| 50 |
// phpcs:disable Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace |
| 51 |
/** |
| 52 |
* Initializes this version of Action Scheduler. |
| 53 |
*/ |
| 54 |
function action_scheduler_initialize_3_dot_9_dot_3() { // WRCS: DEFINED_VERSION. |
| 55 |
// A final safety check is required even here, because historic versions of Action Scheduler |
| 56 |
// followed a different pattern (in some unusual cases, we could reach this point and the |
| 57 |
// ActionScheduler class is already defined—so we need to guard against that). |
| 58 |
if ( ! class_exists( 'ActionScheduler', false ) ) { |
| 59 |
require_once __DIR__ . '/classes/abstracts/ActionScheduler.php'; |
| 60 |
ActionScheduler::init( __FILE__ ); |
| 61 |
} |
| 62 |
} |
| 63 |
|
| 64 |
// Support usage in themes - load this version if no plugin has loaded a version yet. |
| 65 |
if ( did_action( 'plugins_loaded' ) && ! doing_action( 'plugins_loaded' ) && ! class_exists( 'ActionScheduler', false ) ) { |
| 66 |
action_scheduler_initialize_3_dot_9_dot_3(); // WRCS: DEFINED_VERSION. |
| 67 |
do_action( 'action_scheduler_pre_theme_init' ); |
| 68 |
ActionScheduler_Versions::initialize_latest_version(); |
| 69 |
} |
| 70 |
} |
| 71 |
|