woocommerce/includes/tracks/events/class-wc-admin-setup-wizard...

177 lines
4.8 KiB
PHP
Raw Normal View History

<?php
/**
* WooCommerce Admin Setup Wizard Tracking
*
* @package WooCommerce\Tracks
2020-06-23 18:29:58 +00:00
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
*/
defined( 'ABSPATH' ) || exit;
/**
* This class adds actions to track usage of the WooCommerce Onboarding Wizard.
*/
class WC_Admin_Setup_Wizard_Tracking {
/**
* Steps for the setup wizard
*
* @var array
*/
private $steps = array();
/**
* Init tracking.
2020-06-23 18:29:58 +00:00
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
*/
public function init() {
2020-08-13 17:46:12 +00:00
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.5.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
}
/**
* Get the name of the current step.
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
* @return string
*/
public function get_current_step() {
2020-08-13 17:46:12 +00:00
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.5.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
return isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
}
2019-02-28 09:41:15 +00:00
/**
* Add footer scripts to OBW via woocommerce_setup_footer
2020-06-23 18:29:58 +00:00
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
2019-02-28 09:41:15 +00:00
*/
public function add_footer_scripts() {
2020-08-13 17:46:12 +00:00
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.5.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
2019-02-28 09:41:15 +00:00
}
2019-03-01 03:24:02 +00:00
/**
* Dequeue unwanted scripts from OBW footer.
2020-06-23 18:29:58 +00:00
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
2019-03-01 03:24:02 +00:00
*/
2020-08-25 21:03:03 +00:00
public function dequeue_non_allowed_scripts() {
2020-08-13 17:46:12 +00:00
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.5.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
2019-03-01 03:24:02 +00:00
global $wp_scripts;
2020-08-25 21:03:03 +00:00
$allowed = array( 'woo-tracks' );
2019-03-01 03:24:02 +00:00
foreach ( $wp_scripts->queue as $script ) {
2020-08-25 21:03:03 +00:00
if ( in_array( $script, $allowed, true ) ) {
2019-03-01 03:24:02 +00:00
continue;
}
wp_dequeue_script( $script );
}
}
/**
* Track when tracking is opted into and OBW has started.
*
* @param string $option Option name.
* @param string $value Option value.
2020-06-23 18:29:58 +00:00
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
*/
public function track_start( $option, $value ) {
2020-08-13 17:46:12 +00:00
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.5.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
}
/**
* Track the marketing form on submit.
2020-06-23 18:29:58 +00:00
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
*/
2019-02-28 09:41:15 +00:00
public function track_ready_next_steps() {
2020-08-13 17:46:12 +00:00
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.5.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
}
/**
* Track various events when a step is saved.
2020-06-23 18:29:58 +00:00
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
*/
public function add_step_save_events() {
2020-08-13 17:46:12 +00:00
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.5.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
}
/**
* Track store setup and store properties on save.
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
*/
public function track_store_setup() {
2020-08-13 17:46:12 +00:00
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.5.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
}
/**
* Track payment gateways selected.
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
*/
public function track_payments() {
2020-08-13 17:46:12 +00:00
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.5.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
}
/**
* Track shipping units and whether or not labels are set.
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
*/
public function track_shipping() {
2020-08-13 17:46:12 +00:00
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.5.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
}
/**
* Track recommended plugins selected for install.
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
*/
public function track_recommended() {
2020-08-13 17:46:12 +00:00
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.5.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
}
/**
* Tracks when Jetpack is activated through the OBW.
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
*/
public function track_jetpack_activate() {
2020-08-13 17:46:12 +00:00
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.5.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
}
/**
* Tracks when last next_steps screen is viewed in the OBW.
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
*/
public function track_next_steps() {
2020-08-13 17:46:12 +00:00
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.5.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
}
/**
* Track skipped steps.
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
*/
public function track_skip_step() {
2020-08-13 17:46:12 +00:00
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.5.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
}
/**
* Set the OBW steps inside this class instance.
*
* @param array $steps Array of OBW steps.
2020-06-23 18:29:58 +00:00
*
2020-08-13 17:46:12 +00:00
* @deprecated 4.5.0
*/
public function set_obw_steps( $steps ) {
2020-08-13 17:46:12 +00:00
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.5.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
$this->steps = $steps;
return $steps;
}
}