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 | ![]() |
Version | 20180303 |
Comparing to | |
See all releases |
Code changes from version 20171103 to 20180303
- css/settings.css +36 -0
- ga-google-analytics.php +398 -589
- img/250x250-banhammer-pro.jpg +0 -0
- {images → img}/250x250-bbq-pro.jpg +0 -0
- {images → img}/250x250-blackhole-pro.jpg +0 -0
- {images → img}/250x250-digging-into-wordpress.jpg +0 -0
- {images → img}/250x250-htaccess-made-easy.jpg +0 -0
- {images → img}/250x250-ses-pro.jpg +0 -0
- {images → img}/250x250-tao-of-wordpress.jpg +0 -0
- {images → img}/250x250-usp-pro.jpg +0 -0
- {images → img}/250x250-wp-themes-in-depth.jpg +0 -0
- gap-logo.jpg → img/gap-logo.jpg +0 -0
- inc/plugin-core.php +223 -0
- inc/settings-display.php +262 -0
- inc/support-panel.php +112 -0
- js/settings.js +19 -0
- languages/ga-google-analytics.pot +457 -0
- languages/gap.pot +0 -421
- readme.txt +57 -25
- support-panel.php +0 -97
- uninstall.php +2 -6
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:
|
13 |
-
Stable tag:
|
14 |
-
Version:
|
15 |
Requires PHP: 5.2
|
16 |
-
Text Domain:
|
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
|
36 |
*/
|
37 |
|
38 |
if (!defined('ABSPATH')) die();
|
39 |
|
40 |
-
|
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 |
-
|
96 |
|
97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
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 |
-
|
174 |
-
|
175 |
-
|
|
|
|
|
176 |
|
177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
}
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
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 |
-
|
|
|
321 |
|
322 |
-
|
323 |
-
|
324 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
|
|
|
|
|
|
|
|
|
|
334 |
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
#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 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
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 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
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'); ?> »
|
400 |
-
</a>
|
401 |
-
</p>
|
402 |
-
</div>
|
403 |
-
</div>
|
404 |
-
</div>
|
405 |
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
428 |
|
429 |
-
|
430 |
-
<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><head></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><head></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><head></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><head></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 |
-
|
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 |
-
|
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 |
-
|
593 |
-
|
|
|
594 |
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
<a target="_blank" href="https://monzillamedia.com/" title="Obsessive Web Design & Development">Monzilla Media</a>
|
599 |
-
</div>
|
600 |
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
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 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
641 |
}
|
642 |
-
|
643 |
-
|
644 |
|
645 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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') .' »';
|
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’ huh?', 'ga-google-analytics'), GAP_VERSION);
|
263 |
+
|
264 |
+
}
|
265 |
+
|
266 |
+
function __wakeup() {
|
267 |
+
|
268 |
+
_doing_it_wrong(__FUNCTION__, esc_html__('Cheatin’ 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'); ?> »
|
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><head></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><head></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><head></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><head></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 »</a></li>
|
109 |
+
<li><a target="_blank" href="https://m0n.co/bitcoin">Donate via Bitcoin »</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’ 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 |