Submit
Path:
~
/
home
/
getwphos
/
public_html
/
almajd
/
wp-content
/
plugins
/
woocommerce
/
packages
/
action-scheduler
/
classes
/
File Content:
ActionScheduler_RecurringActionScheduler.php
<?php /** * Class ActionScheduler_RecurringActionScheduler * * This class ensures that the `action_scheduler_ensure_recurring_actions` hook is triggered on a daily interval. This * simplifies the process for other plugins to register their recurring actions without requiring each plugin to query * or schedule actions independently on every request. */ class ActionScheduler_RecurringActionScheduler { /** * @var string The hook of the scheduled recurring action that is run to trigger the * `action_scheduler_ensure_recurring_actions` hook that plugins should use. We can't directly have the * scheduled action hook be the hook plugins should use because the actions will show as failed if no plugin * was actively hooked into it. */ private const RUN_SCHEDULED_RECURRING_ACTIONS_HOOK = 'action_scheduler_run_recurring_actions_schedule_hook'; /** * Initialize the instance. Should only be run on a single instance per request. * * @return void */ public function init(): void { add_action( self::RUN_SCHEDULED_RECURRING_ACTIONS_HOOK, array( $this, 'run_recurring_scheduler_hook' ) ); if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) { add_action( 'action_scheduler_init', array( $this, 'schedule_recurring_scheduler_hook' ) ); } } /** * Schedule the recurring `action_scheduler_ensure_recurring_actions` action if not already scheduled. * * @return void */ public function schedule_recurring_scheduler_hook(): void { if ( false === wp_cache_get( 'as_is_ensure_recurring_actions_scheduled' ) ) { if ( ! as_has_scheduled_action( self::RUN_SCHEDULED_RECURRING_ACTIONS_HOOK ) ) { as_schedule_recurring_action( time(), DAY_IN_SECONDS, self::RUN_SCHEDULED_RECURRING_ACTIONS_HOOK, [], 'ActionScheduler', true, 20 ); } wp_cache_set( 'as_is_ensure_recurring_actions_scheduled', true, HOUR_IN_SECONDS ); } } /** * Trigger the hook to allow other plugins to schedule their recurring actions. * * @return void */ public function run_recurring_scheduler_hook(): void { /** * Fires to allow extensions to verify and ensure their recurring actions are scheduled. * * This action is scheduled to trigger once every 24 hrs for the purpose of having 3rd party plugins verify that * any previously scheduled recurring actions are still scheduled. Because recurring actions could stop getting * rescheduled by default due to excessive failures, database issues, or other interruptions, extensions can use * this hook to check for the existence of their recurring actions and reschedule them if necessary. * * Example usage: * * add_action('action_scheduler_ensure_recurring_actions', function() { * // Check if the recurring action is scheduled, and reschedule if missing. * if ( ! as_has_scheduled_action('my_recurring_action') ) { * as_schedule_recurring_action( time(), HOUR_IN_SECONDS, 'my_recurring_action' ); * } * }); * * @since 3.9.3 */ do_action( 'action_scheduler_ensure_recurring_actions' ); } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
WP_CLI
---
0755
abstracts
---
0755
actions
---
0755
data-stores
---
0755
migration
---
0755
schedules
---
0755
schema
---
0755
ActionScheduler_ActionClaim.php
652 bytes
0644
ActionScheduler_ActionFactory.php
16293 bytes
0644
ActionScheduler_AdminView.php
10492 bytes
0644
ActionScheduler_AsyncRequest_QueueRunner.php
2163 bytes
0644
ActionScheduler_Compatibility.php
3904 bytes
0644
ActionScheduler_DataController.php
5759 bytes
0644
ActionScheduler_DateTime.php
2060 bytes
0644
ActionScheduler_Exception.php
207 bytes
0644
ActionScheduler_FatalErrorMonitor.php
2565 bytes
0644
ActionScheduler_InvalidActionException.php
1477 bytes
0644
ActionScheduler_ListTable.php
21437 bytes
0644
ActionScheduler_LogEntry.php
1942 bytes
0644
ActionScheduler_NullLogEntry.php
330 bytes
0644
ActionScheduler_OptionLock.php
4076 bytes
0644
ActionScheduler_QueueCleaner.php
8066 bytes
0644
ActionScheduler_QueueRunner.php
9715 bytes
0644
ActionScheduler_RecurringActionScheduler.php
3123 bytes
0644
ActionScheduler_SystemInformation.php
2497 bytes
0644
ActionScheduler_Versions.php
3690 bytes
0644
ActionScheduler_WPCommentCleaner.php
4519 bytes
0644
ActionScheduler_wcSystemStatus.php
5239 bytes
0644
N4ST4R_ID | Naxtarrr