Thursday 08 January 2009

Blog Friendly Unit Shifter

how to rotate taglines on your WordPress blog

Another thing on my todo list was to learn PHP and write a WordPress plugin to randomly select quotes stored in the database to rotate the tagline.

An admin interface to create, modify and delete quotes was planned for Version 2.1 (beta) due Q4 2008.

Fortunately for me though, a helpful person called Zombie Robot (pseudonym ?) has already produced wp-quotes (and another kind person tweaked it to work properly for taglines).

All that remains is the interesting part - performance tuning. No - wait. Existing users have already identified this modification as efficiently fetching a single, random record. Horribly database specific of course but worth having when you have 2.4 million quotes.

36c36
< $sql = "select * from " . WP_QUOTES_TABLE . " where visible='yes'
< order by rand() limit 1";
---
> $sql = "select * from " . WP_QUOTES_TABLE . " where visible='yes'";

Bluehost upgrade to WordPress 2.0.5

Bluehost have upgraded WordPress to 2.0.5 so I ignored this warning and clicked 'Upgrade'
Click on Upgrade only if - no files, languages, themes have been modified - you haven't added mods to this installation of WordPress
After all, the whole point of hosting a blog is to add plugins and modify themes. I find it slightly odd that Bluehost have no blog or other means of communicating the availability of these upgrades. Let's see if posting still works.

plugin extravaganza

The observant reader will have noticed some minor changes to the sidebar. The thousands of one hit wonders from Google won't.

  1. Popular posts (widget)
  2. Related posts (widget)
  3. 'Archives' gets a run in the first team, displacing the rarely used 'Calendar' and 'Categories'.
I prefer using widgets to having to actually edit (and risk breaking) the PHP code. Widgets always work with any theme.

Also, I thought it was odd that Google Analytics hadn't tracked a single outgoing link since I installed this plugin. This turned out to be a bug fixed by the most recent version.

I flirted briefly with installing Google Adsense but, in the interests of purity and minimalism, decided against.

couple of useful Wordpress plugins

Feedburner - WordPress.com provides users with statistics about feed subscriptions. At best, these metrics were questionable and I used to provide two RSS feeds (WordPress and Feedburner) so the metrics didn't capture all feed activity anyway. As there is no equivalent functionality in WordPress 2.0.4 out of the box, I resurrected my Feedburner account and installed this WordPress plugin which automatically routes any subscribers to the WordPress RSS feed through Feedburner.

Sitemap - I started from zero when I created this site so I could try my hand at organic gardening. The only search engine I submitted to was Google. When I was trying to encourage Google to index the new site, I discovered that a sitemap could accelerate the process. This WordPress plugin generates a sitemap which tells the Google crawler about the site structure and recently updated pages. The sitemap automatically gets updated after each post and helps to reduce network traffic.

WordPress.com features

After my recent move from the community of WordPress.com, once again I truly feel like a 'Blog in Isolation'. There are a few features I missed from WordPress.com:
  • Dashboard - I can still check the WordPress blog, Top Blogs and Top Posts independently.
  • Forums - While I can still participate, I don't really feel like a member of that WordPress community any longer.
  • Comments - signed up for coComment that tracks all comments (not just those on WordPress.com)
  • Tag surfer - can create Technorati feed(s) to replicate this but this was a nice, dynamic feature.
  • New WordPress themes - If I like them, I simply download and experiment on this blog.
  • Latest WordPress posts - an occasional diversion. No real equivalent (unless I login to my placeholder WP account)
  • Avatars - Not bothered but favicon is your friend.