WordPress, I love you, but you drive me crazy

What’s even more extremely current than “bleeding edge”? Well, whatever it is, I’m not it. But I still try to keep my software as current as possible, and that includes updating WordPress whenever a new version is out. Most of the time, the difference is negligible, of course. Other than the major transformation of the admin interface with WordPress 2.5, very little actually changes as far as your site appears to the outside world. Which is good, for the most part, because you don’t really want unexpected changes on your site just because the underlying software is changed. It should all keep working just like it did before.

And there’s the problem: usually the only things I notice that are different when I run a WordPress update are things that are broken. That, and the fact that it’s a major pain to have to update the entire file set whenever a few changes are made. (It would be easy if I had terminal access to my server so I could upload the tarball, but no dice. I have to upload all n-thousand files individually.) So far I haven’t been able to find a reliable source listing exactly which files are modified from version to version.

That aside, what really frustrates me is when I do an update, like the 2.5.1 update that was released last week, and discover that none of my navigation works anymore. I still have no idea exactly what they did, but the old URL rewrites I was using — /%category%/%post_id% — crapped out. It seems like the %category% variable isn’t supported anymore, but I can’t find any documentation of that kind of change (nor can I comprehend the logic behind it, if it was in fact intentional).

Anyway, I discovered along the way that pretty much any of the rewrite schemes (at least, the 3 or 4 standard ones) seem to work, regardless of the one you’ve chosen as your “real” scheme. This makes sense because if you change the scheme, old links from other sites will still work. But my chosen custom scheme does not, anymore. So after some angry fiddling around, I settled on one of the standard schemes that’s almost like what I was using before, and everything seems copacetic, for now.

OK, winter, we get it

I knew it was probably coming, so it wasn’t a total shock. But still… I woke up this morning to this:

Ugh. It will most likely have melted by noon, I suppose. Not that that will do much to repair my severely damaged psychological state.

Even worse, I’m annoyed that the default CSS for the new WordPress gallery functionality uses float: left so when there are only two images, it doesn’t center them, but leaves a nice, perfectly-sized void where a third photo would have gone. I’ll have to fix that. Speaking of voids, my annoyance (and distraction) at snow and CSS is somewhat compensated for by the smooth “electronic breakbeat jazz” grooves of Revolution Void.

Update, 8:13 AM: Great, now it’s actually snowing more. Take that, global warming! (Yes, please check out that site, if for no other reason than to prove that just because your URL is “globalwarming.org” doesn’t mean you’re a benevolent non-profit trying to save the world.)

WordPress 2.5

Having now set it up on a client’s site at work, and being impressed with the experience, I’ve gone ahead and upgraded this site to WordPress 2.5. The changes to the new version are mostly on the “back end” (it’s less unseemly than it… er… seems), but it does feature a built-in photo gallery feature I’m interested in trying out (no offense to the Dutch Monkey… but good riddance to the cumbersome-at-best Gallery2), even though it means the “Offspring” pages will probably be out of commission for a while as I restructure things.

I still haven’t really gotten into using WordPress widgets, and I’m sure there are a ton of other cool things I could implement if only I had the time to discover them. (Although now that I’m actually using WordPress — at least on one project — at work, the chance of me “discovering” these features and plug-ins should increase somewhat.)

Room 34 on iPhone

iPhoneI finally got myself an iPhone on Thursday. In fact tomorrow I will have two, which is one more than I need (and is also a story for another post), but the point right now is that I finally have an iPhone.

Naturally one of the first things I did with the iPhone was take a look at how room34.com looks on the iPhone. And since the iPhone’s Safari browser works pretty well, it looked fine. But since it’s optimized for a 1024×768 display, it also was a tad small.

By now I am all set to create an iPhone-friendly version of the site, but since it’s built on WordPress, I was pretty sure someone would already have created an iPhone-friendly theme, and sure enough, someone did. But they actually went one step further and built it as a plug-in, so you can keep your regular theme for computer-based visitors and mobile users will automatically see the mobile version. Nice!

It’s a bit plain for my tastes, and it doesn’t account for the fact that I’ve built my own navigation bar and menu system for browsing the non-blog pages of my site, but it’s a start. I plan to customize it over the next week or so to look more Room 34-ish, and to include all of the necessary navigation.

Resizing and regenerating WordPress upload thumbnails

WordPressFor quite some time, I’ve been wishing the thumbnail images WordPress creates when you upload an image were slightly bigger. The function that generates the thumbnails accepts a maximum dimension as an input parameter, but then the value (a paltry 128 pixels) is hardcoded in the script that calls the function, and there’s no way in the standard WordPress configuration to change the value, other than manually editing the admin script where the call is made.

This is easy enough to do, if you know how to find the block of code in question, but it’s wrong wrong wrong in terms of ongoing WordPress updates: when a new version is released and you update your files, the changes you made will be lost.

So the right way to go about this is with a plug-in, and fortunately there is one. It’s simple and it works. Except for the fact that it doesn’t regenerate any of your existing thumbnails.

Maybe there’s something else out there, but I wasn’t able to find one, so I had to resort to rolling my own.

The script is incredibly rudimentary right now. It’s not a plug-in, it doesn’t interface with WordPress admin at all, setting the file path and dimensions require manually editing variable values in the script, there’s no security, etc. It does seem to work though, which is the most important thing. There were a few bugs earlier on that I believe I’ve squashed, but I can’t guarantee there aren’t others, and given how quickly I put it together this afternoon, with kids screaming and car dealerships calling me every 3 minutes (yeah, that’s another blog post), it’s probably not quite as efficient as it could be. (That’s why I cranked up the max_execution_time and memory_limit values. YMMV depending on how many files you have to process.)

As long as you understand that you’re using it at your own risk, feel free to download the script. In order for it to work it should be placed in your wp-admin directory. And remember, it’s not secured at all, so I recommend uploading it, running it, and then deleting it. (Well, now that I think about it, I’m pretty sure including admin.php does automatically provide standard admin security, but don’t quote me on that.)

If I have the time and if anyone actually cares, I’ll update this and turn it into a proper plug-in with all of the attendant niceties. Otherwise… well… never mind!