2019-05-14 14:33:45 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2019-05-14 22:08:13 +00:00
|
|
|
* Handle cron events.
|
2019-05-14 14:33:45 +00:00
|
|
|
* NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
|
|
|
|
*
|
|
|
|
* @package Woocommerce Admin
|
|
|
|
*/
|
|
|
|
|
2019-08-06 19:36:15 +00:00
|
|
|
namespace Automattic\WooCommerce\Admin;
|
|
|
|
|
2019-05-14 14:33:45 +00:00
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
|
2020-05-11 06:14:37 +00:00
|
|
|
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Giving_Feedback_Notes;
|
2019-08-06 19:36:15 +00:00
|
|
|
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Mobile_App;
|
|
|
|
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_New_Sales_Record;
|
2019-11-07 16:29:36 +00:00
|
|
|
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Tracking_Opt_In;
|
2019-11-13 03:25:12 +00:00
|
|
|
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Onboarding_Email_Marketing;
|
2020-05-04 11:33:11 +00:00
|
|
|
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Onboarding_Payments;
|
2020-03-26 20:07:54 +00:00
|
|
|
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Personalize_Store;
|
2020-05-28 08:52:25 +00:00
|
|
|
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_EU_VAT_Number;
|
2020-03-31 12:59:48 +00:00
|
|
|
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_WooCommerce_Payments;
|
2020-04-08 20:25:59 +00:00
|
|
|
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Marketing;
|
2020-06-10 13:32:12 +00:00
|
|
|
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Start_Dropshipping_Business;
|
2020-06-03 10:04:36 +00:00
|
|
|
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_WooCommerce_Subscriptions;
|
2020-05-31 14:52:30 +00:00
|
|
|
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Migrate_From_Shopify;
|
2020-06-05 01:51:25 +00:00
|
|
|
use \Automattic\WooCommerce\Admin\RemoteInboxNotifications\DataSourcePoller;
|
|
|
|
use \Automattic\WooCommerce\Admin\RemoteInboxNotifications\RemoteInboxNotificationsEngine;
|
|
|
|
use \Automattic\WooCommerce\Admin\Loader;
|
2019-08-06 19:36:15 +00:00
|
|
|
|
2019-05-14 14:33:45 +00:00
|
|
|
/**
|
|
|
|
* WC_Admin_Events Class.
|
|
|
|
*/
|
2019-08-12 21:52:09 +00:00
|
|
|
class Events {
|
2019-05-14 14:33:45 +00:00
|
|
|
/**
|
|
|
|
* The single instance of the class.
|
|
|
|
*
|
|
|
|
* @var object
|
|
|
|
*/
|
|
|
|
protected static $instance = null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function __construct() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get class instance.
|
|
|
|
*
|
|
|
|
* @return object Instance.
|
|
|
|
*/
|
|
|
|
final public static function instance() {
|
|
|
|
if ( null === static::$instance ) {
|
|
|
|
static::$instance = new static();
|
|
|
|
}
|
|
|
|
return static::$instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cron event handlers.
|
|
|
|
*/
|
|
|
|
public function init() {
|
2019-05-14 22:09:02 +00:00
|
|
|
add_action( 'wc_admin_daily', array( $this, 'do_wc_admin_daily' ) );
|
2019-05-14 14:33:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Daily events to run.
|
|
|
|
*
|
|
|
|
* Note: WC_Admin_Notes_Order_Milestones::other_milestones is hooked to this as well.
|
|
|
|
*/
|
2019-06-12 02:37:45 +00:00
|
|
|
public function do_wc_admin_daily() {
|
2020-05-22 13:48:40 +00:00
|
|
|
WC_Admin_Notes_New_Sales_Record::possibly_add_note();
|
|
|
|
WC_Admin_Notes_Mobile_App::possibly_add_note();
|
|
|
|
WC_Admin_Notes_Tracking_Opt_In::possibly_add_note();
|
|
|
|
WC_Admin_Notes_Onboarding_Email_Marketing::possibly_add_note();
|
|
|
|
WC_Admin_Notes_Onboarding_Payments::possibly_add_note();
|
|
|
|
WC_Admin_Notes_Personalize_Store::possibly_add_note();
|
2020-03-31 12:59:48 +00:00
|
|
|
WC_Admin_Notes_WooCommerce_Payments::possibly_add_note();
|
2020-05-28 08:52:25 +00:00
|
|
|
WC_Admin_Notes_EU_VAT_Number::possibly_add_note();
|
2020-05-22 13:48:40 +00:00
|
|
|
WC_Admin_Notes_Marketing::possibly_add_note();
|
|
|
|
WC_Admin_Notes_Giving_Feedback_Notes::possibly_add_note();
|
2020-06-10 13:32:12 +00:00
|
|
|
WC_Admin_Notes_Start_Dropshipping_Business::possibly_add_note();
|
2020-06-03 10:04:36 +00:00
|
|
|
WC_Admin_Notes_WooCommerce_Subscriptions::possibly_add_note();
|
2020-05-31 14:52:30 +00:00
|
|
|
WC_Admin_Notes_Migrate_From_Shopify::possibly_add_note();
|
2020-06-05 01:51:25 +00:00
|
|
|
|
|
|
|
if ( Loader::is_feature_enabled( 'remote-inbox-notifications' ) ) {
|
|
|
|
DataSourcePoller::read_specs_from_data_sources();
|
|
|
|
RemoteInboxNotificationsEngine::run();
|
|
|
|
}
|
2019-05-14 14:33:45 +00:00
|
|
|
}
|
|
|
|
}
|