Three Point One

WordPress 3.1 is out, and I’ve just upgraded a few of my sites (including this one). A few observations spring to mind immediately:

  • Installation was, of course, a breeze
  • The new admin bar is great. What would make it awesome is if developers (i.e. me) can add item to it: links to plugins, sparklines etc…
  • Network admin has been sensibly moved to a separate place than the standard admin sytem. Can we add items to the network admin menu? I guess so. I also hope that network (or WPMU) plugins will continue to work.
  • Not tried the new internal linking feature as I always use the raw HTML editor, but as I’ve been writing something similar for my day job recently I can imagine how it work

I’m looking forward to testing my plugins with 3.1, and writing some great new ones.

VoucherPress: Version 1.0

I have to admin being a bit of a wimp when it comes to choosing version numbers for my WordPress plugins. Just like Google my work is constantly in a state of development, in flux. Although it isn’t, not really.

I don’t have anywhere near enough time to spend on open source software as I’d like (the bank manager wouldn’t be happy if I wanted to pay my mortgage in a new currency comprising of nice emails). So rather than commit and say “Yes! This is version 1.0, the definitive point in this plugins development!” I wimp out and start from 0.1 … moving to 0.2 when I add some features or fix a load of bugs.

However, one of my most popular plugins – and, incidentally, the one that I get by far the most amount of ‘thank you’ messages for – has just had it’s version 1.0 birthday.

VoucherPress allows you to create vouchers or coupons for download from your WordPress site. The list of features is now pretty extensive:

  • Large range of pre-built templates
  • The ability to add your own templates
  • Limit the number of vouchers available (e.g. only allow 1000 to be downloaded)
  • Set a date when a voucher will expire and not be available any more
  • Require visitors to provide their name and email address to download a voucher
  • Use shortcodes to provide a link to a voucher, a list of all your vouchers, or the registration form
  • Each voucher has a unique code in one of four formats:
    • A random code from 6-10 characters long
    • Sequential codes (1, 2, 3 etc) to which you can add your own prefix and suffix
    • Your own custom codes, one per voucher
    • A single code, the same for every download of a voucher
  • Simple statistics on the number of downloads of each voucher
  • A CSV export of all registered names and email addresses

As you can see, I’ve been a busy boy. Lots of people have asked for the custom codes thing, and a way to style the registration form easier, and both of those things are in this version.

So I think, quite rightly, this deserves to be the official Version 1.0 of the VoucherPress WordPress Plugin. Download it here (once the WordPress plugin administrators have checked all the t’s are dotted and i’s are crossed).

Lifting the veil

I’ve recently released a new WordPress plugin called Plugin Register. In a nutshell it allows plugin developers to be notified every time one of their plugins is activated. Report of these activations then gives the developer some statistics about who is activating what, and when, and what version. Quite simple, but not something that I’ve ever seen before, and certainly very interesting for developers.

It was very easy to build, I probably spent less than 3 hours development time in total. And maybe that’s where I slipped up, because I didn’t think clearly about the nuances of this plugin. You see, the first version of Plugin Register registered the activation of a plugin automatically, with no notification or consent from the user. And that is bad. I’ve since changed it to be an opt-in action to register a plugin.

Even though the only information it saves is the plugin name and version, and the site name and URL, that’s still too much information to be given away without the user knowing. WordPress is sometimes used by sites which need to be kept private, for example sites on an internal network which cannot be accessed from the Internet, or government sites. Even sites which have been set to not be seen by search engines may not wish for their information to be shared with a plugin developer. The bottom line for me was that this plugin should be opt-in, with users making a concious, explicit decision that they want to register their plugin.

However this doesn’t solve the other problem I’ve noticed with the few hundred sites who have registered use of my plugins. You see, traditionally WordPress plugin developers had no idea who was actually using their plugins, unless they got in touch to say “thanks” or report a bug. With Plugin Register they can know that information, and it can cause problems.

Among the sites who have registered using my plugins are sites with legally-dubious content, ‘adult’ sites and sites expressing attitudes and opinions I don’t agree with. When I wasn’t aware who was using my work, there was no problem. Now that I do know, what do I do about it?

Of course, the use of a WordPress plugin doesn’t make me culpable for what appears on these sites, and I can’t stop them using my work even if I felt strongly enough about it to try. With open source software the genie is well and truly out of the bottle. I suppose I could contact the sites I don’t agree with and ask them to not use my plugins, or to save mysefl future moral quandaries I could put a disclaimer on my work which asks people to use my work for good, not evil. But what is evil? My opinion is far from infallible.

And anyway, that’s not the open source way. Short of genuine illegal activites, open source software can be used for what ever you want – including helping political parties I may strongly disagree with. Historically I wouldn’t have known about who was using my work, in this case my WordPress plugins. But, by registering activations of my plugins, I now know. I’m not going to stop contributing to the open source world, but I do have a greater appreciation about the possibilities of how my work could be used.

Testing VoucherPress

This is a test of my new plugin for WordPress. It’s called VoucherPress. Can you tell what it does yet?

Try this on for size: [voucher id=”1″]

With a description: [voucher id=”1″ description=”true”]

And this one should ask you for your email address: [voucher id=”2″]

And a test of a voucher link with a preview:

[voucher id=”1″ preview=”true”]

And a preview with a description:

[voucher id=”1″ preview=”true” description=”true”]

And one with a limited number of downloads:

[voucher id=”3″]

And one more:

[voucher id=”4″]

List of all vouchers:


And a list with descriptions:

[voucherlist description=”true”]

Performer for WordPress

The worlds best CMS just got better, with the creation of a plugin for Performer. Unless you’ve been living under a rock you’ll have heard me waffle on about my JavaScript mini-library which allows you to use those cool effects that your favourite JavaScript library (such as jQuery, Prototype and MooTools) allows you to do. But without writing a single line of JavaScript. Yes, it’s true.

Here’s a simple example. Click here to be amazed.

If everything went to plan this text came pleasingly into view. You might think "Yeah, I’ve seen that JavaScript stuff before", but look at the code I wrote to make that work:

<a href="#" class="toggler targetEl-performerdemo1">Click here to be amazed</a>
<div id="performerdemo1" class="hider"> ... </div>

Yup, just CSS classes.

If you want more information please visit the main Performer website, or download the WordPress plugin here.