Google Analytics for WordPress by MonsterInsights - Version 7.3.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.3.2
Comparing to
See all releases

Code changes from version 7.3.0 to 7.3.2

assets/lib/pandora/class-am-notification.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- if ( ! class_exists( 'AM_Notification' ) ) {
4
  /**
5
  * Awesome Motive Notifications
6
  *
@@ -11,7 +11,7 @@ if ( ! class_exists( 'AM_Notification' ) ) {
11
  * @author AwesomeMotive Team
12
  * @license GPL-2.0+
13
  * @copyright Copyright (c) 2018, Awesome Motive LLC
14
- * @version 1.0.6
15
  */
16
  class AM_Notification {
17
 
@@ -77,9 +77,10 @@ if ( ! class_exists( 'AM_Notification' ) ) {
77
  */
78
  public function custom_post_type() {
79
  register_post_type( 'amn_' . $this->plugin, array(
80
- 'label' => $this->plugin . ' Announcements',
81
- 'can_export' => false,
82
- 'supports' => false,
 
83
  ) );
84
  }
85
 
1
  <?php
2
 
3
+ if ( ! class_exists( 'AM_Notification', false ) ) {
4
  /**
5
  * Awesome Motive Notifications
6
  *
11
  * @author AwesomeMotive Team
12
  * @license GPL-2.0+
13
  * @copyright Copyright (c) 2018, Awesome Motive LLC
14
+ * @version 1.0.7
15
  */
16
  class AM_Notification {
17
 
77
  */
78
  public function custom_post_type() {
79
  register_post_type( 'amn_' . $this->plugin, array(
80
+ 'label' => $this->plugin . ' Announcements',
81
+ 'can_export' => false,
82
+ 'supports' => false,
83
+ 'capability_type' => 'manage_options',
84
  ) );
85
  }
86
 
googleanalytics.php CHANGED
@@ -6,12 +6,12 @@
6
  * Author: MonsterInsights
7
  * Author URI: https://www.monsterinsights.com/?utm_source=liteplugin&utm_medium=pluginheader&utm_campaign=authoruri&utm_content=7%2E0%2E0
8
  *
9
- * Version: 7.3.0
10
  * Requires at least: 3.8.0
11
- * Tested up to: 4.9
12
  *
13
  * License: GPL v3
14
- *
15
  * Text Domain: google-analytics-for-wordpress
16
  * Domain Path: /languages
17
  *
@@ -69,7 +69,7 @@ final class MonsterInsights_Lite {
69
  * @access public
70
  * @var string $version Plugin version.
71
  */
72
- public $version = '7.3.0';
73
 
74
  /**
75
  * Plugin file.
@@ -133,7 +133,7 @@ final class MonsterInsights_Lite {
133
  * @var MonsterInsights_Reporting $reporting Instance of Reporting class.
134
  */
135
  public $reporting;
136
-
137
  /**
138
  * Holds instance of MonsterInsights Auth class.
139
  *
@@ -183,7 +183,7 @@ final class MonsterInsights_Lite {
183
  add_action( 'admin_notices', array( self::$instance, 'monsterinsights_wp_notice' ) );
184
  return;
185
  }
186
-
187
  // Detect Pro version and return early
188
  if ( class_exists( 'MonsterInsights' ) && defined( 'GAWP_VERSION' ) ) {
189
  add_action( 'admin_notices', array( self::$instance, 'monsterinsights_pro_notice' ) );
@@ -193,7 +193,7 @@ final class MonsterInsights_Lite {
193
  if ( defined( 'GAWP_ECOMMERCE_PATH' ) ) {
194
  add_action( 'admin_notices', array( self::$instance, 'monsterinsights_old_ecommerce' ) );
195
  }
196
-
197
  // Define constants
198
  self::$instance->define_globals();
199
 
@@ -269,7 +269,7 @@ final class MonsterInsights_Lite {
269
  * Disable unserializing of the class
270
  *
271
  * Attempting to wakeup an MonsterInsights instance will throw a doing it wrong notice.
272
- *
273
  * @since 6.0.0
274
  * @access public
275
  *
@@ -366,7 +366,7 @@ final class MonsterInsights_Lite {
366
  if ( ! defined( 'GAWP_URL' ) ) {
367
  define( 'GAWP_URL', MONSTERINSIGHTS_PLUGIN_URL );
368
  }
369
- }
370
 
371
  /**
372
  * Loads the plugin textdomain for translation.
@@ -385,8 +385,8 @@ final class MonsterInsights_Lite {
385
 
386
  // Traditional WordPress plugin locale filter.
387
  $mi_locale = apply_filters( 'plugin_locale', $mi_locale, 'google-analytics-for-wordpress' );
388
- $mi_mofile = sprintf( '%1$s-%2$s.mo', 'google-analytics-for-wordpress', $mi_locale );
389
-
390
  // Look for wp-content/languages/google-analytics-for-wordpress/google-analytics-for-wordpress-{lang}_{country}.mo
391
  $mi_mofile1 = WP_LANG_DIR . '/google-analytics-for-wordpress/' . $mi_mofile;
392
 
@@ -450,7 +450,7 @@ final class MonsterInsights_Lite {
450
  </div>
451
  <?php
452
  }
453
-
454
  /**
455
  * Output a nag notice if the user has both Lite and Pro activated
456
  *
@@ -480,7 +480,7 @@ final class MonsterInsights_Lite {
480
  *
481
  * @since 6.0.0
482
  * @access public
483
- *
484
  * @return void
485
  */
486
  public function load_settings() {
@@ -499,7 +499,7 @@ final class MonsterInsights_Lite {
499
  *
500
  * @since 7.0.0
501
  * @access public
502
- *
503
  * @return void
504
  */
505
  public function load_licensing(){
@@ -516,7 +516,7 @@ final class MonsterInsights_Lite {
516
  *
517
  * @since 7.0.0
518
  * @access public
519
- *
520
  * @return void
521
  */
522
  public function load_auth() {
@@ -560,8 +560,8 @@ final class MonsterInsights_Lite {
560
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/pages/tracking.php';
561
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/pages/tools.php';
562
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/pages/reports.php';
563
-
564
- // Both
565
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/pages/addons.php';
566
 
567
  // Settings Tabs
@@ -569,10 +569,10 @@ final class MonsterInsights_Lite {
569
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/settings/tab-tracking.php';
570
  //require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/settings/tab-status.php';
571
  //require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/settings/tab-support.php';
572
-
573
  // Register Settings + Settings API
574
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/settings/settings-api.php';
575
- require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/settings/register-settings.php';
576
 
577
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/api-auth.php';
578
 
@@ -635,18 +635,18 @@ final class MonsterInsights_Lite {
635
  function monsterinsights_lite_activation_hook( $network_wide ) {
636
 
637
  global $wp_version;
638
-
639
  $url = admin_url( 'plugins.php' );
640
  // Check for MS dashboard
641
  if ( is_network_admin() ) {
642
  $url = network_admin_url( 'plugins.php' );
643
  }
644
-
645
  if ( version_compare( $wp_version, '3.8', '<' ) && ( ! defined( 'MONSTERINSIGHTS_FORCE_ACTIVATION' ) || ! MONSTERINSIGHTS_FORCE_ACTIVATION ) ) {
646
  deactivate_plugins( plugin_basename( __FILE__ ) );
647
  wp_die( sprintf( esc_html__( '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.', 'google-analytics-by-wordpress' ), '<strong>', '</strong>', '<a href="' . $url . '">', '</a>' ) );
648
  }
649
-
650
  if ( class_exists( 'MonsterInsights' ) ) {
651
  deactivate_plugins( plugin_basename( __FILE__ ) );
652
  wp_die( sprintf( esc_html__( '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.', 'google-analytics-by-wordpress' ), '<a href="' . $url . '">', '</a>' ) );
@@ -659,7 +659,7 @@ register_activation_hook( __FILE__, 'monsterinsights_lite_activation_hook' );
659
  *
660
  * @access public
661
  * @since 6.0.0
662
- *
663
  * @return void
664
  */
665
  function monsterinsights_lite_uninstall_hook() {
@@ -721,7 +721,7 @@ register_uninstall_hook( __FILE__, 'monsterinsights_lite_uninstall_hook' );
721
  * @since 6.0.0
722
  *
723
  * @uses MonsterInsights_Lite::get_instance() Retrieve MonsterInsights_Lite instance.
724
- *
725
  * @return MonsterInsights_Lite The singleton MonsterInsights_Lite instance.
726
  */
727
  function MonsterInsights_Lite() {
@@ -741,7 +741,7 @@ function MonsterInsights_Lite() {
741
  * @global string $wp_version WordPress version (provided by WordPress core).
742
  * @uses MonsterInsights_Lite::load_settings() Loads MonsterInsights settings
743
  * @uses MonsterInsights_Install::init() Runs upgrade process
744
- *
745
  * @return void
746
  */
747
  function monsterinsights_lite_install_and_upgrade() {
@@ -792,7 +792,7 @@ function monsterinsights_lite_install_and_upgrade() {
792
  * @access public
793
  *
794
  * @uses MonsterInsights_Install() Runs install and upgrade process.
795
- *
796
  * @return void
797
  */
798
  function monsterinsights_lite_call_install_and_upgrade(){
@@ -801,10 +801,10 @@ function monsterinsights_lite_call_install_and_upgrade(){
801
 
802
  /**
803
  * Returns the MonsterInsights combined object that you can use for both
804
- * MonsterInsights Lite and Pro Users. When both plugins active, defers to the
805
- * more complete Pro object.
806
  *
807
- * Warning: Do not use this in Lite or Pro specific code (use the individual objects instead).
808
  * Also do not use in the MonsterInsights Lite/Pro upgrade and install routines.
809
  *
810
  * Use this function like you would a global variable, except without needing
@@ -819,7 +819,7 @@ function monsterinsights_lite_call_install_and_upgrade(){
819
  *
820
  * @uses MonsterInsights::get_instance() Retrieve MonsterInsights Pro instance.
821
  * @uses MonsterInsights_Lite::get_instance() Retrieve MonsterInsights Lite instance.
822
- *
823
  * @return MonsterInsights The singleton MonsterInsights instance.
824
  */
825
  if ( ! function_exists( 'MonsterInsights' ) ) {
@@ -827,4 +827,4 @@ if ( ! function_exists( 'MonsterInsights' ) ) {
827
  return ( class_exists( 'MonsterInsights' ) ? MonsterInsights_Pro() : MonsterInsights_Lite() );
828
  }
829
  add_action( 'plugins_loaded', 'MonsterInsights' );
830
- }
6
  * Author: MonsterInsights
7
  * Author URI: https://www.monsterinsights.com/?utm_source=liteplugin&utm_medium=pluginheader&utm_campaign=authoruri&utm_content=7%2E0%2E0
8
  *
9
+ * Version: 7.3.2
10
  * Requires at least: 3.8.0
11
+ * Tested up to: 5.0
12
  *
13
  * License: GPL v3
14
+ *
15
  * Text Domain: google-analytics-for-wordpress
16
  * Domain Path: /languages
17
  *
69
  * @access public
70
  * @var string $version Plugin version.
71
  */
72
+ public $version = '7.3.2';
73
 
74
  /**
75
  * Plugin file.
133
  * @var MonsterInsights_Reporting $reporting Instance of Reporting class.
134
  */
135
  public $reporting;
136
+
137
  /**
138
  * Holds instance of MonsterInsights Auth class.
139
  *
183
  add_action( 'admin_notices', array( self::$instance, 'monsterinsights_wp_notice' ) );
184
  return;
185
  }
186
+
187
  // Detect Pro version and return early
188
  if ( class_exists( 'MonsterInsights' ) && defined( 'GAWP_VERSION' ) ) {
189
  add_action( 'admin_notices', array( self::$instance, 'monsterinsights_pro_notice' ) );
193
  if ( defined( 'GAWP_ECOMMERCE_PATH' ) ) {
194
  add_action( 'admin_notices', array( self::$instance, 'monsterinsights_old_ecommerce' ) );
195
  }
196
+
197
  // Define constants
198
  self::$instance->define_globals();
199
 
269
  * Disable unserializing of the class
270
  *
271
  * Attempting to wakeup an MonsterInsights instance will throw a doing it wrong notice.
272
+ *
273
  * @since 6.0.0
274
  * @access public
275
  *
366
  if ( ! defined( 'GAWP_URL' ) ) {
367
  define( 'GAWP_URL', MONSTERINSIGHTS_PLUGIN_URL );
368
  }
369
+ }
370
 
371
  /**
372
  * Loads the plugin textdomain for translation.
385
 
386
  // Traditional WordPress plugin locale filter.
387
  $mi_locale = apply_filters( 'plugin_locale', $mi_locale, 'google-analytics-for-wordpress' );
388
+ $mi_mofile = sprintf( '%1$s-%2$s.mo', 'google-analytics-for-wordpress', $mi_locale );
389
+
390
  // Look for wp-content/languages/google-analytics-for-wordpress/google-analytics-for-wordpress-{lang}_{country}.mo
391
  $mi_mofile1 = WP_LANG_DIR . '/google-analytics-for-wordpress/' . $mi_mofile;
392
 
450
  </div>
451
  <?php
452
  }
453
+
454
  /**
455
  * Output a nag notice if the user has both Lite and Pro activated
456
  *
480
  *
481
  * @since 6.0.0
482
  * @access public
483
+ *
484
  * @return void
485
  */
486
  public function load_settings() {
499
  *
500
  * @since 7.0.0
501
  * @access public
502
+ *
503
  * @return void
504
  */
505
  public function load_licensing(){
516
  *
517
  * @since 7.0.0
518
  * @access public
519
+ *
520
  * @return void
521
  */
522
  public function load_auth() {
560
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/pages/tracking.php';
561
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/pages/tools.php';
562
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/pages/reports.php';
563
+
564
+ // Both
565
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/pages/addons.php';
566
 
567
  // Settings Tabs
569
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/settings/tab-tracking.php';
570
  //require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/settings/tab-status.php';
571
  //require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/settings/tab-support.php';
572
+
573
  // Register Settings + Settings API
574
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/settings/settings-api.php';
575
+ require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/settings/register-settings.php';
576
 
577
  require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/api-auth.php';
578
 
635
  function monsterinsights_lite_activation_hook( $network_wide ) {
636
 
637
  global $wp_version;
638
+
639
  $url = admin_url( 'plugins.php' );
640
  // Check for MS dashboard
641
  if ( is_network_admin() ) {
642
  $url = network_admin_url( 'plugins.php' );
643
  }
644
+
645
  if ( version_compare( $wp_version, '3.8', '<' ) && ( ! defined( 'MONSTERINSIGHTS_FORCE_ACTIVATION' ) || ! MONSTERINSIGHTS_FORCE_ACTIVATION ) ) {
646
  deactivate_plugins( plugin_basename( __FILE__ ) );
647
  wp_die( sprintf( esc_html__( '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.', 'google-analytics-by-wordpress' ), '<strong>', '</strong>', '<a href="' . $url . '">', '</a>' ) );
648
  }
649
+
650
  if ( class_exists( 'MonsterInsights' ) ) {
651
  deactivate_plugins( plugin_basename( __FILE__ ) );
652
  wp_die( sprintf( esc_html__( '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.', 'google-analytics-by-wordpress' ), '<a href="' . $url . '">', '</a>' ) );
659
  *
660
  * @access public
661
  * @since 6.0.0
662
+ *
663
  * @return void
664
  */
665
  function monsterinsights_lite_uninstall_hook() {
721
  * @since 6.0.0
722
  *
723
  * @uses MonsterInsights_Lite::get_instance() Retrieve MonsterInsights_Lite instance.
724
+ *
725
  * @return MonsterInsights_Lite The singleton MonsterInsights_Lite instance.
726
  */
727
  function MonsterInsights_Lite() {
741
  * @global string $wp_version WordPress version (provided by WordPress core).
742
  * @uses MonsterInsights_Lite::load_settings() Loads MonsterInsights settings
743
  * @uses MonsterInsights_Install::init() Runs upgrade process
744
+ *
745
  * @return void
746
  */
747
  function monsterinsights_lite_install_and_upgrade() {
792
  * @access public
793
  *
794
  * @uses MonsterInsights_Install() Runs install and upgrade process.
795
+ *
796
  * @return void
797
  */
798
  function monsterinsights_lite_call_install_and_upgrade(){
801
 
802
  /**
803
  * Returns the MonsterInsights combined object that you can use for both
804
+ * MonsterInsights Lite and Pro Users. When both plugins active, defers to the
805
+ * more complete Pro object.
806
  *
807
+ * Warning: Do not use this in Lite or Pro specific code (use the individual objects instead).
808
  * Also do not use in the MonsterInsights Lite/Pro upgrade and install routines.
809
  *
810
  * Use this function like you would a global variable, except without needing
819
  *
820
  * @uses MonsterInsights::get_instance() Retrieve MonsterInsights Pro instance.
821
  * @uses MonsterInsights_Lite::get_instance() Retrieve MonsterInsights Lite instance.
822
+ *
823
  * @return MonsterInsights The singleton MonsterInsights instance.
824
  */
825
  if ( ! function_exists( 'MonsterInsights' ) ) {
827
  return ( class_exists( 'MonsterInsights' ) ? MonsterInsights_Pro() : MonsterInsights_Lite() );
828
  }
829
  add_action( 'plugins_loaded', 'MonsterInsights' );
830
+ }
includes/admin/api-auth.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Google Client admin class.
4
  *
5
  * Handles retrieving whether a particular notice has been dismissed or not,
6
  * as well as marking a notice as dismissed.
@@ -37,7 +37,7 @@ final class MonsterInsights_API_Auth {
37
  add_action( 'admin_init', array( $this, 'reauthenticate_listener' ) );
38
 
39
  add_action( 'wp_ajax_nopriv_monsterinsights_is_installed', array( $this, 'is_installed' ) );
40
- add_action( 'wp_ajax_nopriv_monsterinsights_rauthenticate', array( $this, 'authenticate' ) );
41
  }
42
 
43
  public function get_tt(){
@@ -122,7 +122,7 @@ final class MonsterInsights_API_Auth {
122
  wp_send_json_success( array( 'redirect' => $siteurl ) );
123
  }
124
 
125
- public function authenticate() {
126
  // Check for missing params
127
  $reqd_args = array( 'key', 'token', 'ua', 'miview', 'a', 'w', 'p', 'tt', 'network' );
128
  foreach ( $reqd_args as $arg ) {
@@ -149,59 +149,7 @@ final class MonsterInsights_API_Auth {
149
  );
150
  }
151
 
152
- // Invalid UA code
153
- $ua = monsterinsights_is_valid_ua( $_REQUEST['ua'] );
154
- if ( empty( $ua ) ) {
155
- wp_send_json_error(
156
- array(
157
- 'error' => 'authenticate_invalid_ua',
158
- 'message' => 'Invalid UA code sent',
159
- 'version' => MONSTERINSIGHTS_VERSION,
160
- 'pro' => monsterinsights_is_pro_version(),
161
- )
162
- );
163
- }
164
-
165
- $profile = array(
166
- 'key' => sanitize_text_field( $_REQUEST['key'] ),
167
- 'token' => sanitize_text_field( $_REQUEST['token'] ),
168
- 'ua' => monsterinsights_is_valid_ua( $_REQUEST['ua'] ),
169
- 'viewname' => sanitize_text_field( $_REQUEST['miview'] ),
170
- 'a' => sanitize_text_field( $_REQUEST['a'] ),
171
- 'w' => sanitize_text_field( $_REQUEST['w'] ),
172
- 'p' => sanitize_text_field( $_REQUEST['p'] ),
173
- 'siteurl' => site_url(),
174
- 'neturl' => network_admin_url(),
175
- );
176
-
177
- $worked = $this->verify_auth( $profile );
178
- if ( ! $worked || is_wp_error( $worked ) ) {
179
- wp_send_json_error(
180
- array(
181
- 'error' => 'authenticate_auth_verification_failed',
182
- 'message' => 'Authenticate verification failed',
183
- 'version' => MONSTERINSIGHTS_VERSION,
184
- 'pro' => monsterinsights_is_pro_version(),
185
- 'payload' => is_wp_error( $worked ) ? $worked->get_error_messages() : false,
186
- )
187
- );
188
- }
189
-
190
- // Rotate tt
191
- $this->rotate_tt();
192
-
193
- // Save Profile
194
- $is_network = $_REQUEST['network'] === 'network';
195
- if ( $is_network ) {
196
- MonsterInsights()->auth->set_network_analytics_profile( $profile );
197
- } else {
198
- MonsterInsights()->auth->set_analytics_profile( $profile );
199
- }
200
-
201
- // Clear cache
202
- $where = $is_network ? 'network' : 'site';
203
- MonsterInsights()->reporting->delete_aggregate_data( $where );
204
-
205
  wp_send_json_success();
206
  }
207
 
@@ -239,7 +187,7 @@ final class MonsterInsights_API_Auth {
239
  return;
240
  }
241
 
242
- $profile = array(
243
  'key' => sanitize_text_field( $_REQUEST['key'] ),
244
  'token' => sanitize_text_field( $_REQUEST['token'] ),
245
  'ua' => monsterinsights_is_valid_ua( $_REQUEST['ua'] ),
@@ -346,7 +294,7 @@ final class MonsterInsights_API_Auth {
346
  empty( $_REQUEST['miview'] ) ||
347
  empty( $_REQUEST['a'] ) ||
348
  empty( $_REQUEST['w'] ) ||
349
- empty( $_REQUEST['p'] )
350
  ) {
351
  return;
352
  }
@@ -438,7 +386,7 @@ final class MonsterInsights_API_Auth {
438
  $network = ! empty( $_REQUEST['network'] ) ? $_REQUEST['network'] === 'network' : $this->is_network_admin();
439
  $api = new MonsterInsights_API_Request( $this->get_route( 'auth/verify/{type}/' ), array( 'network' => $network, 'tt' => $this->get_tt(), 'key' => $creds['key'], 'token' => $creds['token'] ) );
440
  $ret = $api->request();
441
-
442
  if ( is_wp_error( $ret ) ) {
443
  return $ret;
444
  } else {
@@ -591,4 +539,4 @@ final class MonsterInsights_API_Auth {
591
  $sitei = ( strlen($sitei) > 30 ) ? substr($sitei, 0, 30 ) : $sitei;
592
  return $sitei;
593
  }
594
- }
1
  <?php
2
  /**
3
+ * Google Client admin class.
4
  *
5
  * Handles retrieving whether a particular notice has been dismissed or not,
6
  * as well as marking a notice as dismissed.
37
  add_action( 'admin_init', array( $this, 'reauthenticate_listener' ) );
38
 
39
  add_action( 'wp_ajax_nopriv_monsterinsights_is_installed', array( $this, 'is_installed' ) );
40
+ add_action( 'wp_ajax_nopriv_monsterinsights_rauthenticate', array( $this, 'rauthenticate' ) );
41
  }
42
 
43
  public function get_tt(){
122
  wp_send_json_success( array( 'redirect' => $siteurl ) );
123
  }
124
 
125
+ public function rauthenticate() {
126
  // Check for missing params
127
  $reqd_args = array( 'key', 'token', 'ua', 'miview', 'a', 'w', 'p', 'tt', 'network' );
128
  foreach ( $reqd_args as $arg ) {
149
  );
150
  }
151
 
152
+ // If the tt is validated, send a success response to trigger the regular auth process.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  wp_send_json_success();
154
  }
155
 
187
  return;
188
  }
189
 
190
+ $profile = array(
191
  'key' => sanitize_text_field( $_REQUEST['key'] ),
192
  'token' => sanitize_text_field( $_REQUEST['token'] ),
193
  'ua' => monsterinsights_is_valid_ua( $_REQUEST['ua'] ),
294
  empty( $_REQUEST['miview'] ) ||
295
  empty( $_REQUEST['a'] ) ||
296
  empty( $_REQUEST['w'] ) ||
297
+ empty( $_REQUEST['p'] )
298
  ) {
299
  return;
300
  }
386
  $network = ! empty( $_REQUEST['network'] ) ? $_REQUEST['network'] === 'network' : $this->is_network_admin();
387
  $api = new MonsterInsights_API_Request( $this->get_route( 'auth/verify/{type}/' ), array( 'network' => $network, 'tt' => $this->get_tt(), 'key' => $creds['key'], 'token' => $creds['token'] ) );
388
  $ret = $api->request();
389
+
390
  if ( is_wp_error( $ret ) ) {
391
  return $ret;
392
  } else {
539
  $sitei = ( strlen($sitei) > 30 ) ? substr($sitei, 0, 30 ) : $sitei;
540
  return $sitei;
541
  }
542
+ }
includes/admin/common.php CHANGED
@@ -326,6 +326,7 @@ function monsterinsights_remove_conflicting_asset_files() {
326
  'c2c_BlogTime', // Fix for Blog Time plugin
327
  'material-wp', // Fix for MaterialWP plugin
328
  'wp-color-picker-alpha', // Fix for MaterialWP plugin
 
329
  'swifty-img-widget-admin-script', // Fix for Swifty Image Widget.
330
  );
331
 
326
  'c2c_BlogTime', // Fix for Blog Time plugin
327
  'material-wp', // Fix for MaterialWP plugin
328
  'wp-color-picker-alpha', // Fix for MaterialWP plugin
329
+ 'grandtour-theme-script', // Grandtour Theme
330
  'swifty-img-widget-admin-script', // Fix for Swifty Image Widget.
331
  );
332
 
includes/admin/reports/abstract-report.php CHANGED
@@ -166,11 +166,13 @@ class MonsterInsights_Report {
166
  }
167
 
168
  if ( ( $start !== $this->default_start_date() || $end !== $this->default_end_date() ) && ! monsterinsights_is_pro_version() ) {
169
- return array(
170
- 'success' => false,
171
- 'error' => __( 'Please upgrade to MonsterInsights Pro to use custom date ranges.', 'google-analytics-for-wordpress' ),
172
- 'data' => array(),
173
- );
 
 
174
  }
175
 
176
  $error = apply_filters( 'monsterinsights_reports_abstract_get_data_pre_cache', false, $args, $this->name );
166
  }
167
 
168
  if ( ( $start !== $this->default_start_date() || $end !== $this->default_end_date() ) && ! monsterinsights_is_pro_version() ) {
169
+ $start = $this->default_start_date();
170
+ $end = $this->default_end_date();
171
+ // return array(
172
+ // 'success' => false,
173
+ // 'error' => __( 'Please upgrade to MonsterInsights Pro to use custom date ranges.', 'google-analytics-for-wordpress' ),
174
+ // 'data' => array(),
175
+ // );
176
  }
177
 
178
  $error = apply_filters( 'monsterinsights_reports_abstract_get_data_pre_cache', false, $args, $this->name );
readme.txt CHANGED
@@ -3,17 +3,17 @@ Contributors: chriscct7, smub
3
  Donate link: http://www.wpbeginner.com/wpbeginner-needs-your-help/
4
  Tags: WordPress analytics, google analytics, google analytics dashboard, google analytics widget, WooCommerce stats, analytics dashboard, universal google analytics, statistics, tracking, stats, google, 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.3.0
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.
11
 
12
  == Description ==
13
 
14
  = Google Analytics Plugin for WordPress =
15
 
16
- We believe that it's easy to double your traffic and sales when you know exactly how people find and use your website. <a href="https://www.monsterinsights.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend" title="MonsterInsights">MonsterInsights</a> shows you the stats that matter, so you can grow your business with confidence.
17
 
18
  With over 2 million active installs, MonsterInsights is the most popular Google Analytics plugin for WordPress.
19
 
@@ -273,6 +273,10 @@ You can also learn about other <a href="http://www.wpbeginner.com/category/plugi
273
  4. Want more features? <a href="https://www.monsterinsights.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion">Purchase MonsterInsights Pro</a>!
274
 
275
  == Changelog ==
 
 
 
 
276
  = 7.3.0: October 30, 2018 =
277
  - New: We've added new custom link attribution, so now you can easily set custom link categories, actions, and labels, which MonsterInsights will use with precedence over our comprehensive automatic link detection, and is compatible with our AMP addon. For usage instructions, see our documentation on <a href="https://www.monsterinsights.com/docs/custom-link-attribution/">custom link attribution</a>.
278
  - Tweak: Better error handling for reports.
3
  Donate link: http://www.wpbeginner.com/wpbeginner-needs-your-help/
4
  Tags: WordPress analytics, google analytics, google analytics dashboard, google analytics widget, WooCommerce stats, analytics dashboard, universal google analytics, statistics, tracking, stats, google, 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: 5.0
7
+ Stable tag: 7.3.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.
11
 
12
  == Description ==
13
 
14
  = Google Analytics Plugin for WordPress =
15
 
16
+ We believe that it's easy to double your traffic and sales when you know exactly how people find and use your website. <a href="https://www.monsterinsights.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend" title="MonsterInsights">MonsterInsights</a> shows you the stats that matter, so you can grow your business with confidence.
17
 
18
  With over 2 million active installs, MonsterInsights is the most popular Google Analytics plugin for WordPress.
19
 
273
  4. Want more features? <a href="https://www.monsterinsights.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion">Purchase MonsterInsights Pro</a>!
274
 
275
  == Changelog ==
276
+ = 7.3.2: November 27, 2018 =
277
+ - Fixed: Issue on some Lite installs where timezone differences caused users to see an error related to custom date ranges.
278
+ - Fixed: Issue where some users were unable to reauthenticate their site.
279
+
280
  = 7.3.0: October 30, 2018 =
281
  - New: We've added new custom link attribution, so now you can easily set custom link categories, actions, and labels, which MonsterInsights will use with precedence over our comprehensive automatic link detection, and is compatible with our AMP addon. For usage instructions, see our documentation on <a href="https://www.monsterinsights.com/docs/custom-link-attribution/">custom link attribution</a>.
282
  - Tweak: Better error handling for reports.