Google Analytics for WordPress by MonsterInsights - Version 6.2.2

Version Description

= 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 6.2.2
Comparing to
See all releases

Code changes from version 6.2.1 to 6.2.2

googleanalytics.php CHANGED
@@ -6,7 +6,7 @@
6
  * Author: MonsterInsights
7
  * Author URI: https://www.monsterinsights.com/
8
  *
9
- * Version: 6.2.1
10
  * Requires at least: 3.9.0
11
  * Tested up to: 4.8.1
12
  *
@@ -69,7 +69,7 @@ final class MonsterInsights_Lite {
69
  * @access public
70
  * @var string $version Plugin version.
71
  */
72
- public $version = '6.2.1';
73
 
74
  /**
75
  * Plugin file.
6
  * Author: MonsterInsights
7
  * Author URI: https://www.monsterinsights.com/
8
  *
9
+ * Version: 6.2.2
10
  * Requires at least: 3.9.0
11
  * Tested up to: 4.8.1
12
  *
69
  * @access public
70
  * @var string $version Plugin version.
71
  */
72
+ public $version = '6.2.2';
73
 
74
  /**
75
  * Plugin file.
includes/admin/admin.php CHANGED
@@ -281,7 +281,13 @@ function monsterinsights_deprecated_notices() {
281
  echo '</p>';
282
  echo '</div>';
283
  } else if ( empty( $updates) && ! isset( $notices ['monsterinsights_automatic_updates' ] ) ){
284
- echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_automatic_updates">';
 
 
 
 
 
 
285
  echo '<p>';
286
  echo sprintf( esc_html__( 'Important: Please %1$sconfigure the Automatic Updates Settings%2$s in MonsterInsights.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' );
287
  echo '</p>';
281
  echo '</p>';
282
  echo '</div>';
283
  } else if ( empty( $updates) && ! isset( $notices ['monsterinsights_automatic_updates' ] ) ){
284
+ if ( defined( 'MONSTERINSIGHTS_SHOWING_EMPTY_CONFIG_NOTICE' ) && MONSTERINSIGHTS_SHOWING_EMPTY_CONFIG_NOTICE ) {
285
+ return;
286
+ }
287
+ if ( defined( 'MONSTERINSIGHTS_SHOWING_OPTIN_TRACKING_NOTICE' ) && MONSTERINSIGHTS_SHOWING_OPTIN_TRACKING_NOTICE ) {
288
+ return;
289
+ }
290
+ echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_automatic_updates">';
291
  echo '<p>';
292
  echo sprintf( esc_html__( 'Important: Please %1$sconfigure the Automatic Updates Settings%2$s in MonsterInsights.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' );
293
  echo '</p>';
includes/admin/common.php CHANGED
@@ -244,6 +244,8 @@ function monsterinsights_remove_conflicting_asset_files() {
244
  'tweeetshare_notice_style', // TweetShare - Click To Tweet
245
  'tweeetshare_theme_style', // TweetShare - Click To Tweet
246
  'tweeetshare_tweet_box_style', // TweetShare - Click To Tweet
 
 
247
  );
248
 
249
  $scripts = array(
244
  'tweeetshare_notice_style', // TweetShare - Click To Tweet
245
  'tweeetshare_theme_style', // TweetShare - Click To Tweet
246
  'tweeetshare_tweet_box_style', // TweetShare - Click To Tweet
247
+ 'soultype2-admin', // SoulType Plugin
248
+ 'thesis-options-stylesheet', // Thesis Options Stylesheet
249
  );
250
 
251
  $scripts = array(
includes/admin/google.php CHANGED
@@ -183,7 +183,7 @@ final class MonsterInsights_GA {
183
  private function get_notices() {
184
  // Notice for no manual or profile GA
185
  if ( $this->status === 'empty' ) {
186
- add_action( 'admin_notices', array( $this, 'monsterinsights_show_admin_config_empty_notice' ) );
187
  }
188
 
189
  $current_page = filter_input( INPUT_GET, 'page' );
@@ -196,17 +196,17 @@ final class MonsterInsights_GA {
196
 
197
  // Notice for GA Access token expired (needs re-authenticate)
198
  if ( $this->status === 'expired' ) {
199
- add_action( 'admin_notices', array( $this, 'monsterinsights_show_admin_config_expired_notice' ) );
200
  }
201
 
202
  // Notice for Needs Permissions
203
  if ( $this->status === 'needs-permissions' ) {
204
- add_action( 'admin_notices', array( $this, 'monsterinsights_show_admin_config_needs_permissions_notice' ) );
205
  }
206
 
207
  // Notice for trouble connecting to Google
208
  if ( $this->status === 'blocked' ) {
209
- add_action( 'admin_notices', array( $this, 'monsterinsights_show_admin_config_blocked_notice' ) );
210
  }
211
  }
212
  }
@@ -795,6 +795,10 @@ final class MonsterInsights_GA {
795
  if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) !== false ) {
796
  return;
797
  }
 
 
 
 
798
  echo '<div class="error"><p>' .
799
  sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),
800
  '<a href="' . admin_url( 'admin.php?page=monsterinsights_settings' ) . '">',
183
  private function get_notices() {
184
  // Notice for no manual or profile GA
185
  if ( $this->status === 'empty' ) {
186
+ add_action( 'admin_notices', array( $this, 'monsterinsights_show_admin_config_empty_notice' ),6 );
187
  }
188
 
189
  $current_page = filter_input( INPUT_GET, 'page' );
196
 
197
  // Notice for GA Access token expired (needs re-authenticate)
198
  if ( $this->status === 'expired' ) {
199
+ add_action( 'admin_notices', array( $this, 'monsterinsights_show_admin_config_expired_notice' ),6 );
200
  }
201
 
202
  // Notice for Needs Permissions
203
  if ( $this->status === 'needs-permissions' ) {
204
+ add_action( 'admin_notices', array( $this, 'monsterinsights_show_admin_config_needs_permissions_notice' ),6 );
205
  }
206
 
207
  // Notice for trouble connecting to Google
208
  if ( $this->status === 'blocked' ) {
209
+ add_action( 'admin_notices', array( $this, 'monsterinsights_show_admin_config_blocked_notice' ),6 );
210
  }
211
  }
212
  }
795
  if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) !== false ) {
796
  return;
797
  }
798
+
799
+ if ( ! defined( 'MONSTERINSIGHTS_SHOWING_EMPTY_CONFIG_NOTICE' ) ) {
800
+ define( 'MONSTERINSIGHTS_SHOWING_EMPTY_CONFIG_NOTICE', true );
801
+ }
802
  echo '<div class="error"><p>' .
803
  sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),
804
  '<a href="' . admin_url( 'admin.php?page=monsterinsights_settings' ) . '">',
includes/admin/settings/settings-api.php CHANGED
@@ -415,7 +415,7 @@ add_filter( 'monsterinsights_settings_sanitize_password', 'monsterinsights_sanit
415
  */
416
  function monsterinsights_sanitize_number_field( $value, $id, $setting, $previous_value ) {
417
  if ( is_int( (int) $value ) ) {
418
- return $int;
419
  } else if ( is_int( $previous_value ) ) {
420
  return $previous_value;
421
  } else {
415
  */
416
  function monsterinsights_sanitize_number_field( $value, $id, $setting, $previous_value ) {
417
  if ( is_int( (int) $value ) ) {
418
+ return $value;
419
  } else if ( is_int( $previous_value ) ) {
420
  return $previous_value;
421
  } else {
includes/admin/tracking.php CHANGED
@@ -40,7 +40,7 @@ class MonsterInsights_Tracking {
40
  add_action( 'monsterinsights_settings_save_general_end', array( $this, 'check_for_settings_optin' ) );
41
  add_action( 'admin_head', array( $this, 'check_for_optin' ) );
42
  add_action( 'admin_head', array( $this, 'check_for_optout' ) );
43
- add_action( 'admin_notices', array( $this, 'monsterinsights_admin_notice' ) );
44
  add_filter( 'cron_schedules', array( $this, 'add_schedules' ) );
45
  add_action( 'monsterinsights_daily_cron', array( $this, 'send_checkin' ) );
46
  }
@@ -69,6 +69,7 @@ class MonsterInsights_Tracking {
69
  $theme = $theme_data->Name . ' ' . $theme_data->Version;
70
  $tracking_mode = monsterinsights_get_option( 'tracking_mode', 'analytics' );
71
  $events_mode = monsterinsights_get_option( 'events_mode', 'none' );
 
72
 
73
  if ( $tracking_mode === false ) {
74
  $tracking_mode = 'analytics';
@@ -78,6 +79,10 @@ class MonsterInsights_Tracking {
78
  $events_mode = 'none';
79
  }
80
 
 
 
 
 
81
  $data['php_version'] = phpversion();
82
  $data['mi_version'] = MONSTERINSIGHTS_VERSION;
83
  $data['wp_version'] = get_bloginfo( 'version' );
@@ -92,6 +97,7 @@ class MonsterInsights_Tracking {
92
  $data['setttings'] = monsterinsights_get_options();
93
  $data['tracking_mode'] = $tracking_mode;
94
  $data['events_mode'] = $events_mode;
 
95
 
96
  // Retrieve current plugin information
97
  if( ! function_exists( 'get_plugins' ) ) {
@@ -278,6 +284,10 @@ class MonsterInsights_Tracking {
278
  return;
279
  }
280
 
 
 
 
 
281
  if (
282
  stristr( network_site_url( '/' ), 'dev' ) !== false ||
283
  stristr( network_site_url( '/' ), 'localhost' ) !== false ||
@@ -285,6 +295,9 @@ class MonsterInsights_Tracking {
285
  ) {
286
  update_option( 'monsterinsights_tracking_notice', '1' );
287
  } else {
 
 
 
288
  $optin_url = add_query_arg( 'mi_action', 'opt_into_tracking' );
289
  $optout_url = add_query_arg( 'mi_action', 'opt_out_of_tracking' );
290
  echo '<div class="updated"><p>';
40
  add_action( 'monsterinsights_settings_save_general_end', array( $this, 'check_for_settings_optin' ) );
41
  add_action( 'admin_head', array( $this, 'check_for_optin' ) );
42
  add_action( 'admin_head', array( $this, 'check_for_optout' ) );
43
+ add_action( 'admin_notices', array( $this, 'monsterinsights_admin_notice' ),7 );
44
  add_filter( 'cron_schedules', array( $this, 'add_schedules' ) );
45
  add_action( 'monsterinsights_daily_cron', array( $this, 'send_checkin' ) );
46
  }
69
  $theme = $theme_data->Name . ' ' . $theme_data->Version;
70
  $tracking_mode = monsterinsights_get_option( 'tracking_mode', 'analytics' );
71
  $events_mode = monsterinsights_get_option( 'events_mode', 'none' );
72
+ $update_mode = monsterinsights_get_option( 'automatic_updates', false );
73
 
74
  if ( $tracking_mode === false ) {
75
  $tracking_mode = 'analytics';
79
  $events_mode = 'none';
80
  }
81
 
82
+ if ( $update_mode === false ) {
83
+ $update_mode = 'none';
84
+ }
85
+
86
  $data['php_version'] = phpversion();
87
  $data['mi_version'] = MONSTERINSIGHTS_VERSION;
88
  $data['wp_version'] = get_bloginfo( 'version' );
97
  $data['setttings'] = monsterinsights_get_options();
98
  $data['tracking_mode'] = $tracking_mode;
99
  $data['events_mode'] = $events_mode;
100
+ $data['autoupdate'] = $update_mode;
101
 
102
  // Retrieve current plugin information
103
  if( ! function_exists( 'get_plugins' ) ) {
284
  return;
285
  }
286
 
287
+ if ( defined( 'MONSTERINSIGHTS_SHOWING_EMPTY_CONFIG_NOTICE' ) && MONSTERINSIGHTS_SHOWING_EMPTY_CONFIG_NOTICE ) {
288
+ return;
289
+ }
290
+
291
  if (
292
  stristr( network_site_url( '/' ), 'dev' ) !== false ||
293
  stristr( network_site_url( '/' ), 'localhost' ) !== false ||
295
  ) {
296
  update_option( 'monsterinsights_tracking_notice', '1' );
297
  } else {
298
+ if ( ! defined( 'MONSTERINSIGHTS_SHOWING_OPTIN_TRACKING_NOTICE' ) ) {
299
+ define( 'MONSTERINSIGHTS_SHOWING_OPTIN_TRACKING_NOTICE', true );
300
+ }
301
  $optin_url = add_query_arg( 'mi_action', 'opt_into_tracking' );
302
  $optout_url = add_query_arg( 'mi_action', 'opt_out_of_tracking' );
303
  echo '<div class="updated"><p>';
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.9
6
  Tested up to: 4.8.1
7
- Stable tag: 6.2.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.
@@ -136,6 +136,10 @@ You can also learn about other <a href="http://www.wpbeginner.com/category/plugi
136
  4. Want more features? <a href="https://www.monsterinsights.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion">Purchase MonsterInsights Pro</a>!
137
 
138
  == Changelog ==
 
 
 
 
139
  = 6.2.1: August 9, 2017 =
140
  * New: MonsterInsights now has the ability to automatically update itself and it's addons. You can set MonsterInsights to automatically update minor versions only or all new versions inside the MonsterInsights settings panel in Tracking -> Permissions.
141
  * Tweak: Introduce scrollbars on GA auth screen for users with many Google accounts
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.9
6
  Tested up to: 4.8.1
7
+ Stable tag: 6.2.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.
136
  4. Want more features? <a href="https://www.monsterinsights.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion">Purchase MonsterInsights Pro</a>!
137
 
138
  == Changelog ==
139
+ = 6.2.2: August 16, 2017 =
140
+ * Tweak: Adjusted order of setup/config notices
141
+ * Fix: Fixed an issue with the sanitization of number fields. Solves an issue with the Google Optimize extension.
142
+
143
  = 6.2.1: August 9, 2017 =
144
  * New: MonsterInsights now has the ability to automatically update itself and it's addons. You can set MonsterInsights to automatically update minor versions only or all new versions inside the MonsterInsights settings panel in Tracking -> Permissions.
145
  * Tweak: Introduce scrollbars on GA auth screen for users with many Google accounts