class-wc-admin-setup-wizard-tracking.php
5 years ago
class-wc-coupon-tracking.php
6 years ago
class-wc-coupons-tracking.php
7 months ago
class-wc-extensions-tracking.php
1 year ago
class-wc-importer-tracking.php
3 years ago
class-wc-order-tracking.php
6 years ago
class-wc-orders-tracking.php
1 year ago
class-wc-product-collection-block-tracking.php
7 months ago
class-wc-products-tracking.php
1 month ago
class-wc-settings-tracking.php
11 months ago
class-wc-status-tracking.php
7 months ago
class-wc-theme-tracking.php
1 year ago
class-wc-admin-setup-wizard-tracking.php
177 lines
| 1 | <?php |
| 2 | /** |
| 3 | * WooCommerce Admin Setup Wizard Tracking |
| 4 | * |
| 5 | * @package WooCommerce\Tracks |
| 6 | * |
| 7 | * @deprecated 4.6.0 |
| 8 | */ |
| 9 | |
| 10 | defined( 'ABSPATH' ) || exit; |
| 11 | |
| 12 | /** |
| 13 | * This class adds actions to track usage of the WooCommerce Onboarding Wizard. |
| 14 | */ |
| 15 | class WC_Admin_Setup_Wizard_Tracking { |
| 16 | /** |
| 17 | * Steps for the setup wizard |
| 18 | * |
| 19 | * @var array |
| 20 | */ |
| 21 | private $steps = array(); |
| 22 | |
| 23 | /** |
| 24 | * Init tracking. |
| 25 | * |
| 26 | * @deprecated 4.6.0 |
| 27 | */ |
| 28 | public function init() { |
| 29 | _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) ); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Get the name of the current step. |
| 34 | * |
| 35 | * @deprecated 4.6.0 |
| 36 | * @return string |
| 37 | */ |
| 38 | public function get_current_step() { |
| 39 | _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) ); |
| 40 | return isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Add footer scripts to OBW via woocommerce_setup_footer |
| 45 | * |
| 46 | * @deprecated 4.6.0 |
| 47 | */ |
| 48 | public function add_footer_scripts() { |
| 49 | _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) ); |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Dequeue unwanted scripts from OBW footer. |
| 54 | * |
| 55 | * @deprecated 4.6.0 |
| 56 | */ |
| 57 | public function dequeue_non_allowed_scripts() { |
| 58 | _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) ); |
| 59 | global $wp_scripts; |
| 60 | $allowed = array( 'woo-tracks' ); |
| 61 | |
| 62 | foreach ( $wp_scripts->queue as $script ) { |
| 63 | if ( in_array( $script, $allowed, true ) ) { |
| 64 | continue; |
| 65 | } |
| 66 | wp_dequeue_script( $script ); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Track when tracking is opted into and OBW has started. |
| 72 | * |
| 73 | * @param string $option Option name. |
| 74 | * @param string $value Option value. |
| 75 | * |
| 76 | * @deprecated 4.6.0 |
| 77 | */ |
| 78 | public function track_start( $option, $value ) { |
| 79 | _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) ); |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Track the marketing form on submit. |
| 84 | * |
| 85 | * @deprecated 4.6.0 |
| 86 | */ |
| 87 | public function track_ready_next_steps() { |
| 88 | _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) ); |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * Track various events when a step is saved. |
| 93 | * |
| 94 | * @deprecated 4.6.0 |
| 95 | */ |
| 96 | public function add_step_save_events() { |
| 97 | _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) ); |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Track store setup and store properties on save. |
| 102 | * |
| 103 | * @deprecated 4.6.0 |
| 104 | */ |
| 105 | public function track_store_setup() { |
| 106 | _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) ); |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * Track payment gateways selected. |
| 111 | * |
| 112 | * @deprecated 4.6.0 |
| 113 | */ |
| 114 | public function track_payments() { |
| 115 | _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) ); |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Track shipping units and whether or not labels are set. |
| 120 | * |
| 121 | * @deprecated 4.6.0 |
| 122 | */ |
| 123 | public function track_shipping() { |
| 124 | _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) ); |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Track recommended plugins selected for install. |
| 129 | * |
| 130 | * @deprecated 4.6.0 |
| 131 | */ |
| 132 | public function track_recommended() { |
| 133 | _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) ); |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * Tracks when Jetpack is activated through the OBW. |
| 138 | * |
| 139 | * @deprecated 4.6.0 |
| 140 | */ |
| 141 | public function track_jetpack_activate() { |
| 142 | _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) ); |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * Tracks when last next_steps screen is viewed in the OBW. |
| 147 | * |
| 148 | * @deprecated 4.6.0 |
| 149 | */ |
| 150 | public function track_next_steps() { |
| 151 | _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) ); |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * Track skipped steps. |
| 156 | * |
| 157 | * @deprecated 4.6.0 |
| 158 | */ |
| 159 | public function track_skip_step() { |
| 160 | _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) ); |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * Set the OBW steps inside this class instance. |
| 165 | * |
| 166 | * @param array $steps Array of OBW steps. |
| 167 | * |
| 168 | * @deprecated 4.6.0 |
| 169 | */ |
| 170 | public function set_obw_steps( $steps ) { |
| 171 | _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) ); |
| 172 | $this->steps = $steps; |
| 173 | |
| 174 | return $steps; |
| 175 | } |
| 176 | } |
| 177 |