WordPress / WordPress/plugin-check
Proposal: Add Feature To Ignore Specific Checks Using Comments
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 362
- Forks
- 126
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 22
Description
The plugin check plugin is a great tool. It has helped developers like me make their code compliant with the WordPress guidelines. However, some errors and warnings detected by this tool fall under the false positive category.
Similar toos like PHP Mess Detector and PHPStan have a way of supressing errors, using comments like
$test = new Test();
// @phpstan-ignore-next-line
$test->magic_property = 'magic value';
for PHPStan
or
/**
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
function test( $a , $b, $c ) {
...
}
for PHP Mess Detector
Proposal
I would be great if there is a way to supress the errors and warnings the developer thinks are false positives from showing as these could sometimes overcrowd the results page, making it difficult to spot other errors. Supressing this errors will enable the developer to focus on solving the most pertinent issues as these errors will be hidden from the results page.
I am proposing adding a feature to hide some errors and warnings.
For example
public function check_nonce() {
...
}
/**
* @PluginCheckSuppress(WordPress.Security.NonceVerification.Recommended)
*/
function some_function_here() {
// Already checked for the nonce in the check_nonce() function
// codes here ...
}
Please let me know what you think.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository files, tests, or entry points are named. Start by tracing how Plugin Check reports errors and warnings, then compare the proposed PHP comment annotations with the existing results display; done means selected checks can be hidden while other findings remain visible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100