• It’s possible to get a WARNING message saying the wrong tag is used, when actually no tags have been defined. Since $tag is checked if it exists in an array of possible tags, can you add an extra check for empty and inform the user accordingly;

    if(empty($tag) || $tag === null){
    	$this->error[] = '<span class="tc-lead tc-warning">'. __('WARNING','theme-check'). '</span>: ' . sprintf(__('Found wrong tag, tag is empty:<strong>%1$s</strong>. Add correct tags to your style.css header. see: <a href="https://codex.www.ads-software.com/Theme_Development">Theme Development</a>', 'theme-check'), $tag);
    	$ret = false;
    } else if ( !in_array( strtolower( $tag ), $allowed_tags ) ) { // ... }

    https://www.ads-software.com/plugins/theme-check/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Empty headers are not acceptable either. If you’re not using a header, remove the empty header.

    Thread Starter Jesse Graupmann

    (@jgraup)

    You plugin has the ability to inform the user of the correct problem. Is it too hard to add another conditional?

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    No, it’s not hard. But it’s a real edge-case thing that nobody has really mentioned before now. Usually people add Tags to their themes.

    FYI, I have the plugin on github if you want to contribute there:
    https://github.com/Otto42/theme-check

    Thread Starter Jesse Graupmann

    (@jgraup)

    The custom _s theme I’ve created will never be submitted. It’s for a specific client with specific needs. With that in mind, tags are meaningless but I’d still like to remove the error from Theme Check’s output.

    By adding the conditional I believe it will show the actual problem. I personally believe it’s a bug if it is reporting the wrong error, albeit a minor one at that.

    When I get some time I’ll submit a pull-request if that helps.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Found wrong tag, remove from your style.css header.’ is closed to new replies.