From 649f5cfee607e01524f560cc1efb403f3403c6e7 Mon Sep 17 00:00:00 2001 From: AnuragR3k Date: Sat, 12 Sep 2026 11:25:30 +0530 Subject: [PATCH] fix: detect closed WordPress.org plugins --- features/plugin-list-wporg-status.feature | 16 ++++++++-------- src/Plugin_Command.php | 9 +++++++-- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/features/plugin-list-wporg-status.feature b/features/plugin-list-wporg-status.feature index 1da8360f..a6e94c7f 100644 --- a/features/plugin-list-wporg-status.feature +++ b/features/plugin-list-wporg-status.feature @@ -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: diff --git a/src/Plugin_Command.php b/src/Plugin_Command.php index 00505984..a9bea313 100644 --- a/src/Plugin_Command.php +++ b/src/Plugin_Command.php @@ -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.