Using SVN to manage your Wordpress install

Saturday, September 27th, 2008

I use SVN to manage both this blog and the Blakepics Gallery2 installation.  Using the version control software as a means of keeping my own sites’ shared components up to date is horribly convenient once you get through the initial attempts of “shit, I’ve broken it again”.

Wordpress have full instructions for setting up your blog with SVN.  I’d recommend sticking to the ‘Tracking Stable Version’ section and controlling your upgrades rather than checking out the trunk and risking an unstable install.  This basically comes down to a single command to be run within your wwwroot.

svn co http://svn.automattic.com/wordpress/tags/2.6.2 .

When a new version is released, you can switch to that with:

svn sw http://svn.automattic.com/wordpress/tags/2.6.3

What they don’t mention, is you can do exactly the same with your plugins using the repository here…

For example, find the plugin you want, and checkout to your plugin folder:

svn co http://plugins.svn.wordpress.org/share-this/tags/2.3/ share-this

As before, you can switch to new releases (make sure you’re in that plugin directory first) with:

svn sw http://plugins.svn.wordpress.org/share-this/tags/2.3/

And should you forget the URL you’ve got it from (like when you see there’s an upgrade available, running ’svn status’ in that directory should help you out.

Once you get the hang of it, it really saves so much more time than that slow download, unzip, copy process you’re probably all used to, and you stand a much better chance at maintaining your own modifications without rewriting them all the time :)

Twitter - Now the machines are syndicating us

Tuesday, August 12th, 2008

RSS recursion is not a toy

… that was syndication for the sake of it.

That’s what I said, word for word. Then a colleague pointed out that I could have twitter automatically update from my blog or Blakepics. And all hell broke loose.

I didn’t like Twitter as another way of updating my blog, or having it throw up all over my Facebook status every time I opened up my Twitter-enabled fridge. But reaching out to new audiences, and the potential to bombard mobile phone networks every time I bounce from one country to the next… Well suddenly it’s become quite cool.

And yes, I admit - I was tempted to install the application to syndicate my Xbox 360 status as well. But I’m not sure I’m ready to spam everyone that much. Yet.

“Kevin has just been killed by a bunny rabbit on Halo 3. Again”

Why don’t you try the homepage? Idiot.

Monday, March 31st, 2008

I recently read “The Inmates are Running the Asylum” by the father of VB, Alan Cooper. He spends quite a while arguing the case against obnoxious interfaces that make life difficult for your users. Quite right too. I highly recommend the read if you’re involved in any kind of user interface. Actually, I highly recommend it anyway - empower yourself with the knowledge that things don’t have to be this way.

Anyway, my small part towards eliminating frustration and annoyance was to try and create the perfect 404 page. And I know what you’re going to say… If you desire perfection, why would anyone ever even see your 404 page. Well you’re quite right, but it doesn’t hurt to be defensive about these sort of things. Accidents happen and believe it or not, not all of them are entirely my fault. Sometimes.

I’m not going to link to it here, because my 404 page automatically emails me whenever there’s a broken internal link. Frankly I could do without the hassle. That’s step one, and here are some more.

  • Tell the user what’s wrong. If they’ve come from another site (do this by checking the referrer URL), let them know which site, and that the link was broken at that end. If they haven’t - chances are it’s a bookmark / favourite. Tell the user that. The term ‘404′ is not helpful - telling the user what happened, is.
  • Recent Posts. It’s a blog. If you’re here, you’re most likely reading one of the latest five posts. If you’re applying this to your own non-blog site, list your most changed popular pages.
  • Search. If you’re looking for something and I’ve already failed to find it, searching seems more appropriate than to keep doing what you’re doing.
  • Possible matches. You’ve got a URL - use it. So I try to guess at what the user was hoping to find based on what’s in the URL. If you’ve got some decent SEO going on, chances are this will do better than you think.
  • Other helpful links. The homepage is generally a good starting point, and well, I don’t have a site map. But if I did - this would be another good thing to include.
  • Google Cache - Google maintains a cache, so why not make some use of it and point your visitors at it to hunt for your missing URL. This might not be exactly what you want for your site, but they could find it on their own anyway so stop being difficult.
  • Tags. All my posts are tagged, and provide a nice overview of what the posts are about, so let’s include those.

Turn your 404 page into a jump-board rather than a brick wall - or your readers are just going to find something better to do.

Fixing wordpress RSS XML parsing errors

Saturday, October 20th, 2007

Wordpress RSS feeds can be annoying. Really annoying. If you install a bad plugin, theme, or even edit some of the existing php files you might find your RSS feeds start getting this parsing error.

XML Parsing Error: xml declaration not at start of external entity
Line Number 3, Column 1:<?xml version="1.0" encoding="UTF-8"?>

You might find that enabling output buffering for your RSS feeds might sort you out, as suggested by J Wynia. But unfortunately it didn’t do it for me.

So, go to the source and fix up the files causing you problems, with the following perl script. It will check each of your php files for any that have extra line feeds at the start, or end - and remove them. You’ll need SSH / command line access for this, as well as perl installed.

Use it at your own risk. It worked for me, but is otherwise untested - so, make a backup first :)

Instructions

  1. Backup your wordpress installation
  2. Download the script to the root directory of your wordpress installation.
  3. cd to your installation directory.
  4. Run the script: perl fix-rss-xml-spacing.txt.
  5. Fingers crossed, your RSS feeds will now work again (and hopefully, so will the rest of your blog).

Good luck!

This site is designed for the Wii … seriously.

Tuesday, May 8th, 2007

Hot on the tail of Google Labs with their updated RSS reader now supporting the Wiimote, in almost eyebrow-raising excitement - I wanted to congratulate this Michael Bolin guy on his Wiimote javascript libraries.

So I did a little more digging, and I found a nice little Wii Wordpress plugin that detects if you’re using a Wii and displays the site accordingly. Nice big text, easy to navigate links, perfect for that in the armchair browsing we all wish we could do.

That’s all very well, but it doesn’t make much of Michael Bolin’s library. So I did what any self-respecting web developer would do, and hacked the two together in the dirtiest quickest way possible. So if you’ve got a Wii - try it out… Go to blog.puzzlebox.co.uk in Opera and see the layout especially designed for you. Click on an article to read it, and while you’re there, hit the Left and Right buttons of the d-pad, and you’ll skip between the articles as well.

Now then, about that Wii keyboard …