From e4bd332dfaa06723c5808581d6c75e47ae6ab177 Mon Sep 17 00:00:00 2001 From: Malay Ladu Date: Wed, 12 Jan 2022 15:59:50 +0530 Subject: [PATCH 1/2] [view-details] Removed `newer_than` parameter value to get the latest available details. --- includes/class-fs-plugin-updater.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-fs-plugin-updater.php b/includes/class-fs-plugin-updater.php index 3f76f335..4f7a1361 100755 --- a/includes/class-fs-plugin-updater.php +++ b/includes/class-fs-plugin-updater.php @@ -1080,7 +1080,7 @@ function plugins_api_filter( $data, $action = '', $args = null ) { $this->_fs->get_plugin_version(); // Get plugin's newest update. - $new_version = $this->get_latest_download_details( $is_addon ? $addon->id : false, $plugin_version ); + $new_version = $this->get_latest_download_details( $is_addon ? $addon->id : false ); if ( ! is_object( $new_version ) || empty( $new_version->version ) ) { $data->version = $plugin_version; From 8d56dce78cf5434d91d2374aa4ec70ad615a9107 Mon Sep 17 00:00:00 2001 From: Malay Ladu Date: Mon, 31 Jan 2022 13:29:57 +0530 Subject: [PATCH 2/2] [view-details] Improved logic to make an API call when it requires. --- includes/class-fs-plugin-updater.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/includes/class-fs-plugin-updater.php b/includes/class-fs-plugin-updater.php index 4f7a1361..cc13c64f 100755 --- a/includes/class-fs-plugin-updater.php +++ b/includes/class-fs-plugin-updater.php @@ -1079,8 +1079,15 @@ function plugins_api_filter( $data, $action = '', $args = null ) { $addon_version : $this->_fs->get_plugin_version(); - // Get plugin's newest update. - $new_version = $this->get_latest_download_details( $is_addon ? $addon->id : false ); + // Get plugin's newest update. If it's a view details request, we want the latest available readme information not necessary the latest available version is newer than the current version. + if ( + 'plugin-information' === fs_request_get( 'tab', false ) && + $this->_fs->get_slug() === fs_request_get('plugin', false) + ) { + $new_version = $this->get_latest_download_details( $is_addon ? $addon->id : false ); + } + else + $new_version = $this->get_latest_download_details( $is_addon ? $addon->id : false, $plugin_version ); if ( ! is_object( $new_version ) || empty( $new_version->version ) ) { $data->version = $plugin_version;