From f7d030f4625e1c1fd46274f0075ad702f1ca2a47 Mon Sep 17 00:00:00 2001 From: "Nicholas K. Dionysopoulos" Date: Sun, 8 Sep 2024 22:15:01 +0300 Subject: [PATCH] # [HIGH] Cannot connect to old Akeeba Backup for WordPress (version 7) Signed-off-by: Nicholas K. Dionysopoulos --- CHANGELOG | 1 + languages/panopticon.pot | 43 ++++++++++++++++--- .../Trait/AkeebaBackupIntegrationTrait.php | 19 +++++--- .../Trait/AkeebaBackupIntegrationTrait.php | 20 +++++++-- 4 files changed, 67 insertions(+), 16 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 00a39ce7..577f6b72 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ Akeeba Panopticon 1.2.3 ================================================================================ # [HIGH] Cannot connect to really old WordPress installations (WordPress 5.5 and earlier) +# [HIGH] Cannot connect to old Akeeba Backup for WordPress (version 7) # [HIGH] PHP error when WordPress fails to provide version information Akeeba Panopticon 1.2.2 diff --git a/languages/panopticon.pot b/languages/panopticon.pot index a9f2f1d6..de84dcdd 100644 --- a/languages/panopticon.pot +++ b/languages/panopticon.pot @@ -1,11 +1,11 @@ msgid "" msgstr "" -"Project-Id-Version: 1.2.2-dev202408130807\n" -"POT-Creation-Date: 2024-08-13 13:58:54\n" +"Project-Id-Version: 1.2.2\n" +"POT-Creation-Date: 2024-09-08 15:17:28\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Panopticon ini_to_po 1.2.2-dev202408130807\n" +"X-Generator: Panopticon ini_to_po 1.2.2\n" #, phpformat msgctxt "LANGUAGE_NAME_IN_ENGLISH" @@ -3817,6 +3817,16 @@ msgctxt "PANOPTICON_SITE_LBL_JUPDATE_HEAD" msgid "Joomla!® Update" msgstr "" +#, phpformat +msgctxt "PANOPTICON_SITE_LBL_JUPDATE_NO_VERSION_HEAD" +msgid "Version information missing" +msgstr "" + +#, phpformat +msgctxt "PANOPTICON_SITE_LBL_JUPDATE_NO_VERSION_BODY" +msgid "Your site has not reported the version of Joomla!® it is running on." +msgstr "" + #, phpformat msgctxt "PANOPTICON_SITE_BTN_JUPDATE_RELOAD" msgid "Reload Joomla!® Update information" @@ -4097,6 +4107,16 @@ msgctxt "PANOPTICON_SITE_LBL_WPUPDATE_HEAD" msgid "WordPress Update" msgstr "" +#, phpformat +msgctxt "PANOPTICON_SITE_LBL_WPUPDATE_NO_VERSION_HEAD" +msgid "Version information missing" +msgstr "" + +#, phpformat +msgctxt "PANOPTICON_SITE_LBL_WPUPDATE_NO_VERSION_BODY" +msgid "Your site has not reported the version of WordPress it is running on." +msgstr "" + #, phpformat msgctxt "PANOPTICON_SITE_LBL_WPUPDATE_AVAILABLE_UPDATE" msgid "WordPress %s is available" @@ -4267,6 +4287,16 @@ msgctxt "PANOPTICON_SITE_BTN_EXTENSIONS_RELOAD_SR" msgid "Reload Extensions Information for site ā€œ%sā€" msgstr "" +#, phpformat +msgctxt "PANOPTICON_SITE_LBL_PHP_MISSING" +msgid "PHP version information missing" +msgstr "" + +#, phpformat +msgctxt "PANOPTICON_SITE_LBL_PHP_MISSING_INFO" +msgid "Your site has not reported the version of PHP it is running on." +msgstr "" + #, phpformat msgctxt "PANOPTICON_SITE_LBL_PHP_UNKNOWN" msgid "Unknown PHP %s" @@ -7344,17 +7374,17 @@ msgstr "" #, phpformat msgctxt "PANOPTICON_LBL_USER_SAVED" -msgid "The user account has been saved." +msgid "The user account has been saved" msgstr "" #, phpformat msgctxt "PANOPTICON_LBL_USER_DELETED" -msgid "The user account has been deleted." +msgid "The user account has been deleted" msgstr "" #, phpformat msgctxt "PANOPTICON_LBL_USER_COPIED" -msgid "The user account has been copied." +msgid "The user account has been copied" msgstr "" #, phpformat @@ -9846,3 +9876,4 @@ msgstr "" msgctxt "PANOPTICON_SYSERROR_LEAKED_PASSWORD" msgid "The password you are trying to use is present in online password leaks, making it very easy for hackers to guess this is what you are using. Please use a different password." msgstr "" + diff --git a/src/Controller/Trait/AkeebaBackupIntegrationTrait.php b/src/Controller/Trait/AkeebaBackupIntegrationTrait.php index 9212ebee..fa8de4e3 100644 --- a/src/Controller/Trait/AkeebaBackupIntegrationTrait.php +++ b/src/Controller/Trait/AkeebaBackupIntegrationTrait.php @@ -7,7 +7,6 @@ namespace Akeeba\Panopticon\Controller\Trait; -use Akeeba\Panopticon\Library\Cache\CallbackController; use Akeeba\Panopticon\Model\Reports; use Akeeba\Panopticon\Model\Site; use Awf\Uri\Uri; @@ -31,9 +30,19 @@ public function akeebaBackupRelink(): bool return false; } - if (!$this->akeebaBackupRelinkInternal($id)) + try { - return false; + if (!$this->akeebaBackupRelinkInternal($id)) + { + return false; + } + } + catch (Throwable $e) + { + $this->setRedirectWithMessage( + $this->container->router->route(sprintf('index.php?view=site&task=read&id=%d&akeebaBackupForce=1', $id)), + $e->getMessage() + ); } $this->setRedirectWithMessage( @@ -368,10 +377,6 @@ function (Throwable $e) } ); } - catch (Throwable) - { - return false; - } finally { $db->unlockTables(); diff --git a/src/Model/Trait/AkeebaBackupIntegrationTrait.php b/src/Model/Trait/AkeebaBackupIntegrationTrait.php index a98ae04f..758864c9 100644 --- a/src/Model/Trait/AkeebaBackupIntegrationTrait.php +++ b/src/Model/Trait/AkeebaBackupIntegrationTrait.php @@ -227,14 +227,28 @@ function (bool $carry, $key) use ($info, $currentInfo) { $httpClient = new HttpClientGuzzle($options); $apiClient = new Connector($httpClient); + $foundConfig = false; try { - $apiClient->autodetect(); + $apiClient->information(); + $foundConfig = true; } - catch (Throwable) + catch (Exception $e) { - continue; + // Nothing + } + + if (!$foundConfig) + { + try + { + $apiClient->autodetect(); + } + catch (Throwable) + { + continue; + } } $newEndpointConfiguration = (object) $httpClient->getOptions()->toArray();