@@ 105-125 (lines=21) @@ | ||
102 | * |
|
103 | * @since 4.4.0 |
|
104 | */ |
|
105 | public static function enqueue_banner_scripts() { |
|
106 | wp_enqueue_script( |
|
107 | 'jetpack-connection-banner-js', |
|
108 | Jetpack::get_file_url_for_environment( |
|
109 | '_inc/build/jetpack-connection-banner.min.js', |
|
110 | '_inc/jetpack-connection-banner.js' |
|
111 | ), |
|
112 | array( 'jquery' ), |
|
113 | JETPACK__VERSION, |
|
114 | true |
|
115 | ); |
|
116 | ||
117 | wp_localize_script( |
|
118 | 'jetpack-connection-banner-js', |
|
119 | 'jp_banner', |
|
120 | array( |
|
121 | 'ajax_url' => admin_url( 'admin-ajax.php' ), |
|
122 | 'connectionBannerNonce' => wp_create_nonce( 'jp-connection-banner-nonce' ), |
|
123 | ) |
|
124 | ); |
|
125 | } |
|
126 | ||
127 | /** |
|
128 | * Performs an A/B test showing or hiding the green bar at the top of the connection dialog displayed in Dashboard or Plugins. |
@@ 27-33 (lines=7) @@ | ||
24 | add_action( 'wp_login_failed', array( __CLASS__, 'track_failed_login_attempts' ) ); |
|
25 | } |
|
26 | ||
27 | static function enqueue_tracks_scripts() { |
|
28 | wp_enqueue_script( 'jptracks', plugins_url( '_inc/lib/tracks/tracks-ajax.js', JETPACK__PLUGIN_FILE ), array(), JETPACK__VERSION, true ); |
|
29 | wp_localize_script( 'jptracks', 'jpTracksAJAX', array( |
|
30 | 'ajaxurl' => admin_url( 'admin-ajax.php' ), |
|
31 | 'jpTracksAJAX_nonce' => wp_create_nonce( 'jp-tracks-ajax-nonce' ), |
|
32 | ) ); |
|
33 | } |
|
34 | ||
35 | /* User has linked their account */ |
|
36 | static function track_user_linked() { |