Skip to content

Add plugin-check-info.json manifest for third-party paths - #1439

Open
faisalahammad wants to merge 2 commits into
WordPress:trunkfrom
faisalahammad:fix/760-third-party-manifest
Open

Add plugin-check-info.json manifest for third-party paths#1439
faisalahammad wants to merge 2 commits into
WordPress:trunkfrom
faisalahammad:fix/760-third-party-manifest

Conversation

@faisalahammad

@faisalahammad faisalahammad commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

What?

Closes #760

Add support for a committed plugin-check-info.json manifest that declares bundled third-party paths.

Why?

Plugin Check currently reports warning-level recommendations inside vendor code that plugin authors do not control. This creates noisy results. Errors must remain visible.

How?

Add a shared configuration helper that reads and validates the manifest from the plugin root. After checks run, the shared runner removes warnings whose plugin-relative file path matches a declared third-party path. Errors and findings outside declared paths remain unchanged. The same result filtering is used by CLI and admin AJAX runs.

Path matching uses normalized, relative paths with directory boundaries. Missing or malformed manifests are treated as no configuration.

Testing Instructions

  1. Add plugin-check-info.json to a test plugin root:
    {
        "third_parties": [
            "vendor/example-library"
        ]
    }
  2. Put code that produces a warning and an error under vendor/example-library/.
  3. Put code that produces a warning outside that directory.
  4. Run Plugin Check from Tools > Plugin Check and with WP-CLI.
  5. Confirm warnings under the declared path are hidden.
  6. Confirm errors under the declared path remain visible.
  7. Confirm warnings outside the declared path remain visible.
  8. Remove or rename the manifest and confirm normal results return.

Automated validation:

  • Focused PHPUnit tests pass in wp-env: 28 tests, 69 assertions.
  • composer lint passes.
  • composer phpstan passes.
  • git diff --check passes.

The local PHPUnit command without wp-env was blocked by missing WordPress test environment constants. CodeRabbit follow-up review was rate limited after the initial review completed with no findings.

AI Usage Disclosure

  • This PR was created without the help of AI tools
  • This PR includes AI-assisted code or content

Used an AI coding assistant to inspect the repository, implement the manifest parsing and result filtering, add tests and documentation, and run validation commands. All changes were reviewed and tested locally.

Screenshots or screencast

Not applicable. This changes check result filtering and does not change the UI layout.

Open WordPress Playground Preview

Add a standalone plugin-check-info.json manifest that lets plugin
authors declare bundled third-party paths. After checks run, warning
messages inside declared paths are removed from results while errors
and all other findings stay untouched. The shared runner applies this
to both CLI and admin check runs.

Missing or invalid manifest entries are ignored, so existing behavior
is preserved when no configuration exists.
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @shawn-digitalpoint, @DavidAnderson684.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: shawn-digitalpoint, DavidAnderson684.

Co-authored-by: faisalahammad <faisalahammad@git.wordpress.org>
Co-authored-by: ernilambar <nilambar@git.wordpress.org>
Co-authored-by: swissspidy <swissspidy@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

- extract third-party warning filtering from run() to filter_third_party_warnings()
PHPMD: Abstract_Check_Runner run() NPath 384 over 200 threshold
PHP 7.4-compatible. All CI checks passing.
Refs WordPress#1439
@faisalahammad

faisalahammad commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

CI Fix Summary — 1 failure resolved

# File Error Fix
1 includes/Checker/Abstract_Check_Runner.php PHPMD NPathComplexity (run() NPath 384 > 200) Extract third-party warning filter to private filter_third_party_warnings()

Tests ✅ (phpmd, lint, phpstan) · Verification ✅ · PHP 7.4 ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Indicate non-WP components

1 participant