Wordpress Plugin for Google Analytics
Posted in Code
Forenoon watch, 7 bells (11:42 am)

The WordPress plugin for Google Analytics by Rich Boakes works great except for one small part: it rewrites a link under comment_author_link and doesn't add a space between elements in the a tag, which causes a validation problem with XHTML.

It's simple to add a space on the proper line (272 in v0.68), but I created a diff file you can use to patch it. Hopefully the author updates the file and nobody else has to deal with this problem.

Get the diff file, copy it into your plugins directory where the googleanalytics.php file is, then run the following command:

patch -p1 < googleanalytics.diff

If this is too confusing for you, or you use Windows, change the line (272) from:

return $matches[1] . "\"" . $matches[2] . "\"" . $coolBit . $matches[3];

to

return $matches[1] . "\"" . $matches[2] . "\" " . $coolBit . $matches[3];
Leave a Comment »