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