Version Description
- Enhancement: optimize the number of ajax requests
- Enhancement: new versioning standard for a better management of automatic updates (M.M.m.u)
- Enhancement: JavaScript code cleanup and optimization
- Enhancement: memory usage optimization
- Enhancement: small assets fixes, UX improvements, props by Adrian Pop
- Enhancement: introducing reports for all frontend web pages (new feature)
- Enhancement: gadwp_frontenditem_uri filter to allow URI corrections for frontend item reports
- Bug Fix: avoid double encoding of UTF-8 URIs
- Bug Fix: 100% number formatting issue on bounce rate report
Download this release
Release Info
Developer | deconf |
Plugin | ![]() |
Version | 4.8 |
Comparing to | |
See all releases |
Code changes from version 4.7.5 to 4.8
- admin/ajax-actions.php +135 -121
- admin/css/gadwp.css +52 -38
- admin/css/item-reports.css +1 -1
- admin/images/google-analytics-dashboard.png +0 -0
- admin/item-reports.php +48 -55
- admin/js/item-reports.js +614 -627
- admin/settings.php +622 -610
- admin/setup.php +186 -247
- admin/widgets.php +417 -485
- config.php +29 -11
- front/ajax-actions.php +136 -130
- front/css/item-reports.css +139 -36
- front/css/widgets.css +64 -0
- front/item-reports.php +21 -189
- front/js/item-reports.js +1 -1
- front/js/widgets.js +5 -0
- front/setup.php +109 -0
- front/tracking.php +48 -54
- front/tracking/code-classic.php +3 -3
- front/tracking/code-universal.php +43 -43
- front/tracking/events-classic.php +2 -2
- front/tracking/events-universal.php +3 -3
- front/widgets.php +131 -161
- gadwp.php +228 -243
- install/install.php +131 -131
- install/uninstall.php +32 -35
- readme.txt +57 -40
- tools/gapi.php +752 -992
- tools/iso3166.php +241 -242
- tools/nprogress/nprogress.css +6 -27
- tools/tools.php +96 -108
admin/ajax-actions.php
CHANGED
@@ -7,125 +7,139 @@
|
|
7 |
*/
|
8 |
|
9 |
// Exit if accessed directly
|
10 |
-
if
|
11 |
-
|
12 |
-
|
13 |
-
if
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
}
|
7 |
*/
|
8 |
|
9 |
// Exit if accessed directly
|
10 |
+
if ( ! defined( 'ABSPATH' ) )
|
11 |
+
exit();
|
12 |
+
|
13 |
+
if ( ! class_exists( 'GADWP_Backend_Ajax' ) ) {
|
14 |
+
|
15 |
+
final class GADWP_Backend_Ajax {
|
16 |
+
|
17 |
+
private $gadwp;
|
18 |
+
|
19 |
+
public function __construct() {
|
20 |
+
$this->gadwp = GADWP();
|
21 |
+
|
22 |
+
if ( GADWP_Tools::check_roles( $this->gadwp->config->options['ga_dash_access_back'] ) && ( 1 == $this->gadwp->config->options['dashboard_widget'] ) ) {
|
23 |
+
// Admin Widget action
|
24 |
+
add_action( 'wp_ajax_gadash_get_widgetreports', array( $this, 'ajax_widget_reports' ) );
|
25 |
+
}
|
26 |
+
|
27 |
+
if ( GADWP_Tools::check_roles( $this->gadwp->config->options['ga_dash_access_back'] ) && ( 1 == $this->gadwp->config->options['backend_item_reports'] ) ) {
|
28 |
+
// Items action
|
29 |
+
add_action( 'wp_ajax_gadwp_backend_item_reports', array( $this, 'ajax_item_reports' ) );
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Ajax handler for Item Reports
|
35 |
+
*
|
36 |
+
* @return json|int
|
37 |
+
*/
|
38 |
+
public function ajax_item_reports() {
|
39 |
+
if ( ! isset( $_REQUEST['gadwp_security_backend_item_reports'] ) || ! wp_verify_nonce( $_REQUEST['gadwp_security_backend_item_reports'], 'gadwp_backend_item_reports' ) ) {
|
40 |
+
wp_die( - 30 );
|
41 |
+
}
|
42 |
+
|
43 |
+
$from = $_REQUEST['from'];
|
44 |
+
$to = $_REQUEST['to'];
|
45 |
+
$query = $_REQUEST['query'];
|
46 |
+
$filter_id = $_REQUEST['filter'];
|
47 |
+
|
48 |
+
if ( ob_get_length() ) {
|
49 |
+
ob_clean();
|
50 |
+
}
|
51 |
+
|
52 |
+
if ( ! GADWP_Tools::check_roles( $this->gadwp->config->options['ga_dash_access_back'] ) || 0 == $this->gadwp->config->options['backend_item_reports'] ) {
|
53 |
+
wp_die( - 31 );
|
54 |
+
}
|
55 |
+
if ( $this->gadwp->config->options['ga_dash_token'] && $this->gadwp->config->options['ga_dash_tableid_jail'] && $from && $to ) {
|
56 |
+
if ( null === $this->gadwp->gapi_controller ) {
|
57 |
+
$this->gadwp->gapi_controller = new GADWP_GAPI_Controller();
|
58 |
+
}
|
59 |
+
} else {
|
60 |
+
wp_die( - 24 );
|
61 |
+
}
|
62 |
+
$projectId = $this->gadwp->config->options['ga_dash_tableid_jail'];
|
63 |
+
$profile_info = GADWP_Tools::get_selected_profile( $this->gadwp->config->options['ga_dash_profile_list'], $projectId );
|
64 |
+
if ( isset( $profile_info[4] ) ) {
|
65 |
+
$this->gadwp->gapi_controller->timeshift = $profile_info[4];
|
66 |
+
} else {
|
67 |
+
$this->gadwp->gapi_controller->timeshift = (int) current_time( 'timestamp' ) - time();
|
68 |
+
}
|
69 |
+
|
70 |
+
$uri_parts = explode( '/', get_permalink( $filter_id ), 4 );
|
71 |
+
|
72 |
+
if ( isset( $uri_parts[3] ) ) {
|
73 |
+
$uri = '/' . $uri_parts[3];
|
74 |
+
} else {
|
75 |
+
wp_die( - 25 );
|
76 |
+
}
|
77 |
+
|
78 |
+
// allow URL correction before sending an API request
|
79 |
+
$filter = apply_filters( 'gadwp_backenditem_uri', $uri );
|
80 |
+
|
81 |
+
// Encode URL
|
82 |
+
$filter = rawurlencode( rawurldecode( $filter ) );
|
83 |
+
|
84 |
+
$queries = explode( ',', $query );
|
85 |
+
|
86 |
+
$results = array();
|
87 |
+
|
88 |
+
foreach ( $queries as $value ) {
|
89 |
+
$results[] = $this->gadwp->gapi_controller->get( $projectId, $value, $from, $to, $filter );
|
90 |
+
}
|
91 |
+
|
92 |
+
wp_send_json( $results );
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Ajax handler for Admin Widget
|
97 |
+
*
|
98 |
+
* @return json|int
|
99 |
+
*/
|
100 |
+
public function ajax_widget_reports() {
|
101 |
+
if ( ! isset( $_REQUEST['gadash_security_widget_reports'] ) || ! wp_verify_nonce( $_REQUEST['gadash_security_widget_reports'], 'gadash_get_widgetreports' ) ) {
|
102 |
+
wp_die( - 30 );
|
103 |
+
}
|
104 |
+
|
105 |
+
$projectId = $_REQUEST['projectId'];
|
106 |
+
$from = $_REQUEST['from'];
|
107 |
+
$to = $_REQUEST['to'];
|
108 |
+
$query = $_REQUEST['query'];
|
109 |
+
|
110 |
+
if ( ob_get_length() ) {
|
111 |
+
ob_clean();
|
112 |
+
}
|
113 |
+
|
114 |
+
if ( ! GADWP_Tools::check_roles( $this->gadwp->config->options['ga_dash_access_back'] ) || 0 == $this->gadwp->config->options['dashboard_widget'] ) {
|
115 |
+
wp_die( - 31 );
|
116 |
+
}
|
117 |
+
|
118 |
+
if ( $this->gadwp->config->options['ga_dash_token'] && $projectId && $from && $to ) {
|
119 |
+
if ( null === $this->gadwp->gapi_controller ) {
|
120 |
+
$this->gadwp->gapi_controller = new GADWP_GAPI_Controller();
|
121 |
+
}
|
122 |
+
} else {
|
123 |
+
wp_die( - 24 );
|
124 |
+
}
|
125 |
+
|
126 |
+
$profile_info = GADWP_Tools::get_selected_profile( $this->gadwp->config->options['ga_dash_profile_list'], $projectId );
|
127 |
+
|
128 |
+
if ( isset( $profile_info[4] ) ) {
|
129 |
+
$this->gadwp->gapi_controller->timeshift = $profile_info[4];
|
130 |
+
} else {
|
131 |
+
$this->gadwp->gapi_controller->timeshift = (int) current_time( 'timestamp' ) - time();
|
132 |
+
}
|
133 |
+
|
134 |
+
$queries = explode( ',', $query );
|
135 |
+
|
136 |
+
$results = array();
|
137 |
+
|
138 |
+
foreach ( $queries as $value ) {
|
139 |
+
$results[] = $this->gadwp->gapi_controller->get( $projectId, $value, $from, $to );
|
140 |
+
}
|
141 |
+
|
142 |
+
wp_send_json( $results );
|
143 |
+
}
|
144 |
+
}
|
145 |
}
|
admin/css/gadwp.css
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
/* Tab navigation */
|
2 |
-
#gadwp-events, #gadwp-custom, #gadwp-advanced, #gadwp-exclude,
|
|
|
3 |
display: none;
|
4 |
}
|
5 |
|
@@ -22,8 +23,8 @@ td.title-select {
|
|
22 |
width: 300px;
|
23 |
}
|
24 |
|
25 |
-
.gadwp-help{
|
26 |
-
padding-left:15px;
|
27 |
}
|
28 |
|
29 |
td.debugging {
|
@@ -78,7 +79,7 @@ td.roles {
|
|
78 |
}
|
79 |
|
80 |
#poststuff h2 {
|
81 |
-
padding-bottom:0;
|
82 |
}
|
83 |
|
84 |
/* Options pages ON/OFF Switch */
|
@@ -86,6 +87,13 @@ td.roles {
|
|
86 |
position: relative;
|
87 |
width: 50px;
|
88 |
float: left;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
-webkit-user-select: none;
|
90 |
-moz-user-select: none;
|
91 |
-ms-user-select: none;
|
@@ -95,16 +103,11 @@ td.roles {
|
|
95 |
display: none !important;
|
96 |
}
|
97 |
|
98 |
-
.onoffswitch:hover {
|
99 |
-
border-color: #5b9dd9;
|
100 |
-
-webkit-box-shadow: 0 0 2px rgba(30,140,190,.8);
|
101 |
-
box-shadow: 0 0 2px rgba(30,140,190,.8);
|
102 |
-
}
|
103 |
-
|
104 |
.onoffswitch-label {
|
105 |
display: block;
|
106 |
overflow: hidden;
|
107 |
cursor: pointer;
|
|
|
108 |
border: 1px solid #ddd;
|
109 |
border-radius: 2px;
|
110 |
}
|
@@ -112,64 +115,74 @@ td.roles {
|
|
112 |
.onoffswitch-inner {
|
113 |
width: 200%;
|
114 |
margin-left: -100%;
|
115 |
-
-
|
116 |
-
-
|
117 |
-
-
|
118 |
-
transition: margin 0.
|
|
|
119 |
}
|
120 |
|
121 |
.onoffswitch-inner:before, .onoffswitch-inner:after {
|
122 |
float: left;
|
123 |
width: 50%;
|
124 |
-
height: 22px;
|
125 |
-
padding: 0;
|
126 |
-
line-height: 22px;
|
127 |
-
font-size: 12px;
|
128 |
-
color: white;
|
129 |
-
font-family: Trebuchet, Arial, sans-serif;
|
130 |
font-weight: normal;
|
131 |
-moz-box-sizing: border-box;
|
132 |
-webkit-box-sizing: border-box;
|
|
|
133 |
box-sizing: border-box;
|
|
|
|
|
|
|
134 |
}
|
135 |
|
136 |
.onoffswitch-inner:before {
|
137 |
content: "On";
|
138 |
padding-left: 5px;
|
139 |
-
|
140 |
-
color: #
|
|
|
141 |
}
|
142 |
|
143 |
.onoffswitch-inner:after {
|
144 |
content: "Off";
|
145 |
padding-right: 5px;
|
146 |
-
background-color: #
|
147 |
-
color: #999;
|
148 |
text-align: right;
|
149 |
}
|
150 |
|
151 |
.onoffswitch-switch {
|
152 |
width: 22px;
|
153 |
-
|
154 |
background: #fff;
|
|
|
155 |
border: 1px solid #ddd;
|
156 |
border-radius: 2px;
|
157 |
position: absolute;
|
158 |
top: 0;
|
159 |
bottom: 0;
|
160 |
-
right:
|
161 |
-
-moz-transition: all 0.
|
162 |
-
-webkit-transition: all 0.
|
163 |
-
-o-transition: all 0.
|
164 |
-
transition: all 0.
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
}
|
174 |
|
175 |
.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-inner {
|
@@ -183,6 +196,7 @@ td.roles {
|
|
183 |
.switch-desc {
|
184 |
float: left;
|
185 |
margin-left: 10px;
|
|
|
186 |
}
|
187 |
|
188 |
/* Admin Widget & Real-Time Stats*/
|
1 |
/* Tab navigation */
|
2 |
+
#gadwp-events, #gadwp-custom, #gadwp-advanced, #gadwp-exclude,
|
3 |
+
#gadwp-config {
|
4 |
display: none;
|
5 |
}
|
6 |
|
23 |
width: 300px;
|
24 |
}
|
25 |
|
26 |
+
.gadwp-help {
|
27 |
+
padding-left: 15px;
|
28 |
}
|
29 |
|
30 |
td.debugging {
|
79 |
}
|
80 |
|
81 |
#poststuff h2 {
|
82 |
+
padding-bottom: 0;
|
83 |
}
|
84 |
|
85 |
/* Options pages ON/OFF Switch */
|
87 |
position: relative;
|
88 |
width: 50px;
|
89 |
float: left;
|
90 |
+
border: none !important;
|
91 |
+
padding: 0 !important;
|
92 |
+
height: 22px !important;
|
93 |
+
-moz-box-shadow: none !important;
|
94 |
+
-webkit-box-shadow: none !important;
|
95 |
+
-o-box-shadow: none !important;
|
96 |
+
box-shadow: none !important;
|
97 |
-webkit-user-select: none;
|
98 |
-moz-user-select: none;
|
99 |
-ms-user-select: none;
|
103 |
display: none !important;
|
104 |
}
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
.onoffswitch-label {
|
107 |
display: block;
|
108 |
overflow: hidden;
|
109 |
cursor: pointer;
|
110 |
+
background: transparent;
|
111 |
border: 1px solid #ddd;
|
112 |
border-radius: 2px;
|
113 |
}
|
115 |
.onoffswitch-inner {
|
116 |
width: 200%;
|
117 |
margin-left: -100%;
|
118 |
+
border-radius: 2px;
|
119 |
+
-moz-transition: margin 0.2s ease-in 0s;
|
120 |
+
-webkit-transition: margin 0.2s ease-in 0s;
|
121 |
+
-o-transition: margin 0.2s ease-in 0s;
|
122 |
+
transition: margin 0.2s ease-in 0s;
|
123 |
}
|
124 |
|
125 |
.onoffswitch-inner:before, .onoffswitch-inner:after {
|
126 |
float: left;
|
127 |
width: 50%;
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
font-weight: normal;
|
129 |
-moz-box-sizing: border-box;
|
130 |
-webkit-box-sizing: border-box;
|
131 |
+
-o-box-sizing: border-box;
|
132 |
box-sizing: border-box;
|
133 |
+
height: 22px;
|
134 |
+
line-height: 22px;
|
135 |
+
font-size: 12px;
|
136 |
}
|
137 |
|
138 |
.onoffswitch-inner:before {
|
139 |
content: "On";
|
140 |
padding-left: 5px;
|
141 |
+
border-bottom: none;
|
142 |
+
/* background-color: #00a0d2;
|
143 |
+
color: #fff; /* inherit from button props */
|
144 |
}
|
145 |
|
146 |
.onoffswitch-inner:after {
|
147 |
content: "Off";
|
148 |
padding-right: 5px;
|
149 |
+
background-color: #ddd;
|
|
|
150 |
text-align: right;
|
151 |
}
|
152 |
|
153 |
.onoffswitch-switch {
|
154 |
width: 22px;
|
155 |
+
height: 22px;
|
156 |
background: #fff;
|
157 |
+
color: #ddd;
|
158 |
border: 1px solid #ddd;
|
159 |
border-radius: 2px;
|
160 |
position: absolute;
|
161 |
top: 0;
|
162 |
bottom: 0;
|
163 |
+
right: 27px;
|
164 |
+
-moz-transition: all 0.2s ease-in 0s;
|
165 |
+
-webkit-transition: all 0.2s ease-in 0s;
|
166 |
+
-o-transition: all 0.2s ease-in 0s;
|
167 |
+
transition: all 0.2s ease-in 0s;
|
168 |
+
}
|
169 |
+
|
170 |
+
.onoffswitch-switch:hover {
|
171 |
+
color: #aaa;
|
172 |
+
border-color: #aaa;
|
173 |
+
}
|
174 |
+
|
175 |
+
.onoffswitch-switch:after {
|
176 |
+
margin: 0;
|
177 |
+
outline: 0;
|
178 |
+
display: inline-block;
|
179 |
+
font: 400 16px/16px dashicons;
|
180 |
+
content: "\f228";
|
181 |
+
padding: 3px 0 0 3px;
|
182 |
+
text-align: left;
|
183 |
+
text-decoration: none;
|
184 |
+
-webkit-font-smoothing: antialiased;
|
185 |
+
-moz-osx-font-smoothing: grayscale;
|
186 |
}
|
187 |
|
188 |
.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-inner {
|
196 |
.switch-desc {
|
197 |
float: left;
|
198 |
margin-left: 10px;
|
199 |
+
line-height: 20px;
|
200 |
}
|
201 |
|
202 |
/* Admin Widget & Real-Time Stats*/
|
admin/css/item-reports.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*
|
2 |
.column-gadwp_stats {
|
3 |
width: 70px;
|
4 |
}
|
1 |
+
/* Backend Item Reports */
|
2 |
.column-gadwp_stats {
|
3 |
width: 70px;
|
4 |
}
|
admin/images/google-analytics-dashboard.png
CHANGED
Binary file
|
admin/item-reports.php
CHANGED
@@ -7,65 +7,58 @@
|
|
7 |
*/
|
8 |
|
9 |
// Exit if accessed directly
|
10 |
-
if
|
11 |
-
|
12 |
|
13 |
-
if
|
14 |
|
15 |
-
|
16 |
-
{
|
17 |
|
18 |
-
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
$this->gadwp = GADWP();
|
23 |
-
|
24 |
-
if (GADWP_Tools::check_roles($this->gadwp->config->options['ga_dash_access_back']) && 1 == $this->gadwp->config->options['item_reports']) {
|
25 |
-
|
26 |
-
// Add custom column in Posts List
|
27 |
-
add_filter('manage_posts_columns', array(
|
28 |
-
$this,
|
29 |
-
'add_columns'
|
30 |
-
));
|
31 |
-
// Populate custom column in Posts List
|
32 |
-
add_action('manage_posts_custom_column', array(
|
33 |
-
$this,
|
34 |
-
'add_icons'
|
35 |
-
), 10, 2);
|
36 |
-
// Add custom column in Pages List
|
37 |
-
add_filter('manage_pages_columns', array(
|
38 |
-
$this,
|
39 |
-
'add_columns'
|
40 |
-
));
|
41 |
-
// Populate custom column in Pages List
|
42 |
-
add_action('manage_pages_custom_column', array(
|
43 |
-
$this,
|
44 |
-
'add_icons'
|
45 |
-
), 10, 2);
|
46 |
-
}
|
47 |
-
}
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
return;
|
55 |
-
}
|
56 |
-
|
57 |
-
if (version_compare($wp_version, '3.8.0', '>=')) {
|
58 |
-
echo '<a id="gadwp-' . $id . '" title="' . get_the_title($id) . '" href="#' . $id . '" class="gadwp-icon dashicons-before dashicons-chart-area"></a>';
|
59 |
-
} else {
|
60 |
-
echo '<a id="gadwp-' . $id . '" title="' . get_the_title($id) . '" href="#' . $id . '"><img class="gadwp-icon-oldwp" src="' . GADWP_URL . 'admin/images/gadash-icon.png"</a>';
|
61 |
-
}
|
62 |
-
}
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
7 |
*/
|
8 |
|
9 |
// Exit if accessed directly
|
10 |
+
if ( ! defined( 'ABSPATH' ) )
|
11 |
+
exit();
|
12 |
|
13 |
+
if ( ! class_exists( 'GADWP_Backend_Item_Reports' ) ) {
|
14 |
|
15 |
+
final class GADWP_Backend_Item_Reports {
|
|
|
16 |
|
17 |
+
private $gadwp;
|
18 |
|
19 |
+
public function __construct() {
|
20 |
+
$this->gadwp = GADWP();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
+
if ( GADWP_Tools::check_roles( $this->gadwp->config->options['ga_dash_access_back'] ) && 1 == $this->gadwp->config->options['backend_item_reports'] ) {
|
23 |
+
// Add custom column in Posts List
|
24 |
+
add_filter( 'manage_posts_columns', array(
|
25 |
+
$this,
|
26 |
+
'add_columns' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
+
// Populate custom column in Posts List
|
29 |
+
add_action( 'manage_posts_custom_column', array(
|
30 |
+
$this,
|
31 |
+
'add_icons' ), 10, 2 );
|
32 |
+
|
33 |
+
// Add custom column in Pages List
|
34 |
+
add_filter( 'manage_pages_columns', array(
|
35 |
+
$this,
|
36 |
+
'add_columns' ) );
|
37 |
+
|
38 |
+
// Populate custom column in Pages List
|
39 |
+
add_action( 'manage_pages_custom_column', array(
|
40 |
+
$this,
|
41 |
+
'add_icons' ), 10, 2 );
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
public function add_icons( $column, $id ) {
|
46 |
+
global $wp_version;
|
47 |
+
|
48 |
+
if ( $column != 'gadwp_stats' ) {
|
49 |
+
return;
|
50 |
+
}
|
51 |
+
|
52 |
+
if ( version_compare( $wp_version, '3.8.0', '>=' ) ) {
|
53 |
+
echo '<a id="gadwp-' . $id . '" title="' . get_the_title( $id ) . '" href="#' . $id . '" class="gadwp-icon dashicons-before dashicons-chart-area"></a>';
|
54 |
+
} else {
|
55 |
+
echo '<a id="gadwp-' . $id . '" title="' . get_the_title( $id ) . '" href="#' . $id . '"><img class="gadwp-icon-oldwp" src="' . GADWP_URL . 'admin/images/gadash-icon.png"</a>';
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
public function add_columns( $columns ) {
|
60 |
+
return array_merge( $columns, array(
|
61 |
+
'gadwp_stats' => __( 'Analytics', 'ga-dash' ) ) );
|
62 |
+
}
|
63 |
+
}
|
64 |
}
|
admin/js/item-reports.js
CHANGED
@@ -1,629 +1,616 @@
|
|
1 |
"use strict";
|
2 |
|
3 |
-
google.load
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
jQuery(document).ready(
|
8 |
-
|
9 |
-
function() {
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
jQuery.fn.extend
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
fluid : true,
|
618 |
-
dialogClass : 'gadwp wp-dialog',
|
619 |
-
resizable : false,
|
620 |
-
title : jQuery('#gadwp'+slug).attr( "title" ),
|
621 |
-
position : {
|
622 |
-
my : "top",
|
623 |
-
at : "top+100",
|
624 |
-
of : window
|
625 |
-
}
|
626 |
-
});
|
627 |
-
|
628 |
-
}
|
629 |
-
});
|
1 |
"use strict";
|
2 |
|
3 |
+
google.load( "visualization", "1", {
|
4 |
+
packages : [ "corechart", "table", "orgchart", "geochart" ]
|
5 |
+
} );
|
6 |
+
|
7 |
+
jQuery( document ).ready(
|
8 |
+
|
9 |
+
function () {
|
10 |
+
jQuery( 'a[id^="gadwp-"]' ).click( function ( e ) {
|
11 |
+
|
12 |
+
var item_id = getID( this );
|
13 |
+
var slug = "-" + item_id;
|
14 |
+
|
15 |
+
if ( !jQuery( "#gadwp-window" + slug ).length > 0 ) {
|
16 |
+
jQuery( "body" ).append( '<div id="gadwp-window' + slug + '"></div>' );
|
17 |
+
}
|
18 |
+
jQuery( '#gadwp-window' + slug ).gadwpItemReport( slug, item_id );
|
19 |
+
} );
|
20 |
+
|
21 |
+
function getID ( item ) {
|
22 |
+
if ( typeof item.id == "undefined" ) {
|
23 |
+
return 0
|
24 |
+
}
|
25 |
+
if ( item.id.split( '-' )[ 1 ] == "undefined" ) {
|
26 |
+
return 0;
|
27 |
+
} else {
|
28 |
+
return item.id.split( '-' )[ 1 ];
|
29 |
+
}
|
30 |
+
}
|
31 |
+
|
32 |
+
// on window resize
|
33 |
+
jQuery( window ).resize( function () {
|
34 |
+
fluidDialog();
|
35 |
+
} );
|
36 |
+
|
37 |
+
// dialog width larger than viewport
|
38 |
+
jQuery( document ).on( "dialogopen", ".ui-dialog", function ( event, ui ) {
|
39 |
+
fluidDialog();
|
40 |
+
} );
|
41 |
+
|
42 |
+
function fluidDialog () {
|
43 |
+
var visible = jQuery( ".ui-dialog:visible" );
|
44 |
+
// on each visible dialog
|
45 |
+
visible.each( function () {
|
46 |
+
var $this = jQuery( this );
|
47 |
+
var dialog = $this.find( ".ui-dialog-content" ).data( "ui-dialog" );
|
48 |
+
// on each fluid dialog
|
49 |
+
if ( dialog.options.fluid ) {
|
50 |
+
var wWidth = jQuery( window ).width();
|
51 |
+
// window width vs dialog width
|
52 |
+
if ( wWidth < ( parseInt( dialog.options.maxWidth ) + 50 ) ) {
|
53 |
+
// don't fill the entire screen
|
54 |
+
$this.css( "max-width", "90%" );
|
55 |
+
} else {
|
56 |
+
// maxWidth bug fix
|
57 |
+
$this.css( "max-width", dialog.options.maxWidth + "px" );
|
58 |
+
}
|
59 |
+
// change dialog position
|
60 |
+
dialog.option( "position", dialog.options.position );
|
61 |
+
}
|
62 |
+
} );
|
63 |
+
|
64 |
+
}
|
65 |
+
} );
|
66 |
+
|
67 |
+
jQuery.fn.extend( {
|
68 |
+
gadwpItemReport : function ( slug, item_id ) {
|
69 |
+
|
70 |
+
var template = {
|
71 |
+
|
72 |
+
data : '<div id="gadwp-container' + slug + '"><select id="gadwp-sel-period' + slug + '"></select> <select id="gadwp-sel-report' + slug + '"></select><div id="gadwp-progressbar' + slug + '"></div><div id="gadwp-status' + slug + '"></div><div id="gadwp-reports' + slug + '"></div><div style="text-align:right;width:100%;font-size:0.8em;clear:both;margin-right:5px;margin-top:10px;">' + gadwp_item_data.i18n[ 14 ] + ' <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> </div></div>',
|
73 |
+
|
74 |
+
addOptions : function ( id, list ) {
|
75 |
+
|
76 |
+
var output = [];
|
77 |
+
jQuery.each( list, function ( key, value ) {
|
78 |
+
if ( key == '30daysAgo' || key == 'sessions' ) {
|
79 |
+
output.push( '<option value="' + key + '" selected="selected">' + value + '</option>' );
|
80 |
+
} else {
|
81 |
+
output.push( '<option value="' + key + '">' + value + '</option>' );
|
82 |
+
}
|
83 |
+
} );
|
84 |
+
jQuery( id ).html( output.join( '' ) );
|
85 |
+
},
|
86 |
+
|
87 |
+
init : function () {
|
88 |
+
if ( jQuery( '#gadwp-window' + slug ).html().length ) { // add main template once
|
89 |
+
return;
|
90 |
+
}
|
91 |
+
|
92 |
+
jQuery( '#gadwp-window' + slug ).append( this.data );
|
93 |
+
|
94 |
+
this.addOptions( '#gadwp-sel-period' + slug, gadwp_item_data.dateList );
|
95 |
+
this.addOptions( '#gadwp-sel-report' + slug, gadwp_item_data.reportList );
|
96 |
+
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
var reports = {
|
101 |
+
|
102 |
+
npcounter : 0,
|
103 |
+
prs : '',
|
104 |
+
trafficchannels : '',
|
105 |
+
trafficmediums : '',
|
106 |
+
traffictype : '',
|
107 |
+
trafficorganic : '',
|
108 |
+
socialnetworks : '',
|
109 |
+
locations : '',
|
110 |
+
mainchart : '',
|
111 |
+
bottomstats : '',
|
112 |
+
|
113 |
+
alertMessage : function ( msg ) {
|
114 |
+
jQuery( "#gadwp-status" + slug ).css( {
|
115 |
+
"margin-top" : "3px",
|
116 |
+
"padding-left" : "5px",
|
117 |
+
"height" : "auto",
|
118 |
+
"color" : "#000",
|
119 |
+
"border-left" : "5px solid red"
|
120 |
+
} );
|
121 |
+
jQuery( "#gadwp-status" + slug ).html( msg );
|
122 |
+
},
|
123 |
+
|
124 |
+
drawprs : function ( gadwp_prs ) {
|
125 |
+
var data = google.visualization.arrayToDataTable( gadwp_prs );
|
126 |
+
var options = {
|
127 |
+
page : 'enable',
|
128 |
+
pageSize : 10,
|
129 |
+
width : '100%',
|
130 |
+
allowHtml : true
|
131 |
+
};
|
132 |
+
|
133 |
+
var chart = new google.visualization.Table( document.getElementById( 'gadwp-prs' + slug ) );
|
134 |
+
chart.draw( data, options );
|
135 |
+
},
|
136 |
+
|
137 |
+
drawtrafficchannels : function ( gadwp_trafficchannels ) {
|
138 |
+
var data = google.visualization.arrayToDataTable( gadwp_trafficchannels );
|
139 |
+
var options = {
|
140 |
+
allowCollapse : true,
|
141 |
+
allowHtml : true,
|
142 |
+
height: '100%'
|
143 |
+
};
|
144 |
+
|
145 |
+
var chart = new google.visualization.OrgChart( document.getElementById( 'gadwp-trafficchannels' + slug ) );
|
146 |
+
chart.draw( data, options );
|
147 |
+
},
|
148 |
+
|
149 |
+
drawtrafficmediums : function ( gadwp_trafficmediums ) {
|
150 |
+
var data = google.visualization.arrayToDataTable( gadwp_trafficmediums );
|
151 |
+
var options = {
|
152 |
+
is3D : false,
|
153 |
+
tooltipText : 'percentage',
|
154 |
+
legend : 'none',
|
155 |
+
chartArea : {
|
156 |
+
width : '99%',
|
157 |
+
height : '80%'
|
158 |
+
},
|
159 |
+
title : gadwp_item_data.i18n[ 1 ],
|
160 |
+
colors : gadwp_item_data.colorVariations
|
161 |
+
};
|
162 |
+
|
163 |
+
var chart = new google.visualization.PieChart( document.getElementById( 'gadwp-trafficmediums' + slug ) );
|
164 |
+
chart.draw( data, options );
|
165 |
+
},
|
166 |
+
|
167 |
+
drawtraffictype : function ( gadwp_traffictype ) {
|
168 |
+
var data = google.visualization.arrayToDataTable( gadwp_traffictype );
|
169 |
+
var options = {
|
170 |
+
is3D : false,
|
171 |
+
tooltipText : 'percentage',
|
172 |
+
legend : 'none',
|
173 |
+
chartArea : {
|
174 |
+
width : '99%',
|
175 |
+
height : '80%'
|
176 |
+
},
|
177 |
+
title : gadwp_item_data.i18n[ 2 ],
|
178 |
+
colors : gadwp_item_data.colorVariations
|
179 |
+
};
|
180 |
+
|
181 |
+
var chart = new google.visualization.PieChart( document.getElementById( 'gadwp-traffictype' + slug ) );
|
182 |
+
chart.draw( data, options );
|
183 |
+
},
|
184 |
+
|
185 |
+
drawsocialnetworks : function ( gadwp_socialnetworks ) {
|
186 |
+
var data = google.visualization.arrayToDataTable( gadwp_socialnetworks );
|
187 |
+
var options = {
|
188 |
+
is3D : false,
|
189 |
+
tooltipText : 'percentage',
|
190 |
+
legend : 'none',
|
191 |
+
chartArea : {
|
192 |
+
width : '99%',
|
193 |
+
height : '80%'
|
194 |
+
},
|
195 |
+
title : gadwp_item_data.i18n[ 3 ],
|
196 |
+
colors : gadwp_item_data.colorVariations
|
197 |
+
};
|
198 |
+
|
199 |
+
var chart = new google.visualization.PieChart( document.getElementById( 'gadwp-socialnetworks' + slug ) );
|
200 |
+
chart.draw( data, options );
|
201 |
+
},
|
202 |
+
|
203 |
+
drawtrafficorganic : function ( gadwp_trafficorganic ) {
|
204 |
+
var data = google.visualization.arrayToDataTable( gadwp_trafficorganic );
|
205 |
+
var options = {
|
206 |
+
is3D : false,
|
207 |
+
tooltipText : 'percentage',
|
208 |
+
legend : 'none',
|
209 |
+
chartArea : {
|
210 |
+
width : '99%',
|
211 |
+
height : '80%'
|
212 |
+
},
|
213 |
+
title : gadwp_item_data.i18n[ 4 ],
|
214 |
+
colors : gadwp_item_data.colorVariations
|
215 |
+
};
|
216 |
+
|
217 |
+
var chart = new google.visualization.PieChart( document.getElementById( 'gadwp-trafficorganic' + slug ) );
|
218 |
+
chart.draw( data, options );
|
219 |
+
},
|
220 |
+
|
221 |
+
drawlocations : function ( gadwp_locations ) {
|
222 |
+
var data = google.visualization.arrayToDataTable( gadwp_locations );
|
223 |
+
var options = {
|
224 |
+
page : 'enable',
|
225 |
+
pageSize : 10,
|
226 |
+
width : '100%'
|
227 |
+
};
|
228 |
+
|
229 |
+
var chart = new google.visualization.Table( document.getElementById( 'gadwp-locations' + slug ) );
|
230 |
+
chart.draw( data, options );
|
231 |
+
},
|
232 |
+
|
233 |
+
drawmaplocations : function ( gadwp_locations ) {
|
234 |
+
|
235 |
+
var data = google.visualization.arrayToDataTable( gadwp_locations );
|
236 |
+
|
237 |
+
var options = {
|
238 |
+
chartArea : {
|
239 |
+
width : '99%',
|
240 |
+
height : '90%'
|
241 |
+
},
|
242 |
+
colors : [ gadwp_item_data.colorVariations[ 5 ], gadwp_item_data.colorVariations[ 4 ] ],
|
243 |
+
}
|
244 |
+
|
245 |
+
if ( gadwp_item_data.region ) {
|
246 |
+
options.region = gadwp_item_data.region;
|
247 |
+
options.displayMode = 'markers';
|
248 |
+
options.datalessRegionColor = 'EFEFEF';
|
249 |
+
}
|
250 |
+
|
251 |
+
var chart = new google.visualization.GeoChart( document.getElementById( 'gadwp-map' + slug ) );
|
252 |
+
chart.draw( data, options );
|
253 |
+
},
|
254 |
+
|
255 |
+
drawmainchart : function ( gadwp_mainchart ) {
|
256 |
+
|
257 |
+
var data = google.visualization.arrayToDataTable( gadwp_mainchart );
|
258 |
+
|
259 |
+
var options = {
|
260 |
+
legend : {
|
261 |
+
position : 'none'
|
262 |
+
},
|
263 |
+
pointSize : 3,
|
264 |
+
colors : [ gadwp_item_data.colorVariations[ 0 ], gadwp_item_data.colorVariations[ 4 ] ],
|
265 |
+
chartArea : {
|
266 |
+
width : '99%',
|
267 |
+
height : '90%'
|
268 |
+
},
|
269 |
+
vAxis : {
|
270 |
+
textPosition : "in",
|
271 |
+
minValue : 0
|
272 |
+
},
|
273 |
+
hAxis : {
|
274 |
+
textPosition : 'none'
|
275 |
+
}
|
276 |
+
};
|
277 |
+
var chart = new google.visualization.AreaChart( document.getElementById( 'gadwp-mainchart' + slug ) );
|
278 |
+
chart.draw( data, options );
|
279 |
+
},
|
280 |
+
|
281 |
+
drawbottomstats : function ( gadwp_bottomstats ) {
|
282 |
+
jQuery( "#gdsessions" + slug ).text( gadwp_bottomstats[ 0 ] );
|
283 |
+
jQuery( "#gdusers" + slug ).text( gadwp_bottomstats[ 1 ] );
|
284 |
+
jQuery( "#gdpageviews" + slug ).text( gadwp_bottomstats[ 2 ] );
|
285 |
+
jQuery( "#gdbouncerate" + slug ).text( parseFloat( gadwp_bottomstats[ 3 ] ).toFixed( 2 ) + "%" );
|
286 |
+
jQuery( "#gdorganicsearch" + slug ).text( gadwp_bottomstats[ 4 ] );
|
287 |
+
jQuery( "#gdpagespervisit" + slug ).text( parseFloat( gadwp_bottomstats[ 5 ] ).toFixed( 2 ) );
|
288 |
+
},
|
289 |
+
|
290 |
+
throwDebug : function ( response ) {
|
291 |
+
jQuery( "#gadwp-status" + slug ).css( {
|
292 |
+
"margin-top" : "3px",
|
293 |
+
"padding-left" : "5px",
|
294 |
+
"height" : "auto",
|
295 |
+
"color" : "#000",
|
296 |
+
"border-left" : "5px solid red"
|
297 |
+
} );
|
298 |
+
jQuery( "#gadwp-status" + slug ).html( gadwp_item_data.i18n[ 11 ] );
|
299 |
+
console.log( "\n********************* GADWP Log ********************* \n\n" + response );
|
300 |
+
},
|
301 |
+
|
302 |
+
throwError : function ( target, response, p ) {
|
303 |
+
jQuery( target ).css( {
|
304 |
+
"background-color" : "#F7F7F7",
|
305 |
+
"height" : "auto",
|
306 |
+
"padding-top" : p,
|
307 |
+
"padding-bottom" : p,
|
308 |
+
"color" : "#000",
|
309 |
+
"text-align" : "center"
|
310 |
+
} );
|
311 |
+
if ( response == -21 ) {
|
312 |
+
jQuery( target ).html( gadwp_item_data.i18n[ 12 ] + ' (' + response + ')' );
|
313 |
+
} else {
|
314 |
+
jQuery( target ).html( gadwp_item_data.i18n[ 13 ] + ' (' + response + ')' );
|
315 |
+
}
|
316 |
+
},
|
317 |
+
|
318 |
+
render : function ( period, query ) {
|
319 |
+
var from, to;
|
320 |
+
jQuery( '#gadwp-status' + slug ).html( '' );
|
321 |
+
switch ( period ) {
|
322 |
+
case 'today':
|
323 |
+
from = 'today';
|
324 |
+
to = 'today';
|
325 |
+
break;
|
326 |
+
case 'yesterday':
|
327 |
+
from = 'yesterday';
|
328 |
+
to = 'yesterday';
|
329 |
+
break;
|
330 |
+
case '7daysAgo':
|
331 |
+
from = '7daysAgo';
|
332 |
+
to = 'yesterday';
|
333 |
+
break;
|
334 |
+
case '14daysAgo':
|
335 |
+
from = '14daysAgo';
|
336 |
+
to = 'yesterday';
|
337 |
+
break;
|
338 |
+
case '90daysAgo':
|
339 |
+
from = '90daysAgo';
|
340 |
+
to = 'yesterday';
|
341 |
+
break;
|
342 |
+
default:
|
343 |
+
from = '30daysAgo';
|
344 |
+
to = 'yesterday';
|
345 |
+
break;
|
346 |
+
}
|
347 |
+
|
348 |
+
var data = {
|
349 |
+
action : 'gadwp_backend_item_reports',
|
350 |
+
gadwp_security_backend_item_reports : gadwp_item_data.security,
|
351 |
+
from : from,
|
352 |
+
to : to,
|
353 |
+
filter : item_id
|
354 |
+
}
|
355 |
+
|
356 |
+
if ( jQuery.inArray( query, [ 'referrers', 'contentpages', 'searches' ] ) > -1 ) {
|
357 |
+
|
358 |
+
jQuery( '#gadwp-reports' + slug ).html( '<div id="gadwp-trafficchannels' + slug + '"></div>' )
|
359 |
+
jQuery( '#gadwp-reports' + slug ).append( '<div id="gadwp-prs' + slug + '"></div>' );
|
360 |
+
|
361 |
+
data.query = 'trafficchannels,' + query;
|
362 |
+
|
363 |
+
jQuery.post( gadwp_item_data.ajaxurl, data, function ( response ) {
|
364 |
+
if ( jQuery.isArray( response ) ) {
|
365 |
+
if ( !jQuery.isNumeric( response[ 0 ] ) ) {
|
366 |
+
if ( jQuery.isArray( response[ 0 ] ) ) {
|
367 |
+
reports.trafficchannels = response[ 0 ];
|
368 |
+
google.setOnLoadCallback( reports.drawtrafficchannels( reports.trafficchannels ) );
|
369 |
+
} else {
|
370 |
+
reports.throwDebug( response[ 0 ] );
|
371 |
+
}
|
372 |
+
} else {
|
373 |
+
reports.throwError( '#gadwp-trafficchannels' + slug, response[ 0 ], "125px" );
|
374 |
+
}
|
375 |
+
|
376 |
+
if ( !jQuery.isNumeric( response[ 1 ] ) ) {
|
377 |
+
if ( jQuery.isArray( response[ 1 ] ) ) {
|
378 |
+
reports.prs = response[ 1 ];
|
379 |
+
google.setOnLoadCallback( reports.drawprs( reports.prs ) );
|
380 |
+
} else {
|
381 |
+
reports.throwDebug( response[ 1 ] );
|
382 |
+
}
|
383 |
+
} else {
|
384 |
+
reports.throwError( '#gadwp-prs' + slug, response[ 1 ], "125px" );
|
385 |
+
}
|
386 |
+
} else {
|
387 |
+
reports.throwDebug( response );
|
388 |
+
}
|
389 |
+
NProgress.done();
|
390 |
+
} );
|
391 |
+
|
392 |
+
} else if ( query == 'trafficdetails' ) {
|
393 |
+
|
394 |
+
jQuery( '#gadwp-reports' + slug ).html( '<div id="gadwp-trafficchannels' + slug + '"></div>' )
|
395 |
+
jQuery( '#gadwp-reports' + slug ).append( '<div class="gadwp-floatwraper"><div id="gadwp-trafficmediums' + slug + '"></div><div id="gadwp-traffictype' + slug + '"></div></div>' );
|
396 |
+
jQuery( '#gadwp-reports' + slug ).append( '<div class="gadwp-floatwraper"><div id="gadwp-trafficorganic' + slug + '"></div><div id="gadwp-socialnetworks' + slug + '"></div></div>' );
|
397 |
+
|
398 |
+
data.query = 'trafficchannels,medium,visitorType,source,socialNetwork';
|
399 |
+
|
400 |
+
jQuery.post( gadwp_item_data.ajaxurl, data, function ( response ) {
|
401 |
+
if ( jQuery.isArray( response ) ) {
|
402 |
+
if ( !jQuery.isNumeric( response[ 0 ] ) ) {
|
403 |
+
if ( jQuery.isArray( response[ 0 ] ) ) {
|
404 |
+
reports.trafficchannels = response[ 0 ];
|
405 |
+
google.setOnLoadCallback( reports.drawtrafficchannels( reports.trafficchannels ) );
|
406 |
+
} else {
|
407 |
+
reports.throwDebug( response[ 0 ] );
|
408 |
+
}
|
409 |
+
} else {
|
410 |
+
reports.throwError( '#gadwp-trafficchannels' + slug, response[ 0 ], "125px" );
|
411 |
+
}
|
412 |
+
|
413 |
+
if ( !jQuery.isNumeric( response[ 1 ] ) ) {
|
414 |
+
if ( jQuery.isArray( response[ 1 ] ) ) {
|
415 |
+
reports.trafficmediums = response[ 1 ];
|
416 |
+
google.setOnLoadCallback( reports.drawtrafficmediums( reports.trafficmediums ) );
|
417 |
+
} else {
|
418 |
+
reports.throwDebug( response[ 1 ] );
|
419 |
+
}
|
420 |
+
} else {
|
421 |
+
reports.throwError( '#gadwp-trafficmediums' + slug, response[ 1 ], "80px" );
|
422 |
+
}
|
423 |
+
|
424 |
+
if ( !jQuery.isNumeric( response[ 2 ] ) ) {
|
425 |
+
if ( jQuery.isArray( response[ 2 ] ) ) {
|
426 |
+
reports.traffictype = response[ 2 ];
|
427 |
+
google.setOnLoadCallback( reports.drawtraffictype( reports.traffictype ) );
|
428 |
+
} else {
|
429 |
+
reports.throwDebug( response[ 2 ] );
|
430 |
+
}
|
431 |
+
} else {
|
432 |
+
reports.throwError( '#gadwp-traffictype' + slug, response[ 2 ], "80px" );
|
433 |
+
}
|
434 |
+
|
435 |
+
if ( !jQuery.isNumeric( response[ 3 ] ) ) {
|
436 |
+
if ( jQuery.isArray( response[ 3 ] ) ) {
|
437 |
+
reports.trafficorganic = response[ 3 ];
|
438 |
+
google.setOnLoadCallback( reports.drawtrafficorganic( reports.trafficorganic ) );
|
439 |
+
} else {
|
440 |
+
reports.throwDebug( response[ 3 ] );
|
441 |
+
}
|
442 |
+
} else {
|
443 |
+
reports.throwError( '#gadwp-trafficorganic' + slug, response[ 3 ], "80px" );
|
444 |
+
}
|
445 |
+
|
446 |
+
if ( !jQuery.isNumeric( response[ 4 ] ) ) {
|
447 |
+
if ( jQuery.isArray( response[ 4 ] ) ) {
|
448 |
+
reports.socialnetworks = response[ 4 ];
|
449 |
+
google.setOnLoadCallback( reports.drawsocialnetworks( reports.socialnetworks ) );
|
450 |
+
} else {
|
451 |
+
reports.throwDebug( response[ 4 ] );
|
452 |
+
}
|
453 |
+
} else {
|
454 |
+
reports.throwError( '#gadwp-socialnetworks' + slug, response[ 4 ], "80px" );
|
455 |
+
}
|
456 |
+
} else {
|
457 |
+
reports.throwDebug( response );
|
458 |
+
}
|
459 |
+
NProgress.done();
|
460 |
+
} );
|
461 |
+
|
462 |
+
} else if ( query == 'locations' ) {
|
463 |
+
|
464 |
+
jQuery( '#gadwp-reports' + slug ).html( '<div id="gadwp-map' + slug + '"></div>' )
|
465 |
+
jQuery( '#gadwp-reports' + slug ).append( '<div id="gadwp-locations' + slug + '"></div>' );
|
466 |
+
|
467 |
+
data.query = query;
|
468 |
+
|
469 |
+
jQuery.post( gadwp_item_data.ajaxurl, data, function ( response ) {
|
470 |
+
if ( jQuery.isArray( response ) ) {
|
471 |
+
if ( !jQuery.isNumeric( response[ 0 ] ) ) {
|
472 |
+
if ( jQuery.isArray( response[ 0 ] ) ) {
|
473 |
+
reports.locations = response[ 0 ];
|
474 |
+
google.setOnLoadCallback( reports.drawmaplocations( reports.locations ) );
|
475 |
+
google.setOnLoadCallback( reports.drawlocations( reports.locations ) );
|
476 |
+
} else {
|
477 |
+
reports.throwDebug( response[ 0 ] );
|
478 |
+
}
|
479 |
+
} else {
|
480 |
+
reports.throwError( '#gadwp-map' + slug, response[ 0 ], "125px" );
|
481 |
+
reports.throwError( '#gadwp-locations' + slug, response[ 0 ], "125px" );
|
482 |
+
}
|
483 |
+
} else {
|
484 |
+
reports.throwDebug( response );
|
485 |
+
}
|
486 |
+
NProgress.done();
|
487 |
+
} );
|
488 |
+
|
489 |
+
} else {
|
490 |
+
|
491 |
+
jQuery( '#gadwp-reports' + slug ).html( '<div id="gadwp-mainchart' + slug + '"></div>' )
|
492 |
+
jQuery( '#gadwp-reports' + slug ).append( '<div id="gadwp-bottomstats' + slug + '" class="gadwp-wrapper"><div class="inside"><div class="small-box"><h3>' + gadwp_item_data.i18n[ 5 ] + '</h3><p id="gdsessions' + slug + '"> </p></div><div class="small-box"><h3>' + gadwp_item_data.i18n[ 6 ] + '</h3><p id="gdusers' + slug + '"> </p></div><div class="small-box"><h3>' + gadwp_item_data.i18n[ 7 ] + '</h3><p id="gdpageviews' + slug + '"> </p></div><div class="small-box"><h3>' + gadwp_item_data.i18n[ 8 ] + '</h3><p id="gdbouncerate' + slug + '"> </p></div><div class="small-box"><h3>' + gadwp_item_data.i18n[ 9 ] + '</h3><p id="gdorganicsearch' + slug + '"> </p></div><div class="small-box"><h3>' + gadwp_item_data.i18n[ 10 ] + '</h3><p id="gdpagespervisit' + slug + '"> </p></div></div></div>' );
|
493 |
+
|
494 |
+
data.query = query + ',bottomstats';
|
495 |
+
|
496 |
+
jQuery.post( gadwp_item_data.ajaxurl, data, function ( response ) {
|
497 |
+
if ( jQuery.isArray( response ) ) {
|
498 |
+
if ( !jQuery.isNumeric( response[ 0 ] ) ) {
|
499 |
+
if ( jQuery.isArray( response[ 0 ] ) ) {
|
500 |
+
reports.mainchart = response[ 0 ];
|
501 |
+
google.setOnLoadCallback( reports.drawmainchart( reports.mainchart ) );
|
502 |
+
} else {
|
503 |
+
reports.throwDebug( response[ 0 ] );
|
504 |
+
}
|
505 |
+
} else {
|
506 |
+
reports.throwError( '#gadwp-mainchart' + slug, response[ 0 ], "125px" );
|
507 |
+
}
|
508 |
+
if ( !jQuery.isNumeric( response[ 1 ] ) ) {
|
509 |
+
if ( jQuery.isArray( response[ 1 ] ) ) {
|
510 |
+
reports.bottomstats = response[ 1 ];
|
511 |
+
google.setOnLoadCallback( reports.drawbottomstats( reports.bottomstats ) );
|
512 |
+
} else {
|
513 |
+
reports.throwDebug( response[ 1 ] );
|
514 |
+
}
|
515 |
+
} else {
|
516 |
+
reports.throwError( '#gadwp-bottomstats' + slug, response[ 1 ], "40px" );
|
517 |
+
}
|
518 |
+
} else {
|
519 |
+
reports.throwDebug( response );
|
520 |
+
}
|
521 |
+
NProgress.done();
|
522 |
+
} );
|
523 |
+
|
524 |
+
}
|
525 |
+
|
526 |
+
},
|
527 |
+
|
528 |
+
refresh : function () {
|
529 |
+
if ( jQuery( '#gadwp-bottomstats' + slug ).length > 0 ) {
|
530 |
+
this.drawbottomstats( this.bottomstats );
|
531 |
+
}
|
532 |
+
if ( jQuery( '#gadwp-mainchart' + slug ).length > 0 && jQuery.isArray( this.mainchart ) ) {
|
533 |
+
this.drawmainchart( this.mainchart );
|
534 |
+
}
|
535 |
+
if ( jQuery( '#gadwp-map' + slug ).length > 0 && jQuery.isArray( this.locations ) ) {
|
536 |
+
this.drawmaplocations( this.locations );
|
537 |
+
}
|
538 |
+
if ( jQuery( '#gadwp-locations' + slug ).length > 0 && jQuery.isArray( this.locations ) ) {
|
539 |
+
this.drawlocations( this.locations );
|
540 |
+
}
|
541 |
+
if ( jQuery( '#gadwp-socialnetworks' + slug ).length > 0 && jQuery.isArray( this.socialnetworks ) ) {
|
542 |
+
this.drawsocialnetworks( this.socialnetworks );
|
543 |
+
}
|
544 |
+
if ( jQuery( '#gadwp-trafficorganic' + slug ).length > 0 && jQuery.isArray( this.trafficorganic ) ) {
|
545 |
+
this.drawtrafficorganic( this.trafficorganic );
|
546 |
+
}
|
547 |
+
if ( jQuery( '#gadwp-traffictype' + slug ).length > 0 && jQuery.isArray( this.traffictype ) ) {
|
548 |
+
this.drawtraffictype( this.traffictype );
|
549 |
+
}
|
550 |
+
if ( jQuery( '#gadwp-trafficmediums' + slug ).length > 0 && jQuery.isArray( this.trafficmediums ) ) {
|
551 |
+
this.drawtrafficmediums( this.trafficmediums );
|
552 |
+
}
|
553 |
+
if ( jQuery( '#gadwp-trafficchannels' + slug ).length > 0 && jQuery.isArray( this.trafficchannels ) ) {
|
554 |
+
this.drawtrafficchannels( this.trafficchannels );
|
555 |
+
}
|
556 |
+
if ( jQuery( '#gadwp-prs' + slug ).length > 0 && jQuery.isArray( this.prs ) ) {
|
557 |
+
this.drawprs( this.prs );
|
558 |
+
}
|
559 |
+
},
|
560 |
+
|
561 |
+
init : function () {
|
562 |
+
|
563 |
+
if ( jQuery( "#gadwp-reports" + slug ).html().length ) { // only when report is empty
|
564 |
+
return;
|
565 |
+
}
|
566 |
+
|
567 |
+
try {
|
568 |
+
NProgress.configure( {
|
569 |
+
parent : "#gadwp-progressbar" + slug,
|
570 |
+
showSpinner : false
|
571 |
+
} );
|
572 |
+
NProgress.start();
|
573 |
+
} catch ( e ) {
|
574 |
+
this.alertMessage( gadwp_item_data.i18n[ 0 ] );
|
575 |
+
}
|
576 |
+
|
577 |
+
this.render( jQuery( '#gadwp-sel-period' + slug ).val(), jQuery( '#gadwp-sel-report' + slug ).val() );
|
578 |
+
|
579 |
+
jQuery( window ).resize( function () {
|
580 |
+
reports.refresh();
|
581 |
+
} );
|
582 |
+
}
|
583 |
+
}
|
584 |
+
|
585 |
+
template.init();
|
586 |
+
|
587 |
+
reports.init();
|
588 |
+
|
589 |
+
jQuery( '#gadwp-sel-period' + slug ).change( function () {
|
590 |
+
jQuery( '#gadwp-reports' + slug ).html( '' );
|
591 |
+
reports.init();
|
592 |
+
} );
|
593 |
+
|
594 |
+
jQuery( '#gadwp-sel-report' + slug ).change( function () {
|
595 |
+
jQuery( '#gadwp-reports' + slug ).html( '' );
|
596 |
+
reports.init();
|
597 |
+
} );
|
598 |
+
|
599 |
+
return this.dialog( {
|
600 |
+
width : 'auto',
|
601 |
+
maxWidth : 510,
|
602 |
+
height : 'auto',
|
603 |
+
modal : true,
|
604 |
+
fluid : true,
|
605 |
+
dialogClass : 'gadwp wp-dialog',
|
606 |
+
resizable : false,
|
607 |
+
title : jQuery( '#gadwp' + slug ).attr( "title" ),
|
608 |
+
position : {
|
609 |
+
my : "top",
|
610 |
+
at : "top+100",
|
611 |
+
of : window
|
612 |
+
}
|
613 |
+
} );
|
614 |
+
|
615 |
+
}
|
616 |
+
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/settings.php
CHANGED
@@ -8,98 +8,93 @@
|
|
8 |
*/
|
9 |
|
10 |
// Exit if accessed directly
|
11 |
-
if
|
12 |
-
|
13 |
|
14 |
-
final class GADWP_Settings
|
15 |
-
{
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
return $options;
|
74 |
-
}
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
}
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
?>
|
103 |
<form name="ga_dash_form" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
|
104 |
<div class="wrap">
|
105 |
<?php echo "<h2>" . __( "Google Analytics Frontend Settings", 'ga-dash' ) . "</h2>"; ?><hr>
|
@@ -118,54 +113,45 @@ final class GADWP_Settings
|
|
118 |
<td class="roles title"><label for="ga_dash_access_front"><?php _e("Show stats to:", 'ga-dash' ); ?></label></td>
|
119 |
<td class="roles">
|
120 |
<?php
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
<table>
|
127 |
<tr>
|
128 |
<?php
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
<td><label> <input type="checkbox" name="options[ga_dash_access_front][]" value="<?php echo $role; ?>" <?php if (in_array($role,$options['ga_dash_access_front']) || $role=='administrator') echo 'checked="checked"'; if ($role=='administrator') echo 'disabled="disabled"';?> /><?php echo $name; ?>
|
134 |
</label></td>
|
135 |
<?php
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
</tr>
|
140 |
<tr>
|
141 |
<?php
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
|
|
|
|
146 |
</table>
|
147 |
</td>
|
148 |
</tr>
|
149 |
<tr>
|
150 |
<td colspan="2" class="title">
|
151 |
-
<div class="onoffswitch">
|
152 |
-
<input type="checkbox" name="options[
|
153 |
<div class="onoffswitch-inner"></div>
|
154 |
<div class="onoffswitch-switch"></div>
|
155 |
</label>
|
156 |
</div>
|
157 |
-
<div class="switch-desc"><?php echo " ".__("
|
158 |
-
</td>
|
159 |
-
</tr>
|
160 |
-
<tr>
|
161 |
-
<td colspan="2" class="title">
|
162 |
-
<div class="onoffswitch">
|
163 |
-
<input type="checkbox" name="options[ga_dash_frontend_keywords]" value="1" class="onoffswitch-checkbox" id="ga_dash_frontend_keywords" <?php checked( $options['ga_dash_frontend_keywords'], 1 ); ?>> <label class="onoffswitch-label" for="ga_dash_frontend_keywords">
|
164 |
-
<div class="onoffswitch-inner"></div>
|
165 |
-
<div class="onoffswitch-switch"></div>
|
166 |
-
</label>
|
167 |
-
</div>
|
168 |
-
<div class="switch-desc"><?php echo " ".__("show page searches (after each article)", 'ga-dash' );?></div>
|
169 |
</td>
|
170 |
</tr>
|
171 |
<tr>
|
@@ -181,28 +167,29 @@ final class GADWP_Settings
|
|
181 |
|
182 |
|
183 |
|
|
|
|
|
184 |
</form>
|
185 |
<?php
|
186 |
-
|
187 |
-
|
188 |
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
?>
|
206 |
<form name="ga_dash_form" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
|
207 |
<div class="wrap">
|
208 |
<?php echo "<h2>" . __( "Google Analytics Backend Settings", 'ga-dash' ) . "</h2>"; ?><hr>
|
@@ -221,39 +208,41 @@ final class GADWP_Settings
|
|
221 |
<td class="roles title"><label for="ga_dash_access_back"><?php _e("Show stats to:", 'ga-dash' ); ?></label></td>
|
222 |
<td class="roles">
|
223 |
<?php
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
<table>
|
230 |
<tr>
|
231 |
<?php
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
<td><label> <input type="checkbox" name="options[ga_dash_access_back][]" value="<?php echo $role; ?>" <?php if (in_array($role,$options['ga_dash_access_back']) || $role=='administrator') echo 'checked="checked"'; if ($role=='administrator') echo 'disabled="disabled"';?> />
|
238 |
<?php echo $name; ?>
|
239 |
</label></td>
|
240 |
<?php
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
</tr>
|
245 |
<tr>
|
246 |
<?php
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
|
|
|
|
251 |
</table>
|
252 |
</td>
|
253 |
</tr>
|
254 |
<tr>
|
255 |
<td colspan="2" class="title">
|
256 |
-
<div class="onoffswitch">
|
257 |
<input type="checkbox" name="options[switch_profile]" value="1" class="onoffswitch-checkbox" id="switch_profile" <?php checked( $options['switch_profile'], 1 ); ?>> <label class="onoffswitch-label" for="switch_profile">
|
258 |
<div class="onoffswitch-inner"></div>
|
259 |
<div class="onoffswitch-switch"></div>
|
@@ -264,8 +253,8 @@ final class GADWP_Settings
|
|
264 |
</tr>
|
265 |
<tr>
|
266 |
<td colspan="2" class="title">
|
267 |
-
<div class="onoffswitch">
|
268 |
-
<input type="checkbox" name="options[
|
269 |
<div class="onoffswitch-inner"></div>
|
270 |
<div class="onoffswitch-switch"></div>
|
271 |
</label>
|
@@ -275,7 +264,7 @@ final class GADWP_Settings
|
|
275 |
</tr>
|
276 |
<tr>
|
277 |
<td colspan="2" class="title">
|
278 |
-
<div class="onoffswitch">
|
279 |
<input type="checkbox" name="options[dashboard_widget]" value="1" class="onoffswitch-checkbox" id="dashboard_widget" <?php checked( $options['dashboard_widget'], 1 ); ?>> <label class="onoffswitch-label" for="dashboard_widget">
|
280 |
<div class="onoffswitch-inner"></div>
|
281 |
<div class="onoffswitch-switch"></div>
|
@@ -290,7 +279,7 @@ final class GADWP_Settings
|
|
290 |
<tr>
|
291 |
<td colspan="2" class="title"> <?php _e("Maximum number of pages to display on real-time tab:", 'ga-dash'); ?>
|
292 |
<input type="number" name="options[ga_realtime_pages]" id="ga_realtime_pages" value="<?php echo (int)$options['ga_realtime_pages']; ?>" size="3">
|
293 |
-
|
294 |
</tr>
|
295 |
<tr>
|
296 |
<td colspan="2"><hr><?php echo "<h2>" . __( "Location Settings", 'ga-dash' ) . "</h2>"; ?></td>
|
@@ -299,7 +288,7 @@ final class GADWP_Settings
|
|
299 |
<td colspan="2" class="title">
|
300 |
<?php echo __("Target Geo Map to country:", 'ga-dash'); ?>
|
301 |
<input type="text" style="text-align: center;" name="options[ga_target_geomap]" value="<?php echo esc_attr($options['ga_target_geomap']); ?>" size="3">
|
302 |
-
|
303 |
</tr>
|
304 |
<tr>
|
305 |
<td colspan="2"><hr></td>
|
@@ -311,32 +300,33 @@ final class GADWP_Settings
|
|
311 |
<input type="hidden" name="options[ga_dash_hidden]" value="Y">
|
312 |
<?php wp_nonce_field('gadash_form','gadash_security'); ?>
|
313 |
|
|
|
|
|
314 |
</form>
|
315 |
<?php
|
316 |
-
|
317 |
-
|
318 |
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
?>
|
340 |
<form name="ga_dash_form" method="post" action="<?php esc_url($_SERVER['REQUEST_URI']); ?>">
|
341 |
<div class="wrap">
|
342 |
<?php echo "<h2>" . __( "Google Analytics Tracking Code", 'ga-dash' ) . "</h2>"; ?>
|
@@ -347,16 +337,16 @@ final class GADWP_Settings
|
|
347 |
<div class="settings-wrapper">
|
348 |
<div class="inside">
|
349 |
<?php
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
<div id="gadwp-basic">
|
361 |
<table class="options">
|
362 |
<tr>
|
@@ -390,7 +380,7 @@ final class GADWP_Settings
|
|
390 |
</tr>
|
391 |
<tr>
|
392 |
<td colspan="2" class="title">
|
393 |
-
<div class="onoffswitch">
|
394 |
<input type="checkbox" name="options[ga_dash_anonim]" value="1" class="onoffswitch-checkbox" id="ga_dash_anonim" <?php checked( $options['ga_dash_anonim'], 1 ); ?>> <label class="onoffswitch-label" for="ga_dash_anonim">
|
395 |
<div class="onoffswitch-inner"></div>
|
396 |
<div class="onoffswitch-switch"></div>
|
@@ -401,7 +391,7 @@ final class GADWP_Settings
|
|
401 |
</tr>
|
402 |
<tr>
|
403 |
<td colspan="2" class="title">
|
404 |
-
<div class="onoffswitch">
|
405 |
<input type="checkbox" name="options[ga_dash_remarketing]" value="1" class="onoffswitch-checkbox" id="ga_dash_remarketing" <?php checked( $options['ga_dash_remarketing'], 1 ); ?>> <label class="onoffswitch-label" for="ga_dash_remarketing">
|
406 |
<div class="onoffswitch-inner"></div>
|
407 |
<div class="onoffswitch-switch"></div>
|
@@ -419,7 +409,7 @@ final class GADWP_Settings
|
|
419 |
</tr>
|
420 |
<tr>
|
421 |
<td colspan="2" class="title">
|
422 |
-
<div class="onoffswitch">
|
423 |
<input type="checkbox" name="options[ga_event_tracking]" value="1" class="onoffswitch-checkbox" id="ga_event_tracking" <?php checked( $options['ga_event_tracking'], 1 ); ?>> <label class="onoffswitch-label" for="ga_event_tracking">
|
424 |
<div class="onoffswitch-inner"></div>
|
425 |
<div class="onoffswitch-switch"></div>
|
@@ -434,7 +424,7 @@ final class GADWP_Settings
|
|
434 |
</tr>
|
435 |
<tr>
|
436 |
<td colspan="2" class="title">
|
437 |
-
<div class="onoffswitch">
|
438 |
<input type="checkbox" name="options[ga_aff_tracking]" value="1" class="onoffswitch-checkbox" id="ga_aff_tracking" <?php checked( $options['ga_aff_tracking'], 1 ); ?>> <label class="onoffswitch-label" for="ga_aff_tracking">
|
439 |
<div class="onoffswitch-inner"></div>
|
440 |
<div class="onoffswitch-switch"></div>
|
@@ -449,7 +439,7 @@ final class GADWP_Settings
|
|
449 |
</tr>
|
450 |
<tr>
|
451 |
<td colspan="2" class="title">
|
452 |
-
<div class="onoffswitch">
|
453 |
<input type="checkbox" name="options[ga_hash_tracking]" value="1" class="onoffswitch-checkbox" id="ga_hash_tracking" <?php checked( $options['ga_hash_tracking'], 1 ); ?>> <label class="onoffswitch-label" for="ga_hash_tracking">
|
454 |
<div class="onoffswitch-inner"></div>
|
455 |
<div class="onoffswitch-switch"></div>
|
@@ -510,7 +500,7 @@ final class GADWP_Settings
|
|
510 |
</tr>
|
511 |
<tr>
|
512 |
<td colspan="2" class="title">
|
513 |
-
<div class="onoffswitch">
|
514 |
<input type="checkbox" name="options[ga_event_bouncerate]" value="1" class="onoffswitch-checkbox" id="ga_event_bouncerate" <?php checked( $options['ga_event_bouncerate'], 1 ); ?>> <label class="onoffswitch-label" for="ga_event_bouncerate">
|
515 |
<div class="onoffswitch-inner"></div>
|
516 |
<div class="onoffswitch-switch"></div>
|
@@ -521,7 +511,7 @@ final class GADWP_Settings
|
|
521 |
</tr>
|
522 |
<tr>
|
523 |
<td colspan="2" class="title">
|
524 |
-
<div class="onoffswitch">
|
525 |
<input type="checkbox" name="options[ga_enhanced_links]" value="1" class="onoffswitch-checkbox" id="ga_enhanced_links" <?php checked( $options['ga_enhanced_links'], 1 ); ?>> <label class="onoffswitch-label" for="ga_enhanced_links">
|
526 |
<div class="onoffswitch-inner"></div>
|
527 |
<div class="onoffswitch-switch"></div>
|
@@ -532,7 +522,7 @@ final class GADWP_Settings
|
|
532 |
</tr>
|
533 |
<tr>
|
534 |
<td colspan="2" class="title">
|
535 |
-
<div class="onoffswitch">
|
536 |
<input type="checkbox" name="options[ga_dash_adsense]" value="1" class="onoffswitch-checkbox" id="ga_dash_adsense" <?php checked( $options['ga_dash_adsense'], 1 ); ?>> <label class="onoffswitch-label" for="ga_dash_adsense">
|
537 |
<div class="onoffswitch-inner"></div>
|
538 |
<div class="onoffswitch-switch"></div>
|
@@ -543,7 +533,7 @@ final class GADWP_Settings
|
|
543 |
</tr>
|
544 |
<tr>
|
545 |
<td colspan="2" class="title">
|
546 |
-
<div class="onoffswitch">
|
547 |
<input type="checkbox" name="options[ga_crossdomain_tracking]" value="1" class="onoffswitch-checkbox" id="ga_crossdomain_tracking" <?php checked( $options['ga_crossdomain_tracking'], 1 ); ?>> <label class="onoffswitch-label" for="ga_crossdomain_tracking">
|
548 |
<div class="onoffswitch-inner"></div>
|
549 |
<div class="onoffswitch-switch"></div>
|
@@ -567,28 +557,34 @@ final class GADWP_Settings
|
|
567 |
<td class="roles title"><label for="ga_track_exclude"><?php _e("Exclude tracking for:", 'ga-dash' ); ?></label></td>
|
568 |
<td class="roles">
|
569 |
<?php
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
<tr>
|
576 |
<?php
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
<td><label> <input type="checkbox" name="options[ga_track_exclude][]" value="<?php echo $role; ?>" <?php if (in_array($role,$options['ga_track_exclude'])) echo 'checked="checked"'; ?> />
|
581 |
<?php echo $name; ?>
|
582 |
</label></td>
|
583 |
<?php
|
584 |
-
|
585 |
-
|
586 |
</tr>
|
587 |
<tr>
|
588 |
<?php
|
589 |
-
|
590 |
-
|
591 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
592 |
</table>
|
593 |
</td>
|
594 |
</tr>
|
@@ -605,45 +601,46 @@ final class GADWP_Settings
|
|
605 |
<input type="hidden" name="options[ga_dash_hidden]" value="Y">
|
606 |
<?php wp_nonce_field('gadash_form','gadash_security'); ?>
|
607 |
|
|
|
|
|
608 |
</form>
|
609 |
<?php
|
610 |
-
|
611 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
612 |
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
}
|
638 |
-
if ($anonim['ga_dash_apikey']) {
|
639 |
-
$anonim['ga_dash_apikey'] = 'HIDDEN';
|
640 |
-
}
|
641 |
-
|
642 |
-
$options = self::update_options('frontend');
|
643 |
-
if (! $gadwp->config->options['ga_dash_tableid_jail'] || ! $gadwp->config->options['ga_dash_token']) {
|
644 |
-
$message = sprintf('<div class="error"><p>%s</p></div>', sprintf(__('Something went wrong, check %1$s or %2$s.', 'ga-dash'), sprintf('<a href="%1$s">%2$s</a>', menu_page_url('gadash_errors_debugging', false), __('Errors & Debug', 'ga-dash')), sprintf('<a href="%1$s">%2$s</a>', menu_page_url('gadash_settings', false), __('authorize the plugin', 'ga-dash'))));
|
645 |
-
}
|
646 |
-
?>
|
647 |
<div class="wrap">
|
648 |
<?php echo "<h2>" . __( "Google Analytics Errors & Debugging", 'ga-dash' ) . "</h2>"; ?>
|
649 |
</div>
|
@@ -654,12 +651,11 @@ final class GADWP_Settings
|
|
654 |
<div class="inside">
|
655 |
<?php if (isset($message)) echo $message; ?>
|
656 |
<?php
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
?>
|
663 |
<div id="gadwp-errors">
|
664 |
<table class="options">
|
665 |
<tr>
|
@@ -670,10 +666,10 @@ final class GADWP_Settings
|
|
670 |
<tr>
|
671 |
<td>
|
672 |
<?php
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
</td>
|
678 |
</tr>
|
679 |
<tr>
|
@@ -682,16 +678,16 @@ final class GADWP_Settings
|
|
682 |
<tr>
|
683 |
<td>
|
684 |
<?php
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
<hr>
|
690 |
</td>
|
691 |
-
|
692 |
-
|
693 |
<tr>
|
694 |
-
|
695 |
</table>
|
696 |
</div>
|
697 |
<div id="gadwp-config">
|
@@ -701,120 +697,118 @@ final class GADWP_Settings
|
|
701 |
</tr>
|
702 |
<tr>
|
703 |
<td><pre class="log_data"><?php echo esc_html(print_r($anonim, true));?></pre><br />
|
704 |
-
|
705 |
</tr>
|
706 |
</table>
|
707 |
</div>
|
708 |
<?php
|
709 |
-
|
710 |
-
|
711 |
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
}
|
817 |
-
?>
|
818 |
<div class="wrap">
|
819 |
<?php echo "<h2>" . __( "Google Analytics Settings", 'ga-dash' ) . "</h2>"; ?>
|
820 |
<hr>
|
@@ -823,18 +817,19 @@ final class GADWP_Settings
|
|
823 |
<div id="post-body" class="metabox-holder columns-2">
|
824 |
<div id="post-body-content">
|
825 |
<div class="settings-wrapper">
|
826 |
-
<div class="inside">
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
|
|
838 |
<form name="ga_dash_form" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
|
839 |
<input type="hidden" name="options[ga_dash_hidden]" value="Y">
|
840 |
<?php wp_nonce_field('gadash_form','gadash_security'); ?>
|
@@ -853,7 +848,8 @@ final class GADWP_Settings
|
|
853 |
<tr>
|
854 |
<td colspan="2" class="info"><input name="options[ga_dash_userapi]" type="checkbox" id="ga_dash_userapi" value="1" <?php checked( $options['ga_dash_userapi'], 1 ); ?> onchange="this.form.submit()" <?php echo ($options['ga_dash_network'])?'disabled="disabled"':''; ?> /><?php echo " ".__("use your own API Project credentials", 'ga-dash' );?>
|
855 |
</td>
|
856 |
-
</tr>
|
857 |
<?php } if ($options['ga_dash_userapi']) { ?>
|
|
|
|
|
858 |
<tr>
|
859 |
<td class="title"><label for="options[ga_dash_apikey]"><?php _e("API Key:", 'ga-dash'); ?></label></td>
|
860 |
<td><input type="text" name="options[ga_dash_apikey]" value="<?php echo esc_attr($options['ga_dash_apikey']); ?>" size="40" required="required"></td>
|
@@ -869,9 +865,9 @@ final class GADWP_Settings
|
|
869 |
</td>
|
870 |
</tr>
|
871 |
<?php
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
<tr>
|
876 |
<td colspan="2"><input type="submit" name="Reset" class="button button-secondary" value="<?php _e( "Clear Authorization", 'ga-dash' ); ?>" <?php echo $options['ga_dash_network']?'disabled="disabled"':''; ?> /> <input type="submit" name="Clear" class="button button-secondary" value="<?php _e( "Clear Cache", 'ga-dash' ); ?>" /> <input type="submit" name="Reset_Err" class="button button-secondary" value="<?php _e( "Reset Errors", 'ga-dash' ); ?>" /></td>
|
877 |
</tr>
|
@@ -885,37 +881,39 @@ final class GADWP_Settings
|
|
885 |
<td class="title"><label for="ga_dash_tableid_jail"><?php _e("Select View:", 'ga-dash' ); ?></label></td>
|
886 |
<td><select id="ga_dash_tableid_jail" <?php disabled(empty($options['ga_dash_profile_list']) || 1 == count($options['ga_dash_profile_list']), true); ?> name="options[ga_dash_tableid_jail]">
|
887 |
<?php
|
888 |
-
if (!empty($options['ga_dash_profile_list'])) {
|
889 |
-
foreach ($options['ga_dash_profile_list'] as $items) {
|
890 |
-
if ($items[3]) {
|
891 |
-
echo '<option value="' . esc_attr($items[1]) . '" ' . selected($items[1], $options['ga_dash_tableid_jail']);
|
892 |
-
echo ' title="' . __("View Name:", 'ga-dash') . ' ' . esc_attr($items[0]) . '">' . esc_html(GADWP_Tools::strip_protocol($items[3])) . ' ⇒ ' . esc_attr($items[0]) . '</option>';
|
893 |
-
}
|
894 |
-
}
|
895 |
-
} else {
|
896 |
-
echo '<option value="">' . __("Property not found", 'ga-dash') . '</option>';
|
897 |
-
}
|
898 |
-
?>
|
899 |
-
</select>
|
900 |
<?php
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
905 |
</td>
|
906 |
</tr>
|
907 |
<?php
|
908 |
-
|
909 |
-
|
910 |
<tr>
|
911 |
<td class="title"></td>
|
912 |
<td><?php
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
</tr>
|
917 |
<?php
|
918 |
-
|
919 |
-
|
|
|
920 |
<td class="title"><label for="ga_dash_style"><?php _e("Theme Color:", 'ga-dash' ); ?></label></td>
|
921 |
<td><input type="text" id="ga_dash_style" class="ga_dash_style" name="options[ga_dash_style]" value="<?php echo esc_attr($options['ga_dash_style']); ?>" size="10"></td>
|
922 |
</tr>
|
@@ -928,7 +926,7 @@ final class GADWP_Settings
|
|
928 |
</tr>
|
929 |
<tr>
|
930 |
<td colspan="2" class="title">
|
931 |
-
<div class="onoffswitch">
|
932 |
<input type="checkbox" name="options[automatic_updates_minorversion]" value="1" class="onoffswitch-checkbox" id="automatic_updates_minorversion" <?php checked( $options['automatic_updates_minorversion'], 1 ); ?>> <label class="onoffswitch-label" for="automatic_updates_minorversion">
|
933 |
<div class="onoffswitch-inner"></div>
|
934 |
<div class="onoffswitch-switch"></div>
|
@@ -937,13 +935,14 @@ final class GADWP_Settings
|
|
937 |
<div class="switch-desc"><?php echo " ".__( "automatic updates for minor versions (security and maintenance releases only)", 'ga-dash' );?></div>
|
938 |
</td>
|
939 |
</tr>
|
940 |
-
|
941 |
<td colspan="2"><hr></td>
|
942 |
-
</tr>
|
943 |
<?php }?>
|
944 |
<tr>
|
945 |
<td colspan="2" class="submit"><input type="submit" name="Submit" class="button button-primary" value="<?php _e('Save Changes', 'ga-dash' ) ?>" /></td>
|
946 |
-
</tr>
|
|
|
947 |
<tr>
|
948 |
<td colspan="2"><hr></td>
|
949 |
</tr>
|
@@ -956,134 +955,133 @@ final class GADWP_Settings
|
|
956 |
</table>
|
957 |
</form>
|
958 |
<?php
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|