WordPress / WordPress/plugin-check

Proposal: Support settings file e.g. .pcprc.json

Open
#1,210 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
362
Forks
126
Avg merge
1d 23h
Merged PRs (30d)
22

Description

Thank you to all the maintainers!

It would be great if a settings file (e.g. .phprc.json ) was supported, inspired by .eslintrc.json

It can reduce false positives and serve as a clear definition of the plugin's analysis policy.

Examples

{
  "rules": {
    "hidden_files": {
        "ignore": [ ".claude", ".gitignore" ],
    },
    "missing_direct_file_access_protection": {
        "ignore": "src"
    }
  }
}
Case 1. hidden_files

I run PCP on local development via wp-cli. Some hidden files(.claude, .gitignore) are listed in .distignore and are removed before deployment to the WordPress.org directory.

Case 2. missing_direct_file_access_protection

Some of my plugins follow PSR-0/4 structure as shown below:

src/
  - Vendor/
    - NameSpace/
      - Services/
        - Slack.php
        - Teams.php
      - Model/
        - Products.php
        - Orders.php
tempalte-parts/
  - block.php

I agree with the PSR guideline that files defining only classes or functions are safe and free of side effects.
Therefore, I’d like to exclude the src directory from this rule. However, it should still apply to files where side effects are expected, such as template files template-parts/*.php.

Concerns

Case 1 is compatible with both local development and WordPress.org directory because .pcprc.json is removed during the deployment process.

However, to support Case 2, we would need to include .phprc.json in the distribution zip. This might conflict with the hidden_files rule itself.

Thanks! I look forward to your feedback.

Related: #1154

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading related issue #1154 and the proposal's examples for .pcprc.json or .phprc.json. Review how the hidden_files and missing_direct_file_access_protection rules currently receive policy, then determine the required configuration and distribution behavior. Done means a decided, documented approach for rule-specific ignores without undermining deployment checks.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.