Skip to content

feat: PHPCS main file + coverage gate (80%) - #9

Merged
Christian-Devora merged 7 commits into
mainfrom
feat/coverage-phpcs-quality-mission
Nov 5, 2026
Merged

Christian-Devora merged 7 commits into
mainfrom
feat/coverage-phpcs-quality-mission

Conversation

@Christian-Devora

Copy link
Copy Markdown
Collaborator

Summary

  • TASK-005: WPCS on rank-math-api-manager.php (phpcbf + manual fixes); removed main-file exclude from phpcs.xml.dist.
  • Coverage: pcov in QA PHPUnit job, scripts/check-plugin-coverage.sh enforces ≥80% line coverage on the main plugin file.
  • Tests: Risk-based integration tests for REST permissions, telemetry opt-out/payload, uninstall cleanup, GitHub updater validation, meta auth, dependency status, and admin notice smoke.

Test plan

  • Local ./scripts/run-phpunit-local.sh (25 tests, WC product skipped without WooCommerce)
  • Local vendor/bin/phpcs --standard=phpcs.xml.dist
  • GitHub QA workflow (PHPUnit + coverage gate, PHPCS, package smoke, Plugin Check)

Run phpcbf and manual docblock/comment fixes; remove main-file exclude from phpcs.xml.dist.
Add mission spec and long-run state for coverage follow-up slice.
Add pcov coverage enforcement (80% lines on main file), check-plugin-coverage.sh,
QA workflow integration, and integration tests for REST permissions, telemetry
privacy, uninstall cleanup, GitHub updater paths, and meta auth.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T10:33:43.849306Z 3dc8825 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Add lifecycle, plugins_api, rate-limit, dependency notice, and telemetry
heartbeat tests to approach the 80% line coverage gate on the main file.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3dc88256c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

fwrite(STDERR, sprintf("check-plugin-coverage: FAIL (minimum %.2f%%)\n", $min));
exit(1);
}
fwrite(STDERR, sprintf("check-plugin-coverage: PASS (minimum %.2f%%)\n", $min));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Open stderr explicitly in the stdin-fed PHP script

In the PHP 8.1 environment configured by .github/workflows/qa.yml, this PHP block is read from stdin through a heredoc, where the standard stream constants are unavailable (PHP manual). Consequently, even when PHPUnit succeeds and coverage meets 80%, this final statement throws Undefined constant "STDERR", causing the coverage step to fail instead of passing. Open php://stderr explicitly and use that resource for all diagnostics in this block, or execute the checker from a PHP file.

Useful? React with 👍 / 👎.

Define STDERR for CI PHP embed; add updater error, deactivation, and REST
field tests to move line coverage toward the 80% gate.
Register minimal WooCommerce stubs in PHPUnit bootstrap so product REST
coverage runs in CI; add sanitizer and invalid GitHub payload tests.
Add CoverageBooster and CoverageGap integration tests for admin notices,
GitHub updater transport errors, telemetry, plugin_info, and enqueue paths.
Add integration tests for register_plugin_settings, load_textdomain,
notice dismissals, log_debug, and dependency notice markup.
@Christian-Devora
Christian-Devora merged commit d901c22 into main Nov 5, 2026
5 checks passed
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.

1 participant