Featured

Setting up my WordPress development environment

This is the post excerpt.

Plenty of posts have been written about setting up a local development environment for WordPress, but when I moved to a new Macbook (running OS X Yosemite) I couldn’t find a post that contained all the instructions I needed. After some searching I got everything up and running and thought it would be worthwhile to share my process and tools here for posterity.

I use my local development environment for:

  • WordPress plugin development
  • Working on WooThemes products (plugins & themes)
  • WordPress core contributions
  • Working on client sites

For this I use the following tools:

  • Vagrant for the general development environment
  • SVN for checking out WordPress trunk and managing my plugins on the WordPress.org repo
  • Git for managing my public plugin repositories as well as all of the WooThemes product repositories
  • Sublime Text for editing code

Vagrant

logo_vagrant-81478652The initial setup of the Vagrant environment was easy usingVarying Vagrant Vagrants. They have a complete step-by-step on their GitHub repo, so you shouldn’t struggle getting that up and running. It did take quite a while to set up, but that’s only because it has to download a lot of software in order to work – it’s relatively uncomplicated to get it working though.

VVV comes with some handy features for WordPress development, most notably it includes the WordPress trunk repository checked out from SVN. This enables you to get the latest development version and create patches to submit to Core Trac easily.

One thing that VVV doesn’t include by default is the ability to easily generate new WordPress sites on the fly. If you’re developing sites for clients, or if you often require new sites for testing, then this is pretty much essential. Luckily, there’s a VVV add-on script that handles this for you very easily:Variable VVV by Brad Parbs. The wizard is a single script that is super easy to use and will generate new sites for you with no additional work on your part – simply follow the simple guide in the GitHub repo and you’ll have no problems.

Additionally, Leo Gopal has created a new VVV dashboard that lets you manage your WordPress installs with greater ease – it provides a friendly UI and easy to use tools. You can grab it from GitHub.

SVN

There’s no need to install SVN before setting up VVV, but in order to use the WordPress trunk SVN repo you need to upgrade the default SVN version. If you’re not sure how to do that, then this guide will run you through the (very quick) process.

vsIf you aren’t comfortable using SVN in the command line then I recommend using Versions to manage your SVN repos through a robust GUI.

Git

LSprVcwqYou don’t need to install anything extra to manage your Git repos, but if you would rather not use the command line to manage things then SourceTree is your best bet for a functional GUI for managing both GitHub and Bitbucket repos.

Sublime Text

Sublime_Text_LogoThe code editor you use is entirely based on your own preferences, but I like to use Sublime Text 3 for development. The main reason for this is the plethora of add-ons that are available for it – some of which are hugely helpful for WordPress development.

Before you can install add-ons for Sublime Text, you need to enable Package Control. Once you’ve done that you can install any of the available add-ons. These are the ones that I use:

The colour scheme I use these days is the Material Colour Scheme – based on Google’s Material Design UI. It provides a dark background with bright colours – kind of like the popular Monokai, but brighter.

That’s my setup – what do you use?