Google Analytics for WordPress by MonsterInsights - Version 7.0.7

Version Description

= 7.0.0 =

This is a major release. Please back up your site before upgrading.

= 6.0.0 =

This is a major release. Please back up your site before upgrading.

Download this release

Release Info

Developer chriscct7
Plugin Icon 128x128 Google Analytics for WordPress by MonsterInsights
Version 7.0.7
Comparing to
See all releases

Code changes from version 7.0.6 to 7.0.7

assets/js/frontend.js CHANGED
@@ -281,7 +281,11 @@ var MonsterInsights = function(){
281
  valuesArray.exit = 'internal-as-outbound';
282
  __gaTrackerNotSend( valuesArray );
283
  };
284
-
 
 
 
 
285
  if ( target || type == 'mailto' || type == 'tel' ) { /* If target opens a new window then just track */
286
  if ( type == 'download' ) {
287
  if ( track_download_as == 'pageview' ) {
@@ -289,7 +293,7 @@ var MonsterInsights = function(){
289
  hitType : 'pageview',
290
  page : link,
291
  };
292
-
293
  __gaTrackerSend( valuesArray, fieldsArray );
294
  } else {
295
  fieldsArray = {
@@ -462,12 +466,14 @@ var MonsterInsights = function(){
462
  __gaTrackerNotSend( valuesArray );
463
  }
464
 
465
- if ( type != 'external' && type != 'internal-as-outbound' ) {
466
  /* Run hitCallback again if GA takes longer than 1 second */
467
  setTimeout( __gaTrackerHitBack, 1000 );
468
  } else {
469
  if ( type == 'external' ) {
470
  setTimeout( __gaTrackerNoRedirectExternal, 1100 );
 
 
471
  } else {
472
  setTimeout( __gaTrackerNoRedirectInboundAsExternal, 1100 );
473
  }
281
  valuesArray.exit = 'internal-as-outbound';
282
  __gaTrackerNotSend( valuesArray );
283
  };
284
+ var __gaTrackerNoRedirectCrossHostname = function() {
285
+ valuesArray.exit = 'cross-hostname';
286
+ __gaTrackerNotSend( valuesArray );
287
+ };
288
+
289
  if ( target || type == 'mailto' || type == 'tel' ) { /* If target opens a new window then just track */
290
  if ( type == 'download' ) {
291
  if ( track_download_as == 'pageview' ) {
293
  hitType : 'pageview',
294
  page : link,
295
  };
296
+
297
  __gaTrackerSend( valuesArray, fieldsArray );
298
  } else {
299
  fieldsArray = {
466
  __gaTrackerNotSend( valuesArray );
467
  }
468
 
469
+ if ( type != 'external' && type != 'cross-hostname' && type != 'internal-as-outbound' ) {
470
  /* Run hitCallback again if GA takes longer than 1 second */
471
  setTimeout( __gaTrackerHitBack, 1000 );
472
  } else {
473
  if ( type == 'external' ) {
474
  setTimeout( __gaTrackerNoRedirectExternal, 1100 );
475
+ } else if ( type == 'cross-hostname' ) {
476
+ setTimeout( __gaTrackerNoRedirectCrossHostname, 1100 );
477
  } else {
478
  setTimeout( __gaTrackerNoRedirectInboundAsExternal, 1100 );
479
  }
assets/js/frontend.min.js CHANGED
@@ -12,7 +12,7 @@ else if(i&&i.length>0&&(a(i)=='mailto'||a(i)=='mailto:')){n='mailto'}
12
  else if(o&&p&&o.length>0&&p.length>0&&!o.endsWith(p)){n='external'}
13
  else if(v&&h.length>0&&v.length>0){for(t=0,l=h.length;t<l;++t){if(h[t].length>0&&v.startsWith(h[t])){n='internal-as-outbound';break}}}
14
  else if(o&&window.monsterinsights_experimental_mode&&o.length>0&&document.domain.length>0&&o!==document.domain){n='cross-hostname'};if(g&&n==='unknown'&&r.length>0&&g.length>0){for(t=0,l=r.length;t<l;++t){if(r[t].length>0&&(c.endsWith(r[t])||r[t]==g)){n='download';break}}};if(n==='unknown'){n='internal'};return n};function y(e,t){var n=(e.target&&!e.target.match(/^_(self|parent|top)$/i))?e.target:!1;if(t.ctrlKey||t.shiftKey||t.metaKey||t.which==2){n='_blank'};return n};function c(i){var a=i.srcElement||i.target,t=[],o;t.el=a;t.ga_loaded=h();t.click_type=v(i);if(!h()||!p(i)){t.exit='loaded';n(t);return}
15
- while(a&&(typeof a.tagName=='undefined'||a.tagName.toLowerCase()!='a'||!a.href)){a=a.parentNode};if(a&&a.href&&!a.hasAttribute('xlink:href')){var c=a.href,C=f(a.href),L=d(),K=u(),O=monsterinsights_frontend.home_url,w=monsterinsights_frontend.track_download_as,b='outbound-link-'+monsterinsights_frontend.internal_label,E=s(),r=m(a),x=y(a,i);t.el=a;t.el_href=a.href;t.el_protocol=a.protocol;t.el_hostname=a.hostname;t.el_port=a.port;t.el_pathname=a.pathname;t.el_search=a.search;t.el_hash=a.hash;t.el_host=a.host;t.debug_mode=l();t.download_extensions=L;t.inbound_paths=K;t.home_url=O;t.track_download_as=w;t.internal_label=b;t.link=c;t.extension=C;t.type=r;t.target=x;t.title=a.title||a.textContent||a.innerText;if(r!=='internal'&&r!=='javascript'){var k=!1,g=function(){if(k){return};k=!0;window.location.href=c},T=function(){t.exit='external';n(t)},A=function(){t.exit='internal-as-outbound';n(t)};if(x||r=='mailto'||r=='tel'){if(r=='download'){if(w=='pageview'){o={hitType:'pageview',page:c,};e(t,o)}
16
  else{o={hitType:'event',eventCategory:'download',eventAction:c,eventLabel:t.title,};e(t,o)}}
17
  else if(r=='tel'){o={hitType:'event',eventCategory:'tel',eventAction:c,eventLabel:t.title.replace('tel:',''),};e(t,o)}
18
  else if(r=='mailto'){o={hitType:'event',eventCategory:'mailto',eventAction:c,eventLabel:t.title.replace('mailto:',''),};e(t,o)}
@@ -29,8 +29,9 @@ else if(r=='external'){window.onbeforeunload=function(n){if(!i.defaultPrevented)
29
  else{i.returnValue=!1}};o={hitType:'event',eventCategory:'outbound-link',eventAction:c,eventLabel:t.title,hitCallback:g,};if(navigator.sendBeacon){o.transport='beacon'};e(t,o);setTimeout(g,1000)}}
30
  else if(r=='cross-hostname'){window.onbeforeunload=function(n){if(!i.defaultPrevented){if(i.preventDefault){i.preventDefault()}
31
  else{i.returnValue=!1}};o={hitType:'event',eventCategory:'cross-hostname',eventAction:c,eventLabel:t.title,hitCallback:g,};if(navigator.sendBeacon){o.transport='beacon'};e(t,o);setTimeout(g,1000)}}
32
- else{t.exit='type';n(t)};if(r!='external'&&r!='internal-as-outbound'){setTimeout(g,1000)}
33
  else{if(r=='external'){setTimeout(T,1100)}
 
34
  else{setTimeout(A,1100)}}}}
35
  else{t.exit='internal';n(t)}}
36
  else{t.exit='notlink';n(t)}};var r=window.location.hash;function g(){if(monsterinsights_frontend.hash_tracking==='true'&&r!=window.location.hash){r=window.location.hash;__gaTracker('set','page',location.pathname+location.search+location.hash);__gaTracker('send','pageview');i('Hash change to: '+location.pathname+location.search+location.hash)}
12
  else if(o&&p&&o.length>0&&p.length>0&&!o.endsWith(p)){n='external'}
13
  else if(v&&h.length>0&&v.length>0){for(t=0,l=h.length;t<l;++t){if(h[t].length>0&&v.startsWith(h[t])){n='internal-as-outbound';break}}}
14
  else if(o&&window.monsterinsights_experimental_mode&&o.length>0&&document.domain.length>0&&o!==document.domain){n='cross-hostname'};if(g&&n==='unknown'&&r.length>0&&g.length>0){for(t=0,l=r.length;t<l;++t){if(r[t].length>0&&(c.endsWith(r[t])||r[t]==g)){n='download';break}}};if(n==='unknown'){n='internal'};return n};function y(e,t){var n=(e.target&&!e.target.match(/^_(self|parent|top)$/i))?e.target:!1;if(t.ctrlKey||t.shiftKey||t.metaKey||t.which==2){n='_blank'};return n};function c(i){var a=i.srcElement||i.target,t=[],o;t.el=a;t.ga_loaded=h();t.click_type=v(i);if(!h()||!p(i)){t.exit='loaded';n(t);return}
15
+ while(a&&(typeof a.tagName=='undefined'||a.tagName.toLowerCase()!='a'||!a.href)){a=a.parentNode};if(a&&a.href&&!a.hasAttribute('xlink:href')){var c=a.href,L=f(a.href),K=d(),O=u(),E=monsterinsights_frontend.home_url,w=monsterinsights_frontend.track_download_as,b='outbound-link-'+monsterinsights_frontend.internal_label,D=s(),r=m(a),x=y(a,i);t.el=a;t.el_href=a.href;t.el_protocol=a.protocol;t.el_hostname=a.hostname;t.el_port=a.port;t.el_pathname=a.pathname;t.el_search=a.search;t.el_hash=a.hash;t.el_host=a.host;t.debug_mode=l();t.download_extensions=K;t.inbound_paths=O;t.home_url=E;t.track_download_as=w;t.internal_label=b;t.link=c;t.extension=L;t.type=r;t.target=x;t.title=a.title||a.textContent||a.innerText;if(r!=='internal'&&r!=='javascript'){var k=!1,g=function(){if(k){return};k=!0;window.location.href=c},T=function(){t.exit='external';n(t)},A=function(){t.exit='internal-as-outbound';n(t)},C=function(){t.exit='cross-hostname';n(t)};if(x||r=='mailto'||r=='tel'){if(r=='download'){if(w=='pageview'){o={hitType:'pageview',page:c,};e(t,o)}
16
  else{o={hitType:'event',eventCategory:'download',eventAction:c,eventLabel:t.title,};e(t,o)}}
17
  else if(r=='tel'){o={hitType:'event',eventCategory:'tel',eventAction:c,eventLabel:t.title.replace('tel:',''),};e(t,o)}
18
  else if(r=='mailto'){o={hitType:'event',eventCategory:'mailto',eventAction:c,eventLabel:t.title.replace('mailto:',''),};e(t,o)}
29
  else{i.returnValue=!1}};o={hitType:'event',eventCategory:'outbound-link',eventAction:c,eventLabel:t.title,hitCallback:g,};if(navigator.sendBeacon){o.transport='beacon'};e(t,o);setTimeout(g,1000)}}
30
  else if(r=='cross-hostname'){window.onbeforeunload=function(n){if(!i.defaultPrevented){if(i.preventDefault){i.preventDefault()}
31
  else{i.returnValue=!1}};o={hitType:'event',eventCategory:'cross-hostname',eventAction:c,eventLabel:t.title,hitCallback:g,};if(navigator.sendBeacon){o.transport='beacon'};e(t,o);setTimeout(g,1000)}}
32
+ else{t.exit='type';n(t)};if(r!='external'&&r!='cross-hostname'&&r!='internal-as-outbound'){setTimeout(g,1000)}
33
  else{if(r=='external'){setTimeout(T,1100)}
34
+ else if(r=='cross-hostname'){setTimeout(C,1100)}
35
  else{setTimeout(A,1100)}}}}
36
  else{t.exit='internal';n(t)}}
37
  else{t.exit='notlink';n(t)}};var r=window.location.hash;function g(){if(monsterinsights_frontend.hash_tracking==='true'&&r!=window.location.hash){r=window.location.hash;__gaTracker('set','page',location.pathname+location.search+location.hash);__gaTracker('send','pageview');i('Hash change to: '+location.pathname+location.search+location.hash)}
googleanalytics.php CHANGED
@@ -548,6 +548,7 @@ final class MonsterInsights_Lite {
548
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/capabilities.php';
549
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/licensing/license-actions.php';
550
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/licensing/autoupdate.php';
 
551
 
552
  // Pages
553
  // Multisite
548
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/capabilities.php';
549
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/licensing/license-actions.php';
550
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/licensing/autoupdate.php';
551
+ require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/review.php';
552
 
553
  // Pages
554
  // Multisite
includes/admin/admin.php CHANGED
@@ -231,7 +231,7 @@ function monsterinsights_welcome_redirect() {
231
  //add_action( 'admin_init', 'monsterinsights_welcome_redirect', 11 ); @todo: Investigate
232
 
233
  /**
234
- * When user is on a WPForms related admin page, display footer text
235
  * that graciously asks them to rate us.
236
  *
237
  * @since 6.0.0
@@ -433,4 +433,14 @@ function monsterinsights_admin_setup_notices() {
433
  }
434
  }
435
  add_action( 'admin_notices', 'monsterinsights_admin_setup_notices' );
436
- add_action( 'network_admin_notices', 'monsterinsights_admin_setup_notices' );
 
 
 
 
 
 
 
 
 
 
231
  //add_action( 'admin_init', 'monsterinsights_welcome_redirect', 11 ); @todo: Investigate
232
 
233
  /**
234
+ * When user is on a MonsterInsights related admin page, display footer text
235
  * that graciously asks them to rate us.
236
  *
237
  * @since 6.0.0
433
  }
434
  }
435
  add_action( 'admin_notices', 'monsterinsights_admin_setup_notices' );
436
+ add_action( 'network_admin_notices', 'monsterinsights_admin_setup_notices' );
437
+
438
+
439
+ // AM Notices
440
+ function monsterinsights_am_notice_optout( $super_admin ) {
441
+ if ( monsterinsights_get_option( 'hide_am_notices', false ) || monsterinsights_get_option( 'network_hide_am_notices', false ) ) {
442
+ return false;
443
+ }
444
+ return $super_admin;
445
+ }
446
+ add_filter( "am_notifications_display", 'monsterinsights_am_notice_optout', 10, 1 );
includes/admin/common.php CHANGED
@@ -272,8 +272,9 @@ function monsterinsights_remove_conflicting_asset_files() {
272
  'icheck', // Grand News Theme
273
  'learn-press-chart', // LearnPress
274
  'theme-script-main', // My Listing Theme by 27collective
275
- 'selz ', // Selz eCommerce
276
  'tie-admin-scripts', // Tie Theme
 
277
  );
278
 
279
  if ( ! empty( $styles ) ) {
@@ -348,6 +349,16 @@ function monsterinsights_remove_conflicting_asset_files() {
348
  }
349
  }
350
  }
 
 
 
 
 
 
 
 
 
 
351
  }
352
  add_action( 'admin_enqueue_scripts', 'monsterinsights_remove_conflicting_asset_files', 9999 );
353
 
272
  'icheck', // Grand News Theme
273
  'learn-press-chart', // LearnPress
274
  'theme-script-main', // My Listing Theme by 27collective
275
+ 'selz', // Selz eCommerce
276
  'tie-admin-scripts', // Tie Theme
277
+ 'td-wp-admin-js', // Newspaper by tagDiv
278
  );
279
 
280
  if ( ! empty( $styles ) ) {
349
  }
350
  }
351
  }
352
+
353
+ // Remove actions from themes that are not following best practices and break the admin doing so
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');
362
  }
363
  add_action( 'admin_enqueue_scripts', 'monsterinsights_remove_conflicting_asset_files', 9999 );
364
 
includes/admin/pages/addons.php CHANGED
@@ -116,7 +116,7 @@ function monsterinsights_addons_page() {
116
  function monsterinsights_addons_content() {
117
 
118
  // If error(s) occurred during license key verification, display them and exit now.
119
- if ( ! MonsterInsights()->license->get_valid_license_key() ) {
120
  ?>
121
  <div class="error below-h2">
122
  <p>
116
  function monsterinsights_addons_content() {
117
 
118
  // If error(s) occurred during license key verification, display them and exit now.
119
+ if ( monsterinsights_is_pro_version() && ! MonsterInsights()->license->get_valid_license_key() ) {
120
  ?>
121
  <div class="error below-h2">
122
  <p>
includes/admin/pages/network-settings.php CHANGED
@@ -165,6 +165,11 @@ function monsterinsights_network_page() {
165
  </td>
166
  </tr>
167
  <?php } ?>
 
 
 
 
 
168
  </tbody>
169
  </table>
170
  </div>
@@ -221,6 +226,13 @@ function monsterinsights_network_settings_save_general() {
221
  // Do nothing
222
  }
223
 
 
 
 
 
 
 
 
224
  // Output an admin notice so the user knows what happened
225
  if ( $throw_notice ) {
226
  add_action( 'monsterinsights_network_settings_general_tab_notice', 'monsterinsights_invalid_ua_code' );
165
  </td>
166
  </tr>
167
  <?php } ?>
168
+ <?php
169
+ $title = esc_html__( 'Hide Announcements', 'google-analytics-for-wordpress' );
170
+ $description = esc_html__( 'Hides plugin announcements and update details. This includes critical notices we use to inform about deprecations and important required configuration changes.', 'google-analytics-for-wordpress' );
171
+ echo monsterinsights_make_checkbox( 'network_hide_am_notices', $title, $description );
172
+ ?>
173
  </tbody>
174
  </table>
175
  </div>
226
  // Do nothing
227
  }
228
 
229
+ $network_hide_am_notices = isset( $_POST['network_hide_am_notices'] ) ? 1 : 0;
230
+ $network_hide_am_notices_old = monsterinsights_get_option( 'network_hide_am_notices', false );
231
+ if ( $network_hide_am_notices != $network_hide_am_notices_old ) {
232
+ monsterinsights_update_option( 'network_hide_am_notices', $network_hide_am_notices );
233
+ $throw_notice = true;
234
+ }
235
+
236
  // Output an admin notice so the user knows what happened
237
  if ( $throw_notice ) {
238
  add_action( 'monsterinsights_network_settings_general_tab_notice', 'monsterinsights_invalid_ua_code' );
includes/admin/review.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ask for some love.
4
+ *
5
+ * @package MonsterInsights
6
+ * @author MonsterInsights
7
+ * @since 7.0.7
8
+ * @license GPL-2.0+
9
+ * @copyright Copyright (c) 2018, MonsterInsights LLC
10
+ */
11
+ class MonsterInsights_Review {
12
+ /**
13
+ * Primary class constructor.
14
+ *
15
+ * @since 7.0.7
16
+ */
17
+ public function __construct() {
18
+ // Admin notice requesting review.
19
+ add_action( 'admin_notices', array( $this, 'review_request' ) );
20
+ add_action( 'wp_ajax_monsterinsights_review_dismiss', array( $this, 'review_dismiss' ) );
21
+ }
22
+ /**
23
+ * Add admin notices as needed for reviews.
24
+ *
25
+ * @since 7.0.7
26
+ */
27
+ public function review_request() {
28
+ // Only consider showing the review request to admin users.
29
+ if ( ! is_super_admin() ) {
30
+ return;
31
+ }
32
+
33
+ // Don't show to lite users
34
+ if ( ! monsterinsights_is_pro_version() ) {
35
+ return;
36
+ }
37
+
38
+ // If the user has opted out of product annoucement notifications, don't
39
+ // display the review request.
40
+ if ( monsterinsights_get_option( 'hide_am_notices', false ) || monsterinsights_get_option( 'network_hide_am_notices', false ) ) {
41
+ return;
42
+ }
43
+ // Verify that we can do a check for reviews.
44
+ $review = get_option( 'monsterinsights_review' );
45
+ $time = time();
46
+ $load = false;
47
+
48
+ if ( ! $review ) {
49
+ $review = array(
50
+ 'time' => $time,
51
+ 'dismissed' => false,
52
+ );
53
+ update_option( 'monsterinsights_review', $review );
54
+ } else {
55
+ // Check if it has been dismissed or not.
56
+ if ( ( isset( $review['dismissed'] ) && ! $review['dismissed'] ) && ( isset( $review['time'] ) && ( ( $review['time'] + DAY_IN_SECONDS ) <= $time ) ) ) {
57
+ $load = true;
58
+ }
59
+ }
60
+
61
+ // If we cannot load, return early.
62
+ if ( ! $load ) {
63
+ return;
64
+ }
65
+
66
+ $this->review();
67
+ }
68
+
69
+ /**
70
+ * Maybe show review request.
71
+ *
72
+ * @since 7.0.7
73
+ */
74
+ public function review() {
75
+ // Fetch when plugin was initially installed.
76
+ $activated = get_option( 'monsterinsights_over_time', array() );
77
+ if ( ! empty( $activated['installed_date'] ) ) {
78
+ // Only continue if plugin has been installed for at least 14 days.
79
+ if ( ( $activated['installed_date'] + ( DAY_IN_SECONDS * 14 ) ) > time() ) {
80
+ return;
81
+ }
82
+ } else {
83
+ $data = array(
84
+ 'installed_version' => MONSTERINSIGHTS_VERSION,
85
+ 'installed_date' => time(),
86
+ 'installed_pro' => monsterinsights_is_pro_version(),
87
+ );
88
+
89
+ update_option( 'monsterinsights_over_time', $data );
90
+ return;
91
+ }
92
+ // Only proceed with displaying if the user is tracking.
93
+ $ua_code = monsterinsights_get_ua_to_output();
94
+ if ( empty( $ua_code ) ) {
95
+ return;
96
+ }
97
+ // We have a candidate! Output a review message.
98
+ ?>
99
+ <div class="notice notice-info is-dismissible monsterinsights-review-notice">
100
+ <p><?php esc_html_e( 'Hey, I noticed you created a contact form with MonsterInsights - that’s awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress to help us spread the word and boost our motivation?', 'google-analytics-for-wordpress' ); ?></p>
101
+ <p><strong><?php echo wp_kses( __( '~ Syed Balkhi<br>Co-Founder of MonsterInsights', 'google-analytics-for-wordpress' ), array( 'br' => array() ) ); ?></strong></p>
102
+ <p>
103
+ <a href="https://wordpress.org/support/plugin/google-analytics-for-wordpress/reviews/?filter=5#new-post" class="monsterinsights-dismiss-review-notice monsterinsights-review-out" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Ok, you deserve it', 'google-analytics-for-wordpress' ); ?></a><br>
104
+ <a href="#" class="monsterinsights-dismiss-review-notice" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Nope, maybe later', 'google-analytics-for-wordpress' ); ?></a><br>
105
+ <a href="#" class="monsterinsights-dismiss-review-notice" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'I already did', 'google-analytics-for-wordpress' ); ?></a>
106
+ </p>
107
+ </div>
108
+ <script type="text/javascript">
109
+ jQuery( document ).ready( function ( $ ) {
110
+ $( document ).on( 'click', '.monsterinsights-dismiss-review-notice, .monsterinsights-review-notice button', function ( event ) {
111
+ if ( ! $( this ).hasClass( 'monsterinsights-review-out' ) ) {
112
+ event.preventDefault();
113
+ }
114
+ $.post( ajaxurl, {
115
+ action: 'monsterinsights_review_dismiss'
116
+ } );
117
+ $( '.monsterinsights-review-notice' ).remove();
118
+ } );
119
+ } );
120
+ </script>
121
+ <?php
122
+ }
123
+ /**
124
+ * Dismiss the review admin notice
125
+ *
126
+ * @since 7.0.7
127
+ */
128
+ public function review_dismiss() {
129
+ $review = get_option( 'monsterinsights_review', array() );
130
+ $review['time'] = time();
131
+ $review['dismissed'] = true;
132
+ update_option( 'monsterinsights_review', $review );
133
+ die;
134
+ }
135
+ }
136
+ new MonsterInsights_Review;
includes/admin/settings/register-settings.php CHANGED
@@ -391,6 +391,12 @@ function monsterinsights_get_registered_settings() {
391
  'desc' => __( 'By allowing us to track usage data we can better help you, because we know with which WordPress configurations, themes and plugins we should test.', 'google-analytics-for-wordpress' ),
392
  'type' => 'checkbox',
393
  ),
 
 
 
 
 
 
394
  )
395
  ),
396
  );
391
  'desc' => __( 'By allowing us to track usage data we can better help you, because we know with which WordPress configurations, themes and plugins we should test.', 'google-analytics-for-wordpress' ),
392
  'type' => 'checkbox',
393
  ),
394
+ 'hide_am_notices' => array(
395
+ 'id' => 'hide_am_notices',
396
+ 'name' => __( 'Hide Announcements', 'google-analytics-for-wordpress' ),
397
+ 'desc' => __( 'Hides plugin announcements and update details. This includes critical notices we use to inform about deprecations and important required configuration changes.', 'google-analytics-for-wordpress' ),
398
+ 'type' => 'checkbox',
399
+ ),
400
  )
401
  ),
402
  );
includes/frontend/tracking/class-tracking-analytics.php CHANGED
@@ -186,7 +186,6 @@ class MonsterInsights_Tracking_Analytics extends MonsterInsights_Tracking_Abstra
186
  $ua = monsterinsights_get_ua();
187
  $output = '';
188
  $reason = '';
189
- $cookie_notice = class_exists( 'Cookie_Notice' );
190
  $attributes = apply_filters( 'monsterinsights_tracking_analytics_script_attributes', array( 'type' => "text/javascript", 'data-cfasync' => 'false' ) );
191
  $attr_string = '';
192
  if ( ! empty( $attributes ) ) {
186
  $ua = monsterinsights_get_ua();
187
  $output = '';
188
  $reason = '';
 
189
  $attributes = apply_filters( 'monsterinsights_tracking_analytics_script_attributes', array( 'type' => "text/javascript", 'data-cfasync' => 'false' ) );
190
  $attr_string = '';
191
  if ( ! empty( $attributes ) ) {
languages/google-analytics-for-wordpress.pot CHANGED
@@ -4,14 +4,14 @@ msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: MonsterInsights Lite\n"
6
  "Report-Msgid-Bugs-To: https://github.com/awesomemotive/monsterinsights/issues\n"
7
- "POT-Creation-Date: 2018-05-14 07:49-0400\n"
8
  "PO-Revision-Date: 2016-07-21 17:01-0400\n"
9
  "Last-Translator: Chris Christoff <support@monsterinsights.com>\n"
10
  "Language-Team: Chris Christoff <support@monsterinsights.com>\n"
11
  "MIME-Version: 1.0\n"
12
  "Content-Type: text/plain; charset=UTF-8\n"
13
  "Content-Transfer-Encoding: 8bit\n"
14
- "X-Generator: Poedit 2.0.7\n"
15
  "X-Poedit-Basepath: ..\n"
16
  "X-Poedit-WPHeader: googleanalytics.php\n"
17
  "X-Poedit-SourceCharset: UTF-8\n"
@@ -50,12 +50,12 @@ msgstr ""
50
  msgid "Please %1$suninstall%2$s the MonsterInsights Lite Plugin. Your Pro version of MonsterInsights may not work as expected until the Lite version is uninstalled."
51
  msgstr ""
52
 
53
- #: googleanalytics.php:644
54
  #, php-format
55
  msgid "Sorry, but your version of WordPress does not meet MonsterInsight's required version of %1$s3.8%2$s to run properly. The plugin not been activated. %3$sClick here to return to the Dashboard%4$s."
56
  msgstr ""
57
 
58
- #: googleanalytics.php:649
59
  #, php-format
60
  msgid "Please uninstall and remove MonsterInsights Pro before activating Google Analytics for WordPress by MonsterInsights. The Lite version has not been activated. %1$sClick here to return to the Dashboard%2$s."
61
  msgstr ""
@@ -438,7 +438,7 @@ msgstr ""
438
  msgid "Error"
439
  msgstr ""
440
 
441
- #: includes/admin/common.php:499
442
  #, php-format
443
  msgid "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."
444
  msgstr ""
@@ -675,6 +675,16 @@ msgstr ""
675
  msgid "Don't yet have a Pro license? %sVisit our website%s to upgrade and learn more about all the amazing features, expanded report and powerful addons you unlock when you go Pro."
676
  msgstr ""
677
 
 
 
 
 
 
 
 
 
 
 
678
  #: includes/admin/pages/reports.php:93
679
  #, php-format
680
  msgid "%s Report"
@@ -1051,6 +1061,26 @@ msgstr ""
1051
  msgid "Unique"
1052
  msgstr ""
1053
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1054
  #: includes/admin/settings/register-settings.php:23
1055
  msgid "Engagement"
1056
  msgstr ""
@@ -1447,23 +1477,23 @@ msgstr ""
1447
  msgid "%1$s is %3$sdeprecated%4$s since MonsterInsights version %2$s."
1448
  msgstr ""
1449
 
1450
- #: includes/frontend/tracking/class-tracking-analytics.php:206
1451
  msgid "Note: MonsterInsights is not currently configured on this site. The site owner needs to authenticate with Google Analytics in the MonsterInsights settings panel."
1452
  msgstr ""
1453
 
1454
- #: includes/frontend/tracking/class-tracking-analytics.php:209
1455
  msgid "Note: MonsterInsights does not track you as a logged in site administrator to prevent site owners from accidentally skewing their own Google Analytics data."
1456
  msgstr ""
1457
 
1458
- #: includes/frontend/tracking/class-tracking-analytics.php:212
1459
  msgid "Note: The site owner has disabled Google Analytics tracking for your user role."
1460
  msgstr ""
1461
 
1462
- #: includes/frontend/tracking/class-tracking-analytics.php:291
1463
  msgid "Not running function"
1464
  msgstr ""
1465
 
1466
- #: includes/frontend/tracking/class-tracking-analytics.php:291
1467
  msgid "because you are not being tracked."
1468
  msgstr ""
1469
 
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: MonsterInsights Lite\n"
6
  "Report-Msgid-Bugs-To: https://github.com/awesomemotive/monsterinsights/issues\n"
7
+ "POT-Creation-Date: 2018-06-07 12:53-0400\n"
8
  "PO-Revision-Date: 2016-07-21 17:01-0400\n"
9
  "Last-Translator: Chris Christoff <support@monsterinsights.com>\n"
10
  "Language-Team: Chris Christoff <support@monsterinsights.com>\n"
11
  "MIME-Version: 1.0\n"
12
  "Content-Type: text/plain; charset=UTF-8\n"
13
  "Content-Transfer-Encoding: 8bit\n"
14
+ "X-Generator: Poedit 2.0.8\n"
15
  "X-Poedit-Basepath: ..\n"
16
  "X-Poedit-WPHeader: googleanalytics.php\n"
17
  "X-Poedit-SourceCharset: UTF-8\n"
50
  msgid "Please %1$suninstall%2$s the MonsterInsights Lite Plugin. Your Pro version of MonsterInsights may not work as expected until the Lite version is uninstalled."
51
  msgstr ""
52
 
53
+ #: googleanalytics.php:645
54
  #, php-format
55
  msgid "Sorry, but your version of WordPress does not meet MonsterInsight's required version of %1$s3.8%2$s to run properly. The plugin not been activated. %3$sClick here to return to the Dashboard%4$s."
56
  msgstr ""
57
 
58
+ #: googleanalytics.php:650
59
  #, php-format
60
  msgid "Please uninstall and remove MonsterInsights Pro before activating Google Analytics for WordPress by MonsterInsights. The Lite version has not been activated. %1$sClick here to return to the Dashboard%2$s."
61
  msgstr ""
438
  msgid "Error"
439
  msgstr ""
440
 
441
+ #: includes/admin/common.php:510
442
  #, php-format
443
  msgid "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."
444
  msgstr ""
675
  msgid "Don't yet have a Pro license? %sVisit our website%s to upgrade and learn more about all the amazing features, expanded report and powerful addons you unlock when you go Pro."
676
  msgstr ""
677
 
678
+ #: includes/admin/pages/network-settings.php:169
679
+ #: includes/admin/settings/register-settings.php:396
680
+ msgid "Hide Announcements"
681
+ msgstr ""
682
+
683
+ #: includes/admin/pages/network-settings.php:170
684
+ #: includes/admin/settings/register-settings.php:397
685
+ msgid "Hides plugin announcements and update details. This includes critical notices we use to inform about deprecations and important required configuration changes."
686
+ msgstr ""
687
+
688
  #: includes/admin/pages/reports.php:93
689
  #, php-format
690
  msgid "%s Report"
1061
  msgid "Unique"
1062
  msgstr ""
1063
 
1064
+ #: includes/admin/review.php:100
1065
+ msgid "Hey, I noticed you created a contact form with MonsterInsights - that’s awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress to help us spread the word and boost our motivation?"
1066
+ msgstr ""
1067
+
1068
+ #: includes/admin/review.php:101
1069
+ msgid "~ Syed Balkhi<br>Co-Founder of MonsterInsights"
1070
+ msgstr ""
1071
+
1072
+ #: includes/admin/review.php:103
1073
+ msgid "Ok, you deserve it"
1074
+ msgstr ""
1075
+
1076
+ #: includes/admin/review.php:104
1077
+ msgid "Nope, maybe later"
1078
+ msgstr ""
1079
+
1080
+ #: includes/admin/review.php:105
1081
+ msgid "I already did"
1082
+ msgstr ""
1083
+
1084
  #: includes/admin/settings/register-settings.php:23
1085
  msgid "Engagement"
1086
  msgstr ""
1477
  msgid "%1$s is %3$sdeprecated%4$s since MonsterInsights version %2$s."
1478
  msgstr ""
1479
 
1480
+ #: includes/frontend/tracking/class-tracking-analytics.php:205
1481
  msgid "Note: MonsterInsights is not currently configured on this site. The site owner needs to authenticate with Google Analytics in the MonsterInsights settings panel."
1482
  msgstr ""
1483
 
1484
+ #: includes/frontend/tracking/class-tracking-analytics.php:208
1485
  msgid "Note: MonsterInsights does not track you as a logged in site administrator to prevent site owners from accidentally skewing their own Google Analytics data."
1486
  msgstr ""
1487
 
1488
+ #: includes/frontend/tracking/class-tracking-analytics.php:211
1489
  msgid "Note: The site owner has disabled Google Analytics tracking for your user role."
1490
  msgstr ""
1491
 
1492
+ #: includes/frontend/tracking/class-tracking-analytics.php:290
1493
  msgid "Not running function"
1494
  msgstr ""
1495
 
1496
+ #: includes/frontend/tracking/class-tracking-analytics.php:290
1497
  msgid "because you are not being tracked."
1498
  msgstr ""
1499
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.wpbeginner.com/wpbeginner-needs-your-help/
4
  Tags: analytics, analytics dashboard, google analytics, google analytics dashboard, google analytics widget, universal google analytics, statistics, tracking, stats, google, yoast, google analytics by yoast, ga, monster insights, monsterinsights, universal analytics, web stats, ecommerce, ecommerce tracking
5
  Requires at least: 3.8.0
6
  Tested up to: 4.9
7
- Stable tag: 7.0.5
8
  License: GPL v3
9
 
10
  The best Google Analytics plugin for WordPress. See how visitors find and use your website, so you can keep them coming back.
@@ -134,6 +134,11 @@ You can also learn about other <a href="http://www.wpbeginner.com/category/plugi
134
  4. Want more features? <a href="https://www.monsterinsights.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion">Purchase MonsterInsights Pro</a>!
135
 
136
  == Changelog ==
 
 
 
 
 
137
  = 7.0.6: May 14, 2018 =
138
  - Tweak: Better handling of link tracking for links embedded as anchor tags inside of an SVG image.
139
  - Tweak: Link tracking has been updated to enforce more strict type checks on variables.
@@ -142,7 +147,7 @@ You can also learn about other <a href="http://www.wpbeginner.com/category/plugi
142
  - Tweak: Fixed "you you" typo on the Reports page notice.
143
  - Tweak: On the overview report the indicator icon colors for bounce rate have been flipped to more accurately describe the impact (ie green = bounce rate going down = good).
144
  - Fixed: Undefined $tracking variable error.
145
- - Fixed: Better type checking before converting number strings to human readable dates on reprots.
146
  - Fixed: If GA didn't load and link tracking was enabled, an undefined Javascript error could occur if the fallback object didn't get set (edgecase).
147
 
148
  = 7.0.5: April 9, 2018 =
4
  Tags: analytics, analytics dashboard, google analytics, google analytics dashboard, google analytics widget, universal google analytics, statistics, tracking, stats, google, yoast, google analytics by yoast, ga, monster insights, monsterinsights, universal analytics, web stats, ecommerce, ecommerce tracking
5
  Requires at least: 3.8.0
6
  Tested up to: 4.9
7
+ Stable tag: 7.0.6
8
  License: GPL v3
9
 
10
  The best Google Analytics plugin for WordPress. See how visitors find and use your website, so you can keep them coming back.
134
  4. Want more features? <a href="https://www.monsterinsights.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion">Purchase MonsterInsights Pro</a>!
135
 
136
  == Changelog ==
137
+ = 7.0.7: June 7, 2018 =
138
+ - Tweak: Compatibility with Selz plugin.
139
+ - Tweak: Issue where some settings would remain hidden inadvertently.
140
+ - Fixed: Issue where some lite users would see an error regarding a license key.
141
+
142
  = 7.0.6: May 14, 2018 =
143
  - Tweak: Better handling of link tracking for links embedded as anchor tags inside of an SVG image.
144
  - Tweak: Link tracking has been updated to enforce more strict type checks on variables.
147
  - Tweak: Fixed "you you" typo on the Reports page notice.
148
  - Tweak: On the overview report the indicator icon colors for bounce rate have been flipped to more accurately describe the impact (ie green = bounce rate going down = good).
149
  - Fixed: Undefined $tracking variable error.
150
+ - Fixed: Better type checking before converting number strings to human readable dates on reports.
151
  - Fixed: If GA didn't load and link tracking was enabled, an undefined Javascript error could occur if the fallback object didn't get set (edgecase).
152
 
153
  = 7.0.5: April 9, 2018 =