Analytics plugin bug

You may have noticed a recent issue with comment author links: they had  ’%20rel=’external%20nofollow” appended to the end of the URL. Apparently this is an incompatibility bug with the Google Analytics plugin by Rich Boakes (v0.68) and the latest release of WP. I found a thread on the WP support forums detailing a fix which I’m happy to say works. Simply change the following line in googleanalytics.php:

function comment_author_link($text) {
	static $anchorPattern = '(.*href\s*=\s*)[\"\']*(.*)[\"\'] (.*)';

To this:

function comment_author_link($text) {
	static $anchorPattern = '(.*href\s*=\s*)[\"\']*(.*\?)[\"\'] (.*)';

Gotta love regexp. :)

One thought on “Analytics plugin bug

  1. Pingback: Mica bug al plugin-ului Google Analytics (Rich Boakes)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>