WordPress / WordPress/plugin-check
Support file/directory exclusion in Admin UI
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 362
- Forks
- 126
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 22
Description
Summary
The CLI supports --exclude-files and --exclude-directories flags, but there's no equivalent option in the WordPress Admin UI. Developers running checks from the admin panel have no way to exclude development files from the scan.
Problem
When running Plugin Check from the Admin UI, developers receive errors for files that:
- Are listed in
.distignoreand won't be included in the wordpress.org distribution - Are development-only files (test suites, build scripts, CI configs)
- Are vendor dependencies that the plugin author doesn't control
While CLI users can work around this with --exclude-directories=tests/,vendor/, Admin UI users have no such option.
Proposed Solution
One or more of the following:
1. Add exclusion fields to the Admin UI
Allow users to specify directories and files to exclude directly in the check form, similar to the existing CLI flags.
2. Respect .distignore automatically
Skip files/directories listed in .distignore since these won't be in the final distribution anyway. This would benefit both CLI and Admin UI users by aligning checks with what actually gets submitted to wordpress.org.
3. Support a configuration file
Allow a .plugin-check.json or similar file that both CLI and Admin UI would respect:
{
"exclude-directories": ["tests/", "vendor/", "bin/"],
"exclude-files": ["phpunit.xml.dist", ".phpcs.xml.dist"]
}
This would provide feature parity between CLI and Admin UI without requiring UI changes.
Use Case
I have a plugin with unit tests in a tests/ directory. These test files:
- Are listed in
.distignore - Will never be uploaded to wordpress.org
- Contain test-specific code that intentionally triggers scenarios that would fail checks
When running Plugin Check from the Admin UI, these files clutter the results and make it harder to focus on actual issues in distributable code. CLI users can exclude them, Admin UI users cannot.
Example files that shouldn't be checked:
tests/bootstrap.phptests/Unit/*.phpbin/install-wp-tests.shvendor/*phpunit.xml.dist.phpcs.xml.distcomposer.jsoncomposer.lock
Related Issues
- #823 - Implement exclusion of rules for the check results
- #1154 - Proposal: Add Feature To Ignore Specific Checks Using Comments
- #1108 - Enhancement: Add CLI options to check specific files and directories
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
Start by comparing the existing CLI --exclude-files and --exclude-directories entry points with the WordPress Admin UI check form. Review the proposed .distignore and configuration-file options, choose a defined scope, and verify that the selected exclusion behavior works for files and directories in Admin UI checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- tooling, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100