Made a theme? Great! Did you have it checked?
If you want to publish a theme on WordPress.org or ThemeForest, there are certain steps to take in order to have it checked. One of them is the Theme Check plugin, which is used by both the WordPress.org and ThemeForest review teams. In this tutorial, we're going to go over the basics of using Theme Check to test your plugin against theme review standards.
You can do anything with WordPress themes. Anything. You can list the latest posts, you can display video galleries, you can get payments for your services, you can change the CSS file by the time of the day, you can hack into your visitors' devices with a malicious JPEG file that runs code...
But aren't all of the things above "theme territory"? Nope, and that's the point. (Actually, only two of them should be done with themes. One of the things above isn't even legal—guess which one?) You shouldn't do anything with your theme. Themes should serve design elements and nothing else. No functionality. No malicious code.
It's called "staying out of plugin territory". It basically means that all functionality must be served as a separate plugin (or plugins). This is only one of the rules in WordPress theme making. There are many more in the Handbook, and you have to comply with all of them in order to get your theme on WordPress.org and ThemeForest.
Making a good theme doesn't mean making a good-looking theme—you also need to code it well. You must stay out of plugin territory, have a valid
You need to check some of these things manually. For everything else, you can use the Theme Check plugin. (Then manually check everything again, just in case.)
Let's talk about the theme review processes on WordPress.org and ThemeForest. First off, I want to remind you that ThemeForest completely embraces WordPress.org's theme review process, so I'll talk about WordPress.org first and ThemeForest second.
The usage of the Theme Check plugin is actually pretty straightforward.
You should see the screen below after these easy steps:
Before you check your theme, though, it's recommended to enable
WP_DEBUG in the
wp-config.php file. Here's how you do it.
God, I love titles with some word play.
As I'm writing this tutorial, there were 95 items in the checklist in the "Theme Check Plugin" page in the Handbook. There are pretty vague items, but the section headings are a bit clearer:
base64decoding/encoding, using the
eval()function and stuff that plays with PHP settings.
comment_form(). (Personal rant: Why does every single theme support WordPress comments? I think I haven't used comments at all for any of my clients' corporate websites.)
.svn), essential files, PHP short tags and pagination code.
add_theme_support( 'title-tag' ).
iframeusage, possible hard-coded links and non-printable characters (like Turkish special characters, which is weird, I think).
Side-note: The Holy Handbook of Theme Review has lots of empty or unfinished pages, which means there's much room for improvement. If you're reading this tutorial in the future, sorry for all the ambiguous statements.
As I said earlier, you must use the freedom WordPress provides responsibly. If you're making a theme, you must be thoughtful about your potential users. The Theme Check plugin is a great tool to lead you through the process of "taming" your theme's code.
What do you think about this tool, and making themes? Share your thoughts with us by commenting below. And if you liked the article, don't forget to share it with your friends!
See you in the next part where we'll talk about the GenerateWP website.