Skip to content

Commit

Permalink
# [HIGH] Cannot connect to old Akeeba Backup for WordPress (version 7)
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas K. Dionysopoulos <nicholas@akeeba.com>
  • Loading branch information
nikosdion committed Sep 8, 2024
1 parent 56c18ac commit f7d030f
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 37 additions & 6 deletions languages/panopticon.pot
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -3817,6 +3817,16 @@ msgctxt "PANOPTICON_SITE_LBL_JUPDATE_HEAD"
msgid "Joomla!&reg; 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!&reg; it is running on."
msgstr ""

#, phpformat
msgctxt "PANOPTICON_SITE_BTN_JUPDATE_RELOAD"
msgid "Reload Joomla!&reg; Update information"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ""

19 changes: 12 additions & 7 deletions src/Controller/Trait/AkeebaBackupIntegrationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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(
Expand Down Expand Up @@ -368,10 +377,6 @@ function (Throwable $e)
}
);
}
catch (Throwable)
{
return false;
}
finally
{
$db->unlockTables();
Expand Down
20 changes: 17 additions & 3 deletions src/Model/Trait/AkeebaBackupIntegrationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f7d030f

Please sign in to comment.