Skip to content

fix: detect closed WordPress.org plugins - #550

Open
AnuragR3k wants to merge 1 commit into
wp-cli:mainfrom
AnuragR3k:fix/closed-plugin-wporg-status
Open

fix: detect closed WordPress.org plugins#550
AnuragR3k wants to merge 1 commit into
wp-cli:mainfrom
AnuragR3k:fix/closed-plugin-wporg-status

Conversation

@AnuragR3k

@AnuragR3k AnuragR3k commented Sep 12, 2026

Copy link
Copy Markdown

Summary

  • Fix the closed-plugin WordPress.org API fixture to use valid JSON.
  • Detect closed plugins from the API response using error: "closed" or closed: true.
  • Preserve the Trac lookup when wporg_last_updated is requested.

Fixes #549

Tests

  • vendor/bin/behat features/plugin-list-wporg-status.feature
  • composer lint
  • composer lint-gherkin

Summary by CodeRabbit

  • Bug Fixes
    • Plugin status information from WordPress.org is now reported accurately.
    • Plugins marked as closed by WordPress.org are displayed as closed instead of incorrectly appearing active.
    • Active plugins continue to be identified as active.

@AnuragR3k
AnuragR3k requested a review from a team as a code owner September 12, 2026 06:01
@github-actions

Copy link
Copy Markdown
Contributor

Hello! 👋

Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project.

Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.

Here are some useful Composer commands to get you started:

  • composer install: Install dependencies.
  • composer test: Run the full test suite.
  • composer phpcs: Check for code style violations.
  • composer phpcbf: Automatically fix code style violations.
  • composer phpunit: Run unit tests.
  • composer behat: Run behavior-driven tests.

To run a single Behat test, you can use the following command:

# Run all tests in a single file
composer behat features/some-feature.feature

# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123

You can find a list of all available Behat steps in our handbook.

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 5ff6fb8b-1f87-43b5-b38d-4717288b12ed

📥 Commits

Reviewing files that changed from the base of the PR and between 8b288e9 and 649f5cf.

📒 Files selected for processing (2)
  • features/plugin-list-wporg-status.feature
  • src/Plugin_Command.php

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The WordPress.org plugin fixture now uses valid JSON. get_wporg_data now returns closed for responses that identify a closed plugin and active otherwise.

Changes

Closed plugin status

Layer / File(s) Summary
Parse closed plugin responses
features/plugin-list-wporg-status.feature, src/Plugin_Command.php
The fixture quotes all JSON keys. get_wporg_data detects the closed field and error: "closed" response and sets the plugin status accordingly.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: swissspidy

Merge Risk: ⚪ Minimal · up to 649f5

The change correctly reports closed plugins while preserving requested last-updated data and API fallback behavior.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: detecting closed WordPress.org plugins.
Linked Issues check ✅ Passed The changes satisfy #549. The fixture now uses quoted JSON keys and is valid JSON. get_wporg_data() now maps decoded API responses with error: "closed" or closed: true to closed. The feature v…
Out of Scope Changes check ✅ Passed The reviewed changes are limited to features/plugin-list-wporg-status.feature and src/Plugin_Command.php. Both changes directly support #549 by correcting the fixture and implementing closed-plugi…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 …
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved review issues were identified.

Pull request overview

Fixes WordPress.org closed-plugin detection while preserving Trac-based update lookups.

Changes:

  • Detects error: "closed" and closed: true responses.
  • Corrects the closed-plugin fixture JSON.
  • Preserves wporg_last_updated handling.
File summaries
File Description
src/Plugin_Command.php Detects closed plugin API responses.
features/plugin-list-wporg-status.feature Uses valid JSON and verifies closed status.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

Labels

bug command:plugin-list Related to 'plugin list' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Closed-plugin fixture in plugin-list-wporg-status.feature is not valid JSON

2 participants