WordPress MU Sitewide Tags Pages 0.3.1

One of these days I’ll rename all my plugins and give them nice snappy titles.

Version 0.3.1 of the Sitewide Tags Pages plugin (for WordPress MU) has just been released. If you’ve been using this plugin you should probably update because this fixes a number of bugs including the problem with the Prologue Theme (and possibly Feedwordpress but I haven’t tested that.)
This release wouldn’t have been possible without the help of Thomas Schneider!

Main changes:

  • Pages are now filtered out because they don’t really fit neatly anywhere in the global posts page.
  • Prologue Theme problem with wp_insert_category() is fixed.
  • Set comment and ping status of global posts to closed.
  • Lots of translation work, including a German translation.
  • Lots of fixes related to when blogs change status, or posts are edited.

Grab it from the download page.

WordPress MU 2.6.2

WordPress MU, the multi blog version of WordPress that runs on WordPress.com has been updated.

Version 2.6.2 is now available for download and is a required update. WordPress MU isn’t vulnerable to the security bugs that were the reason for WordPress 2.6.2 but it does contain a number of important bug fixes, including:

  1. xmlrpc.php works better if you use multiple sites. #735
  2. get_option() wasn’t reading all options.
  3. Configurable media buttons on the Write page. #598, #738
  4. 404 “file not found” errors on folder installs is mostly fixed. #745
  5. And more .. (timeline)

PS. Don’t forget the voting is now open in the WordPress MU plugin competition.
PPS. Registration is now open for BarCamp Cork II on November 1st. I’ve put my name down to give a talk there.

Want to test super speed caching?

Yesterday morning was one of those mornings. I couldn’t sleep, but not for want of trying. Around 5am our 17 month old baby wasn’t too keen on the whole notion of shut-eye. Instead I took him downstairs to feed him, and do a little surfing and hacking to pass the time until the sun rose.

Lucky for you that I did.

I discovered that WP Super Cache was compressing the page output twice! That’s right, it’s my own fault, but for over a year that little bug has gone unnoticed. I won’t bore you with details, but it’s fixed now and if you compare wp-cache-phase2.php from the latest release with that in the development version you’ll spot the differences.

In testing, I noticed that pages were generated more quickly. Sometimes twice as fast as before if everything else had been cached by the object cache. I even posted a message to the support forum asking people to try it out but the silence is deafening which is why I’m turning to the power of the blog post.

If you’d like to give this bit of code a go, grab the development version of WP Super Cache, test it, and leave a comment here. Before you install it, grab a few pages while not logged in and record the page generation time, then after install, check out the same pages. I’d love to hear if it improves things.

You could also try setting “$cache_rebuild_files” to 1 in wp-cache-config.php. That will enable some experimental code that moves supercache files out of the way when the page becomes stale but then restores them while the page is being rebuilt. That should help significantly on busy sites where lots of comments are made. It’ll be switched off by default because I don’t think it will benefit most sites, and will only result in more I/O. Check out this forum thread for further info.

If you’re interested in testing the plugin in the future, you could subscribe to the wp-super-cache-dev tag, where I’ll post development updates on the plugin.

WP Super Cache 0.8

WP Super Cache is a page caching plugin for WordPress that will significantly speed up your website.

If you’re not interested in the changes, simply grab the latest version of the plugin and copy the files into your plugin folder. It’ll work, but if you’re upgrading, you should read on.

Major changes in this release:

  1. Generate a semaphore id based on hostname and cache path to avoid problems on shared hosts, props Tigertech.
  2. If you run WordPress from a different directory to where it’s installed, supercached files weren’t deleted when a post was made or updated. That is now fixed. Thanks Viper007Bond for all your help on that.
  3. Paged archives, category pages, and tag pages are now cleared when a post is edited or comment approved. This replicates what WP Cache did all along so you should hopefully see supercached static files updating more often.
  4. If your .htaccess is read-only, the mod_rewrite rules are displayed on the admin page. Thanks Matt for the patch.
  5. Updated mod_rewrite rules won’t serve static html files if there’s a “=” in the url. Should catch all sorts of problems with plugins and attachments. You’ll have to manually edit your root .htaccess to match the new rules.
  6. Set cache control and expiry headers of supercached files. They are cached for 5 minutes, but with a “must-revalidate” header. Delete wp-content/cache/.htaccess for the new rules to be updated.
  7. Check for WordPress MU because it can’t update the .htaccess file.
  8. Write supercache html to temporary files and rename. The old way opened the correct file for writing, did some work and wrote the file. In the fraction of a second it took to write the file, someone might request it and get an incomplete page.
  9. The Supercache expiry time has been removed. There can be only one.

Edit: 0.8.1 has just been released. This addresses the following:

  • The “forbidden files” problems some users had is fixed.
  • Supercache files were being removed needlessly when a moderated comment was made.
  • I added a “Clear cached files when post is edited” checkbox.
  • I added a “Delete Cache” link next to the Dashboard link on the dashboard.
  • Tigertech found that when a file is renamed and the new filename is already used, the old remains.
  • Updated readme.txt.

WordPress MU 2.6.1

WordPress MU version 2.6.1 has just been released. This is a sync of the WordPress maintenance release that saw the light of day a few weeks ago.

This is a required upgrade as it fixes a number of critical bugs, particularly in deleting users and blogs. Upgrading is as easy as copying over the files of your current install.

For a more comprehensive list of changes, check the timeline, but in short, yes you do need to upgrade!

WordPress MU is a multi blog version of WordPress that runs many sites such as Linux.ie Blogs and WordPress.com. If you run the single blog version of WordPress you can probably ignore this message.

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!

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.

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*