WordPress Release: 6.5.0

Tag Name: 6.5.0

Release Date: 4/2/2024

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.5 introduces significant enhancements to the block editor, including a new Font Library for managing custom fonts, Block Hooks API for extending block functionality, and improved Block Bindings for dynamic content. The release also brings better accessibility features, performance improvements, and a new plugin dependencies system to ensure plugins with dependencies work correctly.

Highlight of the Release

    • New Font Library for managing custom fonts across your site
    • Block Hooks API for extending block functionality
    • Improved Block Bindings for dynamic content connections
    • Plugin Dependencies system for better plugin management
    • Enhanced accessibility features throughout the admin interface
    • Site Icon management now available in General Settings
    • New Interactivity API for creating interactive front-end experiences
    • Script Modules system for loading JavaScript modules

Migration Guide

Font Library Migration

If you've been using custom fonts through CSS or third-party plugins, you may want to migrate to the new Font Library system. To do this:

  1. Navigate to Appearance > Editor > Styles > Typography
  2. Click on "Manage Fonts" to access the Font Library
  3. Upload your custom font files or add Google Fonts
  4. Apply these fonts through the Typography settings

Plugin Dependencies

Plugin authors should update their plugins to declare dependencies using the new system:

  1. Add a Requires Plugins header to your plugin's main file
  2. List required plugins using their slugs, separated by commas
  3. Test your plugin with and without dependencies installed

Example:

/**
 * Plugin Name: My Plugin
 * Requires Plugins: woocommerce, advanced-custom-fields
 */

Block Hooks Implementation

Theme and plugin developers using the new Block Hooks API should:

  1. Register hooked blocks using register_block_type() with the new block_hooks property
  2. Test that hooked blocks appear correctly in both the editor and front end
  3. Use the new hooked_block and hooked_block_{$block_type} filters to modify hooked blocks

Interactivity API Usage

To use the new Interactivity API:

  1. Register your interactive blocks with appropriate directives
  2. Use the wp_interactivity_data_wp_context() function to set context data
  3. Ensure your JavaScript modules are properly registered using the new Script Modules system

Upgrade Recommendations

Recommended Upgrade Path

WordPress 6.5 is a major update with significant improvements to the block editor, accessibility, and developer APIs. It's recommended for all users to upgrade to benefit from these enhancements and security fixes.

Before Upgrading:

  1. Create a complete backup of your website, including files and database
  2. Test on a staging environment if possible to identify any compatibility issues
  3. Update all themes and plugins to their latest versions
  4. Check plugin compatibility with WordPress 6.5, especially if you use plugins that modify the editor

After Upgrading:

  1. Test your site thoroughly, especially block editor functionality and any custom blocks
  2. Review font settings if you've been using custom fonts, as you may want to migrate to the new Font Library
  3. Check plugin dependencies if you use plugins that might have dependencies on other plugins
  4. Update any custom code that interacts with the block editor or REST API

For developers, review the changes to the Block API, Block Hooks API, and Interactivity API to ensure your custom code remains compatible.

Bug Fixes

Editor Fixes

  • Fixed issues with block instance element styles for links incorrectly applying to buttons
  • Resolved problems with duotone hue value parsing that could cause PHP warnings
  • Fixed issues with pattern overrides attribute format
  • Corrected focus outline styles in Twenty Twenty-Four theme in the editor
  • Fixed issues with font family names containing special characters

Accessibility Fixes

  • Improved keyboard navigation for screen readers in the admin toolbar
  • Fixed missing subitem indicators in Customizer menu items
  • Replaced table tags for color palettes in user profiles with more semantic elements
  • Improved media library sidebar behavior to prevent showing when no actions are available
  • Enhanced admin bar link for new sites in network installations

Theme Fixes

  • Fixed border-radius for avatar images in the editor for Twenty Nineteen and Twenty Sixteen themes
  • Corrected Table block default and custom border colors in Twenty Twenty theme
  • Added missing translation functions to text strings in Twenty Twenty-Four theme
  • Fixed privacy-policy styles in Twenty Twenty theme to only apply to the footer
  • Increased color contrast in the Ember style variation of Twenty Twenty-Four theme

Other Fixes

  • Fixed issues with plugin deletion results storage
  • Corrected problems with canonical URL handling in admin
  • Fixed shortcode attribute parsing to always return an array
  • Resolved issues with export functionality for featured images
  • Fixed media icon display and progress spinner positioning

New Features

Font Library

WordPress 6.5 introduces a new Font Library that allows users to manage and use custom fonts across their site. This feature enables uploading and managing font files directly within WordPress, making it easier to create a consistent typography experience.

Block Hooks API

The new Block Hooks API allows developers to extend block functionality by injecting blocks into specific locations within other blocks. This powerful feature enables creating more dynamic and extensible block-based themes and plugins.

Enhanced Block Bindings

Block Bindings have been significantly improved, allowing for more dynamic content connections. The system now supports binding block attributes to various data sources, making it easier to create dynamic blocks that update based on site data.

Plugin Dependencies

WordPress 6.5 introduces a Plugin Dependencies system that allows plugins to declare dependencies on other plugins. This ensures that plugins with dependencies work correctly and helps users understand plugin relationships.

Interactivity API

The new Interactivity API provides a standardized way to create interactive front-end experiences with WordPress blocks. This API enables developers to build interactive components that work seamlessly with the block editor.

Script Modules

WordPress 6.5 adds support for JavaScript modules, allowing developers to load JavaScript modules more efficiently. This modern approach to script loading improves performance and developer experience.

Site Icon in General Settings

The Site Icon setting has been restored to the General Settings page, making it easier to manage your site's favicon and app icon in the same place as other site identity settings.

Security Updates

REST API Security Improvements

  • Removed unnecessary upload overrides in the font face controller to harden the endpoint against potential security issues
  • Improved error handling in REST meta fields to collect all errors rather than halting on the first one
  • Added detailed error data in REST API responses when WP_DEBUG_DISPLAY is enabled

Canonical URL Security

  • Limited post types searched by redirect_guess_404_permalink() to public, searchable post types to prevent redirects to 404 pages and exposure of private post type slugs

Block Bindings Security

  • Added protection to prevent exposing protected post meta fields in block bindings

Font Library Security

  • Improved font file handling with better MIME type detection and validation
  • Enhanced security checks for font file uploads

Performance Improvements

Block Pattern Loading Optimization

Block patterns are now loaded only when used, rather than loading all registered patterns on each request. This significantly improves performance, especially for sites with many block patterns.

HTML API Enhancements

The HTML API has been optimized to defer applying attribute updates until necessary, which improves performance when making multiple updates to a document. This reduces unnecessary document copying and processing.

Translation File Caching

Improvements to translation file caching reduce the number of file system operations needed when loading translations, resulting in better performance for multilingual sites.

Query Optimization

Leading whitespace has been removed from certain database queries to improve query performance and prevent issues with pagination.

Media Icon Improvements

Media icon images have been replaced with SVG versions, improving sharpness and reducing file size, especially on high-resolution screens.

Impact Summary

WordPress 6.5 represents a significant step forward in the evolution of the block editor and WordPress as a content management system. The introduction of the Font Library addresses a long-standing need for better typography management, while the Block Hooks API and enhanced Block Bindings provide developers with powerful new tools for creating dynamic, extensible websites.

The new Plugin Dependencies system improves the plugin ecosystem by ensuring that plugins with dependencies work correctly, reducing user frustration and support issues. This is particularly important as the WordPress ecosystem continues to grow more interconnected.

Accessibility improvements throughout the admin interface demonstrate WordPress's ongoing commitment to making the platform usable for everyone. The enhancements to keyboard navigation, screen reader support, and semantic markup contribute to a more inclusive user experience.

Performance optimizations, particularly around block pattern loading and HTML processing, help ensure that WordPress remains fast and efficient even as sites grow more complex. The move to SVG icons and improved translation file caching are small but meaningful improvements that benefit all users.

For developers, the introduction of the Interactivity API and Script Modules system provides modern tools for creating interactive front-end experiences. These APIs align WordPress with contemporary web development practices while maintaining backward compatibility.

Overall, WordPress 6.5 balances new features with refinements to existing functionality, making it a worthwhile upgrade for both content creators and developers.

Statistics:

File Changed300
Line Additions9,605
Line Deletions8,455
Line Changes18,060
Total Commits250

User Affected:

  • Access to a new Font Library for managing and using custom fonts across the site
  • Improved block editing experience with better UI and more customization options
  • Enhanced accessibility features for better content creation workflows
  • Better responsive typography controls for more flexible design

Contributors:

aaronjorbinjoedolsontellthemachinesgzioloyouknowriadSergeyBiryukovdmsnellswissspidyaudrasjbcostdevockhamdream-encodehellofromtonyaadamsilversteinspacedmonkeyjoemcgilldesrosjjohnbillionpeterwilsoncckadamwhiteryelleantpb