Last night I pushed out an update to our WordPress SEO plugin, version 1.4.8. It included a ton of changes including support for the new author stuff Facebook announced yesterday. We had been testing all the other changes in that release for a while already and all seemed fine, so I was baffled when I released the update and got a flurry of complaints within like 2 minutes. It was our fault, sorry for that, but let me explain why.
I immediately rolled the release back and started to try and figure out what was breaking. I’d updated several of my own sites immediately and all were working fine. Luckily some people in the support forums had given the exact error message. Turns out we were using so called anonymous functions. These are awesome, if you need to do one small thing, this saves you the hassle of creating a function and cluttering the global namespace. But… They were added in PHP 5.3.
PHP 5.2
WordPress still supports PHP 5.2, even though PHP itself doesn’t even support it anymore and hasn’t been supporting it anymore for almost 2.5 years. If you look at the WordPress stats though, you’ll see a large amount of people (or rather, their web hosts) still runs PHP 5.2:
I think it’s fair to say the majority of web hosts out there are lunatics. If it’s your job to make sure web servers run fast and secure, how on earth can you run software on it that hasn’t been supported for over 2.5 years? Seriously, if my update broke your site last night, I’m sorry, truly, I am. But: go read this and upgrade to a decent WordPress host.
Seriously: PHP 5.3 was released as a stable version june 30th 2009. I remember that day well, my son became 3 years old that day. He’ll be 7 in just 9 days from now. The company Yoast didn’t even exist yet then. But yet we’re still relying on bloody old software.
Anyway, you can’t blame users for the lunacy of their web hosts, so we’ve been working on removing those anonymous functions and we’ve been doing another round of tests so we can now confidently release WordPress SEO 1.4.9. We’ve skipped 1.4.8 to avoid confusion in the support forums.
Lessons learned
First of all, I’ve downgraded my local development environment (on which I use MAMP Pro) to use PHP 5.2 instead of the PHP 5.4 I was sporting there. I’ve also, this morning, downgraded our test servers.
Next to that, Mark Jaquith was so kind as to hop in immediately when Scribu pointed me at a system called Travis CI and he helped me get it set up for WordPress SEO here.
Travis CI helps with automated testing of releases. We’ll have to write a lot of unit tests for it so we can test more of the plugin properly and in an automated fashion, but funnily enough… Travis CI doesn’t have support for PHP 5.2. So even though it’s awesome, it wouldn’t have prevented this issue.
In the end…
So, we / I made a mistake. We fixed it, we learned from it, time to move on. WordPress SEO 1.4.9 is out there and it’s awesome. We:
- fixed several bugs;
- added an XML sitemap for author / user profiles;
- added better detection of that other big SEO plugin and our own old Robots Meta plugin and the plugin is now better at helping you import data from those and then disable them;
- added support for Twitters new twitter:domain meta tag;
- added support for Facebooks author / publishing release;
- There’s more, if you want to know what, read the changelog.
This post first appeared on Yoast. Whoopity Doo!