Lee Willis

Easy Digital Downloads

February 20, 2014
by Lee

Moving to EDD

As some of you may know, I offer commercial WordPress plugins over at plugins.leewillis.co.uk. I started the store back in April 2011, and at the time the only real e-Commerce solution for WordPress was WP e-Commerce. My store’s run rock solidly on WP e-Commerce for the past 3 years, and I’ve constantly been impressed by the core team’s ability to manage the complexity of supporting legacy features, installs and themes.

Scratching my own itches building, and running my store served admirably as a source of ideas for many of my free, and paid-for extensions. However, for the last 6 months or so, I’ve been planning a bit of a spring clean. A redesign was on the cards, and there were a few things I’d implemented that have worked OK, but could do with a second iteration and a bit of clearing up – particularly the documentation areas and the product information sections.

There’s a fair amount of bespoke code behind the current solution, from the licensing engine, documentation architecture, and a few other handy tools I use to handle support efficiently. When I talked at WordCamp London in November, hopefully I was clear that I’m a big fan of not re-inventing the wheel. So, I took the opportunity to review what was out there that would allow me to minimize bespoke code.

While I still think WP e-Commerce is a great solution for a lot of stores, it seemed overkill for my own requirements. Fortunately one of the plugins to have arrived in the last few years is targeted specifically at digital products. Easy Digital Downloads also provides some great add-ons that are going to help me minimise the amount of custom code powering my store.

So, with a bit of a heavy heart, I’ve decided to move my store over to Easy Digital Downloads.

I’ll certainly still be working with WP e-Commerce regularly (Actually, I’m looking forward to some changes with the store freeing up a bit more of my time to help out again!), not to mention WooCommerce, but I have to say I’m a little bit excited to spend a little bit more time with EDD.

Addendum: I’ve realised how infrequently I actually use WordPress for blogging, so I’m going to use this exercise to make me blog a little more. I’ll be covering the process, the extensions I’m using, and hopefully also any shareable code that comes out of the process – watch this space …

 Disclaimer: The easy digital downloads links in this post include an affiliate code.

Getting ready for my talk at WCLDN 2013

November 29, 2013
by Lee

WordCamp London 2013

Last weekend I was privileged enough to have a speaking splot at WordCamp London 2013. I’ll leave it to others who have already done a great job rounding up what was an excellent conference. The organisers and volunteers all did an outstanding job and deserve congratulations.

I’m dropping this post here to with a link to the online version of my slides if you want to re-cap, or didn’t manage to make it to the conference. I’ve heard rumour that some of the sessions were recorded – if they appear online I’ll be sure to update this post. In the meantime the slides from my talk “Shipping code for fun & profit” are online at https://leewillis77.github.io/26-things.

The source is also online if you want to fork it (Creative Commons BY-SA).


Photo credit: @ommunist


I'm attending

October 28, 2013
by Lee

WordCamp London 2013

Autumn seems to be conference season in the Willis household, and at the end of November I’ll be off to my 3rd conference in 3 months – this time for the inaugural WordCamp London.

The UK has a solid history of WordCamp events, with the “roving” WordCamp UK sessions hitting Manchester, Portsmouth, Edinburgh in recent year, and Lancaster earlier this years. WordCamp London though is a new event, taking place on the 23rd/24th November with the main session track on the 23rd, and a contributor day on the 24th.

I’m excited not only to be attending, but also speaking at the event – with a talk titled “Shipping code for fun & profit – 26 things I learned by shipping code”. You can see the full list of speakers on the WordCamp London site at http://2013.london.wordcamp.org/speakers/ – if you’re lucky enough to be there I’d love to talk to you.


October 3, 2013
by Lee


This weekend I’ll be attending PHPNW13 in Manchester. It’s my first non-CMS-focussed conference, so I’m really interested from a personal, and professional point of view to see the differences. It’s a conference I’ve heard great things about – so roll on Saturday!


September 18, 2013
by Lee

DrupalCon Prague

I’ll be spending much of next week in Prague for DrupalCon. With Drupal 8 well underway, and some significant architecture changes since Drupal 7 it’s sure to be a great event, with plenty to catch up on, knowledge to be shared and contacts to be made.

I’m there with colleagues from Hydrant, and we’d love to chat!

June 26, 2013
by Lee

Processing feed imports in bigger chunks

Just leaving this here for next time I need this. The change below allows you to change the number of items that Drupal’s feeds importer will process at once.

/* Set feeds importer to import in chunks of 500, rather than 50
 * Ref: http://drupalcode.org/project/feeds.git/blob/b39b547768abbda3b0d7b5425593c0e7c05800f2:/README.txt#l185
$conf['feeds_process_limit'] = 500;

May 11, 2013
by Lee
1 Comment

Adding SKU to email notifications in WP e-Commerce

Adding the SKU (Or other information) to order emails in WP e-Commerce has been an often-requested feature. Up until recently it meant editing plugin files to apply the changes, and remembering to re-apply them on every update.

Thanks to the great work that’s been going on in WP e-Commerce core – there are now a bunch of useful hooks and filters that allow the content to be changed by filters rather than by editing the plugin direct.

So – if you want to add the SKU to your order emails you can just install and enable the plugin below to add it for you.

Say What?

March 10, 2013
by Lee

How to change text in a WordPress plugin

One of the great things about using an out-of-the-box solution like WordPress is that you can get something up and running pretty quickly. That’s been one of WordPress’ strengths over the years. However, if you’re building sites for other people then sometimes parts of the generic-ness seep through and detract from the overall feel of the solution. Specifically – terminology that is great in a generic solution isn’t always helpful in a custom, or specific solution.

None of this is a criticism of WordPress, but as you start building larger, or more complex sites you’ll probably want to start smoothing off some of these rough edges, and make sure the language of the site (frontend or admin side) makes sense in the specific context of the site you’re working on.

That’s something I come across frequently in my day job as a Drupal developer. Fortunately Drupal has the excellent String Overrides module. This lets you specify the current string, and a replacement, and will change the text whenever that string is used, with the caveat that the original string has to be passed through Drupal’s translation function t().

When someone recently asked me how to change some text in one of my own WordPress plugins – my first suggestion was this exact same approach. After all, all of my Premium plugins use translatable strings, and suggesting to someone that they should create a translation file just to change one or two strings for their needs has always seemed a bit excessive. So – I had a hunt around the WordPress.org repo for something similar, but couldn’t really find anything that did the job.

Figuring it’d be something fairly simple to achieve I set out to knock up a plugin that did the job. So next time you need to quickly change a string in WordPress, or a plugin you’re using – don’t hack it in the plugin – or in WordPress core, leaving your client unable to upgrade, give “Say What?” a go:

The strings we want to change

The strings we want to change

The say what page - setting up our string replacements

The say what page – setting up our string replacements

The text - automatically replaced for us

The text – automatically replaced for us


Say what?
by Lee Willis

An easy-to-use plugin that allows you to alter strings on your site without editing WordPress core, or plugin code. Simply enter the current string, and what you want to replace it with and the plugin will automatically do the rest!

The plugin’s available for forking and contribution over on GitHub


  • Current version: 1.6
  • Rating: 96(22 ratings)
  • Downloaded 18,507 times

February 26, 2013
by Lee

Easily embed WordPress.org plugin details into your posts

I’m slowly working through tidying up information about my free plugins. Part of this meant that I wanted a way to easily include the latest information about my free plugins in the page as a summary. For plugins hosted on GitHub I’m using my GitHub oEmbed plugin, but I have quite a few plugins hosted solely over on WordPress.org.

So, I’ve also now published a plugin that will let you embed plugin summaries from WordPress.org into your posts and pages just by pasting in the URL.

Check it out here:

February 9, 2013
by Lee

Simple embedding for non oEmbed services

I recently posted about my GitHub embed plugin for WordPress. The plugin performs a neat trick of hooking into WordPress’ oEmbed infrastructure to allow you just to paste in a URL and retrieve an embed for a service that doesn’t natively support oEmbed.

This post is just a quick walk through explaining the approach. In general the plugin:

  • Registers an oEmbed handler for the selected URLs (http://github.com/{something} in our example)
  • Registers an internal oEmbed handler for that URL
  • Handles the oEmbed call itself, retrieving the details it needs via the 3rd party’s API and then passing WordPress back an oEmbed response

Effectively you make your own site an oEmbed provider for the service you want to embed. Here’s the key bits of code:

First – we register an oEmbed handler, and point it to an internal URL:

function register_oembed_handler() {
    $oembed_url = home_url ();
    $key = get_key();
    $oembed_url = add_query_arg ( array ( 'github_oembed' => $key ), $oembed_url);
    wp_oembed_add_provider ( '#https?://github.com/.*#i', $oembed_url, true );
add_action ( 'init', 'register_oembed_handler' );

Note: get_key() just generates a site-specific key to stop other people using your oEmbed service.

Next, we tell WordPress to look out for an inbound oEmbed request:

function handle_oembed() {

    if ( ! isset ( $_GET['github_oembed'] ) ) {
    // Check this request is valid
    if ( $_GET['github_oembed'] != $this->get_key() ) {
        header ( 'HTTP/1.0 403 Forbidden' );
	die ( 'Sad Octocat is sad.' );

    // Check we have the required information
    $url = isset ( $_REQUEST['url'] ) ? $_REQUEST['url'] : null;
    $format = isset ( $_REQUEST['format'] ) ? $_REQUEST['format'] : null;

    // Call the 3rd party service, and create an oEmbed response here

add_action ( 'init', 'handle_oembed' );

All we need to do now, is retrieve the details we need using whatever API tools are available, then create an oEmbed response, e.g.

    $response = new stdClass();
    $response->type = 'rich';
    $response->width = '10';
    $response->height = '10';
    $response->version = '1.0';
    $response->title = $repo->description;
    $response->html = 'Your info here';
    header ( 'Content-Type: application/json' );
    echo json_encode ( $response );

And that’s it in theory, simple as pie. If you want to see working example, checkout out the github embed plugin on github: