Dougal Campbell's geek ramblings

WordPress, web development, and world domination.

WordPress 2.6 Released

The release of WordPress 2.6 is now official. In addition to the features I highlighted previously, Ryan has details on his blog about the improved support for SSL, and some new helper functions which will be useful for plugin and theme authors. And the official dev blog post has details on other new features. One of the more interesting things that I didn’t yet know about was that the Press This bookmarklet has some nifty autodetection which will make it easy to automatically embed content from sites like YouTube and Flickr.

In addition to the new features, I’d also like to point out that there has been a recent effort to improve the inline source documentation (using PHPdoc). I, for one, certainly appreciate the work that is going into documenting the parameters, return values, and purpose of each function. It make things much easier when you have to trace back through the call stack to figure out where certain things happen.

Knee Surgery

About 16 or 17 years ago, I injured my knee in a job-related incident. Being young and stupid, and not really understanding insurance and workers compensation very well, I never got around to doing anything about it, beyond using crutches for a while until I could walk without them again. My doctor at the time recommended that I get it scoped for a better look at  what the damage was, but like I said, I was young and stupid, and so I put it off.

As a result, over the years my knee has mostly been okay, but occassionally it would “lock up”, requiring me to do odd manipulations of my knee joint to “unlock” it. Sometimes I would twist my knee while doing some physical activity, which would cause it to become swollen and painful for anywhere from a few days to a few weeks. Like last year, when I re-injured it while playing on a church softball team, and it was stiff for about three weeks. When that happened, I ended up getting a doctor to take a closer look, and an MRI revealed that I had a torn ACL and possibly some damage to the meniscus. My doctor recommended surgery, which I knew I was going to have to break down and do eventually, but I put it off again, hoping to find some extended vacation period where I could recover without disrupting my job and household too much.

So, as normal day-to-day things go, it wasn’t a problem. But I knew I had to avoid a lot of activities, including many forms of exercise, which is obviously not a good thing, and is at least a part of why I am a lot more overweight than I’d like to be. And being overweight means that put more wear-and-tear on my knees. It’s a vicious circle.

With some encouragement from my wife, and the realization that there was just never going to be a really “good time” to do it, I finally scheduled the surgery, which I underwent yesterday. So here I am, laid up in the bed, with a “Game Ready” leg wrap that circulates cold water around my knee, a bunch of pillows propping my leg up, and a regimen of Cephalexin (antibiotic) and Oxycodone (pain killer, which is about to send me to snoozy land, shortly). It’s been well over 24 hours since the surgery, and parts of my leg are still numb. At least I can finally move my foot and wiggle my toes again. Not being able to wiggle my toes was driving me nuts! It doesn’t sound so bad, but think of what it’s like when your circulation gets cut off and your foot falls asleep, and it’s like a piece of dead rubber hanging off the end of your leg. Now imagine that your whole leg is like that, and it won’t wake back up. It’s a bit disconcerting.

I’m going to be on crutches for four weeks, with strict orders not to put any pressure on my right leg, and I’m supposed to start physical therapy as soon as possible. I plan to do everything they tell me to do, because I’m looking forward to eventually being able to do normal activities again — swimming, biking, maybe even Tae Kwon Do again one day.

I’m fortunate to have a good support system here. Between my wife, her parents, and her brother, I’ve got a pretty good amount of help on a daily basis. And this week, we have a nephew coming up to help out, and the week after that my mom will be driving up to help out. I can’t imagine what someone without close family and friends nearby would do.

Kids, take this advice from good old Uncle Dougal — be kind to your knees. You’ll miss them when they’re gone.

Update on WordPress blog APIs

I mentioned previously that the XML-RPC and Atom blog APIs would be disabled by default when WordPress 2.6 is released. This was a matter of some debate within the community, and there has been some clarification:

  • The APIs will not be automatically disabled for sites upgrading from older versions. Since the APIs have previously been ‘on’ by default, they will continue to function.
  • For new installs of WordPress 2.6 and later, there will be an option presented at install-time to enable the APIs. Or not. They seem to have removed that between Beta 1 and Beta 2.
  • There will be options in the Write settings to enable or disable XML-RPC posting and Atom API posting individually.

This sounds like the most reasonable path to make this change without causing disruption for those who have been using client tools like Ecto, MarsEdit, or Windows Live Writer (or third-party web services which can post to blogs, like Flickr or Delicious) to post to their blogs.

Also, though this change is being made under the moniker of a security improvement, that is not to imply that the current API code is not secure. It is simply a pretty standard practice to turn off services that are not used, just as when building a dedicated email server, you wouldn’t turn on FTP unless you absolutely needed it. Stats from WordPress.com have shown that only about 5% of its users utilize the client APIs, so it doesn’t make sense to automatically turn it on for the 95% who aren’t using them.

WordPress 2.6 Beta 1

Last night Ryan Boren announced the release of WordPress 2.6 Beta 1. At first glance, you probably wouldn’t notice much difference between versions 2.5 and 2.6. The two biggest new features are Post Revisions, which saves a history of edits made to each post, and support for Gears, which greatly speeds up working with the admin screens.

Other changes of note:

  • Support for the XML-RPC and Atom client APIs is turned off by default now. If you use an external client for posting, you’ll need to specifically turn these features on, under Settings/Writing.
  • Impoved support for SSL access to the admin screens.
  • When you are selecting themes, you now get to view a preview of how your site looks with the new theme before commiting to the change.
  • The return of the “Press This” bookmarklet (find it in the sidebar of the Write page). Drag the link to your browser’s bookmarks toolbar, and use it to quickly post about sites you visit.
  • More avatar options. The Gravatar service now supports displaying MonsterID, Wavatar, or Identicon icons in place of the default icon for those who don’t have a personalized Gravatar. These options are selectable under Settings/Discussion. My Easy Gravatars plugin can support this as well, though I’ll probably update it to use the new built-in settings, rather than its own. I’ll write that up later.
  • Improved plugin management. Active and inactive plugins are now listed separately. You now have the abiliity to “bulk activate” or “bulk deactivate” plugins. You can also delete unused plugins at the click of a button. (Now all we need is the ability to search and install plugins from the  Extend directory right from our admin! Maybe in 2.7?)

And there are other assorted improvements, such as updates to the latest jQuery and jQuery UI libraries, updates to the latest TinyMCE editor, improvements to Page and Category management, and as always, general performance enhancements.

It is a beta, so there are still quirks being hammered out (personally, I’ve observed issues with the theme preview, and with deleting plugins). So don’t use this on a “critical” production web site yet. I’m running it here, but obviously, my personal blog isn’t critical, and I’ve always got backups available for when I screw something up. 🙂

Download WordPress 2.6 Beta 1

Download Firefox 3

If you didn’t know already, today is Download Firefox 3 Day. They’re trying to set a World Record for the most downloads in a single day. I read somewhere that the fun begins around 10:00 a.m. PST.

I’ve been runing the pre-release versions for a while, and I can confirm that the memory management and speed are much improved. I normally have about a dozen tabs open at any given time, and I occassionaly have had 40 or 50 tabs going. In Firefox 2, this would cause major memory problems, even after I closed the tabs. But FF3 handles it well.

If you’re worried about the compatibility of your current add-ons, try installing the Nightly Tester Tools add-on, which lets you override the version checks.

Whither Spam?

When I switched to my new Slicehost server, I spent a while trying to decide what I wanted to do about email for my domains. I contemplated using Google’s domain email service, or some other third-party email hosting. But I just hated giving up that much control of my email setup. I’ve been administering my own email for (…thinking…) almost 15 years now. So, in the end, I just ended up routing email to my new web server.

The problem was that this added a significant amount of processing load to the server. Maily because I have been using the SpamBouncer procmail rules to filter my email. This set of procmail rules does a pretty good job of reducing the amount of spam that makes it to my inbox, but procmail is a notorious CPU hog. Whenever a batch of spam emails would arrive (when you host email for several domains and users, you notice that spam often arrives in ‘clumps’), several procmail processes would kick off, and the system load would shoot up by an order of magnitude for a brief time. The machine seemed to handle it okay, but it bugged me.

Recently, however, I was contacted by one Brad Garrison. He was also a customer with Slicehost, but he wasn’t as satisfied with them as I was. Brad was having some sort of problem with load on his server, and decided to try a different hosting provider. But he had some pre-paid credit that he could not get refunded. Being a visitor to my site, and seeing that I was at Slicehost, he generously arranged to transfer the remainder of his credit to my account (thanks, Brad!).

I decided to put this windfall to use by adding a second server to my account, to act as a dedicated email gateway and spam filter. First, I added a 256 Slice to my account, and set it up with Ubuntu 8.04. Once I had the base system up and running, with a few personal tweaks, I followed the instructions on HowToForge for building a SpamSnake server. When I was done, my server was running the Postfix MTA, MailScanner, Spamassassin, ClamAV, and MailWatch. I had problems with the greylist server, so I disabled gld and removed the associated bits from my postfix config.

Once it was all configured, I pointed the MX records for one of my lesser-used domains to the new server. Then I was able to send some test emails (which is how I ended up disabling gld), adjust and fix things I had missed in the initial setup, and get everything working just right. Once I was happy with it, I updated the DNS for the rest of my domains, to use the new server as their MX (Mail eXchange). After letting it run for a day, however, I found that the load on the new server was through the roof. MailScanner uses a *lot* of RAM, so the machine was in constant swap. So I upgraded the slice to 512MB of RAM. This process went smoothly. It probably took about 15 minutes from my initial request to the point that the machine was running in the new configuration, and it was only down for about 5 of those minutes. Score one for Xen virtual machines!

With the increased RAM, the machine was now happily munching on email, spitting the spams and virii into the bit bucket, and passing the rest of the messages along to my main server. I did, notice, however, that certain spammers were still sending emails directly to my mailbox server, instead of to the spamsnake gateway server. Naughty, naughty spammers! I fixed this by configuring the mailbox server to only accept connections from the gateway server. This took a little bit of research, but a user named Simon on the #exim channel in Freenode IRC pointed me in the right direction for setting up the ACL rules.

So, now my web server is happier because of the lower CPU load. And my inbox is happier because I get much less spam making it through filtering. I went from about 150 uncaught spams per night to about 12. I don’t even want to think about how many messages are getting blocked before I ever see a statistic on them (e.g., blocked by DNSBL, or other fingerprints, before any anti-spam content scanning takes place). For a while, I was actually worried that I had broken something, because I had been going so long without seeing new messages. I almost missed the constant dribble of spams! Almost 🙂

Plugin: WriteScroll

A couple of weeks ago, Les Orchard tweeted a complaint about the WordPress editor:

wordpress annoyance: textarea for editing a blog post doesn’t start until more than 1/2 way down my screen. Too much nav; always scrolling.

I figured that was a problem easily solved, so while I was eating my lunch that day, I whipped up a mini-plugin to help out. The WriteScroll plugin checks to see if you are on one of the main editing pages, and if so, it injects a bit of javascript into the page which automatically scrolls the browser down so that the editor’s container is at the top of the browser window. It uses the jQuery library, which is already included with WordPress, so no additional libraries need to be loaded.

In WriteScroll 1.0, there are no options to set. Just activate the plugin, and when you visit the Write Post or Write Page screens, your browser should automatically scroll down so that the editor fills the browser area better.

Visit the WriteScroll Plugin page for downloading.

Weathering the storms

We had a batch of bad weather come through here yesterday. I had seen a severe thunderstorm warning earlier in the day, but didn’t think much about it. But early in the evening, as we were preparing dinner, the warning sirens started going off, so we turned on the local news to get a more detailed status. It turned out that we were under a tonado warning, and the worst patch of it was heading straight towards our area.

We gathered up the kids and sat in our hallway. Shortly after, we were hit by an intense hailstorm, and the weatherman mentioned that a tornado had been sighted on the ground five miles southeast of Holly Springs. Gee, that’s about where we are! Then Susan’s parents called — they were in their car on the way home, but a tree had fallen across the road, so they were having to re-route. I could barely hear them above the din of the hail pounding their car.

A short time later, the storm cell passed. Surprisingly, none of our vehicles seem to have been damaged by the hail. There were leaves all over everything, and one of the oak trees in the back yard lost a branch. We were pretty lucky, because there was a lot of damage in areas all around our neighborhood. Several of the ‘major’ roads (well, the main roads for our somewhat rural area) are still blocked  by downed trees and power lines. If we need to go anywhere to day we’ll probably have to go a bit out of our way to avoid the blocked areas.

Mary’s school is closed, because several power poles right in front of it were knocked down. We found out last night that the tornado hit the house of Jamie’s para-pro. Well, actually, we don’t know if it was a direct hit, but he’s got trees in his house. Mary called to check on one of her school friends last night, and they were without power, but okay other than that. Susan’s parents called us earlier this morning while they were driving to their store and reported that all along Toonigh Road, it looks like people are selling firewood, because of all the downed trees that had to be cut up and moved off of the road.

So, all the kids are home from school, Susan is staying home from work, and we’re all relieved that we didn’t have any damage, and that we haven’t heard of any major injuries.

Now on Slicehost: Me!

If you are seeing this post, then you are getting pages served from my new server at Slicehost. I still have to migrate my other web sites, and figure out how I’m going to mange email, but this was a big hurdle, and I’m glad to say that it went pretty smoothly. There are still some old files that I haven’t put back in place yet, so if anything seems awry, don’t be too surprised. I know of a couple of things I need to take care of, but I’m sure there are others that haven’t crossed my mind yet. So feel free to contact me if you see anything wrong on the site (dead links, missing images, etc.).

When I was shopping for a hosting company, there were a few final contenders in consideration. But Slicehost hit a sweet-spot in the variables of price, host stats, and that certain je ne sais quoi that tells you that a company seems to Get It. “Built for Developers” — that’s a good start right there. You want Plesk or Webmin? They don’t give it to you. But you can install it yourself if you really want it. Yeah, baby — that’s my kind of hosting.