@@ 25-31 (lines=7) @@ | ||
22 | add_action( 'wp_login_failed', array( __CLASS__, 'track_failed_login_attempts' ) ); |
|
23 | } |
|
24 | ||
25 | static function enqueue_tracks_scripts() { |
|
26 | wp_enqueue_script( 'jptracks', plugins_url( '_inc/lib/tracks/tracks-ajax.js', JETPACK__PLUGIN_FILE ), array(), JETPACK__VERSION, true ); |
|
27 | wp_localize_script( 'jptracks', 'jpTracksAJAX', array( |
|
28 | 'ajaxurl' => admin_url( 'admin-ajax.php' ), |
|
29 | 'jpTracksAJAX_nonce' => wp_create_nonce( 'jp-tracks-ajax-nonce' ), |
|
30 | ) ); |
|
31 | } |
|
32 | ||
33 | /* User has linked their account */ |
|
34 | static function track_user_linked() { |
@@ 121-141 (lines=21) @@ | ||
118 | * |
|
119 | * @since 4.4.0 |
|
120 | */ |
|
121 | public static function enqueue_banner_scripts() { |
|
122 | wp_enqueue_script( |
|
123 | 'jetpack-connection-banner-js', |
|
124 | Jetpack::get_file_url_for_environment( |
|
125 | '_inc/build/jetpack-connection-banner.min.js', |
|
126 | '_inc/jetpack-connection-banner.js' |
|
127 | ), |
|
128 | array( 'jquery' ), |
|
129 | JETPACK__VERSION, |
|
130 | true |
|
131 | ); |
|
132 | ||
133 | wp_localize_script( |
|
134 | 'jetpack-connection-banner-js', |
|
135 | 'jp_banner', |
|
136 | array( |
|
137 | 'ajax_url' => admin_url( 'admin-ajax.php' ), |
|
138 | 'connectionBannerNonce' => wp_create_nonce( 'jp-connection-banner-nonce' ), |
|
139 | ) |
|
140 | ); |
|
141 | } |
|
142 | ||
143 | /** |
|
144 | * Performs an A/B test showing or hiding the green bar at the top of the connection dialog displayed in Dashboard or Plugins. |