Auto Update Self Hosted WordPress Themes

Having visited WordCamp UK over the weekend of the 14th and 15th of July in Edinburgh one of the talks spurred me on into thinking about my development environment and how I could improve it. The talk in question was “Totally Custom Theme Development” and was a panel discussion on how we develop themes etc. for clients.

Steve Taylor, Jonny Allbut and Rachel McCollin chaired the panel although there was a lot of audience contribution to the discussions. Essentially it came down to how we add common functionality to our themes. Most of use tend to use a theme to start with that is the same, and will contain a bunch of code that enables certain things in your site. Therefore the debate was had around either putting all this into a plugin or using a parent theme.

Previous to the debate I have used a start theme which I had developed over time. I then changed and altered this theme according to the site that I was building at the time. Jonny pointed out that this is often not the best way of doing things because if you wanted to update some of the functionality that you have in the starter theme it would mean updating all the sites that we built using that manually. Jonny’s workflow was to use a parent theme, in his case the Wonderflux theme framework and then build child themes off of that. That way if you starter functionality changes (in this case the parent theme) you need only to update each parent theme of all your sites. This works although still requires manual uploading of the parent theme on every site. The reason for this is that because the parent or starter theme is not in the WordPress theme repository then the auto update feature is not available.

This got me thinking about whether or not you could make themes (and plugins for that matter) auto update and get the updated version from another location rather than the WordPress theme repository. Then I thought about premium plugins such as Gravity Forms. These plugins are not in the WordPress plugin repository because you have to pay for them, however they still allow auto updates.

At this point I started searching the web for the solution to this problem and how to get themes auto updating from a set location. This is when I came across this Github project from Jeremy Clark. Jeremy has developed a handy chunk of code to do precisely this.

The instructions are very clear and having implemented this I can now host my own theme updates. When I make an update available on my server all of the sites that are using that theme as a parent theme will see the update in the WordPress dashboard and therefore they can auto update to take advantage of the new functionality or bug fixes. As long as the sites are running child themes then they should work just fine.

I am going to give this a go in my next project and see if it works as a development work flow. I have never been a fan of parent and child themes as my child theme always end up with lots of files that will not get updated when the parent theme is updated and therefore ruining the very idea of parent and child themes. Time will tell I suppose and I will blog again with my thoughts on the outcome.

Reinstalling Mac OX 10.7 Lion

My 27″ iMac upon which I work on for all my development work is an amazing computer. I purchased my in spring 2011 and it was just over a year old. Most computers, particularly PCs based on the Windows operating system, need a rebuild from now and again to remove any ‘rubbish’ and clutter that every day use can add to the system. Therefore here is how I set about reinstalling the operative system and starting again.

Step 1 – Back Up

This sounds obvious but the first stage to rebuilding your machine is to backup all of your content and data that you want to keep. I am not really talking here about applications as you will want to install these from fresh, either through the Mac App store or the original downloads or install CD/DVDs provided. What I am talking about is the documents, presentation, images, video and all the other stuff that you will of course want to keep.

Although I use Time Machine to backup my Mac, which is an excellent fail safe, Time Machine backs up the whole system, including that ‘rubbish’ that builds up over time. Therefore it would be pointless to rebuild it using this backup. Therefore the night before I scoured my hard drive on the iMac for all the stuff that I wanted to keep and then copied this to an external hard drive.

Step 2 – Boot Your iMac in Lion Recovery Mode

In order to be able to delete all the files on the hard disc of your Mac you will need to restart your Mac. On restart (when you here the restart noise) hold down Command + R on the keyboard. A window will then pop-up with some options.

As we want to start from fresh I choose to use Disk Utility in order to delete the main hard drive in the Mac. Then I went through the steps of reinstalling Mac OS X, which is another options in the pop-up window.

This takes a while but puts a clean copy of OS X Lion onto your computer. Your computer will then restart and it will act as if it was the first time you turned on the computer.

Step 3 – Setup OS X

OS X now boots and it will take you through the setup process in the same way as when you first purchased the computer. You will have to connect it to your Apple ID, enter a username and password etc. and choose some Keyboard and time settings to use for the system.

Step 4 – Copy Over Your Documents and Applications

Now you can use the external hard drive you copied your files onto in order to copy them back to your Mac with its brand new installation of OS X. The approach I take here with applications is to only install an App, when you actually need it. This will speed up your system and you will be surprised at home many of them you never actually re-install.

So there you have it  a quick guide on reinstalling Mac OS X Lion to give yourself and clean factory settings install to freshen and speed up your Mac.