API
5 years ago
DateTimeProvider
5 years ago
Features
5 years ago
Marketing
5 years ago
Notes
5 years ago
Overrides
5 years ago
PluginsProvider
5 years ago
RemoteInboxNotifications
5 years ago
Schedulers
5 years ago
CategoryLookup.php
5 years ago
Events.php
5 years ago
FeaturePlugin.php
5 years ago
Install.php
5 years ago
Loader.php
5 years ago
Package.php
5 years ago
PageController.php
5 years ago
PluginsHelper.php
5 years ago
ReportCSVEmail.php
5 years ago
ReportCSVExporter.php
5 years ago
ReportExporter.php
5 years ago
ReportsSync.php
5 years ago
Events.php
115 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Handle cron events. |
| 4 | * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin. |
| 5 | */ |
| 6 | |
| 7 | namespace Automattic\WooCommerce\Admin; |
| 8 | |
| 9 | defined( 'ABSPATH' ) || exit; |
| 10 | |
| 11 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Choose_Niche; |
| 12 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Giving_Feedback_Notes; |
| 13 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Mobile_App; |
| 14 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_New_Sales_Record; |
| 15 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Tracking_Opt_In; |
| 16 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Onboarding_Email_Marketing; |
| 17 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Onboarding_Payments; |
| 18 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Personalize_Store; |
| 19 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_EU_VAT_Number; |
| 20 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_WooCommerce_Payments; |
| 21 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Marketing; |
| 22 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Start_Dropshipping_Business; |
| 23 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_WooCommerce_Subscriptions; |
| 24 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Migrate_From_Shopify; |
| 25 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Launch_Checklist; |
| 26 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Real_Time_Order_Alerts; |
| 27 | use \Automattic\WooCommerce\Admin\RemoteInboxNotifications\DataSourcePoller; |
| 28 | use \Automattic\WooCommerce\Admin\RemoteInboxNotifications\RemoteInboxNotificationsEngine; |
| 29 | use \Automattic\WooCommerce\Admin\Loader; |
| 30 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Insight_First_Sale; |
| 31 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Home_Screen_Feedback; |
| 32 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Need_Some_Inspiration; |
| 33 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Learn_More_About_Product_Settings; |
| 34 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Online_Clothing_Store; |
| 35 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_First_Product; |
| 36 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Customize_Store_With_Blocks; |
| 37 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Facebook_Marketing_Expert; |
| 38 | use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Test_Checkout; |
| 39 | |
| 40 | /** |
| 41 | * WC_Admin_Events Class. |
| 42 | */ |
| 43 | class Events { |
| 44 | /** |
| 45 | * The single instance of the class. |
| 46 | * |
| 47 | * @var object |
| 48 | */ |
| 49 | protected static $instance = null; |
| 50 | |
| 51 | /** |
| 52 | * Constructor |
| 53 | * |
| 54 | * @return void |
| 55 | */ |
| 56 | protected function __construct() {} |
| 57 | |
| 58 | /** |
| 59 | * Get class instance. |
| 60 | * |
| 61 | * @return object Instance. |
| 62 | */ |
| 63 | final public static function instance() { |
| 64 | if ( null === static::$instance ) { |
| 65 | static::$instance = new static(); |
| 66 | } |
| 67 | return static::$instance; |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Cron event handlers. |
| 72 | */ |
| 73 | public function init() { |
| 74 | add_action( 'wc_admin_daily', array( $this, 'do_wc_admin_daily' ) ); |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Daily events to run. |
| 79 | * |
| 80 | * Note: WC_Admin_Notes_Order_Milestones::other_milestones is hooked to this as well. |
| 81 | */ |
| 82 | public function do_wc_admin_daily() { |
| 83 | WC_Admin_Notes_New_Sales_Record::possibly_add_note(); |
| 84 | WC_Admin_Notes_Mobile_App::possibly_add_note(); |
| 85 | WC_Admin_Notes_Tracking_Opt_In::possibly_add_note(); |
| 86 | WC_Admin_Notes_Onboarding_Email_Marketing::possibly_add_note(); |
| 87 | WC_Admin_Notes_Onboarding_Payments::possibly_add_note(); |
| 88 | WC_Admin_Notes_Personalize_Store::possibly_add_note(); |
| 89 | WC_Admin_Notes_WooCommerce_Payments::possibly_add_note(); |
| 90 | WC_Admin_Notes_EU_VAT_Number::possibly_add_note(); |
| 91 | WC_Admin_Notes_Marketing::possibly_add_note(); |
| 92 | WC_Admin_Notes_Giving_Feedback_Notes::possibly_add_note(); |
| 93 | WC_Admin_Notes_Start_Dropshipping_Business::possibly_add_note(); |
| 94 | WC_Admin_Notes_WooCommerce_Subscriptions::possibly_add_note(); |
| 95 | WC_Admin_Notes_Migrate_From_Shopify::possibly_add_note(); |
| 96 | WC_Admin_Notes_Insight_First_Sale::possibly_add_note(); |
| 97 | WC_Admin_Notes_Launch_Checklist::possibly_add_note(); |
| 98 | WC_Admin_Notes_Home_Screen_Feedback::possibly_add_note(); |
| 99 | WC_Admin_Notes_Need_Some_Inspiration::possibly_add_note(); |
| 100 | WC_Admin_Notes_Learn_More_About_Product_Settings::possibly_add_note(); |
| 101 | WC_Admin_Notes_Online_Clothing_Store::possibly_add_note(); |
| 102 | WC_Admin_Notes_First_Product::possibly_add_note(); |
| 103 | WC_Admin_Notes_Choose_Niche::possibly_add_note(); |
| 104 | WC_Admin_Notes_Real_Time_Order_Alerts::possibly_add_note(); |
| 105 | WC_Admin_Notes_Customize_Store_With_Blocks::possibly_add_note(); |
| 106 | WC_Admin_Notes_Facebook_Marketing_Expert::possibly_add_note(); |
| 107 | WC_Admin_Notes_Test_Checkout::possibly_add_note(); |
| 108 | |
| 109 | if ( Loader::is_feature_enabled( 'remote-inbox-notifications' ) ) { |
| 110 | DataSourcePoller::read_specs_from_data_sources(); |
| 111 | RemoteInboxNotificationsEngine::run(); |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 |