Mark’s (we)Blog 2.0

Just under six months ago, I changed hosting providers and moved this blog from Blogger to WordPress. Ever since then it’s been tagged as Mark’s (we)Blog [v2.0β] but the time has come to remove the beta tag… after all I’m just one bloke doing this in his (limited) spare time so things are unlikely to ever be “finished” to the standard I would like!

So, after a few months of running the site on WordPress, were my initial impressions valid? Was it all worth it?

Yes, I think. It’s been hard work getting everything working the way I like it – I’ve had to edit every single post, categorising them and correcting markup issues (my own fault for not writing decent XHTML in the first place, although in the case of embedded video clips I’ve actually had to regress to a non-compliant solution).

Then, as I’ve edited every post there have been hundreds of pingback comments to approve (remembering to update the date and time on the comment to match when the post was originally published).

Editing the template to suit my needs has been great fun (and has really helped bring on my CSS skills) – Andreas Viklund (who wrote the original template) was very helpful in providing me with his original photograph so that I could produce a larger version (with help from my friend Alex) after I increased the width of the content. Alex also helped me out with a cell spacing issue on the few occasions where I used tables (in a semantically correct manner) with a little-known piece of CSS (border-collapse: collapse;).

One of the great things about WordPress is the extensibility of the platform – there are hundreds of plugins available and it’s these plugins that have allowed me to extend the functionality of the site, adding features such as external link highlighting, category tagging and control over meta tags (although I have stopped using others, such as Adsense-Deluxe as I found I could achieve the same result by editing my WordPress template) – at the time of writing, this is the list of plugins that I’m using:

There were also some other sites that provided advice/material for the site’s development (but not plugins):

There’s also really good support documentation for implementing code changes such as conditional tags (e.g. to allow sponsors’ advertisements to only appear on certain pages); however getting meaningful responses on the WordPress support forums can be pretty sporadic.

Of course, there is a downside to running on a self-hosted platform (cf. WordPress.com, Blogger, etc.) – I need to patch the software myself. Luckily, my web hosting provider uses the Fantastico system for installing popular applications (including WordPress) and I can use that to apply updates too (although even Fantastico is not immune from some issues… as I found when I upgraded to WordPress 2.2 – more on that in a moment).

I’ve also learnt some tricks along the way and I think it’s only fair that I post them here:

  • Firstly, after importing a large number of posts, I wanted to change the author. I can’t do that in bulk from within WordPress; however I did find a reference to using PHPMyadmin to run a SQL query and change the author for all posts on the database matching certain criteria – the query I ran in the SQL tab was UPDATE wp_posts SET wp_posts.post_author = "2" WHERE (((wp_posts.post_author)="1"));, where “2” is the ID of the new author and “1” is the ID of the current author.
  • Another day, after making a mistake editing the comment submission code, I found that all of the new comments were being attached to one post. I needed to move the comments to the correct posts by browsing the wp_comments table and editing the corresponding comment_post_id.
  • I also wanted to display the allowed (X)HTML for comments and didn’t know the correct function call (it’s <?php echo allowed_tags(); ?>), then, to change the tags that are allowed, I needed to edit the kses.php file (and will need to keep that updated after WordPress upgrades).
  • I’ve also found that, although I had my permalink structure set to /%year%/%monthnum%/%postname%.htm in order to maintain the links from the old (Blogger) site, the postname is defined by the slug and the slug must be unique for the entire site, so some posts have had -2 added to the end of their name (I used .htaccess redirects to manage this but didn’t spot the changes until after Googlebot had reported the links as not found).

It’s not all been plain sailing though.

  • For example, I found that not all of my comments had been transferred from the old site and had to copy and paste the missing ones manually, then go back and edit the author details, date and time. Then, there was a period of about a month when I couldn’t generate pingbacks (nor could certain friends leave a comment) – it turned out to be caused by a single comment which was accidentally dated in the future and once that was changed everything jumped into life.
  • Then, there is the blog spam, thankfully handled pretty well by Akismet although I no longer have time to check for false positives.
  • The built-in WordPress search function does not seem to work as well as the Google Search facility that I provided on the old site. I hoped that adding the full text search for the related posts plugin (ALTER TABLE `wp_posts` ADD FULLTEXT `post_related` (`post_name` ,`post_content`)) would improve this but it doesn’t seem to have helped.
  • Also, after the WordPress 2.2 upgrade, I noticed that characters like the UK currency symbol (£) were appearing as odd characters – a simple edit to the wp-config.php fixed that issue (commenting out define('DB_CHARSET', 'utf8'); and define('DB_COLLATE', '');) – further explanation of this fix can be found at My Digital Life although I haven’t been brave enough to convert the character set and collation yet.

I got there in the end – all the posts have categories assigned and I’m pretty sure that most of the CSS bugs are fixed now so am glad to say that the site is out of beta. Out of beta – but never finished!

So, that’s v2.0 but what next? Well, there are a few bugs that I’ve not yet fixed:

  • The print stylesheet does not work consistently across browsers
  • Some graphics are wider than the main content column and need to be resized.
  • External link identification is not accurate with .co.uk sites (and Internet Explorer places the external link icon in the wrong place)
  • Some graphics used for tracking page impressions (for advertisements) need to be removed.

I may also provide options for alternative themes (I particularly like Dean Robinson’s redoable theme), I’d like to sort out the poor searching, there are some accessibility and user experience enhancements that I’d like to implement and I’m bound to spot more snazzy plug-ins to add to the site. I’d like to use my own photos in the masthead and I also need to do some code optimisation as the page load times are a bit high and my bandwidth usage is rising faster than planned (more visitors are a good thing and ascomi are always happy to help out when I get close to my bandwidth limit but I’d like to bring it back under control).

I always like to hear from people who use the site – feel free to contact me and suggest enhancements, or to provide feedback/bug reports on the site.

Now, if only I could think of a better name than Mark’s (we)Blog (which was only ever intended as a working title and more than three years later it still hasn’t been replaced)! Any ideas? How about “Confessions of an infrastructure architect: echo $HEAD > dev/web”?

Quick guide to getting video content onto an iPod

Apple iTunes can play back a variety of video formats but the iPod (5th generation) and Apple TV each have their own limitations and only play videos that are created in specific formats. I understand that not all codecs will be available for all platforms but I’m a techie and it’s taken me a lot of time to work out what can and can’t work on my iPod. And yes, the the iPod may only have a 320×240 pixel QVGA screen but it can play back at larger resolutions using the iPod AV cable (or another cable if you can get it to work) – it might not look great on a high definition display but I only have standard definition TVs and it’s perfectly good enough for them (sure, there are a few compression artefacts but I get them with satellite TV too).

I’ve been fighting with video incompatibilities for a few days now and think I’ve pretty much got everything sussed, so, here’s my quick guide to getting video content onto an iPod (some of the software mentioned below is Mac-only and so Windows/Linux users might need to search for something else… sorry).

  • Firstly, (courtesy of Apple’s frequently asked questions about viewing and syncing video with iTunes and iPod), iTunes is your friend. Not only is it the centre of the Apple digital experience but it can convert files to iPod or Apple TV format. Simply select the video or audio content that you require, right- (or Ctrl-) click and select convert selection for iPod or convert selection for Apple TV as appropriate. This seemed to work for much of my video content that has come from an eclectic mix of locations using a multitude of codecs (the main changes seem to involve converting from QuickTime movie file to MPEG-4, using a low complexity profile and the H.264/AAC codecs) although I have a few files that seem to have lost their audio track along the way. For these files, I used iSquint to retry the conversion and it seems to have got around whatever the encoding issue was. Using iSquint’s default settings, content is resized to either 320×240 or 640×480 (depending on whether the output is optimised for iPod or TV) but I did find that by using the option to Optimize for TV there was a noticeable increase in the picture quality, even though the source file was only 320×240 (obviously the quality will not increase from the original but, when viewed on a TV, the 640×480 version that was optimised for TV had a noticeably clearer picture with fewer compression artefacts than the 320×240 version that was optimised for the iPod).
  • The tip above for converting content to an iPod/Apple TV format seems to be non-destructive, which is good but does require some management to ensure that only the correctly formatted content is synchronised (in order to avoid errors like the one shown).iTunes error message explaining that some of the videos in your iTunes library were not copied because they cannot be played. Also, note that the duplicates may not appear in the same location as the originals – some of my video podcasts have relocated themselves within iTunes to the movies section and whilst the video type can be changed (between movies, music videos and TV shows), I’m not familiar with any method to move the content into iTunes’ podcast section. Some video podcasts are available in alternative formats via different RSS feeds, but that’s a nuisance where you might want to watch a high-definition version on the computer but still have it available on the iPod when out and about. Consequently I have multiple copies of podcasts like Systm, where I have both the small QuickTime and large QuickTime feeds in iTunes and different episodes marked as played in each. I’ve yet to find a way around that particular issue and it is relatively minor.
  • Assuming that it is legal where you live, applications like HandBrake will rip DVDs into a format that can be transferred to the iPod via iTunes and videos look surprisingly good on the iPod screen (yes, really – certainly good enough for entertainment on a long train/plane trip). Add to that the potential to use an iPod connected to a TV and it’s an easy method for watching video content in the living room, hotel or even hooking the iPod up to a screen in the car to keep the kids amused without spending lots of money on an expensive in-car entertainment system (I haven’t tried it yet but I may do soon). Encoding video (and re-encoding via an iTunes conversion) is time consuming and also the quality will degrade with each conversion, so it pays to get it right first time – I had some difficulties using the previous version of HandBrake to rip a DVD using the HB-iPod preset but version 0.9.0 seems to be working well for me (although if it doesn’t work, some advice suggests ripping to disk before performing the conversion, using a tool such as Mac the Ripper). If the content is already on the computer, then QuickTime Pro may help with the conversion (although iTunes is based on QuickTime so I recommend trying the conversion in iTunes first).
  • Finally, for content producers, Apple provides a tutorial about creating video for iPod.

These techniques have allowed me to transfer most of the content that I want to access on the move to my iPod. There are a couple of issues to iron out (as mentioned) but I’m a lot further forward than I was a few days back. Please leave a comment if you can add to the advice.