Google Analytics Dashboard for WP (GADWP) - Version 5.1.2.1

Version Description

  • Bug Fixes:
    • fixes multiple GAPI issues
Download this release

Release Info

Developer deconf
Plugin Icon 128x128 Google Analytics Dashboard for WP (GADWP)
Version 5.1.2.1
Comparing to
See all releases

Code changes from version 5.1.2 to 5.1.2.1

Files changed (3) hide show
  1. gadwp.php +2 -2
  2. readme.txt +9 -1
  3. tools/gapi.php +7 -2
gadwp.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://deconf.com
5
  * Description: Displays Google Analytics Reports and Real-Time Statistics in your Dashboard. Automatically inserts the tracking code in every page of your website.
6
  * Author: Alin Marcu
7
- * Version: 5.1.2
8
  * Author URI: https://deconf.com
9
  * Text Domain: google-analytics-dashboard-for-wp
10
  * Domain Path: /languages
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) )
16
 
17
  // Plugin Version
18
  if ( ! defined( 'GADWP_CURRENT_VERSION' ) ) {
19
- define( 'GADWP_CURRENT_VERSION', '5.1.2' );
20
  }
21
 
22
  if ( ! class_exists( 'GADWP_Manager' ) ) {
4
  * Plugin URI: https://deconf.com
5
  * Description: Displays Google Analytics Reports and Real-Time Statistics in your Dashboard. Automatically inserts the tracking code in every page of your website.
6
  * Author: Alin Marcu
7
+ * Version: 5.1.2.2
8
  * Author URI: https://deconf.com
9
  * Text Domain: google-analytics-dashboard-for-wp
10
  * Domain Path: /languages
16
 
17
  // Plugin Version
18
  if ( ! defined( 'GADWP_CURRENT_VERSION' ) ) {
19
+ define( 'GADWP_CURRENT_VERSION', '5.1.2.2' );
20
  }
21
 
22
  if ( ! class_exists( 'GADWP_Manager' ) ) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://deconf.com/donate/
4
  Tags: analytics,google analytics,google analytics dashboard,google analytics plugin,google analytics widget
5
  Requires at least: 3.5
6
  Tested up to: 4.8.2
7
- Stable tag: 5.1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -167,6 +167,14 @@ This is a major update, please read the [release notes](https://deconf.com/googl
167
 
168
  == Changelog ==
169
 
 
 
 
 
 
 
 
 
170
  = 5.1.2 =
171
  * Enhancements:
172
  * adds support for Google AMP Client ID API
4
  Tags: analytics,google analytics,google analytics dashboard,google analytics plugin,google analytics widget
5
  Requires at least: 3.5
6
  Tested up to: 4.8.2
7
+ Stable tag: 5.1.2.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
167
 
168
  == Changelog ==
169
 
170
+ = 5.1.2.2 =
171
+ * Bug Fixes:
172
+ * fixes a GAPI parameter issue
173
+
174
+ = 5.1.2.1 =
175
+ * Bug Fixes:
176
+ * fixes multiple GAPI issues
177
+
178
  = 5.1.2 =
179
  * Enhancements:
180
  * adds support for Google AMP Client ID API
tools/gapi.php CHANGED
@@ -47,7 +47,7 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
47
  }
48
  }
49
  $this->client = new Deconf_Client( $config );
50
- $this->client->setScopes( array( 'https://www.googleapis.com/auth/analytics.readonly', 'https://www.googleapis.com/auth/analytics.edit' ) );
51
  $this->client->setAccessType( 'offline' );
52
  $this->client->setApplicationName( 'Google Analytics Dashboard' );
53
  $this->client->setRedirectUri( 'urn:ietf:wg:oauth:2.0:oob' );
@@ -101,13 +101,16 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
101
  */
102
  public function gapi_errors_handler() {
103
  $errors = GADWP_Tools::get_cache( 'gapi_errors' );
 
104
  if ( false === $errors || ! isset( $errors[0] ) ) { // invalid error
105
  return false;
106
  }
107
- if ( isset( $errors[1][0]['reason'] ) && ( 'invalidCredentials' == $errors[1][0]['reason'] || 'authError' == $errors[1][0]['reason'] || 'insufficientPermissions' == $errors[1][0]['reason'] || 'required' == $errors[1][0]['reason'] || 'keyExpired' == $errors[1][0]['reason'] ) ) {
 
108
  $this->reset_token( false );
109
  return true;
110
  }
 
111
  if ( isset( $errors[1][0]['reason'] ) && ( 'userRateLimitExceeded' == $errors[1][0]['reason'] || 'quotaExceeded' == $errors[1][0]['reason'] ) ) {
112
  if ( $this->gadwp->config->options['api_backoff'] <= 5 ) {
113
  usleep( rand( 1000000, 4500000 ) );
@@ -118,9 +121,11 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
118
  return true;
119
  }
120
  }
 
121
  if ( 500 == $errors[0] || 503 == $errors[0] || 400 == $errors[0] || 401 == $errors[0] || 403 == $errors[0] ) {
122
  return true;
123
  }
 
124
  return false;
125
  }
126
 
47
  }
48
  }
49
  $this->client = new Deconf_Client( $config );
50
+ $this->client->setScopes( array( 'https://www.googleapis.com/auth/analytics.readonly' ) );
51
  $this->client->setAccessType( 'offline' );
52
  $this->client->setApplicationName( 'Google Analytics Dashboard' );
53
  $this->client->setRedirectUri( 'urn:ietf:wg:oauth:2.0:oob' );
101
  */
102
  public function gapi_errors_handler() {
103
  $errors = GADWP_Tools::get_cache( 'gapi_errors' );
104
+
105
  if ( false === $errors || ! isset( $errors[0] ) ) { // invalid error
106
  return false;
107
  }
108
+
109
+ if ( isset( $errors[1][0]['reason'] ) && ( 'badRequest' == $errors[1][0]['reason'] || 'accessNotConfigured' == $errors[1][0]['reason'] || 'invalidCredentials' == $errors[1][0]['reason'] || 'authError' == $errors[1][0]['reason'] || 'insufficientPermissions' == $errors[1][0]['reason'] || 'required' == $errors[1][0]['reason'] || 'keyExpired' == $errors[1][0]['reason'] ) ) {
110
  $this->reset_token( false );
111
  return true;
112
  }
113
+
114
  if ( isset( $errors[1][0]['reason'] ) && ( 'userRateLimitExceeded' == $errors[1][0]['reason'] || 'quotaExceeded' == $errors[1][0]['reason'] ) ) {
115
  if ( $this->gadwp->config->options['api_backoff'] <= 5 ) {
116
  usleep( rand( 1000000, 4500000 ) );
121
  return true;
122
  }
123
  }
124
+
125
  if ( 500 == $errors[0] || 503 == $errors[0] || 400 == $errors[0] || 401 == $errors[0] || 403 == $errors[0] ) {
126
  return true;
127
  }
128
+
129
  return false;
130
  }
131