WordPress Release: 6.1.0

Tag Name: 6.1.0

Release Date: 11/2/2022

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 6.1 "Misha" introduces significant improvements to the block editor, site editing capabilities, and performance optimizations. This release enhances the design tools with fluid typography, expanded style options, and improved template creation. It also brings better performance through database query caching, optimized block registration, and reduced JavaScript bundle sizes. WordPress 6.1 continues the journey toward full site editing while maintaining compatibility with classic themes and improving the overall user experience.

Highlight of the Release

    • Fluid Typography: Automatically adjusts font sizes based on screen width for better responsive design
    • Enhanced Style Engine: Improved block styling with more consistent CSS output
    • Template Creation Improvements: Better template management in the site editor
    • Performance Optimizations: Database query caching and reduced JavaScript bundle sizes
    • Better PHP 8.1 and 8.2 Compatibility: Addressing deprecation notices and compatibility issues

Migration Guide

Upgrading to WordPress 6.1

WordPress 6.1 is a major release and while it maintains backward compatibility with previous versions, there are some changes that may require attention during migration:

For Site Owners and Administrators

  1. Backup First: Always create a complete backup of your site before upgrading.
  2. Update Plugins and Themes: Ensure all plugins and themes are updated to their latest versions before upgrading WordPress.
  3. Test in Staging: If possible, test the upgrade on a staging environment before applying to your production site.
  4. PHP Compatibility: WordPress 6.1 has improved compatibility with PHP 8.1 and 8.2, but if you're using older PHP versions, consider upgrading your PHP version as well.

For Developers

  1. Block Asset Registration Changes: The block registration process has been updated with new _handles properties replacing single asset properties. While backward compatibility is maintained, consider updating your code to use the new approach.

    // Old approach (still works but soft-deprecated)
    register_block_type( 'my-plugin/my-block', array(
        'editor_script' => 'my-editor-script',
        'script' => 'my-script',
        'style' => 'my-style',
    ) );
    
    // New approach
    register_block_type( 'my-plugin/my-block', array(
        'editor_script_handles' => array( 'my-editor-script' ),
        'script_handles' => array( 'my-script' ),
        'style_handles' => array( 'my-style' ),
    ) );
    
  2. Theme.json Filter Changes: Several filters have been renamed with the wp_ prefix:

    • theme_json_default renamed to wp_theme_json_data_default
    • theme_json_theme renamed to wp_theme_json_data_theme
    • theme_json_blocks renamed to wp_theme_json_data_blocks
    • theme_json_user renamed to wp_theme_json_data_user
    • theme_json_get_style_nodes renamed to wp_theme_json_get_style_nodes
  3. Function Renames: Some functions have been renamed for clarity:

    • is_login_screen() renamed to is_login()
  4. Database Query Caching: If you're using custom database queries, be aware that WordPress now implements caching for database queries. This may affect your code if you're relying on queries always hitting the database.

  5. PHP 8.1 and 8.2 Compatibility: Many deprecation notices for PHP 8.1 and 8.2 have been addressed. If your code triggered these notices, they may now be fixed in core, but you should still review your custom code for compatibility.

Upgrade Recommendations

Recommended Action: Upgrade to WordPress 6.1 at your earliest convenience.

WordPress 6.1 is a major release that brings significant improvements to the block editor, site editing capabilities, and performance optimizations. The release includes important security updates to external libraries and addresses numerous bugs and performance issues.

Priority Level: Medium

This is not an emergency security release, but it does contain security improvements and important bug fixes that enhance the stability and performance of your WordPress site.

Preparation Steps:

  1. Create a complete backup of your website before upgrading.
  2. Update all plugins and themes to their latest versions.
  3. Test the upgrade on a staging environment if possible.
  4. Check compatibility with your hosting environment, especially if you're using PHP 8.1 or 8.2.

Special Considerations:

  • Custom Block Developers: If you've developed custom blocks, test them thoroughly with this release as there have been changes to the block registration process.
  • Theme Developers: If you're using theme.json, review the new features and changes to ensure your theme works as expected.
  • Performance-Critical Sites: The performance improvements in this release may significantly benefit high-traffic sites.

The upgrade process should be smooth for most users, with backward compatibility maintained for existing content and functionality.

Bug Fixes

Block Editor Fixes

  • Fixed issues with block spacing property generation in flow layout type.
  • Resolved problems with missing frontend section presets output.
  • Fixed block toolbar positioning when moving blocks.
  • Corrected issues with block search for non-Latin characters.
  • Fixed padding on the post editor when RootPaddingAwareAlignments setting is enabled.

Theme and Styling Fixes

  • Fixed inconsistent text color in Table Block heading cells and figcaption in Twenty Eleven.
  • Improved Pullquote Block text color consistency between editor and front-end in Twenty Sixteen and Twenty Nineteen.
  • Fixed Separator Block rendering in Twenty Twenty.
  • Ensured RTL stylesheets are correctly loaded in the block editor.
  • Fixed issues with theme.json settings being lost on theme export.

Performance and Security Fixes

  • Fixed excessive notoptions key lookups in Options and Meta APIs.
  • Removed extra get_theme_file_path() calls in block scripts and styles registration.
  • Fixed performance regression in WP_Theme_JSON_Resolver.
  • Ensured global styles are rendered for third-party blocks.
  • Updated external libraries including PHPMailer, sodium_compat, MediaElement.js, and getID3 for security and compatibility improvements.

UI and UX Fixes

  • Fixed menu/sub-menu overlap on small screens in admin.
  • Fixed Users list bottom filters margins on small screens.
  • Fixed Upgrade icon alignment on mobile in Plugins Install screen.
  • Prevented scaling issues on featured images using Safari on iPadOS in Twenty Seventeen.
  • Fixed missing "Are you sure" prompt when replying to a comment with no content.

New Features

Enhanced Block Editor Experience

  • Fluid Typography: Font sizes now automatically adjust based on screen width, creating a more responsive design experience without requiring custom CSS.
  • Expanded Style Options: New border, typography, and spacing controls provide more design flexibility.
  • Template Creation Improvements: Creating and managing templates in the site editor is now more intuitive with dynamic template names and descriptions.
  • Block Pattern Interface: Improved interface for browsing and inserting block patterns.
  • Style Engine: New style engine provides more consistent CSS output for blocks.

Theme.json Enhancements

  • New Settings: Added support for appearanceTools, useRootPaddingAwareAlignments, blockGap, and other settings.
  • Fluid Typography Support: Theme authors can now define fluid typography settings in theme.json.
  • Style Variations: Enhanced support for theme style variations.

Developer APIs and Tools

  • Database Query Caching: Improved performance through caching of database queries.
  • Block Registration Optimization: More efficient block registration process.
  • Cache API Improvements: New wp_cache_supports() function to check for supported cache features.
  • Login Detection: New is_login() function to reliably detect login screens.

Accessibility Improvements

  • Twenty Twenty-Three Theme: The new default theme is accessibility-ready.
  • Admin Interface: Various accessibility improvements throughout the admin interface.
  • Block Editor: Enhanced keyboard navigation and screen reader support.

Security Updates

External Library Updates

  • PHPMailer: Updated to version 6.6.5, addressing several security issues including better handling of connection errors and preventing attempts to add folders as attachments.
  • sodium_compat: Updated to version 1.19.0, improving compatibility with PHP 8.0 named parameters functionality.
  • MediaElement.js: Updated to version 4.2.17, addressing security vulnerabilities.
  • getID3: Updated to version 1.9.22, containing bug fixes and improvements for PHP 8.1 support.
  • Underscore.js: Updated to version 1.13.6 to ensure security scanners do not flag sites as potentially insecure.

Security Hardening

  • Post-by-Email: Applied KSES to post-by-email content to prevent potential security issues.
  • Trackbacks: Applied KSES to all trackbacks for better security.
  • Comment Editing: Applied KSES when editing comments to prevent potential security issues.
  • REST API: Locked down post parameter of the terms endpoint to prevent potential security issues.
  • PHPMailer: Reset PHPMailer properties between uses to prevent potential information leakage.
  • RSS Widget: Escaped RSS error messages for display to prevent potential XSS vulnerabilities.
  • Salt Translations: Added translations of salt default phrase in additional locations to ensure the default phrase is considered an error in non-English translations of wp-config.php.
  • Object Replacement Characters: Added protection against object replacement characters in slugs.

Performance Improvements

Database and Query Optimizations

  • Database Query Caching: Implemented caching for database queries, significantly improving performance for repeated queries.
  • Reduced Excessive Cache Operations: Prevented excessive notoptions key lookups in persistent object caches.
  • Query Performance: Improved get_page_by_title() to avoid parsing queries twice.
  • Menu Item Cache Optimization: Moved call to update_menu_item_cache in WP_Query to after post meta caches for menu items are primed.

JavaScript and Asset Optimizations

  • Reduced JavaScript Bundle Sizes: Optimized JavaScript bundles for better loading performance.
  • Block Registration Efficiency: Improved block registration process with caching of normalized paths.
  • Style Engine Performance: Enhanced the style engine for more efficient CSS generation.
  • Theme.json Processing: Fixed performance regression in WP_Theme_JSON_Resolver with improved caching strategy.

Function and API Optimizations

  • Cached File Paths: Avoided extra calls to realpath() and wp_normalize_path() in block scripts and styles registration.
  • Array Processing Optimization: Replaced array_map() usage in WP_Theme_JSON::get_default_slugs() with a more efficient foreach loop.
  • Cached Theme Data: Improved caching of theme data in WP_Theme_JSON_Resolver::read_json_file() to prevent multiple filesystem reads.
  • Dynamic Template Names: Optimized performance of dynamic template name generation for the site editor.

Impact Summary

WordPress 6.1 "Misha" represents a significant step forward in the evolution of WordPress, particularly in the areas of site editing, design flexibility, and performance.

Design and Editing Experience

The introduction of fluid typography automatically adjusts font sizes based on screen width, creating more responsive designs without requiring custom CSS. This feature, combined with expanded style options for borders, typography, and spacing, gives content creators and designers unprecedented control over their site's appearance directly within the editor.

Template creation and management have been significantly improved in the site editor, with dynamic template names and descriptions making the process more intuitive. The enhanced block pattern interface also makes it easier to discover and insert pre-designed content layouts.

Performance and Technical Improvements

Under the hood, WordPress 6.1 brings substantial performance optimizations. Database query caching improves response times for repeated queries, while the optimized block registration process and reduced JavaScript bundle sizes contribute to faster page loads. The new style engine provides more consistent CSS output for blocks, improving both performance and visual consistency.

Developers will appreciate the improved PHP 8.1 and 8.2 compatibility, addressing numerous deprecation notices and potential issues. The new wp_cache_supports() function and other Cache API improvements provide better tools for managing caching in plugins and themes.

Accessibility and User Experience

Accessibility continues to be a priority, with the new Twenty Twenty-Three default theme being accessibility-ready. Various improvements to keyboard navigation, screen reader support, and UI elements throughout the admin interface make WordPress more usable for everyone.

Overall Impact

WordPress 6.1 strikes a balance between pushing forward with the site editor vision while maintaining compatibility with classic themes and workflows. The performance improvements benefit all WordPress sites, regardless of whether they use the block editor or classic editor. This release demonstrates WordPress's commitment to evolving the platform while respecting the diverse needs of its user base.

Statistics:

File Changed300
Line Additions10,299
Line Deletions7,304
Line Changes17,603
Total Commits250

User Affected:

  • Enhanced block editor experience with improved UI and new design tools
  • Access to fluid typography for more responsive text sizing across devices
  • Better template creation and management in the site editor
  • Improved block pattern interface for easier content design

Contributors:

SergeyBiryukovjorgefilipecostagziolohellofromtonyadesrosjaudrasjbjohnbilliondream-encodepeterwilsonccwestonruterspacedmonkeypentoadamsilversteinryelleockhamocean90antpb