May 15

Undefined index: post-trashed Bug in Disqus Plugin for WordPress

I’ve never actually thought much about trashed posts before today…

I like the looks of the Disqus plugin for WordPress.  In fact, I like the whole look of the Disqus idea.  Why shouldn’t all my comments be lumped under one ID?  Why should other people have to log into my site just to leave valid posts?  Can’t we make this simpler?  It hasn’t been updated in a while, I hope it doesn’t have any bugs.  So I Installed the Disqus plugin on my version 3+ WordPress platform.

What’s this post-trashed thing?

I didn’t notice the bug at first; it only popped up on the dashboard, and it was under the wordpress admin bar.  But there it was, peeking out.

Notice: Undefined index: post-trashed in /data/16/2/86/4/2575493/user/2823750/htdocs/wp-content/plugins/disqus-comment-system/disqus.php on line 908

Since I wasn’t working on my tractor, due to some afternoon rain, and heady from my success with SharePoint at work, I decided to pop the hood of the Disqus plugin and see what was up.  So I fired up Microsoft WebMatrix and loaded the php file.

Line 894 tells it all:

// taken from wp-includes/comment.php – WP 2.8.5

Crap.  The plugin isn’t fully compatible with the new WP 3.x.  So I opened  the new comment.php file in WebMatrix and found the errant line.

Line 906 in the core comment.php file changed to add a bunch of extra values to relay post status to admins.   It adds the trash and post-trashed values.

$approved = array(’0′ => ‘moderated’, ’1′ => ‘approved’, ‘spam’ => ‘spam’, ‘trash’ => ‘trash’, ‘post-trashed’ => ‘post-trashed’);

 

OMG! What’s the fix?

Pasting the preceding into the disqus.php file, over line 903 seems to fix the issue.  The error message no longer pops up.  However, I can’t be certain if the comment counting is correct.  I think it may be off, since the 3.x core file has code excluding posts marked as “post-trashed.”  I’ll have to play with it when I have more time in WebMatrix, then add the final solution to my plugin file.

In the mean time, it looks like Disqus has some updating to do.

 

May 14

Return to the Digital Dark Ages?

So I found myself reading this article(http://www.webmonkey.com/2012/05/mozilla-windows-8-a-return-to-the-digital-dark-ages/) on wired’s webmonkey sub-site.  I remember the web browser wars, and the damage that followed.  MS couldn’t embed their browser, IE, with the OS.  Had they been allowed that privilege back in the 90s, I think we would have seen fewer security holes in IE.  I think the OS would have had better control over the APIs accessed by the browser.  Yes, companies who primarily developed browsers would have lost out.  The option would have been to target another OS.  At the time, apple and Linux would have been viable options.  We lost almost a decade of advancement, back when MS was toying with device specific OS (a slightly different version of the flagship OS for terminals vs desktops vs palm vs servers vs network appliances).  It’s taken us a long time to catch up.  We had to wait until other companies brought us the same services MS got sued for attempting almost two decades ago.  Now we have browsers embedded in devices, via Android, Apple IPhone, and in so many mobile phones (see if you can change the browser in your original Motorola Razor).

It seems as though it’s socially acceptable to lock down devices.  As a potential developer, I welcome the standards associated with the Windows Phones, and am glad to know what to expect when writing for the IPhone.  Maybe it’s time for Firefox to think about creating a mobile OS for tablet makers to install.  Make it light, power conservative and powerful.   Combine security with ease of use.  Make it simple enough for parents to hobble their kids’ access.

It isn’t the dark ages anymore. It’s a wild frontier where anything goes.  Machine is becoming one with code and the Killer App is the Gold Rush of today.  Embrace the frontier.

WordPress Theme Reviews

Aside

I’m going to do weekly reviews on WordPress Themes.  For the most part, I will stay away from the graphics design angle.  That means I’ll be staying away from color choices, font choice, layout.  Instead, I will focus on ease of use, customizeability, plug-in friendliness, coding, SEO, and how far the theme crosses the line between form and function.  In other words, I’ll be looking at the guts of the theme rather than the cosmetics.

My first review will be of the Admired theme by Brad Thomas, scheduled for next week.

May 12

Massive Overhaul

Some background first.  My first experiment with running multiple wordpress engines on one database/one server ran into some issues.  First and foremost was a DNS issue that caused a 401 error when you first hit the site.  Refreshing would bring up the site, but that type of error is unnacceptable.

I took down the site, did some research, and decided that the wheel was developed enough for me to use as-is.  I downloaded the WordPress MU Domain Mapping Plugin from the WordPress Plugin page, and went to work.  Right now, there don’t seem to be any issues.

I’ll update this post later if I see anything worth noting.