WordPress Release: 5.2.0

Tag Name: 5.2.0

Release Date: 5/7/2019

WordPress LogoWordPress

World's most popular open-source content management system powering over 40% of all websites. Offers extensive plugin ecosystem, themes, and robust community support for blogs, e-commerce, and corporate websites. Highly customizable and scalable platform suitable for beginners and advanced developers.

TL;DR

WordPress 5.2 "Jaco" introduces significant improvements to site health monitoring, PHP error protection, accessibility, and security. This release adds a new Site Health tool that helps users identify and fix common configuration issues, implements a robust fatal error protection system with recovery mode, and includes numerous accessibility enhancements. The update also brings improvements to the block editor, privacy features, and developer tools.

This is a major update that focuses on making WordPress more resilient and user-friendly, especially when things go wrong. Site administrators will benefit from better error handling and diagnostic capabilities, while all users will appreciate the improved accessibility and interface refinements.

Highlight of the Release

    • New Site Health tool for monitoring and troubleshooting site issues
    • Fatal error protection with recovery mode for handling PHP errors
    • Improved accessibility for alt text fields and keyboard navigation
    • New wp_body_open action hook for theme developers
    • Security improvements including automatic rel="noopener" for target blank links

Migration Guide

Preparing for PHP Minimum Version Changes

WordPress 5.2 maintains compatibility with PHP 5.6.20+, but continues to encourage users to upgrade to PHP 7.3+. The minimum recommended PHP version is now 7.3.

If you're a plugin or theme developer:

  • Use the new is_wp_version_compatible() and is_php_version_compatible() functions to check compatibility
  • Test your code with PHP 7.3+ to ensure compatibility with future WordPress versions
  • Update any deprecated PHP functions or practices

Adapting to Site Health API

If you want to extend the Site Health feature:

  • Use the site_status_tests filter to add custom health checks
  • Use the debug_information filter to add custom debug information
  • Follow the established pattern for test results with status, label, description, and actions

Using the New wp_body_open Hook

Theme developers should add the following code immediately after the opening <body> tag:

<?php
if ( function_exists( 'wp_body_open' ) ) {
    wp_body_open();
} else {
    do_action( 'wp_body_open' );
}
?>

Handling Fatal Error Protection

Plugin and theme developers should:

  • Ensure your code follows WordPress coding standards
  • Implement proper error handling and validation
  • Test your code thoroughly before deployment
  • Be aware that fatal errors will now trigger recovery mode and pause your plugin/theme

Upgrade Recommendations

WordPress 5.2 is a major update with significant improvements to site health, error handling, and security. We strongly recommend upgrading as soon as possible.

The new Site Health tool and fatal error protection features provide important safeguards for your WordPress site, making this update particularly valuable for site stability and security.

Before Upgrading

  1. Back up your website - Always create a complete backup of your site before upgrading
  2. Update all plugins and themes - Ensure all your plugins and themes are compatible with WordPress 5.2
  3. Check PHP compatibility - While WordPress 5.2 works with PHP 5.6.20+, we recommend using PHP 7.3+ for optimal performance and security

After Upgrading

  1. Run a Site Health check - Use the new Tools > Site Health feature to identify any issues
  2. Test your site functionality - Verify that all critical features of your site work correctly
  3. Review your theme - Add the new wp_body_open() function if you're using a custom theme

This update focuses on making WordPress more resilient and user-friendly, especially when things go wrong. The new error protection features will help prevent catastrophic site failures, making this an important update for all WordPress users.

Bug Fixes

Admin Interface Fixes

  • Fixed Dashicon backward compatibility issues with correct icon locations
  • Fixed post format icons in the post list table
  • Fixed vertical alignment for active primary buttons
  • Fixed padding on login input fields
  • Fixed media bulk action labels for consistency
  • Fixed plugin "Update Now" button for plugins requiring higher PHP versions

Block Editor Fixes

  • Fixed parsing of inner blocks when auto-generating excerpts
  • Fixed handling of nested the_content calls within do_blocks()
  • Fixed parsing of blocks in the second half of post_content
  • Fixed outputting malformed HTML with the_content(null, true) or <!--noteaser-->

Theme and Frontend Fixes

  • Fixed Twenty Seventeen MediaElement control hover colors in the customizer
  • Fixed Twenty Seventeen and Twenty Nineteen to prevent horizontal scrolling with long strings
  • Fixed Twenty Nineteen padding discrepancies in responsive styles for Column block
  • Fixed linear-gradient direction argument syntax in Twenty Eleven and Twenty Twelve

Other Bug Fixes

  • Fixed canonical redirect to ensure query keys are URL encoded
  • Fixed deletion of files when using stream wrappers
  • Fixed Tags meta box to better support Input Method Editor (IME) converters
  • Fixed media widgets to respect changes via the instance schema filter
  • Fixed $object_id parameter in meta API filters to always be an integer

New Features

Site Health Check

WordPress 5.2 introduces a comprehensive Site Health feature that helps users identify and fix common configuration issues. The new tool provides:

  • A status page that runs tests on your site's health and provides critical information about your WordPress configuration
  • An info tab that displays detailed information about your WordPress installation, server, and database
  • Clear indicators for passed and failed tests with actionable recommendations
  • Performance and security recommendations to improve your site

Fatal Error Protection with Recovery Mode

A major new feature that helps protect your site when a fatal PHP error occurs:

  • Prevents the "white screen of death" by displaying a user-friendly error message
  • Sends an email to the site admin with a special recovery link
  • Recovery mode allows admins to access the admin area even when a plugin or theme is causing a fatal error
  • Automatically identifies and pauses the problematic plugin or theme
  • Provides tools to fix the issue without breaking your site

New Action Hook: wp_body_open

A new action hook has been added immediately after the opening <body> tag:

  • Enables inserting content or scripts right after the body tag opens
  • Improves theme extensibility and customization options
  • Bundled themes have been updated to include this hook
  • Backward compatibility shim included for older WordPress versions

Improved Privacy Features

  • Personal data export emails now use the user's locale
  • Personal data erasure emails now use the user's locale
  • Export requests are only marked as complete when the user downloads the export
  • Fixed form action on Export/Erasure screens to prevent expired nonces in URLs

Security Updates

Link Security Improvements

  • Added rel="noopener" to links with target="_blank" in navigation menus by default
  • Added rel="noopener noreferrer" to links with target="_blank" in Text and HTML widgets
  • Added rel="noopener noreferrer" to links with target="_blank" in the Image widget
  • These changes help prevent potential security issues with target blank links (tab nabbing)

Package Signature Verification

  • Improved package signature verification system for core updates
  • Added more context in signature verify failures for better diagnostics
  • Fixed verification bugs and scaled back signature checks to compatible PHP versions

Privacy and Data Protection

  • Fixed personal data export to only mark as complete when the user downloads it
  • Improved form handling on Export/Erasure screens to prevent expired nonces in URLs

Performance Improvements

Site Health Performance

  • Implemented timeout protection in directory size calculations to prevent server overload
  • Added caching for directory size calculations
  • Improved loading of the Site Health Info tab with asynchronous data loading
  • Optimized the Site Health Status tab to load tests more efficiently

User Query Performance

  • Improved performance of wp_list_authors() by checking for author's post count before getting metadata
  • This significantly reduces SQL queries on sites where many users don't have posts

Other Performance Improvements

  • Reduced CSS specificity in various admin stylesheets for better rendering performance
  • Improved JavaScript performance in the Site Health interface
  • Optimized loading of admin pages with better resource management

Impact Summary

WordPress 5.2 "Jaco" represents a significant step forward in making WordPress more robust, accessible, and user-friendly. The introduction of the Site Health tool transforms how administrators monitor and maintain their sites, providing clear insights into configuration issues and security recommendations. This proactive approach to site maintenance will help identify and resolve problems before they impact visitors.

The fatal error protection system with recovery mode is perhaps the most impactful change, addressing one of the most frustrating experiences in WordPress - the dreaded "white screen of death." By gracefully handling PHP fatal errors and providing administrators with a way to recover access to their site, WordPress 5.2 significantly improves site reliability and reduces downtime.

Accessibility continues to be a priority with improvements to alt text fields, keyboard navigation, and screen reader support. These changes make WordPress more inclusive and usable for all people regardless of ability.

For developers, the new wp_body_open hook provides a standardized way to insert content after the opening body tag, while the Site Health API offers opportunities to extend the diagnostic capabilities of WordPress.

Security enhancements like automatic rel="noopener" attributes for target blank links and improved privacy features demonstrate WordPress's ongoing commitment to protecting users and their data.

Overall, WordPress 5.2 delivers a more resilient, accessible, and developer-friendly platform that improves the experience for all WordPress users while laying groundwork for future innovations.

Statistics:

File Changed300
Line Additions9,996
Line Deletions2,964
Line Changes12,960
Total Commits250

User Affected:

  • Access to new Site Health tool for monitoring site performance and security
  • Fatal error protection with recovery mode when plugins or themes cause issues
  • Improved error handling with admin email notifications for critical issues
  • Better plugin compatibility checks for PHP version requirements

Contributors:

aferciaSergeyBiryukovdesrosjadamsilversteinpentoaaronjorbinjohnbillionazaozzgetsourcetellyworthswissspidyfelixarntzaduthjoemcgillocean90melchoycejeremyfeltlaurelfulfordkadamwhite