Category Archives: WordPress

Quitting IntenseDebate

That’s it. I think I’m done. I’ve had a pretty good relationship with IntenseDebate’s services on my various websites for quite a while now. Sure, there have been hiccups and periodic issues from time to time, but that’s the nature of online technologies, especially ones that are always under constant development. As WordPress has grown and become more powerful, so did IntenseDebate, and as one of Automattic’s services, I had high hopes that it would continue to grow and develop and become a tool as useful as WordPress always has been for me.

But the honeymoon is over. After a couple of years using the service, I have become increasingly frustrated by the chronic problems with IntenseDebate. Comments that users, including myself, submit will sometimes randomly fail to display on my sites, despite showing up in my IntenseDebate dashboard. I have submitted scads of problem reports to IntenseDebate’s support, including direct links to the missing comments. Support will fix those comments, but then we’ll just end up having to repeat the process with random future comments. Months of reporting and dealing with this problem has yielded up no satisfactory solution from IntenseDebate’s developers.

To add insult to injury, I discovered lately that IntenseDebate will now no longer allow me to remain logged in to any of my sites so that I can reply to comments or administrate comments directly on my own sites. I started using IntenseDebate when Automattic acquired them exactly because it was such an easy system to use and it greatly enhanced my ability to have discussions with readers. Now, I’m finding it to be far more of a liability and a hindrance to said discussion than a help — and I’m getting zero satisfaction from IntenseDebate’s supposed support system.

Frankly, I think IntenseDebate’s developers have given up the project as a lost cause and just haven’t bothered to inform their users that they aren’t working on it anymore. This is unfortunate because I’ve always been pretty happy with Automattic’s various projects. WordPress has always been far and away my favorite tool for website development, and I use bbPress almost exclusively now for my forum system (when I use one), despite the fact that it hasn’t undergone any real major development in several years. (I realize that it’s now in a 1.0 alpha plugin form for WordPress, but that isn’t particularly useful to me at the moment.) Automattic also has several other services that are just fantastic, like Gravatar and VaultPress, so I had really hoped they would get their collective act together with IntenseDebate, get it under development again, and really iron out some of these bugs that have so plagued the system for so many months now.

Apparently, this is simply not to be. The only recent post on the “developers” blog has simply been an item on how to hide guest commenting. Yay, exciting.

So, I wash my hands of IntenseDebate. I’m done with it, at least for now and at least until someone decides it’s a worthwhile project to pick up again. Who knows? Maybe Disqus has put IntenseDebate out of business. I just wish they’d let us, their users, know so that we can actually move on.

Maybe it’s time to go check out Disqus. Are they actually still under development?

Thesis vs. WordPress

There’s a lot of buzz right now in the WordPress community about the fact that Chris Pearson’s does not distribute his Thesis theme for WordPress under the same GPL license under which WordPress is distributed. There was a large discussion yesterday over Twitter between Chris and Matt Mullenweg, the owner of Automattic, the company that builds and distributes WordPress. Andrew Warner got these two gentlemen together for a discussion and the video below is the result of that debate.

Business Tips via Mixergy, home of the ambitious upstart!

I didn’t have an opinion on the topic before listening to the discussion, but after having done so, I find Chris’ argument to be specious and arrogant, and I side with Matt’s interpretation of the application of the GPL. It’s pretty clear to me that Chris is flat-out wrong on this issue. I appreciate Matt’s graciousness and patience in a difficult and confrontational situation. The cooler head prevailed.

If you’ve got an hour or so to listen to the audio, I recommend doing so, and I’d be interested to hear your take on the issue.

[via Matt]

Excluding Page IDs from a Custom Query

Available on the DailyBlogTips website is a theme called StudioPress_Red. The theme uses a custom query to list the pages in the site navigation while applying a ‘current page’ class for styling the nav bar. The navigation code sets up a nav scheme with the traditional ‘Home’ button followed by the listing of pages. This works out just fine for the typical blogger who has his blog as his home page. It breaks down a bit, however, for the blogger who wants to set one of her static pages as the Home page, since she will then have both the ‘Home’ button as well as the selected page’s button showing in the nav bar. Typically, with the wp_list_pages function, you can simply add an exclude parameter to hide any pages you don’t want to show. With the StudioPress_Red theme, however, it not quite that straightforward.

Below is the block of navigation code from the header.php file. Line 47 (highlighted) is the line of interest that needs to be modified in order to exclude the appropriate pages from the nav bar:

<div id="nav">
<?php function get_the_pa_ges() {
  global $wpdb;
  if ( ! $these_pages = wp_cache_get('these_pages', 'pages') ) {
     $these_pages = $wpdb->get_results('select ID, post_title from '. $wpdb->posts .' where post_status = "publish" and post_type = "page" order by ID');
}
  return $these_pages;
 }

 function list_all_pages(){

$all_pages = get_the_pa_ges ();
foreach ($all_pages as $thats_all){
$the_page_id = $thats_all->ID;

if (is_page($the_page_id)) {
  $addclass = ' class="current_page"';
  } else {
  $addclass = '';
  }
$output .= '<li' . $addclass . '><a href="'.get_permalink($thats_all->ID).'" title="'.$thats_all->post_title.'"><span>'.$thats_all->post_title.'</span></a></li>';
}

return $output;
 }
?>
<ul>
<?php

if (is_home()) {
  $addclass = ' class="current_page"';
  } else {
  $addclass = '';
  }
echo "<li" . $addclass . "><a href='" . get_option('home') . "' title='Home'><span>Home</span></a></li>";
echo list_all_pages();?>
</ul>

<div class="cleared"></div>
</div> <!-- Closes Nav -->

What line 47 is doing is talking to the WordPress database and retrieving all published pages by their ID numbers and returning the titles of those pages to the navigation list, sorted by the pages’ IDs. In order to exclude certain pages from the list, a new parameter
needs to be added to line 47 to tell function to skip a page that’s set as the Home page. Unfortunately, even the WordPress Codex doesn’t provide any real documentation for page exclusions in a custom query, so you have to know your WordPress core and MySQL syntax to make it work.

Prior to WordPress 2.7, post ID numbers were saved to the database under the post_id field. From WordPress 2.7 and on, post_id was changed to just ID. So, in order to exclude the Home page ID from our custom query, we have to add and ID !="##" to line 47, where ## is the ID number of the page you want:

<div id="nav">
<?php function get_the_pa_ges() {
  global $wpdb;
  if ( ! $these_pages = wp_cache_get('these_pages', 'pages') ) {
     $these_pages = $wpdb->get_results('select ID, post_title from '. $wpdb->posts .' where post_status = "publish" and post_type = "page" and ID != "##" order by ID');
   }
  return $these_pages;
 }

 function list_all_pages(){

$all_pages = get_the_pa_ges ();
foreach ($all_pages as $thats_all){
$the_page_id = $thats_all->ID;

if (is_page($the_page_id)) {
  $addclass = ' class="current_page"';
  } else {
  $addclass = '';
  }
$output .= '<li' . $addclass . '><a href="'.get_permalink($thats_all->ID).'" title="'.$thats_all->post_title.'"><span>'.$thats_all->post_title.'</span></a></li>';
}

return $output;
 }
?>
<ul>
<?php

if (is_home()) {
  $addclass = ' class="current_page"';
  } else {
  $addclass = '';
  }
echo "<li" . $addclass . "><a href='" . get_option('home') . "' title='Home'><span>Home</span></a></li>";
echo list_all_pages();?>
</ul>

<div class="cleared"></div>
</div> <!-- Closes Nav -->

This tells the query to find all published pages that don’t have an ID of ## and return those page titles for display in the nav bar. Since I don’t work with the way WordPress communicates with the database very often, it took me a couple of hours of (nearly futile) research and experimentation to figure out what would work here. Hopefully you’ll find this information useful.

Bulk Clean-up of ‘Approved’ Spam Comments

I recently had to clean up the database for a WordPress installation where several thousand spam comments had managed to slip by the filters and get themselves approved. Naturally, going through and marking each individual one as spam would have been a mind-numbing and infuriating process, and there is no ‘Check for Spam’ button in the approved comments queue. Obviously, you can’t allow those spam comments to just sit there, so here’s the solution. Fair warning: it’s a bit geeky.

Log into your phpMyAdmin interface and navigate to the comments table (wp_comments by default). Click on the SQL tab ,paste this snippet of code in, and click ‘Go.’

UPDATE wp_comments SET comment_approved='0' WHERE comment_approved='1'

This will bump all approved comments back to a pending status, which you can then go into and click the ‘Check for Spam’ button. Depending on your server’s settings and the number of spam comments you have to deal with (7000+ in my case), you may end up with a timeout error of some kind, which is ok. Just back up your browser and repeat the check process until all spam comments have been filtered into the appropriate queue. What you should have left are your legitimate comments. (Any leftover spam you should be able to clean up manually without too much trouble.)

From there, depending on how many legitimate comments you have remaining in the pending queue, you can either do a bulk approve using WordPress’s native functions or simply reverse the SQL command you issued above:

UPDATE wp_comments SET comment_approved='1' WHERE comment_approved='0'

Voila! Like magic (and with a bit of brute force), you’ve just gotten rid of a LOT of approved spam comments. It’s not necessarily the most elegant solution, but it beats having to click on every spam comment and preserves all the legitimate comments your readers have made.

Oh, and don’t forget to empty out your spam queue.

No WordPress 2.5.2?

Ok, for possibly the first time ever, I’m actually a little annoyed with the WordPress developers. WordPress 2.5.x has a known bug pertaining to users not being able to reset their passwords because of invalid links being generated. The short-term solution has been for the admin to log into the database and manually change the passwords. Trouble is, I have about 30 WordPress installations running on my server, and most of them have multiple users, all of which have needed to change their passwords (thanks to the recent hacker). I’ve been waiting and waiting for WordPress 2.5.2 to be released with a fix for the problem, and then just yesterday I saw that WP 2.6 Beta 1 is out with a 2.6 final release slated for mid-July. I guess this means that 2.5.2 is being skipped completely.

What irritates me about this is that this password reset issue has been known for weeks now, and there’s been virtually no word from the developers on it. Several guys have mentioned the manual reset fix, which, yes, I’ve already done to shore up the security holes. But when my users want to change their passwords, they have to contact me, which ends up being a hassle for all involved. It just would have been nice to have a patch released for this issue a long time ago, instead of having to wait for WP 2.6 to be released with, hopefully, a fix for the bug.

ComicPress 2.5 and ComicPress Manager

It is through the efforts of two gentlemen that the existence of “Reclaimer”:http://reclaimercomic.com is possible. The first is Tyler Martin, who has created the beautifully designed “ComicPress”:http://mindfaucet.com/comicpress/ theme. Tyler’s design makes it eminently easier to produce a regular comic using the powerful WordPress platform. I’ve long been a fan of WordPress, and I’ve wanted to produce a Halo comic since Halo 3 first hit store shelves, so I’m very grateful to Tyler for making it that much easier to make it happen. With the release of “ComicPress 2.5”:http://mindfaucet.com/comicpress/2008/05/19/comicpress-25-released/, things are even better. Tyler built five different layouts, with the graphic novel layout being the design of choice for Reclaimer – and by the feedback I’ve received from you, my readers, it’s been a very positive change. So, my thanks to Tyler for putting the effort into creating such a great tool for producing webcomics.

John Bintz has added another great tool to ComicPress 2.5 that makes it even more efficient to post up new comics. It’s a plugin for WordPress called “ComicPress Manager”:http://claritycomic.com/comicpress-manager/ that goes hand-in-hand with the ComicPress theme. Before, I had to make the comic, use Filezilla to upload the file to the comics directory, then go into the WordPress dashboard and create the new post, write the title, write a little blurb about the comic, add tags, set the category, and set the date and time so that the comic publishes only when I want it to. With ComicPress Manager, all I have to do is create the comic, make sure the file name contains the date and name, and use ComicPress Manager to upload the file. From there, the plugin automatically sets the date and time for me, pulls the post title from the tile of the comic file name, and even creates thumbnails for the comic archive and the RSS feed. I can set my tags and blurb right there. What took me about five minutes before now takes literally 30 seconds and adds more features than were previously available. It’s a powerful little plugin that makes it even more fun to produce a comic by taking away a lot of the ‘pain’ in posting.

Again, my thanks to these two gentlemen for producing these great tools and volunteering their efforts to the webcomic community.

Essential Plugins for WordPress 2.5

With every new version of WordPress, I update my list of plugins that I consider to be essentials. That is, these are the group of plugins that I install in almost every instance of WordPress that I run on my site. In the last couple of weeks, there have been several really slick little plugins that have either been developed or updated for WordPress 2.5. Here are the ones I’ve adopted:

“cforms”:http://www.deliciousdays.com/cforms-plugin has become my contact form plugin of choice. It is a very powerful and robust plugin that allows user customizability right down to the last detail. As such, the admin interface is a little daunting, but the power that cforms provides makes it well worth the effort to learn it. At this point, I think it’s fairly safe to say that there isn’t a better contact form plugin out there.

“Extra Sentence Space”:http://coffee2code.com/wp-plugins/extra-sentence-space is exactly what the typing Nazi ordered. High school typing class taught us that it’s proper form to place two spaces between sentences. HTML documents only display a single space, no matter how many you type. This plugin brings back the ability to add the second space back in and clean up your document formatting.

Flexible UploadI’ve been using “Flexible Upload”:http://blog.japonophile.com/flexible-upload/ almost since it was first developed. What’s attractive about this plugin is that it allows you to resize images on the fly and, if so desired, add a personal watermark to your own images. Now, with all the problems surrounding the Media Uploader in WordPress 2.5[1], Flexible Upload provides the means to bypass most of the buggy AJAX code and get your images uploaded to your blog quickly and reliably.

“Ozh”:http://planetozh.com has fast become one of my favorite plugin developers. He consistently creates plugins that are practical and high quality. I’m running three of his plugins on all my installations that make the WP 2.5 dashboard experience a lot more fun.

Admin Dropdown “Ozh’ Admin Dropdown Menu”:http://planetozh.com/blog/my-projects/wordpress-admin-menu-drop-down-css/ reorganizes the WP 2.5 dashboard, putting all the links in a single row at the top of the dash. What’s more, a simple mouseover for any menu tab will display a dropdown menu that will give one-click access to any submenu in the dash. This plugin effectively cuts dashboard navigation times in half.

Absolute Comments “Ozh’ Absolute Comments”:http://planetozh.com/blog/my-projects/absolute-comments-manager-instant-reply/ makes it fun and easy to reply to reader comments by reorganizing the Comments menu and allowing for instant comment reply right in the dashboard. It’s fast and powerful, and every WordPress user should be running this plugin.

Better Plugins “Ozh’ Better Plugins Page”:http://planetozh.com/blog/my-projects/wordpress-better-plugin-page/ cleans up and reformats the plugin page, making it a little easier to look at and use. It also provides a set of filters that can be used to display only a particular subset of plugins.

The WP 2.5 dashboard comes with a fixed width, which is rather ugly for those of us who use a large monitor resolution. “Remove Max Width”:http://dd32.id.au/wordpress-plugins/remove-max-width/ undoes this limitation and allows the dashboard to stretch completely from side to side.

ShareThis“ShareThis”:http://sharethis.com/ has been around for awhile now, but it compacts social bookmarking down into a single button. Using this plugin gives your readers the ability to share the wealth and send additional readership your way.

I’ve been using Textile as my text markup option almost since I started using WordPress several years back. Textile and and its plugins have undergone various iterations since that time, but “TextileWrapper”:http://www.huddledmasses.org/category/development/wordpress/textile/ is the one I’ve been using for the last year or so. The thing that I like about Textile in particular as a markup tool is because it uses common characters for the markup, making it extremely fast to add formatting to my writing as I go. I use TextileWrapper on all my WordPress installations and won’t set one up without it. Everyone has their markup tool of choice, but this is the one that I think is easiest to use.

Anyone who’s ever had a catastrophic blog failure resulting in lost data knows the value of backing up your database[2]. “WP DB-Backup”:http://www.ilfilosofo.com/blog/wp-db-backup should be required for every WordPress installation[3]. It makes it easy to keep a backup copy of your DB on file, y’know, just in case.

“Shift This Order Pages”:http://www.shiftthis.net/wordpress-order-pages-plugin/ is a little clunky to use[4], but it beats hands-down having to go into every page on your blog manually to change the menu ID. If I have an installation of WordPress that contains more than a couple of pages, I make sure I include this plugin to move pages around more easily.

I know I, for one, like to have the option of subscribing to comments on particular blog postings, and I don’t generally like to add individual RSS feeds to my Google Reader. “Subscribe to Comments”:http://txfx.net/code/wordpress/subscribe-to-comments/ gives readers the option of getting follow-up comments in their email.

Web servers don’t provide a means of automatically adjusting for daylight savings time. “Timezone”:http://kimmo.suominen.com/sw/timezone/ fixes this by automatically applying this adjustment twice a year. Just tell it what time zone you live in and whether you make the adjustment, and it does the rest.

These are my favorite plugins, and I firmly believe they are well-worth your time to investigate, as well. Feel free to tell me about any other essential plugins you use by commenting below.

fn1(footnotes). A problem which, at this point, still has no real solutions, despite many reports of bugs on the WordPress support forums.

fn2(footnotes). And the rest of you _ought_ to know the value of backing up regularly.

fn3(footnotes). Frankly, it ought to be included into the WordPress core, in my opinion.

fn4(footnotes). It took me a little while to figure out just exactly how to make it work.

Nearly Hacked

So, apparently my blog underwent a minor attack last night. I woke up this morning to an email saying that my new blog had been set up at shamuswrites.com. Now this sent a slight cold chill down my back, since I clearly already have a blog here. The email gave the typical administrative username, but what really made my blood run cold was the next part that read, “Password: Inherited.” I checked the site, and sure enough, what I saw was the initial setup screen that asks for the name of your new blog and an email address for the administrator. Not good. Not good at all.

My next step, then, was to log in to phpMyAdmin and double-check the database for my blog. All the tables were present and accounted for, and the sizes looked about like they should for 4.5 years of blogging. So, I backed up the database real quick and then repaired all tables (since I’ve had problems with a table breaking in the past and messing up my blog). After that, everything came back to working order again, which is a huge relief.

My theory is that someone tried to access the install.php file, probably by a roundabout means, in an attempt to either access my site or corrupt it irreparably. The attempt clearly failed, but it did nearly cause me a minor heart attack. I’ve since deleted both the install.php and upgrade.php files, just to prevent this sort of thing from happening again. In theory, not deleting them shouldn’t cause any harm, since accessing them after an install or an upgrade generally only returns a message saying you’ve already done that, but I also wouldn’t be at all surprised if hackers have found ways to exploit those files for their own amusement. I’ll likely make a point of backing up all my DBs on a more regular basis now (especially since SSH makes it so darn fast and easy to do), just to make sure that if I do get hacked at some point in the future, it will be an easy task to return things to a general state of order again.

Subversioning Up

Well, at long last, I finally figured out the trick to installing Subversion on my server. As such, I’m working on switching most of my WordPress installations to Subversion in order to make it _much_ easier and faster to upgrade in the future. I just switched this site to a Subversion-agreeable install, and I’m pretty sure that I copied all my custom files and directories over. But, I’ve been known to make mistakes, too, so if you notice something not working properly, do please let me know.