plugin updates
This commit is contained in:
@@ -246,7 +246,7 @@ class ActionScheduler_ActionFactory {
|
||||
* This general purpose method can be used in place of specific methods such as async(),
|
||||
* async_unique(), single() or single_unique(), etc.
|
||||
*
|
||||
* @internal Not intended for public use, should not be overriden by subclasses.
|
||||
* @internal Not intended for public use, should not be overridden by subclasses.
|
||||
*
|
||||
* @param array $options {
|
||||
* Describes the action we wish to schedule.
|
||||
@@ -357,7 +357,7 @@ class ActionScheduler_ActionFactory {
|
||||
/**
|
||||
* Fallback to non-unique action if the store doesn't support unique actions.
|
||||
* We try to save the action as unique, accepting that there might be a race condition.
|
||||
* This is likely still better than givinig up on unique actions entirely.
|
||||
* This is likely still better than giving up on unique actions entirely.
|
||||
*/
|
||||
$existing_action_id = (int) $store->find_action(
|
||||
$action->get_hook(),
|
||||
|
||||
@@ -145,7 +145,7 @@ class ActionScheduler_AdminView extends ActionScheduler_AdminView_Deprecated {
|
||||
|
||||
# Set thresholds.
|
||||
$threshold_seconds = ( int ) apply_filters( 'action_scheduler_pastdue_actions_seconds', DAY_IN_SECONDS );
|
||||
$threshhold_min = ( int ) apply_filters( 'action_scheduler_pastdue_actions_min', 1 );
|
||||
$threshold_min = ( int ) apply_filters( 'action_scheduler_pastdue_actions_min', 1 );
|
||||
|
||||
// Set fallback value for past-due actions count.
|
||||
$num_pastdue_actions = 0;
|
||||
@@ -162,7 +162,7 @@ class ActionScheduler_AdminView extends ActionScheduler_AdminView_Deprecated {
|
||||
$query_args = array(
|
||||
'date' => as_get_datetime_object( time() - $threshold_seconds ),
|
||||
'status' => ActionScheduler_Store::STATUS_PENDING,
|
||||
'per_page' => $threshhold_min,
|
||||
'per_page' => $threshold_min,
|
||||
);
|
||||
|
||||
# If no third-party preempted, run default check.
|
||||
@@ -171,8 +171,8 @@ class ActionScheduler_AdminView extends ActionScheduler_AdminView_Deprecated {
|
||||
$num_pastdue_actions = ( int ) $store->query_actions( $query_args, 'count' );
|
||||
|
||||
# Check if past-due actions count is greater than or equal to threshold.
|
||||
$check = ( $num_pastdue_actions >= $threshhold_min );
|
||||
$check = ( bool ) apply_filters( 'action_scheduler_pastdue_actions_check', $check, $num_pastdue_actions, $threshold_seconds, $threshhold_min );
|
||||
$check = ( $num_pastdue_actions >= $threshold_min );
|
||||
$check = ( bool ) apply_filters( 'action_scheduler_pastdue_actions_check', $check, $num_pastdue_actions, $threshold_seconds, $threshold_min );
|
||||
}
|
||||
|
||||
# If check failed, set transient and abort.
|
||||
|
||||
@@ -177,7 +177,7 @@ class ActionScheduler_QueueCleaner {
|
||||
|
||||
/**
|
||||
* Mark actions that have been running for more than a given time limit as failed, based on
|
||||
* the assumption some uncatachable and unloggable fatal error occurred during processing.
|
||||
* the assumption some uncatchable and unloggable fatal error occurred during processing.
|
||||
*
|
||||
* When called by ActionScheduler_Abstract_QueueRunner::run_cleanup(), the time limit passed
|
||||
* as a parameter is 10x the time limit used for queue processing.
|
||||
|
||||
@@ -122,7 +122,7 @@ class ActionScheduler_QueueRunner extends ActionScheduler_Abstract_QueueRunner {
|
||||
* should set a context as the first parameter. For an example of this, refer to the code seen in
|
||||
* @see ActionScheduler_AsyncRequest_QueueRunner::handle()
|
||||
*
|
||||
* @param string $context Optional identifer for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron'
|
||||
* @param string $context Optional identifier for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron'
|
||||
* Generally, this should be capitalised and not localised as it's a proper noun.
|
||||
* @return int The number of actions processed.
|
||||
*/
|
||||
@@ -152,7 +152,7 @@ class ActionScheduler_QueueRunner extends ActionScheduler_Abstract_QueueRunner {
|
||||
* size is completed, or memory or time limits are reached, defined by @see $this->batch_limits_exceeded().
|
||||
*
|
||||
* @param int $size The maximum number of actions to process in the batch.
|
||||
* @param string $context Optional identifer for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron'
|
||||
* @param string $context Optional identifier for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron'
|
||||
* Generally, this should be capitalised and not localised as it's a proper noun.
|
||||
* @return int The number of actions processed.
|
||||
*/
|
||||
|
||||
@@ -455,7 +455,7 @@ abstract class ActionScheduler_Abstract_ListTable extends WP_List_Table {
|
||||
/**
|
||||
* Prepares the data to feed WP_Table_List.
|
||||
*
|
||||
* This has the core for selecting, sorting and filting data. To keep the code simple
|
||||
* This has the core for selecting, sorting and filtering data. To keep the code simple
|
||||
* its logic is split among many methods (get_items_query_*).
|
||||
*
|
||||
* Beside populating the items this function will also count all the records that matches
|
||||
@@ -544,7 +544,7 @@ abstract class ActionScheduler_Abstract_ListTable extends WP_List_Table {
|
||||
|
||||
/**
|
||||
* Set the data for displaying. It will attempt to unserialize (There is a chance that some columns
|
||||
* are serialized). This can be override in child classes for futher data transformation.
|
||||
* are serialized). This can be override in child classes for further data transformation.
|
||||
*
|
||||
* @param array $items Items array.
|
||||
*/
|
||||
@@ -645,7 +645,7 @@ abstract class ActionScheduler_Abstract_ListTable extends WP_List_Table {
|
||||
}
|
||||
|
||||
/**
|
||||
* Default column formatting, it will escape everythig for security.
|
||||
* Default column formatting, it will escape everything for security.
|
||||
*
|
||||
* @param array $item The item array.
|
||||
* @param string $column_name Column name to display.
|
||||
|
||||
@@ -44,14 +44,14 @@ abstract class ActionScheduler_Abstract_QueueRunner extends ActionScheduler_Abst
|
||||
* Process an individual action.
|
||||
*
|
||||
* @param int $action_id The action ID to process.
|
||||
* @param string $context Optional identifer for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron'
|
||||
* @param string $context Optional identifier for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron'
|
||||
* Generally, this should be capitalised and not localised as it's a proper noun.
|
||||
*/
|
||||
public function process_action( $action_id, $context = '' ) {
|
||||
// Temporarily override the error handler while we process the current action.
|
||||
set_error_handler(
|
||||
/**
|
||||
* Temporary error handler which can catch errors and convert them into exceptions. This faciliates more
|
||||
* Temporary error handler which can catch errors and convert them into exceptions. This facilitates more
|
||||
* robust error handling across all supported PHP versions.
|
||||
*
|
||||
* @throws Exception
|
||||
@@ -364,7 +364,7 @@ abstract class ActionScheduler_Abstract_QueueRunner extends ActionScheduler_Abst
|
||||
* Process actions in the queue.
|
||||
*
|
||||
* @author Jeremy Pry
|
||||
* @param string $context Optional identifer for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron'
|
||||
* @param string $context Optional identifier for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron'
|
||||
* Generally, this should be capitalised and not localised as it's a proper noun.
|
||||
* @return int The number of actions processed.
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,7 @@ abstract class ActionScheduler_Abstract_RecurringSchedule extends ActionSchedule
|
||||
protected $first_timestamp = NULL;
|
||||
|
||||
/**
|
||||
* The recurrance between each time an action is run using this schedule.
|
||||
* The recurrence between each time an action is run using this schedule.
|
||||
* Used to calculate the start date & time. Can be a number of seconds, in the
|
||||
* case of ActionScheduler_IntervalSchedule, or a cron expression, as in the
|
||||
* case of ActionScheduler_CronSchedule. Or something else.
|
||||
@@ -36,7 +36,7 @@ abstract class ActionScheduler_Abstract_RecurringSchedule extends ActionSchedule
|
||||
|
||||
/**
|
||||
* @param DateTime $date The date & time to run the action.
|
||||
* @param mixed $recurrence The data used to determine the schedule's recurrance.
|
||||
* @param mixed $recurrence The data used to determine the schedule's recurrence.
|
||||
* @param DateTime|null $first (Optional) The date & time the first instance of this interval schedule ran. Default null, meaning this is the first instance.
|
||||
*/
|
||||
public function __construct( DateTime $date, $recurrence, DateTime $first = null ) {
|
||||
|
||||
@@ -135,7 +135,7 @@ abstract class ActionScheduler_Logger {
|
||||
|
||||
/**
|
||||
* @param string $action_id
|
||||
* @param Exception|NULL $exception The exception which occured when fetching the action. NULL by default for backward compatibility.
|
||||
* @param Exception|NULL $exception The exception which occurred when fetching the action. NULL by default for backward compatibility.
|
||||
*
|
||||
* @return ActionScheduler_LogEntry[]
|
||||
*/
|
||||
|
||||
@@ -248,7 +248,7 @@ abstract class ActionScheduler_Store extends ActionScheduler_Store_Deprecated {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the time MySQL formated date/time string for an action's (next) scheduled date.
|
||||
* Get the time MySQL formatted date/time string for an action's (next) scheduled date.
|
||||
*
|
||||
* @param ActionScheduler_Action $action
|
||||
* @param DateTime $scheduled_date (optional)
|
||||
@@ -265,7 +265,7 @@ abstract class ActionScheduler_Store extends ActionScheduler_Store_Deprecated {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the time MySQL formated date/time string for an action's (next) scheduled date.
|
||||
* Get the time MySQL formatted date/time string for an action's (next) scheduled date.
|
||||
*
|
||||
* @param ActionScheduler_Action $action
|
||||
* @param DateTime $scheduled_date (optional)
|
||||
|
||||
@@ -650,7 +650,7 @@ AND `group_id` = %d
|
||||
);
|
||||
if ( false === $updated ) {
|
||||
/* translators: %s: action ID */
|
||||
throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
|
||||
throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s: we were unable to cancel this action. It may may have been deleted by another process.', 'woocommerce' ), $action_id ) );
|
||||
}
|
||||
do_action( 'action_scheduler_canceled_action', $action_id );
|
||||
}
|
||||
@@ -742,7 +742,8 @@ AND `group_id` = %d
|
||||
global $wpdb;
|
||||
$deleted = $wpdb->delete( $wpdb->actionscheduler_actions, array( 'action_id' => $action_id ), array( '%d' ) );
|
||||
if ( empty( $deleted ) ) {
|
||||
throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) ); //phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
|
||||
/* translators: %s is the action ID */
|
||||
throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s: we were unable to delete this action. It may may have been deleted by another process.', 'woocommerce' ), $action_id ) );
|
||||
}
|
||||
do_action( 'action_scheduler_deleted_action', $action_id );
|
||||
}
|
||||
@@ -773,7 +774,8 @@ AND `group_id` = %d
|
||||
global $wpdb;
|
||||
$record = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->actionscheduler_actions} WHERE action_id=%d", $action_id ) );
|
||||
if ( empty( $record ) ) {
|
||||
throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) ); //phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
|
||||
/* translators: %s is the action ID */
|
||||
throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s: we were unable to determine the date of this action. It may may have been deleted by another process.', 'woocommerce' ), $action_id ) );
|
||||
}
|
||||
if ( self::STATUS_PENDING === $record->status ) {
|
||||
return as_get_datetime_object( $record->scheduled_date_gmt );
|
||||
@@ -1083,7 +1085,8 @@ AND `group_id` = %d
|
||||
array( '%d' )
|
||||
);
|
||||
if ( empty( $updated ) ) {
|
||||
throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) ); //phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
|
||||
/* translators: %s is the action ID */
|
||||
throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s: we were unable to mark this action as having failed. It may may have been deleted by another process.', 'woocommerce' ), $action_id ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1141,7 +1144,8 @@ AND `group_id` = %d
|
||||
array( '%d' )
|
||||
);
|
||||
if ( empty( $updated ) ) {
|
||||
throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) ); //phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
|
||||
/* translators: %s is the action ID */
|
||||
throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s: we were unable to mark this action as having completed. It may may have been deleted by another process.', 'woocommerce' ), $action_id ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -512,7 +512,7 @@ class ActionScheduler_wpPostStore extends ActionScheduler_Store {
|
||||
$post = get_post( $action_id );
|
||||
if ( empty( $post ) || ( self::POST_TYPE !== $post->post_type ) ) {
|
||||
/* translators: %s is the action ID */
|
||||
throw new InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
|
||||
throw new InvalidArgumentException( sprintf( __( 'Unidentified action %s: we were unable to cancel this action. It may may have been deleted by another process.', 'woocommerce' ), $action_id ) );
|
||||
}
|
||||
do_action( 'action_scheduler_canceled_action', $action_id );
|
||||
add_filter( 'pre_wp_unique_post_slug', array( $this, 'set_unique_post_slug' ), 10, 5 );
|
||||
@@ -531,7 +531,7 @@ class ActionScheduler_wpPostStore extends ActionScheduler_Store {
|
||||
$post = get_post( $action_id );
|
||||
if ( empty( $post ) || ( self::POST_TYPE !== $post->post_type ) ) {
|
||||
/* translators: %s is the action ID */
|
||||
throw new InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
|
||||
throw new InvalidArgumentException( sprintf( __( 'Unidentified action %s: we were unable to delete this action. It may may have been deleted by another process.', 'woocommerce' ), $action_id ) );
|
||||
}
|
||||
do_action( 'action_scheduler_deleted_action', $action_id );
|
||||
|
||||
@@ -561,7 +561,7 @@ class ActionScheduler_wpPostStore extends ActionScheduler_Store {
|
||||
$post = get_post( $action_id );
|
||||
if ( empty( $post ) || ( self::POST_TYPE !== $post->post_type ) ) {
|
||||
/* translators: %s is the action ID */
|
||||
throw new InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
|
||||
throw new InvalidArgumentException( sprintf( __( 'Unidentified action %s: we were unable to determine the date of this action. It may may have been deleted by another process.', 'woocommerce' ), $action_id ) );
|
||||
}
|
||||
if ( 'publish' === $post->post_status ) {
|
||||
return as_get_datetime_object( $post->post_modified_gmt );
|
||||
@@ -984,7 +984,7 @@ class ActionScheduler_wpPostStore extends ActionScheduler_Store {
|
||||
$post = get_post( $action_id );
|
||||
if ( empty( $post ) || ( self::POST_TYPE !== $post->post_type ) ) {
|
||||
/* translators: %s is the action ID */
|
||||
throw new InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
|
||||
throw new InvalidArgumentException( sprintf( __( 'Unidentified action %s: we were unable to mark this action as having completed. It may may have been deleted by another process.', 'woocommerce' ), $action_id ) );
|
||||
}
|
||||
add_filter( 'wp_insert_post_data', array( $this, 'filter_insert_post_data' ), 10, 1 );
|
||||
add_filter( 'pre_wp_unique_post_slug', array( $this, 'set_unique_post_slug' ), 10, 5 );
|
||||
|
||||
@@ -17,7 +17,7 @@ class ActionScheduler_wpPostStore_PostTypeRegistrar {
|
||||
protected function post_type_args() {
|
||||
$args = array(
|
||||
'label' => __( 'Scheduled Actions', 'woocommerce' ),
|
||||
'description' => __( 'Scheduled actions are hooks triggered on a cetain date and time.', 'woocommerce' ),
|
||||
'description' => __( 'Scheduled actions are hooks triggered on a certain date and time.', 'woocommerce' ),
|
||||
'public' => false,
|
||||
'map_meta_cap' => true,
|
||||
'hierarchical' => false,
|
||||
|
||||
@@ -65,7 +65,7 @@ class Config {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the configured source loger.
|
||||
* Get the configured source logger.
|
||||
*
|
||||
* @return ActionScheduler_Logger
|
||||
*/
|
||||
|
||||
@@ -58,7 +58,7 @@ class ActionScheduler_CronSchedule extends ActionScheduler_Abstract_RecurringSch
|
||||
/**
|
||||
* Serialize cron schedules with data required prior to AS 3.0.0
|
||||
*
|
||||
* Prior to Action Scheduler 3.0.0, reccuring schedules used different property names to
|
||||
* Prior to Action Scheduler 3.0.0, recurring schedules used different property names to
|
||||
* refer to equivalent data. For example, ActionScheduler_IntervalSchedule::start_timestamp
|
||||
* was the same as ActionScheduler_SimpleSchedule::timestamp. Action Scheduler 3.0.0
|
||||
* aligned properties and property names for better inheritance. To guard against the
|
||||
|
||||
@@ -38,7 +38,7 @@ class ActionScheduler_IntervalSchedule extends ActionScheduler_Abstract_Recurrin
|
||||
/**
|
||||
* Serialize interval schedules with data required prior to AS 3.0.0
|
||||
*
|
||||
* Prior to Action Scheduler 3.0.0, reccuring schedules used different property names to
|
||||
* Prior to Action Scheduler 3.0.0, recurring schedules used different property names to
|
||||
* refer to equivalent data. For example, ActionScheduler_IntervalSchedule::start_timestamp
|
||||
* was the same as ActionScheduler_SimpleSchedule::timestamp. Action Scheduler 3.0.0
|
||||
* aligned properties and property names for better inheritance. To guard against the
|
||||
|
||||
Reference in New Issue
Block a user