Dougal Campbell's geek ramblings

WordPress, web development, and world domination.

Yarrr! It’s Talk Like a Pirate Day!

Once again, we have arrived on Talk Like a Pirate Day. I had been hoping that I would be able to find time to upgrade my Text Filter Suite plugin for WordPress (which includes my Pirate filter for posts and comments), but I’ve just been too busy. Maybe I can get it re-worked for next year. I already know what I want to do with it: Consolidate all of the filter code, maybe re-do things in an OOP style, add the concept of ‘registering’ a filter with the system, and add a back-end user interface to make it easier to use.

Anyways, enjoy all the piratey goodness today!

WordPress 2.6.2 Release

As most of you have probably already seen in your Dashboard, yesterday afternoon saw the official WordPress 2.6.2 Release. And as mentioned in the comments on my intitial news break on the 2.6.2 Beta, the focus is on two security patches to cover weaknesses in PHP’s random number generation (which affects password encryption strength), and in MySQL’s field length checking. These weren’t (technically) security bugs in WordPress, per se, but in the underlying PHP/MySQL stack. Fortunately, we’re able to route around them. This is mainly a problem if your site allows users to register for a user login, however, I would still recommend this upgrade for all users, just to be on the safe side.

For those of you who are PHP/MySQL developers yourselves, I highly recommend reading Stefan Esser’s explanation of the PHP mt_srand() bug and the MySQL SQL Column Truncation issue. He provides some really good detail of the problems. Stefan is also the developer of the PHP Suhosin module, which provides extra security-related features and protections to PHP.

It’s also important to note that these problems don’t just affect WordPress — many other PHP/MySQL applications could be vulnerable to future problems if they don’t examine and patch their code.

WordCamp Birmingham

WordCamp Birmingham September 27-28, 2008

If you haven’t already heard, WordCamp Birmingham is coming up on September 27 & 28, 2008. And for those of you not in the States, that’s Birmingham, Alabama, not England. If you are in, or can travel to, the Southeast U.S., you won’t want to miss the first WordCamp in the Deep South! And besides the great tech stuff at WordCamp, there are other fun events in Birmingham that weekend, too.

Oh, and did I mention that I am one of the Speakers (*gulp*)? I will be speaking on “The Future of WordPress”. This will be the first time I’ve given a presentation of this type, so I’m quite nervous about it. If anyone has any public speaking tips that don’t involve imagining people in their underwear, let me know. Or, if you have any particular points that you think I should address, I’d be interested in hearing those, too. I don’t know that I’ll be able to discuss everything that everyone wants, and I don’t claim to have a crystal ball that tells me any more about the timeline of WordPress features than anyone else. But I have some ideas of what I want to touch on, both in general and in the specific.

If you make it to the event, please feel free to find me and say hi! I’m really looking forward to meeting people and putting faces with names. I also figure I’ll be reconfiguring my blogroll, with a bunch of new XFN ‘met’ links. 🙂 I’m not sure whether or not I’ll be there for the entire event, but I hope to have a better idea once the schedule is filled in, and I have my travel plans finalized.

WordPress 2.6.2-beta1

It looks like there’s going to be another point-release of WordPress coming soon. WordPress version 2.6.2-beta1 was just branded in svn a short while ago. Looking over the logs, I don’t see anything major — a fix for the Textpattern importer, a bug fix that prevents an attempt to make a revision of a revision, a new ‘login_redirect’ filter, a new ‘wp_rand()’ function, and a handful of other minor bugfixes.

I’m kind of wondering if there’s something bigger that’s going to be added before release…

XCache Object Cache Plugin for WordPress 2.5+

download

Download: xcache-plugin.zip
Version: 0.7d
Updated: August 29, 2008
Size: 0 bytes

Powered by Drain Hole

This is another one of those articles that will be of interest to a minority of WordPress users. In particular, if you use the XCache PHP opcode cache and Neosmart’s XCache object-cache plugin for WordPress. For those of you who don’t know what the heck I’m babbling about, a PHP opcode cache is a bit of software which helps your web server do less work when turning all your PHP code into web pages that a browser can render. The object-cache plugin is a bit of code added to WordPress which communicates with a caching service in order to reduce the number of database queries it needs to make when building your pages. Together, this helps reduce the CPU load on your web server.

When WordPress 2.5 was released, it introduced some changes to the object cache API. Specifically, it introduced ‘global groups’ and ‘non-persistent groups’, which are just ways for WP to organize and optimize the data it stores in the cache. However, if you didn’t have an updated version of your object-cache.php plugin, you’d start to see some ‘quirks’ in your system. The things I noticed the most were that my comment moderation counts and plugin update counts would not update properly when I flagged comments or upgraded my plugins. I had hoped that Neosmart would update the plugin, but I never saw any news about it, so I ended up just disabling the object-cache on my site.

Then recently, I had to do some work on the memcached version of the object-cache plugin for a client. This inspired me to go ahead and take a look at the code myself, and update the XCache plugin. By looking at the changes to the memcached plugin, I was able to see that it really wasn’t very hard to make similar changes to the XCache plugin.

I’ve sent my changes to the author of the original plugin, but until any official update comes out, you’re welcome to download my changes.

NOTE: this is not a normal WordPress plugin, it does not go in your plugins directory! Install the ‘object-cache.php‘ file directly in your ‘wp-content‘ directory! You must also add the following line to your wp-config.php file, just before the comment that says ‘stop editing’:

define('ENABLE_CACHE', 'yes');This is no longer required in newer versions of WordPress.

For more information, see my previous article, Using the WordPress Object Cache.

UPDATE 2008-09-02: After seeing comments about people getting errors, I took a closer look and found a couple of typos. Version 0.7c should clear those up.

UPDATE 2008-09-11: Updated to version 0.7d, which should do a better job of creating unique keys, even on servers with multiple installations of WP / WPMU. Testers wanted!

Knee Update – Week 7

It’s been seven weeks since my knee surgery. I can now officially put my full weight on my right leg. Unofficially, I’ve already been walking around without crutches for most of the past week. When I had my six-week checkup with the surgeon, I asked when I could drive a car on my own instead of having to get my family members to drive me to appointments. He said “whenever you feel like you can,” so I did.

The important thing about the six-week checkup last week was that it marked the point that my meniscus repairs are healed enough for me to start bending my knee past 90 degrees. At my physical therapy appointment a few days later, we measured my angle at 118 degrees, and I was able to pedal an exercise bike. Between the bike, the squats and the leg-lift exercises (4 different exercises with 4 pound ankle weights x 100 reps each = 1600 pounds!)

We’re also getting back to a proper eating plan at home, so between that and the exercise I get from therapy, I’m hoping to shed some pounds now. I’ve got to say, though, I don’t recommend the knee surgery weight loss plan. It’s a pretty darned expensive gym membership. 🙂

Macbook + Coffee = Bad

Everybody knows that you shouldn’t keep beverages too close to the computer, right? The reason is because eventually, your toddler is going to run up to give you a big hug before she leaves for daycare, and is going to bump your leg. Your leg, in turn, is going to bump the TV tray where you set your coffee cup. The cup is going to tip over and spill several ounces of coffee directly onto the keyboard of your Macbook. And as a consequence, the Macbook is going to cease to function.

Yes, that’s what happened here at Castle Campbell last Friday morning. I tried to disconnect power and battery as quickly as possible, tried using a blowdryer on it, sat it out in direct sunlight for about an hour, and continued to let it air out for quite a while after that. But it still would not power up. I scheduled repair with Apple Care, figuring I’d end up eating just about the full cost of a refurb laptop.

Fortunately, I tried booting once more today, with the power supply connected, and it did boot. It still won’t boot under battery power, but at least I know now that it didn’t fry the entire motherboard. And I can get one last Time Machine backup before I send it off. Hopefully it will be back to normal after Apple cleans up the innards (keyboard, CD drive, etc).

Without the Macbook to work on, I had to fire up my old Sony VAIO laptop. It’s really not a bad machine, despite its age. It’s got a 2.4GHz P4 with 1GB of RAM (the maximum that this model can have, unfortunately). Its biggest problem, hardware-wise, is that the battery won’t hold much of a charge anymore, so I have to stay tethered to the wall. But I do that when I work anyways.

I booted it up, let it install a bazillion updates for Ubuntu 8.04, and restarted. And it ran as slow as molasses. What the? After doing some diagnostics, I discovered that I was running a bunch of services that I didn’t really need. Samba? Netatalk? Winbind? Turn those off, I’m not using them on a regular basis. MT-DAAP, Tomcat, avahi-daemon, tor, and even apache and mysql — not needed right now. Turning all of those off helped a lot.

But the performance still seemed sluggish, especially once I had Thunderbird and Firefox running. My final tweak was to switch from the default GNOME/metacity setup to xfce4. Once I got that configured, the system became much more useable. Even now, with Thunderbird, Firefox, Pidgin, Tomboy, a terminal, and several xfce panel plugins running, almost half of my RAM is still free.

Still, I’ll be glad to have the Mac back. It’s got more screen resolution, a slightly bigger hard drive, and several newer CDs of ours in iTunes that I don’t have ripped on the VAIO. And I’m getting antsy about the fact that I can’t sync my iPhone at the moment. Not that I have anything terribly important that needs to be synced, but it’s the principle of the thing.

So, anyways, let my mistake serve as a lesson to you all. Really keep your beverages faaar away from your equipment. It’s not just the repair cost you have to worry about. For me, the time I’ve wasted in getting another machine set up as my working environment was at least as valuable as what I’ll be paying for repairs. I don’t know about you, but time is something that I can’t spare much of.

WordPress 2.6.1-beta1

I’m surprised that I haven’t seen mention of this from other channels yet (official or unofficial), but two days ago, SVN revision 8561 of the WordPress 2.6 branch was labled as WordPress version 2.6.1-beta1. The log messages reveal that most changes since the 2.6 release are minor bug and typo fixes. A few of the more interesting bits that jump out at me are:

  • Allow disabling password reset per-user.
  • Query functions now allow a comma-separated list of post_status values.
  • Several more link generation bits are made SSL-aware.
  • Advertise the Atom 1.0 feed in the default theme.
  • Atom API uses the newer WP authentication functions.
  • Fix for an object caching bug in plugin updates.

Wanted: Cross-platform mobile shopping list app

Okay Lazyweb, help me find what I’m looking for. I want a mobile shopping/todo list app that my wife and I can both use to keep shared lists. I’ve got an iPhone, Susan has a Blackberry Curve — it should be easy to use on either of those devices. And of course, we’d want to be able to edit our lists via our desktop web browsers, as well.

It should:

  • support multiple lists
  • support sharing lists between multiple people
  • make it super easy to check off items
  • be able to sync the latest list updates from anywhere
  • be easy to use on iPhone, Blackberry, or any web browser
  • be inexpensive

It doesn’t have to have (but could):

  • support store-specific lists
  • be aware of what aisle items are on
  • support recipe ingredient lists or meal planning functions
  • support item categories within lists

I looked at a few list applications for the iPhone in the App Store, and I did some searches on the general intarwebs, but the apps I found all fell down in some way. The usual failing was that they didn’t support (or at least didn’t make it clear that it would support) sharing lists between people, or weren’t cross-platform.

Is anybody out there aware of such an app? Given my failure to locate one myself, I’m inclined to think that either 1) my Google-fu was weak that day, 2) the app I’m looking for exists but needs better SEO (this is what I suspect), 3) developers of the existing list apps aren’t doing a good job of highlighting all of their features (which I also suspect), or 4) there is an opening in that market space that would be pretty easy to fill. If I thought I could spare the time, I’d try to develop a service like that, myself.

Knee Update – Day 5

I think I’m in the “it gets worse before it gets better” phase of recovery from my knee surgery. Maybe I just overdid things yesterday (visited our chiropractor and went out to a restaurant for dinner). Today I had a headache all day and my stomach has felt just a little off — not naseous, but not hungry. Of course, part of my trouble might be lack of sleep. I can’t move around like normal, and anytime I need to move my leg in the slightest, I wake up. It’s taken its toll on me, and I wound up conking out for a good portion of the day.

But, I still try to do the exercises that the physical therapist showed me. At least after seeing the therapist, I have a better idea of what I can and can’t do with my leg. It’s not in as fragile a state that I initially thought, so I’m able to move it more than I had thought over the weekend. But I definitely can’t attempt to put any weight on it, or I would risk tearing the ligament grafts loose.

It’s frustrating that there is so little that I can do for myself or for my family. I can move on crutches from my bed to the couch, and I can even maneuver myself to go to the restroom on my own, but that’s about it. I have to use a bath chair to take a bath, because I can’t get my bandages wet. And my wife has to help me with that, because you might be surprised how difficult it can be to get yourself in and out of a bath chair when you can’t move your leg.

It’s really taking a toll on Susan, because in addition to her already busy schedule for work, grad school, and household, she now has to take over all the things I normally would do, and she has to take care of me on top of all that. We have a little bit of help, but nothing really substitutes for having both of us up and functional. I’m going to owe her one primo vacation when I’m back on my feet again.

I’ve got at least three more weeks on crutches, and probably a few more weeks after that before I can help out with some of the heavier house and kid help. And I’ll still have a few more months of healing to go after that before my knee will be ready for really normal activity levels. I’m anxious to be done with it. I’m usually a very patient person, but this is not something I want to be patient about.