disqus

I’m a fan of Disqus. It’s a great commenting system, the Gravatar support is a plus, and the comment tracking they have for your profile is awesome. So a few months ago when I was still in the process of creating this blog, I installed it here on Rhymes With Milk using the official Disqus WordPress plugin.

As the process of creating this site started to wind down, I started thinking about validating my code (as any good developer would do). Essentially this just means that I check to see if the organization that governs internet standards thinks my XHTML is up to snuff. And whaddaya know, the homepage alone has over 3 dozen errors*, but none of them are errors I made. They mostly come from the code Disqus adds to the page (with most of the others coming from an embedded YouTube video).

This really rubbed me the wrong way. These weren’t simple negligible errors like “you shouldn’t have a border size declared on an iframe because that’s not allowed” (this in fact is an error on Mark’s blog — I think it’s a Tumblr thing, so give them shit for it, not Mark)** but ones like “there’s an extra link closer-outer tag for a link that doesn’t even exist.” Seriously, Disqus? You didn’t test the plugin before you launched it?

So I decided to hack it. The php files that actually define the plugin’s actions are a bit more advanced than I was prepared for (I can usually pick my way through other people’s code pretty well. Just take a look at my archives. You think those looked like that out-of-the-box? Hell no.). I Googled the problem with very low expectations (Disqus dev documentation is surprisingly scarce) but stumbled upon this gem. This blog takes you step-by-step on how to correct the invalid markup that Disqus adds to your page. Awesome, it just saved me at least 4 hair-pulling hours.

I think the post was written at least one plugin version ago because some things looked a bit different on mine than in the examples, but for the most part I was able to do just what it said verbatim. And happily it worked. My site’s validation checked out (aside from that stupid YouTube video), but for some reason I lost comment count. All posts said that there were zero comments. With my tail between my legs, I got rid of the hacked Disqus and reinstalled a factory-fresh version, complete with its terrible markup.

But not all is lost. The site doesn’t really visually or functionally “break” because of the poorly written code (at least not on good browsers), so in the short run I can ignore the validation issues. And hopefully “the short run” is all that I’ll have to worry about. 3 days ago Disqus posted this on their blog:

We’re nearing the release of our new WordPress plugin that contains bug fixes, better importing, compatibility fixes with themes and other plugins, as well as offers new improvements in performance and speed.

And one of the comment moderators (aka a Disqus employee) said that the plugin is supposed to be released this week! It feels like Christmas in the RWM household. Hopefully they get it right this time. All the way right.

* Take a look for yourself. Click here to see all the errors.

** The only reason I looked at the validation info for his site was because he also has Disqus installed on his blog and I wanted to see if it generated the same errors there, too. It does not because the Tumblr and WordPress inclusion codes are different.

1 Comment »
date Feb 22nd 2010
author Mike
category Geek
tags,
  1 Comment