Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions features/plugin-list-wporg-status.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ Feature: Check the status of plugins on WordPress.org
Content-Type: application/json

{
error: "closed",
name: "No Longer in Directory",
slug: "no-longer-in-directory",
description: "This plugin has been closed as of October 2, 2018 and is not available for download. This closure is permanent. Reason: Guideline Violation.",
closed: true,
closed_date: "2018-10-02",
reason: "guideline-violation",
reason_text: "Guideline Violation"
"error": "closed",
"name": "No Longer in Directory",
"slug": "no-longer-in-directory",
"description": "This plugin has been closed as of October 2, 2018 and is not available for download. This closure is permanent. Reason: Guideline Violation.",
"closed": true,
"closed_date": "2018-10-02",
"reason": "guideline-violation",
"reason_text": "Guideline Violation"
}
"""
And that HTTP requests to https://plugins.trac.wordpress.org/log/wordpress-importer/?limit=1&mode=stop_on_copy&format=rss will respond with:
Expand Down
9 changes: 7 additions & 2 deletions src/Plugin_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -1124,9 +1124,14 @@ protected function get_wporg_data( $plugin_name ) {
$plugin_data = false;
}
if ( $plugin_data ) {
$data['status'] = 'active';
if ( ! empty( $plugin_data['closed'] ) || ( isset( $plugin_data['error'] ) && 'closed' === $plugin_data['error'] ) ) {
$data['status'] = 'closed';
} else {
$data['status'] = 'active';
}

if ( ! $this->check_wporg['last_updated'] ) {
return $data; // The plugin is active on .org, but we don't need the date.
return $data; // The plugin is active or closed on .org, but we don't need the date.
}
}
// Just because the plugin is not in the api, does not mean it was never on .org.
Expand Down