Google Analytics Dashboard for WP (GADWP) - Version 6.0.0

Version Description

Download this release

Release Info

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

Code changes from version 5.3.9 to 6.0.0

Files changed (158) hide show
  1. admin/ajax-actions.php +0 -143
  2. admin/class-am-notification.php +0 -472
  3. admin/css/admin-widgets.css +0 -1
  4. admin/css/gadwp.css +0 -221
  5. admin/css/item-reports.css +0 -1
  6. admin/images/clicky.png +0 -0
  7. admin/images/gadwp-icon.png +0 -0
  8. admin/images/google-analytics-dashboard.png +0 -0
  9. admin/images/help.png +0 -0
  10. admin/images/mcdn.png +0 -0
  11. admin/images/optinmonster.png +0 -0
  12. admin/images/ssl.png +0 -0
  13. admin/images/star.png +0 -0
  14. admin/images/wp.png +0 -0
  15. admin/images/wpforms.png +0 -0
  16. admin/item-reports.php +0 -56
  17. admin/js/settings.js +0 -1
  18. admin/js/ui.js +0 -1
  19. admin/js/wp-color-picker-script.js +0 -1
  20. admin/settings.php +0 -2005
  21. admin/setup.php +0 -368
  22. admin/tracking.php +0 -283
  23. admin/views/access-code.php +0 -36
  24. admin/widgets.php +0 -65
  25. assets/css/admin-common.css +48 -0
  26. assets/css/admin-common.min.css +1 -0
  27. assets/css/images/index.php +4 -0
  28. assets/css/images/logo.png +0 -0
  29. assets/css/images/logo@2x.png +0 -0
  30. assets/css/images/mascot.png +0 -0
  31. assets/css/images/mascot@2x.png +0 -0
  32. assets/css/index.php +4 -0
  33. assets/fonts/README.md +17 -0
  34. assets/fonts/glyphicons-halflings-regular.eot +0 -0
  35. assets/fonts/glyphicons-halflings-regular.svg +288 -0
  36. assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  37. assets/fonts/glyphicons-halflings-regular.woff +0 -0
  38. assets/fonts/glyphicons-halflings-regular.woff2 +0 -0
  39. assets/fonts/icons.eot +0 -0
  40. assets/fonts/icons.otf +0 -0
  41. assets/fonts/icons.ttf +0 -0
  42. assets/fonts/icons.woff +0 -0
  43. assets/fonts/icons.woff2 +0 -0
  44. assets/fonts/index.php +4 -0
  45. assets/fonts/monsterinsights.eot +0 -0
  46. assets/fonts/monsterinsights.svg +1 -0
  47. assets/fonts/monsterinsights.ttf +0 -0
  48. assets/fonts/monsterinsights.woff +0 -0
  49. assets/images/down-green.png +0 -0
  50. assets/images/down-green@2x.png +0 -0
  51. assets/images/down.png +0 -0
  52. assets/images/down@2x.png +0 -0
  53. assets/images/em-mascot.png +0 -0
  54. assets/images/index.php +4 -0
  55. assets/images/plugin-om.png +0 -0
  56. assets/images/plugin-smtp.png +0 -0
  57. assets/images/plugin-wpforms.png +0 -0
  58. assets/images/question-mark.png +0 -0
  59. assets/images/rafflepress.png +0 -0
  60. assets/images/seedprod.png +0 -0
  61. assets/images/trustpulse.png +0 -0
  62. assets/images/up-red.png +0 -0
  63. assets/images/up-red@2x.png +0 -0
  64. assets/images/up.png +0 -0
  65. assets/images/up@2x.png +0 -0
  66. assets/images/upsell/chart.png +0 -0
  67. assets/images/upsell/chart.svg +54 -0
  68. assets/images/upsell/woo-edd-upsell.png +0 -0
  69. assets/images/upsell/woo-edd-upsell.svg +38 -0
  70. assets/index.php +4 -0
  71. assets/js/admin-common.js +25 -0
  72. assets/js/admin-common.min.js +1 -0
  73. assets/js/frontend.js +643 -0
  74. assets/js/frontend.min.js +46 -0
  75. assets/js/index.php +4 -0
  76. assets/lib/index.php +4 -0
  77. assets/lib/pandora/class-am-deactivation-survey.php +358 -0
  78. common/ajax-actions.php +0 -42
  79. common/js/reports5.js +0 -1
  80. common/nprogress/nprogress.css +0 -1
  81. common/nprogress/nprogress.js +0 -1
  82. common/realtime/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  83. common/realtime/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  84. common/realtime/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  85. common/realtime/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  86. common/realtime/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  87. common/realtime/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  88. common/realtime/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  89. common/realtime/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  90. common/realtime/images/ui-icons_222222_256x240.png +0 -0
  91. common/realtime/images/ui-icons_2e83ff_256x240.png +0 -0
  92. common/realtime/images/ui-icons_454545_256x240.png +0 -0
  93. common/realtime/images/ui-icons_888888_256x240.png +0 -0
  94. common/realtime/images/ui-icons_cd0a0a_256x240.png +0 -0
  95. common/realtime/jquery.ui.tooltip.html.css +0 -3
  96. common/realtime/jquery.ui.tooltip.html.js +0 -1
  97. config.php +0 -466
  98. front/ajax-actions.php +0 -157
  99. front/css/item-reports.css +0 -1
  100. front/css/widgets.css +0 -1
  101. front/item-reports.php +0 -38
  102. front/js/tracking-analytics-events.js +0 -1
  103. front/js/tracking-scrolldepth.js +0 -1
  104. front/js/widgets.js +0 -1
  105. front/setup.php +0 -133
  106. front/tracking-analytics.php +0 -775
  107. front/tracking-tagmanager.php +0 -185
  108. front/tracking.php +0 -79
  109. front/views/analytics-amp-clientidapi.php +0 -11
  110. front/views/analytics-amp-code.php +0 -14
  111. front/views/analytics-code.php +0 -40
  112. front/views/analytics-optout-code.php +0 -28
  113. front/views/optimize-code.php +0 -21
  114. front/views/tagmanager-amp-code.php +0 -14
  115. front/views/tagmanager-code.php +0 -24
  116. front/widgets.php +0 -195
  117. gadwp.php +669 -228
  118. includes/admin/admin.php +522 -0
  119. includes/admin/ajax.php +209 -0
  120. includes/admin/api-auth.php +583 -0
  121. includes/admin/common.php +1094 -0
  122. includes/admin/index.php +4 -0
  123. includes/admin/licensing/autoupdate.php +94 -0
  124. includes/admin/licensing/skin.php +116 -0
  125. includes/admin/notice.php +236 -0
  126. includes/admin/pages/addons.php +183 -0
  127. includes/admin/pages/reports.php +65 -0
  128. includes/admin/pages/settings.php +129 -0
  129. includes/admin/pages/tools.php +44 -0
  130. includes/admin/reporting.php +68 -0
  131. includes/admin/reports/abstract-report.php +456 -0
  132. includes/admin/reports/index.php +4 -0
  133. includes/admin/reports/overview.php +80 -0
  134. includes/admin/review.php +192 -0
  135. includes/admin/routes.php +746 -0
  136. includes/admin/tracking.php +247 -0
  137. includes/api-request.php +443 -0
  138. includes/auth.php +250 -0
  139. includes/capabilities.php +89 -0
  140. includes/deprecated.php +238 -0
  141. includes/em-install.php +453 -0
  142. includes/frontend/class-tracking-abstract.php +79 -0
  143. includes/frontend/events/class-analytics-events.php +116 -0
  144. includes/frontend/events/index.php +4 -0
  145. includes/frontend/frontend.php +396 -0
  146. includes/frontend/index.php +4 -0
  147. includes/frontend/seedprod.php +45 -0
  148. includes/frontend/tracking/class-tracking-analytics.php +346 -0
  149. includes/frontend/tracking/class-tracking-preview.php +81 -0
  150. includes/frontend/tracking/index.php +4 -0
  151. includes/helpers.php +1297 -0
  152. includes/index.php +4 -0
  153. includes/measurement-protocol.php +142 -0
  154. includes/options.php +419 -0
  155. index.php +4 -0
  156. install/install.php +0 -199
  157. install/uninstall.php +0 -42
  158. languages/google-analytics-dashboard-for-wp.pot +3849 -0
admin/ajax-actions.php DELETED
@@ -1,143 +0,0 @@
1
- <?php
2
- /**
3
- * Author: ExactMetrics team
4
- * Author URI: https://exactmetrics.com
5
- * Copyright 2018 ExactMetrics team
6
- * License: GPLv2 or later
7
- * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
- */
9
-
10
- // Exit if accessed directly
11
- if ( ! defined( 'ABSPATH' ) )
12
- exit();
13
-
14
- if ( ! class_exists( 'GADWP_Backend_Ajax' ) ) {
15
-
16
- final class GADWP_Backend_Ajax {
17
-
18
- private $gadwp;
19
-
20
- public function __construct() {
21
- $this->gadwp = GADWP();
22
-
23
- if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) && ( ( 1 == $this->gadwp->config->options['backend_item_reports'] ) || ( 1 == $this->gadwp->config->options['dashboard_widget'] ) ) ) {
24
- // Items action
25
- add_action( 'wp_ajax_gadwp_backend_item_reports', array( $this, 'ajax_item_reports' ) );
26
- }
27
- if ( current_user_can( 'manage_options' ) ) {
28
- // Admin Widget action
29
- add_action( 'wp_ajax_gadwp_dismiss_notices', array( $this, 'ajax_dismiss_notices' ) );
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( $_POST['gadwp_security_backend_item_reports'] ) || ! wp_verify_nonce( $_POST['gadwp_security_backend_item_reports'], 'gadwp_backend_item_reports' ) ) {
40
- wp_die( - 30 );
41
- }
42
- if ( isset( $_POST['projectId'] ) && $this->gadwp->config->options['switch_profile'] && 'false' !== $_POST['projectId'] ) {
43
- $projectId = $_POST['projectId'];
44
- } else {
45
- $projectId = false;
46
- }
47
- $from = $_POST['from'];
48
- $to = $_POST['to'];
49
- $query = $_POST['query'];
50
- if ( isset( $_POST['filter'] ) ) {
51
- $filter_id = $_POST['filter'];
52
- } else {
53
- $filter_id = false;
54
- }
55
- if ( isset( $_POST['metric'] ) ) {
56
- $metric = $_POST['metric'];
57
- } else {
58
- $metric = 'sessions';
59
- }
60
-
61
- if ( $filter_id && $metric == 'sessions' ) { // Sessions metric is not available for item reports
62
- $metric = 'pageviews';
63
- }
64
-
65
- if ( ob_get_length() ) {
66
- ob_clean();
67
- }
68
-
69
- if ( ! ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) && ( ( 1 == $this->gadwp->config->options['backend_item_reports'] ) || ( 1 == $this->gadwp->config->options['dashboard_widget'] ) ) ) ) {
70
- wp_die( - 31 );
71
- }
72
- if ( $this->gadwp->config->options['token'] && $this->gadwp->config->options['tableid_jail'] && $from && $to ) {
73
- if ( null === $this->gadwp->gapi_controller ) {
74
- $this->gadwp->gapi_controller = new GADWP_GAPI_Controller();
75
- }
76
- } else {
77
- wp_die( - 24 );
78
- }
79
- if ( false == $projectId ) {
80
- $projectId = $this->gadwp->config->options['tableid_jail'];
81
- }
82
- $profile_info = GADWP_Tools::get_selected_profile( $this->gadwp->config->options['ga_profiles_list'], $projectId );
83
- if ( isset( $profile_info[4] ) ) {
84
- $this->gadwp->gapi_controller->timeshift = $profile_info[4];
85
- } else {
86
- $this->gadwp->gapi_controller->timeshift = (int) current_time( 'timestamp' ) - time();
87
- }
88
-
89
- if ( $filter_id ) {
90
- $uri_parts = explode( '/', get_permalink( $filter_id ), 4 );
91
-
92
- if ( isset( $uri_parts[3] ) ) {
93
- $uri = '/' . $uri_parts[3];
94
- } else {
95
- wp_die( - 25 );
96
- }
97
-
98
- // allow URL correction before sending an API request
99
- $filter = apply_filters( 'gadwp_backenditem_uri', $uri, $filter_id );
100
-
101
- $lastchar = substr( $filter, - 1 );
102
-
103
- if ( isset( $profile_info[6] ) && $profile_info[6] && '/' == $lastchar ) {
104
- $filter = $filter . $profile_info[6];
105
- }
106
-
107
- // Encode URL
108
- $filter = rawurlencode( rawurldecode( $filter ) );
109
- } else {
110
- $filter = false;
111
- }
112
-
113
- $queries = explode( ',', $query );
114
-
115
- $results = array();
116
-
117
- foreach ( $queries as $value ) {
118
- $results[] = $this->gadwp->gapi_controller->get( $projectId, $value, $from, $to, $filter, $metric );
119
- }
120
-
121
- wp_send_json( $results );
122
- }
123
-
124
- /**
125
- * Ajax handler for dismissing Admin notices
126
- *
127
- * @return json|int
128
- */
129
- public function ajax_dismiss_notices() {
130
- if ( ! isset( $_POST['gadwp_security_dismiss_notices'] ) || ! wp_verify_nonce( $_POST['gadwp_security_dismiss_notices'], 'gadwp_dismiss_notices' ) ) {
131
- wp_die( - 30 );
132
- }
133
-
134
- if ( ! current_user_can( 'manage_options' ) ) {
135
- wp_die( - 31 );
136
- }
137
-
138
- delete_option( 'gadwp_got_updated' );
139
-
140
- wp_die();
141
- }
142
- }
143
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/class-am-notification.php DELETED
@@ -1,472 +0,0 @@
1
- <?php
2
-
3
- if ( ! class_exists( 'AM_Notification', false ) ) {
4
- /**
5
- * Awesome Motive Notifications
6
- *
7
- * This creates a custom post type (if it doesn't exist) and calls the API to
8
- * retrieve notifications for this product.
9
- *
10
- * @package AwesomeMotive
11
- * @author AwesomeMotive Team
12
- * @license GPL-2.0+
13
- * @copyright Copyright (c) 2018, Awesome Motive LLC
14
- * @version 1.0.7
15
- */
16
- class AM_Notification {
17
-
18
- /**
19
- * The api url we are calling.
20
- *
21
- * @since 1.0.0
22
- *
23
- * @var string
24
- */
25
- public $api_url = 'https://api.awesomemotive.com/v1/notification/';
26
-
27
- /**
28
- * A unique slug for this plugin.
29
- * (Not the WordPress plugin slug)
30
- *
31
- * @since 1.0.0
32
- *
33
- * @var string
34
- */
35
- public $plugin;
36
-
37
- /**
38
- * The current plugin version.
39
- *
40
- * @since 1.0.0
41
- *
42
- * @var string
43
- */
44
- public $plugin_version;
45
-
46
- /**
47
- * Flag if a notice has been registered.
48
- *
49
- * @since 1.0.0
50
- *
51
- * @var bool
52
- */
53
- public static $registered = false;
54
-
55
- /**
56
- * Construct.
57
- *
58
- * @since 1.0.0
59
- *
60
- * @param string $plugin The plugin slug.
61
- * @param mixed $version The version of the plugin.
62
- */
63
- public function __construct( $plugin = '', $version = 0 ) {
64
- $this->plugin = $plugin;
65
- $this->plugin_version = $version;
66
-
67
- add_action( 'init', array( $this, 'custom_post_type' ) );
68
- add_action( 'admin_init', array( $this, 'get_remote_notifications' ), 100 );
69
- add_action( 'admin_notices', array( $this, 'display_notifications' ) );
70
- add_action( 'wp_ajax_am_notification_dismiss', array( $this, 'dismiss_notification' ) );
71
- }
72
-
73
- /**
74
- * Registers a custom post type.
75
- *
76
- * @since 1.0.0
77
- */
78
- public function custom_post_type() {
79
- register_post_type( 'amn_' . $this->plugin, array(
80
- 'label' => $this->plugin . ' Announcements',
81
- 'can_export' => false,
82
- 'supports' => false,
83
- 'capability_type' => 'manage_options',
84
- ) );
85
- }
86
-
87
- /**
88
- * Retrieve the remote notifications if the time has expired.
89
- *
90
- * @since 1.0.0
91
- */
92
- public function get_remote_notifications() {
93
- if ( ! apply_filters( 'am_notifications_display', is_super_admin() ) ) {
94
- return;
95
- }
96
-
97
- $to_check = get_option( '_amn_' . $this->plugin . '_to_check', false );
98
-
99
- if ( $to_check == false ) {
100
- // Non load balanced. Start checking in in 7 days + 2-4 days.
101
- $checktime = array();
102
- $checktime['day'] = rand( 0, 6 );
103
- $checktime['hour'] = rand( 0, 23 );
104
- $checktime['minute'] = rand( 0, 59 );
105
- $checktime['second'] = rand( 0, 59 );
106
- $checktime['offset'] = ( $checktime['day'] * DAY_IN_SECONDS ) +
107
- ( $checktime['hour'] * HOUR_IN_SECONDS ) +
108
- ( $checktime['minute'] * MINUTE_IN_SECONDS ) +
109
- $checktime['second'];
110
- $to_check = strtotime("next sunday") + $checktime['offset'];
111
- update_option( '_amn_' . $this->plugin . '_to_check', $to_check );
112
- }
113
-
114
- if ( $to_check < time() ) {
115
- $plugin_notifications = $this->get_plugin_notifications( 1 );
116
- $notification_id = null;
117
-
118
- if ( ! empty( $plugin_notifications ) ) {
119
- // Unset it from the array.
120
- $notification = $plugin_notifications[0];
121
- $notification_id = get_post_meta( $notification->ID, 'notification_id', true );
122
- }
123
-
124
- $response = wp_remote_retrieve_body( wp_remote_post( $this->api_url, array(
125
- 'body' => array(
126
- 'slug' => $this->plugin,
127
- 'version' => $this->plugin_version,
128
- 'last_notification' => $notification_id,
129
- ),
130
- ) ) );
131
-
132
- $data = json_decode( $response );
133
-
134
- if ( ! empty( $data->id ) ) {
135
- $notifications = array();
136
-
137
- foreach ( (array) $data->slugs as $slug ) {
138
- $notifications = array_merge(
139
- $notifications,
140
- (array) get_posts(
141
- array(
142
- 'post_type' => 'amn_' . $slug,
143
- 'post_status' => 'all',
144
- 'meta_key' => 'notification_id',
145
- 'meta_value' => $data->id,
146
- )
147
- )
148
- );
149
- }
150
-
151
- if ( empty( $notifications ) ) {
152
- $new_notification_id = wp_insert_post(
153
- array(
154
- 'post_content' => wp_kses_post( $data->content ),
155
- 'post_type' => 'amn_' . $this->plugin,
156
- )
157
- );
158
-
159
- update_post_meta( $new_notification_id, 'notification_id', absint( $data->id ) );
160
- update_post_meta( $new_notification_id, 'type', sanitize_text_field( trim( $data->type ) ) );
161
- update_post_meta( $new_notification_id, 'dismissable', (bool) $data->dismissible ? 1 : 0 );
162
- update_post_meta( $new_notification_id, 'location', function_exists( 'wp_json_encode' ) ? wp_json_encode( $data->location ) : json_encode( $data->location ) );
163
- update_post_meta( $new_notification_id, 'version', sanitize_text_field( trim( $data->version ) ) );
164
- update_post_meta( $new_notification_id, 'viewed', 0 );
165
- update_post_meta( $new_notification_id, 'expiration', $data->expiration ? absint( $data->expiration ) : false );
166
- update_post_meta( $new_notification_id, 'plans', function_exists( 'wp_json_encode' ) ? wp_json_encode( $data->plans ) : json_encode( $data->plans ) );
167
- }
168
- }
169
-
170
- // Possibly revoke notifications.
171
- if ( ! empty( $data->revoked ) ) {
172
- $this->revoke_notifications( $data->revoked );
173
- }
174
-
175
- // Set the option now so we can't run this again until after 24 hours.
176
- update_option( '_amn_' . $this->plugin . '_to_check', time() + 3 * DAY_IN_SECONDS );
177
- }
178
- }
179
-
180
- /**
181
- * Get local plugin notifications that have already been set.
182
- *
183
- * @since 1.0.0
184
- *
185
- * @param integer $limit Set the limit for how many posts to retrieve.
186
- * @param array $args Any top-level arguments to add to the array.
187
- *
188
- * @return WP_Post[] WP_Post that match the query.
189
- */
190
- public function get_plugin_notifications( $limit = - 1, $args = array() ) {
191
- return get_posts(
192
- array(
193
- 'posts_per_page' => $limit,
194
- 'post_type' => 'amn_' . $this->plugin,
195
- ) + $args
196
- );
197
- }
198
-
199
- /**
200
- * Display any notifications that should be displayed.
201
- *
202
- * @since 1.0.0
203
- */
204
- public function display_notifications() {
205
- if ( ! apply_filters( 'am_notifications_display', is_super_admin() ) ) {
206
- return;
207
- }
208
-
209
- $plugin_notifications = $this->get_plugin_notifications( - 1, array(
210
- 'post_status' => 'all',
211
- 'meta_key' => 'viewed',
212
- 'meta_value' => '0',
213
- ) );
214
-
215
- $plugin_notifications = $this->validate_notifications( $plugin_notifications );
216
-
217
- if ( ! empty( $plugin_notifications ) && ! self::$registered ) {
218
- foreach ( $plugin_notifications as $notification ) {
219
- $dismissable = get_post_meta( $notification->ID, 'dismissable', true );
220
- $type = get_post_meta( $notification->ID, 'type', true );
221
- ?>
222
- <div class="am-notification am-notification-<?php echo absint( $notification->ID ); ?> notice notice-<?php echo esc_attr( $type ); ?><?php echo $dismissable ? ' is-dismissible' : ''; ?>">
223
- <?php echo wp_kses_post( $notification->post_content ); ?>
224
- </div>
225
- <script type="text/javascript">
226
- jQuery( document ).ready( function ( $ ) {
227
- $( document ).on( 'click', '.am-notification-<?php echo absint( $notification->ID ); ?> button.notice-dismiss', function ( event ) {
228
- $.post( ajaxurl, {
229
- action: 'am_notification_dismiss',
230
- notification_id: '<?php echo absint( $notification->ID ); ?>'
231
- } );
232
- } );
233
- } );
234
- </script>
235
- <?php
236
- }
237
-
238
- self::$registered = true;
239
- }
240
- }
241
-
242
- /**
243
- * Validate the notifications before displaying them.
244
- *
245
- * @since 1.0.0
246
- *
247
- * @param array $plugin_notifications An array of plugin notifications.
248
- *
249
- * @return array A filtered array of plugin notifications.
250
- */
251
- public function validate_notifications( $plugin_notifications ) {
252
- global $pagenow;
253
-
254
- foreach ( $plugin_notifications as $key => $notification ) {
255
- // Location validation.
256
- $location = (array) json_decode( get_post_meta( $notification->ID, 'location', true ) );
257
- $continue = false;
258
- if ( ! in_array( 'everywhere', $location, true ) ) {
259
- if ( in_array( 'index.php', $location, true ) && 'index.php' === $pagenow ) {
260
- $continue = true;
261
- }
262
-
263
- if ( in_array( 'plugins.php', $location, true ) && 'plugins.php' === $pagenow ) {
264
- $continue = true;
265
- }
266
-
267
- if ( ! $continue ) {
268
- unset( $plugin_notifications[ $key ] );
269
- }
270
- }
271
-
272
- // Plugin validation (OR conditional).
273
- $plugins = (array) json_decode( get_post_meta( $notification->ID, 'plugins', true ) );
274
- $continue = false;
275
- if ( ! empty( $plugins ) ) {
276
- foreach ( $plugins as $plugin ) {
277
- if ( is_plugin_active( $plugin ) ) {
278
- $continue = true;
279
- }
280
- }
281
-
282
- if ( ! $continue ) {
283
- unset( $plugin_notifications[ $key ] );
284
- }
285
- }
286
-
287
- // Theme validation.
288
- $theme = get_post_meta( $notification->ID, 'theme', true );
289
- $continue = (string) wp_get_theme() === $theme;
290
-
291
- if ( ! empty( $theme ) && ! $continue ) {
292
- unset( $plugin_notifications[ $key ] );
293
- }
294
-
295
- // Version validation.
296
- $version = get_post_meta( $notification->ID, 'version', true );
297
- $continue = false;
298
- if ( ! empty( $version ) ) {
299
- if ( version_compare( $this->plugin_version, $version, '<=' ) ) {
300
- $continue = true;
301
- }
302
-
303
- if ( ! $continue ) {
304
- unset( $plugin_notifications[ $key ] );
305
- }
306
- }
307
-
308
- // Expiration validation.
309
- $expiration = get_post_meta( $notification->ID, 'expiration', true );
310
- $continue = false;
311
- if ( ! empty( $expiration ) ) {
312
- if ( $expiration > time() ) {
313
- $continue = true;
314
- }
315
-
316
- if ( ! $continue ) {
317
- unset( $plugin_notifications[ $key ] );
318
- }
319
- }
320
-
321
- // Plan validation.
322
- $plans = (array) json_decode( get_post_meta( $notification->ID, 'plans', true ) );
323
- $continue = false;
324
- if ( ! empty( $plans ) ) {
325
- $level = $this->get_plan_level();
326
- if ( in_array( $level, $plans, true ) ) {
327
- $continue = true;
328
- }
329
-
330
- if ( ! $continue ) {
331
- unset( $plugin_notifications[ $key ] );
332
- }
333
- }
334
- }
335
-
336
- return $plugin_notifications;
337
- }
338
-
339
- /**
340
- * Grab the current plan level.
341
- *
342
- * @since 1.0.0
343
- *
344
- * @return string The current plan level.
345
- */
346
- public function get_plan_level() {
347
- // Prepare variables.
348
- $key = '';
349
- $level = '';
350
-
351
- switch ( $this->plugin ) {
352
- case 'wpforms':
353
- $option = get_option( 'wpforms_license' );
354
- $key = is_array( $option ) && isset( $option['key'] ) ? $option['key'] : '';
355
- $level = is_array( $option ) && isset( $option['type'] ) ? $option['type'] : '';
356
-
357
- // Possibly check for a constant.
358
- if ( empty( $key ) && defined( 'WPFORMS_LICENSE_KEY' ) ) {
359
- $key = WPFORMS_LICENSE_KEY;
360
- }
361
- break;
362
- case 'mi-lite':
363
- case 'mi':
364
- if ( version_compare( MONSTERINSIGHTS_VERSION, '6.9.0', '>=' ) ) {
365
- if ( MonsterInsights()->license->get_site_license_type() ) {
366
- $key = MonsterInsights()->license->get_site_license_key();
367
- $type = MonsterInsights()->license->get_site_license_type();
368
- } else if ( MonsterInsights()->license->get_network_license_type() ) {
369
- $key = MonsterInsights()->license->get_network_license_key();
370
- $type = MonsterInsights()->license->get_network_license_type();
371
- }
372
-
373
- // Check key fallbacks.
374
- if ( empty( $key ) ) {
375
- $key = MonsterInsights()->license->get_license_key();
376
- }
377
- } else {
378
- $option = get_option( 'monsterinsights_license' );
379
- $key = is_array( $option ) && isset( $option['key'] ) ? $option['key'] : '';
380
- $level = is_array( $option ) && isset( $option['type'] ) ? $option['type'] : '';
381
-
382
- // Possibly check for a constant.
383
- if ( empty( $key ) && defined( 'MONSTERINSIGHTS_LICENSE_KEY' ) && is_string( MONSTERINSIGHTS_LICENSE_KEY ) && strlen( MONSTERINSIGHTS_LICENSE_KEY ) > 10 ) {
384
- $key = MONSTERINSIGHTS_LICENSE_KEY;
385
- }
386
- }
387
- break;
388
- case 'om':
389
- $option = get_option( 'optin_monster_api' );
390
- $key = is_array( $option ) && isset( $option['api']['apikey'] ) ? $option['api']['apikey'] : '';
391
-
392
- // Possibly check for a constant.
393
- if ( empty( $key ) && defined( 'OPTINMONSTER_REST_API_LICENSE_KEY' ) ) {
394
- $key = OPTINMONSTER_REST_API_LICENSE_KEY;
395
- }
396
-
397
- // If the key is still empty, check for the old legacy key.
398
- if ( empty( $key ) ) {
399
- $key = is_array( $option ) && isset( $option['api']['key'] ) ? $option['api']['key'] : '';
400
- }
401
- break;
402
- }
403
-
404
- // Possibly set the level to 'none' if the key is empty and no level has been set.
405
- if ( empty( $key ) && empty( $level ) ) {
406
- $level = 'none';
407
- }
408
-
409
- // Possibly set the level to 'unknown' if a key is entered, but no level can be determined (such as manually entered key)
410
- if ( ! empty( $key ) && empty( $level ) ) {
411
- $level = 'unknown';
412
- }
413
-
414
- // Normalize the level.
415
- switch ( $level ) {
416
- case 'bronze':
417
- case 'personal':
418
- $level = 'basic';
419
- break;
420
- case 'silver':
421
- case 'multi':
422
- $level = 'plus';
423
- break;
424
- case 'gold':
425
- case 'developer':
426
- $level = 'pro';
427
- break;
428
- case 'platinum':
429
- case 'master':
430
- $level = 'ultimate';
431
- break;
432
- }
433
-
434
- // Return the plan level.
435
- return $level;
436
- }
437
-
438
- /**
439
- * Dismiss the notification via AJAX.
440
- *
441
- * @since 1.0.0
442
- */
443
- public function dismiss_notification() {
444
- if ( ! apply_filters( 'am_notifications_display', is_super_admin() ) ) {
445
- die;
446
- }
447
-
448
- $notification_id = intval( $_POST['notification_id'] );
449
- update_post_meta( $notification_id, 'viewed', 1 );
450
- die;
451
- }
452
-
453
- /**
454
- * Revokes notifications.
455
- *
456
- * @since 1.0.0
457
- *
458
- * @param array $ids An array of notification IDs to revoke.
459
- */
460
- public function revoke_notifications( $ids ) {
461
- // Loop through each of the IDs and find the post that has it as meta.
462
- foreach ( (array) $ids as $id ) {
463
- $notifications = $this->get_plugin_notifications( - 1, array( 'post_status' => 'all', 'meta_key' => 'notification_id', 'meta_value' => $id ) );
464
- if ( $notifications ) {
465
- foreach ( $notifications as $notification ) {
466
- update_post_meta( $notification->ID, 'viewed', 1 );
467
- }
468
- }
469
- }
470
- }
471
- }
472
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/css/admin-widgets.css DELETED
@@ -1 +0,0 @@
1
- .gadwp-pline{width:100%;margin:0;padding:5px 0 5px 0;background:#fff;-moz-box-shadow:0 0 3px 0 #BBB;-webkit-box-shadow:0 0 3px 0 #BBB;box-shadow:0 0 3px 0 #BBB;display:table;overflow:hidden}.gadwp-pleft{width:90%;float:left;padding-left:5px}.gadwp-pright{width:5%;float:right;padding-right:5px}[id^=gadwp-realtime-]{margin:10px 0 0 0;width:100%}.gadwp-rt-box{width:100%;margin:0;background:#fff;text-align:center;-moz-box-shadow:0 0 5px 0 #BBB;-webkit-box-shadow:0 0 5px 0 #BBB;box-shadow:0 0 5px 0 #BBB;display:table}.gadwp-tdo-left{width:60%;padding:33px 0;float:left;text-align:center}.gadwp-tdo-right{width:35%;margin:0 10px 0 0;text-align:left;font-weight:bold;vertical-align:middle;float:right;display:table}.gadwp-online{font-size:100px;font-weight:normal;line-height:1em;margin:0 auto;width:80%}.gadwp-bigtext{font-size:14px;width:100%;margin:0;padding:5px 5px 5px 5px;background:#fff;-moz-box-shadow:0 0 3px 0 #BBB;-webkit-box-shadow:0 0 3px 0 #BBB;box-shadow:0 0 3px 0 #BBB;display:table;overflow:hidden}.gadwp-bleft{float:left;width:80%}.gadwp-bright{float:right;width:20%}.gadwp-pgdetailsr{padding-left:20px;text-align:right}.gadwp-pgdetailsl{min-width:250px}[id^=gadwp-areachart-]{width:98%;height:100%;margin:10px auto 10px 0;height:250px}.gadwp-floatwraper{display:table;width:100%;height:100%}[id^=gadwp-piechart-].halfsize{width:47%;margin:10px 0 0 0;height:200px;float:left}[id^=gadwp-piechart-].floatleft{float:left}[id^=gadwp-piechart-].floatright{float:right}[id^=gadwp-tablechart-],[id^=gadwp-tablechart-]{width:98%;height:100%;margin:10px auto 10px 0}#dashboard-widgets-wrap .postbox{margin-right:10px}[id^=gadwp-progressbar-]{width:100%;height:3px;margin:5px 0 0 0}[id^=gadwp-bottomstats-]{width:100%}[id^=gadwp-bottomstats-] .inside{display:table;margin:0 auto;padding:0}#gadwp-widget .inside .small-box{width:30%;float:left;margin:0 5px 10px 5px;background:#fff;text-align:center;-moz-box-shadow:0 0 7px 0 #BBB;-webkit-box-shadow:0 0 7px 0 #BBB;box-shadow:0 0 7px 0 #BBB}#gadwp-widget .inside .small-box h3{font-size:1em;color:#777;padding:0 5px 0 5px;margin:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}#gadwp-widget .inside .small-box p{font-size:1.2em;margin:0 0 2px 0}@media screen and (max-width:410px){[id^=gadwp-bottomstats-] .inside .small-box{width:45%}}
 
admin/css/gadwp.css DELETED
@@ -1,221 +0,0 @@
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
- /* Tab navigation */
10
- #gadwp-events, #gadwp-custom, #gadwp-advanced, #gadwp-exclude, #gadwp-config, #gadwp-tmdatalayervars, #gadwp-tmintegration, #gadwp-integration, #gadwp-tmadvanced {
11
- display: none;
12
- }
13
-
14
- /* Options pages */
15
- table.gadwp-settings-options {
16
- padding-left: 10px;
17
- width: 100%;
18
- }
19
-
20
- .gadwp-settings-options td {
21
- padding: 0px 5px 5px 5px;
22
- }
23
-
24
- td.gadwp-settings-title, td.info {
25
- width: 140px;
26
- padding-left: 20px;
27
- }
28
-
29
- td.gadwp-settings-title-s {
30
- width: 300px;
31
- }
32
-
33
- .gadwp-help {
34
- padding-left: 15px;
35
- }
36
-
37
- td.gadwp-settings-info {
38
- padding-bottom: 15px;
39
- }
40
-
41
- td.gadwp-settings-title label {
42
- font-size: 1.1em;
43
- }
44
-
45
- .gadwp-title {
46
- float: left;
47
- margin-right: 10px;
48
- margin-top: 2px;
49
- clear: left;
50
- }
51
-
52
- .gadwp-desc {
53
- font-size: 1em;
54
- }
55
-
56
- .gadwp-top {
57
- vertical-align: top;
58
- }
59
-
60
- pre.gadwp-settings-logdata {
61
- white-space: pre-wrap; /* Since CSS 2.1 */
62
- white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
63
- white-space: -pre-wrap; /* Opera 4-6 */
64
- white-space: -o-pre-wrap; /* Opera 7 */
65
- word-wrap: break-word; /* Internet Explorer 5.5+ */
66
- }
67
-
68
- pre.gadwp-settings-logdata span{
69
- color: #b30000;
70
- font-weight: 800;
71
- }
72
-
73
- table.gadwp-settings-logdata {
74
- table-layout:fixed;
75
- width: 100%;
76
- }
77
-
78
-
79
- td.gadwp-settings-roles {
80
- padding-bottom: 15px;
81
- }
82
-
83
- #ga_speed_samplerate, #ga_user_samplerate, #ga_realtime_pages {
84
- width: 50px;
85
- }
86
-
87
- #gapi-access-code {
88
- color: red !important;
89
- }
90
-
91
- #poststuff.gadwp h2 {
92
- padding-bottom: 0;
93
- font-size: 19.5px;
94
- font-weight: normal;
95
- padding: 0;
96
- margin: 20px 0 15px 0;
97
- }
98
-
99
- #poststuff.gadwp h2.nav-tab-wrapper {
100
- border-bottom: 1px solid #ccc;
101
- padding-bottom: 0;
102
- }
103
-
104
- /* Options pages ON/OFF Switch */
105
- .button-primary.gadwp-settings-switchoo {
106
- position: relative;
107
- width: 50px;
108
- float: left;
109
- border: none;
110
- padding: 0;
111
- height: 22px;
112
- -moz-box-shadow: none;
113
- -webkit-box-shadow: none;
114
- -o-box-shadow: none;
115
- box-shadow: none;
116
- -webkit-user-select: none;
117
- -moz-user-select: none;
118
- -ms-user-select: none;
119
- }
120
-
121
- input.gadwp-settings-switchoo-checkbox {
122
- display: none;
123
- }
124
-
125
- .gadwp-settings-switchoo-label {
126
- display: block;
127
- overflow: hidden;
128
- cursor: pointer;
129
- background: transparent;
130
- border: 1px solid #ddd;
131
- border-radius: 2px;
132
- text-shadow: none;
133
- }
134
-
135
- .gadwp-settings-switchoo-inner {
136
- width: 200%;
137
- margin-left: -100%;
138
- border-radius: 2px;
139
- -moz-transition: margin 0.2s ease-in 0s;
140
- -webkit-transition: margin 0.2s ease-in 0s;
141
- -o-transition: margin 0.2s ease-in 0s;
142
- transition: margin 0.2s ease-in 0s;
143
- }
144
-
145
- .gadwp-settings-switchoo-inner:before, .gadwp-settings-switchoo-inner:after {
146
- float: left;
147
- width: 50%;
148
- font-weight: normal;
149
- -moz-box-sizing: border-box;
150
- -webkit-box-sizing: border-box;
151
- -o-box-sizing: border-box;
152
- box-sizing: border-box;
153
- height: 22px;
154
- line-height: 22px;
155
- font-size: 12px;
156
- text-shadow: none;
157
- }
158
-
159
- .gadwp-settings-switchoo-inner:before {
160
- content: "On";
161
- padding-left: 5px;
162
- border-bottom: none;
163
- /* background-color: #00a0d2;
164
- color: #fff; /* inherit from button props */
165
- }
166
-
167
- .gadwp-settings-switchoo-inner:after {
168
- content: "Off";
169
- padding-right: 5px;
170
- background-color: #ddd;
171
- text-align: right;
172
- }
173
-
174
- .gadwp-settings-switchoo-switch {
175
- width: 22px;
176
- height: 22px;
177
- background: #fff;
178
- color: #ddd;
179
- border: 1px solid #ddd;
180
- border-radius: 2px;
181
- position: absolute;
182
- top: 0;
183
- bottom: 0;
184
- right: 27px;
185
- -moz-transition: all 0.2s ease-in 0s;
186
- -webkit-transition: all 0.2s ease-in 0s;
187
- -o-transition: all 0.2s ease-in 0s;
188
- transition: all 0.2s ease-in 0s;
189
- }
190
-
191
- .gadwp-settings-switchoo-switch:hover {
192
- color: #aaa;
193
- border-color: #aaa;
194
- }
195
-
196
- .gadwp-settings-switchoo-switch:after {
197
- margin: 0;
198
- outline: 0;
199
- display: inline-block;
200
- font: 400 16px/16px dashicons;
201
- content: "\f228";
202
- padding: 3px 0 0 3px;
203
- text-align: left;
204
- text-decoration: none;
205
- -webkit-font-smoothing: antialiased;
206
- -moz-osx-font-smoothing: grayscale;
207
- }
208
-
209
- .gadwp-settings-switchoo-checkbox:checked+.gadwp-settings-switchoo-label .gadwp-settings-switchoo-inner {
210
- margin-left: 0;
211
- }
212
-
213
- .gadwp-settings-switchoo-checkbox:checked+.gadwp-settings-switchoo-label .gadwp-settings-switchoo-switch {
214
- right: 0px;
215
- }
216
-
217
- .switch-desc {
218
- float: left;
219
- margin-left: 10px;
220
- line-height: 20px;
221
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/css/item-reports.css DELETED
@@ -1 +0,0 @@
1
- .column-gadwp_stats{width:70px}.gadwp-icon{color:#555}.gadwp-icon:hover{color:#2ea2cc}.gadwp-icon-oldwp{padding-top:5px}[id^=gadwp-container-]{width:480px}[id^=gadwp-areachart-]{height:280px}[id^=gadwp-progressbar-]{width:100%;height:3px;margin:5px 0 0 0}[id^=gadwp-bottomstats-]{width:100%}[id^=gadwp-bottomstats-] .inside{display:table;margin:0 auto;padding:0}[id^=gadwp-bottomstats-] .inside .small-box{width:31.2%;float:left;margin:10px 5px 10px 5px;background:#fff;text-align:center;-moz-box-shadow:0 0 7px 0 #BBB;-webkit-box-shadow:0 0 7px 0 #BBB;box-shadow:0 0 7px 0 #BBB}[id^=gadwp-bottomstats-] .inside .small-box h3{font-size:1em;font-weight:normal;color:#777;padding:0 5px 0 5px;margin:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}[id^=gadwp-bottomstats-] .inside .small-box p{font-size:1.2em;margin:0 0 2px 0;color:black}.gadwp-floatwraper{display:table;width:100%;height:100%}[id^=gadwp-piechart-].halfsize{width:47%;margin:10px 0 0 0;height:200px;float:left}[id^=gadwp-piechart-].floatleft{float:left}[id^=gadwp-piechart-].floatright{float:right}[id^=gadwp-tablechart-],[id^=gadwp-tablechart-]{margin:10px 0 0 0}.gadwp .ui-dialog-titlebar{font-size:1.1em;text-overflow:ellipsis;overflow:hidden}@media screen and (max-width:500px){[id^=gadwp-container-]{width:410px}[id^=gadwp-bottomstats-] .inside .small-box{width:30.8%}}@media screen and (max-width:410px){[id^=gadwp-container-]{width:260px}[id^=gadwp-bottomstats-] .inside .small-box{width:46%}}
 
admin/images/clicky.png DELETED
Binary file
admin/images/gadwp-icon.png DELETED
Binary file
admin/images/google-analytics-dashboard.png DELETED
Binary file
admin/images/help.png DELETED
Binary file
admin/images/mcdn.png DELETED
Binary file
admin/images/optinmonster.png DELETED
Binary file
admin/images/ssl.png DELETED
Binary file
admin/images/star.png DELETED
Binary file
admin/images/wp.png DELETED
Binary file
admin/images/wpforms.png DELETED
Binary file
admin/item-reports.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
- /**
3
- * Author: ExactMetrics team
4
- * Author URI: https://exactmetrics.com
5
- * Copyright 2018 ExactMetrics team
6
- * License: GPLv2 or later
7
- * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
- */
9
-
10
- // Exit if accessed directly
11
- if ( ! defined( 'ABSPATH' ) )
12
- exit();
13
-
14
- if ( ! class_exists( 'GADWP_Backend_Item_Reports' ) ) {
15
-
16
- final class GADWP_Backend_Item_Reports {
17
-
18
- private $gadwp;
19
-
20
- public function __construct() {
21
- $this->gadwp = GADWP();
22
-
23
- if ( GADWP_Tools::check_roles( $this->gadwp->config->options['access_back'] ) && 1 == $this->gadwp->config->options['backend_item_reports'] ) {
24
- // Add custom column in Posts List
25
- add_filter( 'manage_posts_columns', array( $this, 'add_columns' ) );
26
-
27
- // Populate custom column in Posts List
28
- add_action( 'manage_posts_custom_column', array( $this, 'add_icons' ), 10, 2 );
29
-
30
- // Add custom column in Pages List
31
- add_filter( 'manage_pages_columns', array( $this, 'add_columns' ) );
32
-
33
- // Populate custom column in Pages List
34
- add_action( 'manage_pages_custom_column', array( $this, 'add_icons' ), 10, 2 );
35
- }
36
- }
37
-
38
- public function add_icons( $column, $id ) {
39
- global $wp_version;
40
-
41
- if ( 'gadwp_stats' != $column ) {
42
- return;
43
- }
44
-
45
- if ( version_compare( $wp_version, '3.8.0', '>=' ) ) {
46
- echo '<a id="gadwp-' . $id . '" title="' . get_the_title( $id ) . '" href="#' . $id . '" class="gadwp-icon dashicons-before dashicons-chart-area">&nbsp;</a>';
47
- } else {
48
- echo '<a id="gadwp-' . $id . '" title="' . get_the_title( $id ) . '" href="#' . $id . '"><img class="gadwp-icon-oldwp" src="' . GADWP_URL . 'admin/images/gadwp-icon.png"</a>';
49
- }
50
- }
51
-
52
- public function add_columns( $columns ) {
53
- return array_merge( $columns, array( 'gadwp_stats' => __( 'Analytics', 'google-analytics-dashboard-for-wp' ) ) );
54
- }
55
- }
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/js/settings.js DELETED
@@ -1 +0,0 @@
1
- jQuery(document).ready(function(){if(window.location.href.indexOf("page=gadwp_")!=-1){var a="basic";if(window.location.hash){a=window.location.hash.split("#")[2].split("-")[1]}else{if(window.location.href.indexOf("page=gadwp_errors_debugging")!=-1){a="errors"}}jQuery(".nav-tab-wrapper a").each(function(b){jQuery(this).removeClass("nav-tab-active");jQuery("#"+this.hash.split("#")[2]).hide()});jQuery("#tab-"+a).addClass("nav-tab-active");jQuery("#gadwp-"+a).show()}jQuery('a[href^="#"]').click(function(b){if(window.location.href.indexOf("page=gadwp_")!=-1){jQuery(".nav-tab-wrapper a").each(function(c){jQuery(this).removeClass("nav-tab-active");jQuery("#"+this.hash.split("#")[2]).hide()});jQuery(this).addClass("nav-tab-active");jQuery("#"+this.hash.split("#")[2]).show()}})});
 
admin/js/ui.js DELETED
@@ -1 +0,0 @@
1
- "use strict";jQuery(document).ready(function(){var a={action:"gadwp_dismiss_notices",gadwp_security_dismiss_notices:gadwp_ui_data.security};jQuery("#gadwp-notice .notice-dismiss").click(function(){jQuery.post(gadwp_ui_data.ajaxurl,a)});if(gadwp_ui_data.ed_bubble!=""){jQuery('#toplevel_page_gadwp_settings li > a[href*="page=gadwp_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>")}});
 
admin/js/wp-color-picker-script.js DELETED
@@ -1 +0,0 @@
1
- jQuery(document).ready(function(){jQuery(".theme_color").wpColorPicker()});
 
admin/settings.php DELETED
@@ -1,2005 +0,0 @@
1
- <?php
2
- /**
3
- * Author: ExactMetrics team
4
- * Author URI: https://exactmetrics.com
5
- * Copyright 2018 ExactMetrics team
6
- * License: GPLv2 or later
7
- * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
- */
9
-
10
- // Exit if accessed directly
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit();
13
- }
14
-
15
- final class GADWP_Settings {
16
-
17
- private static function update_options( $who ) {
18
- $gadwp = GADWP();
19
- $network_settings = false;
20
- $options = $gadwp->config->options; // Get current options
21
- if ( isset( $_POST['options']['gadwp_hidden'] ) && isset( $_POST['options'] ) && ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) && 'Reset' != $who ) {
22
- $new_options = $_POST['options'];
23
- if ( 'tracking' == $who ) {
24
- $options['ga_anonymize_ip'] = 0;
25
- $options['ga_optout'] = 0;
26
- $options['ga_dnt_optout'] = 0;
27
- $options['ga_event_tracking'] = 0;
28
- $options['ga_enhanced_links'] = 0;
29
- $options['ga_event_precision'] = 0;
30
- $options['ga_remarketing'] = 0;
31
- $options['ga_event_bouncerate'] = 0;
32
- $options['ga_crossdomain_tracking'] = 0;
33
- $options['ga_aff_tracking'] = 0;
34
- $options['ga_hash_tracking'] = 0;
35
- $options['ga_formsubmit_tracking'] = 0;
36
- $options['ga_force_ssl'] = 0;
37
- $options['ga_pagescrolldepth_tracking'] = 0;
38
- $options['tm_pagescrolldepth_tracking'] = 0;
39
- $options['tm_optout'] = 0;
40
- $options['tm_dnt_optout'] = 0;
41
- $options['amp_tracking_analytics'] = 0;
42
- $options['amp_tracking_clientidapi'] = 0;
43
- $options['amp_tracking_tagmanager'] = 0;
44
- $options['optimize_pagehiding'] = 0;
45
- $options['optimize_tracking'] = 0;
46
- $options['trackingcode_infooter'] = 0;
47
- $options['trackingevents_infooter'] = 0;
48
- $options['ga_with_gtag'] = 0;
49
- if ( isset( $_POST['options']['ga_tracking_code'] ) ) {
50
- $new_options['ga_tracking_code'] = trim( $new_options['ga_tracking_code'], "\t" );
51
- }
52
- if ( empty( $new_options['track_exclude'] ) ) {
53
- $new_options['track_exclude'] = array();
54
- }
55
- } elseif ( 'backend' == $who ) {
56
- $options['switch_profile'] = 0;
57
- $options['backend_item_reports'] = 0;
58
- $options['dashboard_widget'] = 0;
59
- $options['backend_realtime_report'] = 0;
60
- if ( empty( $new_options['access_back'] ) ) {
61
- $new_options['access_back'][] = 'administrator';
62
- }
63
- if ( ! is_multisite() ) {
64
- $options['hide_am_notices'] = 0;
65
- }
66
- } elseif ( 'frontend' == $who ) {
67
- $options['frontend_item_reports'] = 0;
68
- if ( empty( $new_options['access_front'] ) ) {
69
- $new_options['access_front'][] = 'administrator';
70
- }
71
- } elseif ( 'general' == $who ) {
72
- $options['user_api'] = 0;
73
- $options['usage_tracking'] = 0;
74
- if ( ! is_multisite() ) {
75
- $options['automatic_updates_minorversion'] = 0;
76
- }
77
- } elseif ( 'network' == $who ) {
78
- $options['user_api'] = 0;
79
- $options['network_mode'] = 0;
80
- $options['superadmin_tracking'] = 0;
81
- $options['automatic_updates_minorversion'] = 0;
82
- $network_settings = true;
83
- $options['network_hide_am_notices'] = 0;
84
- }
85
- if ( ! $network_settings && 'general' == $who ) {
86
- $usage_tracking = isset( $_POST['usage_tracking'] ) ? (int) $_POST['usage_tracking'] : 0;
87
- do_action( 'exactmetrics_settings_usage_tracking', $usage_tracking );
88
- }
89
-
90
- $options = array_merge( $options, $new_options );
91
- $gadwp->config->options = $options;
92
- $gadwp->config->set_plugin_options( $network_settings );
93
- }
94
- return $options;
95
- }
96
-
97
- private static function navigation_tabs( $tabs ) {
98
- echo '<h2 class="nav-tab-wrapper">';
99
- foreach ( $tabs as $tab => $name ) {
100
- echo "<a class='nav-tab' id='tab-$tab' href='#top#gadwp-$tab'>$name</a>";
101
- }
102
- echo '</h2>';
103
- }
104
-
105
- public static function frontend_settings() {
106
- $gadwp = GADWP();
107
- if ( ! current_user_can( 'manage_options' ) ) {
108
- return;
109
- }
110
- $options = self::update_options( 'frontend' );
111
- if ( isset( $_POST['options']['gadwp_hidden'] ) ) {
112
- $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
113
- if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) {
114
- $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "You don’t have permission to do this.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
115
- }
116
- }
117
- if ( ! $gadwp->config->options['tableid_jail'] || ! $gadwp->config->options['token'] ) {
118
- $message = sprintf( '<div class="error"><p>%s</p></div>', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );
119
- }
120
- ?>
121
- <form name="gadwp_form" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
122
- <div class="wrap">
123
- <?php echo "<h2>" . __( "Google Analytics Frontend Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?><hr>
124
- </div>
125
- <div id="poststuff" class="gadwp">
126
- <div id="post-body" class="metabox-holder columns-2">
127
- <div id="post-body-content">
128
- <div class="settings-wrapper">
129
- <div class="inside">
130
- <?php if (isset($message)) echo $message; ?>
131
- <table class="gadwp-settings-options">
132
- <tr>
133
- <td colspan="2"><?php echo "<h2>" . __( "Permissions", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
134
- </tr>
135
- <tr>
136
- <td class="roles gadwp-settings-title">
137
- <label for="access_front"><?php _e("Show stats to:", 'google-analytics-dashboard-for-wp' ); ?>
138
- </label>
139
- </td>
140
- <td class="gadwp-settings-roles">
141
- <table>
142
- <tr>
143
- <?php if ( ! isset( $wp_roles ) ) : ?>
144
- <?php $wp_roles = new WP_Roles(); ?>
145
- <?php endif; ?>
146
- <?php $i = 0; ?>
147
- <?php foreach ( $wp_roles->role_names as $role => $name ) : ?>
148
- <?php if ( 'subscriber' != $role ) : ?>
149
- <?php $i++; ?>
150
- <td>
151
- <label>
152
- <input type="checkbox" name="options[access_front][]" value="<?php echo $role; ?>" <?php if ( in_array($role,$options['access_front']) || 'administrator' == $role ) echo 'checked="checked"'; if ( 'administrator' == $role ) echo 'disabled="disabled"';?> /><?php echo $name; ?>
153
- </label>
154
- </td>
155
- <?php endif; ?>
156
- <?php if ( 0 == $i % 4 ) : ?>
157
- </tr>
158
- <tr>
159
- <?php endif; ?>
160
- <?php endforeach; ?>
161
- </table>
162
- </td>
163
- </tr>
164
- <tr>
165
- <td colspan="2" class="gadwp-settings-title">
166
- <div class="button-primary gadwp-settings-switchoo">
167
- <input type="checkbox" name="options[frontend_item_reports]" value="1" class="gadwp-settings-switchoo-checkbox" id="frontend_item_reports" <?php checked( $options['frontend_item_reports'], 1 ); ?>>
168
- <label class="gadwp-settings-switchoo-label" for="frontend_item_reports">
169
- <div class="gadwp-settings-switchoo-inner"></div>
170
- <div class="gadwp-settings-switchoo-switch"></div>
171
- </label>
172
- </div>
173
- <div class="switch-desc"><?php echo " ".__("enable web page reports on frontend", 'google-analytics-dashboard-for-wp' );?></div>
174
- </td>
175
- </tr>
176
- <tr>
177
- <td colspan="2">
178
- <hr>
179
- </td>
180
- </tr>
181
- <tr>
182
- <td colspan="2" class="submit">
183
- <input type="submit" name="Submit" class="button button-primary" value="<?php _e('Save Changes', 'google-analytics-dashboard-for-wp' ) ?>" />
184
- </td>
185
- </tr>
186
- </table>
187
- <input type="hidden" name="options[gadwp_hidden]" value="Y">
188
- <?php wp_nonce_field('gadwp_form','gadwp_security');?>
189
-
190
-
191
-
192
-
193
-
194
-
195
- </form>
196
- <?php
197
- self::output_sidebar();
198
- }
199
-
200
- public static function backend_settings() {
201
- $gadwp = GADWP();
202
- if ( ! current_user_can( 'manage_options' ) ) {
203
- return;
204
- }
205
- $options = self::update_options( 'backend' );
206
- if ( isset( $_POST['options']['gadwp_hidden'] ) ) {
207
- $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
208
- if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) {
209
- $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "You don’t have permission to do this.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
210
- }
211
- }
212
- if ( ! $gadwp->config->options['tableid_jail'] || ! $gadwp->config->options['token'] ) {
213
- $message = sprintf( '<div class="error"><p>%s</p></div>', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );
214
- }
215
- ?>
216
- <form name="gadwp_form" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
217
- <div class="wrap">
218
- <?php echo "<h2>" . __( "Google Analytics Backend Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?><hr>
219
- </div>
220
- <div id="poststuff" class="gadwp">
221
- <div id="post-body" class="metabox-holder columns-2">
222
- <div id="post-body-content">
223
- <div class="settings-wrapper">
224
- <div class="inside">
225
- <?php if (isset($message)) echo $message; ?>
226
- <table class="gadwp-settings-options">
227
- <tr>
228
- <td colspan="2"><?php echo "<h2>" . __( "Permissions", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
229
- </tr>
230
- <tr>
231
- <td class="roles gadwp-settings-title">
232
- <label for="access_back"><?php _e("Show stats to:", 'google-analytics-dashboard-for-wp' ); ?>
233
- </label>
234
- </td>
235
- <td class="gadwp-settings-roles">
236
- <table>
237
- <tr>
238
- <?php if ( ! isset( $wp_roles ) ) : ?>
239
- <?php $wp_roles = new WP_Roles(); ?>
240
- <?php endif; ?>
241
- <?php $i = 0; ?>
242
- <?php foreach ( $wp_roles->role_names as $role => $name ) : ?>
243
- <?php if ( 'subscriber' != $role ) : ?>
244
- <?php $i++; ?>
245
- <td>
246
- <label>
247
- <input type="checkbox" name="options[access_back][]" value="<?php echo $role; ?>" <?php if ( in_array($role,$options['access_back']) || 'administrator' == $role ) echo 'checked="checked"'; if ( 'administrator' == $role ) echo 'disabled="disabled"';?> /> <?php echo $name; ?>
248
- </label>
249
- </td>
250
- <?php endif; ?>
251
- <?php if ( 0 == $i % 4 ) : ?>
252
- </tr>
253
- <tr>
254
- <?php endif; ?>
255
- <?php endforeach; ?>
256
-
257
-
258
-
259
-
260
-
261
-
262
- </table>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td colspan="2" class="gadwp-settings-title">
267
- <div class="button-primary gadwp-settings-switchoo">
268
- <input type="checkbox" name="options[switch_profile]" value="1" class="gadwp-settings-switchoo-checkbox" id="switch_profile" <?php checked( $options['switch_profile'], 1 ); ?>>
269
- <label class="gadwp-settings-switchoo-label" for="switch_profile">
270
- <div class="gadwp-settings-switchoo-inner"></div>
271
- <div class="gadwp-settings-switchoo-switch"></div>
272
- </label>
273
- </div>
274
- <div class="switch-desc"><?php _e ( "enable Switch View functionality", 'google-analytics-dashboard-for-wp' );?></div>
275
- </td>
276
- </tr>
277
- <tr>
278
- <td colspan="2" class="gadwp-settings-title">
279
- <div class="button-primary gadwp-settings-switchoo">
280
- <input type="checkbox" name="options[backend_item_reports]" value="1" class="gadwp-settings-switchoo-checkbox" id="backend_item_reports" <?php checked( $options['backend_item_reports'], 1 ); ?>>
281
- <label class="gadwp-settings-switchoo-label" for="backend_item_reports">
282
- <div class="gadwp-settings-switchoo-inner"></div>
283
- <div class="gadwp-settings-switchoo-switch"></div>
284
- </label>
285
- </div>
286
- <div class="switch-desc"><?php _e ( "enable reports on Posts List and Pages List", 'google-analytics-dashboard-for-wp' );?></div>
287
- </td>
288
- </tr>
289
- <tr>
290
- <td colspan="2" class="gadwp-settings-title">
291
- <div class="button-primary gadwp-settings-switchoo">
292
- <input type="checkbox" name="options[dashboard_widget]" value="1" class="gadwp-settings-switchoo-checkbox" id="dashboard_widget" <?php checked( $options['dashboard_widget'], 1 ); ?>>
293
- <label class="gadwp-settings-switchoo-label" for="dashboard_widget">
294
- <div class="gadwp-settings-switchoo-inner"></div>
295
- <div class="gadwp-settings-switchoo-switch"></div>
296
- </label>
297
- </div>
298
- <div class="switch-desc"><?php _e ( "enable the main Dashboard Widget", 'google-analytics-dashboard-for-wp' );?></div>
299
- </td>
300
- </tr>
301
- <tr>
302
- <td colspan="2">
303
- <hr><?php echo "<h2>" . __( "Real-Time Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
304
- </tr>
305
- <?php if ( $options['user_api'] ) : ?>
306
- <tr>
307
- <td colspan="2" class="gadwp-settings-title">
308
- <div class="button-primary gadwp-settings-switchoo">
309
- <input type="checkbox" name="options[backend_realtime_report]" value="1" class="gadwp-settings-switchoo-checkbox" id="backend_realtime_report" <?php checked( $options['backend_realtime_report'], 1 ); ?>>
310
- <label class="gadwp-settings-switchoo-label" for="backend_realtime_report">
311
- <div class="gadwp-settings-switchoo-inner"></div>
312
- <div class="gadwp-settings-switchoo-switch"></div>
313
- </label>
314
- </div>
315
- <div class="switch-desc"><?php _e ( "enable Real-Time report (requires access to Real-Time Reporting API)", 'google-analytics-dashboard-for-wp' );?></div>
316
- </td>
317
- </tr>
318
- <?php endif; ?>
319
- <tr>
320
- <td colspan="2" class="gadwp-settings-title"> <?php _e("Maximum number of pages to display on real-time tab:", 'google-analytics-dashboard-for-wp'); ?>
321
- <input type="number" name="options[ga_realtime_pages]" id="ga_realtime_pages" value="<?php echo (int)$options['ga_realtime_pages']; ?>" size="3">
322
- </td>
323
- </tr>
324
- <tr>
325
- <td colspan="2">
326
- <hr><?php echo "<h2>" . __( "Location Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
327
- </tr>
328
- <tr>
329
- <td colspan="2" class="gadwp-settings-title">
330
- <?php echo __("Target Geo Map to country:", 'google-analytics-dashboard-for-wp'); ?>
331
- <input type="text" style="text-align: center;" name="options[ga_target_geomap]" value="<?php echo esc_attr($options['ga_target_geomap']); ?>" size="3">
332
- </td>
333
- </tr>
334
- <tr>
335
- <td colspan="2" class="gadwp-settings-title">
336
- <?php echo __("Maps API Key:", 'google-analytics-dashboard-for-wp'); ?>
337
- <input type="text" style="text-align: center;" name="options[maps_api_key]" value="<?php echo esc_attr($options['maps_api_key']); ?>" size="50">
338
- </td>
339
- </tr>
340
- <tr>
341
- <td colspan="2">
342
- <hr><?php echo "<h2>" . __( "404 Errors Report", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
343
- </tr>
344
- <tr>
345
- <td colspan="2" class="gadwp-settings-title">
346
- <?php echo __("404 Page Title contains:", 'google-analytics-dashboard-for-wp'); ?>
347
- <input type="text" style="text-align: center;" name="options[pagetitle_404]" value="<?php echo esc_attr($options['pagetitle_404']); ?>" size="20">
348
- </td>
349
- </tr>
350
- <tr>
351
- <td colspan="2">
352
- <hr>
353
- </td>
354
- </tr>
355
- <?php if ( ! is_multisite()) :?>
356
- <tr>
357
- <td colspan="2"><?php echo "<h2>" . __( "Hide Announcements", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
358
- </tr>
359
- <tr>
360
- <td colspan="2" class="gadwp-settings-title">
361
- <div class="button-primary gadwp-settings-switchoo">
362
- <input type="checkbox" name="options[hide_am_notices]" value="1" class="gadwp-settings-switchoo-checkbox" id="hide_am_notices" <?php checked( $options['hide_am_notices'], 1 ); ?>>
363
- <label class="gadwp-settings-switchoo-label" for="hide_am_notices">
364
- <div class="gadwp-settings-switchoo-inner"></div>
365
- <div class="gadwp-settings-switchoo-switch"></div>
366
- </label>
367
- </div>
368
- <div class="switch-desc"><?php echo esc_html__( 'Hides plugin announcements and update details. This includes critical notices we use to inform about deprecations and important required configuration changes.' ); ?></div>
369
- </td>
370
- </tr>
371
- <tr>
372
- <td colspan="2">
373
- <hr>
374
- </td>
375
- </tr>
376
- <?php endif; ?>
377
- <tr>
378
- <td colspan="2" class="submit">
379
- <input type="submit" name="Submit" class="button button-primary" value="<?php _e('Save Changes', 'google-analytics-dashboard-for-wp' ) ?>" />
380
- </td>
381
- </tr>
382
- </table>
383
- <input type="hidden" name="options[gadwp_hidden]" value="Y">
384
- <?php wp_nonce_field('gadwp_form','gadwp_security'); ?>
385
-
386
-
387
-
388
-
389
-
390
-
391
- </form>
392
- <?php
393
- self::output_sidebar();
394
- }
395
-
396
- public static function tracking_settings() {
397
- $gadwp = GADWP();
398
-
399
- if ( ! current_user_can( 'manage_options' ) ) {
400
- return;
401
- }
402
- $options = self::update_options( 'tracking' );
403
- if ( isset( $_POST['options']['gadwp_hidden'] ) ) {
404
- $message = "<div class='updated' id='gadwp-autodismiss'><p>" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
405
- if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) {
406
- $message = "<div class='error' id='gadwp-autodismiss'><p>" . __( "You don’t have permission to do this.", 'google-analytics-dashboard-for-wp' ) . "</p></div>";
407
- }
408
- }
409
- if ( ! $gadwp->config->options['tableid_jail'] ) {
410
- $message = sprintf( '<div class="error"><p>%s</p></div>', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '<a href="%1$s">%2$s</a>', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );
411
- }
412
- ?>
413
- <form name="gadwp_form" method="post" action="<?php esc_url($_SERVER['REQUEST_URI']); ?>">
414
- <div class="wrap">
415
- <?php echo "<h2>" . __( "Google Analytics Tracking Code", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?>
416
- </div>
417
- <div id="poststuff" class="gadwp">
418
- <div id="post-body" class="metabox-holder columns-2">
419
- <div id="post-body-content">
420
- <div class="settings-wrapper">
421
- <div class="inside">
422
- <?php if ( 'universal' == $options['tracking_type'] ) :?>
423
- <?php $tabs = array( 'basic' => __( "Basic Settings", 'google-analytics-dashboard-for-wp' ), 'events' => __( "Events Tracking", 'google-analytics-dashboard-for-wp' ), 'custom' => __( "Custom Definitions", 'google-analytics-dashboard-for-wp' ), 'exclude' => __( "Exclude Tracking", 'google-analytics-dashboard-for-wp' ), 'advanced' => __( "Advanced Settings", 'google-analytics-dashboard-for-wp' ), 'integration' => __( "Integration", 'google-analytics-dashboard-for-wp' ) );?>
424
- <?php elseif ( 'tagmanager' == $options['tracking_type'] ) :?>
425
- <?php $tabs = array( 'basic' => __( "Basic Settings", 'google-analytics-dashboard-for-wp' ), 'tmdatalayervars' => __( "DataLayer Variables", 'google-analytics-dashboard-for-wp' ), 'exclude' => __( "Exclude Tracking", 'google-analytics-dashboard-for-wp' ), 'tmadvanced' => __( "Advanced Settings", 'google-analytics-dashboard-for-wp' ), 'tmintegration' => __( "Integration", 'google-analytics-dashboard-for-wp' ) );?>
426
- <?php else :?>
427
- <?php $tabs = array( 'basic' => __( "Basic Settings", 'google-analytics-dashboard-for-wp' ) );?>
428
- <?php endif; ?>
429
- <?php self::navigation_tabs( $tabs ); ?>
430
- <?php if ( isset( $message ) ) : ?>
431
- <?php echo $message; ?>
432
- <?php endif; ?>
433
- <div id="gadwp-basic">
434
- <table class="gadwp-settings-options">
435
- <tr>
436
- <td colspan="2"><?php echo "<h2>" . __( "Tracking Settings", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
437
- </tr>
438
- <tr>
439
- <td class="gadwp-settings-title">
440
- <label for="tracking_type"><?php _e("Tracking Type:", 'google-analytics-dashboard-for-wp' ); ?>
441
- </label>
442
- </td>
443
- <td>
444
- <select id="tracking_type" name="options[tracking_type]" onchange="this.form.submit()">
445
- <option value="universal" <?php selected( $options['tracking_type'], 'universal' ); ?>><?php _e("Analytics", 'google-analytics-dashboard-for-wp');?></option>
446
- <option value="tagmanager" <?php selected( $options['tracking_type'], 'tagmanager' ); ?>><?php _e("Tag Manager", 'google-analytics-dashboard-for-wp');?></option>
447
- <option value="disabled" <?php selected( $options['tracking_type'], 'disabled' ); ?>><?php _e("Disabled", 'google-analytics-dashboard-for-wp');?></option>
448
- </select>
449
- </td>
450
- </tr>
451
- <?php if ( 'universal' == $options['tracking_type'] ) : ?>
452
- <tr>
453
- <td class="gadwp-settings-title"></td>
454
- <td>
455
- <?php $profile_info = GADWP_Tools::get_selected_profile($gadwp->config->options['ga_profiles_list'], $gadwp->config->options['tableid_jail']); ?>
456
- <?php echo '<pre>' . __("View Name:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[0]) . "<br />" . __("Tracking ID:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[2]) . "<br />" . __("Default URL:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[3]) . "<br />" . __("Time Zone:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[5]) . '</pre>';?>
457
- </td>
458
- </tr>
459
- <tr>
460
- <td colspan="2" class="gadwp-settings-title">
461
- <div class="button-primary gadwp-settings-switchoo">
462
- <input type="checkbox" name="options[ga_with_gtag]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_with_gtag" <?php checked( $options['ga_with_gtag'], 1 ); ?>>
463
- <label class="gadwp-settings-switchoo-label" for="ga_with_gtag">
464
- <div class="gadwp-settings-switchoo-inner"></div>
465
- <div class="gadwp-settings-switchoo-switch"></div>
466
- </label>
467
- </div>
468
- <div class="switch-desc"><?php echo " ".__("use global site tag gtag.js (not recommended)", 'google-analytics-dashboard-for-wp' );?></div>
469
- </td>
470
- </tr>
471
- <?php elseif ( 'tagmanager' == $options['tracking_type'] ) : ?>
472
- <tr>
473
- <td class="gadwp-settings-title">
474
- <label for="tracking_type"><?php _e("Web Container ID:", 'google-analytics-dashboard-for-wp' ); ?>
475
- </label>
476
- </td>
477
- <td>
478
- <input type="text" name="options[web_containerid]" value="<?php echo esc_attr($options['web_containerid']); ?>" size="15">
479
- </td>
480
- </tr>
481
- <?php endif; ?>
482
- <tr>
483
- <td class="gadwp-settings-title">
484
- <label for="trackingcode_infooter"><?php _e("Code Placement:", 'google-analytics-dashboard-for-wp' ); ?>
485
- </label>
486
- </td>
487
- <td>
488
- <select id="trackingcode_infooter" name="options[trackingcode_infooter]">
489
- <option value="0" <?php selected( $options['trackingcode_infooter'], 0 ); ?>><?php _e("HTML Head", 'google-analytics-dashboard-for-wp');?></option>
490
- <option value="1" <?php selected( $options['trackingcode_infooter'], 1 ); ?>><?php _e("HTML Body", 'google-analytics-dashboard-for-wp');?></option>
491
- </select>
492
- </td>
493
- </tr>
494
- </table>
495
- </div>
496
- <div id="gadwp-events">
497
- <table class="gadwp-settings-options">
498
- <tr>
499
- <td colspan="2"><?php echo "<h2>" . __( "Events Tracking", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
500
- </tr>
501
- <tr>
502
- <td colspan="2" class="gadwp-settings-title">
503
- <div class="button-primary gadwp-settings-switchoo">
504
- <input type="checkbox" name="options[ga_event_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_event_tracking" <?php checked( $options['ga_event_tracking'], 1 ); ?>>
505
- <label class="gadwp-settings-switchoo-label" for="ga_event_tracking">
506
- <div class="gadwp-settings-switchoo-inner"></div>
507
- <div class="gadwp-settings-switchoo-switch"></div>
508
- </label>
509
- </div>
510
- <div class="switch-desc"><?php echo " ".__("track downloads, mailto, telephone and outbound links", 'google-analytics-dashboard-for-wp' ); ?></div>
511
- </td>
512
- </tr>
513
- <tr>
514
- <td colspan="2" class="gadwp-settings-title">
515
- <div class="button-primary gadwp-settings-switchoo">
516
- <input type="checkbox" name="options[ga_aff_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_aff_tracking" <?php checked( $options['ga_aff_tracking'], 1 ); ?>>
517
- <label class="gadwp-settings-switchoo-label" for="ga_aff_tracking">
518
- <div class="gadwp-settings-switchoo-inner"></div>
519
- <div class="gadwp-settings-switchoo-switch"></div>
520
- </label>
521
- </div>
522
- <div class="switch-desc"><?php echo " ".__("track affiliate links", 'google-analytics-dashboard-for-wp' ); ?></div>
523
- </td>
524
- </tr>
525
- <tr>
526
- <td colspan="2" class="gadwp-settings-title">
527
- <div class="button-primary gadwp-settings-switchoo">
528
- <input type="checkbox" name="options[ga_hash_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_hash_tracking" <?php checked( $options['ga_hash_tracking'], 1 ); ?>>
529
- <label class="gadwp-settings-switchoo-label" for="ga_hash_tracking">
530
- <div class="gadwp-settings-switchoo-inner"></div>
531
- <div class="gadwp-settings-switchoo-switch"></div>
532
- </label>
533
- </div>
534
- <div class="switch-desc"><?php echo " ".__("track fragment identifiers, hashmarks (#) in URI links", 'google-analytics-dashboard-for-wp' ); ?></div>
535
- </td>
536
- </tr>
537
- <tr>
538
- <td colspan="2" class="gadwp-settings-title">
539
- <div class="button-primary gadwp-settings-switchoo">
540
- <input type="checkbox" name="options[ga_formsubmit_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_formsubmit_tracking" <?php checked( $options['ga_formsubmit_tracking'], 1 ); ?>>
541
- <label class="gadwp-settings-switchoo-label" for="ga_formsubmit_tracking">
542
- <div class="gadwp-settings-switchoo-inner"></div>
543
- <div class="gadwp-settings-switchoo-switch"></div>
544
- </label>
545
- </div>
546
- <div class="switch-desc"><?php echo " ".__("track form submit actions", 'google-analytics-dashboard-for-wp' ); ?></div>
547
- </td>
548
- </tr>
549
- <tr>
550
- <td colspan="2" class="gadwp-settings-title">
551
- <div class="button-primary gadwp-settings-switchoo">
552
- <input type="checkbox" name="options[ga_pagescrolldepth_tracking]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_pagescrolldepth_tracking" <?php checked( $options['ga_pagescrolldepth_tracking'], 1 ); ?>>
553
- <label class="gadwp-settings-switchoo-label" for="ga_pagescrolldepth_tracking">
554
- <div class="gadwp-settings-switchoo-inner"></div>
555
- <div class="gadwp-settings-switchoo-switch"></div>
556
- </label>
557
- </div>
558
- <div class="switch-desc"><?php echo " ".__("track page scrolling depth", 'google-analytics-dashboard-for-wp' ); ?></div>
559
- </td>
560
- </tr>
561
- <tr>
562
- <td class="gadwp-settings-title">
563
- <label for="ga_event_downloads"><?php _e("Downloads Regex:", 'google-analytics-dashboard-for-wp'); ?>
564
- </label>
565
- </td>
566
- <td>
567
- <input type="text" id="ga_event_downloads" name="options[ga_event_downloads]" value="<?php echo esc_attr($options['ga_event_downloads']); ?>" size="50">
568
- </td>
569
- </tr>
570
- <tr>
571
- <td class="gadwp-settings-title">
572
- <label for="ga_event_affiliates"><?php _e("Affiliates Regex:", 'google-analytics-dashboard-for-wp'); ?>
573
- </label>
574
- </td>
575
- <td>
576
- <input type="text" id="ga_event_affiliates" name="options[ga_event_affiliates]" value="<?php echo esc_attr($options['ga_event_affiliates']); ?>" size="50">
577
- </td>
578
- </tr>
579
- <tr>
580
- <td class="gadwp-settings-title">
581
- <label for="trackingevents_infooter"><?php _e("Code Placement:", 'google-analytics-dashboard-for-wp' ); ?>
582
- </label>
583
- </td>
584
- <td>
585
- <select id="trackingevents_infooter" name="options[trackingevents_infooter]">
586
- <option value="0" <?php selected( $options['trackingevents_infooter'], 0 ); ?>><?php _e("HTML Head", 'google-analytics-dashboard-for-wp');?></option>
587
- <option value="1" <?php selected( $options['trackingevents_infooter'], 1 ); ?>><?php _e("HTML Body", 'google-analytics-dashboard-for-wp');?></option>
588
- </select>
589
- </td>
590
- </tr>
591
- </table>
592
- </div>
593
- <div id="gadwp-custom">
594
- <table class="gadwp-settings-options">
595
- <tr>
596
- <td colspan="2"><?php echo "<h2>" . __( "Custom Dimensions", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
597
- </tr>
598
- <tr>
599
- <td class="gadwp-settings-title">
600
- <label for="ga_author_dimindex"><?php _e("Authors:", 'google-analytics-dashboard-for-wp' ); ?>
601
- </label>
602
- </td>
603
- <td>
604
- <select id="ga_author_dimindex" name="options[ga_author_dimindex]">
605
- <?php for ($i=0;$i<21;$i++) : ?>
606
- <option value="<?php echo $i;?>" <?php selected( $options['ga_author_dimindex'], $i ); ?>><?php echo 0 == $i ?'Disabled':'dimension '.$i; ?></option>
607
- <?php endfor; ?>
608
- </select>
609
- </td>
610
- </tr>
611
- <tr>
612
- <td class="gadwp-settings-title">
613
- <label for="ga_pubyear_dimindex"><?php _e("Publication Year:", 'google-analytics-dashboard-for-wp' ); ?>
614
- </label>
615
- </td>
616
- <td>
617
- <select id="ga_pubyear_dimindex" name="options[ga_pubyear_dimindex]">
618
- <?php for ($i=0;$i<21;$i++) : ?>
619
- <option value="<?php echo $i;?>" <?php selected( $options['ga_pubyear_dimindex'], $i ); ?>><?php echo 0 == $i ?'Disabled':'dimension '.$i; ?></option>
620
- <?php endfor; ?>
621
- </select>
622
- </td>
623
- </tr>
624
- <tr>
625
- <td class="gadwp-settings-title">
626
- <label for="ga_pubyearmonth_dimindex"><?php _e("Publication Month:", 'google-analytics-dashboard-for-wp' ); ?>
627
- </label>
628
- </td>
629
- <td>
630
- <select id="ga_pubyearmonth_dimindex" name="options[ga_pubyearmonth_dimindex]">
631
- <?php for ($i=0;$i<21;$i++) : ?>
632
- <option value="<?php echo $i;?>" <?php selected( $options['ga_pubyearmonth_dimindex'], $i ); ?>><?php echo 0 == $i ?'Disabled':'dimension '.$i; ?></option>
633
- <?php endfor; ?>
634
- </select>
635
- </td>
636
- </tr>
637
- <tr>
638
- <td class="gadwp-settings-title">
639
- <label for="ga_category_dimindex"><?php _e("Categories:", 'google-analytics-dashboard-for-wp' ); ?>
640
- </label>
641
- </td>
642
- <td>
643
- <select id="ga_category_dimindex" name="options[ga_category_dimindex]">
644
- <?php for ($i=0;$i<21;$i++) : ?>
645
- <option value="<?php echo $i;?>" <?php selected( $options['ga_categ