PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.2
Jetpack – WP Security, Backup, Speed, & Growth v16.2
16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 All 502 releases
← All changes | src/class-tracking.php +10 -18 13.8.316.2 View file →
@@ -7,9 +7,8 @@
7 7
8 8 namespace Automattic\Jetpack\Plugin;
9 9
10 10 use Automattic\Jetpack\Connection\Manager as Connection_Manager;
11 -use Automattic\Jetpack\IP\Utils as IP_Utils;
12 11 use Automattic\Jetpack\Tracking as Tracks;
13 12 use IXR_Error;
14 13 use WP_Error;
15 14 use WP_User;
@@ -25,25 +24,27 @@
25 24 *
26 25 * @access private
27 26 */
28 27 private $tracking;
28 +
29 29 /**
30 - * Prevents the Tracking from being intialized more then once.
30 + * Prevents the Tracking from being initialized more than once.
31 31 *
32 32 * @var bool
33 33 */
34 - private $initalized = false;
34 + private static $initialized = false;
35 35
36 36 /**
37 37 * Initialization function.
38 38 */
39 39 public function init() {
40 - if ( $this->initalized ) {
40 + if ( static::$initialized ) {
41 41 return;
42 42 }
43 - $this->initalized = true;
44 - $this->tracking = new Tracks( 'jetpack' );
45 43
44 + static::$initialized = true;
45 + $this->tracking = new Tracks( 'jetpack' );
46 +
46 47 // For tracking stuff via js/ajax.
47 48 add_action( 'admin_enqueue_scripts', array( $this->tracking, 'enqueue_tracks_scripts' ) );
48 49
49 50 add_action( 'jetpack_activate_module', array( $this, 'jetpack_activate_module' ), 1, 1 );
@@ -48,9 +49,8 @@
48 49
49 50 add_action( 'jetpack_activate_module', array( $this, 'jetpack_activate_module' ), 1, 1 );
50 51 add_action( 'jetpack_deactivate_module', array( $this, 'jetpack_deactivate_module' ), 1, 1 );
51 52 add_action( 'jetpack_user_authorized', array( $this, 'jetpack_user_authorized' ) );
52 - add_action( 'wp_login_failed', array( $this, 'wp_login_failed' ) );
53 53
54 54 // Tracking XMLRPC server events.
55 55 add_action( 'jetpack_xmlrpc_server_event', array( $this, 'jetpack_xmlrpc_server_event' ), 10, 4 );
56 56
@@ -158,20 +158,12 @@
158 158
159 159 /**
160 160 * Track a failed login attempt.
161 161 *
162 - * @access public
163 - *
164 - * @param string $login Username or email address.
162 + * @deprecated 13.9 Method is not longer in use.
165 163 */
166 - public function wp_login_failed( $login ) {
167 - $this->tracking->record_user_event(
168 - 'failed_login',
169 - array(
170 - 'origin_ip' => IP_Utils::get_ip(),
171 - 'login' => $login,
172 - )
173 - );
164 + public function wp_login_failed() {
165 + _deprecated_function( __METHOD__, '13.9' );
174 166 }
175 167
176 168 /**
177 169 * Track a connection failure at the registration step.