Dev chat summary: January 12, 2022

@webcommsat and @marybaum led the meeting on this agenda.

See the real-time chat in the Make WordPress Slack.

And last week’s notes are at Dev chat summary, January 5, 2021.

Announcements

WordPress 5.9 Release Candidate 2 has landed. Please download and test! Also, please feel free to share the package and invite your friends to test the release candidaterelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta). for themselves.

Help test WordPress 5.9 features. You can test in general or find prompts for daily features to test in  #fse-outreach-experiment.

Also, share the details of the new features with your teams and networks – Read the latest Developer Notes

@nalininonstopnewsuk asked about testing deadlines and current focuses from a question from the marketing meeting. @hellofromtonya: Testing and feedback can be ongoing. But for regressions or bugfixes to land in the final release, these would need to be reported, fixed, and committed 24 hours before the final release, which is on 25 January 2022.

Blogblog (versus network, site) posts to note

A year in core (December 29, 2021)

What’s new in Gutenberg 12.3 release (5 January 2022)

A Week in CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.January 10, 2022

A reminder of the revised 5.9 release schedule.

Join the discussion on 2022 release planning (December 27, 2021 post by @chanthaboune). This is still open for discussion. No current closing date.

Proposal: Approving custom block pattern directory submissions (posted January 4, feedback by January 14, 2022)
Proposed changes to javascript coding standards for full prettier compatibility 

The 5.9 Field Guide brings together the developer notes about every change in the new release. It’s a must-read if you build themes or plugins!

Update on 5.9 release

@hellofromtonya:

First of all, thank you to everyone who has contributed to the 5.9 release.

The final release is in less than 13 days on 25 January and it is on track to release on that day. There are currently no blockers or red flags. Everyone has come together across Core and GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ to make the revised schedule happen on time as promised.

Release Candidate (RCrelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta).) 2 landed yesterday and is available for testing and feedback. Please, test test test test. Regressions and bugs introduced in the RC cycle are priority to find and fix before the final release. Your help is needed to test and report. 

When is the next release? Release Candidate 3 will be on 18 January 2022. You are all invited to join and actively participate in the release party.

As a reminder, 5.9 is in a hard string freeze. Any string changes must be critically necessary — and nearly unanimously agreed as such before they show up in the 5.9 package. Why? Translationtranslation The process (or result) of changing text, words, and display formatting to support another language. Also see localization, internationalization. teams are working hard translating the release and in many cases, translations are done. String changes impact not only the translators but users. Please cautiously recommend string changes only where it’s critically necessary.

One more reminder, with 5.9 in RC, code changes require two core committers: one to review and approve the backportbackport A port is when code from one branch (or trunk) is merged into another branch or trunk. Some changes in WordPress point releases are the result of backporting code from trunk to the release branch. to 5.9 and the second to do the review and actual backport commit. Why? This is on purpose to make sure code changes are necessary and respect the release processes. With all that said, 5.9 is less than two weeks from full final release.

Additional updates

Last week, a security update, 5.8.3, arrived. @audrasjb also confirmed that updates dropped for older versions, from branchbranch A directory in Subversion. WordPress uses branches to store the latest development code for each major release (3.9, 4.0, etc.). Branches are then updated with code for any minor releases of that branch. Sometimes, a major version of WordPress and its minor versions are collectively referred to as a "branch", such as "the 4.0 branch". 3.7 to 5.8, to patchpatch A special text file that describes changes to code, by identifying the files and lines which are added, removed, and altered. It may also be referred to as a diff. A patch can be applied to a codebase for testing. the same issues.

Component Maintainers update

Until 5.9 final release on January 25, the team is skipping component updates unrelated to 5.9. If any maintainer has something to add, please add it to the comments.

Open Floor

The core team is looking for notetakers. The idea is to create a pool and encourage more contributors, and spread the responsibility around.
@webcommsat: at and after last week’s meeting, there was a discussion about the usefulness of an advance rota for people to volunteer to write summaries for dev chat.

Writing notes is a great way to review what is happening — and learn more about items you might be interested in. Some other teams find it easier to have a rota running a couple of weeks in advance, where people can volunteer in advance rather than just asking on the day.

And when you volunteer, you are not going it alone. There’s lots of help, you can ask questions just about anytime, and at least one other person will review and help with edits too.

Finally, the summaries are really helpful for people who cannot join the live meeting or are in different timezones, but who still want to be part of what’s happening in core. So it’s a really important task. It’s a great way to get involved and contribute!

Volunteers invited for notes on:
12 Jan – Estela
19 Jan –
26 Jan –
2 Feb –
9 Feb –

@davidbaumwald: Yeah, sometimes not everyone can make the meeting, so it’s tough to find volunteers. … One perk of writing notes: You get to become an author on Make WordPress/Core.

@estelaris commented that it is a great way of meeting the team that is actually building WordPress and learn from them. @webcommsat mentioned about creating a schedule and asked anyone who would like to take notes during dev chat to post in the #core channel or comment on this summary.

There is a call for volunteers on the marketing and training teams to support 5.9, specifically in the next two weeks. You can reach out to them in their SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/. channels.

Next meeting

Dev Chat will take place next week, Wednesday 19 January 2022 at 20:00 UTC in the Make WordPress Core Slack.

Props: Dev Chat summary by @estelaris and @webcommsat. Thanks to @marybaum for proofing.

#5-9#dev-chat#summary

#dev-chat, #summary, #week-in-core

Dev Chat agenda for January 12, 2021

The weekly developers chat meeting is at 20:00 UTC in the #core channel on Slack. Please join the group!

Announcements

WordPress 5.9 Release Candidate 2 has landed.  Please download and test! Also, please feel free to share the package and invite your friends to test the release candidaterelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta). for themselves.

Help test WordPress 5.9 features

Read the latest Developer Notes

3. Blogblog (versus network, site) posts to note

A year in core (December 29, 2021)

What’s new in Gutenberg 12.2 release (5 January 2022)

A Week in CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.: January 10, 2022

The revised 5.9 release schedule.

Join the discussion on 2022 release planning (December 27, 2021 post by @chanthaboune)

Proposal: Approving custom block pattern directory submissions (posted January 4, feedback by January 14, 2022)

Proposed changes to javascript coding standards for full prettier compatibility [added during devchat]

Do you have other posts that should get attention? Please add them in the comments.

4. Upcoming releases

@hellofromtonya will update the group on the 5.9 release, slated for January 25, 2022.

Component Maintainers

From now until 5.9 launch, devchat will skip a formal check-in so the group can have a longer Open Floor. If you’re a maintainer who would like to get help with a blockerblocker A bug which is so severe that it blocks a release. or share success/ collaboration, please feel free to either comment on this post or in the meeting.

Open Floor

Please add your topic to the comments below.

#agenda#core#dev-chat#week-in-core

#5-9, #agenda, #dev-chat

Performance team meeting summary 11 January 2022

Meeting agenda here and the full chat log is available beginning here on Slack.

Focus group updates

Images

@adamsilverstein

GitHub project

  • @adamsilverstein offline
  • @mitogh: Researching existing functionality and working on planning. Can we include https://core.trac.wordpress.org/ticket/53232 in GH as part of image performance improvements?
  • @tweetythierry: Sure, this will help us do some testing before it lands in coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress..
  • @mitogh will create a new GH issue linking back to the TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. ticketticket Created for both bug reports and feature development on the bug tracker.
  • WebP module
    • Ready for testing
    • @tweetythierry: Should we remove the original image or not?
    • @boogah: Can we give the option? Keep the original and add a filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output. to remove the original for users/hosts who wish to do so
    • @tillkruess, @madpixels, @craigfrancis: Keep the original
    • @blogaid: This will double disk space usage and we need to keep hosting costs in mind
    • @schlessera: webp is not supported everywhere, so we shouldn’t be removing the original
    • Several other users chimed in; see Slack
    • Continue the discussion on GitHubGitHub GitHub is a website that offers online implementation of git repositories that can can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ (see below)

Feedback requested

Object caching

@tillkruess

GitHub project

  • No updates

Feedback requested

  • N/A

Site Health

@audrasjb

GitHub project

Feedback requested

  • Create Site Health Audit Enqueued Assets module (inc. this PR) has been adapted to the new pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party structure and is open for discussion

Measurement

@wp-source @josephscott

GitHub project

  • @wp-source offline until end of January
  • @josephscott: Plan to get a live updating test site set up on platform.sh ot begin running tests on every commit to master soon

Feedback requested

JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/.

@aristath

GitHub project

Feedback requested

  • N/A

Infrastructure

Feedback requested

Open floor

  • @seedsca: Has anyone looked into using Xdebug with profiling for tests?
  • @craigfrancis: Looking for review on PR #2127 in Core since this is a feature change to wp-db

#core-media, #meeting, #performance, #performance-chat, #summary

Editor Chat Agenda: 12 January 2021

Facilitator and notetaker: @jorgefilipecosta

This is the agenda for the weekly editor chat scheduled for Wednesday, January 12 2021, 03:00 PM GMT+1.

This meeting is held in the #core-editor channel in the Making WordPress SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/..

  • GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ 12.4 RCrelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta).
  • What’s new in Gutenberg 12.3 ( 5 January)
  • WordPress 5.9
  • Updates based on updated scope for site editing projects:
    • Navigation BlockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience..
    • Template editor.
    • Patterns.
    • Styling.
    • Mobile Team.
    • Components Team.
  • Task Coordination.
  • Open Floor.

If you are not able to attend the meeting, you are encouraged to share anything relevant for the discussion:

  • If you have an update for the main site editing projects, please feel free to share as a comment or come prepared for the meeting itself.
  • If you have anything to share for the Task Coordination section, please leave it as a comment on this post.
  • If you have anything to propose for the agenda or other specific items related to those listed above, please leave a comment below.

#agenda, #core-editor, #core-editor-agenda, #meeting

A Week in Core – January 10, 2022

Welcome back to a new issue of Week in CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.. Let’s take a look at what changed on TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. between January 3 and January 10, 2022.

  • 41 commits
  • 63 contributors
  • 65 tickets created
  • 8 tickets reopened
  • 51 tickets closed

The Core team is currently working on the next major release, WordPress 5.9 🛠

Ticketticket Created for both bug reports and feature development on the bug tracker. numbers are based on the Trac timeline for the period above. The following is a summary of commits, organized by component and/or focus.

Code changes

Administration

  • Add missing texture image for Welcome panel & About page – #54489, #54270
  • Refresh the Dashboard Welcome panel – #54489

Build/Test Tools

  • Add the 5.9 branchbranch A directory in Subversion. WordPress uses branches to store the latest development code for each major release (3.9, 4.0, etc.). Branches are then updated with code for any minor releases of that branch. Sometimes, a major version of WordPress and its minor versions are collectively referred to as a "branch", such as "the 4.0 branch". to the workflow for testing branches
  • Re-enable E2E tests for the 5.8 branch – #54749
  • Update qUnit test fixtures after [52535]#54745

Bundled Themes

  • Fix: WordPress default presets aren’t loaded for all themes – #54781
  • Update some default presets in use by default themes to the new format – #54782
  • Twenty Twenty-Two: Sync updates from GitHubGitHub GitHub is a website that offers online implementation of git repositories that can can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ for RCrelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta). 1 – #54318

Coding Standards

  • Remove empty space at end of inline comment in _add_default_theme_supports()#54731
  • Correct alignment in get_block_editor_settings()#54728
  • Use strict comparison in wp-admin/options.php#53359
  • Use strict comparison in wp-admin/plugin-install.php#54728
  • Use strict comparison in wp-admin/revision.php#54728
  • Use strict comparison in wp-admin/themes.php#54728

Editor

  • Update wordpress packages for WP 5.9 RC 1 – #54487

Embeds

  • Fix oEmbed host script enqueueing on blockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience.-based themes – #44632

External Libraries

  • Update jQuery hoverIntent to version 1.10.2 – #54722, #51812

Formatting

  • Correctly encode ASCII characters in post slugs

HTTPHTTP HTTP is an acronym for Hyper Text Transfer Protocol. HTTP is the underlying protocol used by the World Wide Web and this protocol defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways.

  • Improve docs for wp_remote_retrieve_header function return value – #51736

Help/About

  • Change the HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. title of Themes Screen and add related HelpHub Docs link – #54707
  • Change the Learn WP link in the about page – #54755
  • Correction in “Managing Themes” HelpHub Docs link – #54707
  • Correction on the documentation link about adding new themes – #54709
  • Use “refactoring” noun form in WordPress 5.9 About Page – #54270
  • WordPress 5.9 About Page

Login and Registration

  • Remove aria-expanded from “Generate Password” button – #54538
  • Rename login_language_switcher_args to login_language_dropdown_args#54696
  • Rename two filters related to language dropdown for better consistency – #54696

Query

  • Improve sanitization within WP_Meta_Query
  • Improve sanitization within WP_Tax_Query

REST APIREST API The REST API is an acronym for the RESTful Application Program Interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data. It is how the front end of an application (think “phone app” or “website”) can communicate with the data store (think “database” or “file system”) https://developer.wordpress.org/rest-api/.

  • Add unit tests for the 404 template slug handler – #54680
  • Typo correction in a link description object – #54745

RevisionsRevisions The WordPress revisions system stores a record of each saved draft or published update. The revision system allows you to see what changes were made in each revision by dragging a slider (or using the Next/Previous buttons). The display indicates what has changed in each revision.

  • Improve _set_preview for case when autosave is missing – #54708

TaxonomyTaxonomy A taxonomy is a way to group things together. In WordPress, some common taxonomies are category, link, tag, or post format. https://codex.wordpress.org/Taxonomies#Default_Taxonomies.

  • Typo correction in context used for the navigation link block title – #54566

Themes

  • Make block themes support HTML5 by default – #54731, #54597

Upgrade/Install

  • Avoid using unserialize() unnecessarily
  • Fix parameter count in error call when an automatic core upgrade fails – #53284
  • Make first comment URLs translatable – #54535

Props

Thanks to the 63 people who contributed to WordPress Core on Trac last week: @hellofromTonya (9), @audrasjb (7), @desrosj (5), @SergeyBiryukov (4), @costdev (4), @xknown (4), @tobifjellner (3), @jdy68 (3), @dd32 (3), @marybaum (3), @sabernhardt (2), @oandregal (2), @critterverse (2), @kebbet (2), @melchoyce (2), @walbo (2), @webcommsat (2), @Mamaduka (2), @johnjamesjacoby (2), @davidbaumwald (2), @peterwilsoncc (2), @vortfu (2), @chanthaboune (1), @mukesh27 (1), @mkaz (1), @kjellr (1), @ryelle (1), @annezazu (1), @paaljoachim (1), @richtabor (1), @Clorith (1), @mitogh (1), @adamsilverstein (1), @kafleg (1), @faisal03 (1), @swissspidy (1), @westonruter (1), @rachelbaker (1), @ockham (1), @flixos90 (1), @cbringmann (1), @smit08 (1), @nalininonstopnewsuk (1), @hlashbrooke (1), @sainthkh (1), @devutpol (1), @Chouby (1), @la-geek (1), @zieladam (1), @whyisjake (1), @iandunn (1), @ehtis (1), @alexstine (1), @dansoschin (1), @jameskoster (1), @noisysocks (1), @karmatosed (1), @poena (1), @robtarr (1), @felipeelia (1), @joyously (1), @ocean90 (1), and @titsmaker (1).

Congrats and welcome to our new contributor of the week: @dansoschin, @robtarr ♥️

Core committers: @audrasjb (13), @sergeybiryukov (9), @hellofromtonya (5), @davidbaumwald (4), @desrosj (4), @ryelle (3), @jorgefilipecosta (2), and @noisysocks (1).

#5-9, #core, #week-in-core

WordPress 5.9 Field Guide

WordPress 5.9 unlocks the ability to build with blocks across all parts of your site, bringing advanced design tools to build your templates, themes, and style your sites in new and exciting ways.

Let’s take a look at what to expect in WordPress 5.9.

BlockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. Editor

WordPress 5.9 might be the largest release of GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ features since the initial Gutenberg launch in WordPress 5.0. The latest version includes a full suite of site editing tools bringing the block editor to the full screen. This includes a new way to build themes, new ways to create templates, and style your site. Plus a dozen new theme blocks to load dynamic content.

All of this is shown off in the beautiful new Twenty Twenty-Two default theme.

Review the block theme dev notedev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include: a description of the change; the decision that led to this change a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase. for more information around block themes and how to get started building your own.

WordPress 5.9 incorporates all of the changes to the Gutenberg plugin since the last release until the code freeze which was Gutenberg 11.9; to see in detail all that these entail see the “What’s New” post for the releases: 10.8, 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9

Here are the dev notesdev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include: a description of the change; the decision that led to this change a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase. related to block editor updates:

Performance

CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways.

Internationalization

Themes & CustomizerCustomizer Tool built into WordPress core that hooks into most modern themes. You can use it to preview and modify many of your site’s appearance settings.

PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher 8.0 and 8.1

Tooling

Other Developer Updates

But wait, there’s more!

5.9 offers so much more! Over 100 bugs, 99 enhancements, 5 feature requests, and 51 blessed tasks have been marked as fixed in WordPress 5.9.

Here are a few additional:

  • Switch to block theme from customizer (Trac 54549)

#5-9, #field-guide

Performance Chat Agenda: 11 January 2022

Here is the agenda for this week’s performance team meeting scheduled for January 11, 2022, at 16:00 UTC.

  • Announcements
  • Focus group updates
    • Images
    • Object caching
    • Site Health
    • Measurement
    • JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/.
  • Infrastructure
  • Open floor

This meeting happens in the #performance channel. To join the meeting, you’ll need an account on the Making WordPress Slack.

#agenda, #meeting, #performance, #performance-chat

WordPress 5.9 and PHP 8.0-8.1

PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher 8.1 was released on 25 November 2021. PHP 8.1 contains new features, performance improvements, deprecations, and backward compatibility breaks. For more information, see the PHP 8.1 release page, changelog, and migration guide.

WordPress is not fully compatible with PHP 8.0 or 8.1. All remaining known PHP 8.1 issues are deprecation notices.

Please note, a deprecation notice is not an error, but rather an indicator of where additional work is needed for compatibility before PHP 9 (i.e. when the notices become fatal errors). With a deprecation notice, the PHP code will continue to work and nothing is broken.

The following is a breakdown of changes in WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. that pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party and theme developers need to be aware of and accommodate in their code.

PHP 8.1 Remaining known deprecation notices

Deprecation notices remain in WordPress 5.9 and work will continue in the 6.0 cycle.

What is required to resolve each?

  • Resolution requires a more structural and all-encompassing solution for input validation (i.e. validating the data type and, in some cases, value passed to a function/method) to be architected and implemented to properly fix the underlying bugbug A bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority. rather than introducing buggy unexpected behavior by haphazardly silencing the deprecation notice.
  • Each notice needs investigation to determine the impact of such changes.
  • Each change requires thorough testing including full coverage happy and unhappy unit/integration tests.

The remaining known deprecation notices include:

  • Functions in the wp-includes/formatting.php file.
  • parse_url() or wp_parse_url() passed directly to a non-nullable in PHP native function without validating a string type is returned (i.e. both will return null when the requested component doesn’t exist within the given URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org (see the PHP manual)).
  • wp_xmlrpc_server::mw_newPost(): changing content structure default values from null to an empty string. This change requires a review from XMLRPC domain expert and more testing.
  • Upgrade to Requests 2.0.0: Originally planned for WordPress 5.9, but reverted due to issues with WordPress Core’s updater. Currently planned for 6.0 (TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. #54504).

To follow or contribute to this ongoing work, see Trac #53465, #53635, #54183, and #54730.

WordPress Core Changes

PHP 8.0 polyfills introduced

The following PHP 8 polyfills are available in WordPress 5.9:

Each polyfill loads into memory when the site is run on PHP versions less than PHP 8.0.

PHP 8.0 named parameters: match parent to child class method signatures

As noted last year in the PHP 8.0 dev note, WordPress Core is not compatible nor supports named parameters:

Using named parameters when calling WordPress functions and class methods is explicitly not supported and highly discouraged until this audit can be completed, as during the audit, parameter names are subject to change without notice. When this audit has been completed, it will be announced in a future developer note.

In 5.9, WordPress Core’s parent and child class method signatures were changed. The parameter names match in the parent and child methods.

If you extend Core classes and choose to support named parameters, you’ll need to audit and change each method being overloaded to ensure the method signatures match the Core class being extended.

To follow or contribute to this review, see Trac #51553, and #50531.

PHP 8.1 readonly() renamed to wp_readonly()

Though originally planned as a reserved keyword, PHP 8.1 changed readonly keyword to a (limited) contextual keyword with potential future plans to deprecate.

WordPress 5.9 renames the readonly() function to wp_readonly(). For PHP 8.0 or earlier, the original readonly() function is loaded into memory but deprecated.

Reference:

PHP 8.1 return type enforcement and new #[ReturnTypeWillChange] attribute

PHP 8.1 introduces a new #[ReturnTypeWillChange] attribute to silence the deprecation notice for each PHP native interface method where the overloaded method’s return type is incompatible. WordPress Core adds the attribute to each of its instances.

When overloading a PHP native interface method, you should either have the return type declared (in a covariant compatible manner with the PHP native interface method declaration), or add the #[ReturnTypeWillChange] attribute to silence the deprecation notice.

For example, when implementing the ArrayAccess interface, ensure the required methods are compatible or add the attribute as follows:

/**
 * @param mixed $offset The offset to check for.
 *
 * @return bool True on success or false on failure.
 */
#[ReturnTypeWillChange]
public function offsetExists( $offset ) {
	// the code
}

/**
 * @param mixed $offset The offset to retrieve.
 *
 * @return mixed The offset’s value.
 */
#[ReturnTypeWillChange]
public function offsetGet( $offset ) {
	// the code
}

/**
 * @param mixed $offset The offset to assign the value to.
 * @param mixed $value  The value to set.
 */
#[ReturnTypeWillChange]
public function offsetSet( $offset, $value ) {
	// the code
}

/**
 * @param mixed $offset The offset to unset.
 */
#[ReturnTypeWillChange]
public function offsetUnset( $offset ) {
	// the code
}

See the PHP RFC: Add return type declarations for internal methods.

PHP 8.1 MySQLi default error mode changed

PHP 8.1 changed the default mysqli error mode from silent to fatal error.

Prior to PHP 8.1, the default error handling mode of MySQLi was silent (i.e. MYSQLI_REPORT_OFF). An error in the extension, database, query, or the database connection returned false and emitted a PHP warning.

PHP 8.1 changed the default error mode to MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT. An error in the extension, database, query, or the database connection throws a fatal error exception.

WordPress Core has its own error reporting and gracefully handles the database errors by inspecting the error codes. In 5.9, Core sets MySQLi error reporting to off to avoid fatal errors due to uncaught exceptions and maintains the current behavior (see Trac #52825).

If you are using wpdb, 5.9 takes care of this for you. However, if you are not using wpdb, you will need to make changes in your theme or plugins. It is recommended to switch to wpdb.

References:

PHP 8.1 deprecation: passing null to non-nullable PHP native functions parameters

A deprecation notice is thrown when passing a null value to a PHP native function’s parameter that is not declared nullable. The value will continue to be coerced, meaning the PHP behavior has not (yet) changed. However, in PHP 9, a TypeError will be thrown.

For example, passing null to strlen() (which expects a string type) will throw the following notice:

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in .. on line ..

The deprecation notice identifies where an underlying bug exists in the code base. Rather than merely silencing the deprecation, the approach taken in WordPress Core is to fix each underlying bug notice through input validation (i.e. validating what is passed to the function) or targeted guarding to skip processing for type mismatches.

As noted previously, deprecation notices remain in WordPress Core. These remaining deprecation notices will require a more structural and all-encompassing architectural solution and tests to avoid haphazardly silencing the deprecation notice while potentially introducing buggy, unexpected behavior.

To follow or contribute to this effort, see Trac #54730.

What do you need to do?

Analyze each deprecation notice in your theme or plugin and craft a solution that resolves the bug.

For example, skip the trim() operation when the value to trimmed is not scalar:

if ( is_scalar( $value ) ) {
	$value = trim( $value );
}

Check that a string type is returned from the following function before passing the returned value to a PHP native function:

  • parse_url() or wp_parse_url() will return null when the requested component doesn’t exist within the given URL (see the PHP manual).
  • filter_input() will return null if the var_name to get is not set or if using FILTER_NULL_ON_FAILURE flag but the filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output. fails.

For example:

$url_path     = parse_url( $url, PHP_URL_PATH );
$url_filename = '';
if ( is_string( $url_path ) && '' !== $url_path ) {
	$url_filename = basename( $url_path );
}

References:

PHP 8.1 deprecation: autovivification on false

Autovivification is the automatic creation of an array. When a variable is defined as a boolean false and then used as an array as shown,

$arr   = false;
$arr[] = 2;

PHP 8.1 throws a deprecation notice:

Deprecated: Automatic conversion of false to array is deprecated in .. on line ..

In PHP 8.1, this code will continue to work; however, in PHP 9.0, it will result in a fatal error.

There are multiple ways to fix your code to not only resolve the deprecation notice but to also avoid a fatal error in the future when PHP 9 is released. Some of ways include:

  • Declare an array before using it, i.e. $arr = array();.
  • Check the returned value to ensure it is an array or at minimum not false before using.
  • When getting an option with get_option(), if an array type is expected, set the default to an empty array.
$options = get_option( ‘some_option’, array() );

For more information, see the PHP RFC: Deprecate autovivification on false.

PHP 8.1 deprecation: implicit incompatible float to int conversion

The implicit conversion of float to int which leads to precision loss will throw a deprecation notice.

$arr = array();
$arr[15.5]; // will throw the deprecation notice because 0.5 is lost

References:

PHP 8.1 other notable deprecations and changes

The following functions are deprecated:

  • Date functions: date_sunrise(), date_sunset(), gmstrftime(), strftime(), strptime().
  • Hash functions:  mhash(), mhash_keygen_s2k(), mhash_count(), mhash_get_block_size(), and mhash_get_hash_name() .
  • Calling key(), current(), next(), prev(), reset(), or end() on objects is deprecated.

The following functions changed:

  • The default of ENT_COMPAT changed to ENT_QUOTES | ENT_SUBSTITUTE in these functions htmlspecialchars(), htmlentities(), htmlspecialchars_decode(), html_entity_decode(), and get_html_translation_table() (Trac #53465).
  • Undocumented operation abbreviations can no longer be passed to version_compare().

See the Migrating from PHP 8.0.x to PHP 8.1.x for a complete list of deprecations and changes.

External Libraries

WordPress 5.9 includes the following updated external libraries:

  • GetID3 1.9.21 which includes preliminary PHP 8.1 support (Trac #54162).
  • SimplePie 1.5.7 which includes significant PHP 8.0 and 8.1 compatibility improvements ( Trac #54659).
  • PHPMailer 6.5.1 which includes preliminary PHP 8.1 support (Trac #53953).

The Requests 2.0.0 library was originally planned for WordPress 5.9. However, due to issues with WordPress Core’s upgrader, it was reverted and planned for 6.0 (Trac #54504).

Test Suites and Tooling

Changes to the WordPress Core PHP Test Suite

What about static tooling? Can it identify incompatibilities?

PHPCompatibility can only find a limited amount of these issues. PHPStan/Psalm/Exakat may find more, but are prone to false positives for non-typed code bases.

A Good Test Suite is the first line of defense

Most of the incompatibilities can be found through a good test suite, which includes full test coverage of both happy and unhappy paths.

Theme and plugin developers are encouraged to extend your test suites.

WordPress Core’s test coverage is currently less than 10%. You are invited and encouraged to contribute tests to grow test coverage in WordPress.

PHPUnit deprecation notices

In PHPUnit < 9.5.10/8.5.21, if a PHP native deprecation notice was encountered, PHPUnit would:

  1. Show a test which causes a deprecation notice to be thrown as “errored”;
  2. Show the first deprecation notice it encountered;
  3. Exit with a non-0 exit code (2), which will fail a CI build.

As of PHPUnit 9.5.10/8.5.21, if a PHP native deprecation notice is encountered, PHPUnit will:

  1. Show a test which causes a PHP deprecation notice to be thrown as “risky”;
  2. Show all deprecation notices it encountered;
  3. Exit with a 0 exit code, which will pass a CI build.

To follow or contribute to this review, see Trac #54183.

Why is this a problem?

These deprecations will become errors in the next PHP major and they will still need to be fixed. As CI builds pass, the deprecations go unnoticed. This means more deprecations remaining in WordPress Core, and would lead to more reports of deprecation notices from end-users.

What’s changing in WordPress Core?

The single site and multisitemultisite Used to describe a WordPress installation with a network of multiple blogs, grouped by sites. This installation type has shared users tables, and creates separate database tables for each blog (wp_posts becomes wp_0_posts). See also network, blog, site PHPUnit configuration files for WordPress Core now include the following attributes:

convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
convertNoticesToExceptions="true"
convertDeprecationsToExceptions="true"

How does this solve the problem?

This will cause CI builds to fail when a native PHP deprecation notice is encountered, meaning that deprecation notices can not go unnoticed.

Are there any negatives?

Only the first deprecation notice will be shown for a test, and there may be more issues hiding behind a deprecation.

What’s coming in PHP 8.2

A significant change is coming in PHP 8.2 which could impact your themes and plugins. The  RFC to deprecate dynamic properties was approved. See the RFC for more information.


Props to @costdev and @jrf for contributing to this dev notedev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include: a description of the change; the decision that led to this change a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase., and to @costdev, @antonvlasenko, @javiercasares, and @andraganescu for reviewing.

#5-9, #dev-notes

Updates for Settings, Styles, and theme.json

Changes in v2 of theme.jsonJSON JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML.

WordPress 5.9 is evolving the theme.json v1 introduced in WordPress 5.8 to a v2. The existing v1 theme.json files will still work as expected, and they’ll be transformed at runtime to the v2 format by WordPress.

Please, refer to the live specification document for a detailed description of the theme.json file capabilities.

Changes per section

Version

It’s now 2 instead of 1.

You don’t need to update the v1 file for it to work, as it’ll be transformed into v2 at runtime for you. However, if you want to update a v1 file, keep in mind that you have to update the version value and potentially change the names of some keys. See below for a full set of changes.

For example, one of the changes from v1 to v2 is that the customLineHeight key has been renamed to lineHeight. Besides changing from version 1 to 2, you also need to rename the old customLineHeight name, as it’s an invalidinvalid A resolution on the bug tracker (and generally common in software development, sometimes also notabug) that indicates the ticket is not a bug, is a support request, or is generally invalid. key for the v2 file and will be ignored.

Settings

The following section documents the changes done to settings in v2:

  • appearanceTools: new key; see section below for a detailed description.
  • border:
    • customRadius has been renamed to radius.
    • colorstyle, and width keys have been added; they control the visibility of the corresponding UIUI User interface controls. false by default.
  • color:
    • text and background keys have been added. They control the visibility of the corresponding controls. true by default.
    • defaultGradients and defaultPalette keys have been added to control whether the color palette UI control should show the default colors (gradients and solids, respectively) in addition to the theme colors. true by default.
  • spacing:
    • customMargin and customPadding have been renamed to margin and padding, respectively.
    • blockGap is a new key, see section below for a detailed description.
  • typography:
    • customLineHeight has been renamed to lineHeight.
    • fontStylefontWeightletterSpacingtextDecoration, and textTransform keys have been added. They control the visibility of the corresponding UI controls. true by default.
    • fontFamilies preset has been added. Themes can now provide a list of fonts to be displayed to the user in the blocks that support the font family style. WordPress doesn’t provide any font family by default.
    • The fontSizes preset has been updated. The Normal and Huge sizes (with normal and huge slugs) have been removed from the list, and Extra Large (x-large slug) has been added. While the UI controls will no longer show the Normal and Huge values, their CSSCSS Cascading Style Sheets. classes and CSS Custom Properties are still enqueued to make sure content that uses them still works as expected.

Styles

The following section documents the changes done to styles in v2:

  • bordercolorstyle, and width styles are now allowed.
  • filter: new section to allow themes to attach filters to styles. So far, it only includes the duotone filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output..
  • spacing: added a new style property, blockGap; see section below for a detailed description.
  • typographyfontFamilyfontStylefontWeightletterSpacingtextDecoration, and textTransform styles are now allowed.

Custom templates

The customTemplates field has been introduced in version 2. It allows themes to declare their custom templates that should be present in the templates folder.

For example, for a custom template named my-custom-template.html, the theme.json can declare what post types can use it and what’s the title to show the user:

  • name: mandatory.
  • title: mandatory, translatable.
  • postTypes: optional, only applies to the page by default.

Example (theme.json):

{
  "version": 2,
  "customTemplates": [
    {
      "name": "my-custom-template",
      "title": "The template title",
      "postTypes": [
        "page",
        "post",
        "my-cpt"
      ]
    }
  ]
}

Template parts

The templateParts field has been introduced in version 2. It allows themes to list the template parts present in the partsfolder.

For example, for a template part named my-template-part.html, the theme.json can declare the area term for the template part entity responsible for rendering the corresponding blockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. variation (HeaderHeader The header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes. block, Footer block, etc.) in the editor. Defining this area term in the theme.json will allow the setting to persist across all uses of that template part entity instead of a block attribute that would only affect one block. Defining area as a block attribute is not recommended as this is only used ‘behind the scenes’ to bridge the gap between placeholder flows and entity creation.

Currently, block variations exist for “header” and “footer” values of the area term. Any other values and template parts not defined in the json will default to the general template part block. Variations will be denoted by specific icons within the editor’s interface, will default to the corresponding semantic HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. element for the wrapper (this can also be overridden by the tagName attribute set on the template part block), and will contextualize the template part allowing more custom flows in future editor improvements.

  • name: mandatory.
  • title: optional, translatable.
  • area: optional, will be set to uncategorized by default and trigger no block variation.

Example (theme.json):

{
  "version": 2,
  "templateParts": [
    {
      "name": "my-template-part",
      "title": "Header",
      "area": "header"
    }
  ]
}

Appearance tools

The new setting appearanceTools serves to opt-in a number of other settings that are disabled by default, serving themes to quickly enable every setting available.

In v2, setting appearanceTools true opts-in to the following settings that are false by default:

  • border: color, radius, style, width
  • color: link
  • spacing: blockGap, margin, padding
  • typography: lineHeight

BlockGap

The blockGap adjusts the vertical margin, or gap, between blocks. It is also used for the gap between inner blocks in rows, buttons, and social icons. In the editor, the control for the blockGap is called Block spacing, located in the Dimensions panel.

By default the block gap support is disabled for all themes, but you can enable it in your theme.json with two different ways:

  • Set its value to false to enable the block gap styles support but keep the per block control hidden in the inspector controls of blocks.
  • Set its value to true to enable the block gap styles support and allow users to tweak the block gap per block (buttons, rows groups, social icons).

Example (theme.json):

{
	"version": 2,
	"settings": {
		"spacing": {
			"blockGap": true,
		}
	},
	"styles": {
		"spacing": {
			"blockGap": "1.5rem"
		}
	}
}

Changes to the global stylesheet

Default font sizes, colors, and gradients

The CSS for some of the presets defined by WordPress (font sizes, colors, and gradients) was loaded twice for most themes: in the block-library stylesheet plus in the global stylesheet. Additionally, there were slight differences in the CSS in both places.

We’ve consolidated the CSS of presets into the global stylesheet, that is now loaded for all themes. Each preset value generates a single CSS Custom Property and a class, as in:

/* CSS Custom Properties for the preset values */
body {
  --wp--preset--<PRESET_TYPE>--<PRESET_SLUG>: <DEFAULT_VALUE>;
  --wp--preset--color--pale-pink: #f78da7;
  --wp--preset--font-size--large: 36px;
  /* etc. */
}

/* CSS classes for the preset values */
.has-<PRESET_SLUG>-<PRESET_TYPE> { ... }
.has-pale-pink-color { color: var(--wp--preset--color--pale-pink) !important; } 
.has-large-font-size { font-size: var(--wp--preset--font-size--large) !important; }

For themes to override the default values they can use the theme.json and provide the same slug. Themes that do not use a theme.json can still override the default values by enqueuing some CSS that sets the corresponding CSS Custom Property.

Example (sets a new value for the default large font size):

:root {
 --wp--preset--font-size--large: <NEW_VALUE>;
}

In v1, when a user selected a link color for a specific block we attached a class to that block in the form of .wp-element-<ID> and then enqueued the following style:

.wp-element-<ID> a { color: <USER_COLOR_VALUE> !important; }

While this preserved user preferences at all times, the specificity was too strong and conflicted with some blocks with legit uses of an HTML element that shouldn’t be considered links. To address this issue, we removed the !important and updated the corresponding blocks to style the a elements with a specificity higher than the user link color, which now is:

.wp-element-<ID> a { color: <USER_COLOR_VALUE>; }

As a result of this change, it’s now the block author and theme author’s responsibility to make sure the user choices are respected at all times and that the link color provided by the user (specificity 011) is not overridden.


Props to @oandregal for writing this dev notedev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include: a description of the change; the decision that led to this change a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase., and @mkaz for reviewing.

#5-9, #dev-notes

Locking Blocks in WordPress 5.9

To facilitate creating better patterns and templates, WordPress 5.9 comes with a new blockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. level locking mechanism that works alongside templateLock.

Instead of applying a lock to all inner blocks, you can apply it selectively to individual blocks via the lock attribute. The block level locking would supersede the inherited templateLock value. You can choose to lock moving or removing a block.

APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways. definition

You can lock a block by default by adding locking to its definition, for example:

"attributes": {
    "lock": {
        "type": "object",
        "default": {
            "move": true,
            "remove": true
        }
    }
}

You can also lock a specific block in a pattern. In this example, the heading block is now locked and can’t be removed:

<!-- wp:media-text {"align":"full","mediaType":"image","verticalAlignment":"center"} -->
<div class="wp-block-media-text alignfull is-stacked-on-mobile is-vertically-aligned-center">
    <figure class="wp-block-media-text__media"><img src="https://s.w.org/images/core/5.8/architecture-04.jpg" alt="Close-up, abstract view of architecture." /></figure>
    <div class="wp-block-media-text__content">
        <!-- wp:heading {"textAlign":"center","level":3,"style":{"color":{"text":"#000000"}},"lock":{"remove": true}} -->
        <h3 class="has-text-align-center has-text-color" id="open-spaces-1" style="color: #000000;"><strong>Open Spaces</strong></h3>
        <!-- /wp:heading -->

        <!-- wp:paragraph {"align":"center","fontSize":"extra-small"} -->
        <p class="has-text-align-center has-extra-small-font-size"><a href="#">See case study ↗</a></p>
        <!-- /wp:paragraph -->
    </div>
</div>
<!-- /wp:media-text -->

Working alongside templateLock

Block locking supersedes template locking, see block template documentation, this allows it to override or undo on the specified block:

For removing:

lock.remove\templateLock"all""insert"false
truecan’t Removecan’t Removecan’t Remove
falsecan Removecan Removecan Remove
undefinedcan’t Removecan’t Removecan Remove

For moving:

lock.move\templateLock"all""insert"false
truecan’t Movecan’t Movecan’t Move
falsecan Movecan Movecan Move
undefinedcan’t Movecan Movecan Move

Unlike templateLock, block locking is not inheritable. If a block is locked from being removed, its children can still be removed. If you want to apply locking on children as well, add templateLock to the inner block component, or templateLock attribute to supporting blocks.


Props to @nadir for writing this dev notedev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include: a description of the change; the decision that led to this change a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase., and @get_dave for reviewing.

#5-9, #dev-notes