@@ -150,32 +150,32 @@ discard block |
||
150 | 150 | 'copytoclip' => esc_html__( 'Copy to Clipboard', 'google-analytics-for-wordpress' ), |
151 | 151 | 'failed' => esc_html__( 'Failed!', 'google-analytics-for-wordpress' ), |
152 | 152 | 'admin_nonce' => wp_create_nonce( 'mi-admin-nonce' ), |
153 | - 'shorten' => esc_html__( 'Shorten URL' ,'google-analytics-for-wordpress'), |
|
154 | - 'shortened' => esc_html__( 'Shortened!' ,'google-analytics-for-wordpress'), |
|
155 | - 'working' => esc_html__( 'Working...' ,'google-analytics-for-wordpress'), |
|
156 | - 'importtext' => esc_html__( 'Import' ,'google-analytics-for-wordpress'), |
|
157 | - 'imported' => esc_html__( 'Imported!' ,'google-analytics-for-wordpress'), |
|
158 | - 'redirect_loading_title_text' => esc_html__( 'Preparing to redirect:' ,'google-analytics-for-wordpress'), |
|
159 | - 'redirect_loading_text_text' => esc_html__( "You'll be redirected momentarily to complete authentication. This may take a couple seconds." ,'google-analytics-for-wordpress'), |
|
160 | - 'redirect_loading_error_title' => esc_html__( "Authentication Error:" ,'google-analytics-for-wordpress'), |
|
161 | - 'deauth_loading_title_text' => esc_html__( 'Deauthenticating....' ,'google-analytics-for-wordpress'), |
|
162 | - 'deauth_loading_text_text' => esc_html__( "We're deactivating your site. This may take a couple seconds." ,'google-analytics-for-wordpress'), |
|
163 | - 'deauth_loading_error_title' => esc_html__( "Deactivation Error:" ,'google-analytics-for-wordpress'), |
|
164 | - 'deauth_success_title_text' => esc_html__( 'Deactivated Successfully!' ,'google-analytics-for-wordpress'), |
|
165 | - 'deauth_success_text_text' => esc_html__( "You've disconnected your site from MonsterInsights. Your site is no longer being tracked by Google Analytics and you won't see reports anymore." ,'google-analytics-for-wordpress'), |
|
166 | - 'verify_loading_title_text' => esc_html__( 'Verifying....' ,'google-analytics-for-wordpress'), |
|
167 | - 'verify_loading_text_text' => esc_html__( "We're verifying your site. This may take a couple seconds." ,'google-analytics-for-wordpress'), |
|
168 | - 'verify_loading_error_title' => esc_html__( "Verification Error:" ,'google-analytics-for-wordpress'), |
|
169 | - 'verify_success_title_text' => esc_html__( 'Verified Successfully!' ,'google-analytics-for-wordpress'), |
|
170 | - 'verify_success_text_text' => esc_html__( "Your site is connected to MonsterInsights!" ,'google-analytics-for-wordpress'), |
|
171 | - 'ok_text' => esc_html__( "OK" ,'google-analytics-for-wordpress'), |
|
172 | - 'force_deauth_button_text' => esc_html__( "Force Deauthenticate" ,'google-analytics-for-wordpress'), |
|
153 | + 'shorten' => esc_html__( 'Shorten URL', 'google-analytics-for-wordpress' ), |
|
154 | + 'shortened' => esc_html__( 'Shortened!', 'google-analytics-for-wordpress' ), |
|
155 | + 'working' => esc_html__( 'Working...', 'google-analytics-for-wordpress' ), |
|
156 | + 'importtext' => esc_html__( 'Import', 'google-analytics-for-wordpress' ), |
|
157 | + 'imported' => esc_html__( 'Imported!', 'google-analytics-for-wordpress' ), |
|
158 | + 'redirect_loading_title_text' => esc_html__( 'Preparing to redirect:', 'google-analytics-for-wordpress' ), |
|
159 | + 'redirect_loading_text_text' => esc_html__( "You'll be redirected momentarily to complete authentication. This may take a couple seconds.", 'google-analytics-for-wordpress' ), |
|
160 | + 'redirect_loading_error_title' => esc_html__( "Authentication Error:", 'google-analytics-for-wordpress' ), |
|
161 | + 'deauth_loading_title_text' => esc_html__( 'Deauthenticating....', 'google-analytics-for-wordpress' ), |
|
162 | + 'deauth_loading_text_text' => esc_html__( "We're deactivating your site. This may take a couple seconds.", 'google-analytics-for-wordpress' ), |
|
163 | + 'deauth_loading_error_title' => esc_html__( "Deactivation Error:", 'google-analytics-for-wordpress' ), |
|
164 | + 'deauth_success_title_text' => esc_html__( 'Deactivated Successfully!', 'google-analytics-for-wordpress' ), |
|
165 | + 'deauth_success_text_text' => esc_html__( "You've disconnected your site from MonsterInsights. Your site is no longer being tracked by Google Analytics and you won't see reports anymore.", 'google-analytics-for-wordpress' ), |
|
166 | + 'verify_loading_title_text' => esc_html__( 'Verifying....', 'google-analytics-for-wordpress' ), |
|
167 | + 'verify_loading_text_text' => esc_html__( "We're verifying your site. This may take a couple seconds.", 'google-analytics-for-wordpress' ), |
|
168 | + 'verify_loading_error_title' => esc_html__( "Verification Error:", 'google-analytics-for-wordpress' ), |
|
169 | + 'verify_success_title_text' => esc_html__( 'Verified Successfully!', 'google-analytics-for-wordpress' ), |
|
170 | + 'verify_success_text_text' => esc_html__( "Your site is connected to MonsterInsights!", 'google-analytics-for-wordpress' ), |
|
171 | + 'ok_text' => esc_html__( "OK", 'google-analytics-for-wordpress' ), |
|
172 | + 'force_deauth_button_text' => esc_html__( "Force Deauthenticate", 'google-analytics-for-wordpress' ), |
|
173 | 173 | 'refresh_report_title' => esc_html__( 'Refreshing Report', 'google-analytics-for-wordpress' ), |
174 | 174 | 'refresh_report_text' => esc_html__( 'Loading new report data...', 'google-analytics-for-wordpress' ), |
175 | 175 | 'refresh_report_success_text' => esc_html__( 'Success', 'google-analytics-for-wordpress' ), |
176 | 176 | 'refresh_report_success_text' => esc_html__( 'Retrieved the new report data successfully', 'google-analytics-for-wordpress' ), |
177 | 177 | 'refresh_report_failure_title' => esc_html__( 'Error', 'google-analytics-for-wordpress' ), |
178 | - 'timezone' => date('e'), |
|
178 | + 'timezone' => date( 'e' ), |
|
179 | 179 | ) |
180 | 180 | ); |
181 | 181 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | 'kad_admin_js', // Pinnacle theme |
231 | 231 | 'dt-chart', // DesignThemes core features plugin |
232 | 232 | 'tweeetshare_font_script', // TweetShare - Click To Tweet |
233 | - 'tweeetshare_jquery_script', // TweetShare - Click To Tweet |
|
233 | + 'tweeetshare_jquery_script', // TweetShare - Click To Tweet |
|
234 | 234 | 'tweeetshare_jqueryui_script', // TweetShare - Click To Tweet |
235 | 235 | 'tweeetshare_custom_script', // TweetShare - Click To Tweet |
236 | 236 | 'imagify-promise-polyfill', // Imagify |
@@ -249,16 +249,16 @@ discard block |
||
249 | 249 | 'rml-modal', // WP Real Media Library |
250 | 250 | 'rml-order', // WP Real Media Library |
251 | 251 | 'rml-meta', // WP Real Media Library |
252 | - 'rml-uploader', // WP Real Media Library |
|
253 | - 'rml-options', // WP Real Media Library |
|
254 | - 'rml-usersettings', // WP Real Media Library |
|
252 | + 'rml-uploader', // WP Real Media Library |
|
253 | + 'rml-options', // WP Real Media Library |
|
254 | + 'rml-usersettings', // WP Real Media Library |
|
255 | 255 | 'rml-main', // WP Real Media Library |
256 | 256 | 'control-panel-sweet-alert', // Ken Theme |
257 | 257 | 'sweet-alert-js', // Vitrine Theme |
258 | 258 | 'theme-admin-script', // Vitrine Theme |
259 | 259 | 'sweetalert', // Church Suite Theme by Webnus |
260 | 260 | 'be_alerts_charts', // WooCommerce bolder product alerts |
261 | - 'magayo-lottery-results', // Magayo Lottery Results |
|
261 | + 'magayo-lottery-results', // Magayo Lottery Results |
|
262 | 262 | 'control-panel-sweet-alert', // Ken Theme |
263 | 263 | 'cpm_chart', // WP Project Manager |
264 | 264 | 'adminscripts', // Artisan Nayma Theme |
@@ -306,15 +306,15 @@ discard block |
||
306 | 306 | |
307 | 307 | global $wp_styles; |
308 | 308 | foreach ( $wp_styles->queue as $handle ) { |
309 | - if ( strpos( $wp_styles->registered[$handle]->src, 'wp-content') === false ) { |
|
309 | + if ( strpos( $wp_styles->registered[$handle]->src, 'wp-content' ) === false ) { |
|
310 | 310 | return; |
311 | 311 | } |
312 | 312 | |
313 | - if ( strpos( $wp_styles->registered[$handle]->handle, 'monsterinsights') !== false ) { |
|
313 | + if ( strpos( $wp_styles->registered[$handle]->handle, 'monsterinsights' ) !== false ) { |
|
314 | 314 | return; |
315 | 315 | } |
316 | 316 | |
317 | - foreach( $third_party as $partial ) { |
|
317 | + foreach ( $third_party as $partial ) { |
|
318 | 318 | if ( strpos( $wp_styles->registered[$handle]->handle, $partial ) !== false ) { |
319 | 319 | wp_dequeue_style( $handle ); // Remove css file from MI screen |
320 | 320 | wp_deregister_style( $handle ); |
@@ -329,15 +329,15 @@ discard block |
||
329 | 329 | |
330 | 330 | global $wp_scripts; |
331 | 331 | foreach ( $wp_scripts->queue as $handle ) { |
332 | - if ( strpos( $wp_scripts->registered[$handle]->src, 'wp-content') === false ) { |
|
332 | + if ( strpos( $wp_scripts->registered[$handle]->src, 'wp-content' ) === false ) { |
|
333 | 333 | return; |
334 | 334 | } |
335 | 335 | |
336 | - if ( strpos( $wp_scripts->registered[$handle]->handle, 'monsterinsights') !== false ) { |
|
336 | + if ( strpos( $wp_scripts->registered[$handle]->handle, 'monsterinsights' ) !== false ) { |
|
337 | 337 | return; |
338 | 338 | } |
339 | 339 | |
340 | - foreach( $third_party as $partial ) { |
|
340 | + foreach ( $third_party as $partial ) { |
|
341 | 341 | if ( strpos( $wp_scripts->registered[$handle]->handle, $partial ) !== false ) { |
342 | 342 | wp_dequeue_script( $handle ); // Remove JS file from MI screen |
343 | 343 | wp_deregister_script( $handle ); |
@@ -352,13 +352,13 @@ discard block |
||
352 | 352 | |
353 | 353 | // Remove actions from themes that are not following best practices and break the admin doing so |
354 | 354 | // Theme: Newspaper by tagDiv |
355 | - remove_action('admin_enqueue_scripts', 'load_wp_admin_js'); |
|
356 | - remove_action('admin_enqueue_scripts', 'load_wp_admin_css'); |
|
357 | - remove_action('admin_print_scripts-widgets.php', 'td_on_admin_print_scripts_farbtastic'); |
|
358 | - remove_action('admin_print_styles-widgets.php', 'td_on_admin_print_styles_farbtastic'); |
|
359 | - remove_action('admin_print_footer_scripts', 'check_if_media_uploads_is_loaded', 9999); |
|
360 | - remove_action('print_media_templates', 'td_custom_gallery_settings_hook'); |
|
361 | - remove_action('print_media_templates', 'td_change_backbone_js_hook'); |
|
355 | + remove_action( 'admin_enqueue_scripts', 'load_wp_admin_js' ); |
|
356 | + remove_action( 'admin_enqueue_scripts', 'load_wp_admin_css' ); |
|
357 | + remove_action( 'admin_print_scripts-widgets.php', 'td_on_admin_print_scripts_farbtastic' ); |
|
358 | + remove_action( 'admin_print_styles-widgets.php', 'td_on_admin_print_styles_farbtastic' ); |
|
359 | + remove_action( 'admin_print_footer_scripts', 'check_if_media_uploads_is_loaded', 9999 ); |
|
360 | + remove_action( 'print_media_templates', 'td_custom_gallery_settings_hook' ); |
|
361 | + remove_action( 'print_media_templates', 'td_change_backbone_js_hook' ); |
|
362 | 362 | } |
363 | 363 | add_action( 'admin_enqueue_scripts', 'monsterinsights_remove_conflicting_asset_files', 9999 ); |
364 | 364 | |
@@ -370,65 +370,65 @@ discard block |
||
370 | 370 | * |
371 | 371 | * @return null Return early if not on the proper screen. |
372 | 372 | */ |
373 | -function hide_non_monsterinsights_warnings () { |
|
373 | +function hide_non_monsterinsights_warnings() { |
|
374 | 374 | // Bail if we're not on a MonsterInsights screen. |
375 | 375 | if ( empty( $_REQUEST['page'] ) || strpos( $_REQUEST['page'], 'monsterinsights' ) === false ) { |
376 | 376 | return; |
377 | 377 | } |
378 | 378 | |
379 | 379 | global $wp_filter; |
380 | - if ( !empty( $wp_filter['user_admin_notices']->callbacks ) && is_array( $wp_filter['user_admin_notices']->callbacks ) ) { |
|
381 | - foreach( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) { |
|
380 | + if ( ! empty( $wp_filter['user_admin_notices']->callbacks ) && is_array( $wp_filter['user_admin_notices']->callbacks ) ) { |
|
381 | + foreach ( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) { |
|
382 | 382 | foreach ( $hooks as $name => $arr ) { |
383 | 383 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
384 | - unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
384 | + unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] ); |
|
385 | 385 | continue; |
386 | 386 | } |
387 | 387 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
388 | 388 | continue; |
389 | 389 | } |
390 | - if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
390 | + if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
391 | 391 | unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] ); |
392 | 392 | } |
393 | 393 | } |
394 | 394 | } |
395 | 395 | } |
396 | 396 | |
397 | - if ( !empty( $wp_filter['admin_notices']->callbacks ) && is_array( $wp_filter['admin_notices']->callbacks ) ) { |
|
398 | - foreach( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) { |
|
397 | + if ( ! empty( $wp_filter['admin_notices']->callbacks ) && is_array( $wp_filter['admin_notices']->callbacks ) ) { |
|
398 | + foreach ( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) { |
|
399 | 399 | foreach ( $hooks as $name => $arr ) { |
400 | 400 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
401 | - unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] ); |
|
401 | + unset( $wp_filter['admin_notices']->callbacks[$priority][$name] ); |
|
402 | 402 | continue; |
403 | 403 | } |
404 | 404 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
405 | 405 | continue; |
406 | 406 | } |
407 | - if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
407 | + if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
408 | 408 | unset( $wp_filter['admin_notices']->callbacks[$priority][$name] ); |
409 | 409 | } |
410 | 410 | } |
411 | 411 | } |
412 | 412 | } |
413 | 413 | |
414 | - if ( !empty( $wp_filter['all_admin_notices']->callbacks ) && is_array( $wp_filter['all_admin_notices']->callbacks ) ) { |
|
415 | - foreach( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) { |
|
414 | + if ( ! empty( $wp_filter['all_admin_notices']->callbacks ) && is_array( $wp_filter['all_admin_notices']->callbacks ) ) { |
|
415 | + foreach ( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) { |
|
416 | 416 | foreach ( $hooks as $name => $arr ) { |
417 | 417 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
418 | - unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
418 | + unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] ); |
|
419 | 419 | continue; |
420 | 420 | } |
421 | 421 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
422 | 422 | continue; |
423 | 423 | } |
424 | - if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
424 | + if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
425 | 425 | unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] ); |
426 | 426 | } |
427 | 427 | } |
428 | 428 | } |
429 | 429 | } |
430 | 430 | } |
431 | -add_action('admin_print_scripts', 'hide_non_monsterinsights_warnings'); |
|
431 | +add_action( 'admin_print_scripts', 'hide_non_monsterinsights_warnings' ); |
|
432 | 432 | |
433 | 433 | /** |
434 | 434 | * Called whenever an upgrade button / link is displayed in Lite, this function will |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | return $shareasale_id; |
490 | 490 | } |
491 | 491 | |
492 | -function monsterinsights_settings_ublock_error_js(){ |
|
492 | +function monsterinsights_settings_ublock_error_js() { |
|
493 | 493 | echo "<script type='text/javascript'>\n"; |
494 | 494 | echo "jQuery( document ).ready( function( $ ) { |
495 | 495 | if ( window.uorigindetected == null){ |
@@ -505,9 +505,9 @@ discard block |
||
505 | 505 | } |
506 | 506 | |
507 | 507 | function monsterinsights_ublock_notice() { |
508 | - ob_start();?> |
|
508 | + ob_start(); ?> |
|
509 | 509 | <div id="monsterinsights-ublock-origin-error" class="error inline" style="display:none;"> |
510 | - <?php echo sprintf( esc_html__( 'MonsterInsights has detected that it\'s files are being blocked. This is usually caused by a adblock browser plugin (particularly uBlock Origin), or a conflicting WordPress theme or plugin. This issue only affects the admin side of MonsterInsights. To solve this, ensure MonsterInsights is whitelisted for your website URL in any adblock browser plugin you use. For step by step directions on how to do this, %1$sclick here%2$s. If this doesn\'t solve the issue (rare), send us a ticket %3$shere%2$s and we\'ll be happy to help diagnose the issue.', 'google-analytics-for-wordpress'), '<a href="https://monsterinsights.com/docs/monsterinsights-asset-files-blocked/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>', '<a href="https://monsterinsights.com/contact/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">'); |
|
510 | + <?php echo sprintf( esc_html__( 'MonsterInsights has detected that it\'s files are being blocked. This is usually caused by a adblock browser plugin (particularly uBlock Origin), or a conflicting WordPress theme or plugin. This issue only affects the admin side of MonsterInsights. To solve this, ensure MonsterInsights is whitelisted for your website URL in any adblock browser plugin you use. For step by step directions on how to do this, %1$sclick here%2$s. If this doesn\'t solve the issue (rare), send us a ticket %3$shere%2$s and we\'ll be happy to help diagnose the issue.', 'google-analytics-for-wordpress' ), '<a href="https://monsterinsights.com/docs/monsterinsights-asset-files-blocked/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>', '<a href="https://monsterinsights.com/contact/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">' ); |
|
511 | 511 | ?> |
512 | 512 | </div> |
513 | 513 | <?php |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | |
99 | 99 | if ( $create && ! empty( $create ) && is_array( $create ) ) { |
100 | 100 | $create = json_encode( $create ); |
101 | - $create = str_replace( '"', "'", $create ); |
|
102 | - $options['create'] = "'create', '" . esc_js( $ua_code ). "', '" . esc_js( $domain ) . "', " . $create; |
|
101 | + $create = str_replace( '"', "'", $create ); |
|
102 | + $options['create'] = "'create', '" . esc_js( $ua_code ) . "', '" . esc_js( $domain ) . "', " . $create; |
|
103 | 103 | } else { |
104 | 104 | $options['create'] = "'create', '" . esc_js( $ua_code ) . "', '" . esc_js( $domain ) . "'"; |
105 | 105 | } |
@@ -175,21 +175,21 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function frontend_output( ) { |
177 | 177 | $options = $this->frontend_tracking_options(); |
178 | - $is_debug_mode = monsterinsights_is_debug_mode(); |
|
179 | - $src = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics.js' ); |
|
178 | + $is_debug_mode = monsterinsights_is_debug_mode(); |
|
179 | + $src = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics.js' ); |
|
180 | 180 | if ( current_user_can( 'manage_options' ) && $is_debug_mode ) { |
181 | - $src = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics_debug.js' ); |
|
181 | + $src = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics_debug.js' ); |
|
182 | 182 | } |
183 | 183 | $compat = monsterinsights_get_option( 'gatracker_compatibility_mode', false ); |
184 | - $compat = $compat ? 'window.ga = __gaTracker;' : ''; |
|
184 | + $compat = $compat ? 'window.ga = __gaTracker;' : ''; |
|
185 | 185 | $track_user = monsterinsights_track_user(); |
186 | 186 | $ua = monsterinsights_get_ua(); |
187 | 187 | $output = ''; |
188 | 188 | $reason = ''; |
189 | - $attributes = apply_filters( 'monsterinsights_tracking_analytics_script_attributes', array( 'type' => "text/javascript", 'data-cfasync' => 'false' ) ); |
|
189 | + $attributes = apply_filters( 'monsterinsights_tracking_analytics_script_attributes', array( 'type' => "text/javascript", 'data-cfasync' => 'false' ) ); |
|
190 | 190 | $attr_string = ''; |
191 | 191 | if ( ! empty( $attributes ) ) { |
192 | - foreach( $attributes as $attr_name => $attr_value ) { |
|
192 | + foreach ( $attributes as $attr_name => $attr_value ) { |
|
193 | 193 | if ( ! empty( $attr_name ) ) { |
194 | 194 | $attr_string .= ' ' . sanitize_key( $attr_name ) . '="' . esc_attr( $attr_value ) . '"'; |
195 | 195 | } else { |
@@ -203,20 +203,20 @@ discard block |
||
203 | 203 | <?php if ( ! $track_user ) { |
204 | 204 | if ( empty( $ua ) ) { |
205 | 205 | $reason = __( 'Note: MonsterInsights is not currently configured on this site. The site owner needs to authenticate with Google Analytics in the MonsterInsights settings panel.', 'google-analytics-for-wordpress' ); |
206 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
206 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
207 | 207 | } else if ( current_user_can( 'monsterinsights_save_settings' ) ) { |
208 | - $reason = __( 'Note: MonsterInsights does not track you as a logged in site administrator to prevent site owners from accidentally skewing their own Google Analytics data.'. PHP_EOL . 'If you are testing Google Analytics code, please do so either logged out or in the private browsing/incognito mode of your web browser.', 'google-analytics-for-wordpress' ); |
|
209 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
208 | + $reason = __( 'Note: MonsterInsights does not track you as a logged in site administrator to prevent site owners from accidentally skewing their own Google Analytics data.' . PHP_EOL . 'If you are testing Google Analytics code, please do so either logged out or in the private browsing/incognito mode of your web browser.', 'google-analytics-for-wordpress' ); |
|
209 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
210 | 210 | } else { |
211 | 211 | $reason = __( 'Note: The site owner has disabled Google Analytics tracking for your user role.', 'google-analytics-for-wordpress' ); |
212 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
212 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
213 | 213 | } |
214 | 214 | echo $output; |
215 | 215 | } ?> |
216 | 216 | <?php if ( $ua ) { ?> |
217 | -<script<?php echo $attr_string;?>> |
|
217 | +<script<?php echo $attr_string; ?>> |
|
218 | 218 | var mi_track_user = <?php echo ( $track_user ? 'true' : 'false' ); ?>; |
219 | - var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason) . "'": "''" ); ?>; |
|
219 | + var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason ) . "'" : "''" ); ?>; |
|
220 | 220 | <?php do_action( 'monsterinsights_tracking_analytics_frontend_output_after_mi_track_user' ); ?> |
221 | 221 | |
222 | 222 | <?php if ( $this->should_do_optout() ) { ?> |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | ?> |
265 | 265 | } else { |
266 | 266 | <?php if ( $this->should_do_optout() ) { ?> |
267 | - console.log( "<?php echo esc_js( $reason );?>" ); |
|
267 | + console.log( "<?php echo esc_js( $reason ); ?>" ); |
|
268 | 268 | (function() { |
269 | 269 | /* https://developers.google.com/analytics/devguides/collection/analyticsjs/ */ |
270 | 270 | var noopfn = function() { |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | } |
288 | 288 | var f = arguments[len-1]; |
289 | 289 | if ( typeof f !== 'object' || f === null || typeof f.hitCallback !== 'function' ) { |
290 | - console.log( '<?php echo esc_js( __("Not running function", "google-analytics-for-wordpress" ) );?> __gaTracker(' + arguments[0] + " ....) <?php echo esc_js( __( "because you are not being tracked.", 'google-analytics-for-wordpress' ) );?> " + mi_no_track_reason ); |
|
290 | + console.log( '<?php echo esc_js( __( "Not running function", "google-analytics-for-wordpress" ) ); ?> __gaTracker(' + arguments[0] + " ....) <?php echo esc_js( __( "because you are not being tracked.", 'google-analytics-for-wordpress' ) ); ?> " + mi_no_track_reason ); |
|
291 | 291 | return; |
292 | 292 | } |
293 | 293 | try { |