WordPress / WordPress/plugin-check

Display warning if non existent parameters are passed in `--checks` and `--categories`

Open
#348 7 comments 1 reaction 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

Proper warning message should be displayed rather than fatal error when non existent check is passed to --checks

wp plugin check hello-universe --checks=nonexistent_check

Currently it generates PHP fatal error.

Fatal error: Uncaught Exception: Check with the slug "nonexistent_check" does not exist. in /var/www/html/wp-content/plugins/plugin-check/includes/Checker/Default_Check_Collection.php:158

May be we should display warning message like

WARNING: Invalid check slug 'nonexistent_check'

We could implement similar for categories also.

wp plugin check hello-universe --categories=nonexistent_category

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 in includes/Checker/Default_Check_Collection.php, where the nonexistent check slug currently produces the fatal exception. Trace how the --checks and --categories CLI arguments are validated, then make invalid values report warnings instead. Done means both example commands show a warning for the invalid slug or category rather than a fatal error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.