Google Analytics Dashboard for WP (GADWP) - Version 5.1.2.3

Version Description

  • Bug Fixes:
    • fixes an access token request loop
    • some thrown errors weren't properly stored
Download this release

Release Info

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

Code changes from version 5.1.2.2 to 5.1.2.3

Files changed (3) hide show
  1. gadwp.php +2 -2
  2. readme.txt +7 -2
  3. tools/gapi.php +9 -5
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.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.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.3
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.3' );
20
  }
21
 
22
  if ( ! class_exists( 'GADWP_Manager' ) ) {
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: deconf
3
  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.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -167,6 +167,11 @@ This is a major update, please read the [release notes](https://deconf.com/googl
167
 
168
  == Changelog ==
169
 
 
 
 
 
 
170
  = 5.1.2.2 =
171
  * Bug Fixes:
172
  * fixes a GAPI parameter issue
3
  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.9.1
7
+ Stable tag: 5.1.2.3
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.3 =
171
+ * Bug Fixes:
172
+ * fixes an access token request loop
173
+ * some thrown errors weren't properly stored
174
+
175
  = 5.1.2.2 =
176
  * Bug Fixes:
177
  * fixes a GAPI parameter issue
tools/gapi.php CHANGED
@@ -67,15 +67,19 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
67
  if ( $token ) {
68
  try {
69
  $this->client->setAccessToken( $token );
70
- $gadwp->config->options['ga_dash_token'] = $this->client->getAccessToken();
 
 
 
 
71
  } catch ( Deconf_IO_Exception $e ) {
72
- GADWP_Tools::set_cache( 'ga_dash_lasterror', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $this->error_timeout );
73
  } catch ( Deconf_Service_Exception $e ) {
74
- GADWP_Tools::set_cache( 'ga_dash_lasterror', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . $e->getMessage() ), $this->error_timeout );
75
- GADWP_Tools::set_cache( 'ga_dash_gapi_errors', array( $e->getCode(), (array) $e->getErrors() ), $this->error_timeout );
76
  $this->reset_token();
77
  } catch ( Exception $e ) {
78
- GADWP_Tools::set_cache( 'ga_dash_lasterror', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $this->error_timeout );
79
  $this->reset_token();
80
  }
81
  if ( is_multisite() && $this->gadwp->config->options['ga_dash_network'] ) {
67
  if ( $token ) {
68
  try {
69
  $this->client->setAccessToken( $token );
70
+ if ( $this->client->isAccessTokenExpired() ) {
71
+ $refreshtoken = $this->client->getRefreshToken();
72
+ $this->client->refreshToken( $refreshtoken );
73
+ }
74
+ $this->gadwp->config->options['ga_dash_token'] = $this->client->getAccessToken();
75
  } catch ( Deconf_IO_Exception $e ) {
76
+ GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $this->error_timeout );
77
  } catch ( Deconf_Service_Exception $e ) {
78
+ GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . $e->getMessage() ), $this->error_timeout );
79
+ GADWP_Tools::set_cache( 'gapi_errors', array( $e->getCode(), (array) $e->getErrors() ), $this->error_timeout );
80
  $this->reset_token();
81
  } catch ( Exception $e ) {
82
+ GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $this->error_timeout );
83
  $this->reset_token();
84
  }
85
  if ( is_multisite() && $this->gadwp->config->options['ga_dash_network'] ) {