How to Check Your WordPress Theme Against Latest Standards wordpress.org

Submitting themes to the WordPress.Org repository is sometimes complicated because of the requirements. Before submitting, if you take care of some important things regarding licensing, validation and sanitization, escaping, translation, etc, your theme will likely be accepted.

There are more than 7000 free WordPress themes available in the WordPress repository and it is increasing day by day. There is no actual data of daily theme submission, however, 23 new themes were made live in a week (On the week when I wrote this post). Among them, the most popular themes are more than 400K active installs. Besides WordPress Twenty____ Themes(They are bundled with WordPress and have millions of active installs),  ShopStore, OceanWP and Astra are the leading popular themes.

If you are planning to submit themes in WordPress.Org, you need to know the review process and the requirements. Your theme will go through a strict review process, thus you need to make the theme based on the guidelines.

How does the theme review process work?

In the beginning, you need to login in WordPress.Org and you need to upload the theme ZIP file. While submitting the theme, a new ticket will be created and it will be listed on the review queue. When your theme is at the top of the review queue, volunteer reviewers will take it for review. Reviewers will review your theme based on the required handbook and will post the issues on the ticket.

Note: Reviewers are allowed to close your ticket if there are more than 3 distinct issues. ( Issues Example: Licensing, Escaping, Translation).

From the day the reviewers submit the issues, you need to communicate in the ticket within 7 days, otherwise, your theme will be closed for inactivity and you need to submit the theme again and it will go back to the queue.

There is no hard reject, you can always resubmit the updated themes. The only thing is, you need to follow the same queue and wait again.
Based on my experience of reviewing themes for 5 years, I am going to share some common mistakes that theme developers do while submitting the theme. I have strong hope that the chances of approved themes will be high if you follow this post completely.

Who Reviews the themes?

All the reviewers in the WordPress theme review team are volunteers. Even team leads like us are volunteers and give our spare time for the community. No one is getting paid or a monthly salary.

So, firstly I would like to request all the authors to respect the reviewers for the contribution. The theme review team has leads, moderators and reviewers who are responsible for the overall management of the theme repository.

If you are interested in joining the theme team, you are always welcome, you can join this team to start reviewing themes. Reviewing themes is a good idea to learning the requirements, building a relationship with other developers and get the chance to work with developers all around the globe. It is also the best platform to show your talent and get exposure.

Setting up the theme development environment
While developing the theme for the WordPress repository, you can do the basic things which are listed below.

  • Debug True – define(‘WP_DEBUG’, true); in wp-config.php
  • Import theme unit test data XML file
  • Install and activate Developers, Theme Check, and Theme Sniffer plugins

Theme Check and Theme Sniffer plugins are developed to check your theme as per the guidelines of WordPress themes repository. Those plugins are really helpful to find the issues.

Name Collision

The theme name should be unique. Otherwise, your theme will not be uploaded to the WordPress repository. The system will block your theme upload. So, it is recommended to check occupied themes name on themes SVN and google the name.

Themes repository system checks the active installs of the theme and if that particular theme has more than 50 active installs, you will not able to use that name. However, if that particular theme is legally yours and already available on Github or other shops and marketplaces, you will be able to upload it, but with some help. You can ask on #themereview channel of WordPress Slack chat and someone will guide you.

Licensing Issues

All the resources including libraries, images, scripts, CSS and fonts must be 100% GPL compatible. And moreover, your theme should be 100% GPL after the release. Besides that, you need to mention the license of all the resources used in the theme in readme.txt file.

In addition to that, if you are selling the premium product of that theme, your premium theme should be 100% GPL compatible and license should be declared on your themes sites. You are not allowed to host free themes in the WordPress repository if your premium themes are not GPL compatible.

Most of the authors provide the license of images used on the theme screenshot and bundled in the theme from Unsplash, Pixabay, and some other non-GPL sites. Currently, pxhere, stocksnap are recommended websites for images.

Translation Issues

You need to know that your theme should be translation ready. All the default text used on the theme must be 100% translation ready. WordPress has the system and functionality to handle the default strings and make the translation ready. If you use those functions in the right way, your themes will be 100% translation ready.
While reviewing themes, I can see this issue on most of the themes. So, I recommend you to check this thing carefully. It is very simple and easy to implement.
Untranslated default strings look like,

<p>Related Posts</p>

This text is not translation ready.
The solution is,

 echo __( 'Related Posts', 'text-domain' );

Some more examples,

// __ functions are the basis of localization.
 echo __( 'Related Posts', 'text-domain' );
// echo doesn't required in this case. _e does both translation ready and print the value.
<?php _e( 'Related Posts', 'text-domain' ); ?>
// Whenever you want to escape the html and make it translation ready and echo it.
<?php esc_html_e( 'Related Posts', 'text-domain'); ?>
// localization and variables.
<?php _n( 'One post', '%s posts', $count, 'text-domain' ); ?>

You can check the Twenty____ Themes codes to know more about it. Theme check and Theme sniffer plugin will help you to find the untranslated strings.

Escaping Issues

Escaping falls under security issues. Hence, your theme should use valid escaping functions. All untrusted data should be validated before entering into the database and all untrusted data should be escaped before output.
Example of unescaped variables,

$my_title = get_theme_mod( 'my-title' );
echo $my_title;

From the above example, you can see that the variables will have text as output. Hence, you need the perfect escaping function. Here is the solution,

$my_title = get_theme_mod( 'my-title' );
echo esc_html($my_title);

For escaping URL, you need to use esc_url function. Example,

<a href="&lt;?php echo esc_url( get_permalink() ); ?>"></a>

Enqueue Style and Sripts

It is not allowed to hardcode style and scripts. You need to enqueue them via the functions file. WordPress has functions wp_enqueue_style() for CSS and wp_enqueue_script() for scripts to enqueue. Examples,

/**
* Enqueue scripts and styles.
*/
function theme_slug_scripts()
{
wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/assets/framework/Font-Awesome/css/font-awesome.min.css' );
wp_enqueue_script('bxslider', get_template_directory_uri() . '/assets/framework/slick/slick.min.js', array( 'jquery' ),'20151217', true );
wp_enqueue_script('theme-slug-navigation', get_template_directory_uri() . '/js/navigation.js', array(),'20151215', true);
}
add_action( 'wp_enqueue_scripts', 'theme_slug_scripts' );

By default, WordPress includes popular JS itself, you are not allowed to include them in the theme. Example, you are not allowed to enqueue your own version of jquery.js.

wp_enqueue_script('jquery', get_template_directory_uri()  . '/assets/framework/jquery.js', array( 'jquery' ),'20151217', true );
//Not allowed to enqueue.

Prefixing Issues

It is mandatory to prefix functions name, global variables, class name, image size name, hooks, and filters with theme slug. See the below examples,

// functions name prefix with theme slug

function theme_slug_scripts()
// class name prefix with theme slug
class Theme_Slug_Customize_Category_Dropdown_Control
// global variable prefix with theme slug
global $theme_slug_theme_options;
// Image size name prefix with theme slug
add_image_size( 'theme-slug-carousel-img', 700, 450, true );
// Hooks and Filters
add_image_size( 'theme-slug-carousel-img', 700, 450, true );
do_action( 'theme_slug_related_posts' );

In additon to that, you need to prefix the handle of style and scripts while enqueing. You need to prefix only for your own style and scripts, not for library.

// enqueue examples.
wp_enqueue_script( 'theme_slug_script', get_template_directory_uri() . '/js/custom-script.js' );
wp_enqueue_style( 'theme_slug_style', get_template_directory_uri() . '/css/styles.css' );
//not required for library
wp_enqueue_style( 'slick', get_template_directory_uri() . '/css/slick.css' ); 

Readme file Issues

Firstly, you need to validate the readme file with readme validator. In the readme file, you need to mention the license of every resources used on the theme. Moreover, you can maintain changelog, important descriptions, setup instructions etc.

Screenshot Issues

The screenshot size should be 4:3 in ratio. It is recommended to use 1200*900 px screenshot size. All the images used on the screenshot license should be mentioned in the readme file. Moreover, you are not allowed to write the promotional text on the screenshot. Lorem text is allowed.

Allowed: Let’s Party Together
Not Allowed: Perfect Theme for Party

Plugin Recommendation

Themes can recommend plugins and the plugins must be in the WordPress repository. Plugins that are not in the WordPress repository are still allowed to be recommended but it must pass the plugins guidelines. Moreover, you can use TGM or similar other libraries. You can only recommend plugins, not require. The theme should work perfectly without plugins.

Conclusion

Besides the above-listed things, there are some more things you need to check while developing themes. However, the above-listed things are more common. Escaping, validation and licensing are the major issues on the theme while reviewing. So, I recommend you to check those issues meticulously before submitting themes on WordPress.
If you want to submit themes in the WordPress repository, I recommend you to do the below three task,

  • Check previously live themes code
  • Start reviewing other themes
  • Read the handbook and follow the guidelines

The theme review team is the team of volunteers, so join the theme review team today.

aThemeArt

Art of Awesome Professional WordPress themes & Site templates. Our responsive themes are designed to work seamlessly for all desktop and mobile devices. Modern, Clean & Easy To Use.

Leave a Reply

Your email address will not be published. Required fields are marked *

18 + eight =

This site uses Akismet to reduce spam. Learn how your comment data is processed.

NEW FREE THEME! BCF IS HERE GET FREE THEME