wp_dashboard_php_nag

The timeline below displays how wordpress function wp_dashboard_php_nag has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.3

/**
 * Displays the PHP update nag.
 *
 * @since 5.1.0
 */
function wp_dashboard_php_nag()
{
    $response = wp_check_php_version();
    if (!$response) {
        return;
    }
    if (isset($response['is_secure']) && !$response['is_secure']) {
        // The `is_secure` array key name doesn't actually imply this is a secure version of PHP. It only means it receives security updates.
        if ($response['is_lower_than_future_minimum']) {
            $message = sprintf(
                /* translators: %s: The server PHP version. */
                __('Your site is running on an outdated version of PHP (%s), which does not receive security updates and soon will not be supported by WordPress. Ensure that PHP is updated on your server as soon as possible. Otherwise you will not be able to upgrade WordPress.'),
                PHP_VERSION
            );
        } else {
            $message = sprintf(
                /* translators: %s: The server PHP version. */
                __('Your site is running on an outdated version of PHP (%s), which does not receive security updates. It should be updated.'),
                PHP_VERSION
            );
        }
    } elseif ($response['is_lower_than_future_minimum']) {
        $message = sprintf(
            /* translators: %s: The server PHP version. */
            __('Your site is running on an outdated version of PHP (%s), which soon will not be supported by WordPress. Ensure that PHP is updated on your server as soon as possible. Otherwise you will not be able to upgrade WordPress.'),
            PHP_VERSION
        );
    } else {
        $message = sprintf(
            /* translators: %s: The server PHP version. */
            __('Your site is running on an outdated version of PHP (%s), which should be updated.'),
            PHP_VERSION
        );
    }
    ?>
	<p class="bigger-bolder-text"><?php 
    echo $message;
    ?></p>

	<p><?php 
    _e('What is PHP and how does it affect my site?');
    ?></p>
	<p>
		<?php 
    _e('PHP is one of the programming languages used to build WordPress. Newer versions of PHP receive regular security updates and may increase your site&#8217;s performance.');
    ?>
		<?php 
    if (!empty($response['recommended_version'])) {
        printf(
            /* translators: %s: The minimum recommended PHP version. */
            __('The minimum recommended version of PHP is %s.'),
            $response['recommended_version']
        );
    }
    ?>
	</p>

	<p class="button-container">
		<?php 
    printf(
        '<a class="button button-primary" href="%1$s" target="_blank" rel="noopener">%2$s<span class="screen-reader-text"> %3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
        esc_url(wp_get_update_php_url()),
        __('Learn more about updating PHP'),
        /* translators: Hidden accessibility text. */
        __('(opens in a new tab)')
    );
    ?>
	</p>
	<?php 
    wp_update_php_annotation();
    wp_direct_php_update_button();
}

WordPress Version: 6.2

/**
 * Displays the PHP update nag.
 *
 * @since 5.1.0
 */
function wp_dashboard_php_nag()
{
    $response = wp_check_php_version();
    if (!$response) {
        return;
    }
    if (isset($response['is_secure']) && !$response['is_secure']) {
        // The `is_secure` array key name doesn't actually imply this is a secure version of PHP. It only means it receives security updates.
        if ($response['is_lower_than_future_minimum']) {
            $message = sprintf(
                /* translators: %s: The server PHP version. */
                __('Your site is running on an outdated version of PHP (%s), which does not receive security updates and soon will not be supported by WordPress. Ensure that PHP is updated on your server as soon as possible. Otherwise you will not be able to upgrade WordPress.'),
                PHP_VERSION
            );
        } else {
            $message = sprintf(
                /* translators: %s: The server PHP version. */
                __('Your site is running on an outdated version of PHP (%s), which does not receive security updates. It should be updated.'),
                PHP_VERSION
            );
        }
    } elseif ($response['is_lower_than_future_minimum']) {
        $message = sprintf(
            /* translators: %s: The server PHP version. */
            __('Your site is running on an outdated version of PHP (%s), which soon will not be supported by WordPress. Ensure that PHP is updated on your server as soon as possible. Otherwise you will not be able to upgrade WordPress.'),
            PHP_VERSION
        );
    } else {
        $message = sprintf(
            /* translators: %s: The server PHP version. */
            __('Your site is running on an outdated version of PHP (%s), which should be updated.'),
            PHP_VERSION
        );
    }
    ?>
	<p class="bigger-bolder-text"><?php 
    echo $message;
    ?></p>

	<p><?php 
    _e('What is PHP and how does it affect my site?');
    ?></p>
	<p>
		<?php 
    _e('PHP is one of the programming languages used to build WordPress. Newer versions of PHP receive regular security updates and may increase your site&#8217;s performance.');
    ?>
		<?php 
    if (!empty($response['recommended_version'])) {
        printf(
            /* translators: %s: The minimum recommended PHP version. */
            __('The minimum recommended version of PHP is %s.'),
            $response['recommended_version']
        );
    }
    ?>
	</p>

	<p class="button-container">
		<?php 
    printf(
        '<a class="button button-primary" href="%1$s" target="_blank" rel="noopener">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
        esc_url(wp_get_update_php_url()),
        __('Learn more about updating PHP'),
        /* translators: Hidden accessibility text. */
        __('(opens in a new tab)')
    );
    ?>
	</p>
	<?php 
    wp_update_php_annotation();
    wp_direct_php_update_button();
}

WordPress Version: 6.1

/**
 * Displays the PHP update nag.
 *
 * @since 5.1.0
 */
function wp_dashboard_php_nag()
{
    $response = wp_check_php_version();
    if (!$response) {
        return;
    }
    if (isset($response['is_secure']) && !$response['is_secure']) {
        // The `is_secure` array key name doesn't actually imply this is a secure version of PHP. It only means it receives security updates.
        if ($response['is_lower_than_future_minimum']) {
            $message = sprintf(
                /* translators: %s: The server PHP version. */
                __('Your site is running on an outdated version of PHP (%s), which does not receive security updates and soon will not be supported by WordPress. Ensure that PHP is updated on your server as soon as possible. Otherwise you will not be able to upgrade WordPress.'),
                PHP_VERSION
            );
        } else {
            $message = sprintf(
                /* translators: %s: The server PHP version. */
                __('Your site is running on an outdated version of PHP (%s), which does not receive security updates. It should be updated.'),
                PHP_VERSION
            );
        }
    } elseif ($response['is_lower_than_future_minimum']) {
        $message = sprintf(
            /* translators: %s: The server PHP version. */
            __('Your site is running on an outdated version of PHP (%s), which soon will not be supported by WordPress. Ensure that PHP is updated on your server as soon as possible. Otherwise you will not be able to upgrade WordPress.'),
            PHP_VERSION
        );
    } else {
        $message = sprintf(
            /* translators: %s: The server PHP version. */
            __('Your site is running on an outdated version of PHP (%s), which should be updated.'),
            PHP_VERSION
        );
    }
    ?>
	<p class="bigger-bolder-text"><?php 
    echo $message;
    ?></p>

	<p><?php 
    _e('What is PHP and how does it affect my site?');
    ?></p>
	<p>
		<?php 
    _e('PHP is one of the programming languages used to build WordPress. Newer versions of PHP receive regular security updates and may increase your site&#8217;s performance.');
    ?>
		<?php 
    if (!empty($response['recommended_version'])) {
        printf(
            /* translators: %s: The minimum recommended PHP version. */
            __('The minimum recommended version of PHP is %s.'),
            $response['recommended_version']
        );
    }
    ?>
	</p>

	<p class="button-container">
		<?php 
    printf(
        '<a class="button button-primary" href="%1$s" target="_blank" rel="noopener">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
        esc_url(wp_get_update_php_url()),
        __('Learn more about updating PHP'),
        /* translators: Accessibility text. */
        __('(opens in a new tab)')
    );
    ?>
	</p>
	<?php 
    wp_update_php_annotation();
    wp_direct_php_update_button();
}

WordPress Version: 6.1

/**
 * Displays the PHP update nag.
 *
 * @since 5.1.0
 */
function wp_dashboard_php_nag()
{
    $response = wp_check_php_version();
    if (!$response) {
        return;
    }
    if (isset($response['is_secure']) && !$response['is_secure']) {
        $msg = sprintf(
            /* translators: %s: The server PHP version. */
            __('Your site is running an insecure version of PHP (%s), which should be updated.'),
            PHP_VERSION
        );
    } else {
        $msg = sprintf(
            /* translators: %s: The server PHP version. */
            __('Your site is running an outdated version of PHP (%s), which should be updated.'),
            PHP_VERSION
        );
    }
    ?>
	<p><?php 
    echo $msg;
    ?></p>

	<h3><?php 
    _e('What is PHP and how does it affect my site?');
    ?></h3>
	<p>
		<?php 
    printf(
        /* translators: %s: The minimum recommended PHP version. */
        __('PHP is the programming language used to build and maintain WordPress. Newer versions of PHP are created with increased performance in mind, so you may see a positive effect on your site&#8217;s performance. The minimum recommended version of PHP is %s.'),
        $response ? $response['recommended_version'] : ''
    );
    ?>
	</p>

	<p class="button-container">
		<?php 
    printf(
        '<a class="button button-primary" href="%1$s" target="_blank" rel="noopener">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
        esc_url(wp_get_update_php_url()),
        __('Learn more about updating PHP'),
        /* translators: Accessibility text. */
        __('(opens in a new tab)')
    );
    ?>
	</p>
	<?php 
    wp_update_php_annotation();
    wp_direct_php_update_button();
}

WordPress Version: 5.6

/**
 * Displays the PHP update nag.
 *
 * @since 5.1.0
 */
function wp_dashboard_php_nag()
{
    $response = wp_check_php_version();
    if (!$response) {
        return;
    }
    if (isset($response['is_secure']) && !$response['is_secure']) {
        $msg = __('WordPress has detected that your site is running on an insecure version of PHP.');
    } else {
        $msg = __('WordPress has detected that your site is running on an outdated version of PHP.');
    }
    ?>
	<p><?php 
    echo $msg;
    ?></p>

	<h3><?php 
    _e('What is PHP and how does it affect my site?');
    ?></h3>
	<p><?php 
    _e('PHP is the programming language we use to build and maintain WordPress. Newer versions of PHP are both faster and more secure, so updating will have a positive effect on your site&#8217;s performance.');
    ?></p>

	<p class="button-container">
		<?php 
    printf(
        '<a class="button button-primary" href="%1$s" target="_blank" rel="noopener">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
        esc_url(wp_get_update_php_url()),
        __('Learn more about updating PHP'),
        /* translators: Accessibility text. */
        __('(opens in a new tab)')
    );
    ?>
	</p>
	<?php 
    wp_update_php_annotation();
    wp_direct_php_update_button();
}

WordPress Version: 5.3

/**
 * Displays the PHP update nag.
 *
 * @since 5.1.0
 */
function wp_dashboard_php_nag()
{
    $response = wp_check_php_version();
    if (!$response) {
        return;
    }
    if (isset($response['is_secure']) && !$response['is_secure']) {
        $msg = __('WordPress has detected that your site is running on an insecure version of PHP.');
    } else {
        $msg = __('WordPress has detected that your site is running on an outdated version of PHP.');
    }
    ?>
	<p><?php 
    echo $msg;
    ?></p>

	<h3><?php 
    _e('What is PHP and how does it affect my site?');
    ?></h3>
	<p><?php 
    _e('PHP is the programming language we use to build and maintain WordPress. Newer versions of PHP are both faster and more secure, so updating will have a positive effect on your site&#8217;s performance.');
    ?></p>

	<p class="button-container">
		<?php 
    printf(
        '<a class="button button-primary" href="%1$s" target="_blank" rel="noopener noreferrer">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
        esc_url(wp_get_update_php_url()),
        __('Learn more about updating PHP'),
        /* translators: Accessibility text. */
        __('(opens in a new tab)')
    );
    ?>
	</p>
	<?php 
    wp_update_php_annotation();
    wp_direct_php_update_button();
}

WordPress Version: .10

/**
 * Displays the PHP update nag.
 *
 * @since 5.1.0
 */
function wp_dashboard_php_nag()
{
    $response = wp_check_php_version();
    if (!$response) {
        return;
    }
    if (isset($response['is_secure']) && !$response['is_secure']) {
        $msg = __('WordPress has detected that your site is running on an insecure version of PHP.');
    } else {
        $msg = __('WordPress has detected that your site is running on an outdated version of PHP.');
    }
    ?>
	<p><?php 
    echo $msg;
    ?></p>

	<h3><?php 
    _e('What is PHP and how does it affect my site?');
    ?></h3>
	<p><?php 
    _e('PHP is the programming language we use to build and maintain WordPress. Newer versions of PHP are both faster and more secure, so updating will have a positive effect on your site&#8217;s performance.');
    ?></p>

	<p class="button-container">
		<?php 
    printf(
        '<a class="button button-primary" href="%1$s" target="_blank" rel="noopener noreferrer">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
        esc_url(wp_get_update_php_url()),
        __('Learn more about updating PHP'),
        /* translators: accessibility text */
        __('(opens in a new tab)')
    );
    ?>
	</p>
	<?php 
    wp_update_php_annotation();
    wp_direct_php_update_button();
}

WordPress Version: 1.1

/**
 * Displays the PHP update nag.
 *
 * @since 5.1.0
 */
function wp_dashboard_php_nag()
{
    $response = wp_check_php_version();
    if (!$response) {
        return;
    }
    if (isset($response['is_secure']) && !$response['is_secure']) {
        $msg = __('WordPress has detected that your site is running on an insecure version of PHP.');
    } else {
        $msg = __('WordPress has detected that your site is running on an outdated version of PHP.');
    }
    ?>
	<p><?php 
    echo $msg;
    ?></p>

	<h3><?php 
    _e('What is PHP and how does it affect my site?');
    ?></h3>
	<p><?php 
    _e('PHP is the programming language we use to build and maintain WordPress. Newer versions of PHP are both faster and more secure, so updating will have a positive effect on your site’s performance.');
    ?></p>

	<p class="button-container">
		<?php 
    printf(
        '<a class="button button-primary" href="%1$s" target="_blank" rel="noopener noreferrer">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
        esc_url(wp_get_update_php_url()),
        __('Learn more about updating PHP'),
        /* translators: accessibility text */
        __('(opens in a new tab)')
    );
    ?>
	</p>
	<?php 
    wp_update_php_annotation();
    wp_direct_php_update_button();
}

WordPress Version: 5.1

/**
 * Displays the PHP update nag.
 *
 * @since 5.1.0
 */
function wp_dashboard_php_nag()
{
    $response = wp_check_php_version();
    if (!$response) {
        return;
    }
    if (isset($response['is_secure']) && !$response['is_secure']) {
        $msg = __('WordPress has detected that your site is running on an insecure version of PHP.');
    } else {
        $msg = __('WordPress has detected that your site is running on an outdated version of PHP.');
    }
    ?>
	<p><?php 
    echo $msg;
    ?></p>

	<h3><?php 
    _e('What is PHP and how does it affect my site?');
    ?></h3>
	<p><?php 
    _e('PHP is the programming language we use to build and maintain WordPress. Newer versions of PHP are both faster and more secure, so updating will have a positive effect on your site’s performance.');
    ?></p>

	<p class="button-container">
		<?php 
    printf(
        '<a class="button button-primary" href="%1$s" target="_blank" rel="noopener noreferrer">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
        esc_url(wp_get_update_php_url()),
        __('Learn more about updating PHP'),
        /* translators: accessibility text */
        __('(opens in a new tab)')
    );
    ?>
	</p>
	<?php 
    wp_update_php_annotation();
}