Google Analytics Dashboard for WP (GADWP) - Version 4.9.3.1

Version Description

  • Bug Fixes:
    • fixing a bug where &nbsp was displayed instead of a blank space on localized sites
Download this release

Release Info

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

Code changes from version 4.9.2 to 4.9.3.1

admin/js/settings.js CHANGED
@@ -1,36 +1,40 @@
1
/*
2
* Navigation Tabs
3
*/
4
- jQuery(document).ready(
5
- function() {
6
- if (window.location.href.indexOf("page=gadash_") != -1) {
7
- var ident = 'basic';
8
-
9
- if (window.location.hash) {
10
- ident = window.location.hash.split('#')[2].split('-')[1];
11
- }else if (window.location.href.indexOf("page=gadash_errors_debugging") != -1){
12
- ident = 'errors';
13
- }
14
15
- jQuery(".nav-tab-wrapper a").each(function(index) {
16
- jQuery(this).removeClass("nav-tab-active");
17
- jQuery("#" + this.hash.split('#')[2]).hide();
18
- });
19
- jQuery("#tab-" + ident).addClass("nav-tab-active");
20
- jQuery("#gadwp-" + ident).show();
21
- }
22
23
- jQuery('a[href^="#"]').click(function(e) {
24
- if (window.location.href.indexOf("page=gadash_") != -1) {
25
- jQuery(".nav-tab-wrapper a").each(function(index) {
26
- jQuery(this).removeClass("nav-tab-active");
27
- jQuery("#" + this.hash.split('#')[2]).hide();
28
- });
29
- jQuery(this).addClass("nav-tab-active");
30
- jQuery("#" + this.hash.split('#')[2]).show();
31
- }
32
- });
33
34
}
35
-
36
- );
1
+ /*-
2
+ * Author: Alin Marcu
3
+ * Author URI: https://deconf.com
4
+ * Copyright 2013 Alin Marcu
5
+ * License: GPLv2 or later
6
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
+ */
8
+
9
/*
10
* Navigation Tabs
11
*/
12
+ jQuery( document ).ready( function () {
13
+ if ( window.location.href.indexOf( "page=gadash_" ) != -1 ) {
14
+ var ident = 'basic';
15
16
+ if ( window.location.hash ) {
17
+ ident = window.location.hash.split( '#' )[ 2 ].split( '-' )[ 1 ];
18
+ } else if ( window.location.href.indexOf( "page=gadash_errors_debugging" ) != -1 ) {
19
+ ident = 'errors';
20
+ }
21
22
+ jQuery( ".nav-tab-wrapper a" ).each( function ( index ) {
23
+ jQuery( this ).removeClass( "nav-tab-active" );
24
+ jQuery( "#" + this.hash.split( '#' )[ 2 ] ).hide();
25
+ } );
26
+ jQuery( "#tab-" + ident ).addClass( "nav-tab-active" );
27
+ jQuery( "#gadwp-" + ident ).show();
28
+ }
29
30
+ jQuery( 'a[href^="#"]' ).click( function ( e ) {
31
+ if ( window.location.href.indexOf( "page=gadash_" ) != -1 ) {
32
+ jQuery( ".nav-tab-wrapper a" ).each( function ( index ) {
33
+ jQuery( this ).removeClass( "nav-tab-active" );
34
+ jQuery( "#" + this.hash.split( '#' )[ 2 ] ).hide();
35
+ } );
36
+ jQuery( this ).addClass( "nav-tab-active" );
37
+ jQuery( "#" + this.hash.split( '#' )[ 2 ] ).show();
38
}
39
+ } );
40
+ } );
admin/js/ui.js CHANGED
@@ -1,3 +1,11 @@
1
"use strict";
2
3
jQuery( document ).ready( function () {
@@ -10,9 +18,9 @@ jQuery( document ).ready( function () {
10
jQuery( "#gadwp-notice .notice-dismiss" ).click( function () {
11
jQuery.post( gadwp_ui_data.ajaxurl, gadwp_ui );
12
} );
13
-
14
- if (gadwp_ui_data.ed_bubble != ''){
15
- jQuery('#toplevel_page_gadash_settings li > a[href*="page=gadash_errors_debugging"]').append('&nbsp;<span class="awaiting-mod count-1"><span class="pending-count" style="padding:0 7px;">'+gadwp_ui_data.ed_bubble+'</span></span>');
16
- }
17
-
18
} );
1
+ /*-
2
+ * Author: Alin Marcu
3
+ * Author URI: https://deconf.com
4
+ * Copyright 2013 Alin Marcu
5
+ * License: GPLv2 or later
6
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
+ */
8
+
9
"use strict";
10
11
jQuery( document ).ready( function () {
18
jQuery( "#gadwp-notice .notice-dismiss" ).click( function () {
19
jQuery.post( gadwp_ui_data.ajaxurl, gadwp_ui );
20
} );
21
+
22
+ if ( gadwp_ui_data.ed_bubble != '' ) {
23
+ jQuery( '#toplevel_page_gadash_settings li > a[href*="page=gadash_errors_debugging"]' ).append( '&nbsp;<span class="awaiting-mod count-1"><span class="pending-count" style="padding:0 7px;">' + gadwp_ui_data.ed_bubble + '</span></span>' );
24
+ }
25
+
26
} );
admin/js/wp-color-picker-script.js CHANGED
@@ -1,3 +1,11 @@
1
- jQuery(document).ready(function($){
2
- $('.ga_dash_style').wpColorPicker();
3
- });
1
+ /*-
2
+ * Author: Alin Marcu
3
+ * Author URI: https://deconf.com
4
+ * Copyright 2013 Alin Marcu
5
+ * License: GPLv2 or later
6
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
+ */
8
+
9
+ jQuery( document ).ready( function () {
10
+ jQuery( '.ga_dash_style' ).wpColorPicker();
11
+ } );
admin/settings.php CHANGED
@@ -132,11 +132,6 @@ final class GADWP_Settings {
132
}
133
}
134
?>
135
-
136
-
137
-
138
-
139
-
140
</table>
141
</td>
142
</tr>
@@ -160,14 +155,6 @@ final class GADWP_Settings {
160
</table>
161
<input type="hidden" name="options[ga_dash_hidden]" value="Y">
162
<?php wp_nonce_field('gadash_form','gadash_security');?>
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
-
171
</form>
172
<?php
173
self::output_sidebar();
@@ -215,7 +202,7 @@ final class GADWP_Settings {
215
<table>
216
<tr>
217
<?php
218
-
219
foreach ( $wp_roles->role_names as $role => $name ) {
220
if ( $role != 'subscriber' ) {
221
$i++;
@@ -233,11 +220,6 @@ final class GADWP_Settings {
233
}
234
}
235
?>
236
-
237
-
238
-
239
-
240
-
241
</table>
242
</td>
243
</tr>
@@ -301,10 +283,6 @@ final class GADWP_Settings {
301
<input type="hidden" name="options[ga_dash_hidden]" value="Y">
302
<?php wp_nonce_field('gadash_form','gadash_security'); ?>
303
304
-
305
-
306
-
307
-
308
</form>
309
<?php
310
self::output_sidebar();
@@ -312,7 +290,7 @@ final class GADWP_Settings {
312
313
public static function tracking_settings() {
314
$gadwp = GADWP();
315
-
316
if ( ! current_user_can( 'manage_options' ) ) {
317
return;
318
}
@@ -485,6 +463,14 @@ final class GADWP_Settings {
485
<?php }?>
486
</select></td>
487
</tr>
488
</table>
489
</div>
490
<div id="gadwp-advanced">
@@ -595,14 +581,6 @@ final class GADWP_Settings {
595
}
596
}
597
?>
598
-
599
-
600
-
601
-
602
-
603
-
604
-
605
-
606
</table>
607
</td>
608
</tr>
@@ -618,11 +596,6 @@ final class GADWP_Settings {
618
</table>
619
<input type="hidden" name="options[ga_dash_hidden]" value="Y">
620
<?php wp_nonce_field('gadash_form','gadash_security'); ?>
621
-
622
-
623
-
624
-
625
-
626
</form>
627
<?php
628
self::output_sidebar();
@@ -630,13 +603,13 @@ final class GADWP_Settings {
630
631
public static function errors_debugging() {
632
global $wp_version;
633
-
634
$gadwp = GADWP();
635
-
636
if ( ! current_user_can( 'manage_options' ) ) {
637
return;
638
}
639
-
640
$anonim = $gadwp->config->options;
641
$anonim['wp_version'] = $wp_version;
642
$anonim['gadwp_version'] = GADWP_CURRENT_VERSION;
@@ -695,10 +668,10 @@ final class GADWP_Settings {
695
?></pre><br />
696
<hr>
697
</td>
698
-
699
-
700
<tr>
701
-
702
</table>
703
</div>
704
<div id="gadwp-config">
@@ -718,9 +691,9 @@ final class GADWP_Settings {
718
719
public static function general_settings() {
720
$gadwp = GADWP();
721
-
722
global $wp_version;
723
-
724
if ( ! current_user_can( 'manage_options' ) ) {
725
return;
726
}
@@ -974,7 +947,7 @@ final class GADWP_Settings {
974
public static function general_settings_network() {
975
$gadwp = GADWP();
976
global $wp_version;
977
-
978
if ( ! current_user_can( 'manage_network_options' ) ) {
979
return;
980
}
@@ -983,11 +956,11 @@ final class GADWP_Settings {
983
* Include GAPI
984
*/
985
echo '<div id="gapi-warning" class="updated"><p>' . __( 'Loading the required libraries. If this results in a blank screen or a fatal error, try this solution:', 'google-analytics-dashboard-for-wp' ) . ' <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_config&utm_medium=link&utm_content=general_screen&utm_campaign=gadwp">Library conflicts between WordPress plugins</a></p></div>';
986
-
987
if ( null === $gadwp->gapi_controller ) {
988
$gadwp->gapi_controller = new GADWP_GAPI_Controller();
989
}
990
-
991
echo '<script type="text/javascript">jQuery("#gapi-warning").hide()</script>';
992
if ( isset( $_POST['ga_dash_code'] ) ) {
993
if ( ! stripos( 'x' . $_POST['ga_dash_code'], 'UA-', 1 ) == 1 ) {
@@ -1274,7 +1247,7 @@ final class GADWP_Settings {
1274
1275
public static function output_sidebar() {
1276
global $wp_version;
1277
-
1278
$gadwp = GADWP();
1279
?>
1280
</div>
132
}
133
}
134
?>
135
</table>
136
</td>
137
</tr>
155
</table>
156
<input type="hidden" name="options[ga_dash_hidden]" value="Y">
157
<?php wp_nonce_field('gadash_form','gadash_security');?>
158
</form>
159
<?php
160
self::output_sidebar();
202
<table>
203
<tr>
204
<?php
205
+
206
foreach ( $wp_roles->role_names as $role => $name ) {
207
if ( $role != 'subscriber' ) {
208
$i++;
220
}
221
}
222
?>
223
</table>
224
</td>
225
</tr>
283
<input type="hidden" name="options[ga_dash_hidden]" value="Y">
284
<?php wp_nonce_field('gadash_form','gadash_security'); ?>
285
286
</form>
287
<?php
288
self::output_sidebar();
290
291
public static function tracking_settings() {
292
$gadwp = GADWP();
293
+
294
if ( ! current_user_can( 'manage_options' ) ) {
295
return;
296
}
463
<?php }?>
464
</select></td>
465
</tr>
466
+ <tr>
467
+ <td class="gadwp-settings-title"><label for="ga_tag_dimindex"><?php _e("Tags:", 'google-analytics-dashboard-for-wp' ); ?></label></td>
468
+ <td><select id="ga_tag_dimindex" name="options[ga_tag_dimindex]">
469
+ <?php for ($i=0;$i<21;$i++){?>
470
+ <option value="<?php echo $i;?>" <?php selected( $options['ga_tag_dimindex'], $i ); ?>><?php echo $i==0?'Disabled':'dimension '.$i; ?></option>
471
+ <?php }?>
472
+ </select></td>
473
+ </tr>
474
</table>
475
</div>
476
<div id="gadwp-advanced">
581
}
582
}
583
?>
584
</table>
585
</td>
586
</tr>
596
</table>
597
<input type="hidden" name="options[ga_dash_hidden]" value="Y">
598
<?php wp_nonce_field('gadash_form','gadash_security'); ?>
599
</form>
600
<?php
601
self::output_sidebar();
603
604
public static function errors_debugging() {
605
global $wp_version;
606
+
607
$gadwp = GADWP();
608
+
609
if ( ! current_user_can( 'manage_options' ) ) {
610
return;
611
}
612
+
613
$anonim = $gadwp->config->options;
614
$anonim['wp_version'] = $wp_version;
615
$anonim['gadwp_version'] = GADWP_CURRENT_VERSION;
668
?></pre><br />
669
<hr>
670
</td>
671
+
672
+
673
<tr>
674
+
675
</table>
676
</div>
677
<div id="gadwp-config">
691
692
public static function general_settings() {
693
$gadwp = GADWP();
694
+
695
global $wp_version;
696
+
697
if ( ! current_user_can( 'manage_options' ) ) {
698
return;
699
}
947
public static function general_settings_network() {
948
$gadwp = GADWP();
949
global $wp_version;
950
+
951
if ( ! current_user_can( 'manage_network_options' ) ) {
952
return;
953
}
956
* Include GAPI
957
*/
958
echo '<div id="gapi-warning" class="updated"><p>' . __( 'Loading the required libraries. If this results in a blank screen or a fatal error, try this solution:', 'google-analytics-dashboard-for-wp' ) . ' <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_config&utm_medium=link&utm_content=general_screen&utm_campaign=gadwp">Library conflicts between WordPress plugins</a></p></div>';
959
+
960
if ( null === $gadwp->gapi_controller ) {
961
$gadwp->gapi_controller = new GADWP_GAPI_Controller();
962
}
963
+
964
echo '<script type="text/javascript">jQuery("#gapi-warning").hide()</script>';
965
if ( isset( $_POST['ga_dash_code'] ) ) {
966
if ( ! stripos( 'x' . $_POST['ga_dash_code'], 'UA-', 1 ) == 1 ) {
1247
1248
public static function output_sidebar() {
1249
global $wp_version;
1250
+
1251
$gadwp = GADWP();
1252
?>
1253
</div>
admin/setup.php CHANGED
@@ -19,7 +19,7 @@ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
19
20
public function __construct() {
21
$this->gadwp = GADWP();
22
-
23
// Styles & Scripts
24
add_action( 'admin_enqueue_scripts', array( $this, 'load_styles_scripts' ) );
25
// Site Menu
@@ -69,34 +69,34 @@ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
69
*/
70
public function load_styles_scripts( $hook ) {
71
$new_hook = explode( '_page_', $hook );
72
-
73
if ( isset( $new_hook[1] ) ) {
74
$new_hook = '_page_' . $new_hook[1];
75
} else {
76
$new_hook = $hook;
77
}
78
-
79
$lang = get_bloginfo( 'language' );
80
$lang = explode( '-', $lang );
81
$lang = $lang[0];
82
-
83
/*
84
* GADWP main stylesheet
85
*/
86
wp_enqueue_style( 'gadwp', GADWP_URL . 'admin/css/gadwp.css', null, GADWP_CURRENT_VERSION );
87
-
88
/*
89
* GADWP UI
90
*/
91
-
92
if ( GADWP_Tools::get_cache( 'gapi_errors' ) ) {
93
$ed_bubble = '!';
94
} else {
95
$ed_bubble = '';
96
}
97
-
98
wp_enqueue_script( 'gadwp-backend-ui', plugins_url( 'js/ui.js', __FILE__ ), array( 'jquery' ), GADWP_CURRENT_VERSION, true );
99
-
100
/* @formatter:off */
101
wp_localize_script( 'gadwp-backend-ui', 'gadwp_ui_data', array(
102
'ajaxurl' => admin_url( 'admin-ajax.php' ),
@@ -105,7 +105,7 @@ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
105
)
106
);
107
/* @formatter:on */
108
-
109
if ( $this->gadwp->config->options['switch_profile'] && count( $this->gadwp->config->options['ga_dash_profile_list'] ) > 1 ) {
110
$views = array();
111
foreach ( $this->gadwp->config->options['ga_dash_profile_list'] as $items ) {
@@ -116,15 +116,15 @@ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
116
} else {
117
$views = false;
118
}
119
-
120
/*
121
* Main Dashboard Widgets Styles & Scripts
122
*/
123
$widgets_hooks = array( 'index.php' );
124
-
125
if ( in_array( $new_hook, $widgets_hooks ) ) {
126
if ( GADWP_Tools::check_roles( $this->gadwp->config->options['ga_dash_access_back'] ) && $this->gadwp->config->options['dashboard_widget'] ) {
127
-
128
if ( $this->gadwp->config->options['ga_target_geomap'] ) {
129
$country_codes = GADWP_Tools::get_countrycodes();
130
if ( isset( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ) ) {
@@ -135,25 +135,23 @@ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
135
} else {
136
$region = false;
137
}
138
-
139
wp_enqueue_style( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.css', null, GADWP_CURRENT_VERSION );
140
-
141
wp_enqueue_style( 'gadwp-backend-item-reports', GADWP_URL . 'admin/css/admin-widgets.css', null, GADWP_CURRENT_VERSION );
142
-
143
wp_register_style( 'jquery-ui-tooltip-html', GADWP_URL . 'common/realtime/jquery.ui.tooltip.html.css' );
144
-
145
wp_enqueue_style( 'jquery-ui-tooltip-html' );
146
-
147
wp_register_script( 'jquery-ui-tooltip-html', GADWP_URL . 'common/realtime/jquery.ui.tooltip.html.js' );
148
-
149
- if ( ! wp_script_is( 'googlejsapi' ) ) {
150
- wp_register_script( 'googlejsapi', 'https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22language%22%3A%22' . $lang . '%22%2C%22packages%22%3A%5B%22corechart%22%2C%20%22table%22%2C%20%22orgchart%22%2C%20%22geochart%22%5D%7D%5D%7D%27', array(), null );
151
- }
152
-
153
wp_enqueue_script( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
154
-
155
- wp_enqueue_script( 'gadwp-backend-dashboard-reports', GADWP_URL . 'common/js/reports.js', array( 'jquery', 'googlejsapi', 'gadwp-nprogress', 'jquery-ui-tooltip', 'jquery-ui-core', 'jquery-ui-position', 'jquery-ui-tooltip-html' ), GADWP_CURRENT_VERSION );
156
-
157
/* @formatter:off */
158
wp_localize_script( 'gadwp-backend-dashboard-reports', 'gadwpItemData', array(
159
'ajaxurl' => admin_url( 'admin-ajax.php' ),
@@ -194,7 +192,7 @@ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
194
__( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
195
__( "Organic Search", 'google-analytics-dashboard-for-wp' ),
196
__( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
197
- __( "Invalid response, more details in JavaScript Console (F12).", 'google-analytics-dashboard-for-wp' ),
198
__( "Not enough data collected", 'google-analytics-dashboard-for-wp' ),
199
__( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
200
__( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
@@ -221,14 +219,14 @@ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
221
/* @formatter:on */
222
}
223
}
224
-
225
/*
226
* Posts/Pages List Styles & Scripts
227
*/
228
$contentstats_hooks = array( 'edit.php' );
229
if ( in_array( $hook, $contentstats_hooks ) ) {
230
if ( GADWP_Tools::check_roles( $this->gadwp->config->options['ga_dash_access_back'] ) && $this->gadwp->config->options['backend_item_reports'] ) {
231
-
232
if ( $this->gadwp->config->options['ga_target_geomap'] ) {
233
$country_codes = GADWP_Tools::get_countrycodes();
234
if ( isset( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ) ) {
@@ -239,21 +237,19 @@ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
239
} else {
240
$region = false;
241
}
242
-
243
wp_enqueue_style( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.css', null, GADWP_CURRENT_VERSION );
244
-
245
wp_enqueue_style( 'gadwp-backend-item-reports', GADWP_URL . 'admin/css/item-reports.css', null, GADWP_CURRENT_VERSION );
246
-
247
wp_enqueue_style( "wp-jquery-ui-dialog" );
248
-
249
- if ( ! wp_script_is( 'googlejsapi' ) ) {
250
- wp_register_script( 'googlejsapi', 'https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22language%22%3A%22' . $lang . '%22%2C%22packages%22%3A%5B%22corechart%22%2C%20%22table%22%2C%20%22orgchart%22%2C%20%22geochart%22%5D%7D%5D%7D%27', array(), null );
251
- }
252
-
253
wp_enqueue_script( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
254
-
255
- wp_enqueue_script( 'gadwp-backend-item-reports', GADWP_URL . 'common/js/reports.js', array( 'gadwp-nprogress', 'googlejsapi', 'jquery', 'jquery-ui-dialog' ), GADWP_CURRENT_VERSION );
256
-
257
/* @formatter:off */
258
wp_localize_script( 'gadwp-backend-item-reports', 'gadwpItemData', array(
259
'ajaxurl' => admin_url( 'admin-ajax.php' ),
@@ -292,7 +288,7 @@ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
292
__( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
293
__( "Organic Search", 'google-analytics-dashboard-for-wp' ),
294
__( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
295
- __( "Invalid response, more details in JavaScript Console (F12).", 'google-analytics-dashboard-for-wp' ),
296
__( "Not enough data collected", 'google-analytics-dashboard-for-wp' ),
297
__( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
298
__( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
@@ -312,17 +308,17 @@ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
312
/* @formatter:on */
313
}
314
}
315
-
316
/*
317
* Settings Styles & Scripts
318
*/
319
$settings_hooks = array( '_page_gadash_settings', '_page_gadash_backend_settings', '_page_gadash_frontend_settings', '_page_gadash_tracking_settings', '_page_gadash_errors_debugging' );
320
-
321
if ( in_array( $new_hook, $settings_hooks ) ) {
322
wp_enqueue_style( 'wp-color-picker' );
323
wp_enqueue_script( 'wp-color-picker' );
324
wp_enqueue_script( 'wp-color-picker-script-handle', plugins_url( 'js/wp-color-picker-script.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
325
- wp_enqueue_script( 'gadwp-settings', plugins_url( 'js/settings.js', __FILE__ ), array( 'jquery' ), GADWP_CURRENT_VERSION );
326
}
327
}
328
@@ -344,11 +340,11 @@ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
344
*/
345
function admin_notice() {
346
$currentScreen = get_current_screen();
347
-
348
if ( ! current_user_can( 'manage_options' ) || $currentScreen->base != 'dashboard' ) {
349
return;
350
}
351
-
352
if ( get_option( 'gadwp_got_updated' ) ) :
353
?>
354
<div id="gadwp-notice" class="notice is-dismissible">
19
20
public function __construct() {
21
$this->gadwp = GADWP();
22
+
23
// Styles & Scripts
24
add_action( 'admin_enqueue_scripts', array( $this, 'load_styles_scripts' ) );
25
// Site Menu
69
*/
70
public function load_styles_scripts( $hook ) {
71
$new_hook = explode( '_page_', $hook );
72
+
73
if ( isset( $new_hook[1] ) ) {
74
$new_hook = '_page_' . $new_hook[1];
75
} else {
76
$new_hook = $hook;
77
}
78
+
79
$lang = get_bloginfo( 'language' );
80
$lang = explode( '-', $lang );
81
$lang = $lang[0];
82
+
83
/*
84
* GADWP main stylesheet
85
*/
86
wp_enqueue_style( 'gadwp', GADWP_URL . 'admin/css/gadwp.css', null, GADWP_CURRENT_VERSION );
87
+
88
/*
89
* GADWP UI
90
*/
91
+
92
if ( GADWP_Tools::get_cache( 'gapi_errors' ) ) {
93
$ed_bubble = '!';
94
} else {
95
$ed_bubble = '';
96
}
97
+
98
wp_enqueue_script( 'gadwp-backend-ui', plugins_url( 'js/ui.js', __FILE__ ), array( 'jquery' ), GADWP_CURRENT_VERSION, true );
99
+
100
/* @formatter:off */
101
wp_localize_script( 'gadwp-backend-ui', 'gadwp_ui_data', array(
102
'ajaxurl' => admin_url( 'admin-ajax.php' ),
105
)
106
);
107
/* @formatter:on */
108
+
109
if ( $this->gadwp->config->options['switch_profile'] && count( $this->gadwp->config->options['ga_dash_profile_list'] ) > 1 ) {
110
$views = array();
111
foreach ( $this->gadwp->config->options['ga_dash_profile_list'] as $items ) {
116
} else {
117
$views = false;
118
}
119
+
120
/*
121
* Main Dashboard Widgets Styles & Scripts
122
*/
123
$widgets_hooks = array( 'index.php' );
124
+
125
if ( in_array( $new_hook, $widgets_hooks ) ) {
126
if ( GADWP_Tools::check_roles( $this->gadwp->config->options['ga_dash_access_back'] ) && $this->gadwp->config->options['dashboard_widget'] ) {
127
+
128
if ( $this->gadwp->config->options['ga_target_geomap'] ) {
129
$country_codes = GADWP_Tools::get_countrycodes();
130
if ( isset( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ) ) {
135
} else {
136
$region = false;
137
}
138
+
139
wp_enqueue_style( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.css', null, GADWP_CURRENT_VERSION );
140
+
141
wp_enqueue_style( 'gadwp-backend-item-reports', GADWP_URL . 'admin/css/admin-widgets.css', null, GADWP_CURRENT_VERSION );
142
+
143
wp_register_style( 'jquery-ui-tooltip-html', GADWP_URL . 'common/realtime/jquery.ui.tooltip.html.css' );
144
+
145
wp_enqueue_style( 'jquery-ui-tooltip-html' );
146
+
147
wp_register_script( 'jquery-ui-tooltip-html', GADWP_URL . 'common/realtime/jquery.ui.tooltip.html.js' );
148
+
149
+ wp_register_script( 'googlejsapi', 'https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22language%22%3A%22' . $lang . '%22%2C%22packages%22%3A%5B%22corechart%22%2C%20%22table%22%2C%20%22orgchart%22%2C%20%22geochart%22%5D%7D%5D%7D%27', array(), null );
150
+
151
wp_enqueue_script( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
152
+
153
+ wp_enqueue_script( 'gadwp-backend-dashboard-reports', GADWP_URL . 'common/js/reports.js', array( 'jquery', 'googlejsapi', 'gadwp-nprogress', 'jquery-ui-tooltip', 'jquery-ui-core', 'jquery-ui-position', 'jquery-ui-tooltip-html' ), GADWP_CURRENT_VERSION, true );
154
+
155
/* @formatter:off */
156
wp_localize_script( 'gadwp-backend-dashboard-reports', 'gadwpItemData', array(
157
'ajaxurl' => admin_url( 'admin-ajax.php' ),
192
__( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
193
__( "Organic Search", 'google-analytics-dashboard-for-wp' ),
194
__( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
195
+ __( "Invalid response", 'google-analytics-dashboard-for-wp' ),
196
__( "Not enough data collected", 'google-analytics-dashboard-for-wp' ),
197
__( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
198
__( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
219
/* @formatter:on */
220
}
221
}
222
+
223
/*
224
* Posts/Pages List Styles & Scripts
225
*/
226
$contentstats_hooks = array( 'edit.php' );
227
if ( in_array( $hook, $contentstats_hooks ) ) {
228
if ( GADWP_Tools::check_roles( $this->gadwp->config->options['ga_dash_access_back'] ) && $this->gadwp->config->options['backend_item_reports'] ) {
229
+
230
if ( $this->gadwp->config->options['ga_target_geomap'] ) {
231
$country_codes = GADWP_Tools::get_countrycodes();
232
if ( isset( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ) ) {
237
} else {
238
$region = false;
239
}
240
+
241
wp_enqueue_style( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.css', null, GADWP_CURRENT_VERSION );
242
+
243
wp_enqueue_style( 'gadwp-backend-item-reports', GADWP_URL . 'admin/css/item-reports.css', null, GADWP_CURRENT_VERSION );
244
+
245
wp_enqueue_style( "wp-jquery-ui-dialog" );
246
+
247
+ wp_register_script( 'googlejsapi', 'https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22language%22%3A%22' . $lang . '%22%2C%22packages%22%3A%5B%22corechart%22%2C%20%22table%22%2C%20%22orgchart%22%2C%20%22geochart%22%5D%7D%5D%7D%27', array(), null );
248
+
249
wp_enqueue_script( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
250
+
251
+ wp_enqueue_script( 'gadwp-backend-item-reports', GADWP_URL . 'common/js/reports.js', array( 'gadwp-nprogress', 'googlejsapi', 'jquery', 'jquery-ui-dialog' ), GADWP_CURRENT_VERSION, true );
252
+
253
/* @formatter:off */
254
wp_localize_script( 'gadwp-backend-item-reports', 'gadwpItemData', array(
255
'ajaxurl' => admin_url( 'admin-ajax.php' ),
288
__( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
289
__( "Organic Search", 'google-analytics-dashboard-for-wp' ),
290
__( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
291
+ __( "Invalid response", 'google-analytics-dashboard-for-wp' ),
292
__( "Not enough data collected", 'google-analytics-dashboard-for-wp' ),
293
__( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
294
__( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
308
/* @formatter:on */
309
}
310
}
311
+
312
/*
313
* Settings Styles & Scripts
314
*/
315
$settings_hooks = array( '_page_gadash_settings', '_page_gadash_backend_settings', '_page_gadash_frontend_settings', '_page_gadash_tracking_settings', '_page_gadash_errors_debugging' );
316
+
317
if ( in_array( $new_hook, $settings_hooks ) ) {
318
wp_enqueue_style( 'wp-color-picker' );
319
wp_enqueue_script( 'wp-color-picker' );
320
wp_enqueue_script( 'wp-color-picker-script-handle', plugins_url( 'js/wp-color-picker-script.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
321
+ wp_enqueue_script( 'gadwp-settings', plugins_url( 'js/settings.js', __FILE__ ), array( 'jquery' ), GADWP_CURRENT_VERSION, true );
322
}
323
}
324
340
*/
341
function admin_notice() {
342
$currentScreen = get_current_screen();
343
+
344
if ( ! current_user_can( 'manage_options' ) || $currentScreen->base != 'dashboard' ) {
345
return;
346
}
347
+
348
if ( get_option( 'gadwp_got_updated' ) ) :
349
?>
350
<div id="gadwp-notice" class="notice is-dismissible">
common/js/reports.js CHANGED
@@ -1,5 +1,9 @@
1
- /**
2
- * Author: Alin Marcu Author URI: https://deconf.com Copyright 2013 Alin Marcu License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html
3
*/
4
5
"use strict";
@@ -363,7 +367,7 @@ jQuery.fn.extend( {
363
height : '80%'
364
},
365
title : title,
366
- pieSliceText: 'value',
367
colors : gadwpItemData.colorVariations
368
};
369
chart = new google.visualization.PieChart( document.getElementById( 'gadwp-' + id + slug ) );
@@ -430,12 +434,12 @@ jQuery.fn.extend( {
430
},
431
432
drawBottomStats : function ( data ) {
433
- jQuery( "#gdsessions" + slug ).text( data[ 0 ] );
434
- jQuery( "#gdusers" + slug ).text( data[ 1 ] );
435
- jQuery( "#gdpageviews" + slug ).text( data[ 2 ] );
436
- jQuery( "#gdbouncerate" + slug ).text( data[ 3 ] + "%" );
437
- jQuery( "#gdorganicsearch" + slug ).text( data[ 4 ] );
438
- jQuery( "#gdpagespervisit" + slug ).text( data[ 5 ] );
439
},
440
441
rtOnlyUniqueValues : function ( value, index, self ) {
@@ -689,6 +693,17 @@ jQuery.fn.extend( {
689
if ( response == '-24' ) {
690
jQuery( "#gadwp-status" + slug ).html( gadwpItemData.i18n[ 15 ] );
691
} else {
692
jQuery( "#gadwp-status" + slug ).html( gadwpItemData.i18n[ 11 ] );
693
console.log( "\n********************* GADWP Log ********************* \n\n" + response );
694
postData = {
@@ -1028,7 +1043,7 @@ jQuery.fn.extend( {
1028
}
1029
} );
1030
1031
- jQuery( function () {
1032
if ( gadwpItemData.scope == 'admin-widgets' ) {
1033
jQuery( '#gadwp-window-1' ).gadwpItemReport( 1 );
1034
} else {
1
+ /*-
2
+ * Author: Alin Marcu
3
+ * Author URI: https://deconf.com
4
+ * Copyright 2013 Alin Marcu
5
+ * License: GPLv2 or later
6
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
*/
8
9
"use strict";
367
height : '80%'
368
},
369
title : title,
370
+ pieSliceText : 'value',
371
colors : gadwpItemData.colorVariations
372
};
373
chart = new google.visualization.PieChart( document.getElementById( 'gadwp-' + id + slug ) );
434
},
435
436
drawBottomStats : function ( data ) {
437
+ jQuery( "#gdsessions" + slug ).html( data[ 0 ] );
438
+ jQuery( "#gdusers" + slug ).html( data[ 1 ] );
439
+ jQuery( "#gdpageviews" + slug ).html( data[ 2 ] );
440
+ jQuery( "#gdbouncerate" + slug ).html( data[ 3 ] + "%" );
441
+ jQuery( "#gdorganicsearch" + slug ).html( data[ 4 ] );
442
+ jQuery( "#gdpagespervisit" + slug ).html( data[ 5 ] );
443
},
444
445
rtOnlyUniqueValues : function ( value, index, self ) {
693
if ( response == '-24' ) {
694
jQuery( "#gadwp-status" + slug ).html( gadwpItemData.i18n[ 15 ] );
695
} else {
696
+ jQuery( "#gadwp-reports" + slug ).css( {
697
+ "background-color" : "#F7F7F7",
698
+ "height" : "auto",
699
+ "margin-top" : "10px",
700
+ "padding-top" : "50px",
701
+ "padding-bottom" : "50px",
702
+ "color" : "#000",
703
+ "text-align" : "center"
704
+ } );
705
+ jQuery( "#gadwp-reports" + slug ).html ( response );
706
+ jQuery( "#gadwp-reports" + slug ).show();
707
jQuery( "#gadwp-status" + slug ).html( gadwpItemData.i18n[ 11 ] );
708
console.log( "\n********************* GADWP Log ********************* \n\n" + response );
709
postData = {
1043
}
1044
} );
1045
1046
+ jQuery( document ).ready( function () {
1047
if ( gadwpItemData.scope == 'admin-widgets' ) {
1048
jQuery( '#gadwp-window-1' ).gadwpItemReport( 1 );
1049
} else {
common/nprogress/nprogress.js CHANGED
@@ -1,5 +1,6 @@
1
- /* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
2
- * @license MIT */
3
4
;(function(root, factory) {
5
1
+ /**
2
+ * NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress * @license MIT
3
+ */
4
5
;(function(root, factory) {
6
common/realtime/jquery.ui.tooltip.html.js CHANGED
@@ -1,3 +1,11 @@
1
jQuery(function () {
2
jQuery('#gadwp-widget *').tooltip({
3
items: "[data-gadwp]",
1
+ /*-
2
+ * Author: Alin Marcu Author
3
+ * URI: https://deconf.com
4
+ * Copyright 2013 Alin Marcu
5
+ * License: GPLv2 or later
6
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
+ */
8
+
9
jQuery(function () {
10
jQuery('#gadwp-widget *').tooltip({
11
items: "[data-gadwp]",
config.php CHANGED
@@ -95,6 +95,9 @@ if ( ! class_exists( 'GADWP_Config' ) ) {
95
if ( isset( $options['ga_category_dimindex'] ) ) {
96
$options['ga_category_dimindex'] = (int) $options['ga_category_dimindex'];
97
}
98
if ( isset( $options['ga_user_dimindex'] ) ) {
99
$options['ga_user_dimindex'] = (int) $options['ga_user_dimindex'];
100
}
@@ -287,10 +290,15 @@ if ( ! class_exists( 'GADWP_Config' ) ) {
287
$this->options['ga_author_dimindex'] = 0;
288
$flag = true;
289
}
290
if ( ! isset( $this->options['ga_category_dimindex'] ) ) {
291
$this->options['ga_category_dimindex'] = 0;
292
$flag = true;
293
}
294
if ( ! isset( $this->options['ga_user_dimindex'] ) ) {
295
$this->options['ga_user_dimindex'] = 0;
296
$flag = true;
95
if ( isset( $options['ga_category_dimindex'] ) ) {
96
$options['ga_category_dimindex'] = (int) $options['ga_category_dimindex'];
97
}
98
+ if ( isset( $options['ga_tag_dimindex'] ) ) {
99
+ $options['ga_tag_dimindex'] = (int) $options['ga_tag_dimindex'];
100
+ }
101
if ( isset( $options['ga_user_dimindex'] ) ) {
102
$options['ga_user_dimindex'] = (int) $options['ga_user_dimindex'];
103
}
290
$this->options['ga_author_dimindex'] = 0;
291
$flag = true;
292
}
293
+ if ( ! isset( $this->options['ga_tag_dimindex'] ) ) {
294
+ $this->options['ga_tag_dimindex'] = 0;
295
+ $flag = true;
296
+ }
297
if ( ! isset( $this->options['ga_category_dimindex'] ) ) {
298
$this->options['ga_category_dimindex'] = 0;
299
$flag = true;
300
}
301
+ $options['ga_tag_dimindex'] = 0;
302
if ( ! isset( $this->options['ga_user_dimindex'] ) ) {
303
$this->options['ga_user_dimindex'] = 0;
304
$flag = true;
front/ajax-actions.php CHANGED
@@ -1,8 +1,8 @@
1
<?php
2
/**
3
- * Author: Alin Marcu
4
* Author URI: https://deconf.com
5
- * Copyright 2013 Alin Marcu
6
* License: GPLv2 or later
7
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
*/
@@ -19,12 +19,12 @@ if ( ! class_exists( 'GADWP_Frontend_Ajax' ) ) {
19
20
public function __construct() {
21
$this->gadwp = GADWP();
22
-
23
if ( GADWP_Tools::check_roles( $this->gadwp->config->options['ga_dash_access_front'] ) && $this->gadwp->config->options['frontend_item_reports'] ) {
24
// Item Reports action
25
add_action( 'wp_ajax_gadwp_frontend_item_reports', array( $this, 'ajax_item_reports' ) );
26
}
27
-
28
// Frontend Widget actions
29
add_action( 'wp_ajax_ajax_frontwidget_report', array( $this, 'ajax_frontend_widget' ) );
30
add_action( 'wp_ajax_nopriv_ajax_frontwidget_report', array( $this, 'ajax_frontend_widget' ) );
@@ -39,21 +39,21 @@ if ( ! class_exists( 'GADWP_Frontend_Ajax' ) ) {
39
if ( ! isset( $_POST['gadwp_security_frontend_item_reports'] ) || ! wp_verify_nonce( $_POST['gadwp_security_frontend_item_reports'], 'gadwp_frontend_item_reports' ) ) {
40
wp_die( - 30 );
41
}
42
-
43
$from = $_POST['from'];
44
$to = $_POST['to'];
45
$query = $_POST['query'];
46
$uri = $_POST['filter'];
47
-
48
$query = $_POST['query'];
49
if ( ob_get_length() ) {
50
ob_clean();
51
}
52
-
53
if ( ! GADWP_Tools::check_roles( $this->gadwp->config->options['ga_dash_access_front'] ) || 0 == $this->gadwp->config->options['frontend_item_reports'] ) {
54
wp_die( - 31 );
55
}
56
-
57
if ( $this->gadwp->config->options['ga_dash_token'] && $this->gadwp->config->options['ga_dash_tableid_jail'] ) {
58
if ( null === $this->gadwp->gapi_controller ) {
59
$this->gadwp->gapi_controller = new GADWP_GAPI_Controller();
@@ -61,43 +61,43 @@ if ( ! class_exists( 'GADWP_Frontend_Ajax' ) ) {
61
} else {
62
wp_die( - 24 );
63
}
64
-
65
if ( $this->gadwp->config->options['ga_dash_tableid_jail'] ) {
66
$projectId = $this->gadwp->config->options['ga_dash_tableid_jail'];
67
} else {
68
- wp_die( - 25 );
69
}
70
-
71
$profile_info = GADWP_Tools::get_selected_profile( $this->gadwp->config->options['ga_dash_profile_list'], $projectId );
72
-
73
if ( isset( $profile_info[4] ) ) {
74
$this->gadwp->gapi_controller->timeshift = $profile_info[4];
75
} else {
76
$this->gadwp->gapi_controller->timeshift = (int) current_time( 'timestamp' ) - time();
77
}
78
-
79
$uri = '/' . ltrim( $uri, '/' );
80
-
81
// allow URL correction before sending an API request
82
$filter = apply_filters( 'gadwp_frontenditem_uri', $uri );
83
-
84
$lastchar = substr( $filter, - 1 );
85
-
86
if ( isset( $profile_info[6] ) && $profile_info[6] && $lastchar == '/' ) {
87
$filter = $filter . $profile_info[6];
88
}
89
-
90
// Encode URL
91
$filter = rawurlencode( rawurldecode( $filter ) );
92
-
93
$queries = explode( ',', $query );
94
-
95
$results = array();
96
-
97
foreach ( $queries as $value ) {
98
$results[] = $this->gadwp->gapi_controller->get( $projectId, $value, $from, $to, $filter );
99
}
100
-
101
wp_send_json( $results );
102
}
103
1
<?php
2
/**
3
+ * Author: Alin Marcu
4
* Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
* License: GPLv2 or later
7
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
*/
19
20
public function __construct() {
21
$this->gadwp = GADWP();
22
+
23
if ( GADWP_Tools::check_roles( $this->gadwp->config->options['ga_dash_access_front'] ) && $this->gadwp->config->options['frontend_item_reports'] ) {
24
// Item Reports action
25
add_action( 'wp_ajax_gadwp_frontend_item_reports', array( $this, 'ajax_item_reports' ) );
26
}
27
+
28
// Frontend Widget actions
29
add_action( 'wp_ajax_ajax_frontwidget_report', array( $this, 'ajax_frontend_widget' ) );
30
add_action( 'wp_ajax_nopriv_ajax_frontwidget_report', array( $this, 'ajax_frontend_widget' ) );
39
if ( ! isset( $_POST['gadwp_security_frontend_item_reports'] ) || ! wp_verify_nonce( $_POST['gadwp_security_frontend_item_reports'], 'gadwp_frontend_item_reports' ) ) {
40
wp_die( - 30 );
41
}
42
+
43
$from = $_POST['from'];
44
$to = $_POST['to'];
45
$query = $_POST['query'];
46
$uri = $_POST['filter'];
47
+
48
$query = $_POST['query'];
49
if ( ob_get_length() ) {
50
ob_clean();
51
}
52
+
53
if ( ! GADWP_Tools::check_roles( $this->gadwp->config->options['ga_dash_access_front'] ) || 0 == $this->gadwp->config->options['frontend_item_reports'] ) {
54
wp_die( - 31 );
55
}
56
+
57
if ( $this->gadwp->config->options['ga_dash_token'] && $this->gadwp->config->options['ga_dash_tableid_jail'] ) {
58
if ( null === $this->gadwp->gapi_controller ) {
59
$this->gadwp->gapi_controller = new GADWP_GAPI_Controller();
61
} else {
62
wp_die( - 24 );
63
}
64
+
65
if ( $this->gadwp->config->options['ga_dash_tableid_jail'] ) {
66
$projectId = $this->gadwp->config->options['ga_dash_tableid_jail'];
67
} else {
68
+ wp_die( - 26 );
69
}
70
+
71
$profile_info = GADWP_Tools::get_selected_profile( $this->gadwp->config->options['ga_dash_profile_list'], $projectId );
72
+
73
if ( isset( $profile_info[4] ) ) {
74
$this->gadwp->gapi_controller->timeshift = $profile_info[4];
75
} else {
76
$this->gadwp->gapi_controller->timeshift = (int) current_time( 'timestamp' ) - time();
77
}
78
+
79
$uri = '/' . ltrim( $uri, '/' );
80
+
81
// allow URL correction before sending an API request
82
$filter = apply_filters( 'gadwp_frontenditem_uri', $uri );
83
+
84
$lastchar = substr( $filter, - 1 );
85
+
86
if ( isset( $profile_info[6] ) && $profile_info[6] && $lastchar == '/' ) {
87
$filter = $filter . $profile_info[6];
88
}
89
+
90
// Encode URL
91
$filter = rawurlencode( rawurldecode( $filter ) );
92
+
93
$queries = explode( ',', $query );
94
+
95
$results = array();
96
+
97
foreach ( $queries as $value ) {
98
$results[] = $this->gadwp->gapi_controller->get( $projectId, $value, $from, $to, $filter );
99
}
100
+
101
wp_send_json( $results );
102
}
103
front/js/widgets.js CHANGED
@@ -1,8 +1,8 @@
1
- /**
2
* Author: Alin Marcu
3
- * Author URI: https://deconf.com
4
* Copyright 2013 Alin Marcu
5
- * License: GPLv2 or later
6
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
*/
8
1
+ /*-
2
* Author: Alin Marcu
3
+ * Author URI: https://deconf.com
4
* Copyright 2013 Alin Marcu
5
+ * License: GPLv2 or later
6
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
*/
8
front/setup.php CHANGED
@@ -19,7 +19,7 @@ if ( ! class_exists( 'GADWP_Frontend_Setup' ) ) {
19
20
public function __construct() {
21
$this->gadwp = GADWP();
22
-
23
// Styles & Scripts
24
add_action( 'wp_enqueue_scripts', array( $this, 'load_styles_scripts' ) );
25
}
@@ -34,33 +34,31 @@ if ( ! class_exists( 'GADWP_Frontend_Setup' ) ) {
34
$lang = get_bloginfo( 'language' );
35
$lang = explode( '-', $lang );
36
$lang = $lang[0];
37
-
38
/*
39
* Item reports Styles & Scripts
40
*/
41
if ( GADWP_Tools::check_roles( $this->gadwp->config->options['ga_dash_access_front'] ) && $this->gadwp->config->options['frontend_item_reports'] ) {
42
-
43
wp_enqueue_style( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.css', null, GADWP_CURRENT_VERSION );
44
-
45
wp_enqueue_style( 'gadwp-frontend-item-reports', GADWP_URL . 'front/css/item-reports.css', null, GADWP_CURRENT_VERSION );
46
-
47
$country_codes = GADWP_Tools::get_countrycodes();
48
if ( $this->gadwp->config->options['ga_target_geomap'] && isset( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ) ) {
49
$region = $this->gadwp->config->options['ga_target_geomap'];
50
} else {
51
$region = false;
52
}
53
-
54
wp_enqueue_style( "wp-jquery-ui-dialog" );
55
-
56
- if ( ! wp_script_is( 'googlejsapi' ) ) {
57
- wp_register_script( 'googlejsapi', 'https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22language%22%3A%22' . $lang . '%22%2C%22packages%22%3A%5B%22corechart%22%2C%20%22table%22%2C%20%22orgchart%22%2C%20%22geochart%22%5D%7D%5D%7D%27', array(), null );
58
- }
59
-
60
wp_enqueue_script( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
61
-
62
- wp_enqueue_script( 'gadwp-frontend-item-reports', GADWP_URL . 'common/js/reports.js', array( 'gadwp-nprogress', 'googlejsapi', 'jquery', 'jquery-ui-dialog' ), GADWP_CURRENT_VERSION );
63
-
64
/* @formatter:off */
65
wp_localize_script( 'gadwp-frontend-item-reports', 'gadwpItemData', array(
66
'ajaxurl' => admin_url( 'admin-ajax.php' ),
@@ -99,7 +97,7 @@ if ( ! class_exists( 'GADWP_Frontend_Setup' ) ) {
99
__( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
100
__( "Organic Search", 'google-analytics-dashboard-for-wp' ),
101
__( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
102
- __( "Invalid response, more details in JavaScript Console (F12).", 'google-analytics-dashboard-for-wp' ),
103
__( "Not enough data collected", 'google-analytics-dashboard-for-wp' ),
104
__( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
105
__( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
19
20
public function __construct() {
21
$this->gadwp = GADWP();
22
+
23
// Styles & Scripts
24
add_action( 'wp_enqueue_scripts', array( $this, 'load_styles_scripts' ) );
25
}
34
$lang = get_bloginfo( 'language' );
35
$lang = explode( '-', $lang );
36
$lang = $lang[0];
37
+
38
/*
39
* Item reports Styles & Scripts
40
*/
41
if ( GADWP_Tools::check_roles( $this->gadwp->config->options['ga_dash_access_front'] ) && $this->gadwp->config->options['frontend_item_reports'] ) {
42
+
43
wp_enqueue_style( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.css', null, GADWP_CURRENT_VERSION );
44
+
45
wp_enqueue_style( 'gadwp-frontend-item-reports', GADWP_URL . 'front/css/item-reports.css', null, GADWP_CURRENT_VERSION );
46
+
47
$country_codes = GADWP_Tools::get_countrycodes();
48
if ( $this->gadwp->config->options['ga_target_geomap'] && isset( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ) ) {
49
$region = $this->gadwp->config->options['ga_target_geomap'];
50
} else {
51
$region = false;
52
}
53
+
54
wp_enqueue_style( "wp-jquery-ui-dialog" );
55
+
56
+ wp_register_script( 'googlejsapi', 'https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22language%22%3A%22' . $lang . '%22%2C%22packages%22%3A%5B%22corechart%22%2C%20%22table%22%2C%20%22orgchart%22%2C%20%22geochart%22%5D%7D%5D%7D%27', array(), null );
57
+
58
wp_enqueue_script( 'gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.js', array( 'jquery' ), GADWP_CURRENT_VERSION );
59
+
60
+ wp_enqueue_script( 'gadwp-frontend-item-reports', GADWP_URL . 'common/js/reports.js', array( 'gadwp-nprogress', 'googlejsapi', 'jquery', 'jquery-ui-dialog' ), GADWP_CURRENT_VERSION, true );
61
+
62
/* @formatter:off */
63
wp_localize_script( 'gadwp-frontend-item-reports', 'gadwpItemData', array(
64
'ajaxurl' => admin_url( 'admin-ajax.php' ),
97
__( "Bounce Rate", 'google-analytics-dashboard-for-wp' ),
98
__( "Organic Search", 'google-analytics-dashboard-for-wp' ),
99
__( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
100
+ __( "Invalid response", 'google-analytics-dashboard-for-wp' ),
101
__( "Not enough data collected", 'google-analytics-dashboard-for-wp' ),
102
__( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
103
__( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
front/tracking/code-universal.php CHANGED
@@ -1,8 +1,8 @@
1
<?php
2
/**
3
- * Author: Alin Marcu
4
* Author URI: https://deconf.com
5
- * Copyright 2013 Alin Marcu
6
* License: GPLv2 or later
7
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
*/
@@ -87,6 +87,22 @@ if ( $this->gadwp->config->options['ga_category_dimindex'] && is_category() ) {
87
ga('set', 'dimension<?php echo (int)$this->gadwp->config->options ['ga_category_dimindex']; ?>', '<?php echo esc_attr(single_tag_title()); ?>');
88
<?php
89
}
90
if ( $this->gadwp->config->options['ga_category_dimindex'] && is_single() ) {
91
global $post;
92
$categories = get_the_category( $post->ID );
1
<?php
2
/**
3
+ * Author: Alin Marcu
4
* Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
* License: GPLv2 or later
7
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
*/
87
ga('set', 'dimension<?php echo (int)$this->gadwp->config->options ['ga_category_dimindex']; ?>', '<?php echo esc_attr(single_tag_title()); ?>');
88
<?php
89
}
90
+ if ( $this->gadwp->config->options['ga_tag_dimindex'] && is_single() ) {
91
+ global $post;
92
+ $post_tags_list = '';
93
+ $post_tags_array = get_the_tags( $post->ID );
94
+ if ( $post_tags_array ) {
95
+ foreach ( $post_tags_array as $tag ) {
96
+ $post_tags_list .= $tag->name . ', ';
97
+ }
98
+ }
99
+ $post_tags_list = rtrim( $post_tags_list, ', ' );
100
+ if ( $post_tags_list ) {
101
+ ?>
102
+ ga('set', 'dimension<?php echo (int)$this->gadwp->config->options ['ga_tag_dimindex']; ?>', '<?php echo esc_attr($post_tags_list); ?>');
103
+ <?php
104
+ }
105
+ }
106
if ( $this->gadwp->config->options['ga_category_dimindex'] && is_single() ) {
107
global $post;
108
$categories = get_the_category( $post->ID );
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.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', '4.9.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: 4.9.3.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.3.1' );
20
}
21
22
if ( ! class_exists( 'GADWP_Manager' ) ) {
install/install.php CHANGED
@@ -2,7 +2,7 @@
2
/**
3
* Author: Alin Marcu
4
* Author URI: https://deconf.com
5
- * Copyright 2013 Alin Marcu
6
* License: GPLv2 or later
7
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
*/
@@ -49,6 +49,7 @@ class GADWP_Install {
49
$options['ga_crossdomain_list'] = '';
50
$options['ga_author_dimindex'] = 0;
51
$options['ga_category_dimindex'] = 0;
52
$options['ga_user_dimindex'] = 0;
53
$options['ga_pubyear_dimindex'] = 0;
54
$options['ga_aff_tracking'] = 0;
@@ -98,6 +99,7 @@ class GADWP_Install {
98
$options['ga_crossdomain_list'] = '';
99
$options['ga_author_dimindex'] = 0;
100
$options['ga_category_dimindex'] = 0;
101
$options['ga_user_dimindex'] = 0;
102
$options['ga_pubyear_dimindex'] = 0;
103
$options['ga_event_affiliates'] = '/out/';
@@ -110,7 +112,7 @@ class GADWP_Install {
110
$options['ga_cookiedomain'] = '';
111
$options['ga_cookiename'] = '';
112
$options['ga_cookieexpires'] = '';
113
-
114
delete_option( 'ga_dash_clientid' );
115
delete_option( 'ga_dash_clientsecret' );
116
delete_option( 'ga_dash_access' );
2
/**
3
* Author: Alin Marcu
4
* Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
* License: GPLv2 or later
7
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
*/
49
$options['ga_crossdomain_list'] = '';
50
$options['ga_author_dimindex'] = 0;
51
$options['ga_category_dimindex'] = 0;
52
+ $options['ga_tag_dimindex'] = 0;
53
$options['ga_user_dimindex'] = 0;
54
$options['ga_pubyear_dimindex'] = 0;
55
$options['ga_aff_tracking'] = 0;
99
$options['ga_crossdomain_list'] = '';
100
$options['ga_author_dimindex'] = 0;
101
$options['ga_category_dimindex'] = 0;
102
+ $options['ga_tag_dimindex'] = 0;
103
$options['ga_user_dimindex'] = 0;
104
$options['ga_pubyear_dimindex'] = 0;
105
$options['ga_event_affiliates'] = '/out/';
112
$options['ga_cookiedomain'] = '';
113
$options['ga_cookiename'] = '';
114
$options['ga_cookieexpires'] = '';
115
+
116
delete_option( 'ga_dash_clientid' );
117
delete_option( 'ga_dash_clientsecret' );
118
delete_option( 'ga_dash_access' );
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: deconf
3
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.1
7
- Stable tag: 4.9.2
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -65,6 +65,7 @@ With Google Analytics Dashboard for WP you can use custom dimensions to track:
65
- Authors
66
- Publication year
67
- Categories
68
- User engagement
69
70
= Google Analytics Dashboard for WP on Multisite =
@@ -133,11 +134,21 @@ Google Analytics Dashboard for WP it's released under the GPLv2, you can use it
133
134
== Upgrade Notice ==
135
136
- = 4.9.2 =
137
- In case of errors refresh your page or clear your browser cache, as a first step. The Frontend Widget can be re-enabled from Appearance -> Widgets screen.
138
-
139
== Changelog ==
140
141
= 4.9.2 =
142
* Enhancements:
143
* improved loading speed for charts
3
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.5
7
+ Stable tag: 4.9.3.1
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
65
- Authors
66
- Publication year
67
- Categories
68
+ - Tags
69
- User engagement
70
71
= Google Analytics Dashboard for WP on Multisite =
134
135
== Upgrade Notice ==
136
137
== Changelog ==
138
139
+ = 4.9.3.1 =
140
+ * Bug Fixes:
141
+ * fixing a bug where &nbsp was displayed instead of a blank space on localized sites
142
+
143
+ = 4.9.3 =
144
+ * Enhancements:
145
+ * implement more specific error codes
146
+ * files cleanup
147
+ * move reports.js and other scripts to footer
148
+ * on-screen errors instead of using console
149
+ * New Features:
150
+ * custom dimensions support for Tags
151
+
152
= 4.9.2 =
153
* Enhancements:
154
* improved loading speed for charts
realtime/jquery/jquery.ui.tooltip.html.js CHANGED
@@ -1,3 +1,11 @@
1
jQuery(function () {
2
jQuery('#gadash-widget *').tooltip({
3
items: "[data-tooltip]",
1
+ /*-
2
+ * Author: Alin Marcu
3
+ * Author URI: https://deconf.com
4
+ * Copyright 2013 Alin Marcu
5
+ * License: GPLv2 or later
6
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
+ */
8
+
9
jQuery(function () {
10
jQuery('#gadash-widget *').tooltip({
11
items: "[data-tooltip]",
tools/gapi.php CHANGED
@@ -796,7 +796,7 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
796
*/
797
public function get( $projectId, $query, $from = false, $to = false, $filter = '' ) {
798
if ( empty( $projectId ) || ! is_numeric( $projectId ) ) {
799
- return - 25;
800
}
801
if ( in_array( $query, array( 'sessions', 'users', 'organicSearches', 'visitBounceRate', 'pageviews', 'uniquePageviews' ) ) ) {
802
return $this->get_areachart_data( $projectId, $from, $to, $query, $filter );
@@ -825,7 +825,7 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
825
if ( in_array( $query, array( 'medium', 'visitorType', 'socialNetwork', 'source', 'browser', 'operatingSystem', 'screenResolution', 'mobileDeviceBranding' ) ) ) {
826
return $this->get_piechart_data( $projectId, $from, $to, $query, $filter );
827
}
828
- return - 25;
829
}
830
}
831
}
796
*/
797
public function get( $projectId, $query, $from = false, $to = false, $filter = '' ) {
798
if ( empty( $projectId ) || ! is_numeric( $projectId ) ) {
799
+ wp_die( - 26 );
800
}
801
if ( in_array( $query, array( 'sessions', 'users', 'organicSearches', 'visitBounceRate', 'pageviews', 'uniquePageviews' ) ) ) {
802
return $this->get_areachart_data( $projectId, $from, $to, $query, $filter );
825
if ( in_array( $query, array( 'medium', 'visitorType', 'socialNetwork', 'source', 'browser', 'operatingSystem', 'screenResolution', 'mobileDeviceBranding' ) ) ) {
826
return $this->get_piechart_data( $projectId, $from, $to, $query, $filter );
827
}
828
+ wp_die( - 27 );
829
}
830
}
831
}