You know what makes me cringe?
When I see an awesome pre-made theme for sale and then I see the upgrade instructions for that theme. They look something like this:
Updating your theme is super easy! Just download the latest version from your client area, then delete your current theme (you can switch to Twenty Twelve in the meantime), and re-upload the new version.
or:
Updating your theme is super easy! Just download the latest version from your client area, then drag them into wp-content/themes/theme-name via FTP.
Updating themes manually is easy… for a techy person.
And that’s the rub.
I have no problem updating stuff that way. I know what FTP is, I know how to use it, and updating stuff that way is fine… because I’m a web developer. I’m a techy person.
So many of my customers don’t even know what FTP is!
I suspect the lack of automatic updates is why so many customers never update their themes at all.
As someone who sells plugins and themes, I occasionally need to ask my customers for FTP details so I can do some debugging or whatever. Majority of them don’t even know what FTP is. They don’t know their login details (or how to find them), let alone how to connect!
And as a customer, I’d never want to have to uninstall my theme completely in order to update it. If the alternative to FTP is deleting your theme, switching to another temporarily, and then re-installing the theme entirely… hell-to-the-no!
Automatic updates are a must-have, particularly for your less-tech-savvy customers.
- They’re convenient.
- They’re a WordPress standard.
- They keep things simple and in the admin interface.
- They’re not that hard to implement.
Easy Digital Downloads makes automatic updates super easy to implement with their Software Licensing add-on (that’s my affiliate link). It’s a must have for any plugin or theme shop owner. It’s what I’ve been using to seamlessly deliver automatic updates for years.
- Upon purchasing the product, the customer is automatically given a license key.
- You (the seller) can choose how long this key is valid for. For example, one year, six months, or even forever.
- The customer adds their license key in WordPress (more on this later) to activate it.
- You (the seller) can add an update to the product any time by adding a new file to the product page and incrementing the version number (like from 1.0 to 1.1).
- Then, the customer gets updates to the theme automatically inside WordPress.
All that’s required to get this working is a few files added to the theme and a few simple lines of code. The EDD team already has a great tutorial on how to implement it. Plus the add-on itself comes with a sample theme and sample plugin so you can mostly just copy and paste.
How to implement automatic updates using the EDD Software Licensing add-on.
In short, you copy the updater folder in the sample theme to your own theme.
Then open up the functions.php file in the sample theme. You’ll see this code:
/** * Load theme updater functions. * Action is used so that child themes can easily disable. */ function prefix_theme_updater() { require( get_template_directory() . '/updater/theme-updater.php' ); } add_action( 'after_setup_theme', 'prefix_theme_updater' );
This code is basically including the contents of the updater folder you added. Change the prefix to be your own theme. This needs to be edited in two places.
So I might use:
function tweakme2_theme_updater() { require( get_template_directory() . '/updater/theme-updater.php' ); } add_action( 'after_setup_theme', 'tweakme2_theme_updater' );
Finally, go inside the updater folder and edit theme-updater.php. You need to edit the items on this page to match your configuration.
You’ll see code like this:
// Includes the files needed for the theme updater if ( !class_exists( 'EDD_Theme_Updater_Admin' ) ) { include( dirname( __FILE__ ) . '/theme-updater-admin.php' ); } // Loads the updater classes $updater = new EDD_Theme_Updater_Admin( // Config settings $config = array( 'remote_api_url' => 'https://easydigitaldownloads.com', // Site where EDD is hosted 'item_name' => 'Theme Name', // Name of theme 'theme_slug' => 'theme-slug', // Theme slug 'version' => '1.0.0', // The current version of this theme 'author' => 'Easy Digital Downloads', // The author of this theme 'download_id' => '', // Optional, used for generating a license renewal link 'renew_url' => '' // Optional, allows for a custom license renewal link ), // Strings $strings = array( 'theme-license' => __( 'Theme License', 'edd-theme-updater' ), 'enter-key' => __( 'Enter your theme license key.', 'edd-theme-updater' ), 'license-key' => __( 'License Key', 'edd-theme-updater' ), 'license-action' => __( 'License Action', 'edd-theme-updater' ), 'deactivate-license' => __( 'Deactivate License', 'edd-theme-updater' ), 'activate-license' => __( 'Activate License', 'edd-theme-updater' ), 'status-unknown' => __( 'License status is unknown.', 'edd-theme-updater' ), 'renew' => __( 'Renew?', 'edd-theme-updater' ), 'unlimited' => __( 'unlimited', 'edd-theme-updater' ), 'license-key-is-active' => __( 'License key is active.', 'edd-theme-updater' ), 'expires%s' => __( 'Expires %s.', 'edd-theme-updater' ), '%1$s/%2$-sites' => __( 'You have %1$s / %2$s sites activated.', 'edd-theme-updater' ), 'license-key-expired-%s' => __( 'License key expired %s.', 'edd-theme-updater' ), 'license-key-expired' => __( 'License key has expired.', 'edd-theme-updater' ), 'license-keys-do-not-match' => __( 'License keys do not match.', 'edd-theme-updater' ), 'license-is-inactive' => __( 'License is inactive.', 'edd-theme-updater' ), 'license-key-is-disabled' => __( 'License key is disabled.', 'edd-theme-updater' ), 'site-is-inactive' => __( 'Site is inactive.', 'edd-theme-updater' ), 'license-status-unknown' => __( 'License status is unknown.', 'edd-theme-updater' ), 'update-notice' => __( "Updating this theme will lose any customizations you have made. 'Cancel' to stop, 'OK' to update.", 'edd-theme-updater' ), 'update-available' => __('<strong>%1$s %2$s</strong> is available. <a href="%3$s" class="thickbox" title="%4s">Check out what\'s new</a> or <a href="%5$s"%6$s>update now</a>.', 'edd-theme-updater' ) ) );
The Config settings section needs to be updated to use your settings. Each setting is commented to explain what it does, so you just need to edit the values accordingly.
The Strings section just needs to be updated to use your theme slug in the translations.
By default, one of the lines is like this:
'theme-license' => __( 'Theme License', 'edd-theme-updater' ),
You just need to swap out edd-theme-updater with your theme’s slug. So I might change that to tweakme2.
You can basically do a CTRL+F on this file to swap out 'edd-theme-updater'
with your theme slug, like 'tweakme2'
.
Yes to all of this Ashley!!! I haven’t started to sell themes, but thank you for this info because it’s true. For any client or person who doesn’t really know tech, I know they rather things to happen automatically. Bookmarking. This certainly goes great with your theme course too!
This is awesome, one more reason to switch from WooCommerce to EDD next year. I was looking for auto-update instructions and everything that I found was too complicated, this seems super easy to implement and reliable.
Thanks for sharing this!
Ugg, I wish my current theme had this! LOL. Almost all the themes Ive used over the years have had an auto update. Whats the kicker is all hosts don’t have FTP access and you have to use 3rd party. I had to sign up for a 3rd party just to update my theme… Im not happy with my latest theme really…
After the holidays I want to sign up for your development course. WordPress is going to be my bitch, well, it already is just making it a bigger one!! ha ha.
First time visit today and Ive been stalking you for over an hour! Love it here. 😀
Thank you for the code and will install the plugin. Also glad to see beautiful girls coding 🙂 Well done Ashley.