The Irish Citizenship Test

I saw this on reddit a few days ago but this morning Rick O’Shea retweeted this 2fm tweet announcing the sale of a poster with the image above:

The Citizenship Test Poster! On sale now & with all profits going to Médecins sans Frontières, the world’s… http://fb.me/1ySOHnDU5

You can buy the poster here where “€4.50 from the sale of every poster will be donated to Rick and RTÉ 2fm’s nominated charity, Médecins sans Frontières, the world’s leading medical humanitarian organisation.”

Click on the image above to get a slightly bigger and more readable version. You’ll still have to squint a bit but it’s worth it. Well done to everyone who contributed a tweet!

Now, where’s the Cork Citizenship Test? (You knew I had to bring this up didn’t you?)

WP-Super-Cache: bug fixing and PHP object destruction

If you use the WPTouch mobile plugin, or the preload function in my caching plugin, or noticed that annoying but random and (thankfully) rare “front page isn’t showing my front page” bug then you might like to try the development version of WP-Super-Cache located on this page.

Mobile plugins need to tell WP Super Cache what user agents they support. I documented the filters you can use (“cached_mobile_browsers” and others) to do this but I don’t think they’ve been used by any plugin. It’s not hard to do and I added code that checks for WPTouch so when you visit the WP Super Cache settings page it updates the mobile user agents. So far it works for me but please feel free to view this site on your mobile phone and tell me if it looks ok! I also added support for the theme switcher in WPTouch based on code posted on the wporg forum.

It appears that the “random post on the front page” problem is a side effect of how PHP works. WordPress incorrectly reported that the current page wasn’t a search page, even though it was. I put an extra bit of code in checking if $_GET is non empty and that fixed it, so far.

Just in case anyone else is interested, this is why is_search() fails randomly when run during PHP shutdown. When a PHP process shuts down it starts by killing off objects. Unfortunately this happens before PHP stops executing your code, something that changed after PHP4.

Anything that runs when the output buffer finishes or that is registered by register_shutdown_function() better not depend on objects or classes. That means no using $wpdb, the object cache may disappear or to be completely paranoid don’t expect $wp_query to be around either! The functions is_search(), is_feed() and other related WordPress functions depend on $wp_query so you should cache the values of those functions earlier in the process. I’m thinking of hooking into wp_head but that depends on the theme unfortunately. Not every theme uses that action.

Many years ago I changed the format of the cache “meta file” from an object to an array because of the way the PHP desctruction process works. More recently, but still two years ago I had to remove all calls to get_option() and update_option() in the output buffer handler because occasionally people saw the error, “Call to a member function get() on a non-object in cache.php” in their error log. The object cache object had been destroyed by PHP! That was a right pain to figure out as the code looked perfect yet didn’t work right some of the time.

To help figure out problems I’ve added a lot more debugging to the plugin too. If $wp_query disappears it’ll appear in your debug log, and preloading will generate a lot more messages now.

Next up is caching is_search(), is_feed(), is_single() etc. Where should those be cached? The “init” action is too early for is_search and probably others but I don’t want to depend on actions that may not be in a theme.

Skyrim is pretty good and on PC you…

Skyrim is pretty good and on PC you can use mods to change things around. skyrim nexus appears to be a good place to get those mods and I’ve tried a few:

Edit: two articles on being a battlemage and a followup article.

Charlie Chaplin’s Kerry Accent

Charlie Chaplin, the star of silent movies of a bygone era spoke with a Kerry accent. Well, he did when he spent time in the town of Waterville in that county of Ireland. So his daughter says in this RTE documentary called “Kerry and the Tramp”.

It’s a wonderful documentary to listen to, especially as they interviewed his family and people who met him who all had their own stories about the actor.

I did not know that he was practically forced out of the United States because the authorities there suspected he was a communist. They let him back in the 70’s, but only for 15 days. He joked that they were still afraid of him!

I installed the RTÉ DocOnOne app but it’s stuck on the “Loading” page so best to not use that if you’re on Android. Does the iPhone version works better?
Then I was left wondering how do I subscribe to an itunes podcast without itunes but thankfully searching for “documentaries on one” in Podkicker worked!

Makerbot 3D Printer makes a Church

Last Saturday I went to the Coderdojo party in the NSC with my son Adam to see what it was all about. We arrived late and all the pizza was gone but there were loads of balloons for the younger kids to play with!

The adults and older kids watched a 3D Makerbot printer demo. I love the open wooden case the printer is made from and when it started making a replica of St. Anne’s Church all eyes were glued to it as layers of plastic were laid down layer by layer. I posted some more photos here too.

One that was made earlier

Thanks Ann for tweeting about this on Saturday morning and reminding me it was on! Hopefully I’ll get to more Coderdojo events in the future!

Kids Place Android Parental Lock

My new favourite app is Kids Place. It’s an application launcher for Android that only allows access to the apps you want. The parental lock is protected by a 4 digit PIN but the launcher can be disabled by rebooting the phone.

A launcher app, with child lock, for Kids to protect your personal data & apps.
Creates a safe area on you device for kids. Child lock protects your personal information when kids are using your phone or tablet by restricting them to apps you approve

My son loves playing games on my phone and I usually put it into Airplane mode so he can’t go online accidentally but once in a while he’ll move the icons around or make new folders. Luckily he never deleted any contacts or messages but with this app I don’t have to worry any more. Parents, go get this app if you have an Android phone!

WP Super Cache 1.0

WP Super Cache is a fast page caching plugin for WordPress that can significantly speed up websites.

The first release of this plugin was in September 2009 so this has been a bit too long in the making. Back then the main caching plugin was WP Cache, which this plugin is based on, but now there are quite a few including W3 Total Cache, Hypercache, Quick Cache and many more.

Version 1.0 is an incremental upgrade from the previous release but it has a number of bugfixes and new features:

  1. The all new scheduler and admin bar link should please many people, especially those who want to clear the cache on their site at particular times. The “Delete Cache” admin bar link is something people have been asking about for as long as WordPress has had that bar!
  2. You can preload categories and taxonomies although this hasn’t really been tested as well as I’d like. It works for me but YMMV.
  3. There’s better support for mobile and https users now. Mobile support should scale a lot more than previously.
  4. The cache tester is fixed now and the plugin traps as many errors as possible. It’ll also spit out some helpful text if there is a problem. 99% of the time it’s because the server can’t request a page from itself.
  5. At the risk of annoying users who comment on your site you can make them appear to be anonymous users which will drastically help your server if they like commenting a lot. Unfortunately it stops the comment form populating with their details so it might be worth using an external comment system like Intense Debate or Disqus!
  6. The Advanced Settings page now lists a “do not cache page” secret key. Use this key to view any page of your site uncached.
  7. The cache file listing and delete links should work again now.
  8. And many many more bug fixes.

Once you upgrade go visit the settings page and check out what’s new there. The upgrade worked fine for me, but there’s no harm looking. Pay close attention to the new garbage collector. The scheduler is rather powerful and flexible so it’s worth setting up right.

If you have any problems please leave a comment here or use the support forum.

WP Super Cache Scheduler and Admin Bar Link

I made a few changes to WP Super Cache over the last week. The garbage collection user interface received an overhaul and it’s now possible to schedule the those jobs using a timer or a clock. It can also send you an email each time it runs!

Another major change was the addition of a “Delete Cache” link on the admin bar for logged in users. This may seem strange, but it will only show if you have disabled caching for known users. Unfortunately this is needed because of the security measures required. It only deletes the supercache file(s) for the current page, not any legacy files associated with it.

If you’re feeling adventurous go download the development version from this page and give it a whirl. I really need feedback that this works well so please leave a comment if you try it.

The version number won’t change and when the next release comes out you’ll still get the upgrade notification!