Version Description
Download this release
Release Info
Developer | cavemonkey50 |
Plugin | Google Analyticator |
Version | 2.14 |
Comparing to | |
See all releases |
Code changes from version 2.13 to 2.14
- google-analyticator.php +14 -14
- readme.txt +5 -1
google-analyticator.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Plugin Name: Google Analyticator
|
4 |
-
* Version: 2.
|
5 |
* Plugin URI: http://cavemonkey50.com/code/google-analyticator/
|
6 |
* Description: Adds the necessary JavaScript code to enable <a href="http://www.google.com/analytics/">Google's Analytics</a>. After enabling this plugin visit <a href="options-general.php?page=google-analyticator.php">the options page</a> and enter your Google Analytics' UID and enable logging.
|
7 |
* Author: Ronald Heft, Jr.
|
@@ -123,7 +123,7 @@ function ga_options_page() {
|
|
123 |
?>
|
124 |
|
125 |
<div class="wrap">
|
126 |
-
<form method="post" action="
|
127 |
<?php ga_nonce_field(); ?>
|
128 |
<h2>Google Analyticator Options</h2>
|
129 |
<h3>Basic Options</h3>
|
@@ -374,24 +374,24 @@ function add_google_analytics() {
|
|
374 |
|
375 |
// Add the ougoing links script
|
376 |
function ga_outgoing_links() {
|
377 |
-
if (
|
378 |
-
if (get_option(
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
add_filter('the_excerpt', 'ga_outgoing', -10);
|
384 |
-
}
|
385 |
}
|
386 |
}
|
387 |
}
|
388 |
|
389 |
// Finds all the links contained in a post or comment
|
390 |
function ga_outgoing($input) {
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
|
|
|
|
395 |
return $input;
|
396 |
}
|
397 |
|
1 |
<?php
|
2 |
/*
|
3 |
* Plugin Name: Google Analyticator
|
4 |
+
* Version: 2.14
|
5 |
* Plugin URI: http://cavemonkey50.com/code/google-analyticator/
|
6 |
* Description: Adds the necessary JavaScript code to enable <a href="http://www.google.com/analytics/">Google's Analytics</a>. After enabling this plugin visit <a href="options-general.php?page=google-analyticator.php">the options page</a> and enter your Google Analytics' UID and enable logging.
|
7 |
* Author: Ronald Heft, Jr.
|
123 |
?>
|
124 |
|
125 |
<div class="wrap">
|
126 |
+
<form method="post" action="options-general.php?page=google-analyticator.php">
|
127 |
<?php ga_nonce_field(); ?>
|
128 |
<h2>Google Analyticator Options</h2>
|
129 |
<h3>Basic Options</h3>
|
374 |
|
375 |
// Add the ougoing links script
|
376 |
function ga_outgoing_links() {
|
377 |
+
if (get_option(key_ga_outbound) == ga_enabled) {
|
378 |
+
if ((get_option(key_ga_admin) == ga_enabled) || ((get_option(key_ga_admin) == ga_disabled) && ( !current_user_can('level_' . get_option(key_ga_admin_level)) ))) {
|
379 |
+
add_filter('comment_text', 'ga_outgoing', -10);
|
380 |
+
add_filter('get_comment_author_link', 'ga_outgoing_comment_author', -10);
|
381 |
+
add_filter('the_content', 'ga_outgoing', -10);
|
382 |
+
add_filter('the_excerpt', 'ga_outgoing', -10);
|
|
|
|
|
383 |
}
|
384 |
}
|
385 |
}
|
386 |
|
387 |
// Finds all the links contained in a post or comment
|
388 |
function ga_outgoing($input) {
|
389 |
+
if ( !is_feed() ) {
|
390 |
+
static $link_pattern = '/<a (.*?)href="(.*?)\/\/(.*?)"(.*?)>(.*?)<\/a>/i';
|
391 |
+
static $link_pattern_2 = '/<a (.*?)href=\'(.*?)\/\/(.*?)\'(.*?)>(.*?)<\/a>/i';
|
392 |
+
$input = preg_replace_callback($link_pattern, ga_parse_link, $input);
|
393 |
+
$input = preg_replace_callback($link_pattern_2, ga_parse_link, $input);
|
394 |
+
}
|
395 |
return $input;
|
396 |
}
|
397 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://cavemonkey50.com/code/
|
|
4 |
Tags: stats, google, analytics, tracking
|
5 |
Requires at least: 2.3
|
6 |
Tested up to: 2.6
|
7 |
-
Stable tag: 2.
|
8 |
|
9 |
Adds the necessary JavaScript code to enable Google Analytics.
|
10 |
|
@@ -55,6 +55,10 @@ Google's servers are slow at crawling for the tracking code. While the code may
|
|
55 |
|
56 |
== Changelog ==
|
57 |
|
|
|
|
|
|
|
|
|
58 |
**2.13** - Bug Fix
|
59 |
- Stops the external link tracking code from appearing in feeds, breaking feed validation.
|
60 |
|
4 |
Tags: stats, google, analytics, tracking
|
5 |
Requires at least: 2.3
|
6 |
Tested up to: 2.6
|
7 |
+
Stable tag: 2.14
|
8 |
|
9 |
Adds the necessary JavaScript code to enable Google Analytics.
|
10 |
|
55 |
|
56 |
== Changelog ==
|
57 |
|
58 |
+
**2.14** - Bug Fix
|
59 |
+
- Stops the external link tracking code from appearing in feeds, breaking feed validation.
|
60 |
+
- Adds compatibility for a very rare few users who cannot save options.
|
61 |
+
|
62 |
**2.13** - Bug Fix
|
63 |
- Stops the external link tracking code from appearing in feeds, breaking feed validation.
|
64 |
|