Skip to content

Commit

Permalink
# [HIGH] PHP error when WordPress fails to provide version information
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 421f85d commit 56c18ac
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 6 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] PHP error when WordPress fails to provide version information

Akeeba Panopticon 1.2.2
================================================================================
Expand Down
12 changes: 11 additions & 1 deletion ViewTemplates/Sites/item_joomlaupdate.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,17 @@
@stop

@section('jUpdateStatus')
@if(!$this->siteConfig->get('core.extensionAvailable', true))
@if (empty($currentVersion))
<div class="alert alert-danger">
<h4 class="alert alert-heading h5 p-0">
<span class="fab fa-joomla d-none d-md-inline" aria-hidden="true"></span>
@lang('PANOPTICON_SITE_LBL_JUPDATE_NO_VERSION_HEAD')
</h4>
<p>
@lang('PANOPTICON_SITE_LBL_JUPDATE_NO_VERSION_BODY')
</p>
</div>
@elseif(!$this->siteConfig->get('core.extensionAvailable', true))
<div class="alert alert-danger">
<h4 class="alert-heading h6">
<span class="fa fa-xmark-circle" aria-hidden="true"></span>
Expand Down
13 changes: 11 additions & 2 deletions ViewTemplates/Sites/item_php.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
$minimumSupportedBranch = $phpVersion?->getMinimumSupportedBranch();
$isUnknown = $versionInfo?->unknown;
$isOutOfDate = $versionInfo?->eol;
$isLatestVersionInBranch = version_compare($php, $latestVersionInBranch, 'ge');
$isLatestVersionInBranch = version_compare($php, $latestVersionInBranch ?? '0.0.0', 'ge');
$isLatestBranch = $phpBranch === $phpVersion->getLatestBranch();
$isRecommendedBranch = $phpBranch === $phpVersion->getRecommendedSupportedBranch();
$isOldestBranch = $phpBranch === $minimumSupportedBranch;
Expand Down Expand Up @@ -57,7 +57,16 @@
</div>

{{-- PHP Status --}}
@if($isUnknown)
@if($php === '0.0.0' || $php === null)
<div class="alert alert-info">
<h3 class="alert-heading h5 m-0 mb-2">
<span class="fa fa-question-circle" aria-hidden="true"></span>
@lang('PANOPTICON_SITE_LBL_PHP_MISSING')
</h3>

@lang('PANOPTICON_SITE_LBL_PHP_MISSING_INFO')
</div>
@elseif($isUnknown)
<div class="alert alert-info">
<h3 class="alert-heading h5 m-0 mb-2">
<span class="fa fa-question-circle" aria-hidden="true"></span>
Expand Down
16 changes: 13 additions & 3 deletions ViewTemplates/Sites/item_wpupdate.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,20 @@
@stop

@section('wpUpdateStatus')
@if ($this->siteConfig->get('core.canUpgrade', false))
@if (empty($currentVersion))
<div class="alert alert-danger">
<h4 class="alert alert-heading h5 p-0">
<span class="fab fa-wordpress d-none d-md-inline" aria-hidden="true"></span>
@lang('PANOPTICON_SITE_LBL_WPUPDATE_NO_VERSION_HEAD')
</h4>
<p>
@lang('PANOPTICON_SITE_LBL_WPUPDATE_NO_VERSION_BODY')
</p>
</div>
@elseif ($this->siteConfig->get('core.canUpgrade', false))
<div class="alert alert-warning">
<h4 class="alert alert-heading h5 p-0">
<span class="fab fa-joomla d-none d-md-inline" aria-hidden="true"></span>
<span class="fab fa-wordpress d-none d-md-inline" aria-hidden="true"></span>
@sprintf('PANOPTICON_SITE_LBL_WPUPDATE_AVAILABLE_UPDATE', $this->escape($latestVersion))
</h4>
<p class="mb-1">
Expand Down Expand Up @@ -221,7 +231,7 @@ class="btn btn-outline-danger" role="button">

<div class="card">
<h3 class="card-header h4 d-flex flex-row gap-1 align-items-center">
<span class="fab fa-joomla d-none d-md-inline" aria-hidden="true"></span>
<span class="fab fa-wordpress d-none d-md-inline" aria-hidden="true"></span>
<span class="flex-grow-1">@lang('PANOPTICON_SITE_LBL_WPUPDATE_HEAD')</span>
<a class="btn btn-outline-secondary btn-sm" role="button"
href="@route(sprintf('index.php?view=site&task=refreshSiteInformation&id=%d&%s=1', $this->item->id, $token))"
Expand Down
6 changes: 6 additions & 0 deletions languages/en-GB.ini
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,8 @@ PANOPTICON_SITE_ERR_JUPDATE_SCHEDULE_FAILED="Scheduling the Joomla core update h
PANOPTICON_SITE_LBL_JUPDATE_SCHEDULE_ERROR_CLEARED="The scheduling error has been cleared."
PANOPTICON_SITE_LBL_JUPDATE_SCHEDULE_ERROR_NOT_CLEARED="The scheduling error could not be cleared: %s"
PANOPTICON_SITE_LBL_JUPDATE_HEAD="Joomla!&reg; Update"
PANOPTICON_SITE_LBL_JUPDATE_NO_VERSION_HEAD="Version information missing"
PANOPTICON_SITE_LBL_JUPDATE_NO_VERSION_BODY="Your site has not reported the version of Joomla!&reg; it is running on."
PANOPTICON_SITE_BTN_JUPDATE_RELOAD="Reload Joomla!&reg; Update information"
PANOPTICON_SITE_BTN_JUPDATE_RELOAD_SR="Reload Joomla!&reg; Update information for site “%s”"
PANOPTICON_SITE_LBL_JUPDATE_LAST_CHECKED="Last checked:"
Expand Down Expand Up @@ -854,6 +856,8 @@ PANOPTICON_SITE_LBL_WPUPDATE_UNSCHEDULE_ERR_NOT_SCHEDULED="There is no scheduled
PANOPTICON_SITE_LBL_WPUPDATE_UNSCHEDULE_ERR_RUNNING="The scheduled update is already running."
PANOPTICON_SITE_ERR_WPUPDATE_UNSCHEDULE_FAILED="Could not cancel the WordPress core update."
PANOPTICON_SITE_LBL_WPUPDATE_HEAD="WordPress Update"
PANOPTICON_SITE_LBL_WPUPDATE_NO_VERSION_HEAD="Version information missing"
PANOPTICON_SITE_LBL_WPUPDATE_NO_VERSION_BODY="Your site has not reported the version of WordPress it is running on."
PANOPTICON_SITE_LBL_WPUPDATE_AVAILABLE_UPDATE="WordPress %s is available"
PANOPTICON_SITE_LBL_WPUPDATE_CURRENT_VERSION="Your site is currently using WordPress %s."
PANOPTICON_SITE_LBL_WPUPDATE_IS_PATCH_RELEASE="This is a patch (point) update which is almost always safe."
Expand Down Expand Up @@ -889,6 +893,8 @@ PANOPTICON_SITE_LBL_PHP_HEAD="PHP"
PANOPTICON_SITE_BTN_PHP_RELOAD="Reload PHP Information"
PANOPTICON_SITE_BTN_EXTENSIONS_RELOAD="Reload Extensions Information"
PANOPTICON_SITE_BTN_EXTENSIONS_RELOAD_SR="Reload Extensions Information for site “%s”"
PANOPTICON_SITE_LBL_PHP_MISSING="PHP version information missing"
PANOPTICON_SITE_LBL_PHP_MISSING_INFO="Your site has not reported the version of PHP it is running on."
PANOPTICON_SITE_LBL_PHP_UNKNOWN="Unknown PHP %s"
PANOPTICON_SITE_LBL_PHP_UNKNOWN_INFO="Your version of PHP is not known to Panopticon. Try clearing the <code>cache</code> folder."
PANOPTICON_SITE_LBL_PHP_EOL="End-of-Life PHP %s"
Expand Down

0 comments on commit 56c18ac

Please sign in to comment.