Articles for August, 2010

Is WordPress putting whitespace in your XML? Here’s how to fix it

XML error

XML Whitespace error, courtesy of @JonRowe

Since I started using Feedburner to add adverts into my RSS feed (there are now ads, let me know if they’re intrusive), I’ve been getting errors like the one above in my XML feed. Basically, there’s a few new line characters being output by several classes. This means the XML is invalid and services like Feedburner complain, as do some browsers (FF, Opera, Chrome).

In PHP, there’s a simple way to fix this, using a buffer and stripping newline characters off the beginning and end. WordPress have considered this before, and have rejected this method of fixing it because it’s generally caused by plug-ins which should fix themselves. Hence, their solution for 3.0: indicating when additional characters are output when the plugin is activiated.

So, I did that for all my plugins. I found that the following were giving me extra characters:

  • AVH First Defense Against Spam (2)
  • FeedBurner FeedSmith
  • JR Post Image
  • Last.fm for wordpress
  • Tweetbacks
  • Twittar
  • Twitter for WordPress
  • WP-Spamfree

So, I then removed the blank line at the top of each of these files. This got the number of blank lines from 12 to 2, which still isn’t enough.

I then re-installed wordpress, thinking one of the core files had become corrupted. Still no valid XML.

More research led me back to the output buffering solution. wejn.org has a pre-prepared file to resolve this issue. It’s a simple install and is well documented. Since putting this fix in, I’ve had no issues and my RSS feed is back up and running.

I’d still love to know what caused the single line, but I’m glad there’s a fix to sort it out.

The Low-Hanging Fruit

Ceppas Cristiana's The Tree

Hearing childhood teenage professional hero Andy Budd speak at #lwsux last month confirmed many things that I already knew, and introduced me to even more things that I needed to be more aware of (read my full write-up).

The one thing that really got me was talking about the “low-hanging fruit”. It’s a pretty simple concept, as a consultant, much of the benefit you will bring to an organisation, in improving a system’s design, will be painfully obvious.

Take, for example, a client of mine. An old system based on 2003 technology, with even more prehistoric standards support. It used javascript everywhere, all links opened in new windows (complete with navigation) and whilst there were templates, from a programmers perspective, there may as well not have been.

So, how to make it better instantly? Update the system to use templates, stop links appearing in new windows, make it work cross-browser and replace as much of the javascript with “server-side” code as possible. That’s before you get to the simple layout changes that you can make. Spending a bit of time on the information architecture improves the flow of information and user journeys. The system hasn’t changed much, but it’s infinitely more usable and user-friendly. The client almost had a “crisis” when I showed it working on my iPad.

What’s the lesson here? Take the easy usability problems and solve them with best practices.  Test as you go, there’s no need for large-scale user testing unless there’s a specific problem that you’ve been asked to solve. The simple solutions to simple problems solve most of the issues of user-friendliness within a system, and a good bit of IA generally does the rest.

So, take the easy option!