diff --git a/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes.php b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes.php index 2da6e6bef4b..741864e8269 100644 --- a/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes.php +++ b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes.php @@ -174,7 +174,7 @@ class WC_Admin_Notes { public static function clear_queued_actions() { $store = \ActionScheduler::store(); - if ( is_a( $store, 'WC_Admin_ActionScheduler_WPPostStore' ) ) { + if ( is_a( $store, 'Automattic\WooCommerce\Admin\WC_Admin_ActionScheduler_WPPostStore' ) ) { // If we're using our data store, call our bespoke deletion method. $action_types = array( self::UNSNOOZE_HOOK ); $store->clear_pending_wcadmin_actions( $action_types ); diff --git a/plugins/woocommerce-admin/includes/class-wc-admin-actionscheduler-wppoststore.php b/plugins/woocommerce-admin/src/WC_Admin_ActionScheduler_WPPostStore.php similarity index 86% rename from plugins/woocommerce-admin/includes/class-wc-admin-actionscheduler-wppoststore.php rename to plugins/woocommerce-admin/src/WC_Admin_ActionScheduler_WPPostStore.php index b3bfe6178d6..f2348e9b956 100644 --- a/plugins/woocommerce-admin/includes/class-wc-admin-actionscheduler-wppoststore.php +++ b/plugins/woocommerce-admin/src/WC_Admin_ActionScheduler_WPPostStore.php @@ -5,10 +5,12 @@ * @package WooCommerce Admin/Classes */ +namespace Automattic\WooCommerce\Admin; + /** * Class WC Admin Action Scheduler Store. */ -class WC_Admin_ActionScheduler_WPPostStore extends ActionScheduler_wpPostStore { +class WC_Admin_ActionScheduler_WPPostStore extends \ActionScheduler_wpPostStore { /** * Action scheduler job priority (lower numbers are claimed first). */ @@ -24,7 +26,7 @@ class WC_Admin_ActionScheduler_WPPostStore extends ActionScheduler_wpPostStore { * @param DateTime $scheduled_date Action schedule. * @return array Post data array for usage in wp_insert_post(). */ - protected function create_post_array( ActionScheduler_Action $action, DateTime $scheduled_date = null ) { + protected function create_post_array( \ActionScheduler_Action $action, \DateTime $scheduled_date = null ) { $postdata = parent::create_post_array( $action, $scheduled_date ); if ( 0 === strpos( $postdata['post_title'], 'wc-admin_' ) ) { diff --git a/plugins/woocommerce-admin/src/WC_Admin_Reports_Sync.php b/plugins/woocommerce-admin/src/WC_Admin_Reports_Sync.php index c70e9fc44c7..286640e7eba 100644 --- a/plugins/woocommerce-admin/src/WC_Admin_Reports_Sync.php +++ b/plugins/woocommerce-admin/src/WC_Admin_Reports_Sync.php @@ -209,7 +209,7 @@ class WC_Admin_Reports_Sync { public static function clear_queued_actions() { $store = \ActionScheduler::store(); - if ( is_a( $store, 'WC_Admin_ActionScheduler_WPPostStore' ) ) { + if ( is_a( $store, 'Automattic\WooCommerce\Admin\WC_Admin_ActionScheduler_WPPostStore' ) ) { // If we're using our data store, call our bespoke deletion method. $action_types = array( self::QUEUE_BATCH_ACTION, diff --git a/plugins/woocommerce-admin/tests/queue-priority.php b/plugins/woocommerce-admin/tests/queue-priority.php index c1ecf264221..4821d6b0255 100644 --- a/plugins/woocommerce-admin/tests/queue-priority.php +++ b/plugins/woocommerce-admin/tests/queue-priority.php @@ -7,6 +7,7 @@ */ use Automattic\WooCommerce\Admin\WC_Admin_Reports_Sync; +use Automattic\WooCommerce\Admin\WC_Admin_ActionScheduler_wpPostStore; /** * Reports Generation Batch Queue Prioritizaion Test Class diff --git a/plugins/woocommerce-admin/woocommerce-admin.php b/plugins/woocommerce-admin/woocommerce-admin.php index 9d64d89574b..9ae8445c79f 100755 --- a/plugins/woocommerce-admin/woocommerce-admin.php +++ b/plugins/woocommerce-admin/woocommerce-admin.php @@ -222,7 +222,7 @@ class WC_Admin_Feature_Plugin { return $store_class; } - return 'WC_Admin_ActionScheduler_WPPostStore'; + return 'Automattic\WooCommerce\Admin\WC_Admin_ActionScheduler_WPPostStore'; } /**