TechLudd Cork 2008

Anton Mannering organised TechLudd Cork last night at the Cork International Airport Hotel. I demoed Tweet Tweet and answered questions about WordPress and some of the plugins I had running on my blog.

Apart from showing off Tweet Tweet I took a few photos too. Pictured below are only some of the people there including (in no particular order): Walter, Bernard Goldbach, Anton, Aileen, Gavin Harkness, James Galvin (who should tweet more about Tweetrush!), Walter Wynne, John Peavoy, Pat Phelan, Ashley Halsall, Robin Blandford and some crazy guy who calls himself Damien.

If you see yourself in one of the photos please leave a comment, and apologies for not getting your name on the night.

Yes, the lighting in the toilets in the Cork International Airport Hotel really do change colour.

WP Super Cache 0.7 – the dupe content killer

WordPress.org user, “definitelynot” discovered a bug in the WordPress plugin, WP Super Cache that could expose blogs to duplicate content penalties. Unfortunately this affects every blog that uses the plugin in “ON” or full “Super Cache” mode, and has URLs that end with the “/” (forward slash) character. If the plugin is on “half on” mode, you’ll be fine.

The problem is that an anonymous user might visit a legitimate URL, ending with a slash, the plugin then creates a static file out of that page, which is then used when people visit the same URL. Unfortunately if someone links to that URL without the ending slash, a visiting browser or search engine bot won’t be redirected to the proper URL, they’ll be served the static html file.

For example:

  1. John visits the URL /2007/05/23/why-the-nurses-cant-go-on-strike/ on my site. WP Super Cache creates a html file of that page.
  2. In his enthusiasm for that post, John publishes a post about those zany doctors, but he forgets the ending “/”.
  3. Googlebot, seeing fresh content on John’s site, crawls it and sees the link, visits my site eventually and wonders why it’s seeing the exact same page at two different URLs.

To be fair, Google is pretty good at figuring out where duplicate content is supposed to go but it’s better to avoid the issue completely. It also only matters if there are links to your site without the ending slash. The most common will probably be to your homepage as it’s likely internal URLs will be copy/pasted.

How to Fix
You should update to version 0.7 of the plugin which checks if your blog is affected by this problem. It also has instructions for updating the mod_rewrite rules in your .htaccess. It’s fairly easy to fix. Thank you “andylav” for the mod rewrite magic!

  1. Edit the .htaccess in the root of your WordPress install.
  2. You’ll see two groups of rules that look like this:
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*s=.*
    RewriteCond %{QUERY_STRING} !.*wp-subscription-manager=.*
    RewriteCond %{QUERY_STRING} !.*attachment_id=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{HTTP:Accept-Encoding} .*gzip.*
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]
    
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*s=.*
    RewriteCond %{QUERY_STRING} !.*wp-subscription-manager=.*
    RewriteCond %{QUERY_STRING} !.*attachment_id=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]
    
    
  3. You need to add the following 2 rules above each block of “RewriteCond” lines:
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    
    
  4. The rules should eventually look like this:
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*s=.*
    RewriteCond %{QUERY_STRING} !.*wp-subscription-manager=.*
    RewriteCond %{QUERY_STRING} !.*attachment_id=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{HTTP:Accept-Encoding} .*gzip.*
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*s=.*
    RewriteCond %{QUERY_STRING} !.*wp-subscription-manager=.*
    RewriteCond %{QUERY_STRING} !.*attachment_id=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]
    
  5. Or you could just delete those rules and let the plugin regenerate them for you again.

PS. Thanks also to Lloyd for noticing the “enable the plugin” link was pointing at the wrong URL, and to Ryan who spotted a minor problem with the admin page and was kind enough to send me a Tweet about it.
PPS. I’ve just tagged 0.7.1 to fix some problems with the updating of the .htaccess, mainly for new users. If 0.7 of the plugin works for you, there’s no need to upgrade!

Howto: Twitter sms notification for Meteor and Vodafone

A few weeks ago Twitter annoyed a lot of European users when they stopped sending sms notifications to their users. I never really used that facility so I didn’t miss it but many Tweeters did. Outrage and blue murder were spoken of in the same sentence. People marched in the streets, there were riots.

OK, maybe not, but it annoyed a few prolific Tweeters and I wondered aloud if I could make Tweet Tweet send me sms notifications when I got replies or direct messages. After quite a bit of testing and playing around with Meteor’s website I’m glad to say I cracked it. I added hooks to my plugin for other plugins to latch on to, and wrote a small bit of code that logs in to Meteor.ie and uses their free web text to notify me of replies or direct messages.

Following on from that success, Jason Roe added code so Irish Vodafone customers could get sms notifications too!

So, if you really miss the sms notifications from Twitter, and you’re an Irish Meteor or Vodafone customer, download Tweet Tweet, install it in your WordPress blog and enjoy getting those sms notifications from Twitter again!

Developers – if your phone company isn’t covered just yet, please take a look at the existing Meteor and Vodafone plugins. The framework is there. Using curl to login and send texts can be a little daunting but it’s not impossible. Get in touch by leaving a comment here, or using the contact form on the about page.

PS. Almost forgot to mention Tweetrush went live yesterday with some very nice Twitter stats. Check out what my friend AJ has to say about the launch!
PPS. I’ll be demoing Tweet Tweet at Techludd Cork on Thursday night. If you’re there, please say hi!

WP Super Cache 0.6.7

WP Super Cache is a plugin for WordPress that creates cached copies of your blog posts and pages, making your site much faster to serve. It’s also ideal for coping with sudden surges of traffic.

I released a new version of the plugin this morning. This is a bugfix release:

  • Mike Beggs contributed a number of changes:
    1. Better support for Win32 NTFS
    2. Better use of the “Vary” header so proxy servers won’t cache the wrong page. If you see leakage of comment details on posts this will fix that problem.
    3. WP-Cron handles cleanup of expired cache files in the background now.
    4. Disable mod_deflate if it’s running as it sometimes tries to compress gzipped files. Remove wp-content/cache/.htaccess for that file to be updated.
  • Lazy and Otto both recommended using get_comment() instead of the depreciated get_commentdata()
  • A basic “uninstall” function has been added to remove some of the files the plugin creates. It’s called when you deactivate the plugin.
  • PHP running as a CGI doesn’t support apache_request_headers() so that’s been added too.
  • And I almost forgot, the admin page received a slight makeover.

Get the plugin from the download page!

When a dog loves a woman

The happy and sad story of Goofy, a dog rescued from Greece, who took over Belinda Harley’s life.

If you enjoyed story of Goofy’s rescue, look for the book, “Marley and Me”. It’s a lovely story, and you’d need to have a hard heart not to shed a tear by the end of it.

The only time that Mark Birley, that quintessentially reserved Englishman and ruler of the nightclub Annabel’s, sent me a love letter, it began: “Darling Belinda, I know I only saw you last night, and will see you again in a few days, but there is something I wanted to put in writing. I want to tell you how much I love and admire you” (here, I caught my breath) “for rescuing that divine dog.”

The rest of the letter was not about me at all. It was all about Goofy, the mixture of spaniel and scamp with the wonderful, intelligent eyes that I had brought home, after nightmarish battles with official-dom, from the Greek island of Paxos.

Tweet Tweet 0.1 for WordPress

I’m a big fan of Twitter. It serves as a useful tool connecting people who might never meet, and also as a vital means of communication for those who work at home or in solitary conditions.

The one huge and uncomfortable problem I see with Twitter is, “What happens to the conversation if Twitter fails?” What will you do if Twitter goes out of business tomorrow? Where will all your conversations, all the links you posted, and received from your friends be? That’s why I wrote Tweet Tweet.

Tweet Tweet is a plugin for WordPress that will archive your tweets, and the tweets of everyone you follow, plus replies you receive from strangers, and direct messages too. All these tweets will be stored safely in your database.

There is a simple “review pane” where you can see the latest tweets and go back in history but it’s very basic. The primary aim of this plugin is to ensure that your conversations are safe.

Tweet Tweet

The plugin has been tested by a number of users, but it uses jQuery and AJAX techniques for the review pane so I’d love to hear if it works for you.

Please, do not hack the plugin to poll Twitter more than once every 90 seconds. Unless you follow thousands of others, 90 seconds will be fine. I have mine set to 180 seconds and it picks up every single tweet.

Update! I just tagged version 0.2 which adds a better hover for the review pane (and makes it IE6 compatible), and also adds a search form to make it easier to navigate your Tweet archive.

How to watch DVDs on your Wii

Speculation on fan blogs about an upgrade to play DVDs on the Wii Console has been persistent for as long as I’ve been reading them, but it seems doubtful Nintendo will ever add this ability.

What are we to do? If you can’t get official support for something that the hardware can probably do, why not code it yourself? The Wii is a closed platform, but that hasn’t stopped enterprising developers taking a peek under the covers. That’s exactly what Erant did with his libdl and DVDX installer!

He created a dvd access library for the Wii Console, added the Mplayer media player and hey presto! DVD playback on the Wii. Mplayer also plays practically any video format under the sun so it’s even better than a DVD player.

Our DVD player is stuck in a cupboard under the television where the baby can’t get it (and requires untying of handles for an adult to get to) while the Wii is on a shelf in easy reach. I think this may be the project that gets me to try out Wii Homebrew using the new Twilight hack.

Once you’ve done that, you can enjoy the splendor of mplayer. That what started out as a simple proof of concept has rapidly turned into a full-featured media player, under the nourishing hands of dhewg. The main aim of the mplayer project was to get DVDVideo going, but it also supports reading video files off the SD card. (Experimental).

Nintendo Wii fanboy has a simple guide to getting everything running, from installing the Homebrew channel to running Mplayer. Nice.

Mplayer playing DVD on Wii Console

WordPress at No. 10

You may have heard that the official site of the British Prime Minister’s Office at number10.gov.uk launched earlier today. The great news is that it’s running WordPress, but what really excited me is the fact that the site is also using WP Super Cache.

The site was initially very slow, but once the cached static files were in place, it just zipped along! Three cheers for caching and everyone who has contributed to WP Cache and WP Super Cache! 🙂

I wonder if Gordon Brown will be looking at his Dashboard? *Wave*

WordPress MU Domain Mapping 0.1

A long sought after feature in WordPress MU is domain mapping. That’s where a blog on a WordPress MU site can be “mapped” to a new domain. WordPress.com has an advanced domain mapping feature that has proved to be very popular with users even though it’s a paid-for upgrade.

This domain mapping plugin isn’t quite as powerful and still requires plenty of testing. So, while domains and “sub domains” or hostnames can be mapped to individual blogs, there are a number of caveats:

  1. Remote login does not work. It’s possible to be logged in on the main site, logged in on the domain mapped blog as a different user or not logged in at all there!
  2. It only works if your WordPress MU site is using sub domains.
  3. It’s the 0.1 0.2 release. It’s basic.

Here’s the plugin page, and the download page. I’d like to hear how well it works for you.

I’m submitting this plugin to the WordPress MU plugin competition. There are only 2 other entries so the odds on my winning are pretty good!

I should have a Sitewide Tags update later this week, with thanks to Thomas Schneider who came on board last week to help and has done some super work!

Ron and Andrea found a bug in pre release testing that I forgot to fix in 0.1, so grab 0.2 if you were (un)lucky enough to grab the first release! Thanks Trent for testing too. Follow me on Twitter to get the inside scoop on my WordPress plugins, including a sort of super secret Twitter plugin..

WordPress MU is the multi blog version of WordPress that runs on WordPress.com and many other sites.

Gravatar enabled WordCamp Badges

Andy has the very exciting news that Gravatar icons will be printed on attendee’s WordCamp San Francisco badges this year!

gravatar badge

On supporting websites, Gravatars have become a de-facto identity for comment threads and discussions so to carry through the identity to the conference floor is just a logical conclusion.

There is one caveat. Gravatars can now be up to 512×512 pixels. The bigger they are, the better they’ll print. If your Gravatar is a measly 32×32 pixels it’s going to look like a dirty smudge next to the shiny badges of the big boys. Andy has created a handy form for checking if your image is the right size. If not, please upload a new Gravatar before August 14th!

I won’t be at WordCamp this year but after seeing the line up of speakers I’m looking forward to seeing the blog coverage afterwards.

PS. Andy has a new post showing how to create those badges with the help of a PDF library.