├── assets ├── gray-grad.png └── style.css ├── checks ├── class-tag-check.php ├── class-deregister-check.php ├── class-gravatar-check.php ├── class-theme-support-title-tag.php ├── class-php-short-tags-check.php ├── class-editor-style-check.php ├── class-screen-reader-text-check.php ├── class-site-url-check.php ├── class-non-printable-check.php ├── class-favicon-check.php ├── class-included-zip-check.php ├── class-script-tag-check.php ├── class-directories-check.php ├── class-image-size-check.php ├── class-comment-reply-check.php ├── class-uri-check.php ├── class-iframe-check.php ├── class-post-pagination-check.php ├── class-block-patterns-check.php ├── class-fse-required-files-check.php ├── class-comment-pagination-check.php ├── class-version-php-check.php ├── class-post-thumbnail-check.php ├── class-time-date-check.php ├── class-worms-check.php ├── class-include-check.php ├── class-version-tested-check.php ├── class-generated-check.php ├── class-post-format-check.php ├── class-comments-check.php ├── class-copyright-notice-check.php ├── class-cdn-check.php ├── class-non-gpl-check.php ├── class-no-hidden-admin-bar-check.php ├── class-constants-check.php ├── class-search-form-check.php ├── class-link-check.php ├── class-suggested-styles-check.php ├── class-title-check.php ├── class-theme-support-check.php ├── class-style-css-header-check.php ├── class-i18n-check.php ├── class-screenshot-check.php ├── class-deprecated-param-check.php ├── class-line-endings-check.php ├── class-widgets-check.php ├── class-underscores-check.php ├── class-customizer-check.php ├── class-admin-menu-check.php ├── class-filesystem-http-check.php ├── class-basic-check.php ├── class-bad-things-check.php ├── class-escaping-check.php ├── class-file-check.php ├── class-nav-menu-check.php ├── class-plugin-territory-check.php ├── class-style-tags-check.php ├── class-textdomain-check.php └── class-envato-check.php ├── readme.md ├── theme-check.php ├── theme-check-cli.php ├── main.php └── checkbase.php /assets/gray-grad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/envato/envato-theme-check/master/assets/gray-grad.png -------------------------------------------------------------------------------- /checks/class-tag-check.php: -------------------------------------------------------------------------------- 1 | error[] = sprintf( 27 | '%s %s', 28 | __( 'RECOMMENDED', 'theme-check' ), 29 | __( "This theme doesn't seem to display tags. Modify it to display tags in appropriate locations.", 'theme-check' ) 30 | ); 31 | } 32 | 33 | return true; 34 | } 35 | 36 | function getError() { 37 | return $this->error; 38 | } 39 | } 40 | 41 | $themechecks[] = new Tag_Check(); 42 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Envato Theme Check 2 | Plugin Name: Envato Theme Check 3 | 4 | Author: Scott Parry 5 | 6 | Author URI: https://scottparry.co/ 7 | 8 | Plugin URI: https://github.com/envato/Envato-Theme-Check 9 | 10 | License: GPLv2 11 | 12 | License URI: https://www.gnu.org/licenses/gpl-2.0.html 13 | 14 | 15 | ## Description 16 |

The Envato Theme Check is a modified fork of the original Theme Check by Otto42 with additional Envato specific WordPress checks.

17 |

It is an easy way to test your theme and make sure it's up-to-date with the latest Envato review standards. With it, you can run all the same automated testing tools on your theme that Envato Reviewers use for WordPress theme submissions.

18 | 19 |

The tests are run through a simple admin menu and all results are displayed at once. This is very handy for theme developers, or anybody looking to make sure that their theme supports the latest WordPress theme standards and practices.

20 | 21 | ## Frequently Asked Questions 22 | 23 | #### Do I need to address WARNINGS and INFO notices? 24 |

It is strongly recommended that WARNING, RECOMMENDED and INFO notices be resolved if possible. Some may be the result of an issue that is cause for rejection (Reviewers make this decision).

25 | 26 | #### What do I do if I find a bug, or think something is wrong with the plugin? 27 |

You can submit an issue directly here: https://github.com/envato/envato-theme-check/issues

-------------------------------------------------------------------------------- /checks/class-deregister-check.php: -------------------------------------------------------------------------------- 1 | $file_content ) { 21 | checkcount(); 22 | 23 | if ( false !== strpos( $file_content, 'wp_deregister_script' ) ) { 24 | $grep = tc_preg( '/wp_deregister_script/', $file_path ); 25 | $this->error[] = sprintf( 26 | '%s: %s %s', 27 | __( 'WARNING', 'theme-check' ), 28 | sprintf( 29 | __( 'Found wp_deregister_script in %1$s. Themes must not deregister scripts that are included in WordPress. Deregistering third party scripts that are registered by parent themes is allowed.', 'theme-check' ), 30 | '' . tc_filename( $file_path ) . '' 31 | ), 32 | $grep 33 | ); 34 | } 35 | } 36 | 37 | return true; 38 | } 39 | 40 | function getError() { 41 | return $this->error; 42 | } 43 | } 44 | 45 | $themechecks[] = new Deregister_Check(); 46 | -------------------------------------------------------------------------------- /checks/class-gravatar-check.php: -------------------------------------------------------------------------------- 1 | error[] = sprintf( 37 | '%s: %s', 38 | __( 'RECOMMENDED', 'theme-check' ), 39 | __( "This theme doesn't seem to support the standard avatar functions. Use get_avatar or wp_list_comments to add this support.", 'theme-check' ) 40 | ); 41 | } 42 | 43 | return true; 44 | } 45 | 46 | /** 47 | * Get error messages from the checks. 48 | * 49 | * @return array Error message. 50 | */ 51 | public function getError() { 52 | return $this->error; 53 | } 54 | } 55 | 56 | $themechecks[] = new Gravatar_Check(); 57 | -------------------------------------------------------------------------------- /assets/style.css: -------------------------------------------------------------------------------- 1 | .tc-box { 2 | padding:20px 0; 3 | border-top:1px solid #dfdfdf; 4 | } 5 | .tc-required, .tc-fail { 6 | color:red; 7 | } 8 | .tc-warning { 9 | color: orange; 10 | } 11 | .tc-recommended, .tc-pass { 12 | color: green; 13 | } 14 | .tc-info { 15 | color: blue; 16 | } 17 | .tc-grep span { 18 | background: yellow; 19 | } 20 | pre { 21 | white-space: pre-wrap; 22 | } 23 | .tc-success { 24 | margin:0 20px 20px 20px; 25 | background:#e6ffe2; 26 | border:1px solid #d1eecc; 27 | } 28 | form { 29 | margin: 1.5em auto; 30 | } 31 | .theme-check { 32 | margin: 1em auto; 33 | border:1px solid #dfdfdf; 34 | -moz-border-radius:5px; 35 | -khtml-border-radius:5px; 36 | -webkit-border-radius:5px; 37 | border-radius:5px; 38 | } 39 | .theme-check h2 { 40 | margin: 0 0 1em 0; 41 | padding: 1em; 42 | background:#dfdfdf url("gray-grad.png") repeat-x left top; 43 | font-size:20px; 44 | border-bottom:1px solid #ccc; 45 | } 46 | .theme-check p { 47 | padding:5px 20px; 48 | } 49 | .theme-check form { 50 | margin-left: 1.5em; 51 | } 52 | .theme-check ul { 53 | margin-left:20px; 54 | } 55 | .theme-check h3 { 56 | margin:0 0 10px 20px; 57 | padding:0; 58 | } 59 | .theme-check ul { 60 | margin-bottom:10px; 61 | } 62 | .theme-info { 63 | padding: 1em; 64 | border:1px solid #dfdfdf; 65 | margin: 1em 1em 0 1em; 66 | } 67 | .theme-info p { 68 | padding:0; 69 | margin-bottom:10px; 70 | } 71 | .theme-info label { 72 | float:left; 73 | width:100px; 74 | font-weight:bold; 75 | display:block; 76 | } 77 | .theme-info span.info { 78 | margin-left:100px; 79 | display:block; 80 | } 81 | .theme-check input[name="s_info"] { 82 | margin-left: 0.5em; 83 | } -------------------------------------------------------------------------------- /checks/class-theme-support-title-tag.php: -------------------------------------------------------------------------------- 1 | error[] = sprintf( 34 | '%s: %s', 35 | __( 'REQUIRED', 'theme-check' ), 36 | __( 'No reference to add_theme_support( "title-tag" ) was found in the theme.', 'theme-check' ) 37 | ); 38 | } 39 | 40 | return $ret; 41 | } 42 | 43 | /** 44 | * Get error messages from the checks. 45 | * 46 | * @return array Error message. 47 | */ 48 | public function getError() { 49 | return $this->error; 50 | } 51 | } 52 | 53 | $themechecks[] = new Theme_Support_Title_Tag_Check(); 54 | -------------------------------------------------------------------------------- /checks/class-php-short-tags-check.php: -------------------------------------------------------------------------------- 1 | $file_content ) { 29 | checkcount(); 30 | 31 | if ( preg_match( '/<\?(\=?)(?!php|xml)/i', $file_content ) ) { 32 | $grep = tc_preg( '/<\?(\=?)(?!php|xml)/', $file_path ); 33 | $this->error[] = sprintf( 34 | '%s: %s %s', 35 | __( 'WARNING', 'theme-check' ), 36 | sprintf( 37 | __( 'Found PHP short tags in file %s.', 'theme-check' ), 38 | '' . tc_filename( $file_path ) . '' 39 | ), 40 | $grep 41 | ); 42 | } 43 | } 44 | 45 | return true; 46 | } 47 | 48 | /** 49 | * Get error messages from the checks. 50 | * 51 | * @return array Error message. 52 | */ 53 | public function getError() { 54 | return $this->error; 55 | } 56 | } 57 | 58 | $themechecks[] = new PHP_Short_Tags_Check(); 59 | -------------------------------------------------------------------------------- /checks/class-editor-style-check.php: -------------------------------------------------------------------------------- 1 | error[] = sprintf( 36 | '%s: %s', 37 | __( 'RECOMMENDED', 'theme-check' ), 38 | __( 'No reference to add_editor_style() was found in the theme. It is recommended that the theme implement editor styling, so as to make the editor content match the resulting post output in the theme, for a better user experience.', 'theme-check' ) 39 | ); 40 | } 41 | 42 | return $ret; 43 | } 44 | 45 | /** 46 | * Get error messages from the checks. 47 | * 48 | * @return array Error message. 49 | */ 50 | public function getError() { 51 | return $this->error; 52 | } 53 | } 54 | 55 | $themechecks[] = new Editor_Style_Check(); 56 | -------------------------------------------------------------------------------- /checks/class-screen-reader-text-check.php: -------------------------------------------------------------------------------- 1 | __( '.screen-reader-text CSS class is generated by WordPress and needs to be styled with your theme CSS. See the Codex for an example implementation.', 'theme-check' ), 32 | ); 33 | 34 | foreach ( $checks as $key => $check ) { 35 | checkcount(); 36 | if ( ! preg_match( '/' . $key . '/i', $css, $matches ) ) { 37 | $this->error[] = sprintf( 38 | '%s %s', 39 | __( 'INFO', 'theme-check' ), 40 | $check 41 | ); 42 | } 43 | } 44 | 45 | return true; 46 | } 47 | 48 | /** 49 | * Get error messages from the checks. 50 | * 51 | * @return array Error message. 52 | */ 53 | public function getError() { 54 | return $this->error; 55 | } 56 | } 57 | 58 | $themechecks[] = new Screen_Reader_Text_Check(); 59 | -------------------------------------------------------------------------------- /checks/class-site-url-check.php: -------------------------------------------------------------------------------- 1 | $file_content ) { 32 | $filename = tc_filename( $file_path ); 33 | 34 | if ( strpos( $file_content, 'site_url' ) !== false ) { 35 | $this->error[] = sprintf( 36 | '%s %s', 37 | __( 'INFO', 'theme-check' ), 38 | sprintf( 39 | __( 'site_url() or get_site_url() was found in %s. site_url() references the URL where the WordPress files are located. Use home_url() if the intention is to point to the site address (home page), and in the search form.', 'theme-check' ), 40 | '' . $filename . '' 41 | ) 42 | ); 43 | } 44 | } 45 | 46 | return true; 47 | } 48 | 49 | /** 50 | * Get error messages from the checks. 51 | * 52 | * @return array Error message. 53 | */ 54 | public function getError() { 55 | return $this->error; 56 | } 57 | } 58 | 59 | $themechecks[] = new Site_URL_Check(); 60 | -------------------------------------------------------------------------------- /checks/class-non-printable-check.php: -------------------------------------------------------------------------------- 1 | $file_content ) { 29 | checkcount(); 30 | 31 | // 09 = tab. 32 | // 0A = line feed. 33 | // 0D = new line. 34 | if ( preg_match( '/[\x00-\x08\x0B-\x0C\x0E-\x1F]/', $file_content, $matches ) ) { 35 | $grep = tc_preg( '/[\x00-\x08\x0B-\x0C\x0E-\x1F]/', $file_path ); 36 | $this->error[] = sprintf( 37 | '%s: %s %s', 38 | __( 'WARNING', 'theme-check' ), 39 | sprintf( 40 | __( 'Non-printable characters were found in the %s file. You may want to check this file for errors.', 'theme-check' ), 41 | '' . tc_filename( $file_path ) . '' 42 | ), 43 | $grep 44 | ); 45 | } 46 | } 47 | 48 | return true; 49 | } 50 | 51 | /** 52 | * Get error messages from the checks. 53 | * 54 | * @return array Error message. 55 | */ 56 | public function getError() { 57 | return $this->error; 58 | } 59 | } 60 | 61 | $themechecks[] = new Non_Printable_Check(); 62 | -------------------------------------------------------------------------------- /checks/class-favicon-check.php: -------------------------------------------------------------------------------- 1 | $file_content ) { 33 | 34 | $filename = tc_filename( $file_path ); 35 | 36 | if ( 37 | preg_match( '/(error[] = sprintf( 41 | '%s: %s', 42 | __( 'INFO', 'theme-check' ), 43 | sprintf( 44 | __( 'Possible Favicon found in %1$s. Favicons are handled by the Site Icon setting in the customizer since version 4.3.', 'theme-check' ), 45 | '' . $filename . '' 46 | ) 47 | ); 48 | } 49 | } 50 | return true; 51 | } 52 | 53 | /** 54 | * Get error messages from the checks. 55 | * 56 | * @return array Error message. 57 | */ 58 | public function getError() { 59 | return $this->error; 60 | } 61 | } 62 | 63 | $themechecks[] = new Favicon_Check(); 64 | -------------------------------------------------------------------------------- /checks/class-included-zip-check.php: -------------------------------------------------------------------------------- 1 | $otherfile ) { 32 | array_push( $filenames, strtolower( basename( $other_key ) ) ); 33 | } 34 | 35 | $blocklist = array( 36 | '\.zip' => __( 'Zipped Plugin', 'theme-check' ), 37 | ); 38 | 39 | checkcount(); 40 | 41 | foreach ( $blocklist as $file => $reason ) { 42 | if ( $filename = preg_grep( '/' . $file . '/', $filenames ) ) { 43 | $error = implode( ' ', array_unique( $filename ) ); 44 | $this->error[] = sprintf( 45 | '%s: %s', 46 | __( 'REQUIRED', 'theme-check' ), 47 | sprintf( 48 | __( 'Zip file found. Plugins are not allowed in themes unless they are being included with TGMPA. The zip file found was %s.', 'theme-check' ), 49 | $error 50 | ) 51 | ); 52 | $ret = false; 53 | } 54 | } 55 | 56 | return $ret; 57 | } 58 | 59 | /** 60 | * Get error messages from the checks. 61 | * 62 | * @return array Error message. 63 | */ 64 | public function getError() { 65 | return $this->error; 66 | } 67 | } 68 | 69 | $themechecks[] = new Included_Zip_Check(); 70 | -------------------------------------------------------------------------------- /checks/class-script-tag-check.php: -------------------------------------------------------------------------------- 1 | tag is included in header.php or footer.php 4 | * 5 | * @package Theme Check 6 | */ 7 | 8 | /** 9 | * Check if: 10 | * A