Google Analytics for WordPress by MonsterInsights - Version 7.0.2

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.2
Comparing to
See all releases

Code changes from version 7.0.1 to 7.0.2

googleanalytics.php CHANGED
@@ -6,7 +6,7 @@
6
  * Author: MonsterInsights
7
  * Author URI: https://www.monsterinsights.com/
8
  *
9
- * Version: 7.0.1
10
  * Requires at least: 3.8.0
11
  * Tested up to: 4.9
12
  *
@@ -69,7 +69,7 @@ final class MonsterInsights_Lite {
69
  * @access public
70
  * @var string $version Plugin version.
71
  */
72
- public $version = '7.0.1';
73
 
74
  /**
75
  * Plugin file.
6
  * Author: MonsterInsights
7
  * Author URI: https://www.monsterinsights.com/
8
  *
9
+ * Version: 7.0.2
10
  * Requires at least: 3.8.0
11
  * Tested up to: 4.9
12
  *
69
  * @access public
70
  * @var string $version Plugin version.
71
  */
72
+ public $version = '7.0.2';
73
 
74
  /**
75
  * Plugin file.
includes/admin/admin.php CHANGED
@@ -313,38 +313,36 @@ function monsterinsights_admin_setup_notices() {
313
  }
314
 
315
  // 4. Optin setting not configured
316
- if ( ! is_network_admin() ) {
317
- if ( ! get_option( 'monsterinsights_tracking_notice' ) ) {
318
- if ( ! monsterinsights_get_option( 'anonymous_data', false ) ) {
319
- if ( ! monsterinsights_is_dev_url( network_site_url( '/' ) ) ) {
320
- if ( monsterinsights_is_pro_version() ) {
321
- monsterinsights_update_option( 'anonymous_data', 1 );
322
- return;
323
- }
324
- $optin_url = add_query_arg( 'mi_action', 'opt_into_tracking' );
325
- $optout_url = add_query_arg( 'mi_action', 'opt_out_of_tracking' );
326
- echo '<div class="updated"><p>';
327
- echo esc_html__( 'Allow MonsterInsights to track plugin usage? Opt-in to tracking and our newsletter to stay informed of the latest changes to MonsterInsights and help us ensure compatibility.', 'google-analytics-for-wordpress' );
328
- echo '&nbsp;<a href="' . esc_url( $optin_url ) . '" class="button-secondary">' . __( 'Allow', 'google-analytics-for-wordpress' ) . '</a>';
329
- echo '&nbsp;<a href="' . esc_url( $optout_url ) . '" class="button-secondary">' . __( 'Do not allow', 'google-analytics-for-wordpress' ) . '</a>';
330
- echo '</p></div>';
331
- return;
332
- } else {
333
- // is testing site
334
- update_option( 'monsterinsights_tracking_notice', '1' );
335
- }
336
- }
337
- }
 
 
 
 
 
338
  }
339
 
340
- $notices = array();
341
- if ( ! is_network_admin() || ( ! monsterinsights_is_pro_version() && ( class_exists( 'WooCommerce' ) || class_exists( 'Easy_Digital_Downloads' ) ) ) ) {
342
- $notices = get_option( 'monsterinsights_notices' );
343
- if ( ! is_array( $notices ) ) {
344
- $notices = array();
345
- }
346
- }
347
- // 5. Automatic updates not configured
348
  $authed = MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed();
349
  $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
350
 
@@ -357,20 +355,20 @@ function monsterinsights_admin_setup_notices() {
357
  return;
358
  }
359
 
360
- // 6. Authenticate, not manual
361
- if ( ! is_network_admin() ) {
362
- $updates = monsterinsights_get_option( 'automatic_updates', false );
363
- $url = admin_url( 'admin.php?page=monsterinsights_settings' );
364
-
365
- if ( empty( $updates) && ! isset( $notices['monsterinsights_automatic_updates' ] ) ) {
366
- echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_automatic_updates">';
367
- echo '<p>';
368
- echo sprintf( esc_html__( 'Important: Please %1$sconfigure the Automatic Updates Settings%2$s in MonsterInsights.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' );
369
- echo '</p>';
370
- echo '</div>';
371
- return;
372
- }
373
- }
374
 
375
  // 7. WooUpsell
376
  if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) {
313
  }
314
 
315
  // 4. Optin setting not configured
316
+ // if ( ! is_network_admin() ) {
317
+ // if ( ! get_option( 'monsterinsights_tracking_notice' ) ) {
318
+ // if ( ! monsterinsights_get_option( 'anonymous_data', false ) ) {
319
+ // if ( ! monsterinsights_is_dev_url( network_site_url( '/' ) ) ) {
320
+ // if ( monsterinsights_is_pro_version() ) {
321
+ // monsterinsights_update_option( 'anonymous_data', 1 );
322
+ // return;
323
+ // }
324
+ // $optin_url = add_query_arg( 'mi_action', 'opt_into_tracking' );
325
+ // $optout_url = add_query_arg( 'mi_action', 'opt_out_of_tracking' );
326
+ // echo '<div class="updated"><p>';
327
+ // echo esc_html__( 'Allow MonsterInsights to track plugin usage? Opt-in to tracking and our newsletter to stay informed of the latest changes to MonsterInsights and help us ensure compatibility.', 'google-analytics-for-wordpress' );
328
+ // echo '&nbsp;<a href="' . esc_url( $optin_url ) . '" class="button-secondary">' . __( 'Allow', 'google-analytics-for-wordpress' ) . '</a>';
329
+ // echo '&nbsp;<a href="' . esc_url( $optout_url ) . '" class="button-secondary">' . __( 'Do not allow', 'google-analytics-for-wordpress' ) . '</a>';
330
+ // echo '</p></div>';
331
+ // return;
332
+ // } else {
333
+ // // is testing site
334
+ // update_option( 'monsterinsights_tracking_notice', '1' );
335
+ // }
336
+ // }
337
+ // }
338
+ // }
339
+
340
+ $notices = get_option( 'monsterinsights_notices' );
341
+ if ( ! is_array( $notices ) ) {
342
+ $notices = array();
343
  }
344
 
345
+ // 5. Authenticate, not manual
 
 
 
 
 
 
 
346
  $authed = MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed();
347
  $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' );
348
 
355
  return;
356
  }
357
 
358
+ // 6. Automatic updates not configured
359
+ // if ( ! is_network_admin() ) {
360
+ // $updates = monsterinsights_get_option( 'automatic_updates', false );
361
+ // $url = admin_url( 'admin.php?page=monsterinsights_settings' );
362
+
363
+ // if ( empty( $updates) && ! isset( $notices['monsterinsights_automatic_updates' ] ) ) {
364
+ // echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_automatic_updates">';
365
+ // echo '<p>';
366
+ // echo sprintf( esc_html__( 'Important: Please %1$sconfigure the Automatic Updates Settings%2$s in MonsterInsights.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' );
367
+ // echo '</p>';
368
+ // echo '</div>';
369
+ // return;
370
+ // }
371
+ // }
372
 
373
  // 7. WooUpsell
374
  if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) {
includes/frontend/tracking/class-tracking-analytics.php CHANGED
@@ -184,12 +184,12 @@ class MonsterInsights_Tracking_Analytics extends MonsterInsights_Tracking_Abstra
184
  $compat = $compat ? 'window.ga = __gaTracker;' : '';
185
  $track_user = monsterinsights_track_user();
186
  $ua = monsterinsights_get_ua();
 
 
187
  ob_start();
188
  ?>
189
  <!-- This site uses the Google Analytics by MonsterInsights plugin v<?php echo MONSTERINSIGHTS_VERSION; ?> - Using Analytics tracking - https://www.monsterinsights.com/ -->
190
  <?php if ( ! $track_user ) {
191
- $output = '';
192
- $reason = '';
193
  if ( empty( $ua ) ) {
194
  $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' );
195
  $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
184
  $compat = $compat ? 'window.ga = __gaTracker;' : '';
185
  $track_user = monsterinsights_track_user();
186
  $ua = monsterinsights_get_ua();
187
+ $output = '';
188
+ $reason = '';
189
  ob_start();
190
  ?>
191
  <!-- This site uses the Google Analytics by MonsterInsights plugin v<?php echo MONSTERINSIGHTS_VERSION; ?> - Using Analytics tracking - https://www.monsterinsights.com/ -->
192
  <?php if ( ! $track_user ) {
 
 
193
  if ( empty( $ua ) ) {
194
  $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' );
195
  $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL;
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.1
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,10 @@ 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.1: February 26, 2018 =
138
  - New: Support for the updated version of MonsterInsights AMP plugin which switches from using a custom REST endpoint to using the now built in Google AMP ClientID synching feature. If you're using the AMP addon, you'll want to also update that addon as well.
139
  - New: The __gaTracker and disable tracking functions will always be defined, even when we're not tracking users (for example if viewing a preview, or if a logged-in administrator) to allow sites to not have to worry about breakage when variable exist checking isn't done.
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.2
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.2: February 27, 2018 =
138
+ - Bugfix: Fixed a bug with the analytics.js output where a UA code wasn't entered, the $reason variable could be undefined.
139
+ - Bugfix: Fixed an issue where a notice might not be dismissable and we've also removed several of them.
140
+
141
  = 7.0.1: February 26, 2018 =
142
  - New: Support for the updated version of MonsterInsights AMP plugin which switches from using a custom REST endpoint to using the now built in Google AMP ClientID synching feature. If you're using the AMP addon, you'll want to also update that addon as well.
143
  - New: The __gaTracker and disable tracking functions will always be defined, even when we're not tracking users (for example if viewing a preview, or if a logged-in administrator) to allow sites to not have to worry about breakage when variable exist checking isn't done.