From 8a1a779f00ebc47a1054c81f9bf67441cbc5d93e Mon Sep 17 00:00:00 2001 From: Marco Rocca Date: Fri, 12 Mar 2021 00:10:50 +0100 Subject: [PATCH] Fixed wrong call to inexistent property --- Puc/v4p10/Plugin/Ui.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Puc/v4p10/Plugin/Ui.php b/Puc/v4p10/Plugin/Ui.php index 1ff18d6..1e8de2b 100644 --- a/Puc/v4p10/Plugin/Ui.php +++ b/Puc/v4p10/Plugin/Ui.php @@ -156,8 +156,9 @@ if ( !class_exists('Puc_v4p10_Plugin_Ui', false) ): if ( $shouldCheck ) { $update = $this->updateChecker->checkForUpdates(); $status = ($update === null) ? 'no_update' : 'update_available'; + $lastRequestApiErrors = $this->updateChecker->getLastRequestApiErrors(); - if ( ($update === null) && !empty($this->lastRequestApiErrors) ) { + if ( ($update === null) && !empty($lastRequestApiErrors) ) { //Some errors are not critical. For example, if PUC tries to retrieve the readme.txt //file from GitHub and gets a 404, that's an API error, but it doesn't prevent updates //from working. Maybe the plugin simply doesn't have a readme. @@ -169,7 +170,7 @@ if ( !class_exists('Puc_v4p10_Plugin_Ui', false) ): 'puc-bitbucket-http-error', ); - foreach ($this->lastRequestApiErrors as $item) { + foreach ($lastRequestApiErrors as $item) { $wpError = $item['error']; /** @var WP_Error $wpError */ if ( !in_array($wpError->get_error_code(), $questionableErrorCodes) ) { @@ -180,7 +181,7 @@ if ( !class_exists('Puc_v4p10_Plugin_Ui', false) ): if ( $foundCriticalErrors ) { $status = 'error'; - set_site_transient($this->manualCheckErrorTransient, $this->lastRequestApiErrors, 60); + set_site_transient($this->manualCheckErrorTransient, $lastRequestApiErrors, 60); } }