Wordpress Development Workflow Tips

January 2, 2014

Wordpress logoWordPress is becoming increasingly popular amongst web developers. If you're new to developing with WordPress, here are some quick tips that could save you a little bit of time.

Get Version Controlled

If you're not comfortable with git yet, I highly recommend you get up and running with it. There are tons of great tutorials out there. The one I used can be found here. It's a 70 min video but is very good at explaining how git works.

What files should I version control? Here is a gist I yanked from github that is everything you need to know about version controlling WordPress.

[code] *.log .htaccess sitemap.xml sitemap.xml.gz wp-config.php wp-content/advanced-cache.php wp-content/backup-db/ wp-content/backups/ wp-content/blogs.dir/ wp-content/cache/ wp-content/upgrade/ wp-content/uploads/ wp-content/wp-cache-config.php [/code]

Source: https://github.com/github/gitignore/blob/master/WordPress.gitignore

If you find a different/better WordPress .gitignore, let me know in the comments.

This gist has saved me a lot of time of fiddling with different .gitignore configurations.

Work Locally

XAMPP or MAMP both work great. Or if you want to use OS X's built in apache, that's fine too. Whatever allows you to run apache, MySQL, and PHP will work.

I use MAMP when I'm at work on a Mac and XAMPP when I'm home on a PC. They both achieve the same goal. I can work locally on my Wordpress site. I can tinker with PHP and test without worrying about bringing down my production server or bogging it down.

Local configuration vs. production configuration Now, chances are, the settings within your wp-config.php file will be different on your local server than your production server. There are multiple ways to handle this.

The way I use was posted by Mark Jaquith on his blog. It's a clever way of dealing with the local vs production dilemma that all WordPress devs have encountered at least once.

Another quite good reference point on the matter is this article, which takes into account version control as well.

Use Node.js & Grunt

If you want to completely supercharge your WordPress workflow, look into using Node.js and Grunt to run repetitive tasks. I might write my own article on this eventually, but until then I would highly recommend looking at an article by Matt Banks about WordPress development and deployment with Grunt.