Quick and Dirty tools: WP Version Tattler
For those of you who noticed my downtime here, we recently went through a HDD failure.
Backups were restored, but they didn’t feel so… fresh.
When I got back up, I was apparently on WP version 2.8, but had updated to 2.9.1 prior to this. Through some manual trickery, I forced WP to let me into the admin console (which required me to let it ‘update’ my DB to 2.8’s way of doing things), then bumped the files back to 2.9.1, which does another DB update.
Dan mentioned we’re going to have a bunch of people who are going to need to have an update done, to catch them up.
I figured that I’d dust off my PHP skills and try writing something myself.
All it does is this:
Provided that the WordPress installation is at least intact, it includes the user’s config file (wp-config.php), and their wp-includes/version.php file.
It reports back what version the version.php file says it is, and then looks at the database, checking what version the DB says it has.
I’d like to add two features to it in the near future:
- Dump a copy of the database, w.r.t tables that would be affected by a WordPress install/update. This should be relatively easy, as long as all plugins respect the table prefix that WP uses (in my case, I use something other than wp_). Dump ‘em, tar ‘em, gzip ‘em up, and serve with a side of I backed that up for you.
- Provide a link that triggers the WP Update feature. It’s not going to work on every host, especially not if the host uses lame safe_mode = ON in their php.ini config (I HATE YOU WHEN YOU DO THAT. FIND A BETTER WAY TO SECURE THINGS).
It’s not a plugin, because I want to just be able to drop it in the root of a WordPress directory, throw a browser at it, and get an answer. It’d be even nicer if I could invoke that script from the command line and get the same answers to questions (which I think you can do in PHP, but I’m not sure?).
Once I can get back to my code, I’d be willing to share it.
Good times, good times.
[...] I mentioned a number of days ago, I had written a script that would let me check WordPress installs even if [...]