# servebolt-optimizer/trunk/php-outdated.php

Servebolt Optimizer, version trunk. 29 lines.

- Page: https://pluginprobe.com/plugins/servebolt-optimizer/trunk/code/php-outdated.php
- Raw: https://pluginprobe.com/plugins/servebolt-optimizer/trunk/raw/php-outdated.php
- Modified: 2021-07-01T13:29:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/servebolt-optimizer/trunk/code/php-outdated.php#L10-L20`.

```php
<?php

if (!defined('ABSPATH')) exit; // Exit if accessed directly

require_once SERVEBOLT_PLUGIN_PSR4_PATH . 'Helpers/Helpers.php';
use function Servebolt\Optimizer\Helpers\isHostedAtServebolt;

/**
 * Display notice about PHP being too outdated.
 */
add_action('admin_notices', function() {
    if (isHostedAtServebolt()) {
        // Warning for Servebolt users, and help to upgrade the PHP version
        ?>
        <div class="notice notice-error is-dismissable">
            <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>
            <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>
        </div>
        <?php
    } else {
        // Warning for non-Servebolt users
        ?>
        <div class="notice notice-error is-dismissable">
            <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>
        </div>
        <?php
    }
});

```
