Google Analytics Dashboard for WP (GADWP) - Version 4.9.1.1

Version Description

  • Bug Fix: focusFlag preventing Real-Time reports from refreshing properly
  • Bug Fix: date format is not properly localized in daily/monthly reports
  • Bug Fix: reports loading issues on WordPress 4.4
Download this release

Release Info

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

Code changes from version 4.9.1 to 4.9.1.1

Files changed (5) hide show
  1. common/js/reports.js +15 -13
  2. front/widgets.php +3 -3
  3. gadwp.php +2 -2
  4. readme.txt +6 -1
  5. tools/gapi.php +3 -3
common/js/reports.js CHANGED
@@ -1,9 +1,11 @@
1
  "use strict";
2
 
3
- google.load( "visualization", "1", {
4
- packages : [ "corechart", "table", "orgchart", "geochart" ],
5
- 'language' : gadwp_item_data.language,
6
- 'callback' : GADWPLoad
 
 
7
  } );
8
 
9
  // Get the numeric ID
@@ -505,8 +507,8 @@ jQuery.fn.extend( {
505
  return ( "<p><center><strong>" + pagetitle + "</strong></center></p>" + tablerfr + tablekwd + tablescl + tablecpg + tabledrt );
506
  },
507
 
508
- rt_refresh : function ( focusFlag ) {
509
- if ( focusFlag ) {
510
  post_data.from = false;
511
  post_data.to = false;
512
  post_data.query = 'realtime';
@@ -522,7 +524,6 @@ jQuery.fn.extend( {
522
  NProgress.done();
523
 
524
  } );
525
-
526
  }
527
  },
528
 
@@ -798,12 +799,13 @@ jQuery.fn.extend( {
798
  }
799
  }
800
  if ( period == 'realtime' ) {
801
- focusFlag = 1;
 
802
 
803
  jQuery( window ).bind( "focus", function ( event ) {
804
- focusFlag = 1;
805
  } ).bind( "blur", function ( event ) {
806
- focusFlag = 0;
807
  } );
808
 
809
  tpl = '<div id="gadwp-realtime' + slug + '">';
@@ -844,10 +846,10 @@ jQuery.fn.extend( {
844
  tpl += '</div>';
845
 
846
  jQuery( '#gadwp-reports' + slug ).html( tpl );
 
 
847
 
848
- reports.rt_refresh( focusFlag );
849
-
850
- reports.realtime_running = setInterval( reports.rt_refresh.bind( focusFlag ), 6000 );
851
 
852
  } else {
853
  if ( jQuery.inArray( query, [ 'referrers', 'contentpages', 'searches' ] ) > -1 ) {
1
  "use strict";
2
 
3
+ jQuery( function () {
4
+ google.load( "visualization", "1", {
5
+ packages : [ "corechart", "table", "orgchart", "geochart" ],
6
+ 'language' : gadwp_item_data.language,
7
+ 'callback' : GADWPLoad
8
+ } );
9
  } );
10
 
11
  // Get the numeric ID
507
  return ( "<p><center><strong>" + pagetitle + "</strong></center></p>" + tablerfr + tablekwd + tablescl + tablecpg + tabledrt );
508
  },
509
 
510
+ rt_refresh : function ( ) {
511
+ if ( reports.render.focusFlag ) {
512
  post_data.from = false;
513
  post_data.to = false;
514
  post_data.query = 'realtime';
524
  NProgress.done();
525
 
526
  } );
 
527
  }
528
  },
529
 
799
  }
800
  }
801
  if ( period == 'realtime' ) {
802
+
803
+ reports.render.focusFlag = 1;
804
 
805
  jQuery( window ).bind( "focus", function ( event ) {
806
+ reports.render.focusFlag = 1;
807
  } ).bind( "blur", function ( event ) {
808
+ reports.render.focusFlag = 0;
809
  } );
810
 
811
  tpl = '<div id="gadwp-realtime' + slug + '">';
846
  tpl += '</div>';
847
 
848
  jQuery( '#gadwp-reports' + slug ).html( tpl );
849
+
850
+ reports.rt_refresh( reports.render.focusFlag );
851
 
852
+ reports.realtime_running = setInterval( reports.rt_refresh, 55000 );
 
 
853
 
854
  } else {
855
  if ( jQuery.inArray( query, [ 'referrers', 'contentpages', 'searches' ] ) > -1 ) {
front/widgets.php CHANGED
@@ -28,7 +28,7 @@ final class GADWP_Frontend_Widget extends WP_Widget {
28
  public function load_styles_scripts() {
29
  wp_enqueue_style( 'gadwp-front-widget', GADWP_URL . 'front/css/widgets.css', null, GADWP_CURRENT_VERSION );
30
  wp_enqueue_script( 'gadwp-front-widget', GADWP_URL . 'front/js/widgets.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
31
- wp_enqueue_script( 'googlejsapi', 'https://www.google.com/jsapi' );
32
  }
33
 
34
  public function widget( $args, $instance ) {
@@ -85,7 +85,7 @@ final class GADWP_Frontend_Widget extends WP_Widget {
85
  break;
86
  }
87
  echo '<script type="text/javascript">
88
-
89
  jQuery.post("' . admin_url( 'admin-ajax.php' ) . '", {action: "gadash_get_frontendwidget_data",gadash_number: "' . $this->number . '",gadash_optionname: "' . $this->option_name . '"}, function(response){
90
  if (!jQuery.isNumeric(response) && jQuery.isArray(response)){
91
  if (jQuery("#gadwp-widgetchart")[0]){
@@ -99,7 +99,7 @@ final class GADWP_Frontend_Widget extends WP_Widget {
99
  jQuery("#gadwp-widgetchart").css({"background-color":"#F7F7F7","height":"auto","padding-top":"50px","padding-bottom":"50px","color":"#000","text-align":"center"});
100
  jQuery("#gadwp-widgetchart").html("' . __( "This report is unavailable", 'google-analytics-dashboard-for-wp' ) . ' ("+response+")");
101
  }
102
- });';
103
  echo 'google.load("visualization", "1", {packages:["corechart"], "language" : "'. get_bloginfo( 'language' ) . '"});
104
  function ga_dash_drawfwidgetsessions(response) {
105
  var data = google.visualization.arrayToDataTable(response);
28
  public function load_styles_scripts() {
29
  wp_enqueue_style( 'gadwp-front-widget', GADWP_URL . 'front/css/widgets.css', null, GADWP_CURRENT_VERSION );
30
  wp_enqueue_script( 'gadwp-front-widget', GADWP_URL . 'front/js/widgets.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
31
+ wp_enqueue_script( 'gadwp-jsapi', 'https://www.google.com/jsapi' );
32
  }
33
 
34
  public function widget( $args, $instance ) {
85
  break;
86
  }
87
  echo '<script type="text/javascript">
88
+ jQuery( function () {
89
  jQuery.post("' . admin_url( 'admin-ajax.php' ) . '", {action: "gadash_get_frontendwidget_data",gadash_number: "' . $this->number . '",gadash_optionname: "' . $this->option_name . '"}, function(response){
90
  if (!jQuery.isNumeric(response) && jQuery.isArray(response)){
91
  if (jQuery("#gadwp-widgetchart")[0]){
99
  jQuery("#gadwp-widgetchart").css({"background-color":"#F7F7F7","height":"auto","padding-top":"50px","padding-bottom":"50px","color":"#000","text-align":"center"});
100
  jQuery("#gadwp-widgetchart").html("' . __( "This report is unavailable", 'google-analytics-dashboard-for-wp' ) . ' ("+response+")");
101
  }
102
+ });});';
103
  echo 'google.load("visualization", "1", {packages:["corechart"], "language" : "'. get_bloginfo( 'language' ) . '"});
104
  function ga_dash_drawfwidgetsessions(response) {
105
  var data = google.visualization.arrayToDataTable(response);
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: 4.9.1
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', '4.9.1' );
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: 4.9.1.1
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', '4.9.1.1' );
20
  }
21
 
22
  if ( ! class_exists( 'GADWP_Manager' ) ) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://deconf.com/donate/
4
  Tags: google,analytics,google analytics,dashboard,analytics dashboard,google analytics dashboard,google analytics plugin,google analytics widget,tracking,universal google analytics,realtime,multisite,gadwp
5
  Requires at least: 3.5
6
  Tested up to: 4.4
7
- Stable tag: 4.9.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -132,6 +132,11 @@ Google Analytics Dashboard for WP it's released under the GPLv2, you can use it
132
 
133
  == Changelog ==
134
 
 
 
 
 
 
135
  = 4.9.1 =
136
  - Bug Fix: clear_cache method is generating PHP warnings on certain conditions
137
  - Bug Fix: make sure Google charts libraries are loaded before rendering
4
  Tags: google,analytics,google analytics,dashboard,analytics dashboard,google analytics dashboard,google analytics plugin,google analytics widget,tracking,universal google analytics,realtime,multisite,gadwp
5
  Requires at least: 3.5
6
  Tested up to: 4.4
7
+ Stable tag: 4.9.1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
132
 
133
  == Changelog ==
134
 
135
+ = 4.9.1.1 =
136
+ - Bug Fix: focusFlag preventing Real-Time reports from refreshing properly
137
+ - Bug Fix: date format is not properly localized in daily/monthly reports
138
+ - Bug Fix: reports loading issues on WordPress 4.4
139
+
140
  = 4.9.1 =
141
  - Bug Fix: clear_cache method is generating PHP warnings on certain conditions
142
  - Bug Fix: make sure Google charts libraries are loaded before rendering
tools/gapi.php CHANGED
@@ -370,14 +370,14 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
370
  /* translators:
371
  * Example: 'F, Y' will become 'November, 2015'
372
  * For details see: http://php.net/manual/en/function.date.php#refsect1-function.date-parameters */
373
- $gadwp_data[] = array( date_i18n( __('F, Y'), strtotime( $row[0] . '01' ) ), round( $row[2], 2 ) );
374
  }
375
  } else {
376
  foreach ( $data->getRows() as $row ) {
377
  /* translators:
378
  * Example: 'l, F j, Y' will become 'Thusday, November 17, 2015'
379
  * For details see: http://php.net/manual/en/function.date.php#refsect1-function.date-parameters */
380
- $gadwp_data[] = array( date_i18n( __( 'l, F j, Y' ), strtotime( $row[0] ) ), round( $row[2], 2 ) );
381
  }
382
  }
383
  return $gadwp_data;
@@ -683,7 +683,7 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
683
  $max = max( $max_array ) ? max( $max_array ) : 1;
684
  }
685
  foreach ( $data->getRows() as $row ) {
686
- $gadwp_data[] = array( date_i18n( __( 'l, F j, Y' ), strtotime( $row[0] ) ), ( $anonim ? round( $row[2] * 100 / $max, 2 ) : (int) $row[2] ) );
687
  }
688
  $totals = $data->getTotalsForAllResults();
689
  return array( $gadwp_data, $anonim ? 0 : number_format_i18n( $totals['ga:sessions'] ) );
370
  /* translators:
371
  * Example: 'F, Y' will become 'November, 2015'
372
  * For details see: http://php.net/manual/en/function.date.php#refsect1-function.date-parameters */
373
+ $gadwp_data[] = array( date_i18n( __('F, Y', 'google-analytics-dashboard-for-wp'), strtotime( $row[0] . '01' ) ), round( $row[2], 2 ) );
374
  }
375
  } else {
376
  foreach ( $data->getRows() as $row ) {
377
  /* translators:
378
  * Example: 'l, F j, Y' will become 'Thusday, November 17, 2015'
379
  * For details see: http://php.net/manual/en/function.date.php#refsect1-function.date-parameters */
380
+ $gadwp_data[] = array( date_i18n( __( 'l, F j, Y', 'google-analytics-dashboard-for-wp' ), strtotime( $row[0] ) ), round( $row[2], 2 ) );
381
  }
382
  }
383
  return $gadwp_data;
683
  $max = max( $max_array ) ? max( $max_array ) : 1;
684
  }
685
  foreach ( $data->getRows() as $row ) {
686
+ $gadwp_data[] = array( date_i18n( __( 'l, F j, Y', 'google-analytics-dashboard-for-wp' ), strtotime( $row[0] ) ), ( $anonim ? round( $row[2] * 100 / $max, 2 ) : (int) $row[2] ) );
687
  }
688
  $totals = $data->getTotalsForAllResults();
689
  return array( $gadwp_data, $anonim ? 0 : number_format_i18n( $totals['ga:sessions'] ) );