In the past I’ve covered some technicalities on how to get yourself up and running for WordPress on Mac OS X based systems. This time around it’s time for some tips and tricks on how I do things with WordPress. I’m sure you’ll find some of these tips helpful as well.
Lets keep it easy and maintainable
WordPress works rather well for creating awesome websites. Even our own site is built on top of WordPress with some customization here and there. What should you keep in mind when you’re just starting your WordPress development career? I’m actually not going too much into the technical stuff (you need to become friends with WordPress code anyway) but instead I’ll share some tips and tricks that have worked well for me in the past.
Clean start for a new project
I’ve created a clean database dump that I can use to easily setup new project from scratch. It doesn’t have any posts, categories etc – just a blank skeleton that I can easily import.
If you do lot of themes then you probably want to create a skeleton theme that you base your other themes on. That’s what I did and it saves me bunch of time when starting with new projects.
Version Control System (VCS) to use with WordPress
Just one word – Git. If you’ve ever tried to use Subversion with WordPress then you’ll know that updating any plugins will mess up your live installation. Subversion keeps .svn folders in every folder that has been checked into VCS. When you update the plugin then the old version’ folder will be deleted, zip file downloaded and the folder re-created. This time, without the .svn folder and we’ll have a problem.
WordPress Core, themes and plugins
All of the core files are kept in Git repository. When an update comes out I’ll just download it to my local development machine and make sure that it’s working fine with my plugins etc. From there on I’ll just push it to the repository and deploy to live system. Same pretty much applies to themes.
When upgrading plugins, quite often a database update is needed as well. That’s one of the main reasons why I don’t keep the plugins in Git repository but instead upgrade them in our live system. Of course, first I’ll make sure that they work on my development system.
Importing older versions made easy
We’ve created a rake script that converts data from one messy WordPress database to a new and clean one. It pretty much takes over the content part of the database – posts, tags, categories etc. Helped me a lot to create this site in rather short time.
W3 Total Cache for performance
W3 Total Cache is your best friend for performance. All of our assets are hosted on Amazon AWS and served to you quickly. On top of that, you’ll get a good Google Page Speed score.
Disable WordPress AutoSave and Post Revisions
I find both of them to be highly annoying and usually turn them off as the first thing I do. There’s few lines that should be added before the end of
wp-config.php. Just before where it says “That’s all, stop editing! Happy blogging.” (and they mean that).
/** Disable post revisions **/
That’s all folks
As you see, getting started with developing websites that are based on WordPress isn’t really rocket science. It’s always helpful if you’re already familiar with PHP and MySQL – makes your life with WordPress a lot easier.
If you have any comments or questions then just post them below here and I’ll update the post to answer these (or reply to your comment).