Sesam.hu — Engineering Manager & Trail Runner

Sesam.hu

Personal blog by Péter Szilágyi — Engineering Manager and trail runner based in Stockholm.
Writing on leadership, running, and life in the north.

English

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. :)

fixbugAnalyticsTech & Gizmosgooglewordpress

Comments