Theme Check Plugin

Information on this page may be out of date.

The following are all the checks that the Theme Check plugin performs.

Themes have to pass the Theme Check plugin without errors before they can be included in the theme directory.

You can get the plugin from the plugin directory or you can get the developer version on Github.

Admin menu

  • Check for levels deprecated in 2.0 in creating menus.
  • Check for add_admin_page

Check for bad things

  • Themes should not change server PHP settings
  • base64_decode() is not allowed
  • base64_encode() is not allowed
  • uudecode() is not allowed
  • str_rot13() is not allowed
  • Google search code detected
  • Google advertising code detected
  • eval() is not allowed.
  • PHP system calls are often disabled by server admins and should not be in themes

String checks

  • DOCTYPE
  • wp_footer
  • wp_head
  • language_attributes
  • charset
  • add_theme_support
  • comments_template
  • wp_list_comments
  • comment_form
  • body_class
  • wp_link_pages
  • post_class
  • comment-reply
  • body_class
  • register_sidebar() or register_sidebars()

CDN

  • bootstrap-maxcdn
  • bootstrap-netdna
  • bootswatch-maxcdn
  • bootswatch-netdna
  • font-awesome-maxcdn
  • font-awesome-netdna
  • html5shiv-google
  • html5shiv-maxcdn
  • jquery
  • respond-js

Constants

General

  • $content_width

Customization

  • add_setting sanitization callback
  • Sanization callbacks

Deprecation checks

  • All the following deprecated:
    • checks: https://github.com/Otto42/theme-check/blob/master/checks/deprecated.php#L11
    • https://github.com/Otto42/theme-check/blob/master/checks/more_deprecated.php#L16

Line endings

  • DOS or UNIX style line endings

Additional checks

  • .git
  • .svn
  • File checks: https://github.com/WordPress/theme-check/blob/master/checks/filenames.php#L26
  • readme.txt
  • Supports standard avatar functions
  • Il8N errors
  • PHP filesystem calls
  • PHP short tags
  • Pagination code
  • home_url() correct use
  • site_url() correct use
  • get_search_form rather than searchform.php
  • Tags
  • wp_title
  • hardcoded text in title tag
  • Use *_url() template tags, rather than bloginfo() equivalents.
  • No disabling of the admin toolbar.

Text domain

  • If one exists
  • Matches theme slug

Styles

  • Theme name
  • Description
  • Author (recommended)
  • Version
  • License
  • License URI
  • .sticky
  • .bypostauthor
  • .alignleft
  • .alignright
  • .aligncenter
  • .wp-caption
  • .wp-caption-text
  • .gallery-caption

Screenshot

  • Correct size and dimensions (1200×900 preferred)
  • That a screenshot exists

Plugin Territory

  • register_post_type
  • register_taxonomy
  • shortcodes (warning only)

Widgets

  • register_sidebar() anddynamic_sidebar
  • Sidebars registered through widgets_init
  • add_editor_style
  • the_post_thumbnail()
  • sidebar/widget area

Security

Info

  • iframes
  • include or require and advise should use template loading
  • possible hardcoded links
  • nav-menu check
  • non-printable characters
  • post format check for implementation (if you load it use it)
  • hardcoded dates
s
search
c
compose new post
r
reply
e
edit
t
go to top
j
go to the next post or comment
k
go to the previous post or comment
o
toggle comment visibility
esc
cancel edit post or comment