Theme-Check

46 thoughts on “Theme-Check

  1. Hello, nice idea and plugin. Maybe you can change a small code line? The function stristr() use only at php 5.3 the third paramater and its not on all servers normaly to work with php 5.3. Maybe you can change line 70
    $pre = ltrim( htmlspecialchars( stristr($this_line, $error, true) ) );
    in

    $pre = ( FALSE !== ($pos = strpos($this_line, $error) )
    ? substr($this_line, 0, $pos)
    : FALSE );
    $pre = ltrim( htmlspecialchars( $pre ) );

    many thanks!

  2. Rakesh says:

    I am using this plugin to look for obfuscated codes in the themes I download. One question, can it look for other malicious codes present in the theme, not necessarily obfuscated.

    I am not much into coding.

    Thanks Frank for giving the solution to the error w.r.t function stristr()

  3. The Pro version still has the line
    $pre = ltrim( htmlspecialchars( stristr( $this_line, $error, true ) ) );
    and as long as it has ‘true’ parameter, it will return Warning: Wrong parameter count for stristr()

    1. pross says:

      OK new version tagged with this fix.

      I still strongly suggest using the trunk version though, its a complete rewrite and has all the latest guidelines ready for 3.1

  4. I’m not sure if this is a plugin problem or a theme guidelines problem, but I have run your plugin on a couple of sites now and on both of them I get this as one of the errors in the theme:
    REQUIRED: Could not find register_sidebar. See: register_sidebar

    However, both themes use the function register_sidebars (note the “s” at the end) which allows you to register multiple sidebars at one time and is valid core WP standards. Shouldn’t the check(s) that check for register_sidebar check for both the function register_sidebar and register_sidebars, since both are valid and both achieve the same thing.

  5. Bruce Wamppler says:

    Just FYI, when running with WP_DEBUG on:

    Notice: Undefined index: extension in /xxxx/wp-content/plugins/theme-check/checks/lineendings.php on line 27

  6. Bruce Wampler says:

    Hidden files:

    While Theme Check detects hidden files (.Mac-or-Linux-hidden), it doesn’t find hidden directories. I’ve unintentionally been including a hidden directory in my distribution (although it was empty), and suggest that Theme Check include a check and appropriate diagnostic for hidden directories – although I’d think they probably should be prohibited just like hidden files.

    One of the great things about Theme Check is it allows us and easy to verify the little bookkeeping junk like hidden files.

    1. pross says:

      Good suggestion Bruce, yes it already detects .git and .svn and . files like htaccess i wouyld have thought that would catch dirs too, obviously not, something to add 😉 thx!

  7. Njabulo Wela says:

    Hi, complete noob here. How do I use theme check exactly? I’ve installed it as a plugin, but I’m not sure how to actually test my themes? Like I said, I’m a clueless noob so any help would be appreciated.

      1. fawnahareo says:

        Okay, for future n00bs like me: go to the Appearance->Themes section of your Dashboard and you’ll find a “Check Theme” button there. 🙂

  8. Bruce Wampler says:

    In case no one else reported this (with WP_DEBUG true):

    Notice: Undefined offset: 1 in //wp-content/plugins/theme-check/main.php on line 75

  9. The non-printable characters check doesn’t account for Unicode characters and gives a warning for non-printable characters when you have regional characters in the code. One way to solve this is to add ‘u’ at the end of the regular expression in line 13 of checks/nonprintable.php as in
    if ( preg_match('/[\x00-\x08\x0B-\x0C\x0E-\x1F\x80-\xFF]/u', $content, $matches ) ) {

    Another minor annoyance is that in my setup $version[1] is not defined and since the plugin doen’t check if it is defined, throws an error at line75 in main.php.

  10. Potential User says:

    Hi! I make tons of themes for a living and just downloaded your plugin “theme check”. I came here looking for documentation to begin using the plugin.

    You have an effect where you rain heiniken beer cans. Super cool effect bro, too bad it made the site impossible to read and no way of turning it off. You’re clearly not a credible designer or developer, plugin uninstalled.

    I typed this out after turning javascript off. Now I will promptly re-nable javascript, leave and never come back.

  11. persi says:

    hi,
    I have this error:
    Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\unique\wp-content\plugins\theme-check\checkbase.php on line 87

    have you any info or experience about this issue.

    I did not use “set_time_limit(0)” for remove time limitation, I want fix problem

    thanks

    1. persi says:

      I found the problem, I have many (+1000) text that use _e() function and this affect to process time and for this I have this error.

      good luck

  12. Thanks, it´s true.
    The plugin found a lot of errors, Who can guide me to fix it, I have some of knowledge, to do it.

    Part of report:
    WARNING: No screenshot detected! Please include a screenshot.png.
    REQUIRED:License: is missing from your style.css header.
    REQUIRED:License URI: is missing from your style.css header.
    REQUIRED:.sticky css class is needed in your theme css.
    REQUIRED:.gallery-caption css class is needed in your theme css.
    REQUIRED:.bypostauthor css class is needed in your theme css.
    REQUIRED: No content width has been defined

Leave a Reply

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