GA Google Analytics - Version 20180303

Version Description

To upgrade GA Google Analytics, remove the old version and replace with the new version. Or just click "Update" from the Plugins screen and let WordPress do it for you automatically.

Note: uninstalling the plugin from the WP Plugins screen results in the removal of all settings from the WP database.

For more information, visit the GA Plugin Homepage.

Download this release

Release Info

Developer specialk
Plugin Icon 128x128 GA Google Analytics
Version 20180303
Comparing to
See all releases

Code changes from version 20171103 to 20180303

css/settings.css ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* GA Google Analytics */
2
+
3
+ .wp-admin .wrap .notice, .wp-admin .wrap .updated { margin: 8px 0 15px 0; }
4
+ .wp-admin .wrap .notice p, .wp-admin .wrap .updated p { margin: 7px 0; }
5
+
6
+ .wp-admin .gap-panel-overview {
7
+ padding: 0 15px 10px 100px; background-image: url(../img/gap-logo.jpg);
8
+ background-repeat: no-repeat; background-position: 15px 0; background-size: 80px 80px;
9
+ }
10
+ .wp-admin .gap-panel-usage .gap-caption { margin: 15px; }
11
+
12
+ .wp-admin .wrap h1 small { line-height: 12px; font-size: 12px; color: #bbb; }
13
+ .wp-admin .wrap h2 { margin: 0; padding: 12px 0 12px 15px; font-size: 16px; cursor: pointer; }
14
+ .wp-admin .wrap p { margin: 15px; }
15
+ .wp-admin .wrap ul { list-style-type: disc; }
16
+ .wp-admin .wrap ul,
17
+ .wp-admin .wrap ol { margin: 15px 15px 15px 40px; }
18
+ .wp-admin .wrap li { margin: 10px 0; }
19
+
20
+ .wp-admin .gap-panel-settings { margin: 0 15px 15px 15px; }
21
+ .wp-admin .gap-panel-settings table { border: 0; }
22
+ .wp-admin .gap-panel-settings th { width: 25%; vertical-align: middle; }
23
+ .wp-admin .gap-panel-settings td { padding: 15px; vertical-align: middle; }
24
+ .wp-admin .gap-panel-settings td input[type="checkbox"] { position: relative; top: -2px; }
25
+ .wp-admin .gap-panel-settings td textarea { box-sizing: border-box; width: 96%; }
26
+
27
+ .wp-admin .wrap .gap-radio-inputs { margin: 7px 0; }
28
+ .wp-admin .wrap .button-primary { margin: 0 0 15px 15px; }
29
+
30
+ .wp-admin .wrap .gap-caption { line-height: 18px; font-size: 12px; padding: 5px 0 0 0; opacity: 0.8; }
31
+ .wp-admin .wrap .gap-caption code { line-height: 18px; font-size: 12px; padding: 2px 3px; margin: 0; }
32
+ .wp-admin .wrap .gap-caption:hover { opacity: 0.9; }
33
+
34
+ .wp-admin .gap-note { opacity: 0.8; }
35
+ .wp-admin .gap-toggle-all { margin: 5px 0; }
36
+ .wp-admin .gap-credit-info { margin: -5px 0 0 3px; }
ga-google-analytics.php CHANGED
@@ -9,11 +9,11 @@
9
  Donate link: https://m0n.co/donate
10
  Contributors: specialk
11
  Requires at least: 4.1
12
- Tested up to: 4.9
13
- Stable tag: 20171103
14
- Version: 20171103
15
  Requires PHP: 5.2
16
- Text Domain: gap
17
  Domain Path: /languages
18
  License: GPL v2 or later
19
  */
@@ -32,614 +32,423 @@
32
  You should have received a copy of the GNU General Public License
33
  with this program. If not, visit: https://www.gnu.org/licenses/
34
 
35
- Copyright 2017 Monzilla Media. All rights reserved.
36
  */
37
 
38
  if (!defined('ABSPATH')) die();
39
 
40
- $gap_wp_vers = '4.1';
41
- $gap_version = '20171103';
42
- $gap_plugin = esc_html__('GA Google Analytics', 'gap');
43
- $gap_options = get_option('gap_options');
44
- $gap_path = plugin_basename(__FILE__); // 'ga-google-analytics/ga-google-analytics.php';
45
- $gap_homeurl = 'https://perishablepress.com/ga-google-analytics/';
46
-
47
- // i18n
48
- function gap_i18n_init() {
49
- load_plugin_textdomain('gap', false, dirname(plugin_basename(__FILE__)) .'/languages/');
50
- }
51
- add_action('plugins_loaded', 'gap_i18n_init');
52
-
53
- // require minimum version of WordPress
54
- function gap_require_wp_version() {
55
- global $gap_path, $gap_plugin, $gap_wp_vers;
56
- if (isset($_GET['activate']) && $_GET['activate'] == 'true') {
57
- $wp_version = get_bloginfo('version');
58
- if (version_compare($wp_version, $gap_wp_vers, '<')) {
59
- if (is_plugin_active($gap_path)) {
60
- deactivate_plugins($gap_path);
61
- $msg = '<strong>' . $gap_plugin . '</strong> ' . esc_html__('requires WordPress ', 'gap') . $gap_wp_vers . esc_html__(' or higher, and has been deactivated!', 'gap') . '<br />';
62
- $msg .= esc_html__('Please return to the ', 'gap') . '<a href="' . admin_url() . '">' . esc_html__('WordPress Admin area', 'gap') . '</a> ' . esc_html__('to upgrade WordPress and try again.', 'gap');
63
- wp_die($msg);
64
- }
65
- }
66
- }
67
- }
68
- add_action('admin_init', 'gap_require_wp_version');
69
-
70
- // Google Analytics Tracking Code
71
- function google_analytics_tracking_code() {
72
-
73
- $options = get_option('gap_options', array());
74
-
75
- extract($options);
76
-
77
- // universal
78
- $ga_display = "ga('require', 'displayfeatures');";
79
- $ga_link_uni = "ga('require', 'linkid', 'linkid.js');";
80
- $ga_anon_uni = "ga('set', 'anonymizeIP', true);";
81
- $ga_ssl_uni = "ga('set', 'forceSSL', true);";
82
-
83
- // classic
84
- $ga_alt = "('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';";
85
- $ga_src = "('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';";
86
- $ga_link_gaq = "var pluginUrl = '//www.google-analytics.com/plugins/ga/inpage_linkid.js';\n\t\t\t_gaq.push(['_require', 'inpage_linkid', pluginUrl]);";
87
- $ga_anon_gaq = "_gaq.push(['_gat._anonymizeIp']);";
88
- $ga_ssl_gaq = "_gaq.push(['_gat._forceSSL']);";
89
-
90
- $gap_custom_code = preg_replace("/%%userid%%/i", get_current_user_id(), $gap_custom_code);
91
- $gap_custom_code = apply_filters('gap_custom_code', $gap_custom_code);
92
-
93
- if ($gap_display_ads) $ga_src = $ga_alt;
94
 
95
- if ($gap_enable && (!is_user_logged_in() || !current_user_can('administrator') || (current_user_can('administrator') && !$disable_admin))) {
96
 
97
- if ($gap_custom && $gap_custom_loc) echo $gap_custom . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
 
99
- if ($gap_universal) { ?>
100
-
101
- <script>
102
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
103
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
104
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
105
- })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
106
- ga('create', '<?php echo $gap_id; ?>', 'auto'<?php if ($tracker_object) echo ", " . $tracker_object; ?>);
107
- <?php
108
- if ($gap_display_ads) echo $ga_display . "\n\t\t\t";
109
- if ($link_attr) echo $ga_link_uni . "\n\t\t\t";
110
- if ($gap_anonymize) echo $ga_anon_uni . "\n\t\t\t";
111
- if ($gap_force_ssl) echo $ga_ssl_uni . "\n\t\t\t";
112
- if ($gap_custom_code) echo $gap_custom_code . "\n\t\t\t";
113
- ?>ga('send', 'pageview');
114
- </script>
115
-
116
- <?php } else { ?>
117
-
118
- <script type="text/javascript">
119
- var _gaq = _gaq || [];
120
- <?php
121
- if ($link_attr) echo $ga_link_gaq . "\n\t\t\t";
122
- if ($gap_anonymize) echo $ga_anon_gaq . "\n\t\t\t";
123
- if ($gap_force_ssl) echo $ga_ssl_gaq . "\n\t\t\t";
124
- if ($gap_custom_code) echo $gap_custom_code . "\n\t\t\t";
125
- ?>_gaq.push(['_setAccount', '<?php echo $gap_id; ?>']);
126
- _gaq.push(['_trackPageview']);
127
- (function() {
128
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
129
- ga.src = <?php echo $ga_src . "\n"; ?>
130
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
131
- })();
132
- </script>
133
-
134
- <?php }
135
-
136
- if ($gap_custom && !$gap_custom_loc) echo $gap_custom . "\n";
137
-
138
- }
139
-
140
- }
141
-
142
- // include tracking code in header or footer
143
- if (isset($gap_options['gap_location']) && $gap_options['gap_location'] == 'header') {
144
- if (isset($gap_options['admin_area']) && $gap_options['admin_area']) {
145
- add_action('admin_head', 'google_analytics_tracking_code');
146
- }
147
- add_action('wp_head', 'google_analytics_tracking_code');
148
- } else {
149
- if (isset($gap_options['admin_area']) && $gap_options['admin_area']) {
150
- add_action('admin_footer', 'google_analytics_tracking_code');
151
- }
152
- add_action('wp_footer', 'google_analytics_tracking_code');
153
- }
154
-
155
-
156
-
157
- // display settings link on plugin page
158
- function gap_plugin_action_links($links, $file) {
159
- global $gap_path;
160
- if ($file == $gap_path) {
161
- $gap_links = '<a href="' . get_admin_url() . 'options-general.php?page=' . $gap_path . '">' . esc_html__('Settings', 'gap') .'</a>';
162
- array_unshift($links, $gap_links);
163
- }
164
- return $links;
165
- }
166
- add_filter ('plugin_action_links', 'gap_plugin_action_links', 10, 2);
167
-
168
- // rate plugin link
169
- function add_gap_links($links, $file) {
170
-
171
- if ($file == plugin_basename(__FILE__)) {
172
 
173
- $href = 'https://wordpress.org/support/plugin/ga-google-analytics/reviews/?rate=5#new-post';
174
- $title = esc_html__('Give us a 5-star rating at WordPress.org', 'gap');
175
- $text = esc_html__('Rate this plugin', 'gap') .'&nbsp;&raquo;';
 
 
176
 
177
- $links[] = '<a target="_blank" href="'. $href .'" title="'. $title .'">'. $text .'</a>';
 
 
 
 
 
 
 
178
 
179
- }
180
-
181
- return $links;
182
-
183
- }
184
- add_filter('plugin_row_meta', 'add_gap_links', 10, 2);
185
-
186
- // delete plugin settings
187
- function gap_delete_plugin_options() {
188
- delete_option('gap_options');
189
- }
190
- if ($gap_options['default_options'] == 1) {
191
- register_uninstall_hook (__FILE__, 'gap_delete_plugin_options');
192
- }
193
-
194
- // define default settings
195
- function gap_add_defaults() {
196
- $tmp = get_option('gap_options');
197
- if(($tmp['default_options'] == '1') || (!is_array($tmp))) {
198
- $arr = array(
199
- 'gap_id' => 'UA-XXXXX-X',
200
- 'gap_location' => 'header',
201
- 'version_alert' => 0,
202
- 'default_options' => 0,
203
- 'gap_enable' => 0,
204
- 'gap_universal' => 0,
205
- 'gap_display_ads' => 0,
206
- 'link_attr' => 0,
207
- 'gap_anonymize' => 0,
208
- 'gap_force_ssl' => 0,
209
- 'admin_area' => 0,
210
- 'disable_admin' => 0,
211
- 'gap_custom_loc' => 0,
212
- 'tracker_object' => '',
213
- 'gap_custom_code' => '',
214
- 'gap_custom' => '',
215
- );
216
- update_option('gap_options', $arr);
217
- }
218
- }
219
- register_activation_hook (__FILE__, 'gap_add_defaults');
220
-
221
- // whitelist settings
222
- function gap_init() {
223
- register_setting('gap_plugin_options', 'gap_options', 'gap_validate_options');
224
- }
225
- add_action ('admin_init', 'gap_init');
226
-
227
- // sanitize and validate input
228
- function gap_validate_options($input) {
229
-
230
- global $gap_location;
231
-
232
- $input['gap_id'] = wp_filter_nohtml_kses($input['gap_id']);
233
-
234
- if (!isset($input['gap_location'])) $input['gap_location'] = null;
235
- if (!array_key_exists($input['gap_location'], $gap_location)) $input['gap_location'] = null;
236
-
237
- if (!isset($input['version_alert'])) $input['version_alert'] = null;
238
- $input['version_alert'] = ($input['version_alert'] == 1 ? 1 : 0);
239
-
240
- if (!isset($input['default_options'])) $input['default_options'] = null;
241
- $input['default_options'] = ($input['default_options'] == 1 ? 1 : 0);
242
-
243
- if (!isset($input['gap_enable'])) $input['gap_enable'] = null;
244
- $input['gap_enable'] = ($input['gap_enable'] == 1 ? 1 : 0);
245
-
246
- if (!isset($input['gap_universal'])) $input['gap_universal'] = null;
247
- $input['gap_universal'] = ($input['gap_universal'] == 1 ? 1 : 0);
248
-
249
- if (!isset($input['gap_display_ads'])) $input['gap_display_ads'] = null;
250
- $input['gap_display_ads'] = ($input['gap_display_ads'] == 1 ? 1 : 0);
251
-
252
- if (!isset($input['link_attr'])) $input['link_attr'] = null;
253
- $input['link_attr'] = ($input['link_attr'] == 1 ? 1 : 0);
254
-
255
- if (!isset($input['gap_anonymize'])) $input['gap_anonymize'] = null;
256
- $input['gap_anonymize'] = ($input['gap_anonymize'] == 1 ? 1 : 0);
257
-
258
- if (!isset($input['gap_force_ssl'])) $input['gap_force_ssl'] = null;
259
- $input['gap_force_ssl'] = ($input['gap_force_ssl'] == 1 ? 1 : 0);
260
-
261
- if (!isset($input['admin_area'])) $input['admin_area'] = null;
262
- $input['admin_area'] = ($input['admin_area'] == 1 ? 1 : 0);
263
-
264
- if (!isset($input['disable_admin'])) $input['disable_admin'] = null;
265
- $input['disable_admin'] = ($input['disable_admin'] == 1 ? 1 : 0);
266
-
267
- if (!isset($input['gap_custom_loc'])) $input['gap_custom_loc'] = null;
268
- $input['gap_custom_loc'] = ($input['gap_custom_loc'] == 1 ? 1 : 0);
269
-
270
- if (isset($input['tracker_object'])) $input['tracker_object'] = stripslashes(trim($input['tracker_object']));
271
-
272
- if (isset($input['gap_custom_code'])) $input['gap_custom_code'] = stripslashes(trim($input['gap_custom_code']));
273
-
274
- if (isset($input['gap_custom'])) $input['gap_custom'] = stripslashes(trim($input['gap_custom']));
275
-
276
- return $input;
277
-
278
- }
279
-
280
- // define dropdown options
281
- $gap_location = array(
282
- 'header' => array(
283
- 'value' => 'header',
284
- 'label' => esc_html__('Include code in the document head (via wp_head)', 'gap')
285
- ),
286
- 'footer' => array(
287
- 'value' => 'footer',
288
- 'label' => esc_html__('Include code in the document footer (via wp_footer)', 'gap')
289
- ),
290
- );
291
-
292
- // add the options page
293
- function gap_add_options_page() {
294
- global $gap_plugin;
295
- add_options_page($gap_plugin, 'Google Analytics', 'manage_options', __FILE__, 'gap_render_form');
296
- }
297
- add_action ('admin_menu', 'gap_add_options_page');
298
-
299
- // create the options page
300
- function gap_render_form() {
301
-
302
- global $gap_plugin, $gap_options, $gap_path, $gap_homeurl, $gap_version, $gap_location;
303
-
304
- if (isset($gap_options['version_alert'])) $version_alert = $gap_options['version_alert'] ? true : false;
305
- if (isset($gap_options['gap_universal'])) $gap_universal = $gap_options['gap_universal'] ? true : false;
306
-
307
- $display_alert = (!$version_alert && !$gap_universal) ? ' style="display:block;"' : ' style="display:none;"';
308
-
309
- ?>
310
-
311
- <style type="text/css">
312
- .dismiss-alert { margin: 15px; }
313
- .dismiss-alert-wrap { display: inline-block; padding: 7px 0 10px 0; }
314
- .dismiss-alert .description { display: inline-block; margin: -2px 15px 0 0; }
315
- .mm-panel-overview {
316
- padding: 0 15px 10px 100px;
317
- background-image: url(<?php echo plugins_url(); ?>/ga-google-analytics/gap-logo.jpg);
318
- background-repeat: no-repeat; background-position: 15px 0; background-size: 80px 80px;
319
  }
320
- .mm-panel-usage { padding-bottom: 10px; }
 
321
 
322
- #mm-plugin-options h1 small { line-height: 12px; font-size: 12px; color: #bbb; }
323
- #mm-plugin-options h2 { margin: 0; padding: 12px 0 12px 15px; font-size: 16px; cursor: pointer; }
324
- #mm-plugin-options h3 { margin: 20px 15px; font-size: 14px; }
 
 
 
 
 
 
325
 
326
- #mm-plugin-options p { margin-left: 15px; }
327
- #mm-plugin-options p.mm-alt { margin: 15px 0; }
328
- #mm-plugin-options .mm-item-caption,
329
- #mm-plugin-options .mm-item-caption code { font-size: 11px; }
330
- #mm-plugin-options ul,
331
- #mm-plugin-options ol { margin: 15px 15px 15px 40px; }
332
- #mm-plugin-options li { margin: 10px 0; list-style-type: disc; }
333
- #mm-plugin-options abbr { cursor: help; border-bottom: 1px dotted #dfdfdf; }
 
 
 
 
 
334
 
335
- .mm-table-wrap { margin: 15px; }
336
- .mm-table-wrap td { padding: 15px; vertical-align: middle; }
337
- .mm-table-wrap .widefat td { vertical-align: middle; }
338
- .mm-table-wrap .widefat th { width: 25%; vertical-align: middle; }
339
- .mm-table-wrap td input[type="checkbox"] { position: relative; top: -2px; }
340
- .mm-table-wrap td textarea { width: 90%; }
341
- .mm-code { background-color: #fafae0; color: #333; font-size: 14px; }
342
- .mm-radio-inputs { margin: 7px 0; }
343
- .mm-radio-inputs span { padding-left: 5px; }
344
-
345
- #setting-error-settings_updated { margin: 8px 0 15px 0; }
346
- #setting-error-settings_updated p { margin: 7px 0; }
347
- #mm-plugin-options .button-primary { margin: 0 0 15px 15px; }
348
-
349
- #mm-panel-toggle { margin: 5px 0; }
350
- #mm-credit-info { margin-top: -5px; }
351
- </style>
352
-
353
- <div id="mm-plugin-options" class="wrap">
354
- <h1><?php echo $gap_plugin; ?> <small><?php echo 'v' . $gap_version; ?></small></h1>
355
- <div id="mm-panel-toggle"><a href="<?php get_admin_url() . 'options-general.php?page=' . $gap_path; ?>"><?php esc_html_e('Toggle all panels', 'gap'); ?></a></div>
356
 
357
- <form method="post" action="options.php">
358
- <?php $gap_options = get_option('gap_options'); settings_fields('gap_plugin_options'); ?>
359
-
360
- <div class="metabox-holder">
361
- <div class="meta-box-sortables ui-sortable">
362
-
363
- <div id="mm-panel-alert"<?php echo $display_alert; ?> class="postbox">
364
- <h2><?php esc_html_e('Important', 'gap'); ?></h2>
365
- <div class="toggle">
366
- <div class="mm-panel-alert">
367
- <p>
368
- <?php esc_html_e('Universal Analytics is now the standard for Google Analytics.', 'gap'); ?>
369
- <?php esc_html_e('Please read the following info and migrate by enabling Universal Analytics in the plugin settings.', 'gap'); ?>
370
- <?php esc_html_e('Universal Analytics will be the default setting in an future version of this plugin (probably in 2018).', 'gap'); ?>
371
- </p>
372
- <ul>
373
- <li><a target="_blank" href="https://developers.google.com/analytics/devguides/collection/analyticsjs/"><?php esc_html_e('Learn about Universal Analytics', 'gap'); ?></a></li>
374
- <li><a target="_blank" href="https://developers.google.com/analytics/devguides/collection/upgrade/"><?php esc_html_e('Universal Analytics Upgrade Center', 'gap'); ?></a></li>
375
- </ul>
376
- <div class="dismiss-alert">
377
- <div class="dismiss-alert-wrap">
378
- <input class="input-alert" name="gap_options[version_alert]" type="checkbox" value="1" <?php if (isset($gap_options['version_alert'])) checked('1', $gap_options['version_alert']); ?> />
379
- <label class="description" for="gap_options[version_alert]"><?php esc_html_e('Dismiss notice', 'gap') ?></label>
380
- </div>
381
- </div>
382
- </div>
383
- </div>
384
- </div>
385
 
386
- <div id="mm-panel-overview" class="postbox">
387
- <h2><?php esc_html_e('Overview', 'gap'); ?></h2>
388
- <div class="toggle<?php if (isset($_GET["settings-updated"])) { echo ' default-hidden'; } ?>">
389
- <div class="mm-panel-overview">
390
- <p><?php esc_html_e('This plugin adds the GA Tracking Code to your site. Log in to your Google account to view your stats.', 'gap'); ?></p>
391
- <ul>
392
- <li><a id="mm-panel-usage-link" href="#mm-panel-usage"><?php esc_html_e('How to Use', 'gap'); ?></a></li>
393
- <li><a id="mm-panel-primary-link" href="#mm-panel-primary"><?php esc_html_e('Plugin Settings', 'gap'); ?></a></li>
394
- <li><a target="_blank" href="https://wordpress.org/support/plugin/ga-google-analytics"><?php esc_html_e('Plugin Homepage', 'gap'); ?></a></li>
395
- </ul>
396
- <p>
397
- <?php esc_html_e('If you like this plugin, please', 'gap'); ?>
398
- <a target="_blank" href="https://wordpress.org/support/plugin/ga-google-analytics/reviews/?rate=5#new-post" title="<?php esc_attr_e('THANK YOU for your support!', 'gap'); ?>">
399
- <?php esc_html_e('give it a 5-star rating', 'gap'); ?>&nbsp;&raquo;
400
- </a>
401
- </p>
402
- </div>
403
- </div>
404
- </div>
405
 
406
- <div id="mm-panel-usage" class="postbox">
407
- <h2><?php esc_html_e('How to Use', 'gap'); ?></h2>
408
- <div class="toggle default-hidden">
409
- <div class="mm-panel-usage">
410
- <p><?php esc_html_e('How to use', 'gap'); ?> <?php echo $gap_plugin; ?>:</p>
411
- <ol>
412
- <li><?php esc_html_e('In the plugin settings, enter your GA Property ID.', 'gap'); ?></li>
413
- <li><?php esc_html_e('In the plugin settings, enable either "Legacy Analytics" or "Universal Analytics".', 'gap'); ?></li>
414
- <li><?php esc_html_e('Configure other settings (optional) as desired and save your changes.', 'gap'); ?></li>
415
- <li><?php esc_html_e('After 24-48 hours, you can log into your Google Analytics account to view your stats.', 'gap'); ?></li>
416
- </ol>
417
- <p>
418
- <small>
419
- <?php esc_html_e('Note that it can take 24-48 hours after adding the tracking code before any analytical data appears in your', 'gap'); ?>
420
- <a target="_blank" href="http://www.google.com/analytics/"><?php esc_html_e('Google Analytics account', 'gap'); ?></a>.
421
- <?php esc_html_e('To check that the GA tacking code is included, look at the source code of your web page(s). Learn more at the', 'gap'); ?>
422
- <a target="_blank" href="https://support.google.com/analytics/?hl=en#topic=3544906"><?php esc_html_e('Google Analytics Help Center', 'gap'); ?></a>.
423
- </small>
424
- </p>
425
- </div>
426
- </div>
427
- </div>
 
 
 
 
 
 
 
428
 
429
- <div id="mm-panel-primary" class="postbox">
430
- <h2><?php esc_html_e('Plugin Settings', 'gap'); ?></h2>
431
- <div class="toggle<?php if (!isset($_GET["settings-updated"])) { echo ' default-hidden'; } ?>">
432
- <p><?php esc_html_e('Enter your Tracking Code and choose your options.', 'gap'); ?></p>
433
- <div class="mm-table-wrap">
434
- <table class="widefat mm-table">
435
- <tr>
436
- <th scope="row"><label class="description" for="gap_options[gap_id]"><?php esc_html_e('GA Property ID', 'gap') ?></label></th>
437
- <td><input type="text" size="20" maxlength="20" name="gap_options[gap_id]" value="<?php echo $gap_options['gap_id']; ?>" /></td>
438
- </tr>
439
- <tr>
440
- <th scope="row"><label class="description" for="gap_options[gap_enable]"><?php esc_html_e('Enable Analytics', 'gap') ?></label></th>
441
- <td>
442
- <input name="gap_options[gap_enable]" type="checkbox" value="1" <?php if (isset($gap_options['gap_enable'])) checked('1', $gap_options['gap_enable']); ?> />
443
- <?php esc_html_e('Enable Google Analytics on your site. Uses', 'gap'); ?>
444
- <a target="_blank" href="http://code.google.com/apis/analytics/docs/tracking/asyncUsageGuide.html"><?php esc_html_e('Legacy Analytics', 'gap'); ?></a>
445
- <?php esc_html_e('by default. To use Universal Analytics, check this box and enable the next setting.', 'gap'); ?>
446
- </td>
447
- </tr>
448
- <tr>
449
- <th scope="row"><label class="description" for="gap_options[gap_universal]"><?php esc_html_e('Universal Analytics', 'gap') ?></label></th>
450
- <td>
451
- <input name="gap_options[gap_universal]" type="checkbox" value="1" <?php if (isset($gap_options['gap_universal'])) checked('1', $gap_options['gap_universal']); ?> />
452
- <?php esc_html_e('Enable', 'gap'); ?> <a target="_blank" href="https://developers.google.com/analytics/devguides/collection/analyticsjs/"><?php esc_html_e('Universal Analytics', 'gap'); ?></a>
453
- </td>
454
- </tr>
455
- <tr>
456
- <th scope="row"><label class="description" for="gap_options[gap_display_ads]"><?php esc_html_e('Display Advertising', 'gap') ?></label></th>
457
- <td>
458
- <input name="gap_options[gap_display_ads]" type="checkbox" value="1" <?php if (isset($gap_options['gap_display_ads'])) checked('1', $gap_options['gap_display_ads']); ?> />
459
- <?php esc_html_e('Enable support for', 'gap'); ?> <a target="_blank" href="https://support.google.com/analytics/answer/2444872"><?php esc_html_e('Display Advertising', 'gap'); ?></a>
460
- </td>
461
- </tr>
462
- <tr>
463
- <th scope="row"><label class="description" for="gap_options[link_attr]"><?php esc_html_e('Link Attribution', 'gap') ?></label></th>
464
- <td>
465
- <input name="gap_options[link_attr]" type="checkbox" value="1" <?php if (isset($gap_options['link_attr'])) checked('1', $gap_options['link_attr']); ?> />
466
- <?php esc_html_e('Enable support for', 'gap'); ?> <a target="_blank" href="https://support.google.com/analytics/answer/2558867?hl=en"><?php esc_html_e('Enhanced Link Attribution', 'gap'); ?></a>
467
- </td>
468
- </tr>
469
- <tr>
470
- <th scope="row"><label class="description" for="gap_options[gap_anonymize]"><?php esc_html_e('IP Anonymization', 'gap') ?></label></th>
471
- <td>
472
- <input name="gap_options[gap_anonymize]" type="checkbox" value="1" <?php if (isset($gap_options['gap_anonymize'])) checked('1', $gap_options['gap_anonymize']); ?> />
473
- <?php esc_html_e('Enable support for', 'gap'); ?> <a target="_blank" href="https://developers.google.com/analytics/devguides/collection/analyticsjs/ip-anonymization"><?php esc_html_e('IP Anonymization', 'gap'); ?></a>
474
- </td>
475
- </tr>
476
- <tr>
477
- <th scope="row"><label class="description" for="gap_options[gap_force_ssl]"><?php esc_html_e('Force SSL', 'gap') ?></label></th>
478
- <td>
479
- <input name="gap_options[gap_force_ssl]" type="checkbox" value="1" <?php if (isset($gap_options['gap_force_ssl'])) checked('1', $gap_options['gap_force_ssl']); ?> />
480
- <?php esc_html_e('Enable support for', 'gap'); ?> <a href="https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#forceSSL">Force SSL</a>
481
- </td>
482
- </tr>
483
- <tr>
484
- <th scope="row"><label class="description" for="gap_options[gap_location]"><?php esc_html_e('Code Location', 'gap'); ?></label></th>
485
- <td>
486
- <?php if (!isset($checked)) $checked = '';
487
- foreach ($gap_location as $gap_loc) {
488
- $radio_setting = $gap_options['gap_location'];
489
- if ('' != $radio_setting) {
490
- if ($gap_options['gap_location'] == $gap_loc['value']) {
491
- $checked = "checked=\"checked\"";
492
- } else {
493
- $checked = '';
494
- }
495
- } ?>
496
- <div class="mm-radio-inputs">
497
- <input type="radio" name="gap_options[gap_location]" value="<?php echo esc_attr($gap_loc['value']); ?>" <?php echo $checked; ?> />
498
- <span><?php echo $gap_loc['label']; ?></span>
499
- </div>
500
- <?php } ?>
501
- <div class="mm-item-caption">
502
- <?php esc_html_e('Tip: Google recommends including the Tracking Code in the document header, but including it in the footer can benefit page performance.', 'gap'); ?>
503
- <?php esc_html_e('If in doubt, go with the default option to include the code in the header.', 'gap'); ?>
504
- </div>
505
- </td>
506
- </tr>
507
- <tr>
508
- <th scope="row"><label class="description" for="gap_options[tracker_object]"><?php esc_html_e('Custom Tracker Objects', 'gap'); ?></label></th>
509
- <td>
510
- <textarea type="textarea" rows="5" cols="70" name="gap_options[tracker_object]"><?php if (isset($gap_options['tracker_object'])) echo esc_textarea($gap_options['tracker_object']); ?></textarea>
511
- <div class="mm-item-caption">
512
- <?php esc_html_e('Any code entered here will be added to the primary', 'gap'); ?>
513
- <code>ga('create')</code> <?php esc_html_e('function as the fourth parameter.', 'gap'); ?>
514
- <a target="_blank" href="https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers"><?php esc_html_e('Learn more about creating trackers', 'gap'); ?></a>.
515
- </div>
516
- </td>
517
- </tr>
518
- <tr>
519
- <th scope="row"><label class="description" for="gap_options[gap_custom_code]"><?php esc_html_e('Custom GA Code', 'gap'); ?></label></th>
520
- <td>
521
- <textarea type="textarea" rows="5" cols="70" name="gap_options[gap_custom_code]"><?php if (isset($gap_options['gap_custom_code'])) echo esc_textarea($gap_options['gap_custom_code']); ?></textarea>
522
- <div class="mm-item-caption">
523
- <?php esc_html_e('Any code entered here will be added to the GA code snippet. This is useful for things like', 'gap'); ?>
524
- <a target="_blank" href="https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers#working_with_multiple_trackers"><?php esc_html_e('creating multiple trackers', 'gap'); ?></a>
525
- <?php esc_html_e('and', 'gap'); ?> <a target="_blank" href="https://support.google.com/360suite/optimize/"><?php esc_html_e('Google Optimize', 'gap'); ?></a>.
526
- <?php esc_html_e('Can use', 'gap'); ?> <code>%%userid%%</code> <?php esc_html_e('to display the current user ID.', 'gap'); ?>
527
- </div>
528
- </td>
529
- </tr>
530
- <tr>
531
- <th scope="row"><label class="description" for="gap_options[gap_custom]"><?php esc_html_e('Custom', 'gap'); ?> <code>&lt;head&gt;</code> <?php esc_html_e('Code', 'gap'); ?></label></th>
532
- <td>
533
- <textarea type="textarea" rows="5" cols="70" name="gap_options[gap_custom]"><?php if (isset($gap_options['gap_custom'])) echo esc_textarea($gap_options['gap_custom']); ?></textarea>
534
- <div class="mm-item-caption">
535
- <?php esc_html_e('Here you may specify any markup to be displayed in the', 'gap'); ?> <code>&lt;head&gt;</code>
536
- <?php esc_html_e('section (or in the footer, depending on the "Code Location" setting, above).', 'gap'); ?>
537
- </div>
538
- </td>
539
- </tr>
540
- <tr>
541
- <th scope="row"><label class="description" for="gap_options[gap_custom_loc]"><?php esc_html_e('Custom', 'gap'); ?> <code>&lt;head&gt;</code> <?php esc_html_e('Location', 'gap'); ?></label></th>
542
- <td>
543
- <input name="gap_options[gap_custom_loc]" type="checkbox" value="1" <?php if (isset($gap_options['gap_custom_loc'])) checked('1', $gap_options['gap_custom_loc']); ?> />
544
- <?php esc_html_e('Display custom', 'gap'); ?> <code>&lt;head&gt;</code> <?php esc_html_e('code', 'gap'); ?> <em><?php esc_html_e('before', 'gap'); ?></em>
545
- <?php esc_html_e('GA tracking code. Leave unchecked to display', 'gap'); ?> <em><?php esc_html_e('after', 'gap'); ?></em> <?php esc_html_e('the tracking code.', 'gap'); ?>
546
- </td>
547
- </tr>
548
- <tr>
549
- <th scope="row"><label class="description" for="gap_options[admin_area]"><?php esc_html_e('Admin Area', 'gap') ?></label></th>
550
- <td>
551
- <input name="gap_options[admin_area]" type="checkbox" value="1" <?php if (isset($gap_options['admin_area'])) checked('1', $gap_options['admin_area']); ?> />
552
- <?php esc_html_e('Enable GA in the WordPress Admin Area', 'gap'); ?>
553
- </td>
554
- </tr>
555
- <tr>
556
- <th scope="row"><label class="description" for="gap_options[disable_admin]"><?php esc_html_e('Admin Users', 'gap') ?></label></th>
557
- <td>
558
- <input name="gap_options[disable_admin]" type="checkbox" value="1" <?php if (isset($gap_options['disable_admin'])) checked('1', $gap_options['disable_admin']); ?> />
559
- <?php esc_html_e('Disable GA on the frontend for Admin-level users', 'gap') ?>
560
- </td>
561
- </tr>
562
- </table>
563
- </div>
564
- <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'gap'); ?>" />
565
- </div>
566
- </div>
567
 
568
- <div id="mm-restore-settings" class="postbox">
569
- <h2><?php esc_html_e('Restore Defaults', 'gap'); ?></h2>
570
- <div class="toggle<?php if (!isset($_GET["settings-updated"])) { echo ' default-hidden'; } ?>">
571
- <p>
572
- <input name="gap_options[default_options]" type="checkbox" value="1" id="mm_restore_defaults" <?php if (isset($gap_options['default_options'])) checked('1', $gap_options['default_options']); ?> />
573
- <label class="description" for="gap_options[default_options]"><?php esc_html_e('Restore default options upon plugin deactivation/reactivation.', 'gap'); ?></label>
574
- </p>
575
- <p>
576
- <small>
577
- <strong><?php esc_html_e('Tip:', 'gap'); ?> </strong> <?php esc_html_e('leave this option unchecked to remember your settings.', 'gap'); ?>
578
- <?php esc_html_e('Or, to go ahead and restore all default options, check the box, save your settings, and then deactivate/reactivate the plugin.', 'gap'); ?>
579
- </small>
580
- </p>
581
- <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'gap'); ?>" />
582
- </div>
583
- </div>
584
 
585
- <div id="mm-panel-current" class="postbox">
586
- <h2><?php esc_html_e('Show Support', 'gap'); ?></h2>
587
- <div class="toggle">
588
- <?php require_once('support-panel.php'); ?>
589
- </div>
590
- </div>
591
 
592
- </div>
593
- </div>
 
594
 
595
- <div id="mm-credit-info">
596
- <a target="_blank" href="<?php echo $gap_homeurl; ?>" title="<?php echo $gap_plugin; ?> Homepage"><?php echo $gap_plugin; ?></a> by
597
- <a target="_blank" href="https://twitter.com/perishable" title="Jeff Starr on Twitter">Jeff Starr</a> @
598
- <a target="_blank" href="https://monzillamedia.com/" title="Obsessive Web Design &amp; Development">Monzilla Media</a>
599
- </div>
600
 
601
- </form>
602
- </div>
603
-
604
- <script type="text/javascript">
605
- jQuery(document).ready(function(){
606
- // toggle panels
607
- jQuery('.default-hidden').hide();
608
- jQuery('#mm-panel-toggle a').click(function(){
609
- jQuery('.toggle').slideToggle(300);
610
- return false;
611
- });
612
- jQuery('h2').click(function(){
613
- jQuery(this).next().slideToggle(300);
614
- });
615
- jQuery('#mm-panel-usage-link').click(function(){
616
- jQuery('.toggle').hide();
617
- jQuery('#mm-panel-usage .toggle').slideToggle(300);
618
- return true;
619
- });
620
- jQuery('#mm-panel-primary-link').click(function(){
621
- jQuery('.toggle').hide();
622
- jQuery('#mm-panel-primary .toggle').slideToggle(300);
623
- return true;
624
- });
625
- //dismiss_alert
626
- if (!jQuery('.dismiss-alert-wrap input').is(':checked')){
627
- jQuery('.dismiss-alert-wrap input').one('click',function(){
628
- jQuery('.dismiss-alert-wrap').after('<input type="submit" class="button-secondary" value="<?php esc_attr_e('Save Preference', 'gap'); ?>" />');
629
- });
630
  }
631
- // prevent accidents
632
- if (!jQuery('#mm_restore_defaults').is(':checked')){
633
- jQuery('#mm_restore_defaults').click(function(event){
634
- var r = confirm("<?php esc_html_e('Are you sure you want to restore all default options? (this action cannot be undone)', 'gap'); ?>");
635
- if (r == true){
636
- jQuery('#mm_restore_defaults').attr('checked', true);
637
- } else {
638
- jQuery('#mm_restore_defaults').attr('checked', false);
639
- }
640
- });
 
 
 
 
 
 
 
 
 
641
  }
642
- });
643
- </script>
644
 
645
- <?php }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  Donate link: https://m0n.co/donate
10
  Contributors: specialk
11
  Requires at least: 4.1
12
+ Tested up to: 5.0
13
+ Stable tag: 20180303
14
+ Version: 20180303
15
  Requires PHP: 5.2
16
+ Text Domain: ga-google-analytics
17
  Domain Path: /languages
18
  License: GPL v2 or later
19
  */
32
  You should have received a copy of the GNU General Public License
33
  with this program. If not, visit: https://www.gnu.org/licenses/
34
 
35
+ Copyright 2018 Monzilla Media. All rights reserved.
36
  */
37
 
38
  if (!defined('ABSPATH')) die();
39
 
40
+ if (!class_exists('GA_Google_Analytics')) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
+ class GA_Google_Analytics {
43
 
44
+ function __construct() {
45
+
46
+ $this->constants();
47
+ $this->includes();
48
+
49
+ add_action('admin_menu', array($this, 'add_menu'));
50
+ add_filter('admin_init', array($this, 'add_settings'));
51
+ add_action('admin_enqueue_scripts', array($this, 'admin_scripts'));
52
+ add_filter('plugin_action_links', array($this, 'action_links'), 10, 2);
53
+ add_filter('plugin_row_meta', array($this, 'plugin_links'), 10, 2);
54
+ add_action('plugins_loaded', array($this, 'load_i18n'));
55
+ add_action('admin_init', array($this, 'check_version'));
56
+ add_action('admin_init', array($this, 'reset_options'));
57
+ add_action('admin_notices', array($this, 'admin_notices'));
58
+
59
+ }
60
 
61
+ function constants() {
62
+
63
+ if (!defined('GAP_VERSION')) define('GAP_VERSION', '20180303');
64
+ if (!defined('GAP_REQUIRE')) define('GAP_REQUIRE', '4.1');
65
+ if (!defined('GAP_AUTHOR')) define('GAP_AUTHOR', 'Jeff Starr');
66
+ if (!defined('GAP_NAME')) define('GAP_NAME', __('GA Google Analytics', 'ga-google-analytics'));
67
+ if (!defined('GAP_HOME')) define('GAP_HOME', 'https://perishablepress.com/ga-google-analytics/');
68
+ if (!defined('GAP_PATH')) define('GAP_PATH', 'options-general.php?page=ga-google-analytics');
69
+ if (!defined('GAP_URL')) define('GAP_URL', plugin_dir_url(__FILE__));
70
+ if (!defined('GAP_DIR')) define('GAP_DIR', plugin_dir_path(__FILE__));
71
+ if (!defined('GAP_FILE')) define('GAP_FILE', plugin_basename(__FILE__));
72
+ if (!defined('GAP_SLUG')) define('GAP_SLUG', basename(dirname(__FILE__)));
73
+
74
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
+ function includes() {
77
+
78
+ require_once GAP_DIR .'inc/plugin-core.php';
79
+
80
+ }
81
 
82
+ function add_menu() {
83
+
84
+ $title_page = esc_html__('GA Google Analytics', 'ga-google-analytics');
85
+ $title_menu = esc_html__('Google Analytics', 'ga-google-analytics');
86
+
87
+ add_options_page($title_page, $title_menu, 'manage_options', 'ga-google-analytics', array($this, 'display_settings'));
88
+
89
+ }
90
 
91
+ function add_settings() {
92
+
93
+ register_setting('gap_plugin_options', 'gap_options', array($this, 'validate_settings'));
94
+
95
+ }
96
+
97
+ function admin_scripts($hook) {
98
+
99
+ if ($hook === 'settings_page_ga-google-analytics') {
100
+
101
+ wp_enqueue_style('ga-google-analytics', GAP_URL .'css/settings.css', array(), GAP_VERSION);
102
+
103
+ wp_enqueue_script('ga-google-analytics', GAP_URL .'js/settings.js', array('jquery'), GAP_VERSION);
104
+
105
+ $this->localize_scripts();
106
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  }
108
+
109
+ }
110
 
111
+ function localize_scripts() {
112
+
113
+ $script = array(
114
+ 'confirm_message' => esc_html__('Are you sure you want to restore all default options?', 'ga-google-analytics')
115
+ );
116
+
117
+ wp_localize_script('ga-google-analytics', 'ga_google_analytics', $script);
118
+
119
+ }
120
 
121
+ function action_links($links, $file) {
122
+
123
+ if ($file === GAP_FILE) {
124
+
125
+ $gap_links = '<a href="'. admin_url(GAP_PATH) .'">'. esc_html__('Settings', 'ga-google-analytics') .'</a>';
126
+
127
+ array_unshift($links, $gap_links);
128
+
129
+ }
130
+
131
+ return $links;
132
+
133
+ }
134
 
135
+ function plugin_links($links, $file) {
136
+
137
+ if ($file === GAP_FILE) {
138
+
139
+ $rate_href = 'https://wordpress.org/support/plugin/'. GAP_SLUG .'/reviews/?rate=5#new-post';
140
+ $rate_title = esc_attr__('Click here to rate and review this plugin on WordPress.org', 'ga-google-analytics');
141
+ $rate_text = esc_html__('Rate this plugin', 'ga-google-analytics') .'&nbsp;&raquo;';
142
+
143
+ $links[] = '<a target="_blank" href="'. $rate_href .'" title="'. $rate_title .'">'. $rate_text .'</a>';
144
+
145
+ }
146
+
147
+ return $links;
148
+
149
+ }
 
 
 
 
 
 
150
 
151
+ function check_version() {
152
+
153
+ $wp_version = get_bloginfo('version');
154
+
155
+ if (isset($_GET['activate']) && $_GET['activate'] == 'true') {
156
+
157
+ if (version_compare($wp_version, GAP_REQUIRE, '<')) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
 
159
+ if (is_plugin_active(GAP_FILE)) {
160
+
161
+ deactivate_plugins(GAP_FILE);
162
+
163
+ $msg = '<strong>'. GAP_NAME .'</strong> '. esc_html__('requires WordPress ', 'ga-google-analytics') . GAP_REQUIRE;
164
+ $msg .= esc_html__(' or higher, and has been deactivated! ', 'ga-google-analytics');
165
+ $msg .= esc_html__('Please return to the', 'ga-google-analytics') .' <a href="'. admin_url() .'">';
166
+ $msg .= esc_html__('WP Admin Area', 'ga-google-analytics') .'</a> '. esc_html__('to upgrade WordPress and try again.', 'ga-google-analytics');
167
+
168
+ wp_die($msg);
169
+
170
+ }
 
 
 
 
 
 
 
171
 
172
+ }
173
+
174
+ }
175
+
176
+ }
177
+
178
+ function load_i18n() {
179
+
180
+ $domain = 'ga-google-analytics';
181
+
182
+ $locale = apply_filters('gap_locale', get_locale(), $domain);
183
+
184
+ $dir = trailingslashit(WP_LANG_DIR);
185
+
186
+ $file = $domain .'-'. $locale .'.mo';
187
+
188
+ $path_1 = $dir . $file;
189
+
190
+ $path_2 = $dir . $domain .'/'. $file;
191
+
192
+ $path_3 = $dir .'plugins/'. $file;
193
+
194
+ $path_4 = $dir .'plugins/'. $domain .'/'. $file;
195
+
196
+ $paths = array($path_1, $path_2, $path_3, $path_4);
197
+
198
+ foreach ($paths as $path) {
199
+
200
+ if ($loaded = load_textdomain($domain, $path)) {
201
 
202
+ return $loaded;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
 
204
+ } else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
 
206
+ return load_plugin_textdomain($domain, false, GAP_DIR .'languages/');
 
 
 
 
 
207
 
208
+ }
209
+
210
+ }
211
 
212
+ }
213
+
214
+ function admin_notices() {
 
 
215
 
216
+ $screen = get_current_screen();
217
+
218
+ if (!property_exists($screen, 'id')) return;
219
+
220
+ if ($screen->id === 'settings_page_ga-google-analytics') {
221
+
222
+ if (isset($_GET['gap-reset-options'])) {
223
+
224
+ if ($_GET['gap-reset-options'] === 'true') : ?>
225
+
226
+ <div class="notice notice-success is-dismissible"><p><strong><?php esc_html_e('Default options restored.', 'ga-google-analytics'); ?></strong></p></div>
227
+
228
+ <?php else : ?>
229
+
230
+ <div class="notice notice-info is-dismissible"><p><strong><?php esc_html_e('No changes made to options.', 'ga-google-analytics'); ?></strong></p></div>
231
+
232
+ <?php endif;
233
+
234
+ }
235
+
 
 
 
 
 
 
 
 
 
236
  }
237
+
238
+ }
239
+
240
+ function reset_options() {
241
+
242
+ if (isset($_GET['gap-reset-options']) && wp_verify_nonce($_GET['gap-reset-options'], 'gap_reset_options')) {
243
+
244
+ if (!current_user_can('manage_options')) exit;
245
+
246
+ $update = update_option('gap_options', $this->default_options());
247
+
248
+ $result = $update ? 'true' : 'false';
249
+
250
+ $location = add_query_arg(array('gap-reset-options' => $result), admin_url(GAP_PATH));
251
+
252
+ wp_redirect(esc_url_raw($location));
253
+
254
+ exit;
255
+
256
  }
257
+
258
+ }
259
 
260
+ function __clone() {
261
+
262
+ _doing_it_wrong(__FUNCTION__, esc_html__('Cheatin&rsquo; huh?', 'ga-google-analytics'), GAP_VERSION);
263
+
264
+ }
265
+
266
+ function __wakeup() {
267
+
268
+ _doing_it_wrong(__FUNCTION__, esc_html__('Cheatin&rsquo; huh?', 'ga-google-analytics'), GAP_VERSION);
269
+
270
+ }
271
+
272
+ function default_options() {
273
+
274
+ $options = array(
275
+
276
+ 'gap_id' => '',
277
+ 'gap_location' => 'header',
278
+ 'gap_enable' => 1,
279
+ 'gap_display_ads' => 0,
280
+ 'link_attr' => 0,
281
+ 'gap_anonymize' => 0,
282
+ 'gap_force_ssl' => 0,
283
+ 'admin_area' => 0,
284
+ 'disable_admin' => 0,
285
+ 'gap_custom_loc' => 0,
286
+ 'tracker_object' => '',
287
+ 'gap_custom_code' => '',
288
+ 'gap_custom' => '',
289
+ //
290
+ 'gap_universal' => 1,
291
+ 'version_alert' => 0,
292
+ 'default_options' => 0
293
+
294
+ );
295
+
296
+ return apply_filters('gap_default_options', $options);
297
+
298
+ }
299
+
300
+ function validate_settings($input) {
301
+
302
+ $input['gap_id'] = wp_filter_nohtml_kses($input['gap_id']);
303
+
304
+ if (!isset($input['gap_location'])) $input['gap_location'] = null;
305
+ if (!array_key_exists($input['gap_location'], $this->options_locations())) $input['gap_location'] = null;
306
+
307
+ if (!isset($input['gap_enable'])) $input['gap_enable'] = null;
308
+ if (!array_key_exists($input['gap_enable'], $this->options_libraries())) $input['gap_enable'] = null;
309
+
310
+ if (!isset($input['gap_display_ads'])) $input['gap_display_ads'] = null;
311
+ $input['gap_display_ads'] = ($input['gap_display_ads'] == 1 ? 1 : 0);
312
+
313
+ if (!isset($input['link_attr'])) $input['link_attr'] = null;
314
+ $input['link_attr'] = ($input['link_attr'] == 1 ? 1 : 0);
315
+
316
+ if (!isset($input['gap_anonymize'])) $input['gap_anonymize'] = null;
317
+ $input['gap_anonymize'] = ($input['gap_anonymize'] == 1 ? 1 : 0);
318
+
319
+ if (!isset($input['gap_force_ssl'])) $input['gap_force_ssl'] = null;
320
+ $input['gap_force_ssl'] = ($input['gap_force_ssl'] == 1 ? 1 : 0);
321
+
322
+ if (!isset($input['admin_area'])) $input['admin_area'] = null;
323
+ $input['admin_area'] = ($input['admin_area'] == 1 ? 1 : 0);
324
+
325
+ if (!isset($input['disable_admin'])) $input['disable_admin'] = null;
326
+ $input['disable_admin'] = ($input['disable_admin'] == 1 ? 1 : 0);
327
+
328
+ if (!isset($input['gap_custom_loc'])) $input['gap_custom_loc'] = null;
329
+ $input['gap_custom_loc'] = ($input['gap_custom_loc'] == 1 ? 1 : 0);
330
+
331
+ if (isset($input['tracker_object'])) $input['tracker_object'] = stripslashes(trim($input['tracker_object']));
332
+
333
+ if (isset($input['gap_custom_code'])) $input['gap_custom_code'] = stripslashes(trim($input['gap_custom_code']));
334
+
335
+ if (isset($input['gap_custom'])) $input['gap_custom'] = stripslashes(trim($input['gap_custom']));
336
+
337
+ return $input;
338
+
339
+ }
340
+
341
+ function options_locations() {
342
+
343
+ return array(
344
+
345
+ 'header' => array(
346
+ 'value' => 'header',
347
+ 'label' => esc_html__('Include tracking code in page head (via', 'ga-google-analytics') .' <code>wp_head</code>'. esc_html__(')', 'ga-google-analytics')
348
+ ),
349
+ 'footer' => array(
350
+ 'value' => 'footer',
351
+ 'label' => esc_html__('Include tracking code in page footer (via', 'ga-google-analytics') .' <code>wp_footer</code>'. esc_html__(')', 'ga-google-analytics')
352
+ )
353
+ );
354
+
355
+ }
356
+
357
+ function options_libraries() {
358
+
359
+ $url1 = 'https://developers.google.com/analytics/devguides/collection/analyticsjs/';
360
+ $url2 = 'https://developers.google.com/analytics/devguides/collection/gtagjs/';
361
+ $url3 = 'https://developers.google.com/analytics/devguides/collection/gajs/';
362
+
363
+ $link1 = '<a target="_blank" href="'. $url1 .'">'. esc_html__('Universal Analytics', 'ga-google-analytics') .'</a> ';
364
+ $link2 = '<a target="_blank" href="'. $url2 .'">'. esc_html__('Global Site Tag', 'ga-google-analytics') .'</a> ';
365
+ $link3 = '<a target="_blank" href="'. $url3 .'">'. esc_html__('Legacy', 'ga-google-analytics') .'</a> ';
366
+
367
+ return array(
368
+
369
+ 1 => array(
370
+ 'value' => 1,
371
+ 'label' => $link1 .' <span class="gap-note">/</span> <code>analytics.js</code> <span class="gap-note">'. esc_html__('(default)', 'ga-google-analytics') .'</span>'
372
+ ),
373
+ 2 => array(
374
+ 'value' => 2,
375
+ 'label' => $link2 .' <span class="gap-note">/</span> <code>gtag.js</code> <span class="gap-note">'. esc_html__('(new method)', 'ga-google-analytics') .'</span>'
376
+ ),
377
+ 3 => array(
378
+ 'value' => 3,
379
+ 'label' => $link3 .' <span class="gap-note">/</span> <code>ga.js</code> <span class="gap-note">'. esc_html__('(deprecated)', 'ga-google-analytics') .'</span>'
380
+ )
381
+ );
382
+
383
+ }
384
+
385
+ function display_settings() {
386
+
387
+ $gap_options = get_option('gap_options', $this->default_options());
388
+
389
+ require_once GAP_DIR .'inc/settings-display.php';
390
+
391
+ }
392
+
393
+ function select_menu($items, $menu) {
394
+
395
+ $options = get_option('gap_options', $this->default_options());
396
+
397
+ $universal = isset($options['gap_universal']) ? $options['gap_universal'] : 1;
398
+
399
+ $tracking = isset($options['gap_enable']) ? $options['gap_enable'] : 1;
400
+
401
+ $checked = '';
402
+
403
+ $output = '';
404
+
405
+ $class = '';
406
+
407
+ foreach ($items as $item) {
408
+
409
+ $key = isset($options[$menu]) ? $options[$menu] : '';
410
+
411
+ $value = isset($item['value']) ? $item['value'] : '';
412
+
413
+ if ($menu === 'gap_enable') {
414
+
415
+ if ($tracking == 0) $key = 1;
416
+
417
+ if (!$universal && $tracking == 1) $key = 3;
418
+
419
+ $class = ' gap-select-method';
420
+
421
+ }
422
+
423
+ $checked = ($value == $key) ? ' checked="checked"' : '';
424
+
425
+ $output .= '<div class="gap-radio-inputs'. esc_attr($class) .'">';
426
+ $output .= '<input type="radio" name="gap_options['. esc_attr($menu) .']" value="'. esc_attr($item['value']) .'"'. $checked .'> ';
427
+ $output .= '<span>'. $item['label'] .'</span>'; //
428
+ $output .= '</div>';
429
+
430
+ }
431
+
432
+ return $output;
433
+
434
+ }
435
+
436
+ function callback_reset() {
437
+
438
+ $nonce = wp_create_nonce('gap_reset_options');
439
+
440
+ $href = add_query_arg(array('gap-reset-options' => $nonce), admin_url(GAP_PATH));
441
+
442
+ $label = esc_html__('Restore default plugin options', 'ga-google-analytics');
443
+
444
+ return '<a class="gap-reset-options" href="'. esc_url($href) .'">'. esc_html($label) .'</a>';
445
+
446
+ }
447
+
448
+ }
449
+
450
+ $GA_Google_Analytics = new GA_Google_Analytics();
451
+
452
+ ga_google_analytics_init($GA_Google_Analytics);
453
+
454
+ }
img/250x250-banhammer-pro.jpg ADDED
Binary file
{images → img}/250x250-bbq-pro.jpg RENAMED
File without changes
{images → img}/250x250-blackhole-pro.jpg RENAMED
File without changes
{images → img}/250x250-digging-into-wordpress.jpg RENAMED
File without changes
{images → img}/250x250-htaccess-made-easy.jpg RENAMED
File without changes
{images → img}/250x250-ses-pro.jpg RENAMED
File without changes
{images → img}/250x250-tao-of-wordpress.jpg RENAMED
File without changes
{images → img}/250x250-usp-pro.jpg RENAMED
File without changes
{images → img}/250x250-wp-themes-in-depth.jpg RENAMED
File without changes
gap-logo.jpg → img/gap-logo.jpg RENAMED
File without changes
inc/plugin-core.php ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php // Google Analytics - Core Functions
2
+
3
+ if (!function_exists('add_action')) die();
4
+
5
+ function ga_google_analytics_init($GA_Google_Analytics) {
6
+
7
+ $options = get_option('gap_options', $GA_Google_Analytics->default_options());
8
+
9
+ $location = isset($options['gap_location']) ? $options['gap_location'] : 'header';
10
+
11
+ $admin = isset($options['admin_area']) ? $options['admin_area'] : 0;
12
+
13
+ $function = 'ga_google_analytics_tracking_code';
14
+
15
+ if ($location === 'header') {
16
+
17
+ if ($admin) add_action('admin_head', $function);
18
+
19
+ add_action('wp_head', $function);
20
+
21
+ } else {
22
+
23
+ if ($admin) add_action('admin_footer', $function);
24
+
25
+ add_action('wp_footer', $function);
26
+
27
+ }
28
+
29
+ }
30
+
31
+ function ga_google_analytics_tracking_code() {
32
+
33
+ extract(ga_google_analytics_options());
34
+
35
+ if (empty($tracking_id)) return;
36
+
37
+ if (empty($tracking_method)) return;
38
+
39
+ if (current_user_can('administrator') && $disable_admin) return;
40
+
41
+ if ($custom && $custom_location) echo $custom . "\n";
42
+
43
+ if ($tracking_method == 3) {
44
+
45
+ ga_google_analytics_legacy($options);
46
+
47
+ } elseif ($tracking_method == 2) {
48
+
49
+ ga_google_analytics_global($options);
50
+
51
+ } else {
52
+
53
+ if ($universal) {
54
+
55
+ ga_google_analytics_universal($options);
56
+
57
+ } else {
58
+
59
+ ga_google_analytics_legacy($options);
60
+
61
+ }
62
+
63
+ }
64
+
65
+ if ($custom && !$custom_location) echo $custom . "\n";
66
+
67
+ }
68
+
69
+ function ga_google_analytics_universal() {
70
+
71
+ extract(ga_google_analytics_options());
72
+
73
+ $custom_code = ga_google_analytics_custom($custom_code);
74
+
75
+ $ga_display = "ga('require', 'displayfeatures');";
76
+ $ga_link = "ga('require', 'linkid', 'linkid.js');";
77
+ $ga_anon = "ga('set', 'anonymizeIP', true);";
78
+ $ga_ssl = "ga('set', 'forceSSL', true);";
79
+
80
+ ?>
81
+
82
+ <script>
83
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
84
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
85
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
86
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
87
+ ga('create', '<?php echo $tracking_id; ?>', 'auto'<?php if ($tracker_object) echo ', '. $tracker_object; ?>);
88
+ <?php
89
+ if ($display_ads) echo $ga_display . "\n\t\t\t";
90
+ if ($link_attr) echo $ga_link . "\n\t\t\t";
91
+ if ($anonymize) echo $ga_anon . "\n\t\t\t";
92
+ if ($force_ssl) echo $ga_ssl . "\n\t\t\t";
93
+ if ($custom_code) echo $custom_code . "\n\t\t\t";
94
+ ?>ga('send', 'pageview');
95
+ </script>
96
+
97
+ <?php
98
+
99
+ }
100
+
101
+ function ga_google_analytics_global() {
102
+
103
+ extract(ga_google_analytics_options());
104
+
105
+ $custom_code = ga_google_analytics_custom($custom_code);
106
+
107
+ ?>
108
+
109
+ <script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo $tracking_id; ?>"></script>
110
+ <script>
111
+ window.dataLayer = window.dataLayer || [];
112
+ function gtag(){dataLayer.push(arguments)};
113
+ gtag('js', new Date());
114
+ gtag('config', '<?php echo $tracking_id; ?>'<?php if ($tracker_object) echo ', '. $tracker_object; ?>);
115
+ <?php if ($custom_code) echo $custom_code; ?>
116
+
117
+ </script>
118
+
119
+ <?php
120
+
121
+ }
122
+
123
+ function ga_google_analytics_legacy() {
124
+
125
+ extract(ga_google_analytics_options());
126
+
127
+ $custom_code = ga_google_analytics_custom($custom_code);
128
+
129
+ $ga_alt = "('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';";
130
+ $ga_src = "('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';";
131
+ $ga_link = "var pluginUrl = '//www.google-analytics.com/plugins/ga/inpage_linkid.js';\n\t\t\t_gaq.push(['_require', 'inpage_linkid', pluginUrl]);";
132
+ $ga_anon = "_gaq.push(['_gat._anonymizeIp']);";
133
+ $ga_ssl = "_gaq.push(['_gat._forceSSL']);";
134
+
135
+ if ($display_ads) $ga_src = $ga_alt;
136
+
137
+ ?>
138
+
139
+ <script type="text/javascript">
140
+ var _gaq = _gaq || [];
141
+ <?php
142
+ if ($link_attr) echo $ga_link . "\n\t\t\t";
143
+ if ($anonymize) echo $ga_anon . "\n\t\t\t";
144
+ if ($force_ssl) echo $ga_ssl . "\n\t\t\t";
145
+ if ($custom_code) echo $custom_code . "\n\t\t\t";
146
+ ?>_gaq.push(['_setAccount', '<?php echo $tracking_id; ?>']);
147
+ _gaq.push(['_trackPageview']);
148
+ (function() {
149
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
150
+ ga.src = <?php echo $ga_src . "\n"; ?>
151
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
152
+ })();
153
+ </script>
154
+
155
+ <?php
156
+
157
+ }
158
+
159
+ function ga_google_analytics_custom($custom_code) {
160
+
161
+ $custom_code = preg_replace("/%%userid%%/i", get_current_user_id(), $custom_code);
162
+
163
+ return apply_filters('gap_custom_code', $custom_code);
164
+
165
+ }
166
+
167
+ function ga_google_analytics_options() {
168
+
169
+ global $GA_Google_Analytics;
170
+
171
+ $options = get_option('gap_options', $GA_Google_Analytics->default_options());
172
+
173
+ $tracking_id = (isset($options['gap_id']) && !empty($options['gap_id'])) ? $options['gap_id'] : '';
174
+
175
+ $location = isset($options['gap_location']) ? $options['gap_location'] : 'header';
176
+
177
+ $tracking_method = isset($options['gap_enable']) ? $options['gap_enable'] : 1;
178
+
179
+ $universal = isset($options['gap_universal']) ? $options['gap_universal'] : 1;
180
+
181
+ $display_ads = isset($options['gap_display_ads']) ? $options['gap_display_ads'] : 0;
182
+
183
+ $link_attr = isset($options['link_attr']) ? $options['link_attr'] : 0;
184
+
185
+ $anonymize = isset($options['gap_anonymize']) ? $options['gap_anonymize'] : 0;
186
+
187
+ $force_ssl = isset($options['gap_force_ssl']) ? $options['gap_force_ssl'] : 0;
188
+
189
+ $admin_area = isset($options['admin_area']) ? $options['admin_area'] : 0;
190
+
191
+ $disable_admin = isset($options['disable_admin']) ? $options['disable_admin'] : 0;
192
+
193
+ $custom_location = isset($options['gap_custom_loc']) ? $options['gap_custom_loc'] : 0;
194
+
195
+ $tracker_object = isset($options['tracker_object']) ? $options['tracker_object'] : '';
196
+
197
+ $custom_code = isset($options['gap_custom_code']) ? $options['gap_custom_code'] : '';
198
+
199
+ $custom = isset($options['gap_custom']) ? $options['gap_custom'] : '';
200
+
201
+ // $options, $tracking_id, $location, $tracking_method, $universal, $display_ads, $link_attr, $anonymize,
202
+ // $force_ssl, $admin_area, $disable_admin, $custom_location, $tracker_object, $custom_code, $custom
203
+
204
+ return array(
205
+
206
+ 'options' => $options,
207
+ 'tracking_id' => $tracking_id,
208
+ 'location' => $location,
209
+ 'tracking_method' => $tracking_method,
210
+ 'universal' => $universal,
211
+ 'display_ads' => $display_ads,
212
+ 'link_attr' => $link_attr,
213
+ 'anonymize' => $anonymize,
214
+ 'force_ssl' => $force_ssl,
215
+ 'admin_area' => $admin_area,
216
+ 'disable_admin' => $disable_admin,
217
+ 'custom_location' => $custom_location,
218
+ 'tracker_object' => $tracker_object,
219
+ 'custom_code' => $custom_code,
220
+ 'custom' => $custom
221
+ );
222
+
223
+ }
inc/settings-display.php ADDED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php // Google Analytics - Settings Display
2
+
3
+ if (!function_exists('add_action')) die(); ?>
4
+
5
+ <div class="wrap">
6
+
7
+ <h1><?php echo GAP_NAME; ?> <small><?php echo 'v'. GAP_VERSION; ?></small></h1>
8
+
9
+ <div class="gap-toggle-all"><a href="<?php echo admin_url(GAP_PATH); ?>"><?php esc_html_e('Toggle all panels', 'ga-google-analytics'); ?></a></div>
10
+
11
+ <form method="post" action="options.php">
12
+
13
+ <?php settings_fields('gap_plugin_options'); ?>
14
+
15
+ <div class="metabox-holder">
16
+
17
+ <div class="meta-box-sortables ui-sortable">
18
+
19
+ <div id="gap-panel-overview" class="postbox">
20
+
21
+ <h2><?php esc_html_e('Overview', 'ga-google-analytics'); ?></h2>
22
+
23
+ <div class="toggle<?php if (isset($_GET['settings-updated'])) echo ' default-hidden'; ?>">
24
+
25
+ <div class="gap-panel-overview">
26
+
27
+ <p><?php esc_html_e('This plugin adds the GA Tracking Code to your site. Log in to your Google account to view your stats.', 'ga-google-analytics'); ?></p>
28
+
29
+ <ul>
30
+ <li><a class="gap-toggle" data-target="usage" href="#gap-panel-usage"><?php esc_html_e('How to Use', 'ga-google-analytics'); ?></a></li>
31
+ <li><a class="gap-toggle" data-target="settings" href="#gap-panel-settings"><?php esc_html_e('Plugin Settings', 'ga-google-analytics'); ?></a></li>
32
+ <li><a target="_blank" href="https://wordpress.org/support/plugin/ga-google-analytics"><?php esc_html_e('Plugin Homepage', 'ga-google-analytics'); ?></a></li>
33
+ </ul>
34
+
35
+ <p>
36
+ <?php esc_html_e('If you like this plugin, please', 'ga-google-analytics'); ?>
37
+ <a target="_blank" href="https://wordpress.org/support/plugin/ga-google-analytics/reviews/?rate=5#new-post" title="<?php esc_attr_e('THANK YOU for your support!', 'ga-google-analytics'); ?>">
38
+ <?php esc_html_e('give it a 5-star rating', 'ga-google-analytics'); ?>&nbsp;&raquo;
39
+ </a>
40
+ </p>
41
+
42
+ </div>
43
+
44
+ </div>
45
+
46
+ </div>
47
+
48
+ <div id="gap-panel-usage" class="postbox">
49
+
50
+ <h2><?php esc_html_e('How to Use', 'ga-google-analytics'); ?></h2>
51
+
52
+ <div class="toggle default-hidden">
53
+
54
+ <div class="gap-panel-usage">
55
+
56
+ <p><?php esc_html_e('How to use this plugin:', 'ga-google-analytics'); ?></p>
57
+
58
+ <ol>
59
+ <li><?php esc_html_e('Visit the "Plugin Settings" panel', 'ga-google-analytics'); ?></li>
60
+ <li><?php esc_html_e('Enter your GA Tracking ID', 'ga-google-analytics'); ?></li>
61
+ <li>
62
+ <?php esc_html_e('Choose either', 'ga-google-analytics'); ?> <a target="_blank" href="https://developers.google.com/analytics/devguides/collection/analyticsjs/"><?php esc_html_e('Universal Analytics', 'ga-google-analytics'); ?></a>
63
+ <?php esc_html_e('or', 'ga-google-analytics'); ?> <a target="_blank" href="https://developers.google.com/analytics/devguides/collection/gtagjs/"><?php esc_html_e('Global Site Tag', 'ga-google-analytics'); ?></a>
64
+ </li>
65
+ <li><?php esc_html_e('Configure any other plugin settings as desired (optional)', 'ga-google-analytics'); ?></li>
66
+ </ol>
67
+
68
+ <p><?php esc_html_e('Save changes and done. After 24-48 hours, you can log into your Google Analytics account to view your stats.', 'ga-google-analytics'); ?></p>
69
+
70
+ <div class="gap-caption">
71
+
72
+ <?php esc_html_e('Note that it can take 24-48 hours after adding the tracking code before any analytical data appears in your', 'ga-google-analytics'); ?>
73
+ <a target="_blank" href="https://www.google.com/analytics/"><?php esc_html_e('Google Analytics account', 'ga-google-analytics'); ?></a>.
74
+ <?php esc_html_e('To check that the GA tacking code is included, look at the source code of your web page(s). Learn more at the', 'ga-google-analytics'); ?>
75
+ <a target="_blank" href="https://support.google.com/analytics/?hl=en#topic=3544906"><?php esc_html_e('Google Analytics Help Center', 'ga-google-analytics'); ?></a>.
76
+
77
+ </div>
78
+
79
+ </div>
80
+
81
+ </div>
82
+
83
+ </div>
84
+
85
+ <div id="gap-panel-settings" class="postbox">
86
+
87
+ <h2><?php esc_html_e('Plugin Settings', 'ga-google-analytics'); ?></h2>
88
+
89
+ <div class="toggle<?php if (!isset($_GET['settings-updated'])) echo ' default-hidden'; ?>">
90
+
91
+ <div class="gap-panel-settings">
92
+
93
+ <table class="widefat">
94
+ <tr>
95
+ <th><label for="gap_options[gap_id]"><?php esc_html_e('GA Tracking ID', 'ga-google-analytics') ?></label></th>
96
+ <td><input id="gap_options[gap_id]" name="gap_options[gap_id]" type="text" size="20" maxlength="22" value="<?php if (isset($gap_options['gap_id'])) echo esc_attr($gap_options['gap_id']); ?>"></td>
97
+ </tr>
98
+ <tr>
99
+ <th><label for="gap_options[gap_enable]"><?php esc_html_e('Tracking Method', 'ga-google-analytics') ?></label></th>
100
+ <td><?php echo $this->select_menu($this->options_libraries(), 'gap_enable'); ?></td>
101
+ </tr>
102
+ </table>
103
+
104
+ <div class="gap-info-universal<?php if (isset($gap_options['gap_enable']) && $gap_options['gap_enable'] == 2) echo ' default-hidden'; ?>">
105
+
106
+ <table class="widefat">
107
+ <tr>
108
+ <th><label for="gap_options[gap_display_ads]"><?php esc_html_e('Display Advertising', 'ga-google-analytics') ?></label></th>
109
+ <td>
110
+ <input id="gap_options[gap_display_ads]" name="gap_options[gap_display_ads]" type="checkbox" value="1" <?php if (isset($gap_options['gap_display_ads'])) checked('1', $gap_options['gap_display_ads']); ?>>
111
+ <?php esc_html_e('Enable support for', 'ga-google-analytics'); ?>
112
+ <a target="_blank" href="https://support.google.com/analytics/answer/2444872"><?php esc_html_e('Display Advertising', 'ga-google-analytics'); ?></a>
113
+ </td>
114
+ </tr>
115
+ <tr>
116
+ <th><label for="gap_options[link_attr]"><?php esc_html_e('Link Attribution', 'ga-google-analytics') ?></label></th>
117
+ <td>
118
+ <input id="gap_options[link_attr]" name="gap_options[link_attr]" type="checkbox" value="1" <?php if (isset($gap_options['link_attr'])) checked('1', $gap_options['link_attr']); ?>>
119
+ <?php esc_html_e('Enable support for', 'ga-google-analytics'); ?>
120
+ <a target="_blank" href="https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-link-attribution"><?php esc_html_e('Enhanced Link Attribution', 'ga-google-analytics'); ?></a>
121
+ </td>
122
+ </tr>
123
+ <tr>
124
+ <th><label for="gap_options[gap_anonymize]"><?php esc_html_e('IP Anonymization', 'ga-google-analytics') ?></label></th>
125
+ <td>
126
+ <input id="gap_options[gap_anonymize]" name="gap_options[gap_anonymize]" type="checkbox" value="1" <?php if (isset($gap_options['gap_anonymize'])) checked('1', $gap_options['gap_anonymize']); ?>>
127
+ <?php esc_html_e('Enable support for', 'ga-google-analytics'); ?>
128
+ <a target="_blank" href="https://developers.google.com/analytics/devguides/collection/analyticsjs/ip-anonymization"><?php esc_html_e('IP Anonymization', 'ga-google-analytics'); ?></a>
129
+ </td>
130
+ </tr>
131
+ <tr>
132
+ <th><label for="gap_options[gap_force_ssl]"><?php esc_html_e('Force SSL', 'ga-google-analytics') ?></label></th>
133
+ <td>
134
+ <input id="gap_options[gap_force_ssl]" name="gap_options[gap_force_ssl]" type="checkbox" value="1" <?php if (isset($gap_options['gap_force_ssl'])) checked('1', $gap_options['gap_force_ssl']); ?>>
135
+ <?php esc_html_e('Enable support for', 'ga-google-analytics'); ?>
136
+ <a href="https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#forceSSL"><?php esc_html_e('Force SSL', 'ga-google-analytics'); ?></a>
137
+ </td>
138
+ </tr>
139
+ </table>
140
+
141
+ </div>
142
+
143
+ <table class="widefat">
144
+ <tr>
145
+ <th><label for="gap_options[gap_location]"><?php esc_html_e('Code Location', 'ga-google-analytics'); ?></label></th>
146
+ <td>
147
+ <?php echo $this->select_menu($this->options_locations(), 'gap_location'); ?>
148
+ <div class="gap-caption">
149
+ <?php esc_html_e('Tip: Google recommends including the tracking code in the page head, but including it in the footer can benefit page performance.', 'ga-google-analytics'); ?>
150
+ <?php esc_html_e('If in doubt, go with the head option.', 'ga-google-analytics'); ?>
151
+ </div>
152
+ </td>
153
+ </tr>
154
+ <tr>
155
+ <th><label for="gap_options[tracker_object]"><?php esc_html_e('Custom Tracker Objects', 'ga-google-analytics'); ?></label></th>
156
+ <td>
157
+ <textarea id="gap_options[tracker_object]" name="gap_options[tracker_object]" type="textarea" rows="4" cols="70"><?php if (isset($gap_options['tracker_object'])) echo esc_textarea($gap_options['tracker_object']); ?></textarea>
158
+ <div class="gap-caption">
159
+ <?php esc_html_e('Any code entered here will be added to', 'ga-google-analytics'); ?> <code>ga('create')</code>
160
+ <?php esc_html_e('for Universal Analytics, or added to', 'ga-google-analytics'); ?> <code>gtag('config')</code>
161
+ <?php esc_html_e('for Global Site Tag.', 'ga-google-analytics'); ?>
162
+ <a target="_blank" href="https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers"><?php esc_html_e('Learn more about creating trackers', 'ga-google-analytics'); ?></a>.
163
+ </div>
164
+ </td>
165
+ </tr>
166
+ <tr>
167
+ <th><label for="gap_options[gap_custom_code]"><?php esc_html_e('Custom GA Code', 'ga-google-analytics'); ?></label></th>
168
+ <td>
169
+ <textarea id="gap_options[gap_custom_code]" name="gap_options[gap_custom_code]" type="textarea" rows="4" cols="70"><?php if (isset($gap_options['gap_custom_code'])) echo esc_textarea($gap_options['gap_custom_code']); ?></textarea>
170
+ <div class="gap-caption">
171
+ <?php esc_html_e('Any code entered here will be added to the GA code snippet. This is useful for things like', 'ga-google-analytics'); ?>
172
+ <a target="_blank" href="https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers#working_with_multiple_trackers"><?php esc_html_e('creating multiple trackers', 'ga-google-analytics'); ?></a>
173
+ <?php esc_html_e('and', 'ga-google-analytics'); ?> <a target="_blank" href="https://support.google.com/360suite/optimize/"><?php esc_html_e('Google Optimize', 'ga-google-analytics'); ?></a>.
174
+ <?php esc_html_e('Can use', 'ga-google-analytics'); ?> <code>%%userid%%</code> <?php esc_html_e('to display the current user ID.', 'ga-google-analytics'); ?>
175
+ </div>
176
+ </td>
177
+ </tr>
178
+ <tr>
179
+ <th><label for="gap_options[gap_custom]"><?php esc_html_e('Custom', 'ga-google-analytics'); ?> <code>&lt;head&gt;</code> <?php esc_html_e('Code', 'ga-google-analytics'); ?></label></th>
180
+ <td>
181
+ <textarea id="gap_options[gap_custom]" name="gap_options[gap_custom]" type="textarea" rows="4" cols="70"><?php if (isset($gap_options['gap_custom'])) echo esc_textarea($gap_options['gap_custom']); ?></textarea>
182
+ <div class="gap-caption">
183
+ <?php esc_html_e('Here you may specify any markup to be displayed in the', 'ga-google-analytics'); ?> <code>&lt;head&gt;</code>
184
+ <?php esc_html_e('section (or in the footer, depending on the "Code Location" setting, above).', 'ga-google-analytics'); ?>
185
+ </div>
186
+ </td>
187
+ </tr>
188
+ <tr>
189
+ <th><label for="gap_options[gap_custom_loc]"><?php esc_html_e('Custom', 'ga-google-analytics'); ?> <code>&lt;head&gt;</code> <?php esc_html_e('Location', 'ga-google-analytics'); ?></label></th>
190
+ <td>
191
+ <input id="gap_options[gap_custom_loc]" name="gap_options[gap_custom_loc]" type="checkbox" value="1" <?php if (isset($gap_options['gap_custom_loc'])) checked('1', $gap_options['gap_custom_loc']); ?>>
192
+ <?php esc_html_e('Display custom', 'ga-google-analytics'); ?> <code>&lt;head&gt;</code> <?php esc_html_e('code', 'ga-google-analytics'); ?> <em><?php esc_html_e('before', 'ga-google-analytics'); ?></em>
193
+ <?php esc_html_e('GA tracking code. Leave unchecked to display', 'ga-google-analytics'); ?> <em><?php esc_html_e('after', 'ga-google-analytics'); ?></em> <?php esc_html_e('the tracking code.', 'ga-google-analytics'); ?>
194
+ </td>
195
+ </tr>
196
+ <tr>
197
+ <th><label for="gap_options[admin_area]"><?php esc_html_e('Admin Area', 'ga-google-analytics') ?></label></th>
198
+ <td>
199
+ <input id="gap_options[admin_area]" name="gap_options[admin_area]" type="checkbox" value="1" <?php if (isset($gap_options['admin_area'])) checked('1', $gap_options['admin_area']); ?>>
200
+ <?php esc_html_e('Enable GA in the WordPress Admin Area', 'ga-google-analytics'); ?>
201
+ </td>
202
+ </tr>
203
+ <tr>
204
+ <th><label for="gap_options[disable_admin]"><?php esc_html_e('Admin Users', 'ga-google-analytics') ?></label></th>
205
+ <td>
206
+ <input id="gap_options[disable_admin]" name="gap_options[disable_admin]" type="checkbox" value="1" <?php if (isset($gap_options['disable_admin'])) checked('1', $gap_options['disable_admin']); ?>>
207
+ <?php esc_html_e('Disable tracking of Admin-level users', 'ga-google-analytics') ?>
208
+ </td>
209
+ </tr>
210
+ </table>
211
+
212
+ </div>
213
+
214
+ <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Changes', 'ga-google-analytics'); ?>" />
215
+
216
+ </div>
217
+
218
+ </div>
219
+
220
+ <div id="gap-panel-restore" class="postbox">
221
+
222
+ <h2><?php esc_html_e('Restore Defaults', 'ga-google-analytics'); ?></h2>
223
+
224
+ <div class="toggle default-hidden">
225
+
226
+ <p><?php esc_html_e('Click the link to restore the default plugin options.', 'ga-google-analytics'); ?></p>
227
+
228
+ <p><?php echo $this->callback_reset(); ?></p>
229
+
230
+ </div>
231
+
232
+ </div>
233
+
234
+ <div id="gap-panel-current" class="postbox">
235
+
236
+ <h2><?php esc_html_e('Show Support', 'ga-google-analytics'); ?></h2>
237
+
238
+ <div class="toggle<?php if (isset($_GET['settings-updated'])) echo ' default-hidden'; ?>">
239
+
240
+ <?php require_once GAP_DIR .'inc/support-panel.php'; ?>
241
+
242
+ </div>
243
+
244
+ </div>
245
+
246
+ </div>
247
+
248
+ </div>
249
+
250
+ <div class="gap-credit-info">
251
+
252
+ <a target="_blank" href="<?php echo esc_url(GAP_HOME); ?>" title="<?php esc_attr_e('Plugin Homepage', 'ga-google-analytics'); ?>"><?php echo GAP_NAME; ?></a>
253
+ <?php esc_attr_e('by', 'ga-google-analytics'); ?>
254
+ <a target="_blank" href="https://twitter.com/perishable" title="<?php esc_attr_e('Jeff Starr on Twitter', 'ga-google-analytics'); ?>">Jeff Starr</a>
255
+ <?php esc_attr_e('@', 'ga-google-analytics'); ?>
256
+ <a target="_blank" href="https://monzillamedia.com/" title="<?php esc_attr_e('Obsessive Web Development', 'ga-google-analytics'); ?>">Monzilla Media</a>
257
+
258
+ </div>
259
+
260
+ </form>
261
+
262
+ </div>
inc/support-panel.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php // Google Analytics - Show Support Panel
2
+
3
+ if (!function_exists('add_action')) die();
4
+
5
+ $plugin_project = esc_html__('Google Analytics', 'ga-google-analytics');
6
+
7
+ $plugin_url = esc_url(GAP_URL);
8
+
9
+ $array = array(
10
+
11
+ 0 => '<a target="_blank" href="https://plugin-planet.com/bbq-pro/" title="Premium WP Plugin: BBQ Pro">
12
+ <img width="125" height="125" src="'. $plugin_url .'img/250x250-bbq-pro.jpg" alt="BBQ Pro - Block Bad Queries" />
13
+ </a>',
14
+ 1 => '<a target="_blank" href="https://plugin-planet.com/banhammer-pro/" title="Premium WP Plugin: Banhammer Pro">
15
+ <img width="125" height="125" src="'. $plugin_url .'img/250x250-banhammer-pro.jpg" alt="Banhammer Pro - Drop the hammer." />
16
+ </a>',
17
+ 2 => '<a target="_blank" href="https://plugin-planet.com/blackhole-pro/" title="Premium WP Plugin: Blackhole Pro">
18
+ <img width="125" height="125" src="'. $plugin_url .'img/250x250-blackhole-pro.jpg" alt="Blackhole Pro - Block Bad Bots" />
19
+ </a>',
20
+ 3 => '<a target="_blank" href="https://plugin-planet.com/ses-pro/" title="Premium WP Plugin: SES Pro">
21
+ <img width="125" height="125" src="'. $plugin_url .'img/250x250-ses-pro.jpg" alt="SES Pro - Ajax-Powered Email Signup Forms" />
22
+ </a>',
23
+ 4 => '<a target="_blank" href="https://plugin-planet.com/usp-pro/" title="Premium WP Plugin: USP Pro">
24
+ <img width="125" height="125" src="'. $plugin_url .'img/250x250-usp-pro.jpg" alt="USP Pro - Unlimited Front-End Forms" />
25
+ </a>',
26
+
27
+ 5 => '<a target="_blank" href="https://digwp.com/" title="Take your WordPress Skills to the Next Level">
28
+ <img width="125" height="125" src="'. $plugin_url .'img/250x250-digging-into-wordpress.jpg" alt="Digging Into WordPress" />
29
+ </a>',
30
+ 6 => '<a target="_blank" href="https://wp-tao.com/" title="Learn the Way of WordPress">
31
+ <img width="125" height="125" src="'. $plugin_url .'img/250x250-tao-of-wordpress.jpg" alt="The Tao of WordPress" />
32
+ </a>',
33
+ 7 => '<a target="_blank" href="https://wp-tao.com/wordpress-themes-book/" title="WordPress Themes In Depth">
34
+ <img width="125" height="125" src="'. $plugin_url .'img/250x250-wp-themes-in-depth.jpg" alt="WordPress Themes In Depth" />
35
+ </a>',
36
+ 8 => '<a target="_blank" href="https://htaccessbook.com/" title="Optimize and Secure with .htaccess">
37
+ <img width="125" height="125" src="'. $plugin_url .'img/250x250-htaccess-made-easy.jpg" alt=".htaccess made easy" />
38
+ </a>',
39
+
40
+ );
41
+
42
+ $items = array_rand($array, 3);
43
+
44
+ $item1 = isset($array[$items[0]]) ? $array[$items[0]] : 0;
45
+ $item2 = isset($array[$items[1]]) ? $array[$items[1]] : 1;
46
+ $item3 = isset($array[$items[2]]) ? $array[$items[2]] : 2;
47
+
48
+ $url1 = esc_url('https://wp-tao.com/store/');
49
+ $url2 = esc_url('https://plugin-planet.com/store/');
50
+ $url3 = esc_url('https://m0n.co/donate');
51
+
52
+ $title1 = esc_html__('Perishable Press Books', 'ga-google-analytics');
53
+ $title2 = esc_html__('Plugin Planet', 'ga-google-analytics');
54
+ $title3 = esc_html__('Donate via PayPal', 'ga-google-analytics');
55
+
56
+ $link1 = ' <a target="_blank" href="'. $url1 .'" title="'. $title1 .'">'. esc_html__('books', 'ga-google-analytics') .'</a> ';
57
+ $link2 = ' <a target="_blank" href="'. $url2 .'" title="'. $title2 .'">'. esc_html__('plugins', 'ga-google-analytics') .'</a>, ';
58
+ $link3 = ' <a target="_blank" href="'. $url3 .'" title="'. $title3 .'">'. esc_html__('donation', 'ga-google-analytics') .'</a>. ';
59
+
60
+ $message = esc_html__('Thank you for using', 'ga-google-analytics') .' '. $plugin_project .'! ';
61
+ $message .= esc_html__('Please show support by purchasing one of my', 'ga-google-analytics') . $link1;
62
+ $message .= esc_html__('or', 'ga-google-analytics') . $link2 . esc_html__('or by making a', 'ga-google-analytics') . $link3;
63
+ $message .= esc_html__('Your generous support helps to ensure future development of', 'ga-google-analytics') .' '. $plugin_project .' ';
64
+ $message .= esc_html__('and is greatly appreciated.', 'ga-google-analytics');
65
+
66
+ $donate = esc_html__('Any size donation helps me to continue developing this free plugin and other awesome WordPress resources.', 'ga-google-analytics');
67
+
68
+ ?>
69
+
70
+ <style type="text/css">
71
+ #project-wrap { width: 100%; overflow: hidden; }
72
+ #project-wrap p { margin-top: 5px; font-size: 12px; }
73
+ #project-wrap .project-support { float: left; max-width: 480px; }
74
+
75
+ #project-wrap .project-links { width: 100%; overflow: hidden; margin: 15px 0; }
76
+ #project-wrap .project-links img { display: block; width: 125px; height: 125px; margin: 0; padding: 0; border: 0; background-color: #fff; color: #fff; }
77
+ #project-wrap .project-links a { float: left; width: 125px; height: 125px; margin: 0 0 0 15px; padding: 1px; border: 1px solid #ccc; opacity: 0.9; }
78
+ #project-wrap .project-links a:hover { opacity: 1.0; }
79
+
80
+ #project-wrap .project-blurb {
81
+ float: left; width: 220px; box-sizing: border-box; margin: 0 0 25px 20px; padding: 15px 20px; border-radius: 5px;
82
+ background-color: #fefefe; border: 1px solid #ccc; box-shadow: 0 20px 25px -20px rgba(0,0,0,0.7);
83
+ }
84
+ #project-wrap .project-blurb a { text-decoration: none; }
85
+ #project-wrap .project-blurb a:hover { text-decoration: underline; }
86
+ #project-wrap .project-blurb p { margin-left: 0; margin-right: 0; }
87
+ #project-wrap .project-blurb p:first-child { margin: 0 0 10px 0; font-size: 13px; }
88
+ #project-wrap .project-blurb ul { margin: 0; padding: 0; font-size: 12px; }
89
+ #project-wrap .project-blurb li { margin: 5px 0; list-style: none; }
90
+
91
+ @media (max-width: 520px) {
92
+ #project-wrap .project-links a { margin-bottom: 15px; }
93
+ }
94
+ </style>
95
+ <div id="project-wrap">
96
+ <div class="project-support">
97
+ <div class="project-message">
98
+ <p><?php echo $message; ?></p>
99
+ </div>
100
+ <div class="project-links">
101
+ <?php echo $item1 . $item2 . $item3; ?>
102
+ </div>
103
+ </div>
104
+ <div class="project-blurb">
105
+ <p><strong>Please Donate</strong></p>
106
+ <p><?php echo $donate; ?></p>
107
+ <ul>
108
+ <li><a target="_blank" href="https://m0n.co/donate">Donate via PayPal &raquo;</a></li>
109
+ <li><a target="_blank" href="https://m0n.co/bitcoin">Donate via Bitcoin &raquo;</a></li>
110
+ </ul>
111
+ </div>
112
+ </div>
js/settings.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* GA Google Analytics */
2
+
3
+ jQuery(document).ready(function($) {
4
+
5
+ $('.default-hidden').hide();
6
+
7
+ $('h2').click(function() { $(this).next().slideToggle(300); });
8
+
9
+ $('.gap-toggle-all a').click(function(e) { e.preventDefault(); $('.toggle').slideToggle(300); });
10
+
11
+ $('.gap-toggle').click(function(e) { e.preventDefault(); $('.toggle').slideUp(300); $('#gap-panel-'+ $(this).data('target') +' .toggle').slideDown(300); });
12
+
13
+ $('.gap-reset-options').click(function() { return confirm(ga_google_analytics.confirm_message); });
14
+
15
+ $('.gap-select-method:nth-child(1), .gap-select-method:nth-child(3)').click(function() { $('.gap-info-universal').slideDown(300); });
16
+
17
+ $('.gap-select-method:nth-child(2)').click(function() { $('.gap-info-universal').slideUp(300); });
18
+
19
+ });
languages/ga-google-analytics.pot ADDED
@@ -0,0 +1,457 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #, fuzzy
2
+ msgid ""
3
+ msgstr ""
4
+ "Project-Id-Version: GA Google Analytics\n"
5
+ "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2018-03-06 02:41+0000\n"
7
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
+ "Language-Team: \n"
10
+ "Language: \n"
11
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Loco https://localise.biz/"
16
+
17
+ #. Name of the plugin
18
+ #: ga-google-analytics.php:66 ga-google-analytics.php:84
19
+ msgid "GA Google Analytics"
20
+ msgstr ""
21
+
22
+ #: ga-google-analytics.php:85 inc/support-panel.php:5
23
+ msgid "Google Analytics"
24
+ msgstr ""
25
+
26
+ #: ga-google-analytics.php:114
27
+ msgid "Are you sure you want to restore all default options?"
28
+ msgstr ""
29
+
30
+ #: ga-google-analytics.php:125
31
+ msgid "Settings"
32
+ msgstr ""
33
+
34
+ #: ga-google-analytics.php:140
35
+ msgid "Click here to rate and review this plugin on WordPress.org"
36
+ msgstr ""
37
+
38
+ #: ga-google-analytics.php:141
39
+ msgid "Rate this plugin"
40
+ msgstr ""
41
+
42
+ #: ga-google-analytics.php:163
43
+ msgid "requires WordPress "
44
+ msgstr ""
45
+
46
+ #: ga-google-analytics.php:164
47
+ msgid " or higher, and has been deactivated! "
48
+ msgstr ""
49
+
50
+ #: ga-google-analytics.php:165
51
+ msgid "Please return to the"
52
+ msgstr ""
53
+
54
+ #: ga-google-analytics.php:166
55
+ msgid "WP Admin Area"
56
+ msgstr ""
57
+
58
+ #: ga-google-analytics.php:166
59
+ msgid "to upgrade WordPress and try again."
60
+ msgstr ""
61
+
62
+ #: ga-google-analytics.php:226
63
+ msgid "Default options restored."
64
+ msgstr ""
65
+
66
+ #: ga-google-analytics.php:230
67
+ msgid "No changes made to options."
68
+ msgstr ""
69
+
70
+ #: ga-google-analytics.php:262 ga-google-analytics.php:268
71
+ msgid "Cheatin&rsquo; huh?"
72
+ msgstr ""
73
+
74
+ #: ga-google-analytics.php:347
75
+ msgid "Include tracking code in page head (via"
76
+ msgstr ""
77
+
78
+ #: ga-google-analytics.php:347 ga-google-analytics.php:351
79
+ msgid ")"
80
+ msgstr ""
81
+
82
+ #: ga-google-analytics.php:351
83
+ msgid "Include tracking code in page footer (via"
84
+ msgstr ""
85
+
86
+ #: ga-google-analytics.php:363 inc/settings-display.php:62
87
+ msgid "Universal Analytics"
88
+ msgstr ""
89
+
90
+ #: ga-google-analytics.php:364 inc/settings-display.php:63
91
+ msgid "Global Site Tag"
92
+ msgstr ""
93
+
94
+ #: ga-google-analytics.php:365
95
+ msgid "Legacy"
96
+ msgstr ""
97
+
98
+ #: ga-google-analytics.php:371
99
+ msgid "(default)"
100
+ msgstr ""
101
+
102
+ #: ga-google-analytics.php:375
103
+ msgid "(new method)"
104
+ msgstr ""
105
+
106
+ #: ga-google-analytics.php:379
107
+ msgid "(deprecated)"
108
+ msgstr ""
109
+
110
+ #: ga-google-analytics.php:442
111
+ msgid "Restore default plugin options"
112
+ msgstr ""
113
+
114
+ #: inc/settings-display.php:9
115
+ msgid "Toggle all panels"
116
+ msgstr ""
117
+
118
+ #: inc/settings-display.php:21
119
+ msgid "Overview"
120
+ msgstr ""
121
+
122
+ #: inc/settings-display.php:27
123
+ msgid ""
124
+ "This plugin adds the GA Tracking Code to your site. Log in to your Google "
125
+ "account to view your stats."
126
+ msgstr ""
127
+
128
+ #: inc/settings-display.php:30 inc/settings-display.php:50
129
+ msgid "How to Use"
130
+ msgstr ""
131
+
132
+ #: inc/settings-display.php:31 inc/settings-display.php:87
133
+ msgid "Plugin Settings"
134
+ msgstr ""
135
+
136
+ #: inc/settings-display.php:32 inc/settings-display.php:252
137
+ msgid "Plugin Homepage"
138
+ msgstr ""
139
+
140
+ #: inc/settings-display.php:36
141
+ msgid "If you like this plugin, please"
142
+ msgstr ""
143
+
144
+ #: inc/settings-display.php:37
145
+ msgid "THANK YOU for your support!"
146
+ msgstr ""
147
+
148
+ #: inc/settings-display.php:38
149
+ msgid "give it a 5-star rating"
150
+ msgstr ""
151
+
152
+ #: inc/settings-display.php:56
153
+ msgid "How to use this plugin:"
154
+ msgstr ""
155
+
156
+ #: inc/settings-display.php:59
157
+ msgid "Visit the \"Plugin Settings\" panel"
158
+ msgstr ""
159
+
160
+ #: inc/settings-display.php:60
161
+ msgid "Enter your GA Tracking ID"
162
+ msgstr ""
163
+
164
+ #: inc/settings-display.php:62
165
+ msgid "Choose either"
166
+ msgstr ""
167
+
168
+ #: inc/settings-display.php:63 inc/support-panel.php:62
169
+ msgid "or"
170
+ msgstr ""
171
+
172
+ #: inc/settings-display.php:65
173
+ msgid "Configure any other plugin settings as desired (optional)"
174
+ msgstr ""
175
+
176
+ #: inc/settings-display.php:68
177
+ msgid ""
178
+ "Save changes and done. After 24-48 hours, you can log into your Google "
179
+ "Analytics account to view your stats."
180
+ msgstr ""
181
+
182
+ #: inc/settings-display.php:72
183
+ msgid ""
184
+ "Note that it can take 24-48 hours after adding the tracking code before any "
185
+ "analytical data appears in your"
186
+ msgstr ""
187
+
188
+ #: inc/settings-display.php:73
189
+ msgid "Google Analytics account"
190
+ msgstr ""
191
+
192
+ #: inc/settings-display.php:74
193
+ msgid ""
194
+ "To check that the GA tacking code is included, look at the source code of "
195
+ "your web page(s). Learn more at the"
196
+ msgstr ""
197
+
198
+ #: inc/settings-display.php:75
199
+ msgid "Google Analytics Help Center"
200
+ msgstr ""
201
+
202
+ #: inc/settings-display.php:95
203
+ msgid "GA Tracking ID"
204
+ msgstr ""
205
+
206
+ #: inc/settings-display.php:99
207
+ msgid "Tracking Method"
208
+ msgstr ""
209
+
210
+ #: inc/settings-display.php:108 inc/settings-display.php:112
211
+ msgid "Display Advertising"
212
+ msgstr ""
213
+
214
+ #: inc/settings-display.php:111 inc/settings-display.php:119
215
+ #: inc/settings-display.php:127 inc/settings-display.php:135
216
+ msgid "Enable support for"
217
+ msgstr ""
218
+
219
+ #: inc/settings-display.php:116
220
+ msgid "Link Attribution"
221
+ msgstr ""
222
+
223
+ #: inc/settings-display.php:120
224
+ msgid "Enhanced Link Attribution"
225
+ msgstr ""
226
+
227
+ #: inc/settings-display.php:124 inc/settings-display.php:128
228
+ msgid "IP Anonymization"
229
+ msgstr ""
230
+
231
+ #: inc/settings-display.php:132 inc/settings-display.php:136
232
+ msgid "Force SSL"
233
+ msgstr ""
234
+
235
+ #: inc/settings-display.php:145
236
+ msgid "Code Location"
237
+ msgstr ""
238
+
239
+ #: inc/settings-display.php:149
240
+ msgid ""
241
+ "Tip: Google recommends including the tracking code in the page head, but "
242
+ "including it in the footer can benefit page performance."
243
+ msgstr ""
244
+
245
+ #: inc/settings-display.php:150
246
+ msgid "If in doubt, go with the head option."
247
+ msgstr ""
248
+
249
+ #: inc/settings-display.php:155
250
+ msgid "Custom Tracker Objects"
251
+ msgstr ""
252
+
253
+ #: inc/settings-display.php:159
254
+ msgid "Any code entered here will be added to"
255
+ msgstr ""
256
+
257
+ #: inc/settings-display.php:160
258
+ msgid "for Universal Analytics, or added to"
259
+ msgstr ""
260
+
261
+ #: inc/settings-display.php:161
262
+ msgid "for Global Site Tag."
263
+ msgstr ""
264
+
265
+ #: inc/settings-display.php:162
266
+ msgid "Learn more about creating trackers"
267
+ msgstr ""
268
+
269
+ #: inc/settings-display.php:167
270
+ msgid "Custom GA Code"
271
+ msgstr ""
272
+
273
+ #: inc/settings-display.php:171
274
+ msgid ""
275
+ "Any code entered here will be added to the GA code snippet. This is useful "
276
+ "for things like"
277
+ msgstr ""
278
+
279
+ #: inc/settings-display.php:172
280
+ msgid "creating multiple trackers"
281
+ msgstr ""
282
+
283
+ #: inc/settings-display.php:173
284
+ msgid "and"
285
+ msgstr ""
286
+
287
+ #: inc/settings-display.php:173
288
+ msgid "Google Optimize"
289
+ msgstr ""
290
+
291
+ #: inc/settings-display.php:174
292
+ msgid "Can use"
293
+ msgstr ""
294
+
295
+ #: inc/settings-display.php:174
296
+ msgid "to display the current user ID."
297
+ msgstr ""
298
+
299
+ #: inc/settings-display.php:179 inc/settings-display.php:189
300
+ msgid "Custom"
301
+ msgstr ""
302
+
303
+ #: inc/settings-display.php:179
304
+ msgid "Code"
305
+ msgstr ""
306
+
307
+ #: inc/settings-display.php:183
308
+ msgid "Here you may specify any markup to be displayed in the"
309
+ msgstr ""
310
+
311
+ #: inc/settings-display.php:184
312
+ msgid ""
313
+ "section (or in the footer, depending on the \"Code Location\" setting, above)"
314
+ "."
315
+ msgstr ""
316
+
317
+ #: inc/settings-display.php:189
318
+ msgid "Location"
319
+ msgstr ""
320
+
321
+ #: inc/settings-display.php:192
322
+ msgid "Display custom"
323
+ msgstr ""
324
+
325
+ #: inc/settings-display.php:192
326
+ msgid "code"
327
+ msgstr ""
328
+
329
+ #: inc/settings-display.php:192
330
+ msgid "before"
331
+ msgstr ""
332
+
333
+ #: inc/settings-display.php:193
334
+ msgid "GA tracking code. Leave unchecked to display"
335
+ msgstr ""
336
+
337
+ #: inc/settings-display.php:193
338
+ msgid "after"
339
+ msgstr ""
340
+
341
+ #: inc/settings-display.php:193
342
+ msgid "the tracking code."
343
+ msgstr ""
344
+
345
+ #: inc/settings-display.php:197
346
+ msgid "Admin Area"
347
+ msgstr ""
348
+
349
+ #: inc/settings-display.php:200
350
+ msgid "Enable GA in the WordPress Admin Area"
351
+ msgstr ""
352
+
353
+ #: inc/settings-display.php:204
354
+ msgid "Admin Users"
355
+ msgstr ""
356
+
357
+ #: inc/settings-display.php:207
358
+ msgid "Disable tracking of Admin-level users"
359
+ msgstr ""
360
+
361
+ #: inc/settings-display.php:214
362
+ msgid "Save Changes"
363
+ msgstr ""
364
+
365
+ #: inc/settings-display.php:222
366
+ msgid "Restore Defaults"
367
+ msgstr ""
368
+
369
+ #: inc/settings-display.php:226
370
+ msgid "Click the link to restore the default plugin options."
371
+ msgstr ""
372
+
373
+ #: inc/settings-display.php:236
374
+ msgid "Show Support"
375
+ msgstr ""
376
+
377
+ #: inc/settings-display.php:253
378
+ msgid "by"
379
+ msgstr ""
380
+
381
+ #: inc/settings-display.php:254
382
+ msgid "Jeff Starr on Twitter"
383
+ msgstr ""
384
+
385
+ #: inc/settings-display.php:255
386
+ msgid "@"
387
+ msgstr ""
388
+
389
+ #: inc/settings-display.php:256
390
+ msgid "Obsessive Web Development"
391
+ msgstr ""
392
+
393
+ #: inc/support-panel.php:52
394
+ msgid "Perishable Press Books"
395
+ msgstr ""
396
+
397
+ #: inc/support-panel.php:53
398
+ msgid "Plugin Planet"
399
+ msgstr ""
400
+
401
+ #: inc/support-panel.php:54
402
+ msgid "Donate via PayPal"
403
+ msgstr ""
404
+
405
+ #: inc/support-panel.php:56
406
+ msgid "books"
407
+ msgstr ""
408
+
409
+ #: inc/support-panel.php:57
410
+ msgid "plugins"
411
+ msgstr ""
412
+
413
+ #: inc/support-panel.php:58
414
+ msgid "donation"
415
+ msgstr ""
416
+
417
+ #: inc/support-panel.php:60
418
+ msgid "Thank you for using"
419
+ msgstr ""
420
+
421
+ #: inc/support-panel.php:61
422
+ msgid "Please show support by purchasing one of my"
423
+ msgstr ""
424
+
425
+ #: inc/support-panel.php:62
426
+ msgid "or by making a"
427
+ msgstr ""
428
+
429
+ #: inc/support-panel.php:63
430
+ msgid "Your generous support helps to ensure future development of"
431
+ msgstr ""
432
+
433
+ #: inc/support-panel.php:64
434
+ msgid "and is greatly appreciated."
435
+ msgstr ""
436
+
437
+ #: inc/support-panel.php:66
438
+ msgid ""
439
+ "Any size donation helps me to continue developing this free plugin and other "
440
+ "awesome WordPress resources."
441
+ msgstr ""
442
+
443
+ #. Description of the plugin
444
+ msgid "Adds your Google Analytics Tracking Code to your WordPress site."
445
+ msgstr ""
446
+
447
+ #. URI of the plugin
448
+ msgid "https://perishablepress.com/google-analytics-plugin/"
449
+ msgstr ""
450
+
451
+ #. Author of the plugin
452
+ msgid "Jeff Starr"
453
+ msgstr ""
454
+
455
+ #. Author URI of the plugin
456
+ msgid "https://plugin-planet.com/"
457
+ msgstr ""
languages/gap.pot DELETED
@@ -1,421 +0,0 @@
1
- #, fuzzy
2
- msgid ""
3
- msgstr ""
4
- "Project-Id-Version: GA Google Analytics\n"
5
- "Report-Msgid-Bugs-To: \n"
6
- "POT-Creation-Date: 2017-11-02 00:58+0000\n"
7
- "POT-Revision-Date: Wed Aug 31 2016 16:01:29 GMT-0700 (PDT)\n"
8
- "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
9
- "Last-Translator: \n"
10
- "Language-Team: \n"
11
- "Language: \n"
12
- "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION\n"
13
- "MIME-Version: 1.0\n"
14
- "Content-Type: text/plain; charset=UTF-8\n"
15
- "Content-Transfer-Encoding: 8bit\n"
16
- "X-Poedit-SourceCharset: UTF-8\n"
17
- "X-Poedit-Basepath: .\n"
18
- "X-Poedit-SearchPath-0: ..\n"
19
- "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
20
- "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
21
- "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
22
- "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
23
- "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
24
- "X-Generator: Loco - https://localise.biz/"
25
-
26
- #. Name of the plugin
27
- #: ga-google-analytics.php:42
28
- msgid "GA Google Analytics"
29
- msgstr ""
30
-
31
- #: ga-google-analytics.php:60
32
- msgid "requires WordPress "
33
- msgstr ""
34
-
35
- #: ga-google-analytics.php:60
36
- msgid " or higher, and has been deactivated!"
37
- msgstr ""
38
-
39
- #: ga-google-analytics.php:61
40
- msgid "Please return to the "
41
- msgstr ""
42
-
43
- #: ga-google-analytics.php:61
44
- msgid "WordPress Admin area"
45
- msgstr ""
46
-
47
- #: ga-google-analytics.php:61
48
- msgid "to upgrade WordPress and try again."
49
- msgstr ""
50
-
51
- #: ga-google-analytics.php:161
52
- msgid "Settings"
53
- msgstr ""
54
-
55
- #: ga-google-analytics.php:174
56
- msgid "Give us a 5-star rating at WordPress.org"
57
- msgstr ""
58
-
59
- #: ga-google-analytics.php:175
60
- msgid "Rate this plugin"
61
- msgstr ""
62
-
63
- #: ga-google-analytics.php:286
64
- msgid "Include code in the document head (via wp_head)"
65
- msgstr ""
66
-
67
- #: ga-google-analytics.php:290
68
- msgid "Include code in the document footer (via wp_footer)"
69
- msgstr ""
70
-
71
- #: ga-google-analytics.php:357
72
- msgid "Toggle all panels"
73
- msgstr ""
74
-
75
- #: ga-google-analytics.php:366
76
- msgid "Important"
77
- msgstr ""
78
-
79
- #: ga-google-analytics.php:370
80
- msgid "Universal Analytics is now the standard for Google Analytics."
81
- msgstr ""
82
-
83
- #: ga-google-analytics.php:371
84
- msgid ""
85
- "Please read the following info and migrate by enabling Universal Analytics "
86
- "in the plugin settings."
87
- msgstr ""
88
-
89
- #: ga-google-analytics.php:372
90
- msgid ""
91
- "Universal Analytics will be the default setting in an future version of this "
92
- "plugin (probably in 2018)."
93
- msgstr ""
94
-
95
- #: ga-google-analytics.php:375
96
- msgid "Learn about Universal Analytics"
97
- msgstr ""
98
-
99
- #: ga-google-analytics.php:376
100
- msgid "Universal Analytics Upgrade Center"
101
- msgstr ""
102
-
103
- #: ga-google-analytics.php:381
104
- msgid "Dismiss notice"
105
- msgstr ""
106
-
107
- #: ga-google-analytics.php:389
108
- msgid "Overview"
109
- msgstr ""
110
-
111
- #: ga-google-analytics.php:392
112
- msgid ""
113
- "This plugin adds the GA Tracking Code to your site. Log in to your Google "
114
- "account to view your stats."
115
- msgstr ""
116
-
117
- #: ga-google-analytics.php:394 ga-google-analytics.php:409
118
- msgid "How to Use"
119
- msgstr ""
120
-
121
- #: ga-google-analytics.php:395 ga-google-analytics.php:432
122
- msgid "Plugin Settings"
123
- msgstr ""
124
-
125
- #: ga-google-analytics.php:396
126
- msgid "Plugin Homepage"
127
- msgstr ""
128
-
129
- #: ga-google-analytics.php:399
130
- msgid "If you like this plugin, please"
131
- msgstr ""
132
-
133
- #: ga-google-analytics.php:400
134
- msgid "THANK YOU for your support!"
135
- msgstr ""
136
-
137
- #: ga-google-analytics.php:401
138
- msgid "give it a 5-star rating"
139
- msgstr ""
140
-
141
- #: ga-google-analytics.php:412
142
- msgid "How to use"
143
- msgstr ""
144
-
145
- #: ga-google-analytics.php:414
146
- msgid "In the plugin settings, enter your GA Property ID."
147
- msgstr ""
148
-
149
- #: ga-google-analytics.php:415
150
- msgid ""
151
- "In the plugin settings, enable either \"Legacy Analytics\" or \"Universal "
152
- "Analytics\"."
153
- msgstr ""
154
-
155
- #: ga-google-analytics.php:416
156
- msgid "Configure other settings (optional) as desired and save your changes."
157
- msgstr ""
158
-
159
- #: ga-google-analytics.php:417
160
- msgid ""
161
- "After 24-48 hours, you can log into your Google Analytics account to view "
162
- "your stats."
163
- msgstr ""
164
-
165
- #: ga-google-analytics.php:421
166
- msgid ""
167
- "Note that it can take 24-48 hours after adding the tracking code before any "
168
- "analytical data appears in your"
169
- msgstr ""
170
-
171
- #: ga-google-analytics.php:422
172
- msgid "Google Analytics account"
173
- msgstr ""
174
-
175
- #: ga-google-analytics.php:423
176
- msgid ""
177
- "To check that the GA tacking code is included, look at the source code of "
178
- "your web page(s). Learn more at the"
179
- msgstr ""
180
-
181
- #: ga-google-analytics.php:424
182
- msgid "Google Analytics Help Center"
183
- msgstr ""
184
-
185
- #: ga-google-analytics.php:434
186
- msgid "Enter your Tracking Code and choose your options."
187
- msgstr ""
188
-
189
- #: ga-google-analytics.php:438
190
- msgid "GA Property ID"
191
- msgstr ""
192
-
193
- #: ga-google-analytics.php:442
194
- msgid "Enable Analytics"
195
- msgstr ""
196
-
197
- #: ga-google-analytics.php:445
198
- msgid "Enable Google Analytics on your site. Uses"
199
- msgstr ""
200
-
201
- #: ga-google-analytics.php:446
202
- msgid "Legacy Analytics"
203
- msgstr ""
204
-
205
- #: ga-google-analytics.php:447
206
- msgid ""
207
- "by default. To use Universal Analytics, check this box and enable the next "
208
- "setting."
209
- msgstr ""
210
-
211
- #: ga-google-analytics.php:451 ga-google-analytics.php:454
212
- msgid "Universal Analytics"
213
- msgstr ""
214
-
215
- #: ga-google-analytics.php:454
216
- msgid "Enable"
217
- msgstr ""
218
-
219
- #: ga-google-analytics.php:458 ga-google-analytics.php:461
220
- msgid "Display Advertising"
221
- msgstr ""
222
-
223
- #: ga-google-analytics.php:461 ga-google-analytics.php:468
224
- #: ga-google-analytics.php:475 ga-google-analytics.php:482
225
- msgid "Enable support for"
226
- msgstr ""
227
-
228
- #: ga-google-analytics.php:465
229
- msgid "Link Attribution"
230
- msgstr ""
231
-
232
- #: ga-google-analytics.php:468
233
- msgid "Enhanced Link Attribution"
234
- msgstr ""
235
-
236
- #: ga-google-analytics.php:472 ga-google-analytics.php:475
237
- msgid "IP Anonymization"
238
- msgstr ""
239
-
240
- #: ga-google-analytics.php:479
241
- msgid "Force SSL"
242
- msgstr ""
243
-
244
- #: ga-google-analytics.php:486
245
- msgid "Code Location"
246
- msgstr ""
247
-
248
- #: ga-google-analytics.php:504
249
- msgid ""
250
- "Tip: Google recommends including the Tracking Code in the document header, "
251
- "but including it in the footer can benefit page performance."
252
- msgstr ""
253
-
254
- #: ga-google-analytics.php:505
255
- msgid ""
256
- "If in doubt, go with the default option to include the code in the header."
257
- msgstr ""
258
-
259
- #: ga-google-analytics.php:510
260
- msgid "Custom Tracker Objects"
261
- msgstr ""
262
-
263
- #: ga-google-analytics.php:514
264
- msgid "Any code entered here will be added to the primary"
265
- msgstr ""
266
-
267
- #: ga-google-analytics.php:515
268
- msgid "function as the fourth parameter."
269
- msgstr ""
270
-
271
- #: ga-google-analytics.php:516
272
- msgid "Learn more about creating trackers"
273
- msgstr ""
274
-
275
- #: ga-google-analytics.php:521
276
- msgid "Custom GA Code"
277
- msgstr ""
278
-
279
- #: ga-google-analytics.php:525
280
- msgid ""
281
- "Any code entered here will be added to the GA code snippet. This is useful "
282
- "for things like"
283
- msgstr ""
284
-
285
- #: ga-google-analytics.php:526
286
- msgid "creating multiple trackers"
287
- msgstr ""
288
-
289
- #: ga-google-analytics.php:527
290
- msgid "and"
291
- msgstr ""
292
-
293
- #: ga-google-analytics.php:527
294
- msgid "Google Optimize"
295
- msgstr ""
296
-
297
- #: ga-google-analytics.php:528
298
- msgid "Can use"
299
- msgstr ""
300
-
301
- #: ga-google-analytics.php:528
302
- msgid "to display the current user ID."
303
- msgstr ""
304
-
305
- #: ga-google-analytics.php:533 ga-google-analytics.php:543
306
- msgid "Custom"
307
- msgstr ""
308
-
309
- #: ga-google-analytics.php:533
310
- msgid "Code"
311
- msgstr ""
312
-
313
- #: ga-google-analytics.php:537
314
- msgid "Here you may specify any markup to be displayed in the"
315
- msgstr ""
316
-
317
- #: ga-google-analytics.php:538
318
- msgid ""
319
- "section (or in the footer, depending on the \"Code Location\" setting, above)"
320
- "."
321
- msgstr ""
322
-
323
- #: ga-google-analytics.php:543
324
- msgid "Location"
325
- msgstr ""
326
-
327
- #: ga-google-analytics.php:546
328
- msgid "Display custom"
329
- msgstr ""
330
-
331
- #: ga-google-analytics.php:546
332
- msgid "code"
333
- msgstr ""
334
-
335
- #: ga-google-analytics.php:546
336
- msgid "before"
337
- msgstr ""
338
-
339
- #: ga-google-analytics.php:547
340
- msgid "GA tracking code. Leave unchecked to display"
341
- msgstr ""
342
-
343
- #: ga-google-analytics.php:547
344
- msgid "after"
345
- msgstr ""
346
-
347
- #: ga-google-analytics.php:547
348
- msgid "the tracking code."
349
- msgstr ""
350
-
351
- #: ga-google-analytics.php:551
352
- msgid "Admin Area"
353
- msgstr ""
354
-
355
- #: ga-google-analytics.php:554
356
- msgid "Enable GA in the WordPress Admin Area"
357
- msgstr ""
358
-
359
- #: ga-google-analytics.php:558
360
- msgid "Admin Users"
361
- msgstr ""
362
-
363
- #: ga-google-analytics.php:561
364
- msgid "Disable GA on the frontend for Admin-level users"
365
- msgstr ""
366
-
367
- #: ga-google-analytics.php:566 ga-google-analytics.php:583
368
- msgid "Save Settings"
369
- msgstr ""
370
-
371
- #: ga-google-analytics.php:571
372
- msgid "Restore Defaults"
373
- msgstr ""
374
-
375
- #: ga-google-analytics.php:575
376
- msgid "Restore default options upon plugin deactivation/reactivation."
377
- msgstr ""
378
-
379
- #: ga-google-analytics.php:579
380
- msgid "Tip:"
381
- msgstr ""
382
-
383
- #: ga-google-analytics.php:579
384
- msgid "leave this option unchecked to remember your settings."
385
- msgstr ""
386
-
387
- #: ga-google-analytics.php:580
388
- msgid ""
389
- "Or, to go ahead and restore all default options, check the box, save your "
390
- "settings, and then deactivate/reactivate the plugin."
391
- msgstr ""
392
-
393
- #: ga-google-analytics.php:588
394
- msgid "Show Support"
395
- msgstr ""
396
-
397
- #: ga-google-analytics.php:630
398
- msgid "Save Preference"
399
- msgstr ""
400
-
401
- #: ga-google-analytics.php:636
402
- msgid ""
403
- "Are you sure you want to restore all default options? (this action cannot be "
404
- "undone)"
405
- msgstr ""
406
-
407
- #. Description of the plugin
408
- msgid "Adds your Google Analytics Tracking Code to your WordPress site."
409
- msgstr ""
410
-
411
- #. URI of the plugin
412
- msgid "https://perishablepress.com/google-analytics-plugin/"
413
- msgstr ""
414
-
415
- #. Author of the plugin
416
- msgid "Jeff Starr"
417
- msgstr ""
418
-
419
- #. Author URI of the plugin
420
- msgid "https://plugin-planet.com/"
421
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -9,11 +9,11 @@ Author URI: https://plugin-planet.com/
9
  Donate link: https://m0n.co/donate
10
  Contributors: specialk
11
  Requires at least: 4.1
12
- Tested up to: 4.9
13
- Stable tag: 20171103
14
- Version: 20171103
15
  Requires PHP: 5.2
16
- Text Domain: gap
17
  Domain Path: /languages
18
  License: GPL v2 or later
19
 
@@ -23,6 +23,8 @@ Adds your Google Analytics Tracking Code to your WordPress site.
23
 
24
  == Description ==
25
 
 
 
26
  This plugin enables Google Analytics for your entire WordPress site. Lightweight and fast with plenty of great features.
27
 
28
  **Features**
@@ -30,27 +32,30 @@ This plugin enables Google Analytics for your entire WordPress site. Lightweight
30
  * Blazing fast performance
31
  * Does one thing and does it well
32
  * Drop-dead simple and easy to use
33
- * Uses latest version of tracking code
34
  * Includes tracking code in header or footer
35
- * Inserts tracking code on all WordPress web pages
36
  * Includes option to add your own custom markup
37
  * Sleek plugin Settings page with toggling panels
38
- * Lightweight, and born of simplicity, no frills
39
- * Option to disable GA on the frontend for admin users
40
- * Option to include or exclude GA in the Admin Area
41
- * Add custom directives to your GA code
42
 
43
  This is a lightweight plugin that inserts the required GA tracking code. To view your site statistics, visit your Google Analytics account.
44
 
45
- **GA Support**
 
 
 
 
 
 
46
 
47
- * Supports [Classic Analytics/ga.js](https://developers.google.com/analytics/devguides/collection/gajs/)
48
- * Supports [Universal Analytics/analytics.js](https://developers.google.com/analytics/devguides/collection/analyticsjs/)
49
  * Supports [Display Advertising](https://support.google.com/analytics/answer/2444872)
50
- * Supports [Enhanced Link Attribution](https://support.google.com/analytics/answer/2558867)
51
- * Supports [Tracker Objects](https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers)
52
  * Supports [IP Anonymization](https://developers.google.com/analytics/devguides/collection/analyticsjs/ip-anonymization)
53
  * Supports [Force SSL](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#forceSSL)
 
54
  * Supports [Google Optimize](https://support.google.com/360suite/optimize/)
55
 
56
  Learn more about [Google Analytics](http://www.google.com/analytics/)!
@@ -64,7 +69,7 @@ Learn more about [Google Analytics](http://www.google.com/analytics/)!
64
  1. Upload the plugin to your blog and activate
65
  2. Visit the settings to configure your options
66
 
67
- After configuring your settings, you can verify that GA code is included by viewing the source code of your web pages.
68
 
69
  __Note:__ this plugin adds the required GA code to your web pages. In order for the code to do anything, it must correspond to an active, properly configured Google Analytics account. Learn more at the [Google Analytics Help Center](https://support.google.com/analytics/?hl=en#topic=3544906).
70
 
@@ -73,13 +78,27 @@ __Note:__ this plugin adds the required GA code to your web pages. In order for
73
 
74
  **Usage**
75
 
76
- After entering your GA Property ID, enable the setting "Enable Google Analytics". This enables the legacy tracking method, which is deprecated and soon to be replaced by the new tracking method, "Universal Analytics". To go ahead and start using Universal Analytics right now, also enable the next setting, "Enable Universal Analytics".
 
 
 
 
 
77
 
78
- Then from there you can enable advanced tracking functionality such as "Display Advertising" and "Link Attribution", depending on your own statistical strategy. If ever in doubt, consult the official [Google Analytics site](https://developers.google.com/analytics/) and [Help Center](https://support.google.com/analytics/?hl=en#topic=3544906).
79
 
 
80
 
81
 
82
- **Upgrades**
 
 
 
 
 
 
 
 
83
 
84
  To upgrade GA Google Analytics, remove the old version and replace with the new version. Or just click "Update" from the Plugins screen and let WordPress do it for you automatically.
85
 
@@ -95,7 +114,7 @@ To restore default plugin options, either uninstall/reinstall the plugin, or vis
95
 
96
  **Uninstalling**
97
 
98
- GA Google Analytics cleans up after itself. All plugin settings will be removed from your database when the plugin is uninstalled via the Plugins screen.
99
 
100
 
101
 
@@ -134,7 +153,7 @@ If the GA tracking code still is not displayed, most likely there is interferenc
134
  You need to wait awhile for Google to collect some data, like at least a day or whatever. Standard stuff for Google Analytics. For more information, check out the [Google Analytics Help Center](https://support.google.com/analytics/?hl=en#topic=3544906).
135
 
136
 
137
- **Can I filter the output of the "Custom GA Code" setting?
138
 
139
  Yes, you can use the `gap_custom_code` filter hook.
140
 
@@ -168,10 +187,10 @@ I develop and maintain this free plugin with love for the WordPress community. T
168
 
169
  And/or purchase one of my premium WordPress plugins:
170
 
171
- * [BBQ Pro](https://plugin-planet.com/bbq-pro/) - Pro version of Block Bad Queries
172
- * [Blackhole Pro](https://plugin-planet.com/blackhole-pro/) - Pro version of Blackhole for Bad Bots
173
- * [SES Pro](https://plugin-planet.com/ses-pro/) - Super-simple &amp; flexible email signup forms
174
- * [USP Pro](https://plugin-planet.com/usp-pro/) - Pro version of User Submitted Posts
175
 
176
  Links, tweets and likes also appreciated. Thanks! :)
177
 
@@ -181,6 +200,19 @@ Links, tweets and likes also appreciated. Thanks! :)
181
 
182
  *Thank you to everyone who shares feedback for GA Google Analytics!*
183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  **20171103**
185
 
186
  * Removes extra `manage_options` check for plugin settings
9
  Donate link: https://m0n.co/donate
10
  Contributors: specialk
11
  Requires at least: 4.1
12
+ Tested up to: 5.0
13
+ Stable tag: 20180303
14
+ Version: 20180303
15
  Requires PHP: 5.2
16
+ Text Domain: ga-google-analytics
17
  Domain Path: /languages
18
  License: GPL v2 or later
19
 
23
 
24
  == Description ==
25
 
26
+ > Supports Global Site Tag / gtag.js !
27
+
28
  This plugin enables Google Analytics for your entire WordPress site. Lightweight and fast with plenty of great features.
29
 
30
  **Features**
32
  * Blazing fast performance
33
  * Does one thing and does it well
34
  * Drop-dead simple and easy to use
35
+ * Stays current with the latest tracking code
36
  * Includes tracking code in header or footer
37
+ * Includes tracking code on all WordPress web pages
38
  * Includes option to add your own custom markup
39
  * Sleek plugin Settings page with toggling panels
40
+ * Option to disable tracking of admin-level users
41
+ * Option to enable page tracking in the Admin Area
42
+ * Easy to customize the tracking code
 
43
 
44
  This is a lightweight plugin that inserts the required GA tracking code. To view your site statistics, visit your Google Analytics account.
45
 
46
+ **GA Tracking Options**
47
+
48
+ * [Universal Analytics](https://developers.google.com/analytics/devguides/collection/analyticsjs/) / analytics.js
49
+ * [Global Site Tag](https://developers.google.com/analytics/devguides/collection/gtagjs/) / gtag.js
50
+ * [Legacy](https://developers.google.com/analytics/devguides/collection/gajs/) / ga.js
51
+
52
+ **GA Feature Support**
53
 
 
 
54
  * Supports [Display Advertising](https://support.google.com/analytics/answer/2444872)
55
+ * Supports [Enhanced Link Attribution](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-link-attribution)
 
56
  * Supports [IP Anonymization](https://developers.google.com/analytics/devguides/collection/analyticsjs/ip-anonymization)
57
  * Supports [Force SSL](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#forceSSL)
58
+ * Supports [Tracker Objects](https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers)
59
  * Supports [Google Optimize](https://support.google.com/360suite/optimize/)
60
 
61
  Learn more about [Google Analytics](http://www.google.com/analytics/)!
69
  1. Upload the plugin to your blog and activate
70
  2. Visit the settings to configure your options
71
 
72
+ After configuring your settings, you can verify that GA tracking code is included by viewing the source code of your web pages.
73
 
74
  __Note:__ this plugin adds the required GA code to your web pages. In order for the code to do anything, it must correspond to an active, properly configured Google Analytics account. Learn more at the [Google Analytics Help Center](https://support.google.com/analytics/?hl=en#topic=3544906).
75
 
78
 
79
  **Usage**
80
 
81
+ To enable Google Analytics tracking on your site, follow these steps:
82
+
83
+ 1. Visit the "Plugin Settings" panel
84
+ 2. Enter your GA Tracking ID
85
+ 3. Choose either [Universal Analytics](https://developers.google.com/analytics/devguides/collection/analyticsjs/) or [Global Site Tag](https://developers.google.com/analytics/devguides/collection/gtagjs/)
86
+ 4. Configure any other plugin settings as desired (optional)
87
 
88
+ Save changes and done. After 24-48 hours, you can log into your Google Analytics account to view your stats.
89
 
90
+ Note that it can take 24-48 hours after adding the tracking code before any analytical data appears in your [Google Analytics account](https://developers.google.com/analytics/). To check that the GA tacking code is included, look at the source code of your web page(s). Learn more at the [Google Analytics Help Center](https://support.google.com/analytics/?hl=en#topic=3544906).
91
 
92
 
93
+ **Upgrading Analytics**
94
+
95
+ Google Analytics tracking methods change over time. First there was `urchin.js`, then `ga.js`, and now `analytics.js`, soon to be replaced officially by `gtag.js`. If you are using an older version and want to upgrade, check out these Google docs:
96
+
97
+ * [Universal Analytics Upgrade Center](https://developers.google.com/analytics/devguides/collection/upgrade/)
98
+ * [Migrate from analytics.js to gtag.js](https://developers.google.com/analytics/devguides/collection/gtagjs/migration)
99
+
100
+
101
+ **Plugin Upgrades**
102
 
103
  To upgrade GA Google Analytics, remove the old version and replace with the new version. Or just click "Update" from the Plugins screen and let WordPress do it for you automatically.
104
 
114
 
115
  **Uninstalling**
116
 
117
+ GA Google Analytics cleans up after itself. All plugin settings will be removed from your database when the plugin is uninstalled via the Plugins screen. Your collected GA data will remain in your Google account.
118
 
119
 
120
 
153
  You need to wait awhile for Google to collect some data, like at least a day or whatever. Standard stuff for Google Analytics. For more information, check out the [Google Analytics Help Center](https://support.google.com/analytics/?hl=en#topic=3544906).
154
 
155
 
156
+ **Can I filter the output of the "Custom GA Code" setting?**
157
 
158
  Yes, you can use the `gap_custom_code` filter hook.
159
 
187
 
188
  And/or purchase one of my premium WordPress plugins:
189
 
190
+ * [BBQ Pro](https://plugin-planet.com/bbq-pro/) - Super fast WordPress firewall
191
+ * [Blackhole Pro](https://plugin-planet.com/blackhole-pro/) - Automatically block bad bots
192
+ * [Banhammer Pro](https://plugin-planet.com/banhammer-pro/) - Monitor traffic and ban the bad guys
193
+ * [USP Pro](https://plugin-planet.com/usp-pro/) - Unlimited front-end forms
194
 
195
  Links, tweets and likes also appreciated. Thanks! :)
196
 
200
 
201
  *Thank you to everyone who shares feedback for GA Google Analytics!*
202
 
203
+ **20180303**
204
+
205
+ * Refactors code base
206
+ * Removes deprecated notice
207
+ * Simplifies plugin settings
208
+ * Adds support for Global Site Tag (`gtag.js`)
209
+ * Makes it easier to reset default plugin options
210
+ * Changes Text Domain from `gap` to `ga-google-analytics`
211
+ * Generates new translation template
212
+ * Improves plugin settings page UI
213
+ * Updates plugin settings images
214
+ * Tests on WordPress 5.0 (alpha)
215
+
216
  **20171103**
217
 
218
  * Removes extra `manage_options` check for plugin settings
support-panel.php DELETED
@@ -1,97 +0,0 @@
1
- <?php // GA Google Analytics - Show Support Panel
2
-
3
- if (!function_exists('add_action')) die();
4
-
5
- $plugin_project = 'Google Analytics';
6
-
7
- $plugin_url = plugin_dir_url(__FILE__);
8
-
9
- $array = array(
10
-
11
- 0 => '<a target="_blank" href="https://plugin-planet.com/bbq-pro/" title="Premium WP Plugin: BBQ Pro">
12
- <img width="125" height="125" src="'. $plugin_url .'images/250x250-bbq-pro.jpg" alt="BBQ Pro - Block Bad Queries" />
13
- </a>',
14
- 1 => '<a target="_blank" href="https://plugin-planet.com/blackhole-pro/" title="Premium WP Plugin: Blackhole Pro">
15
- <img width="125" height="125" src="'. $plugin_url .'images/250x250-blackhole-pro.jpg" alt="Blackhole Pro - Block Bad Bots" />
16
- </a>',
17
- 2 => '<a target="_blank" href="https://plugin-planet.com/ses-pro/" title="Premium WP Plugin: SES Pro">
18
- <img width="125" height="125" src="'. $plugin_url .'images/250x250-ses-pro.jpg" alt="SES Pro - Ajax-Powered Email Signup Forms" />
19
- </a>',
20
- 3 => '<a target="_blank" href="https://plugin-planet.com/usp-pro/" title="Premium WP Plugin: USP Pro">
21
- <img width="125" height="125" src="'. $plugin_url .'images/250x250-usp-pro.jpg" alt="USP Pro - Unlimited Front-End Forms" />
22
- </a>',
23
-
24
- 4 => '<a target="_blank" href="https://digwp.com/" title="Take your WordPress Skills to the Next Level">
25
- <img width="125" height="125" src="'. $plugin_url .'images/250x250-digging-into-wordpress.jpg" alt="Digging Into WordPress" />
26
- </a>',
27
- 5 => '<a target="_blank" href="https://wp-tao.com/" title="Learn the Way of WordPress">
28
- <img width="125" height="125" src="'. $plugin_url .'images/250x250-tao-of-wordpress.jpg" alt="The Tao of WordPress" />
29
- </a>',
30
- 6 => '<a target="_blank" href="https://wp-tao.com/wordpress-themes-book/" title="WordPress Themes In Depth">
31
- <img width="125" height="125" src="'. $plugin_url .'images/250x250-wp-themes-in-depth.jpg" alt="WordPress Themes In Depth" />
32
- </a>',
33
- 7 => '<a target="_blank" href="https://htaccessbook.com/" title="Optimize and Secure with .htaccess">
34
- <img width="125" height="125" src="'. $plugin_url .'images/250x250-htaccess-made-easy.jpg" alt=".htaccess made easy" />
35
- </a>',
36
-
37
- );
38
-
39
- $items = array_rand($array, 3);
40
-
41
- $item1 = isset($array[$items[0]]) ? $array[$items[0]] : 0;
42
- $item2 = isset($array[$items[1]]) ? $array[$items[1]] : 1;
43
- $item3 = isset($array[$items[2]]) ? $array[$items[2]] : 2;
44
-
45
- $message = 'Thank you for using '. $plugin_project .'! Please show support by purchasing one of my
46
- <a target="_blank" href="https://wp-tao.com/store/" title="Perishable Press Books">books</a> or
47
- <a target="_blank" href="https://plugin-planet.com/store/" title="Plugin Planet">plugins</a>,
48
- or by making a <a target="_blank" href="https://m0n.co/donate" title="Donate via PayPal">donation</a>.
49
- Your generous support helps to ensure future development of '. $plugin_project .' and is greatly appreciated.';
50
-
51
- $donate = 'Any size donation helps me to continue developing this free plugin and other awesome WordPress resources.';
52
-
53
- ?>
54
-
55
- <style type="text/css">
56
- #project-wrap { width: 100%; overflow: hidden; }
57
- #project-wrap p { margin-top: 5px; font-size: 12px; }
58
- #project-wrap .project-support { float: left; max-width: 480px; }
59
-
60
- #project-wrap .project-links { width: 100%; overflow: hidden; margin: 15px 0; }
61
- #project-wrap .project-links img { display: block; width: 125px; height: 125px; margin: 0; padding: 0; border: 0; background-color: #fff; color: #fff; }
62
- #project-wrap .project-links a { float: left; width: 125px; height: 125px; margin: 0 0 0 15px; padding: 1px; border: 1px solid #ccc; opacity: 0.9; }
63
- #project-wrap .project-links a:hover { opacity: 1.0; }
64
-
65
- #project-wrap .project-blurb {
66
- float: left; width: 220px; box-sizing: border-box; margin: 0 0 25px 20px; padding: 15px 20px; border-radius: 5px;
67
- background-color: #fefefe; border: 1px solid #ccc; box-shadow: 0 20px 25px -20px rgba(0,0,0,0.7);
68
- }
69
- #project-wrap .project-blurb a { text-decoration: none; }
70
- #project-wrap .project-blurb a:hover { text-decoration: underline; }
71
- #project-wrap .project-blurb p { margin-left: 0; margin-right: 0; }
72
- #project-wrap .project-blurb p:first-child { margin: 0 0 10px 0; font-size: 13px; }
73
- #project-wrap .project-blurb ul { margin: 0; padding: 0; font-size: 12px; }
74
- #project-wrap .project-blurb li { margin: 5px 0; list-style: none; }
75
-
76
- @media (max-width: 520px) {
77
- #project-wrap .project-links a { margin-bottom: 15px; }
78
- }
79
- </style>
80
- <div id="project-wrap">
81
- <div class="project-support">
82
- <div class="project-message">
83
- <p><?php echo $message; ?></p>
84
- </div>
85
- <div class="project-links">
86
- <?php echo $item1 . $item2 . $item3; ?>
87
- </div>
88
- </div>
89
- <div class="project-blurb">
90
- <p><strong>Please Donate</strong></p>
91
- <p><?php echo $donate; ?></p>
92
- <ul>
93
- <li><a target="_blank" href="https://m0n.co/donate">Donate via PayPal &raquo;</a></li>
94
- <li><a target="_blank" href="https://m0n.co/bitcoin">Donate via Bitcoin &raquo;</a></li>
95
- </ul>
96
- </div>
97
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
uninstall.php CHANGED
@@ -1,10 +1,6 @@
1
  <?php // uninstall remove options
2
 
3
- if(!defined('ABSPATH') && !defined('WP_UNINSTALL_PLUGIN')) exit();
4
 
5
  // delete options
6
- delete_option('gap_options');
7
-
8
-
9
-
10
-
1
  <?php // uninstall remove options
2
 
3
+ if (!defined('ABSPATH') && !defined('WP_UNINSTALL_PLUGIN')) exit();
4
 
5
  // delete options
6
+ delete_option('gap_options');