Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that all required headers in style.css are there. #50

Open
khacoder opened this issue Aug 12, 2016 · 2 comments

Comments

@khacoder
Copy link
Contributor

commented Aug 12, 2016

[New sniff] Check that all required headers in style.css are there.

Rule type:

Error

Rule:

ERROR | Check specifically against style.css whether the required headers are found. See Theme-Check plugin - /checks/style_needed.php for the list.

Rule as it is found in the handbook.
There are no other specific rules in this sniff. Most are pretty obvious.

Theme check file covering this rule:

https://github.com/Otto42/theme-check/blob/master/checks/style_needed.php
Required styles are also included in this theme check but they will have to be moved to a separate sniff.

[Optional Section] Decision needed:

There is only the one rule covering text domain requirements. The other checks that will be done are pretty obvious. However if we are striving for rule/sniff consistency I would suggest the following additions.
Stylesheets and Scripts (Required)
The main style.css header requires: Theme name, Description, Author, Version, License, License URI, and Text Domain.

Advice/Request for decision: Should the above header requirements be added to the requirements lists?

Notes for implementation:
  • This sniff will rely on the WordPress_AbstractThemeSniff Class to get the $sniff_helper array.
  • Testing will require that a style.css file is in the same folder as the test file.

To do:

  • Decision and implementation to add the rule in the Theme Review handbook to the Requirements page.
  • Create unit tests
  • Create new sniff
  • Adjust existing WPCS / PHPCS sniff and send in PR upstream.
  • Add existing sniffname sniff to the ruleset.

@khacoder khacoder self-assigned this Aug 12, 2016

@khacoder

This comment has been minimized.

Copy link
Contributor Author

commented Aug 12, 2016

I have this sniff ready to go, however it uses the $sniff_helper array from the proposed WordPress_AbstractThemeSniff class.

@dingo-d

This comment has been minimized.

Copy link
Member

commented May 18, 2019

Again, I think this is something that is added in Theme Sniffer. Not sure if a sniff is needed for this 🤷‍♂

@timelsass comments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.