Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
a133b6d
KSES: Allow assigning values to CSS variables.
SergeyBiryukov Sep 9, 2022
438822a
Editor: Backport Elements API updates.
SergeyBiryukov Sep 10, 2022
640cca7
Docs: Correct `@global` tags in `WP_User_Query::prepare_query()`.
SergeyBiryukov Sep 11, 2022
8f533d7
Customize: Use Semantically correct function
aaronjorbin Sep 11, 2022
da03cf1
REST API: Use helper functions for building routes in more places.
TimothyBJacobs Sep 11, 2022
3fbc7e5
Editor: Refresh nones for metaboxes after reauthentication.
joemcgill Sep 11, 2022
a400e99
REST API: Add support for searching resources by id.
TimothyBJacobs Sep 11, 2022
db0290b
Build/Test: Prevent using unsupported NPM versions.
aaronjorbin Sep 11, 2022
4b34765
Customize: Prevent JS error in Links widget when selective refresh is…
westonruter Sep 11, 2022
27aa1ec
Date/Time: Cast extracted strings to integers in `wp_resolve_post_dat…
swissspidy Sep 11, 2022
bb20a18
REST API: Introduce _pretty query parameter to opt in to JSON_PRETTY_…
kadamwhite Sep 11, 2022
1c69513
Media: Add muted property for video elements.
antpb Sep 11, 2022
62f25a4
Embeds: Add Google Data Studio as a trusted oEmbed provider
helen Sep 11, 2022
244a209
Autosave/REST API: Block autosaving from overwriting changes when loc…
antpb Sep 11, 2022
b80ba26
REST API: Add support for settings to specify their own additionalPro…
TimothyBJacobs Sep 11, 2022
7053062
Blocks: Add new `render` property in `block.json` for block types
gziolo Sep 12, 2022
5ebe289
Code Modernization: Add `AllowDynamicProperties` attribute to all (pa…
SergeyBiryukov Sep 12, 2022
2d98ba4
Code Modernization: Replace deprecated string interpolation patterns.
SergeyBiryukov Sep 12, 2022
4fc5f0e
Code Modernization: Pass correct value to `parse_url()` in `WP_Custom…
SergeyBiryukov Sep 12, 2022
de06111
Comments: Remove `aria-hidden="true"` attribute for visible text in c…
audrasjb Sep 12, 2022
0ad353d
Comments: Make `wp_required_field_indicator()` and `wp_required_field…
audrasjb Sep 12, 2022
926f3f8
Editor: Hide query loop pagination link arrows from assistive technol…
audrasjb Sep 12, 2022
1746a68
Twenty Seventeen: Ensure long text wraps correctly in the Button Block.
audrasjb Sep 12, 2022
7c72b3d
Themes: Implement file description for `theme.json`.
audrasjb Sep 13, 2022
b886ab6
Twenty Twenty: Improve support for Post Title block alignment.
audrasjb Sep 13, 2022
695cd01
Code Modernization: Fix autovivification from `false` to `array` in `…
SergeyBiryukov Sep 13, 2022
d8b2629
Upgrade/Install: Remove `_copy_dir()` function as originally intended.
SergeyBiryukov Sep 13, 2022
751a7b8
General: Add a new filter for `the_posts_pagination_args`.
dream-encode Sep 13, 2022
9bde2e9
Options, Meta APIs: Add a new `pre-option` filter.
dream-encode Sep 13, 2022
7b9d4cf
General: Correct path replacement regex in `wp_guess_url`.
dream-encode Sep 13, 2022
5225a99
Tests: Rename the test for `pre_option` filter to match the filter name.
SergeyBiryukov Sep 13, 2022
ebd2606
Tests: Rename the test for `wp_guess_url()` to match the function name.
SergeyBiryukov Sep 13, 2022
a338319
Plugins: Visually align plugin cards in Plugin Install screen.
audrasjb Sep 13, 2022
1116041
Upgrade/Install: Update sodium_compat to v1.18.0.
SergeyBiryukov Sep 14, 2022
a8f702f
Twenty Fifteen: Ensure border-bottom styles are applied to the Button…
audrasjb Sep 14, 2022
2030705
Twenty Twenty: Correctly align Social Icons block in the editor.
audrasjb Sep 14, 2022
9603308
Twenty Twenty: Ensure link color is inherited from paragraph in the e…
audrasjb Sep 14, 2022
73c668d
Twenty Twenty: Ensure headings styles are consistent between editor a…
audrasjb Sep 14, 2022
3381f05
Blocks: Allow registering multiple items for all supported asset types
gziolo Sep 14, 2022
7fcc88a
Editor: Backport Style Engine API functions, classes and tests.
audrasjb Sep 14, 2022
e4a2e73
Docs: Correct `@return` value for `wp_get_http_headers()`.
SergeyBiryukov Sep 14, 2022
7c86dfe
Code Quality: Remove unwanted spaces in the `WP_Block_Type` class
gziolo Sep 14, 2022
34aeac1
Editor: Backport foundation for Layout block support refactor (part 1).
audrasjb Sep 14, 2022
759f2b3
Editor: Revert [54159].
Sep 14, 2022
d6e842c
Feeds: Add a set of fine-grained filters to disable the different typ…
SergeyBiryukov Sep 14, 2022
72380e3
Editor: Backport foundation for Layout block support refactor (part 1).
hellofromtonya Sep 14, 2022
3e9fd82
Twenty Twenty: Fix Heading Block alignment when nested in Cover Block.
audrasjb Sep 14, 2022
c2dcd6e
Twenty Twenty-One: Fix Heading Block alignment when nested in Cover B…
audrasjb Sep 14, 2022
4086157
Site health: Add a menu bubble with the critical issues count to the …
azaozz Sep 14, 2022
26fad95
Twenty Twenty: Ensure Latest Posts block set to 2 columns displays ac…
audrasjb Sep 14, 2022
235faff
Twenty Twenty: Fix Social Links widget alignment.
audrasjb Sep 14, 2022
fe87f8e
Twenty Twenty-Two: Add "Accessibility Ready" tag to theme in repository
audrasjb Sep 14, 2022
0fdfa26
Site health:
azaozz Sep 14, 2022
39617d8
Twenty Twenty-One: Remove WooCommerce related CSS selectors.
audrasjb Sep 14, 2022
4c10e3e
Twenty Nineteen: Define underline thickness for links.
audrasjb Sep 15, 2022
0b2f05a
Docs: Add missing `@since` history in Gallery Shortcode function.
audrasjb Sep 15, 2022
7991edb
Docs: Use third-person singular verbs in Media API function descripti…
audrasjb Sep 15, 2022
d0a7711
Editor: Backport `wp_theme_element_class_name()` alias.
audrasjb Sep 15, 2022
b98a8bb
Editor: Backport `build_query_vars_from_query_block` changes from Gut…
audrasjb Sep 15, 2022
98cfa29
Themes: Introduces block-based template parts for Classic themes.
hellofromtonya Sep 15, 2022
db90f69
Initial commit.
ramonjd Sep 9, 2022
8d10a6e
Added test
ramonjd Sep 9, 2022
311df00
Remove unused global from test
ramonjd Sep 9, 2022
3c3a710
Formatting
ramonjd Sep 9, 2022
23a38f8
Move test
ockham Sep 15, 2022
ca40bbb
Remove obsolete PHPDoc
ockham Sep 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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 #56199.

git-svn-id: https://develop.svn.wordpress.org/trunk@54169 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
azaozz committed Sep 14, 2022
commit 0fdfa266afd314ae2d53ffff4079cc859b34a9d1
12 changes: 7 additions & 5 deletions src/wp-admin/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,8 @@ a.rsswidget {
padding-right: 6px;
}

#dashboard_php_nag.php-insecure .dashicons-warning {
#dashboard_php_nag.php-no-security-updates .dashicons-warning,
#dashboard_php_nag.php-version-lower-than-future-minimum .dashicons-warning {
color: #d63638;
}

Expand All @@ -1198,14 +1199,15 @@ a.rsswidget {
margin: 12px 0;
}

#dashboard_php_nag h3 {
font-weight: 600;
}

#dashboard_php_nag .button .dashicons-external {
line-height: 25px;
}

.bigger-bolder-text {
font-weight: 600;
font-size: 14px;
}

/* =Media Queries
-------------------------------------------------------------- */

Expand Down
49 changes: 39 additions & 10 deletions src/wp-admin/includes/class-wp-site-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ public function get_test_php_version() {
'<p>%s</p>',
sprintf(
/* 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.' ),
__( '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. The minimum recommended version of PHP is %s.' ),
$response ? $response['recommended_version'] : ''
)
),
Expand All @@ -764,33 +764,62 @@ public function get_test_php_version() {
if ( $response['is_supported'] ) {
$result['label'] = sprintf(
/* translators: %s: The server PHP version. */
__( 'Your site is running an older version of PHP (%s)' ),
__( 'Your site is running on an older version of PHP (%s)' ),
PHP_VERSION
);
$result['status'] = 'recommended';

return $result;
}

// 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;
}

// The PHP version is only receiving security fixes.
if ( $response['is_secure'] ) {
$result['label'] = sprintf(
/* translators: %s: The server PHP version. */
__( 'Your site is running an older version of PHP (%s), which should be updated' ),
__( 'Your site is running on an older version of PHP (%s), which should be updated' ),
PHP_VERSION
);
$result['status'] = 'recommended';

return $result;
}

// 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';
// 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';

$result['badge']['label'] = __( 'Security' );

return $result;
Expand Down
79 changes: 55 additions & 24 deletions src/wp-admin/includes/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,38 @@
function wp_dashboard_setup() {
global $wp_registered_widgets, $wp_registered_widget_controls, $wp_dashboard_control_callbacks;

$wp_dashboard_control_callbacks = array();
$screen = get_current_screen();
$screen = get_current_screen();

/* Register Widgets and Controls */
$wp_dashboard_control_callbacks = array();

$response = wp_check_browser_version();
// Browser version
$check_browser = wp_check_browser_version();

if ( $response && $response['upgrade'] ) {
if ( $check_browser && $check_browser['upgrade'] ) {
add_filter( 'postbox_classes_dashboard_dashboard_browser_nag', 'dashboard_browser_nag_class' );

if ( $response['insecure'] ) {
if ( $check_browser['insecure'] ) {
wp_add_dashboard_widget( 'dashboard_browser_nag', __( 'You are using an insecure browser!' ), 'wp_dashboard_browser_nag' );
} else {
wp_add_dashboard_widget( 'dashboard_browser_nag', __( 'Your browser is out of date!' ), 'wp_dashboard_browser_nag' );
}
}

// PHP Version.
$response = wp_check_php_version();
$check_php = wp_check_php_version();

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' );
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' );

wp_add_dashboard_widget( 'dashboard_php_nag', __( 'PHP Update Recommended' ), 'wp_dashboard_php_nag' );
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' );
}
}
}

// Site Health.
Expand Down Expand Up @@ -1825,29 +1831,48 @@ function wp_dashboard_php_nag() {
}

if ( isset( $response['is_secure'] ) && ! $response['is_secure'] ) {
$msg = sprintf(
// 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 an insecure version of PHP (%s), which should be updated.' ),
__( '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 {
$msg = sprintf(
$message = sprintf(
/* translators: %s: The server PHP version. */
__( 'Your site is running an outdated version of PHP (%s), which should be updated.' ),
__( 'Your site is running on an outdated version of PHP (%s), which should be updated.' ),
PHP_VERSION
);
}
?>
<p><?php echo $msg; ?></p>
<p class="bigger-bolder-text"><?php echo $message; ?></p>

<h3><?php _e( 'What is PHP and how does it affect my site?' ); ?></h3>
<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
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'] : ''
);
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>

Expand Down Expand Up @@ -1879,8 +1904,14 @@ function wp_dashboard_php_nag() {
function dashboard_php_nag_class( $classes ) {
$response = wp_check_php_version();

if ( $response && isset( $response['is_secure'] ) && ! $response['is_secure'] ) {
$classes[] = 'php-insecure';
if ( ! $response ) {
return $classes;
}

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';
}

return $classes;
Expand Down
13 changes: 12 additions & 1 deletion src/wp-admin/includes/misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,8 @@ function wp_check_php_version() {
* 'recommended_version' - string - The PHP version recommended by WordPress.
* 'is_supported' - boolean - Whether the PHP version is actively supported.
* 'is_secure' - boolean - Whether the PHP version receives security updates.
* 'is_acceptable' - boolean - Whether the PHP version is still acceptable for WordPress.
* 'is_acceptable' - boolean - Whether the PHP version is still acceptable or warnings
* should be shown and an update recommended.
*/
$response = json_decode( wp_remote_retrieve_body( $response ), true );

Expand Down Expand Up @@ -1613,5 +1614,15 @@ function wp_check_php_version() {
$response['is_acceptable'] = (bool) apply_filters( 'wp_is_php_version_acceptable', true, $version );
}

$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;
}

return $response;
}