@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | 'kad_admin_js', // Pinnacle theme |
354 | 354 | 'dt-chart', // DesignThemes core features plugin |
355 | 355 | 'tweeetshare_font_script', // TweetShare - Click To Tweet |
356 | - 'tweeetshare_jquery_script', // TweetShare - Click To Tweet |
|
356 | + 'tweeetshare_jquery_script', // TweetShare - Click To Tweet |
|
357 | 357 | 'tweeetshare_jqueryui_script', // TweetShare - Click To Tweet |
358 | 358 | 'tweeetshare_custom_script', // TweetShare - Click To Tweet |
359 | 359 | 'imagify-promise-polyfill', // Imagify |
@@ -372,16 +372,16 @@ discard block |
||
372 | 372 | 'rml-modal', // WP Real Media Library |
373 | 373 | 'rml-order', // WP Real Media Library |
374 | 374 | 'rml-meta', // WP Real Media Library |
375 | - 'rml-uploader', // WP Real Media Library |
|
376 | - 'rml-options', // WP Real Media Library |
|
377 | - 'rml-usersettings', // WP Real Media Library |
|
375 | + 'rml-uploader', // WP Real Media Library |
|
376 | + 'rml-options', // WP Real Media Library |
|
377 | + 'rml-usersettings', // WP Real Media Library |
|
378 | 378 | 'rml-main', // WP Real Media Library |
379 | 379 | 'control-panel-sweet-alert', // Ken Theme |
380 | 380 | 'sweet-alert-js', // Vitrine Theme |
381 | 381 | 'theme-admin-script', // Vitrine Theme |
382 | 382 | 'sweetalert', // Church Suite Theme by Webnus |
383 | 383 | 'be_alerts_charts', // WooCommerce bolder product alerts |
384 | - 'magayo-lottery-results', // Magayo Lottery Results |
|
384 | + 'magayo-lottery-results', // Magayo Lottery Results |
|
385 | 385 | 'control-panel-sweet-alert', // Ken Theme |
386 | 386 | 'cpm_chart', // WP Project Manager |
387 | 387 | 'adminscripts', // Artisan Nayma Theme |
@@ -472,20 +472,20 @@ discard block |
||
472 | 472 | |
473 | 473 | global $wp_styles; |
474 | 474 | foreach ( $wp_styles->queue as $handle ) { |
475 | - if ( strpos( $wp_styles->registered[ $handle ]->src, 'wp-content' ) === false ) { |
|
475 | + if ( strpos( $wp_styles->registered[$handle]->src, 'wp-content' ) === false ) { |
|
476 | 476 | return; |
477 | 477 | } |
478 | 478 | |
479 | - if ( strpos( $wp_styles->registered[ $handle ]->handle, 'monsterinsights' ) !== false ) { |
|
479 | + if ( strpos( $wp_styles->registered[$handle]->handle, 'monsterinsights' ) !== false ) { |
|
480 | 480 | return; |
481 | 481 | } |
482 | 482 | |
483 | 483 | foreach ( $third_party as $partial ) { |
484 | - if ( strpos( $wp_styles->registered[ $handle ]->handle, $partial ) !== false ) { |
|
484 | + if ( strpos( $wp_styles->registered[$handle]->handle, $partial ) !== false ) { |
|
485 | 485 | wp_dequeue_style( $handle ); // Remove css file from MI screen |
486 | 486 | wp_deregister_style( $handle ); |
487 | 487 | break; |
488 | - } else if ( strpos( $wp_styles->registered[ $handle ]->src, $partial ) !== false ) { |
|
488 | + } else if ( strpos( $wp_styles->registered[$handle]->src, $partial ) !== false ) { |
|
489 | 489 | wp_dequeue_style( $handle ); // Remove css file from MI screen |
490 | 490 | wp_deregister_style( $handle ); |
491 | 491 | break; |
@@ -495,20 +495,20 @@ discard block |
||
495 | 495 | |
496 | 496 | global $wp_scripts; |
497 | 497 | foreach ( $wp_scripts->queue as $handle ) { |
498 | - if ( strpos( $wp_scripts->registered[ $handle ]->src, 'wp-content' ) === false ) { |
|
498 | + if ( strpos( $wp_scripts->registered[$handle]->src, 'wp-content' ) === false ) { |
|
499 | 499 | return; |
500 | 500 | } |
501 | 501 | |
502 | - if ( strpos( $wp_scripts->registered[ $handle ]->handle, 'monsterinsights' ) !== false ) { |
|
502 | + if ( strpos( $wp_scripts->registered[$handle]->handle, 'monsterinsights' ) !== false ) { |
|
503 | 503 | return; |
504 | 504 | } |
505 | 505 | |
506 | 506 | foreach ( $third_party as $partial ) { |
507 | - if ( strpos( $wp_scripts->registered[ $handle ]->handle, $partial ) !== false ) { |
|
507 | + if ( strpos( $wp_scripts->registered[$handle]->handle, $partial ) !== false ) { |
|
508 | 508 | wp_dequeue_script( $handle ); // Remove JS file from MI screen |
509 | 509 | wp_deregister_script( $handle ); |
510 | 510 | break; |
511 | - } else if ( strpos( $wp_scripts->registered[ $handle ]->src, $partial ) !== false ) { |
|
511 | + } else if ( strpos( $wp_scripts->registered[$handle]->src, $partial ) !== false ) { |
|
512 | 512 | wp_dequeue_script( $handle ); // Remove JS file from MI screen |
513 | 513 | wp_deregister_script( $handle ); |
514 | 514 | break; |
@@ -582,14 +582,14 @@ discard block |
||
582 | 582 | foreach ( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) { |
583 | 583 | foreach ( $hooks as $name => $arr ) { |
584 | 584 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
585 | - unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
585 | + unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] ); |
|
586 | 586 | continue; |
587 | 587 | } |
588 | 588 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
589 | 589 | continue; |
590 | 590 | } |
591 | 591 | if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
592 | - unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
592 | + unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] ); |
|
593 | 593 | } |
594 | 594 | } |
595 | 595 | } |
@@ -599,14 +599,14 @@ discard block |
||
599 | 599 | foreach ( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) { |
600 | 600 | foreach ( $hooks as $name => $arr ) { |
601 | 601 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
602 | - unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] ); |
|
602 | + unset( $wp_filter['admin_notices']->callbacks[$priority][$name] ); |
|
603 | 603 | continue; |
604 | 604 | } |
605 | 605 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
606 | 606 | continue; |
607 | 607 | } |
608 | 608 | if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
609 | - unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] ); |
|
609 | + unset( $wp_filter['admin_notices']->callbacks[$priority][$name] ); |
|
610 | 610 | } |
611 | 611 | } |
612 | 612 | } |
@@ -616,14 +616,14 @@ discard block |
||
616 | 616 | foreach ( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) { |
617 | 617 | foreach ( $hooks as $name => $arr ) { |
618 | 618 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
619 | - unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
619 | + unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] ); |
|
620 | 620 | continue; |
621 | 621 | } |
622 | 622 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
623 | 623 | continue; |
624 | 624 | } |
625 | 625 | if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
626 | - unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
626 | + unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] ); |
|
627 | 627 | } |
628 | 628 | } |
629 | 629 | } |
@@ -684,10 +684,10 @@ discard block |
||
684 | 684 | // Put together redirect URL |
685 | 685 | $url = add_query_arg( |
686 | 686 | array( |
687 | - 'utm_source' => $source, // Pro/Lite Plugin |
|
688 | - 'utm_medium' => sanitize_key( $medium ), // Area of MonsterInsights (example Reports) |
|
687 | + 'utm_source' => $source, // Pro/Lite Plugin |
|
688 | + 'utm_medium' => sanitize_key( $medium ), // Area of MonsterInsights (example Reports) |
|
689 | 689 | 'utm_campaign' => sanitize_key( $campaign ), // Which link (example eCommerce Report) |
690 | - 'utm_content' => $content, // Version number of MI |
|
690 | + 'utm_content' => $content, // Version number of MI |
|
691 | 691 | ), |
692 | 692 | trailingslashit( $url ) |
693 | 693 | ); |
@@ -19,28 +19,28 @@ |
||
19 | 19 | global $admin_page_hooks; |
20 | 20 | |
21 | 21 | if ( ! is_object( $current_screen ) || empty( $current_screen->id ) || empty( $admin_page_hooks ) ) { |
22 | - return false; |
|
22 | + return false; |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | $settings_page = false; |
26 | 26 | if ( ! empty( $admin_page_hooks['monsterinsights_settings'] ) && $current_screen->id === $admin_page_hooks['monsterinsights_settings'] ) { |
27 | - $settings_page = true; |
|
27 | + $settings_page = true; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | if ( $current_screen->id === 'toplevel_page_monsterinsights_settings' ) { |
31 | - $settings_page = true; |
|
31 | + $settings_page = true; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | if ( $current_screen->id === 'insights_page_monsterinsights_settings' ) { |
35 | - $settings_page = true; |
|
35 | + $settings_page = true; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | if ( strpos( $current_screen->id, 'monsterinsights_settings' ) !== false ) { |
39 | - $settings_page = true; |
|
39 | + $settings_page = true; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | if ( ! empty( $current_screen->base ) && strpos( $current_screen->base, 'monsterinsights_network' ) !== false ) { |
43 | - $settings_page = true; |
|
43 | + $settings_page = true; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | return $settings_page; |
@@ -195,18 +195,18 @@ |
||
195 | 195 | return; |
196 | 196 | } |
197 | 197 | |
198 | - // Otherwise, our request has been done successfully. Update the option and set the success message. |
|
199 | - $option = is_network_admin() ? MonsterInsights()->license->get_network_license() : MonsterInsights()->license->get_site_license(); |
|
200 | - $option['key'] = trim( $_POST['monsterinsights-license-key'] ); |
|
201 | - $option['type'] = isset( $verify->type ) ? $verify->type : $option['type']; |
|
202 | - $option['is_expired'] = false; |
|
203 | - $option['is_disabled'] = false; |
|
204 | - $option['is_invalid'] = false; |
|
205 | - $this->success[] = isset( $verify->success ) ? $verify->success : esc_html__( 'Congratulations! This site is now receiving automatic updates.', 'google-analytics-for-wordpress' ); |
|
206 | - is_network_admin() ? MonsterInsights()->license->set_network_license( $option ) : MonsterInsights()->license->set_site_license( $option ); |
|
207 | - delete_transient( '_monsterinsights_addons' ); |
|
208 | - monsterinsights_get_addons_data( $option['key'] ); |
|
209 | - // Make sure users can now update their plugins if they previously an expired key. |
|
198 | + // Otherwise, our request has been done successfully. Update the option and set the success message. |
|
199 | + $option = is_network_admin() ? MonsterInsights()->license->get_network_license() : MonsterInsights()->license->get_site_license(); |
|
200 | + $option['key'] = trim( $_POST['monsterinsights-license-key'] ); |
|
201 | + $option['type'] = isset( $verify->type ) ? $verify->type : $option['type']; |
|
202 | + $option['is_expired'] = false; |
|
203 | + $option['is_disabled'] = false; |
|
204 | + $option['is_invalid'] = false; |
|
205 | + $this->success[] = isset( $verify->success ) ? $verify->success : esc_html__( 'Congratulations! This site is now receiving automatic updates.', 'google-analytics-for-wordpress' ); |
|
206 | + is_network_admin() ? MonsterInsights()->license->set_network_license( $option ) : MonsterInsights()->license->set_site_license( $option ); |
|
207 | + delete_transient( '_monsterinsights_addons' ); |
|
208 | + monsterinsights_get_addons_data( $option['key'] ); |
|
209 | + // Make sure users can now update their plugins if they previously an expired key. |
|
210 | 210 | wp_clean_plugins_cache( true ); |
211 | 211 | } |
212 | 212 |
@@ -87,7 +87,8 @@ |
||
87 | 87 | wp_cache_flush(); |
88 | 88 | $cachec = true; |
89 | 89 | } |
90 | - } else { // if existing install |
|
90 | + } else { |
|
91 | +// if existing install |
|
91 | 92 | if ( version_compare( $version, '6.0.11', '<' ) ) { |
92 | 93 | if ( ! $cachec ) { |
93 | 94 | wp_cache_flush(); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | // if new install or Yoast Era instal |
64 | 64 | if ( ! $version ) { |
65 | 65 | // See if from Yoast |
66 | - $yoast = get_option( 'yst_ga', false ); |
|
66 | + $yoast = get_option( 'yst_ga', false ); |
|
67 | 67 | |
68 | 68 | // In case from Yoast, start from scratch |
69 | 69 | delete_option( 'yoast-ga-access_token' ); |
@@ -297,25 +297,25 @@ discard block |
||
297 | 297 | public function v700_upgrades() { |
298 | 298 | // 1. Default all event tracking and tracking to GA + JS respectively |
299 | 299 | // 3a Set tracking_mode to use analytics.js |
300 | - $this->new_settings['tracking_mode' ] = 'analytics'; |
|
300 | + $this->new_settings['tracking_mode'] = 'analytics'; |
|
301 | 301 | |
302 | 302 | |
303 | 303 | // 3b Set events mode to use JS if the events mode is not set explicitly to none |
304 | - if ( empty( $this->new_settings['events_mode' ] ) || $this->new_settings['events_mode' ] !== 'none' ) { |
|
305 | - $this->new_settings['events_mode' ] = 'js'; |
|
304 | + if ( empty( $this->new_settings['events_mode'] ) || $this->new_settings['events_mode'] !== 'none' ) { |
|
305 | + $this->new_settings['events_mode'] = 'js'; |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | // 2. Migrate manual UA codes |
309 | 309 | // 2a Manual UA has the lowest priority |
310 | - if ( ! empty( $this->new_settings['manual_ua_code' ] ) ) { |
|
310 | + if ( ! empty( $this->new_settings['manual_ua_code'] ) ) { |
|
311 | 311 | // Set as manual UA code |
312 | - is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['manual_ua_code' ] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['manual_ua_code' ] ) ); |
|
312 | + is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['manual_ua_code'] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['manual_ua_code'] ) ); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | // 2b Then try the oAuth UA code |
316 | - if ( ! empty( $this->new_settings['analytics_profile_code' ] ) ) { |
|
316 | + if ( ! empty( $this->new_settings['analytics_profile_code'] ) ) { |
|
317 | 317 | // Set as manual UA code |
318 | - is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['analytics_profile_code' ] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['analytics_profile_code' ] ) ); |
|
318 | + is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['analytics_profile_code'] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['analytics_profile_code'] ) ); |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | // 3. Migrate License keys |
@@ -357,8 +357,8 @@ discard block |
||
357 | 357 | 'track_internal_as_label', |
358 | 358 | ); |
359 | 359 | foreach ( $settings as $setting ) { |
360 | - if ( ! empty( $this->new_settings[ $setting ] ) ) { |
|
361 | - unset( $this->new_settings[ $setting ] ); |
|
360 | + if ( ! empty( $this->new_settings[$setting] ) ) { |
|
361 | + unset( $this->new_settings[$setting] ); |
|
362 | 362 | } |
363 | 363 | } |
364 | 364 | } |
@@ -402,8 +402,8 @@ discard block |
||
402 | 402 | ); |
403 | 403 | |
404 | 404 | foreach ( $settings as $setting ) { |
405 | - if ( ! empty( $this->new_settings[ $setting ] ) ) { |
|
406 | - unset( $this->new_settings[ $setting ] ); |
|
405 | + if ( ! empty( $this->new_settings[$setting] ) ) { |
|
406 | + unset( $this->new_settings[$setting] ); |
|
407 | 407 | } |
408 | 408 | } |
409 | 409 | |
@@ -442,8 +442,8 @@ discard block |
||
442 | 442 | ); |
443 | 443 | |
444 | 444 | foreach ( $settings as $setting ) { |
445 | - if ( ! empty( $this->new_settings[ $setting ] ) ) { |
|
446 | - unset( $this->new_settings[ $setting ] ); |
|
445 | + if ( ! empty( $this->new_settings[$setting] ) ) { |
|
446 | + unset( $this->new_settings[$setting] ); |
|
447 | 447 | } |
448 | 448 | } |
449 | 449 | |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | } |
535 | 535 | preg_match( $regex, $cross_domain['domain'], $matches ); |
536 | 536 | if ( count( $matches ) > 0 ) { |
537 | - unset( $this->new_settings['cross_domains'][ $key ] ); |
|
537 | + unset( $this->new_settings['cross_domains'][$key] ); |
|
538 | 538 | } |
539 | 539 | } |
540 | 540 | } |
@@ -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 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | * @return string Javascript to output. |
174 | 174 | */ |
175 | 175 | public function frontend_output( ) { |
176 | - $options = $this->frontend_tracking_options(); |
|
176 | + $options = $this->frontend_tracking_options(); |
|
177 | 177 | $src = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics.js' ); |
178 | 178 | $compat = monsterinsights_get_option( 'gatracker_compatibility_mode', false ); |
179 | 179 | $compat = $compat ? 'window.ga = __gaTracker;' : ''; |
@@ -181,10 +181,10 @@ discard block |
||
181 | 181 | $ua = monsterinsights_get_ua(); |
182 | 182 | $output = ''; |
183 | 183 | $reason = ''; |
184 | - $attributes = apply_filters( 'monsterinsights_tracking_analytics_script_attributes', array( 'type' => "text/javascript", 'data-cfasync' => 'false' ) ); |
|
184 | + $attributes = apply_filters( 'monsterinsights_tracking_analytics_script_attributes', array( 'type' => "text/javascript", 'data-cfasync' => 'false' ) ); |
|
185 | 185 | $attr_string = ''; |
186 | 186 | if ( ! empty( $attributes ) ) { |
187 | - foreach( $attributes as $attr_name => $attr_value ) { |
|
187 | + foreach ( $attributes as $attr_name => $attr_value ) { |
|
188 | 188 | if ( ! empty( $attr_name ) ) { |
189 | 189 | $attr_string .= ' ' . sanitize_key( $attr_name ) . '="' . esc_attr( $attr_value ) . '"'; |
190 | 190 | } else { |
@@ -198,21 +198,21 @@ discard block |
||
198 | 198 | <?php if ( ! $track_user ) { |
199 | 199 | if ( empty( $ua ) ) { |
200 | 200 | $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' ); |
201 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
201 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
202 | 202 | } else if ( current_user_can( 'monsterinsights_save_settings' ) ) { |
203 | - $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' ); |
|
204 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
203 | + $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' ); |
|
204 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
205 | 205 | } else { |
206 | 206 | $reason = __( 'Note: The site owner has disabled Google Analytics tracking for your user role.', 'google-analytics-for-wordpress' ); |
207 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
207 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
208 | 208 | } |
209 | 209 | echo $output; |
210 | 210 | } ?> |
211 | 211 | <?php if ( $ua ) { ?> |
212 | -<script<?php echo $attr_string;?>> |
|
212 | +<script<?php echo $attr_string; ?>> |
|
213 | 213 | var mi_version = '<?php echo MONSTERINSIGHTS_VERSION; ?>'; |
214 | 214 | var mi_track_user = <?php echo ( $track_user ? 'true' : 'false' ); ?>; |
215 | - var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason) . "'": "''" ); ?>; |
|
215 | + var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason ) . "'" : "''" ); ?>; |
|
216 | 216 | <?php do_action( 'monsterinsights_tracking_analytics_frontend_output_after_mi_track_user' ); ?> |
217 | 217 | |
218 | 218 | <?php if ( $this->should_do_optout() ) { ?> |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | ?> |
257 | 257 | } else { |
258 | 258 | <?php if ( $this->should_do_optout() ) { ?> |
259 | - console.log( "<?php echo esc_js( $reason );?>" ); |
|
259 | + console.log( "<?php echo esc_js( $reason ); ?>" ); |
|
260 | 260 | (function() { |
261 | 261 | /* https://developers.google.com/analytics/devguides/collection/analyticsjs/ */ |
262 | 262 | var noopfn = function() { |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | } |
280 | 280 | var f = arguments[len-1]; |
281 | 281 | if ( typeof f !== 'object' || f === null || typeof f.hitCallback !== 'function' ) { |
282 | - 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 ); |
|
282 | + 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 ); |
|
283 | 283 | return; |
284 | 284 | } |
285 | 285 | try { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | if ( ! is_array( $inbound_paths ) ) { |
62 | 62 | $inbound_paths = array(); |
63 | 63 | } else { |
64 | - foreach( $inbound_paths as $index => $pair ) { |
|
64 | + foreach ( $inbound_paths as $index => $pair ) { |
|
65 | 65 | // if empty pair, unset and continue |
66 | 66 | if ( empty( $pair['path'] ) ) { |
67 | 67 | unset( $inbound_paths[$index] ); |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | $download_extensions = array( $download_extensions ); |
88 | 88 | } |
89 | 89 | $i = 0; |
90 | - foreach( $download_extensions as $extension ){ |
|
91 | - $download_extensions[ $i ] = esc_js( trim( $extension ) ); |
|
90 | + foreach ( $download_extensions as $extension ) { |
|
91 | + $download_extensions[$i] = esc_js( trim( $extension ) ); |
|
92 | 92 | $i++; |
93 | 93 | } |
94 | 94 |
@@ -87,7 +87,7 @@ |
||
87 | 87 | $download_extensions = array( $download_extensions ); |
88 | 88 | } |
89 | 89 | $i = 0; |
90 | - foreach( $download_extensions as $extension ){ |
|
90 | + foreach( $download_extensions as $extension ) { |
|
91 | 91 | $download_extensions[ $i ] = esc_js( trim( $extension ) ); |
92 | 92 | $i++; |
93 | 93 | } |
@@ -33,13 +33,13 @@ |
||
33 | 33 | $track_user = monsterinsights_track_user(); |
34 | 34 | |
35 | 35 | if ( $track_user ) { |
36 | - require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/events/class-analytics-events.php'; |
|
37 | - new MonsterInsights_Analytics_Events(); |
|
36 | + require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/events/class-analytics-events.php'; |
|
37 | + new MonsterInsights_Analytics_Events(); |
|
38 | 38 | |
39 | - // Let's run form tracking if we find it |
|
40 | - if ( function_exists( 'monsterinsights_forms_output_after_script' ) ) { |
|
41 | - monsterinsights_forms_output_after_script( array() ); |
|
42 | - } |
|
39 | + // Let's run form tracking if we find it |
|
40 | + if ( function_exists( 'monsterinsights_forms_output_after_script' ) ) { |
|
41 | + monsterinsights_forms_output_after_script( array() ); |
|
42 | + } |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | add_action( 'seedprod_monsterinsights_output_tracking', 'monsterinsights_seedprod_tracking', 6, 1 ); |
46 | 46 | \ No newline at end of file |
@@ -30,7 +30,7 @@ |
||
30 | 30 | do_action( 'monsterinsights_tracking_after_analytics' ); |
31 | 31 | do_action( 'monsterinsights_tracking_after', 'analytics' ); |
32 | 32 | |
33 | - $track_user = monsterinsights_track_user(); |
|
33 | + $track_user = monsterinsights_track_user(); |
|
34 | 34 | |
35 | 35 | if ( $track_user ) { |
36 | 36 | require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/events/class-analytics-events.php'; |
@@ -40,37 +40,37 @@ discard block |
||
40 | 40 | |
41 | 41 | // Get addons data from transient or perform API query if no transient. |
42 | 42 | if ( false === ( $addons = get_transient( '_monsterinsights_addons' ) ) ) { |
43 | - $addons = monsterinsights_get_addons_data( $key ); |
|
43 | + $addons = monsterinsights_get_addons_data( $key ); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | // If no Addons exist, return false |
47 | 47 | if ( ! $addons ) { |
48 | - return false; |
|
48 | + return false; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | // Iterate through Addons, to build two arrays: |
52 | 52 | // - Addons the user is licensed to use, |
53 | 53 | // - Addons the user isn't licensed to use. |
54 | 54 | $results = array( |
55 | - 'licensed' => array(), |
|
56 | - 'unlicensed'=> array(), |
|
55 | + 'licensed' => array(), |
|
56 | + 'unlicensed'=> array(), |
|
57 | 57 | ); |
58 | 58 | foreach ( (array) $addons as $i => $addon ) { |
59 | 59 | |
60 | - // Determine whether the user is licensed to use this Addon or not. |
|
61 | - if ( |
|
62 | - empty( $type ) || |
|
63 | - ( in_array( 'Pro', $addon->categories ) && ( $type != 'pro' && $type != 'master' ) ) || |
|
64 | - ( in_array( 'Plus', $addon->categories ) && $type != 'plus' && $type != 'pro' && $type != 'master' ) || |
|
65 | - ( in_array( 'Basic', $addon->categories ) && ( $type != 'basic' && $type != 'plus' && $type != 'pro' && $type != 'master' ) ) |
|
66 | - ) { |
|
67 | - // Unlicensed |
|
68 | - $results['unlicensed'][] = $addon; |
|
69 | - continue; |
|
70 | - } |
|
71 | - |
|
72 | - // Licensed |
|
73 | - $results['licensed'][] = $addon; |
|
60 | + // Determine whether the user is licensed to use this Addon or not. |
|
61 | + if ( |
|
62 | + empty( $type ) || |
|
63 | + ( in_array( 'Pro', $addon->categories ) && ( $type != 'pro' && $type != 'master' ) ) || |
|
64 | + ( in_array( 'Plus', $addon->categories ) && $type != 'plus' && $type != 'pro' && $type != 'master' ) || |
|
65 | + ( in_array( 'Basic', $addon->categories ) && ( $type != 'basic' && $type != 'plus' && $type != 'pro' && $type != 'master' ) ) |
|
66 | + ) { |
|
67 | + // Unlicensed |
|
68 | + $results['unlicensed'][] = $addon; |
|
69 | + continue; |
|
70 | + } |
|
71 | + |
|
72 | + // Licensed |
|
73 | + $results['licensed'][] = $addon; |
|
74 | 74 | |
75 | 75 | } |
76 | 76 | |
@@ -93,21 +93,21 @@ discard block |
||
93 | 93 | // Get Addons |
94 | 94 | // If the key is valid, we'll get personalised upgrade URLs for each Addon (if necessary) and plugin update information. |
95 | 95 | if ( $key ) { |
96 | - $addons = MonsterInsights()->license_actions->perform_remote_request( 'get-addons-data-v600', array( 'tgm-updater-key' => $key ) ); |
|
96 | + $addons = MonsterInsights()->license_actions->perform_remote_request( 'get-addons-data-v600', array( 'tgm-updater-key' => $key ) ); |
|
97 | 97 | } else { |
98 | - $addons = MonsterInsights()->license_actions->perform_remote_request( 'get-all-addons-data', array() ); |
|
98 | + $addons = MonsterInsights()->license_actions->perform_remote_request( 'get-all-addons-data', array() ); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | // If there was an API error, set transient for only 10 minutes. |
102 | 102 | if ( ! $addons ) { |
103 | - set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS ); |
|
104 | - return false; |
|
103 | + set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS ); |
|
104 | + return false; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | // If there was an error retrieving the addons, set the error. |
108 | 108 | if ( isset( $addons->error ) ) { |
109 | - set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS ); |
|
110 | - return false; |
|
109 | + set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS ); |
|
110 | + return false; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | // Otherwise, our request worked. Save the data and return it. |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | $keys = array_keys( get_plugins() ); |
129 | 129 | |
130 | 130 | foreach ( $keys as $key ) { |
131 | - if ( preg_match( '|^' . $slug . '|', $key ) ) { |
|
132 | - return $key; |
|
133 | - } |
|
131 | + if ( preg_match( '|^' . $slug . '|', $key ) ) { |
|
132 | + return $key; |
|
133 | + } |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | return $slug; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | return; |
41 | 41 | } |
42 | 42 | |
43 | - $site_license = array( |
|
43 | + $site_license = array( |
|
44 | 44 | 'key' => MonsterInsights()->license->get_site_license_key(), |
45 | 45 | 'type' => MonsterInsights()->license->get_site_license_type(), |
46 | 46 | 'is_disabled' => MonsterInsights()->license->site_license_disabled(), |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | // Array fields are needed even if empty. |
101 | 101 | $array_fields = array( 'view_reports', 'save_settings', 'ignore_users' ); |
102 | 102 | foreach ( $array_fields as $array_field ) { |
103 | - if ( ! isset( $options[ $array_field ] ) ) { |
|
104 | - $options[ $array_field ] = array(); |
|
103 | + if ( ! isset( $options[$array_field] ) ) { |
|
104 | + $options[$array_field] = array(); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | if ( isset( $options['custom_code'] ) ) { |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | } |
176 | 176 | } |
177 | 177 | if ( $empty ) { |
178 | - unset( $value[ $key ] ); |
|
178 | + unset( $value[$key] ); |
|
179 | 179 | } |
180 | 180 | } |
181 | 181 | } |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | } else { |
226 | 226 | $addon = $this->get_addon( $installed_plugins, $addons_type, $addon, $slug ); |
227 | 227 | } |
228 | - $parsed_addons[ $addon->slug ] = $addon; |
|
228 | + $parsed_addons[$addon->slug] = $addon; |
|
229 | 229 | } |
230 | 230 | } |
231 | 231 | |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | $installed = false; |
311 | 311 | $plugin_basename = monsterinsights_get_plugin_basename_from_slug( $slug ); |
312 | 312 | |
313 | - if ( isset( $installed_plugins[ $plugin_basename ] ) ) { |
|
313 | + if ( isset( $installed_plugins[$plugin_basename] ) ) { |
|
314 | 314 | $installed = true; |
315 | 315 | $ms_active = is_plugin_active_for_network( $plugin_basename ); |
316 | 316 | $ss_active = is_plugin_active( $plugin_basename ); |
@@ -455,8 +455,8 @@ discard block |
||
455 | 455 | ); |
456 | 456 | |
457 | 457 | foreach ( $exclude as $e ) { |
458 | - if ( ! empty( $new_settings[ $e ] ) ) { |
|
459 | - unset( $new_settings[ $e ] ); |
|
458 | + if ( ! empty( $new_settings[$e] ) ) { |
|
459 | + unset( $new_settings[$e] ); |
|
460 | 460 | } |
461 | 461 | } |
462 | 462 | |
@@ -467,8 +467,8 @@ discard block |
||
467 | 467 | } |
468 | 468 | |
469 | 469 | foreach ( $exclude as $e ) { |
470 | - if ( ! empty( $settings[ $e ] ) ) { |
|
471 | - $new_settings = $settings[ $e ]; |
|
470 | + if ( ! empty( $settings[$e] ) ) { |
|
471 | + $new_settings = $settings[$e]; |
|
472 | 472 | } |
473 | 473 | } |
474 | 474 | |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | ), |
617 | 617 | admin_url( 'admin.php' ) |
618 | 618 | ); |
619 | - $url = esc_url( $url ); |
|
619 | + $url = esc_url( $url ); |
|
620 | 620 | |
621 | 621 | ob_start(); |
622 | 622 | if ( false === ( $creds = request_filesystem_credentials( $url, $method, false, false, null ) ) ) { |
@@ -47,17 +47,17 @@ |
||
47 | 47 | if ( ! empty( $data['data']['countries'] ) ) { |
48 | 48 | $country_names = monsterinsights_get_country_list( true ); |
49 | 49 | foreach ( $data['data']['countries'] as $key => $country ) { |
50 | - $data['data']['countries'][ $key ]['name'] = isset( $country_names[ $country['iso'] ] ) ? $country_names[ $country['iso'] ] : $country['iso']; |
|
50 | + $data['data']['countries'][$key]['name'] = isset( $country_names[$country['iso']] ) ? $country_names[$country['iso']] : $country['iso']; |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | 54 | // Escape urls for the top pages report. |
55 | 55 | if ( ! empty( $data['data']['toppages'] ) ) { |
56 | 56 | foreach ( $data['data']['toppages'] as $key => $page ) { |
57 | - $title = $data['data']['toppages'][ $key ]['title']; |
|
58 | - $url = '(not set)' === $title ? '' : esc_url( $data['data']['toppages'][ $key ]['hostname'] ); |
|
57 | + $title = $data['data']['toppages'][$key]['title']; |
|
58 | + $url = '(not set)' === $title ? '' : esc_url( $data['data']['toppages'][$key]['hostname'] ); |
|
59 | 59 | |
60 | - $data['data']['toppages'][ $key ]['hostname'] = $url; |
|
60 | + $data['data']['toppages'][$key]['hostname'] = $url; |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 |