<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[54169] trunk/src/wp-admin: Site health:</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/54169">54169</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/54169","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>azaozz</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2022-09-14 22:17:53 +0000 (Wed, 14 Sep 2022)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Site health:
- Add a check to `wp_check_php_version()` whether the current PHP version is lower than the next (desired) minimum version.
- Set the next desired minimum PHP version to 7.2.
- Use that check to update the warnings in the `wp_dashboard_php_nag()` widget, and on the Site Health screen.
Props Clorith, SergeyBiryukov, ironprogrammer, azaozz.
See <a href="https://core.trac.wordpress.org/ticket/56199">#56199</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmincssdashboardcss">trunk/src/wp-admin/css/dashboard.css</a></li>
<li><a href="#trunksrcwpadminincludesclasswpsitehealthphp">trunk/src/wp-admin/includes/class-wp-site-health.php</a></li>
<li><a href="#trunksrcwpadminincludesdashboardphp">trunk/src/wp-admin/includes/dashboard.php</a></li>
<li><a href="#trunksrcwpadminincludesmiscphp">trunk/src/wp-admin/includes/misc.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmincssdashboardcss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/css/dashboard.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/dashboard.css 2022-09-14 21:50:12 UTC (rev 54168)
+++ trunk/src/wp-admin/css/dashboard.css 2022-09-14 22:17:53 UTC (rev 54169)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1186,7 +1186,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> padding-right: 6px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-#dashboard_php_nag.php-insecure .dashicons-warning {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+#dashboard_php_nag.php-no-security-updates .dashicons-warning,
+#dashboard_php_nag.php-version-lower-than-future-minimum .dashicons-warning {
</ins><span class="cx" style="display: block; padding: 0 10px"> color: #d63638;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1198,14 +1199,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 12px 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-#dashboard_php_nag h3 {
- font-weight: 600;
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> #dashboard_php_nag .button .dashicons-external {
</span><span class="cx" style="display: block; padding: 0 10px"> line-height: 25px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.bigger-bolder-text {
+ font-weight: 600;
+ font-size: 14px;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /* =Media Queries
</span><span class="cx" style="display: block; padding: 0 10px"> -------------------------------------------------------------- */
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpsitehealthphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-site-health.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-site-health.php 2022-09-14 21:50:12 UTC (rev 54168)
+++ trunk/src/wp-admin/includes/class-wp-site-health.php 2022-09-14 22:17:53 UTC (rev 54169)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -741,7 +741,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '<p>%s</p>',
</span><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: The minimum recommended PHP version. */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- __( '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’s performance. The minimum recommended version of PHP is %s.' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ __( 'PHP is one of the programming languages used to build WordPress. Newer versions of PHP receive regular security updates and may increase your site’s performance. The minimum recommended version of PHP is %s.' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> $response ? $response['recommended_version'] : ''
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -764,7 +764,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $response['is_supported'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $result['label'] = sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: The server PHP version. */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- __( 'Your site is running an older version of PHP (%s)' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ __( 'Your site is running on an older version of PHP (%s)' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> PHP_VERSION
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result['status'] = 'recommended';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -772,11 +772,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $result;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // The PHP version is still receiving security fixes, but is lower than
+ // the expected minimum version that will be required by WordPress in the near future.
+ if ( $response['is_secure'] && $response['is_lower_than_future_minimum'] ) {
+ // The `is_secure` array key name doesn't actually imply this is a secure version of PHP. It only means it receives security updates.
+
+ $result['label'] = 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.' ),
+ PHP_VERSION
+ );
+
+ $result['status'] = 'critical';
+ $result['badge']['label'] = __( 'Requirements' );
+
+ return $result;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // The PHP version is only receiving security fixes.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $response['is_secure'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $result['label'] = sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: The server PHP version. */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- __( 'Your site is running an older version of PHP (%s), which should be updated' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ __( 'Your site is running on an older version of PHP (%s), which should be updated' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> PHP_VERSION
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result['status'] = 'recommended';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -784,13 +801,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $result;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Anything no longer secure must be updated.
- $result['label'] = sprintf(
- /* translators: %s: The server PHP version. */
- __( 'Your site is running an outdated version of PHP (%s), which requires an update' ),
- PHP_VERSION
- );
- $result['status'] = 'critical';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // No more security updates for the PHP version, and lower than the expected minimum version required by WordPress.
+ 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.' ),
+ PHP_VERSION
+ );
+ } else {
+ // No more security updates for the PHP version, must be updated.
+ $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
+ );
+ }
+
+ $result['label'] = $message;
+ $result['status'] = 'critical';
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $result['badge']['label'] = __( 'Security' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $result;
</span></span></pre></div>
<a id="trunksrcwpadminincludesdashboardphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/dashboard.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/dashboard.php 2022-09-14 21:50:12 UTC (rev 54168)
+++ trunk/src/wp-admin/includes/dashboard.php 2022-09-14 22:17:53 UTC (rev 54169)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,17 +20,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_dashboard_setup() {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_registered_widgets, $wp_registered_widget_controls, $wp_dashboard_control_callbacks;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $wp_dashboard_control_callbacks = array();
- $screen = get_current_screen();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $screen = get_current_screen();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Register Widgets and Controls */
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $wp_dashboard_control_callbacks = array();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $response = wp_check_browser_version();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Browser version
+ $check_browser = wp_check_browser_version();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $response && $response['upgrade'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $check_browser && $check_browser['upgrade'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'postbox_classes_dashboard_dashboard_browser_nag', 'dashboard_browser_nag_class' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $response['insecure'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $check_browser['insecure'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_add_dashboard_widget( 'dashboard_browser_nag', __( 'You are using an insecure browser!' ), 'wp_dashboard_browser_nag' );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_add_dashboard_widget( 'dashboard_browser_nag', __( 'Your browser is out of date!' ), 'wp_dashboard_browser_nag' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,14 +39,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // PHP Version.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $response = wp_check_php_version();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $check_php = wp_check_php_version();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $response && isset( $response['is_acceptable'] ) && ! $response['is_acceptable']
- && current_user_can( 'update_php' )
- ) {
- add_filter( 'postbox_classes_dashboard_dashboard_php_nag', 'dashboard_php_nag_class' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $check_php && current_user_can( 'update_php' ) ) {
+ // If "not acceptable" the widget will be shown.
+ if ( isset( $check_php['is_acceptable'] ) && ! $check_php['is_acceptable'] ) {
+ add_filter( 'postbox_classes_dashboard_dashboard_php_nag', 'dashboard_php_nag_class' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_add_dashboard_widget( 'dashboard_php_nag', __( 'PHP Update Recommended' ), 'wp_dashboard_php_nag' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $check_php['is_lower_than_future_minimum'] ) {
+ wp_add_dashboard_widget( 'dashboard_php_nag', __( 'PHP Update Required' ), 'wp_dashboard_php_nag' );
+ } else {
+ wp_add_dashboard_widget( 'dashboard_php_nag', __( 'PHP Update Recommended' ), 'wp_dashboard_php_nag' );
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Site Health.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1825,29 +1831,48 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $response['is_secure'] ) && ! $response['is_secure'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $msg = sprintf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // 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(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: The server PHP version. */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- __( 'Your site is running an insecure version of PHP (%s), which should be updated.' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ __( '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.' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> PHP_VERSION
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $msg = sprintf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: The server PHP version. */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- __( 'Your site is running an outdated version of PHP (%s), which should be updated.' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ __( 'Your site is running on an outdated version of PHP (%s), which should be updated.' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> PHP_VERSION
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <p><?php echo $msg; ?></p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <p class="bigger-bolder-text"><?php echo $message; ?></p>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <h3><?php _e( 'What is PHP and how does it affect my site?' ); ?></h3>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <p><?php _e( 'What is PHP and how does it affect my site?' ); ?></p>
</ins><span class="cx" style="display: block; padding: 0 10px"> <p>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?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’s performance.' ); ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 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’s performance. The minimum recommended version of PHP is %s.' ),
- $response ? $response['recommended_version'] : ''
- );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $response['recommended_version'] ) ) {
+ printf(
+ /* translators: %s: The minimum recommended PHP version. */
+ __( 'The minimum recommended version of PHP is %s.' ),
+ $response['recommended_version']
+ );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </p>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1879,10 +1904,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function dashboard_php_nag_class( $classes ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $response = wp_check_php_version();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $response && isset( $response['is_secure'] ) && ! $response['is_secure'] ) {
- $classes[] = 'php-insecure';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $response ) {
+ return $classes;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $response['is_secure'] ) && ! $response['is_secure'] ) {
+ $classes[] = 'php-no-security-updates';
+ } elseif ( $response['is_lower_than_future_minimum'] ) {
+ $classes[] = 'php-version-lower-than-future-minimum';
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $classes;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminincludesmiscphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/misc.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/misc.php 2022-09-14 21:50:12 UTC (rev 54168)
+++ trunk/src/wp-admin/includes/misc.php 2022-09-14 22:17:53 UTC (rev 54169)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1585,7 +1585,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * 'recommended_version' - string - The PHP version recommended by WordPress.
</span><span class="cx" style="display: block; padding: 0 10px"> * 'is_supported' - boolean - Whether the PHP version is actively supported.
</span><span class="cx" style="display: block; padding: 0 10px"> * 'is_secure' - boolean - Whether the PHP version receives security updates.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 'is_acceptable' - boolean - Whether the PHP version is still acceptable for WordPress.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * 'is_acceptable' - boolean - Whether the PHP version is still acceptable or warnings
+ * should be shown and an update recommended.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $response = json_decode( wp_remote_retrieve_body( $response ), true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1613,5 +1614,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response['is_acceptable'] = (bool) apply_filters( 'wp_is_php_version_acceptable', true, $version );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $response['is_lower_than_future_minimum'] = false;
+
+ // The minimum supported PHP version will be updated to 7.2. Check if the current version is lower.
+ if ( version_compare( $version, '7.2', '<' ) ) {
+ $response['is_lower_than_future_minimum'] = true;
+
+ // Force showing of warnings.
+ $response['is_acceptable'] = false;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $response;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre>
</div>
</div>
</body>
</html>