WordPress Release: 5.6.2

Tag Name: 5.6.2

Release Date: 2/22/2021

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.6.2 is a maintenance release that addresses several bugs and improves compatibility with PHP 8. Key fixes include resolving a PHP 8 fatal error in the PclZip library, correcting the "Are you sure?" prompt when navigating away from the classic editor, and updating multiple block editor packages to their latest patch versions. This release also includes several build and testing tool improvements to enhance the development workflow.

Highlight of the Release

    • Fixed a PHP 8 fatal error in the PclZip library by ensuring fread() is only called on non-empty files
    • Corrected the 'Are you sure?' prompt behavior when navigating away from the classic editor
    • Updated multiple block editor packages to their latest patch versions
    • Switched from node-sass to Dart Sass for better build tool maintenance
    • Improved Node.js version specification and testing workflows

Migration Guide

Upgrading to WordPress 5.6.2

This is a maintenance release with no breaking changes, so no special migration steps are required. Standard WordPress update procedures apply:

  1. Back up your website before updating
  2. Update through the WordPress admin dashboard or via your preferred method
  3. Test your site functionality after the update

For Developers

If you're working on the WordPress codebase:

  • Note that the build tools now use Dart Sass instead of node-sass
  • NodeJS 14.x is now specified in the .nvmrc file for the 5.6 branch
  • The package.json file now includes version ranges for node and npm in the engines field
  • If you're using the local Docker environment, you can now replace mysql with mariadb for consistency

Upgrade Recommendations

WordPress 5.6.2 is a recommended update for all WordPress sites, especially for those running on PHP 8 or planning to upgrade to PHP 8. The release fixes a critical PHP 8 compatibility issue in the PclZip library that could cause fatal errors.

Content creators will benefit from the fixes to the classic editor's "Are you sure?" prompt behavior and the various block editor improvements.

As this is a maintenance release with bug fixes and compatibility improvements, there are no known risks associated with upgrading. Standard precautions apply:

  1. Create a full backup of your site before updating
  2. Test your site thoroughly after the update
  3. If you use custom themes or plugins, ensure they are compatible with this version

The update process is straightforward and can be performed through the WordPress admin dashboard.

Bug Fixes

PHP 8 Compatibility Fix

  • Fixed a fatal error in the PclZip library by ensuring fread() is only called on non-empty files, avoiding passing a zero value to the $length argument which must be greater than zero in PHP 8

Editor Improvements

  • Corrected the check for unsaved content in wp.autosave.server.postChanged() to fix improper triggering of the "Are you sure?" prompt when navigating away from the classic Edit Post screen
  • Fixed handling of Pages and custom post types that don't have a Title, Content, or Excerpt field

Block Editor Package Updates

Updated several packages to their latest patch versions to fix bugs:

  • @wordpress/block-directory to 1.17.8
  • @wordpress/block-editor to 5.1.7
  • @wordpress/block-library to 2.26.8
  • @wordpress/components to 11.1.5
  • @wordpress/core-data to 2.24.4
  • @wordpress/edit-post to 3.25.8
  • @wordpress/editor to 9.24.7
  • @wordpress/format-library to 1.25.7
  • @wordpress/list-reusable-blocks to 1.24.5
  • @wordpress/media-utils to 1.18.1
  • @wordpress/nux to 3.23.5
  • @wordpress/reusable-blocks to 1.0.7
  • @wordpress/server-side-render to 1.19.5

New Features

Build Tool Improvements

  • Replaced node-sass with Dart Sass as the Sass implementation used by Grunt, since LibSass & node-sass have been deprecated
  • Added clearer version range specifications within engines for node and npm in package.json
  • Pinned NodeJS 14.x in the .nvmrc file for better version control
  • Updated the version of NodeJS tested on Windows to 14
  • Added ability to replace mysql with mariadb when using the local Docker environment

Testing Workflow Enhancements

  • Merged several refinements to GitHub Action workflow files
  • Added support for running automated tests when tags are created
  • Refined the matched version ranges for several workflows

Security Updates

No specific security fixes were mentioned in the release notes for WordPress 5.6.2.

Performance Improvements

Build Performance

  • The switch from node-sass to Dart Sass provides a more actively maintained and potentially faster Sass implementation
  • Improved Node.js version specifications help ensure optimal build performance by using compatible versions
  • Enhanced GitHub Actions workflows for more efficient automated testing

Editor Performance

  • Multiple block editor package updates include performance improvements and optimizations
  • Fixed issues that could cause unnecessary prompts and page reloads in the classic editor

Impact Summary

WordPress 5.6.2 is primarily a maintenance and bug fix release that addresses several important issues:

  1. PHP 8 Compatibility: The most significant fix addresses a fatal error in the PclZip library when running on PHP 8, making WordPress more stable on newer PHP versions.

  2. Editor Experience: The release fixes an annoying issue where users would get unnecessary "Are you sure?" prompts when navigating away from the classic editor even when no changes were made, particularly affecting custom post types.

  3. Block Editor Improvements: Multiple block editor packages were updated to their latest patch versions, addressing various bugs and improving the editing experience.

  4. Developer Tooling: Several improvements to build tools and testing workflows make WordPress development more efficient, including the switch from node-sass to Dart Sass and better Node.js version specifications.

This release doesn't introduce new features but focuses on stability and compatibility. Site administrators should update to ensure better PHP 8 compatibility and a smoother editing experience for content creators. The changes are backward compatible and shouldn't cause any disruption to existing sites.

Statistics:

File Changed18
Line Additions303
Line Deletions552
Line Changes855
Total Commits16

User Affected:

  • Improved build tools with the switch from node-sass to Dart Sass
  • Better Node.js version specification in package.json and .nvmrc files
  • Enhanced automated testing workflows, including support for running tests when tags are created
  • Fixed PHP 8 compatibility issues in the PclZip library

Contributors:

desrosjSergeyBiryukov