Google Analytics Dashboard for WP (GADWP) - Version 4.9.1

Version Description

  • Bug Fix: clear_cache method is generating PHP warnings on certain conditions
  • Bug Fix: make sure Google charts libraries are loaded before rendering
Download this release

Release Info

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

Code changes from version 4.9.0.1 to 4.9.1

Files changed (5) hide show
  1. common/js/reports.js +157 -157
  2. config.php +3 -1
  3. gadwp.php +2 -2
  4. readme.txt +5 -1
  5. tools/tools.php +0 -3
common/js/reports.js CHANGED
@@ -2,7 +2,8 @@
2
 
3
  google.load( "visualization", "1", {
4
  packages : [ "corechart", "table", "orgchart", "geochart" ],
5
- 'language' : gadwp_item_data.language
 
6
  } );
7
 
8
  // Get the numeric ID
@@ -41,7 +42,7 @@ gadwp_item_data.responsiveDialog = function () {
41
  var dialog;
42
  var wWidth;
43
  var visible = jQuery( ".ui-dialog:visible" );
44
-
45
  // on each visible dialog
46
  visible.each( function () {
47
  dialog = jQuery( this ).find( ".ui-dialog-content" ).data( "ui-dialog" );
@@ -62,30 +63,6 @@ gadwp_item_data.responsiveDialog = function () {
62
  } );
63
  }
64
 
65
- jQuery( document ).ready( function () {
66
-
67
- if ( gadwp_item_data.scope == 'admin-widgets' ) {
68
- jQuery( '#gadwp-window-1' ).gadwpItemReport( 1 );
69
- } else {
70
- jQuery( gadwp_item_data.getSelector( gadwp_item_data.scope ) ).click( function () {
71
- if ( !jQuery( "#gadwp-window-" + gadwp_item_data.getID( this ) ).length > 0 ) {
72
- jQuery( "body" ).append( '<div id="gadwp-window-' + gadwp_item_data.getID( this ) + '"></div>' );
73
- }
74
- jQuery( '#gadwp-window-' + gadwp_item_data.getID( this ) ).gadwpItemReport( gadwp_item_data.getID( this ) );
75
- } );
76
- }
77
-
78
- // on window resize
79
- jQuery( window ).resize( function () {
80
- gadwp_item_data.responsiveDialog();
81
- } );
82
-
83
- // dialog width larger than viewport
84
- jQuery( document ).on( "dialogopen", ".ui-dialog", function ( event, ui ) {
85
- gadwp_item_data.responsiveDialog();
86
- } );
87
- } );
88
-
89
  jQuery.fn.extend( {
90
  gadwpItemReport : function ( item_id ) {
91
  var post_data;
@@ -95,7 +72,7 @@ jQuery.fn.extend( {
95
  set_cookie : function ( name, value ) {
96
  var expires;
97
  var date_item = new Date();
98
-
99
  if ( gadwp_item_data.scope == 'admin-widgets' ) {
100
  name = "gadwp_wg_" + name;
101
  } else {
@@ -110,7 +87,7 @@ jQuery.fn.extend( {
110
  var cookie;
111
  var cookies_array;
112
  var div;
113
-
114
  if ( gadwp_item_data.scope == 'admin-widgets' ) {
115
  name = "gadwp_wg_" + name + "=";
116
  } else {
@@ -140,7 +117,7 @@ jQuery.fn.extend( {
140
  var default_dimension;
141
  var default_view;
142
  var output = [];
143
-
144
  if ( list == false ) {
145
  return;
146
  }
@@ -155,7 +132,7 @@ jQuery.fn.extend( {
155
  } else {
156
  default_metric = tools.get_cookie( 'default_metric' );
157
  default_dimension = tools.get_cookie( 'default_dimension' );
158
- default_view = tools.get_cookie( 'default_view' );
159
  }
160
 
161
  jQuery.each( list, function ( key, value ) {
@@ -169,7 +146,7 @@ jQuery.fn.extend( {
169
  },
170
 
171
  init : function () {
172
- var tpl;
173
 
174
  if ( !jQuery( '#gadwp-window' + slug ).length ) {
175
  return;
@@ -179,21 +156,21 @@ jQuery.fn.extend( {
179
  return;
180
  }
181
 
182
- tpl = '<div id="gadwp-container' + slug + '">';
183
  if ( gadwp_item_data.viewList != false ) {
184
- tpl += '<select id="gadwp-sel-view' + slug + '"></select>';
185
- }
186
- tpl += '<select id="gadwp-sel-period' + slug + '"></select> ';
187
- tpl += '<select id="gadwp-sel-report' + slug + '"></select>';
188
- tpl += '<div id="gadwp-progressbar' + slug + '"></div>';
189
- tpl += '<div id="gadwp-status' + slug + '"></div>';
190
- tpl += '<div id="gadwp-reports' + slug + '"></div>';
191
- tpl += '<div style="text-align:right;width:100%;font-size:0.8em;clear:both;margin-right:5px;margin-top:10px;">';
192
- tpl += gadwp_item_data.i18n[ 14 ];
193
- tpl += ' <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_report&utm_medium=link&utm_content=back_report&utm_campaign=gadwp" rel="nofollow" style="text-decoration:none;font-size:1em;">GADWP</a>&nbsp;';
194
- tpl += '</div>';
195
  tpl += '</div>',
196
-
197
  jQuery( '#gadwp-window' + slug ).append( tpl );
198
 
199
  template.addOptions( '#gadwp-sel-view' + slug, gadwp_item_data.viewList );
@@ -237,7 +214,7 @@ jQuery.fn.extend( {
237
  },
238
 
239
  drawprs : function ( gadwp_prs ) {
240
- var chart_data= google.visualization.arrayToDataTable( gadwp_prs );
241
  var options = {
242
  page : 'enable',
243
  pageSize : 10,
@@ -245,7 +222,7 @@ jQuery.fn.extend( {
245
  allowHtml : true
246
  };
247
  var chart = new google.visualization.Table( document.getElementById( 'gadwp-prs' + slug ) );
248
-
249
  chart.draw( chart_data, options );
250
  },
251
 
@@ -257,7 +234,7 @@ jQuery.fn.extend( {
257
  height : '100%'
258
  };
259
  var chart = new google.visualization.OrgChart( document.getElementById( 'gadwp-trafficchannels' + slug ) );
260
-
261
  chart.draw( chart_data, options );
262
  },
263
 
@@ -275,7 +252,7 @@ jQuery.fn.extend( {
275
  colors : gadwp_item_data.colorVariations
276
  };
277
  var chart = new google.visualization.PieChart( document.getElementById( 'gadwp-trafficmediums' + slug ) );
278
-
279
  chart.draw( chart_data, options );
280
  },
281
 
@@ -293,7 +270,7 @@ jQuery.fn.extend( {
293
  colors : gadwp_item_data.colorVariations
294
  };
295
  var chart = new google.visualization.PieChart( document.getElementById( 'gadwp-traffictype' + slug ) );
296
-
297
  chart.draw( chart_data, options );
298
  },
299
 
@@ -311,7 +288,7 @@ jQuery.fn.extend( {
311
  colors : gadwp_item_data.colorVariations
312
  };
313
  var chart = new google.visualization.PieChart( document.getElementById( 'gadwp-socialnetworks' + slug ) );
314
-
315
  chart.draw( chart_data, options );
316
  },
317
 
@@ -329,7 +306,7 @@ jQuery.fn.extend( {
329
  colors : gadwp_item_data.colorVariations
330
  };
331
  var chart = new google.visualization.PieChart( document.getElementById( 'gadwp-trafficorganic' + slug ) );
332
-
333
  chart.draw( chart_data, options );
334
  },
335
 
@@ -341,7 +318,7 @@ jQuery.fn.extend( {
341
  width : '100%'
342
  };
343
  var chart = new google.visualization.Table( document.getElementById( 'gadwp-locations' + slug ) );
344
-
345
  chart.draw( chart_data, options );
346
  },
347
 
@@ -360,14 +337,14 @@ jQuery.fn.extend( {
360
  options.datalessRegionColor = 'EFEFEF';
361
  }
362
  var chart = new google.visualization.GeoChart( document.getElementById( 'gadwp-map' + slug ) );
363
-
364
  chart.draw( chart_data, options );
365
  },
366
 
367
  drawmainchart : function ( gadwp_mainchart, format ) {
368
  var chart_data = google.visualization.arrayToDataTable( gadwp_mainchart );
369
  var formatter;
370
-
371
  if ( format ) {
372
  formatter = new google.visualization.NumberFormat( {
373
  suffix : '%',
@@ -376,7 +353,7 @@ jQuery.fn.extend( {
376
 
377
  formatter.format( chart_data, 1 );
378
  }
379
-
380
  var options = {
381
  legend : {
382
  position : 'none'
@@ -396,7 +373,7 @@ jQuery.fn.extend( {
396
  }
397
  };
398
  var chart = new google.visualization.AreaChart( document.getElementById( 'gadwp-mainchart' + slug ) );
399
-
400
  chart.draw( chart_data, options );
401
  },
402
 
@@ -412,11 +389,11 @@ jQuery.fn.extend( {
412
  rt_onlyUniqueValues : function ( value, index, self ) {
413
  return self.indexOf( value ) === index;
414
  },
415
-
416
  rt_countsessions : function ( gadwp_realtime, searchvalue ) {
417
  var count = 0;
418
  var i = 0;
419
-
420
  for ( i = 0; i < gadwp_realtime[ "rows" ].length; i = i + 1 ) {
421
  if ( jQuery.inArray( searchvalue, gadwp_realtime[ "rows" ][ i ] ) > -1 ) {
422
  count += parseInt( gadwp_realtime[ "rows" ][ i ][ 6 ] );
@@ -424,8 +401,8 @@ jQuery.fn.extend( {
424
  }
425
  return count;
426
  },
427
-
428
- rt_generatetooltip : function ( gadwp_realtime ) {
429
  var count = 0;
430
  var table = "";
431
  var i = 0;
@@ -441,8 +418,8 @@ jQuery.fn.extend( {
441
  return ( "" );
442
  }
443
  },
444
-
445
- rt_pagedetails : function ( gadwp_realtime, searchvalue ) {
446
  var sant;
447
  var i = 0;
448
  var j = 0;
@@ -461,13 +438,17 @@ jQuery.fn.extend( {
461
  var tabledrt = "";
462
  var pagetitle;
463
  var pgstatstable;
464
-
465
  for ( i = 0; i < gadwp_realtime[ "rows" ].length; i = i + 1 ) {
466
  sant = 1;
467
  for ( j = 0; j < newgadwp_realtime.length; j = j + 1 ) {
468
- jQuery.each(gadwp_realtime[ "rows" ][ i ],function(){sum+=parseFloat(this) || 0; });
469
- jQuery.each(newgadwp_realtime[ j ],function(){newsum+=parseFloat(this) || 0; });
470
- if ( sum == newsum ) {
 
 
 
 
471
  newgadwp_realtime[ j ][ 6 ] = parseInt( newgadwp_realtime[ j ][ 6 ] ) + parseInt( gadwp_realtime[ "rows" ][ i ][ 6 ] );
472
  sant = 0;
473
  }
@@ -505,7 +486,7 @@ jQuery.fn.extend( {
505
  }
506
  }
507
  }
508
-
509
  if ( countrfr ) {
510
  tablerfr = "<table><tr><td>" + gadwp_item_data.i18n_realtime[ 0 ] + "(" + countrfr + ")</td></tr>" + tablerfr + "</table><br />";
511
  }
@@ -523,7 +504,7 @@ jQuery.fn.extend( {
523
  }
524
  return ( "<p><center><strong>" + pagetitle + "</strong></center></p>" + tablerfr + tablekwd + tablescl + tablecpg + tabledrt );
525
  },
526
-
527
  rt_refresh : function ( focusFlag ) {
528
  if ( focusFlag ) {
529
  post_data.from = false;
@@ -543,9 +524,8 @@ jQuery.fn.extend( {
543
  } );
544
 
545
  }
546
- },
547
-
548
-
549
  drawrealtime : function ( gadwp_realtime ) {
550
  var i = 0;
551
  var pagepath = [];
@@ -555,7 +535,7 @@ jQuery.fn.extend( {
555
  var visittype = [];
556
  var custom = [];
557
  var upagepathstats = [];
558
- var upagepath;
559
  var pgstatstable = "";
560
  var ureferralsstats = [];
561
  var ureferrals;
@@ -567,14 +547,13 @@ jQuery.fn.extend( {
567
  var ucustom;
568
  var uvisittype = [ "REFERRAL", "ORGANIC", "SOCIAL", "CUSTOM" ];
569
  var uvisitortype = [ "DIRECT", "NEW" ];
570
-
571
  jQuery( function () {
572
  jQuery( '#gadwp-widget *' ).tooltip( {
573
  tooltipClass : "gadwp"
574
  } );
575
  } );
576
 
577
-
578
  gadwp_realtime = gadwp_realtime[ 0 ];
579
 
580
  if ( jQuery.isNumeric( gadwp_realtime ) || typeof gadwp_realtime === "undefined" ) {
@@ -738,7 +717,7 @@ jQuery.fn.extend( {
738
  var from;
739
  var to;
740
  var tpl;
741
- var focusFlag;
742
 
743
  if ( period == 'realtime' ) {
744
  jQuery( '#gadwp-sel-report' + slug ).hide();
@@ -786,7 +765,7 @@ jQuery.fn.extend( {
786
  tools.set_cookie( 'default_metric', query );
787
  tools.set_cookie( 'default_dimension', period );
788
 
789
- if ( typeof view !== 'undefined') {
790
  tools.set_cookie( 'default_view', view );
791
  projectId = view;
792
  } else {
@@ -813,7 +792,7 @@ jQuery.fn.extend( {
813
  post_data = {
814
  action : 'gadwp_backend_item_reports',
815
  gadwp_security_backend_item_reports : gadwp_item_data.security,
816
- projectId : projectId,
817
  from : from,
818
  to : to
819
  }
@@ -821,50 +800,48 @@ jQuery.fn.extend( {
821
  if ( period == 'realtime' ) {
822
  focusFlag = 1;
823
 
824
- jQuery( document ).ready( function () {
825
- jQuery( window ).bind( "focus", function ( event ) {
826
- focusFlag = 1;
827
- } ).bind( "blur", function ( event ) {
828
- focusFlag = 0;
829
- } );
830
  } );
831
-
832
  tpl = '<div id="gadwp-realtime' + slug + '">';
833
- tpl += '<div class="gadwp-rt-box">';
834
- tpl += '<div class="gadwp-tdo-left">';
835
- tpl += '<div class="gadwp-online" id="gadwp-online">0</div>';
836
- tpl += '</div>';
837
- tpl += '<div class="gadwp-tdo-right" id="gadwp-tdo-right">';
838
- tpl += '<div class="gadwp-bigtext">';
839
- tpl += '<div class="gadwp-bleft">' + gadwp_item_data.i18n_realtime[ 0 ] + '</div>';
840
- tpl += '<div class="gadwp-bright">0</div>';
841
- tpl += '</div>';
842
- tpl += '<div class="gadwp-bigtext">';
843
- tpl += '<div class="gadwp-bleft">' + gadwp_item_data.i18n_realtime[ 1 ] + '</div>';
844
- tpl += '<div class="gadwp-bright">0</div>';
845
- tpl += '</div>';
846
- tpl += '<div class="gadwp-bigtext">';
847
- tpl += '<div class="gadwp-bleft">' + gadwp_item_data.i18n_realtime[ 2 ] + '</div>';
848
- tpl += '<div class="gadwp-bright">0</div>';
849
- tpl += '</div>';
850
- tpl += '<div class="gadwp-bigtext">';
851
- tpl += '<div class="gadwp-bleft">' + gadwp_item_data.i18n_realtime[ 3 ] + '</div>';
852
- tpl += '<div class="gadwp-bright">0</div>';
853
- tpl += '</div>';
854
- tpl += '<div class="gadwp-bigtext">';
855
- tpl += '<div class="gadwp-bleft">' + gadwp_item_data.i18n_realtime[ 4 ] + '</div>';
856
- tpl += '<div class="gadwp-bright">0</div>';
857
- tpl += '</div>';
858
- tpl += '<div class="gadwp-bigtext">';
859
- tpl += '<div class="gadwp-bleft">' + gadwp_item_data.i18n_realtime[ 5 ] + '</div>';
860
- tpl += '<div class="gadwp-bright">0</div>';
861
- tpl += '</div>';
862
- tpl += '</div>';
863
- tpl += '</div>';
864
- tpl += '<div>';
865
- tpl += '<div id="gadwp-pages" class="gadwp-pages">&nbsp;</div>';
866
- tpl += '</div>';
867
- tpl += '</div>';
868
 
869
  jQuery( '#gadwp-reports' + slug ).html( tpl );
870
 
@@ -875,9 +852,9 @@ jQuery.fn.extend( {
875
  } else {
876
  if ( jQuery.inArray( query, [ 'referrers', 'contentpages', 'searches' ] ) > -1 ) {
877
 
878
- tpl = '<div id="gadwp-trafficchannels' + slug + '"></div>';
879
  tpl += '<div id="gadwp-prs' + slug + '"></div>';
880
-
881
  jQuery( '#gadwp-reports' + slug ).html( tpl );
882
  jQuery( '#gadwp-reports' + slug ).hide();
883
 
@@ -889,7 +866,7 @@ jQuery.fn.extend( {
889
  if ( jQuery.isArray( response[ 0 ] ) ) {
890
  jQuery( '#gadwp-reports' + slug ).show();
891
  reports.trafficchannels = response[ 0 ];
892
- google.setOnLoadCallback( reports.drawtrafficchannels( reports.trafficchannels ) );
893
  } else {
894
  reports.throwDebug( response[ 0 ] );
895
  }
@@ -901,7 +878,7 @@ jQuery.fn.extend( {
901
  if ( !jQuery.isNumeric( response[ 1 ] ) ) {
902
  if ( jQuery.isArray( response[ 1 ] ) ) {
903
  reports.prs = response[ 1 ];
904
- google.setOnLoadCallback( reports.drawprs( reports.prs ) );
905
  } else {
906
  reports.throwDebug( response[ 1 ] );
907
  }
@@ -915,17 +892,17 @@ jQuery.fn.extend( {
915
  } );
916
 
917
  } else if ( query == 'trafficdetails' ) {
918
-
919
- tpl = '<div id="gadwp-trafficchannels' + slug + '"></div>';
920
  tpl += '<div class="gadwp-floatwraper">';
921
- tpl += '<div id="gadwp-trafficmediums' + slug + '"></div>';
922
- tpl += '<div id="gadwp-traffictype' + slug + '"></div>';
923
  tpl += '</div>';
924
  tpl += '<div class="gadwp-floatwraper">';
925
- tpl += '<div id="gadwp-trafficorganic' + slug + '"></div>';
926
- tpl += '<div id="gadwp-socialnetworks' + slug + '"></div>';
927
  tpl += '</div>';
928
-
929
  jQuery( '#gadwp-reports' + slug ).html( tpl );
930
  jQuery( '#gadwp-reports' + slug ).hide();
931
 
@@ -937,7 +914,7 @@ jQuery.fn.extend( {
937
  if ( jQuery.isArray( response[ 0 ] ) ) {
938
  jQuery( '#gadwp-reports' + slug ).show();
939
  reports.trafficchannels = response[ 0 ];
940
- google.setOnLoadCallback( reports.drawtrafficchannels( reports.trafficchannels ) );
941
  } else {
942
  reports.throwDebug( response[ 0 ] );
943
  }
@@ -950,7 +927,7 @@ jQuery.fn.extend( {
950
  if ( jQuery.isArray( response[ 1 ] ) ) {
951
  jQuery( '#gadwp-reports' + slug ).show();
952
  reports.trafficmediums = response[ 1 ];
953
- google.setOnLoadCallback( reports.drawtrafficmediums( reports.trafficmediums ) );
954
  } else {
955
  reports.throwDebug( response[ 1 ] );
956
  }
@@ -963,7 +940,7 @@ jQuery.fn.extend( {
963
  if ( jQuery.isArray( response[ 2 ] ) ) {
964
  jQuery( '#gadwp-reports' + slug ).show();
965
  reports.traffictype = response[ 2 ];
966
- google.setOnLoadCallback( reports.drawtraffictype( reports.traffictype ) );
967
  } else {
968
  reports.throwDebug( response[ 2 ] );
969
  }
@@ -976,7 +953,7 @@ jQuery.fn.extend( {
976
  if ( jQuery.isArray( response[ 3 ] ) ) {
977
  jQuery( '#gadwp-reports' + slug ).show();
978
  reports.trafficorganic = response[ 3 ];
979
- google.setOnLoadCallback( reports.drawtrafficorganic( reports.trafficorganic ) );
980
  } else {
981
  reports.throwDebug( response[ 3 ] );
982
  }
@@ -989,7 +966,7 @@ jQuery.fn.extend( {
989
  if ( jQuery.isArray( response[ 4 ] ) ) {
990
  jQuery( '#gadwp-reports' + slug ).show();
991
  reports.socialnetworks = response[ 4 ];
992
- google.setOnLoadCallback( reports.drawsocialnetworks( reports.socialnetworks ) );
993
  } else {
994
  reports.throwDebug( response[ 4 ] );
995
  }
@@ -1004,10 +981,10 @@ jQuery.fn.extend( {
1004
  } );
1005
 
1006
  } else if ( query == 'locations' ) {
1007
-
1008
- tpl = '<div id="gadwp-map' + slug + '"></div>';
1009
  tpl += '<div id="gadwp-locations' + slug + '"></div>';
1010
-
1011
  jQuery( '#gadwp-reports' + slug ).html( tpl );
1012
  jQuery( '#gadwp-reports' + slug ).hide();
1013
 
@@ -1019,8 +996,8 @@ jQuery.fn.extend( {
1019
  if ( jQuery.isArray( response[ 0 ] ) ) {
1020
  jQuery( '#gadwp-reports' + slug ).show();
1021
  reports.locations = response[ 0 ];
1022
- google.setOnLoadCallback( reports.drawmaplocations( reports.locations ) );
1023
- google.setOnLoadCallback( reports.drawlocations( reports.locations ) );
1024
  } else {
1025
  reports.throwDebug( response[ 0 ] );
1026
  }
@@ -1036,19 +1013,19 @@ jQuery.fn.extend( {
1036
  } );
1037
 
1038
  } else {
1039
-
1040
- tpl = '<div id="gadwp-mainchart' + slug + '"></div>';
1041
  tpl += '<div id="gadwp-bottomstats' + slug + '" class="gadwp-wrapper">';
1042
- tpl += '<div class="inside">';
1043
- tpl += '<div class="small-box"><h3>' + gadwp_item_data.i18n[ 5 ] + '</h3><p id="gdsessions' + slug + '">&nbsp;</p></div>';
1044
- tpl += '<div class="small-box"><h3>' + gadwp_item_data.i18n[ 6 ] + '</h3><p id="gdusers' + slug + '">&nbsp;</p></div>';
1045
- tpl += '<div class="small-box"><h3>' + gadwp_item_data.i18n[ 7 ] + '</h3><p id="gdpageviews' + slug + '">&nbsp;</p></div>';
1046
- tpl += '<div class="small-box"><h3>' + gadwp_item_data.i18n[ 8 ] + '</h3><p id="gdbouncerate' + slug + '">&nbsp;</p></div>';
1047
- tpl += '<div class="small-box"><h3>' + gadwp_item_data.i18n[ 9 ] + '</h3><p id="gdorganicsearch' + slug + '">&nbsp;</p></div>';
1048
- tpl += '<div class="small-box"><h3>' + gadwp_item_data.i18n[ 10 ] + '</h3><p id="gdpagespervisit' + slug + '">&nbsp;</p></div>';
1049
- tpl += '</div>';
1050
- tpl += '</div>';
1051
-
1052
  jQuery( '#gadwp-reports' + slug ).html( tpl );
1053
  jQuery( '#gadwp-reports' + slug ).hide();
1054
 
@@ -1061,9 +1038,9 @@ jQuery.fn.extend( {
1061
  jQuery( '#gadwp-reports' + slug ).show();
1062
  reports.mainchart = response[ 0 ];
1063
  if ( query == 'visitBounceRate' ) {
1064
- google.setOnLoadCallback( reports.drawmainchart( reports.mainchart, true ) );
1065
  } else {
1066
- google.setOnLoadCallback( reports.drawmainchart( reports.mainchart, false ) );
1067
  }
1068
  } else {
1069
  reports.throwDebug( response[ 0 ] );
@@ -1076,7 +1053,7 @@ jQuery.fn.extend( {
1076
  if ( jQuery.isArray( response[ 1 ] ) ) {
1077
  jQuery( '#gadwp-reports' + slug ).show();
1078
  reports.bottomstats = response[ 1 ];
1079
- google.setOnLoadCallback( reports.drawbottomstats( reports.bottomstats ) );
1080
  } else {
1081
  reports.throwDebug( response[ 1 ] );
1082
  }
@@ -1164,8 +1141,8 @@ jQuery.fn.extend( {
1164
  jQuery( '#gadwp-sel-view' + slug ).change( function () {
1165
  jQuery( '#gadwp-reports' + slug ).html( '' );
1166
  reports.init();
1167
- } );
1168
-
1169
  jQuery( '#gadwp-sel-period' + slug ).change( function () {
1170
  jQuery( '#gadwp-reports' + slug ).html( '' );
1171
  reports.init();
@@ -1197,3 +1174,26 @@ jQuery.fn.extend( {
1197
  }
1198
  }
1199
  } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
42
  var dialog;
43
  var wWidth;
44
  var visible = jQuery( ".ui-dialog:visible" );
45
+
46
  // on each visible dialog
47
  visible.each( function () {
48
  dialog = jQuery( this ).find( ".ui-dialog-content" ).data( "ui-dialog" );
63
  } );
64
  }
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  jQuery.fn.extend( {
67
  gadwpItemReport : function ( item_id ) {
68
  var post_data;
72
  set_cookie : function ( name, value ) {
73
  var expires;
74
  var date_item = new Date();
75
+
76
  if ( gadwp_item_data.scope == 'admin-widgets' ) {
77
  name = "gadwp_wg_" + name;
78
  } else {
87
  var cookie;
88
  var cookies_array;
89
  var div;
90
+
91
  if ( gadwp_item_data.scope == 'admin-widgets' ) {
92
  name = "gadwp_wg_" + name + "=";
93
  } else {
117
  var default_dimension;
118
  var default_view;
119
  var output = [];
120
+
121
  if ( list == false ) {
122
  return;
123
  }
132
  } else {
133
  default_metric = tools.get_cookie( 'default_metric' );
134
  default_dimension = tools.get_cookie( 'default_dimension' );
135
+ default_view = tools.get_cookie( 'default_view' );
136
  }
137
 
138
  jQuery.each( list, function ( key, value ) {
146
  },
147
 
148
  init : function () {
149
+ var tpl;
150
 
151
  if ( !jQuery( '#gadwp-window' + slug ).length ) {
152
  return;
156
  return;
157
  }
158
 
159
+ tpl = '<div id="gadwp-container' + slug + '">';
160
  if ( gadwp_item_data.viewList != false ) {
161
+ tpl += '<select id="gadwp-sel-view' + slug + '"></select>';
162
+ }
163
+ tpl += '<select id="gadwp-sel-period' + slug + '"></select> ';
164
+ tpl += '<select id="gadwp-sel-report' + slug + '"></select>';
165
+ tpl += '<div id="gadwp-progressbar' + slug + '"></div>';
166
+ tpl += '<div id="gadwp-status' + slug + '"></div>';
167
+ tpl += '<div id="gadwp-reports' + slug + '"></div>';
168
+ tpl += '<div style="text-align:right;width:100%;font-size:0.8em;clear:both;margin-right:5px;margin-top:10px;">';
169
+ tpl += gadwp_item_data.i18n[ 14 ];
170
+ tpl += ' <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_report&utm_medium=link&utm_content=back_report&utm_campaign=gadwp" rel="nofollow" style="text-decoration:none;font-size:1em;">GADWP</a>&nbsp;';
171
+ tpl += '</div>';
172
  tpl += '</div>',
173
+
174
  jQuery( '#gadwp-window' + slug ).append( tpl );
175
 
176
  template.addOptions( '#gadwp-sel-view' + slug, gadwp_item_data.viewList );
214
  },
215
 
216
  drawprs : function ( gadwp_prs ) {
217
+ var chart_data = google.visualization.arrayToDataTable( gadwp_prs );
218
  var options = {
219
  page : 'enable',
220
  pageSize : 10,
222
  allowHtml : true
223
  };
224
  var chart = new google.visualization.Table( document.getElementById( 'gadwp-prs' + slug ) );
225
+
226
  chart.draw( chart_data, options );
227
  },
228
 
234
  height : '100%'
235
  };
236
  var chart = new google.visualization.OrgChart( document.getElementById( 'gadwp-trafficchannels' + slug ) );
237
+
238
  chart.draw( chart_data, options );
239
  },
240
 
252
  colors : gadwp_item_data.colorVariations
253
  };
254
  var chart = new google.visualization.PieChart( document.getElementById( 'gadwp-trafficmediums' + slug ) );
255
+
256
  chart.draw( chart_data, options );
257
  },
258
 
270
  colors : gadwp_item_data.colorVariations
271
  };
272
  var chart = new google.visualization.PieChart( document.getElementById( 'gadwp-traffictype' + slug ) );
273
+
274
  chart.draw( chart_data, options );
275
  },
276
 
288
  colors : gadwp_item_data.colorVariations
289
  };
290
  var chart = new google.visualization.PieChart( document.getElementById( 'gadwp-socialnetworks' + slug ) );
291
+
292
  chart.draw( chart_data, options );
293
  },
294
 
306
  colors : gadwp_item_data.colorVariations
307
  };
308
  var chart = new google.visualization.PieChart( document.getElementById( 'gadwp-trafficorganic' + slug ) );
309
+
310
  chart.draw( chart_data, options );
311
  },
312
 
318
  width : '100%'
319
  };
320
  var chart = new google.visualization.Table( document.getElementById( 'gadwp-locations' + slug ) );
321
+
322
  chart.draw( chart_data, options );
323
  },
324
 
337
  options.datalessRegionColor = 'EFEFEF';
338
  }
339
  var chart = new google.visualization.GeoChart( document.getElementById( 'gadwp-map' + slug ) );
340
+
341
  chart.draw( chart_data, options );
342
  },
343
 
344
  drawmainchart : function ( gadwp_mainchart, format ) {
345
  var chart_data = google.visualization.arrayToDataTable( gadwp_mainchart );
346
  var formatter;
347
+
348
  if ( format ) {
349
  formatter = new google.visualization.NumberFormat( {
350
  suffix : '%',
353
 
354
  formatter.format( chart_data, 1 );
355
  }
356
+
357
  var options = {
358
  legend : {
359
  position : 'none'
373
  }
374
  };
375
  var chart = new google.visualization.AreaChart( document.getElementById( 'gadwp-mainchart' + slug ) );
376
+
377
  chart.draw( chart_data, options );
378
  },
379
 
389
  rt_onlyUniqueValues : function ( value, index, self ) {
390
  return self.indexOf( value ) === index;
391
  },
392
+
393
  rt_countsessions : function ( gadwp_realtime, searchvalue ) {
394
  var count = 0;
395
  var i = 0;
396
+
397
  for ( i = 0; i < gadwp_realtime[ "rows" ].length; i = i + 1 ) {
398
  if ( jQuery.inArray( searchvalue, gadwp_realtime[ "rows" ][ i ] ) > -1 ) {
399
  count += parseInt( gadwp_realtime[ "rows" ][ i ][ 6 ] );
401
  }
402
  return count;
403
  },
404
+
405
+ rt_generatetooltip : function ( gadwp_realtime ) {
406
  var count = 0;
407
  var table = "";
408
  var i = 0;
418
  return ( "" );
419
  }
420
  },
421
+
422
+ rt_pagedetails : function ( gadwp_realtime, searchvalue ) {
423
  var sant;
424
  var i = 0;
425
  var j = 0;
438
  var tabledrt = "";
439
  var pagetitle;
440
  var pgstatstable;
441
+
442
  for ( i = 0; i < gadwp_realtime[ "rows" ].length; i = i + 1 ) {
443
  sant = 1;
444
  for ( j = 0; j < newgadwp_realtime.length; j = j + 1 ) {
445
+ jQuery.each( gadwp_realtime[ "rows" ][ i ], function () {
446
+ sum += parseFloat( this ) || 0;
447
+ } );
448
+ jQuery.each( newgadwp_realtime[ j ], function () {
449
+ newsum += parseFloat( this ) || 0;
450
+ } );
451
+ if ( sum == newsum ) {
452
  newgadwp_realtime[ j ][ 6 ] = parseInt( newgadwp_realtime[ j ][ 6 ] ) + parseInt( gadwp_realtime[ "rows" ][ i ][ 6 ] );
453
  sant = 0;
454
  }
486
  }
487
  }
488
  }
489
+
490
  if ( countrfr ) {
491
  tablerfr = "<table><tr><td>" + gadwp_item_data.i18n_realtime[ 0 ] + "(" + countrfr + ")</td></tr>" + tablerfr + "</table><br />";
492
  }
504
  }
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;
524
  } );
525
 
526
  }
527
+ },
528
+
 
529
  drawrealtime : function ( gadwp_realtime ) {
530
  var i = 0;
531
  var pagepath = [];
535
  var visittype = [];
536
  var custom = [];
537
  var upagepathstats = [];
538
+ var upagepath;
539
  var pgstatstable = "";
540
  var ureferralsstats = [];
541
  var ureferrals;
547
  var ucustom;
548
  var uvisittype = [ "REFERRAL", "ORGANIC", "SOCIAL", "CUSTOM" ];
549
  var uvisitortype = [ "DIRECT", "NEW" ];
550
+
551
  jQuery( function () {
552
  jQuery( '#gadwp-widget *' ).tooltip( {
553
  tooltipClass : "gadwp"
554
  } );
555
  } );
556
 
 
557
  gadwp_realtime = gadwp_realtime[ 0 ];
558
 
559
  if ( jQuery.isNumeric( gadwp_realtime ) || typeof gadwp_realtime === "undefined" ) {
717
  var from;
718
  var to;
719
  var tpl;
720
+ var focusFlag;
721
 
722
  if ( period == 'realtime' ) {
723
  jQuery( '#gadwp-sel-report' + slug ).hide();
765
  tools.set_cookie( 'default_metric', query );
766
  tools.set_cookie( 'default_dimension', period );
767
 
768
+ if ( typeof view !== 'undefined' ) {
769
  tools.set_cookie( 'default_view', view );
770
  projectId = view;
771
  } else {
792
  post_data = {
793
  action : 'gadwp_backend_item_reports',
794
  gadwp_security_backend_item_reports : gadwp_item_data.security,
795
+ projectId : projectId,
796
  from : from,
797
  to : to
798
  }
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 + '">';
810
+ tpl += '<div class="gadwp-rt-box">';
811
+ tpl += '<div class="gadwp-tdo-left">';
812
+ tpl += '<div class="gadwp-online" id="gadwp-online">0</div>';
813
+ tpl += '</div>';
814
+ tpl += '<div class="gadwp-tdo-right" id="gadwp-tdo-right">';
815
+ tpl += '<div class="gadwp-bigtext">';
816
+ tpl += '<div class="gadwp-bleft">' + gadwp_item_data.i18n_realtime[ 0 ] + '</div>';
817
+ tpl += '<div class="gadwp-bright">0</div>';
818
+ tpl += '</div>';
819
+ tpl += '<div class="gadwp-bigtext">';
820
+ tpl += '<div class="gadwp-bleft">' + gadwp_item_data.i18n_realtime[ 1 ] + '</div>';
821
+ tpl += '<div class="gadwp-bright">0</div>';
822
+ tpl += '</div>';
823
+ tpl += '<div class="gadwp-bigtext">';
824
+ tpl += '<div class="gadwp-bleft">' + gadwp_item_data.i18n_realtime[ 2 ] + '</div>';
825
+ tpl += '<div class="gadwp-bright">0</div>';
826
+ tpl += '</div>';
827
+ tpl += '<div class="gadwp-bigtext">';
828
+ tpl += '<div class="gadwp-bleft">' + gadwp_item_data.i18n_realtime[ 3 ] + '</div>';
829
+ tpl += '<div class="gadwp-bright">0</div>';
830
+ tpl += '</div>';
831
+ tpl += '<div class="gadwp-bigtext">';
832
+ tpl += '<div class="gadwp-bleft">' + gadwp_item_data.i18n_realtime[ 4 ] + '</div>';
833
+ tpl += '<div class="gadwp-bright">0</div>';
834
+ tpl += '</div>';
835
+ tpl += '<div class="gadwp-bigtext">';
836
+ tpl += '<div class="gadwp-bleft">' + gadwp_item_data.i18n_realtime[ 5 ] + '</div>';
837
+ tpl += '<div class="gadwp-bright">0</div>';
838
+ tpl += '</div>';
839
+ tpl += '</div>';
840
+ tpl += '</div>';
841
+ tpl += '<div>';
842
+ tpl += '<div id="gadwp-pages" class="gadwp-pages">&nbsp;</div>';
843
+ tpl += '</div>';
844
+ tpl += '</div>';
845
 
846
  jQuery( '#gadwp-reports' + slug ).html( tpl );
847
 
852
  } else {
853
  if ( jQuery.inArray( query, [ 'referrers', 'contentpages', 'searches' ] ) > -1 ) {
854
 
855
+ tpl = '<div id="gadwp-trafficchannels' + slug + '"></div>';
856
  tpl += '<div id="gadwp-prs' + slug + '"></div>';
857
+
858
  jQuery( '#gadwp-reports' + slug ).html( tpl );
859
  jQuery( '#gadwp-reports' + slug ).hide();
860
 
866
  if ( jQuery.isArray( response[ 0 ] ) ) {
867
  jQuery( '#gadwp-reports' + slug ).show();
868
  reports.trafficchannels = response[ 0 ];
869
+ reports.drawtrafficchannels( reports.trafficchannels );
870
  } else {
871
  reports.throwDebug( response[ 0 ] );
872
  }
878
  if ( !jQuery.isNumeric( response[ 1 ] ) ) {
879
  if ( jQuery.isArray( response[ 1 ] ) ) {
880
  reports.prs = response[ 1 ];
881
+ reports.drawprs( reports.prs );
882
  } else {
883
  reports.throwDebug( response[ 1 ] );
884
  }
892
  } );
893
 
894
  } else if ( query == 'trafficdetails' ) {
895
+
896
+ tpl = '<div id="gadwp-trafficchannels' + slug + '"></div>';
897
  tpl += '<div class="gadwp-floatwraper">';
898
+ tpl += '<div id="gadwp-trafficmediums' + slug + '"></div>';
899
+ tpl += '<div id="gadwp-traffictype' + slug + '"></div>';
900
  tpl += '</div>';
901
  tpl += '<div class="gadwp-floatwraper">';
902
+ tpl += '<div id="gadwp-trafficorganic' + slug + '"></div>';
903
+ tpl += '<div id="gadwp-socialnetworks' + slug + '"></div>';
904
  tpl += '</div>';
905
+
906
  jQuery( '#gadwp-reports' + slug ).html( tpl );
907
  jQuery( '#gadwp-reports' + slug ).hide();
908
 
914
  if ( jQuery.isArray( response[ 0 ] ) ) {
915
  jQuery( '#gadwp-reports' + slug ).show();
916
  reports.trafficchannels = response[ 0 ];
917
+ reports.drawtrafficchannels( reports.trafficchannels );
918
  } else {
919
  reports.throwDebug( response[ 0 ] );
920
  }
927
  if ( jQuery.isArray( response[ 1 ] ) ) {
928
  jQuery( '#gadwp-reports' + slug ).show();
929
  reports.trafficmediums = response[ 1 ];
930
+ reports.drawtrafficmediums( reports.trafficmediums );
931
  } else {
932
  reports.throwDebug( response[ 1 ] );
933
  }
940
  if ( jQuery.isArray( response[ 2 ] ) ) {
941
  jQuery( '#gadwp-reports' + slug ).show();
942
  reports.traffictype = response[ 2 ];
943
+ reports.drawtraffictype( reports.traffictype );
944
  } else {
945
  reports.throwDebug( response[ 2 ] );
946
  }
953
  if ( jQuery.isArray( response[ 3 ] ) ) {
954
  jQuery( '#gadwp-reports' + slug ).show();
955
  reports.trafficorganic = response[ 3 ];
956
+ reports.drawtrafficorganic( reports.trafficorganic );
957
  } else {
958
  reports.throwDebug( response[ 3 ] );
959
  }
966
  if ( jQuery.isArray( response[ 4 ] ) ) {
967
  jQuery( '#gadwp-reports' + slug ).show();
968
  reports.socialnetworks = response[ 4 ];
969
+ reports.drawsocialnetworks( reports.socialnetworks );
970
  } else {
971
  reports.throwDebug( response[ 4 ] );
972
  }
981
  } );
982
 
983
  } else if ( query == 'locations' ) {
984
+
985
+ tpl = '<div id="gadwp-map' + slug + '"></div>';
986
  tpl += '<div id="gadwp-locations' + slug + '"></div>';
987
+
988
  jQuery( '#gadwp-reports' + slug ).html( tpl );
989
  jQuery( '#gadwp-reports' + slug ).hide();
990
 
996
  if ( jQuery.isArray( response[ 0 ] ) ) {
997
  jQuery( '#gadwp-reports' + slug ).show();
998
  reports.locations = response[ 0 ];
999
+ reports.drawmaplocations( reports.locations );
1000
+ reports.drawlocations( reports.locations );
1001
  } else {
1002
  reports.throwDebug( response[ 0 ] );
1003
  }
1013
  } );
1014
 
1015
  } else {
1016
+
1017
+ tpl = '<div id="gadwp-mainchart' + slug + '"></div>';
1018
  tpl += '<div id="gadwp-bottomstats' + slug + '" class="gadwp-wrapper">';
1019
+ tpl += '<div class="inside">';
1020
+ tpl += '<div class="small-box"><h3>' + gadwp_item_data.i18n[ 5 ] + '</h3><p id="gdsessions' + slug + '">&nbsp;</p></div>';
1021
+ tpl += '<div class="small-box"><h3>' + gadwp_item_data.i18n[ 6 ] + '</h3><p id="gdusers' + slug + '">&nbsp;</p></div>';
1022
+ tpl += '<div class="small-box"><h3>' + gadwp_item_data.i18n[ 7 ] + '</h3><p id="gdpageviews' + slug + '">&nbsp;</p></div>';
1023
+ tpl += '<div class="small-box"><h3>' + gadwp_item_data.i18n[ 8 ] + '</h3><p id="gdbouncerate' + slug + '">&nbsp;</p></div>';
1024
+ tpl += '<div class="small-box"><h3>' + gadwp_item_data.i18n[ 9 ] + '</h3><p id="gdorganicsearch' + slug + '">&nbsp;</p></div>';
1025
+ tpl += '<div class="small-box"><h3>' + gadwp_item_data.i18n[ 10 ] + '</h3><p id="gdpagespervisit' + slug + '">&nbsp;</p></div>';
1026
+ tpl += '</div>';
1027
+ tpl += '</div>';
1028
+
1029
  jQuery( '#gadwp-reports' + slug ).html( tpl );
1030
  jQuery( '#gadwp-reports' + slug ).hide();
1031
 
1038
  jQuery( '#gadwp-reports' + slug ).show();
1039
  reports.mainchart = response[ 0 ];
1040
  if ( query == 'visitBounceRate' ) {
1041
+ reports.drawmainchart( reports.mainchart, true );
1042
  } else {
1043
+ reports.drawmainchart( reports.mainchart, false );
1044
  }
1045
  } else {
1046
  reports.throwDebug( response[ 0 ] );
1053
  if ( jQuery.isArray( response[ 1 ] ) ) {
1054
  jQuery( '#gadwp-reports' + slug ).show();
1055
  reports.bottomstats = response[ 1 ];
1056
+ reports.drawbottomstats( reports.bottomstats );
1057
  } else {
1058
  reports.throwDebug( response[ 1 ] );
1059
  }
1141
  jQuery( '#gadwp-sel-view' + slug ).change( function () {
1142
  jQuery( '#gadwp-reports' + slug ).html( '' );
1143
  reports.init();
1144
+ } );
1145
+
1146
  jQuery( '#gadwp-sel-period' + slug ).change( function () {
1147
  jQuery( '#gadwp-reports' + slug ).html( '' );
1148
  reports.init();
1174
  }
1175
  }
1176
  } );
1177
+
1178
+ function GADWPLoad () {
1179
+ if ( gadwp_item_data.scope == 'admin-widgets' ) {
1180
+ jQuery( '#gadwp-window-1' ).gadwpItemReport( 1 );
1181
+ } else {
1182
+ jQuery( gadwp_item_data.getSelector( gadwp_item_data.scope ) ).click( function () {
1183
+ if ( !jQuery( "#gadwp-window-" + gadwp_item_data.getID( this ) ).length > 0 ) {
1184
+ jQuery( "body" ).append( '<div id="gadwp-window-' + gadwp_item_data.getID( this ) + '"></div>' );
1185
+ }
1186
+ jQuery( '#gadwp-window-' + gadwp_item_data.getID( this ) ).gadwpItemReport( gadwp_item_data.getID( this ) );
1187
+ } );
1188
+ }
1189
+
1190
+ // on window resize
1191
+ jQuery( window ).resize( function () {
1192
+ gadwp_item_data.responsiveDialog();
1193
+ } );
1194
+
1195
+ // dialog width larger than viewport
1196
+ jQuery( document ).on( "dialogopen", ".ui-dialog", function ( event, ui ) {
1197
+ gadwp_item_data.responsiveDialog();
1198
+ } );
1199
+ }
config.php CHANGED
@@ -210,7 +210,9 @@ if ( ! class_exists( 'GADWP_Config' ) ) {
210
  } else {
211
  unset( $this->options['ga_dash_refresh_token'] );
212
  }
213
-
 
 
214
  GADWP_Tools::clear_cache();
215
  GADWP_Tools::clear_transients(); // 4.8.3 to be removed after a few months
216
  $flag = true;
210
  } else {
211
  unset( $this->options['ga_dash_refresh_token'] );
212
  }
213
+ GADWP_Tools::unset_cookie( 'default_metric' );
214
+ GADWP_Tools::unset_cookie( 'default_dimension' );
215
+ GADWP_Tools::unset_cookie( 'default_view' );
216
  GADWP_Tools::clear_cache();
217
  GADWP_Tools::clear_transients(); // 4.8.3 to be removed after a few months
218
  $flag = true;
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.0.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.0.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
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' );
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.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -132,6 +132,10 @@ Google Analytics Dashboard for WP it's released under the GPLv2, you can use it
132
 
133
  == Changelog ==
134
 
 
 
 
 
135
  = 4.9.0.1 =
136
  - Bug Fix: Pages report missing from admin dashboard widget
137
  - Bug Fix: Invalid response with a -31 error when using a certain combination of backend settings
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
 
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
138
+
139
  = 4.9.0.1 =
140
  - Bug Fix: Pages report missing from admin dashboard widget
141
  - Bug Fix: Invalid response with a -31 error when using a certain combination of backend settings
tools/tools.php CHANGED
@@ -168,9 +168,6 @@ if ( ! class_exists( 'GADWP_Tools' ) ) {
168
  public static function clear_cache() {
169
  global $wpdb;
170
  $sqlquery = $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'gadwp_cache_qr%%'" );
171
- GADWP_Tools::unset_cookie( 'default_metric' );
172
- GADWP_Tools::unset_cookie( 'default_dimension' );
173
- GADWP_Tools::unset_cookie( 'default_view' );
174
  }
175
  }
176
  }
168
  public static function clear_cache() {
169
  global $wpdb;
170
  $sqlquery = $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'gadwp_cache_qr%%'" );
 
 
 
171
  }
172
  }
173
  }