| 1 |
<?php |
| 2 |
|
| 3 |
if (!defined('ABSPATH')) exit; // Exit if accessed directly |
| 4 |
|
| 5 |
require_once SERVEBOLT_PLUGIN_PSR4_PATH . 'Helpers/Helpers.php'; |
| 6 |
use function Servebolt\Optimizer\Helpers\isHostedAtServebolt; |
| 7 |
|
| 8 |
/** |
| 9 |
* Display notice about PHP being too outdated. |
| 10 |
*/ |
| 11 |
add_action('admin_notices', function() { |
| 12 |
if (isHostedAtServebolt()) { |
| 13 |
// Warning for Servebolt users, and help to upgrade the PHP version |
| 14 |
?> |
| 15 |
<div class="notice notice-error is-dismissable"> |
| 16 |
<p><?php printf(__('This site is running on a lower PHP version than required by the Servebolt Optimizer plugin. Please upgrade your site to run PHP %s or higher. We highly recommend upgrading to the highest available PHP version.', 'servebolt-wp'), SERVEBOLT_PLUGIN_MINIMUM_PHP_VERSION); ?></p> |
| 17 |
<p><?php printf(__('%sGet in touch with our support%s if you need assistance upgrading your site to a newer PHP version.', 'servebolt-wp'), '<a href="https://admin.servebolt.com/" target="_blank">', '</a>'); ?></p> |
| 18 |
</div> |
| 19 |
<?php |
| 20 |
} else { |
| 21 |
// Warning for non-Servebolt users |
| 22 |
?> |
| 23 |
<div class="notice notice-error is-dismissable"> |
| 24 |
<p><?php printf(__('Servebolt Optimizer cannot run on PHP-versions older than PHP %s. You currently run PHP version %s. Please upgrade your PHP version to be able to run Servebolt Optimizer.', 'servebolt-wp'), SERVEBOLT_PLUGIN_MINIMUM_PHP_VERSION, phpversion()); ?></p> |
| 25 |
</div> |
| 26 |
<?php |
| 27 |
} |
| 28 |
}); |
| 29 |
|