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.
Freedom of Coding in WordPress and Using It Responsibly
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.)
Nine Things to Say About the Theme Review Processes on WordPress.org and ThemeForest
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 Handbook: The Theme Review Handbook is the holy book of WordPress.org's review theme. So, it should be your holy book as well.
- Required: The first part of the review process on WordPress.org is the part where the "required" checks are made. If you don't pass this part, you will fail and your theme will not be in the theme repository.
- Recommended: The second part is the part of "recommended" checks. (See the subsections.) In this part, some non-required aspects of your theme (like CSS preprocessors, core functionality and privacy) will be checked. The Holy Handbook promises that "no theme will be resolve as not approved because they do not meet a recommended item". Amen.
- Accessibility: This third part of the review process, "accessibility", is only required for those who tag their themes as "accessibility-ready" and not required for the rest. It has its own "required" and "recommended" subsections, so be sure to check them out if you're working on an "accessibility-ready" theme.
- The Theme Check Plugin: The plugin we'll be talking about is going to be used by your theme reviewer as well. But that doesn't mean that you don't have to use it—in fact, using it will save both you and your reviewer a huge amount of time.
- Queues: Reviewers have their own workflows, but they will be working with two different queues called "New" (for newly submitted themes) and "updates" (for theme updates).
- Tickets: Your theme reviewer will contact you through tickets. He/she will inform you about required things, recommended checks and various notes about your theme.
- Same Goes for ThemeForest...: All the things said for WordPress.org's theme review process apply to the review process of ThemeForest. Except, of course, that the theme review teams and their workflows will be different.
- ... and even more, with ThemeForest-Check: There's an old plugin called ThemeForest-Check, which is an addon of the Theme Check plugin. It has additional checks and different methods. Use it to shorten your review process on ThemeForest.
Using Theme Check to Pre-Review Your Theme
The usage of the Theme Check plugin is actually pretty straightforward.
- Search for "Theme Check" in the Plugins > Add New screen. (You may not even need to search for it, as it resides in the "Featured Plugins" section.
- Click the Install Now button.
- Activate the plugin when it's installed.
- Head over to the Appearance > Theme Check screen.
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.
Things Theme Check Checks
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:
- Admin menu checks.
- Checks for "bad things" like
base64decoding/encoding, using the
eval()function and stuff that plays with PHP settings.
- String checks like
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.)
- CDN checks.
- PHP constants check like
- General checks.
- Customization checks like the Customizer does.
- Deprecation checks, which means checking deprecated code in your theme.
- Line endings checks.
- Additional checks like redundant files (like
.svn), essential files, PHP short tags and pagination code.
- Text domain checks.
- Stylesheet checks like theme name, version and support for default WordPress CSS.
- Screenshot checks (existence and size checks).
- Plugin territory checks (the most important checks, I think).
- Checks for widgets support.
- Recommended checks like support for featured images, editor stylesheet and the new
add_theme_support( 'title-tag' ).
- Checks for malicious code.
- And informational checks (that aren't required, nor recommended) like
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.
Wrapping Up for Today
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.