You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Closed-plugin fixture in plugin-list-wporg-status.feature is not valid JSON #549
features/plugin-list-wporg-status.feature:32-41 mocks the plugin-info API response for no-longer-in-directory with unquoted keys:
{
error: "closed",
name: "No Longer in Directory",
...
}
That is not JSON. WpOrgApi::get_plugin_info() runs json_decode() and throws on the decode error (wp-cli/php/WP_CLI/WpOrgApi.php:311-314), so get_wporg_data() lands in the catch at src/Plugin_Command.php:1126 and marks the plugin closed only because the trac request is not a 404 (:1140-1141). The scenario therefore tests the "API request failed" path, not a real closure response.
The real API answers a closed plugin with HTTP 200 and a body like {"error":"closed","name":"...","closed":true,"closed_date":"2018-10-02","reason":"guideline-violation"}. get_wporg_data() treats any decoded body as active (:1129), so with a valid fixture the scenario would report active for a closed plugin.
Two things to do:
Quote the keys in the fixture so it is valid JSON.
Make get_wporg_data() recognise error: "closed" (or closed: true) in a decoded response and return closed without the trac round trip. Keep the trac fallback covered by a separate scenario where the API is unreachable.
Activity
AnuragR3k commentedon Sep 12, 2026
@schlessera Hi, I worked on this issue and created PR #550 with the fix. could u please take a look when you get a chance? Thank you :