| @@ 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. |
|
| @@ 15-25 (lines=11) @@ | ||
| 12 | $this->product_name = $product_name; |
|
| 13 | } |
|
| 14 | ||
| 15 | static function enqueue_tracks_scripts() { |
|
| 16 | wp_enqueue_script( 'jptracks', plugins_url( '_inc/lib/tracks/tracks-ajax.js', JETPACK__PLUGIN_FILE ), array(), JETPACK__VERSION, true ); |
|
| 17 | wp_localize_script( |
|
| 18 | 'jptracks', |
|
| 19 | 'jpTracksAJAX', |
|
| 20 | array( |
|
| 21 | 'ajaxurl' => admin_url( 'admin-ajax.php' ), |
|
| 22 | 'jpTracksAJAX_nonce' => wp_create_nonce( 'jp-tracks-ajax-nonce' ), |
|
| 23 | ) |
|
| 24 | ); |
|
| 25 | } |
|
| 26 | ||
| 27 | static function record_user_event( $event_type, $data = array(), $user = null ) { |
|
| 28 | if ( ! $user ) { |
|