When creating a new WordPress theme, a series of tests should be passed. Aside from the programming related ones, such as no PHP warnings, no deprecated functions, no obsolete code, no code hackery to accomplish simple tasks, there are also the common sense tests. These are the theme name, the theme design, hardcoded footer links, number of footer links, source code comments and overall theme presentation.
Every theme developer should start by checking these lists, available within the Codex:
You can find plugin suggestions for debugging, checking and validating your theme.
More resources, code samples, questions and answers can be found here:
More common sense behaviour should include a small functions.php file, no hardcoded/required plugins, no bundled plugins and optimized source code.
For theme development, I use Debogger plugin, Log Deprecated Notices plugin and Theme-Check plugin. Also, WP-DEBUG constant should be switched on in wp-config.php. By using all these plugins and the W3C validator, I make sure they are correct, valid and yield no error in no specific scenario.
My themes are here, and they are in the process of being updated (as of December 2010):
The update process consists in running all the debugging and checking plugins, validating the theme, implementing WordPress 3.x features and adding new, tested features such as pagination and custom helper functions.
Another development practice I use, but not preach, is embedding of frequently used plugins into themes. While this may conflict with I wrote earlier, let me give you an example:
I built 10 themes for 10 different clients. They all required a backup solution. There are many backup plugins out there, more or less updated, more or less bloated, more or less useful. So, I had to customize one of my favourite backup plugins, add features, remove options and embed it into the theme. It can be used on-demand, it doesn’t add any overhead to theme loading and it’s light. I can also maintain it along with the theme. I shouldn’t worry about updates, wait for the author to change anything, or change it myself and then update it and lose all the changes.
My approach should be used only when working extensively with WordPress and only with utility plugins such as backup, pagination, cleaning, TODO plugins and general theme options.
What are your common practices when designing a WordPress theme?
Once a week or so we send an email with our best content. We never bug you, we just send you our latest piece of content.
If you found any value in this post, agree, disagree, or have anything to add - please do. I use comments as my #1 signal for what to write about. Read our comment policy before commenting! Comments such as "Thank you!", "Awesome!", "You're the man!" are either marked as spam or stripped from URL.