Bug Scrub Schedule for WordPress 6.4

Following sessions are dedicated to move things forward and be ready in time according to 6.4 Release Schedule.

Everyone is welcome to join not only to triagetriage The act of evaluating and sorting bug reports, in order to decide priority, severity, and other factors. tickets but also to look for tickets you can contribute by creating patches, making code review and testing. Keep in mind that all features and enhancements should be in the Trunktrunk A directory in Subversion containing the latest development code in preparation for the next major release cycle. If you are running "trunk", then you are on the latest revision. before BetaBeta A pre-release of software that is given out to a large group of users to trial under real conditions. Beta versions have gone through alpha testing in-house and are generally fairly close in look, feel and function to the final product; however, design changes often occur as part of the process. 1 and most bugs and all strings need to be there before RC1. If you are working on a 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., plan your contribution to have enough time for other contributors to make suggestions, review and test.

Alpha Bug Scrubs

Focus: features, enhancements and then bugs

Beta Bug Scrubs

Focus: rest of the bugs plus reported regressions

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). Bug Scrubs (if needed)

Focus: issues reported from the previous RC.

  • TBD

Check this schedule often, as it will change to reflect the latest information.

Regular component scrubs and triage sessions

For your reference, here are some of the recurring sessions:

Have a regular component scrub or triage session?
PingPing The act of sending a very small amount of data to an end point. Ping is used in computer science to illicit a response from a target server to test it’s connection. Ping is also a term used by Slack users to @ someone or send them a direct message (DM). Users might say something along the lines of “Ping me when the meeting starts.” @audrasjb@oglekler or @marybaum on 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/. to have it added to this page.

You can start your own triage sessions

  • Decide what you want to work on

6.4 triage session are our priority and moving forward tickets which already are scheduled for the release is most needed task. If you want to lead some of them, they can be added on this schedule.

But if you are interested in particular component or user focus, for example to take care about RTL-tickets, this will be most welcome too.

Especially interested can be the session to scrub old tickets. We are continuously closing new tickets with the same topic in favor of existing ones and because these tickets are looking complicated just because they’re age not, so many contributors are eager to work on them, but there are actual treasures hidden among very difficult or tricky topics.

  • Ping @oglekler or @marybaum on Slack with the day and time you’re considering as well as the report or tickets you want to scrub.

Useful reports and information

  • Report 5 provides a list of all open 6.4 tickets:
    • Use this list to focus on highest priority tickets first.
    • Use this list to focus on tickets that haven’t received love in a while.
  • Report 6 provides a list of open 6.4 tickets ordered by workflow.

Need a refresher on 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. scrubs? Checkout Leading Bug Scrubs in the coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. handbook.

Thanks to @audrasjb, @mukesh27 and @marybaum for helping to put together this agenda and peer review.

#6-4, #bug-scrub, #core, #props

What’s new in Gutenberg 16.9? (25 October)

“What’s new in 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/…” posts (labeled with the #gutenberg-new tag) are posted following every Gutenberg release on a biweekly basis, showcasing new features included in each release. As a reminder, here’s an overview of different ways to keep up with Gutenberg and the Site Editor project (formerly called Full Site Editing).

Decorative image that reads "What's new in Gutenberg 16.9?"

Gutenberg 16.9 has been released and is available for download!

The latest release includes several new enhancements, loads of 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. fixes, and continued work on Phase 3 features.

Rename (almost) all blocks from the editor

After a successful implementation of renaming Group blocks in Gutenberg 16.7 and feedback that the feature should be opened up, version 16.9 lets you rename nearly every block. A bonus for this feature is that theme authors can use this to label blocks in their theme templates and patterns.

Two panels shown next to each other. The first is a "Rename" field for customizing a block's name. The second is the "List View" in the block editor with the block highlighted to be renamed.

There are a few blocks that cannot be renamed:

  • core/block
  • core/template-part
  • core/pattern
  • core/navigation

Duplicate and rename patterns and more

Pattern management is getting a lot of nice feature additions. For individual patterns, you can now rename or duplicate them:

A block pattern showing a demo quotation. Above it is a dropdown menu with Rename, Duplicate, Export as JSON, and Delete options.

You can also rename or delete pattern categories directly from the user interface:

Patterns shown in the Site Editor in WordPress. At the top of the menu, a dropdown shows with Rename and Delete options for managing the current pattern category.

Gutenberg 16.9 also introduces two new media categories: Audio and Video. This should help better organize patterns by media type.

Other Notable Highlights

  • The Dimensions design tool control’s layout is much improved (55060).
  • The Template Part 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. now falls back to the current theme is there is no theme attribute provided (55217).
  • ​​A ton of CSSCSS Cascading Style Sheets. Level 4 viewport-relative units are now supported for more flexible control over various sizing options (54415).
  • getEntityRecords() calls now return pagination totals in the returned data (55164).

Changelog

Features

Create Block

  • Introduce the transformer property. (55423)

Data Views

  • Enable users to sort by date. (55388)

Block Library

  • Enable Block Renaming support for (almost) all blocks. (54426)

Enhancements

Command 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.

  • Add block-specific commands as contextual suggestions [#53539]. (53974)

Components

  • Add Tabs (a composable TabPanel v2). (53960)
  • Add type="button" to vanilla <button> elements. (55125)
  • ConfirmDialog: Ts unit testunit test Code written to test a small piece of code or functionality within a larger application. Everything from themes to WordPress core have a series of unit tests. Also see regression. storybook. (54954)
  • GradientPicker: Remove padding and disable overflow of color picker popovers. (55265)
  • Migrate Composite component from reakit to ariakit. (54225)
  • Remove margins from Notice component. (54800)

Patterns

  • Add duplicate pattern command. (55292)
  • Add rename command. (55188)
  • Add rename/delete options for pattern categories in site editor. (55035)
  • Register new media related categories. (55236)
  • Use modal for pattern duplication flow as workaround for changing sync status. (54764)

Block Editor

  • Migrating DownloadableBlocksList to use updated Composite implementation. (55272)

Block Library

  • Improve DimensionsTool control layout. (55060)
  • Template Part block: Fall back to current theme if no theme attribute is given. (55217)

Post Editor

  • Editor: Introduce PluginPostExcerpt slot. (55200)
  • Editor: Use hooksHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same. instead of HoCs in PostExcerpt. (55189)

Design Tools

  • Allow using CSS level 4 viewport-relative units. (54415)
  • Add changelog entry for #54415. (55201)
  • Remove 16:10 from 10:16 options from AspectRatioDropdown. (55053)

Data Views

  • Add drop down with action in headers. (55293)

Icons

  • Update fullscreen icon. (55021)

Format Library

  • Link format: Auto link pasted urls. (55195)

Site Editor

  • Migrating AddCustomTemplateModalContent to use updated Composite implementation. (55256)

Private APIs

  • Update consent string for using private APIs. (55182)

New APIs

  • CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Data: Retrieve the pagination totals in the getEntityRecords calls. (55164)

Bug Fixes

Block Library

  • PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher notice when an image with lightbox is deleted. (55370)
  • Cover Block: Check for previously uploaded media before setting the dimRatio. (55422)
  • Cover: Fix media type check in the onSelectMedia hook. (55168)
  • Fix Block Rename UIUI User interface perf regressionregression A software bug that breaks or degrades something that previously worked. Regressions are often treated as critical bugs or blockers. Recent regressions may be given higher priorities. A "3.6 regression" would be a bug in 3.6 that worked as intended in 3.5.. (55250)
  • Fix PHP notice when an image with lightbox is deleted in the behaviors file. (55385)
  • Fix: Wrong condition on cover block dimRatioToClass. (55356)
  • Focus submenu button when clicked. (55198)
  • Hide footnotes block from the inserter. (55058)
  • Image: Fix Lightbox display bug in Classic Themes. (54837)
  • Latest Posts: Add screen reader title text to Read more links and use alternative to excerpt_more 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.. (55029)
  • Latest Posts: Sync updates from Core (6.4). (55181)
  • List View: Change the aria-description attribute to aria-describedby. (55264)
  • Query LoopLoop The Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post. https://codex.wordpress.org/The_Loop. block: Reuse existing screen-reader-text CSS class for the enhanced pagination aria-live region. (55309)

Site Editor

  • Alternative: Fix template part area listing when a template has no edits. (55115)
  • Do not display ‘trashed’ navigation menus in SidebarSidebar A sidebar in WordPress is referred to a widget-ready area used by WordPress themes to display information that is not a part of the main content. It is not always a vertical column on the side. It can be a horizontal rectangle below or above the content area, footer, header, or any where in the theme.. (55072)
  • Pages list: Set status as no sortable. (55210)
  • Remove duplicate template areas from the site view sidebar. (54942)
  • Site Editor Styles Screen: Fix dancing styles previews. (55183)
  • Use accessorFn instead of cell to render status. (55196)

Interactivity API

  • Add aria-label attribute to navigation block only when it is open. (54816)
  • Fix server processing of wp-context getting out of sync. (55436)
  • Image: Disable lightbox editor UI for linked images. (55141)
  • Image: Reimplement lightbox trigger as a minimal button in corner of image. (55212)
  • Image: Stop crashing with Lightbox on image blocks without an image. (55269)
  • Remove the lightbox filter and view file when the lightbox setting is disabled. (55120)
  • Reset “Expand on click” image styles when window is resized. (55077)

Components

  • Changing Button component toggled style selector. (55065)
  • ColorPicker: Improve UXUX User experience of dragging the handle when in popover on top of the editor. (55149)
  • Colors: Fix color button border radii. (55207)
  • Iframeiframe iFrame is an acronym for an inline frame. An iFrame is used inside a webpage to load another HTML document and render it. This HTML document may also contain JavaScript and/or CSS which is loaded at the time when iframe tag is parsed by the user’s browser. / block drag chip: Fix positioning when dragging over an iframe. (55150)
  • ProgressBar: Use text color to ensure enough contrast against background. (55285)
  • Toolbar: Add unstyled variant. (55139)
  • useBlockPreview: Try outputting EditorStyles to ensure local style overrides are rendered. (55288)

Block Editor

  • LinkControl: Prevent horizontally long preview image from being stretched vertically. (55156)
  • List: Fix forward merging of nested list. (55121)
  • Paste: Fix MS Word list paste. (55127)
  • Writing flow: Fix selecting synced pattern. (55221)
  • Writing flow: Preserve block when merging into empty paragraph. (55134)
  • url: Update filterURLForDisplay to include all image, video, and audio file types. (54920)
  • Block Styles: Display default style label correctly in the block sidebar. (55008)
  • useBlockSettings: Add missing useMemo dependencies. (55204)

Data Views

  • Add linked title fallback. (55248)
  • PagePages: Fix unintended object mutation inside component. (55314)
  • Fix pagination. (55387)
  • Make date 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. translatable. (55445)

Patterns

  • Add categoryCategory The 'category' taxonomy lets you group posts / content together that share a common bond. Categories are pre-defined and broad ranging. selector to pattern creation modal. (55024)
  • Fix scrollbars on pattern transforms. (55069)

HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. API

  • Fix: Directive processor failing on updated HTML API. (55404)

Widgets Editor

  • Only suppress adminadmin (and super admin) notices when 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/. is enabled. (55403)

Data Layer

  • Fix combineReducers() types. (55321)
  • Get the page count as derived data. (55316)

Layout

  • Add selector as id to layout style overrides. (55291)

History

  • Try: Only render LastRevision component if 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 is active. (55253)

Block Directory

  • Fix filtering for downloadable blocks in inserter. (55243)

Global Styles

  • Use all the settings origins for a block that consumes paths with merge. (55219)

Post Editor

  • Fix wrong notification message shown when an entity is moved to trashTrash Trash in WordPress is like the Recycle Bin on your PC or Trash in your Macintosh computer. Users with the proper permission level (administrators and editors) have the ability to delete a post, page, and/or comments. When you delete the item, it is moved to the trash folder where it will remain for 30 days.. (55155)

Typography

  • Font Library: Show error if fetching collection fails. (54919)

Colors

  • I18ni18n Internationalization, or the act of writing and preparing code to be fully translatable into other languages. Also see localization. Often written with a lowercase i so it is not confused with a lowercase L or the numeral 1. Often an acquired skill. Make No color selected translatable text. (54814)

Rich Text

  • Paste: Only link selection if URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org protocol is http(s). (53000)

Patterns

  • Remove the version enforcement for npm in engines field. (55245)

Code Quality

  • Fix: Use y-webrtc room name terminology instead of docName. (55260)

AccessibilityAccessibility Accessibility (commonly shortened to a11y) refers to the design of products, devices, services, or environments for people with disabilities. The concept of accessible design ensures both “direct access” (i.e. unassisted) and “indirect access” meaning compatibility with a person’s assistive technology (for example, computer screen readers). (https://en.wikipedia.org/wiki/Accessibility)

Global Styles

  • Fix flickering when focusing on global style variations. (55267)

Interactivity API

  • Fix Image block lightbox missing alt attribute and improve accessibility. (55010)

Components

  • Modal: Fix closing when contained iframe is focused. (51602)

Block Library

  • Cover: Add aria-label to fixed and repeated image backgrounds. (50990)

Performance

Block Editor

  • Rich Text: Cleanup excess focusin/focusout listeners. (55382)
  • Optimize customClassName controls. (55345)
  • useBlockControlsFill: Avoid unneeded store subscriptions. (55340)

Parsing

  • Remove empty attrs. (54496)

Data Layer

  • Fix resolver resolution status key types mismatch causing unwanted resolver calls for identical state data. (52120)

Experiments

Data Views

  • Add status entity and use it in “admin views” experiment. (55050)
  • Add Grid Layout. (55353)
  • Add featured imageFeatured image A featured image is the main image used on your blog archive page and is pulled when the post or page is shared on social media. The image can be used to display in widget areas on your site or in a summary list of posts. field to the page list. (55246)
  • Adds a control to the views actions to switch layouts. (55311)
  • Fix the actions menu in the list view. (55426)

Block Library

  • Introduce experimental form and input blocks to allow building basic forms. (44214)
  • Mark forms blocks as experimental in block.json files. (55187)
  • Update the apiVersion in experimental blocks block.json files. (55186)

Components

  • Expose Tabs as private API. (55327)

Site Editor

  • Add author and status filter to the page list. (55270)

Documentation

  • Add “Get started with create-block” doc to the Getting Started section. (55373)
  • Add a “Get started with wp-scripts” doc to the Getting Started section. (55372)
  • Add backgroundImage to the 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. documentation for appearanceTools. (55376)
  • Add initial documentation for the DataViews component. (55435)
  • Augment Block.Edit filter documentation with performance guidance. (55252)
  • Correct the documented type for the $w parameter of block_core_navigation_add_directives_to_submenu(). (53585)
  • Document kind, name, plural for entity configuration. (55158)
  • Document updating the consent string to unlock private APIs. (55235)
  • Explain how to translate Gutenberg in standalone apps using the editor packages. (55080)
  • Fix callouts in end-to-end test documentation. (55300)
  • Fix code formatting due to bug in the “Get started with wp-env” doc. (55458)
  • Fix the position of the callout in the “Get started with wp-scripts” doc. (55457)
  • Font Library: Change all references to 6.4.0 by 6.5.0 core version. (55320)
  • Initial documentation of entity configuration. (55103)
  • PHP lib docs: Update to include information about prefixes in block PHP code. (55402)
  • Platform docs: Add a page to explain how to render HTML from a list of blocks. (55140)
  • Remove @return void from PHP function docs. (55237)
  • Remove the wp-now getting started doc. (55136)
  • Update LinkControl documentation with advice to memoize value prop. (54659)
  • Update nested-blocks-inner-blocks.md for WP 6.4 release. (55375)
  • docs/get-started-with-wp-env: Diagram and links added. (55381)
  • Update broken anchor link. (55233)

Code Quality

Data Views

  • Allow actions to be provided declaratively as a prop. (55192)
  • In list view, automatically insert header menu separators. (55412)
  • Update the data views component to pass a view object. (55154)
  • Update the view actions menu to be independent from current view APIs. (55294)
  • Normalize render fields function. (55411)
  • Rename accessorFn to getValue. (55434)
  • Update the view configuration to include fields visibility. (55247)

Block Library

  • Query block: Remove unnecessary class. (55438)

Site Editor

  • Fix: Remove unrequired nullish coalescing operator on canEditCss con…. (55357)

Global Styles

  • Update: Unset variable set by reference after a foreach loop. (55261)

Design Tools

  • Elements: Add unit tests for class and style generation. (55113)

Block Editor

  • Remove value syncing in Link Control. (51387)
  • Chore: Fix: Remove third parameter passed to shouldDismissPastedFiles. (55262)
  • Chore: Simplify code by removing unnecessary and condition. (55268)
  • useBlockSync: Fix typo and simplify test. (55203)

Data Layer

  • Update status entity label to Status and plural to getStatuses. (55160)

Gutenberg Plugin

  • Text Component: Typescript’n. (54953)

Tools

Testing

  • Don’t change error handling in WP_Theme_JSON_Gutenberg::Set_spacing_sizes(). (55354)
  • E2E: Add missing comment. (55093)
  • E2E: Try to fix the flaky autocomplete spec. (55081)
  • Migrate ‘Post Title block’ end-to-end tests to Playwright. (55297)
  • Migrate ‘text color’ end-to-end test to Playwright. (55323)
  • Migrate demo page tests to Playwright. (55054)
  • Migrate remaining Link UI tests to Playwright. (52828)
  • Playwright Utils: Introduce the editor.saveDraft helper. (55308)
  • Try to fix flaky synced pattern test. (55406)
  • Try to fix multi-block-selection flakiness. (55075)
  • WP_Theme_JSON_Gutenberg Unit tests: Fix phpunit warnings about set_spacing_sizes. (55313)
  • end-to-end Utils: Use frameLocator for retrieving editor canvas. (54911)

Build Tooling

  • Packages: Ensure only changed packages get published for WP releases. (55334)
  • WP_Env: tests-cli phpunit executable file not found in $PATH: Unknown. (54508)

First time contributors

The following PRs were merged by first time contributors:

Contributors

The following contributors merged PRs in this release:

@aaronrobertshaw @afercia @andrewhayward @andrewserong @anton-vlasenko @apeatling @aristath @artemiomorales @brookewp @carolinan @chad1008 @ciampo @dcalhoun @dmsnell @ecgan @ellatrix @fluiddot @getdave @glendaviesnz @gziolo @jffng @jhnstn @johnbillion @jorgefilipecosta @jrtashjian @jsnajdr @juanmaguitar @kevin940726 @kishanjasani @luisherranz @MaggieCabrera @Mamaduka @margolisj @matiasbenedetto @mcsf @michalczaplinski @mikachan @ndiego @ntsekouras @oandregal @ockham @peterwilsoncc @ramonjd @retrofox @richtabor @ryanwelcher @SantosGuillamot @scruffian @sethrubenstein @shimotmk @SiobhyB @spacedmonkey @stokesman @t-hamano @talldan @tellthemachines @tyxla @unscripted @WunderBart @youknowriad

Props to @jameskoster for designing assets for this post.

#block-editor, #core-editor, #gutenberg, #gutenberg-new

Dev Chat agenda, October 25, 2023

(Update – call for 6.4 end user documentation contributors)

The next weekly WordPress developers chat will take place on Wednesday, October 25, 2023 at 20:00 UTC in the core channel of Make WordPress Slack.

Further items will continue to be added as they come up in coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. and release leads channels on 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/..

Welcome and housekeeping

All are welcome to join Dev Chat.

Summary of Dev Chat, October 18, 2023 – thanks to @ironprogrammer.

Announcements

WordPress 6.4 Release Candidate 2 is available – please help test and make the release the best it can be. All details are on the post. Thanks to everyone who contributed towards this..

Highlighted posts

Due to time constraints during a release and to prioritize 6.4 items, some of the highlighted posts may not be raised during the live Dev Chat meeting.

Summary and insights from discussions on Phase 3

Forthcoming release updates

Next major WordPress release: 6.4

Forthcoming milestone:

New 6.4 related posts

6.4 Release Candidates phase

Update from contributors on docs for this release:

  • Field Guide for 6.4
  • You can also find all Developer Notes relating to 6.4 using this tag
  • If you think a ticketticket Created for both bug reports and feature development on the bug tracker. needs a 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, and 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 it has not been highlighted previously, send a message to Nalini on Slack for those working on the docs release or add it to the Documentation Tracker for 6.4
  • Call for contributors to assist with 6.4 End User documentation

Any issues relating to 6.4 tickets?

Existing 6.4 useful links

Release parties schedule for 6.4

This detailed guide will walk you through testing features in WordPress 6.4.

Roadmap to 6.4 – this release is scheduled for November 7, 2023.

Bug Scrub Schedule 6.4

6.4 Development Cycle

Project Board for Editor Tasks for WordPress 6.4 on GitHubGitHub GitHub is a website that offers online implementation of git repositories that 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/

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/

Tickets or Components help requests

Please add any items for this part of the agenda to the comments – tickets for 6.4 will be prioritized. If you can not attend dev chat live, don’t worry, include a note and the facilitator can highlight a ticket if needed.

Open floor

If you have any additional items to add to the agenda, please respond in the comments below to help the facilitator highlight them during the meeting.

#6-4, #agenda, #dev-chat

Performance Chat Summary: 24 October 2023

No agenda was posted prior to this meeting. The full chat log is available beginning here on Slack.

Announcements

  • We will shift the time of this meeting starting next week, October 31 at 16:00 UTC, to account for seasonal time changes starting next week in Europe.
  • Today is WordPress 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. Everything in the performance focus for this release has been resolved. Thanks to everyone who contributed to the 67 resolved performance focus tickets in this release 🎉
  • The fortnightly 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. scrub is scheduled for tomorrow at 15:00 UTC in #core-performance in 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/..
    • We plan to review 6.5 tickets. If anyone has things they plan to work on during this release, please make sure they are added to the milestone in advance of that meeting.

Priority Projects

Server Response Time

Link to roadmap projects

Contributors: @joemcgill @swissspidy @thekt12 @mukesh27

  • @swissspidy is drafting a blogblog (versus network, site) post covering next steps for merging the Performant Translations 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 (#59656)
  • @joemcgill plans to review work related to improving Template Loading (see: https://github.com/WordPress/performance/issues/746) for 6.5

Database Optimization

Link to roadmap projects

Contributors: @mukesh27 @thekt12

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/. & CSSCSS Cascading Style Sheets.

Link to roadmap project

Contributors: @mukesh27 @10upsimon @westonruter

  • @westonruter No updates for script loading strategies, except that WP 6.4 will implement them on the frontend.
  • @pereirinha I’ve been doing research on #59595. Was supposed to do an update last week, but I didn’t like the results. Today, he returned to it and is much happier with the direction. He plans to update the ticketticket Created for both bug reports and feature development on the bug tracker. before EOD. There will be findings and potential solution.

Images

Link to roadmap projects

Contributors: @flixos90 @thekt12 @adamsilverstein @joemcgill @pereirinha

  • @westonruter Just opened an overview issue to implement “Image Loading Optimization via Client-side Detection”
    • “For the past few weeks, I’ve been working on a document to outline the requirements and a proposed solution”
    • There is also a discussion issue from a year and a half ago that has a good bit of background.

Measurement

Link to roadmap projects

Contributors: @adamsilverstein @joemcgill @mukesh27 @swissspidy @flixos90

  • @joemcgill We had a lively discussion last week during the hallway hangout about this topic.
  • @flixos90 “Hard to summarize, but TLDR I think we are still trying to figure out ways to get more consistent (as in “less variance”) benchmarks within a single environment. While we apparently saw some more consistent metrics in the compare-wp-performance workflow that @swissspidy implemented, there is still high variance, and even the same WordPress versions may produce vastly different numbers. There’s a good chance that this is simply because GH Actions workers aren’t suitable for this kind of testing as they vary in their environment”
  • @flixos90 – I’ve been working on a simple PR to support detecting the kind of content for a WordPress URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org in 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. Archive: https://github.com/HTTPArchive/custom-metrics/pull/96

Ecosystem Tools

Link to roadmap projects

Contributors: @mukesh27 @swissspidy @westonruter

Creating Standalone Plugins

Link to GitHub overview issue

Contributors: @flixos90 @mukesh27 @10upsimon

  • @10upsimon Currently iterating on PR 864 in relation to issue 651 (Creating standalone plugins). Thank you to all who left feedback, much appreciated

Open Floor

  • n/a

Our next chat will be held on Tuesday, October 31, 2023 at 16:00 UTC in the #core-performance channel in Slack.

#core-performance, #performance, #performance-chat, #summary

Editor chat summary: Wednesday, October 18, 2023

This post summarizes the weekly editor chat meeting on Wednesday, 18 October 2023, 14:00 UTC, held in Slack.

Agenda of the meeting at https://make.wordpress.org/core/2023/10/17/editor-chat-agenda-wednesday-18-october-2023/.

Announcements

Last week we had security and maintenance releases for both WordPress and the 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/ 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: https://wordpress.org/news/2023/10/wordpress-6-3-2-maintenance-and-security-release/ and https://github.com/WordPress/gutenberg/releases/tag/v16.8.1. Please make sure they are both updated.
WordPress 6.4 RC1 was released on October 17 https://wordpress.org/news/2023/10/wordpress-6-4-release-candidate-1/.

Open floor

There were two questions raised by Andrei Glingeanu.

Question 1:

Is the possibility of adding custom tabs here prohibited intentionally?

Print screen of the 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. inspector sidebarSidebar A sidebar in WordPress is referred to a widget-ready area used by WordPress themes to display information that is not a part of the main content. It is not always a vertical column on the side. It can be a horizontal rectangle below or above the content area, footer, header, or any where in the theme. with a custom item added at the side of the page and block.

@jorgefilipecosta said:

 We never added extensibility api’s to create new tabs there. There was not an intentional decision to never do it, but there was also never a decision to do it. I guess the best bet for now is to create a custom sidebar.

Question 2:

Is there a standard way of outputting dynamic css for a custom block besides putting it inline in style="" attributes and without outputting <style> tags in the edit function of the block?

@jorgefilipecosta said:

In my personal opinion, it depends on the case:

  • If the dynamic CSSCSS Cascading Style Sheets. styles you want to add should affect just a single instance of the block I think using the style attribute may be the way to go.
  • If the dynamic CSS styles you want to add should affect all the instances of your custom block, I guess a good option is to use the global styles filters and 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. 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. to add the styles you want for the block dynamically.
  • If it is dynamic but there is a limited set of different possible styles e.g.: dynamic but there are like 5 different style configurations. Probably creating classes as part of the block styles CSS and then dynamically deciding which class to add to the block seems to be the way to go.

#core-editor, #core-editor-summary, #gutenberg, #meeting, #meeting-notes, #summary

Framework for storing revisions of Post Meta in 6.4

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. are now supported for post metaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. on an opt-in basis. This feature is currently used by coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. for footnotes – enabling footnotes to be correctly previewed, stored in autosaved and stored and retrieved from revisions. In the future, this may be expanded to the featured imageFeatured image A featured image is the main image used on your blog archive page and is pulled when the post or page is shared on social media. The image can be used to display in widget areas on your site or in a summary list of posts. which is also stored in meta.

When registering a new meta field with register_meta or register_post_meta, the $args parameter accepts a new revisions_enabled argument. This defaults to false—set to true to opt in to revisions for this meta field. Note that the object type the meta is being created for must have revision support in order for the meta field to have revisions enabled. Attempting to enable meta revisions for a post type that doesn’t support revisions will result in a doing_it_wrong warning.

This feature is designed to lay the groundwork for future improvements to 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/ as part of Phase 3: Collaboration. Care has been made to do this in a backwards compatible manner, but if you are unhooking anything in the post save/update process, please read this entire note and test your code before WordPress 6.4 is released

A new wp_post_revision_meta_keys 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. is introduced, which can be used to filter the list of meta fields to be revisioned. The post type is also passed to the filter, which can be used to adjust revisioning of meta fields.

// Example to add a `my_product_price` meta field to revisions.
function enable_revisions_for_product_price_field( $revisioned_keys ) {
	if ( ! in_array( 'my_product_price', $revisioned_keys, true ) ) {
		$revisioned_keys[] = 'product_price';
	}
	return $revisioned_keys;
}
add_filter( 'wp_post_revision_meta_keys', 'enable_revisions_for_product_price_field' );

The _wp_put_post_revision action, which fires once a revision is saved, includes a new parameter—the post ID associated with the revision. This is used by core to copy the meta data from the main post to the revision.

The wp_creating_autosave action, which fires before an autosave is stored, includes a new parameter `$is_update`, added to indicate if the autosave is being updated or was newly created.

Meta revisions are also stored for autosaves and when previewing posts, fixing a long standing 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. (#20299) that caused live post meta to be overwritten when post meta was previewed. This is because using update_post_meta to save meta to a revision actually resulted in it being saved to the parent post. With this change, developers can now opt in to meta revisions and core will correctly attach the meta data to the revision. Meta that has revisions is also restored when restoring an autosave or revision. 

The 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/. revisions endpoint now returns meta when stored as part of a revision and the autosaves endpoint now handles storing of meta.

The new meta revision features are enabled in core via hooksHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same.; removing the hooks will disable the features:

To disable post meta revisions entirely, use:

remove_action( 'wp_after_insert_post', 'wp_save_post_revision_on_insert', 9, 3 );

To disable storing post meta on autosaves, use:

remove_action( 'wp_creating_autosave', 'wp_autosave_post_revisioned_meta_fields' );

To disable restoring meta when restoring revisions or autosaves, use:

remove_action( 'wp_restore_post_revision', 'wp_restore_post_revision_meta', 10, 2 );

Important note: as part of this change, the timing for the storing of post revisions has been changed. Previously, revisions were created before post meta had been saved by the REST API on the post_updated hook.  Revisions are now hooked on the wp_after_insert_post action, fired after post meta has been saved. 

Special backwards compatibility consideration has been given to plugins that may be unhooking post_updated from wp_save_post_revision to disable revisions—in that case, core ensures revisions are still not created.


Props to @westonruter, @jorbin and @webcommsat for reviewing.

#6-4-2, #dev-notes, #dev-notes-6-4

WordPress 6.4 Field Guide

This guide shares more in-depth changes that you will find in 6.4 and is published in 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). cycle to help inform WordPress developers, extenders, and others. The release squad and many contributors across the global project have worked to bring these changes, and you can follow this work and add to the contribution using the ticketticket Created for both bug reports and feature development on the bug tracker. systems in Trac and GitHubGitHub GitHub is a website that offers online implementation of git repositories that 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/.

Some fascinating stats! TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. has about 268 tickets, 113 of which are enhancements and feature requests, 134 bug fixes, and 21 other tasks. This time, there are more than 64 tickets with a focus on performance, 17 for accessibility, and 16 for modernizing code and applying coding standards. 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/’s GitHub repo brings more than 1,400 updates/changes, providing to coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. more than 420 enhancements, 445 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. fixes, and 42 accessibility improvements.

Changes in 6.4 are spread across about 45 core components. Below is the breakdown of the most important ones.

You can also find all Developer Notes relating to 6.4 as they continue to be published until the release goes live. You can follow them using this tag.

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 6.4 is bringing six Gutenberg releases into the core – 16.2, 16.3, 16.4, 16.5, 16.6, 16.7. You will find Block HooksHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same., the ability to register their own media categories, changes to the @wordpress/components package, updates for the user interface components, and many other changes.

WordPress 6.4 introduces Block Hooks (#53987), a feature that provides an extensibility mechanism for Block Themes. This is the first step in emulating WordPress’ Hooks concept that allows developers to extend Classic Themes using filters and actions.

From WordPress 6.4, extenders can register their own inserter media categories and provide users with more options from which to choose.

6.4 brings in a number of notable changes to the @wordpress/components package.

There are a number of other changes, including a new background image block support, fluid typography, disabled layout controls globally or on a block basis by theme.json, Stabilized APIs for InnerBlocks, and much more.

Adminadmin (and super admin) notices

Two new functions abstract the HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. markup generation to reduce the maintenance burden, encourage consistency, and enable argument and message filtering for all admin notices used widely in WordPress Core and the extender community.

General

A developer note will be added later on the following change:

Introduce wp_trigger_error() to complement _doing_it_wrong() #57686

HTML 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.

WordPress 6.4 includes continued development of the HTML API, including the introduction of a minimal HTML Processor with the concept of breadcrumbs, and makes it possible to, for example, search for images that are direct children of a DIV.

Also included in 6.4, is the addition of a couple of CSSCSS Cascading Style Sheets./class helpers in the Tag Processor, which will make it possible to search for a tagtag A directory in Subversion. WordPress uses tags to store a single snapshot of a version (3.6, 3.6.1, etc.), the common convention of tags in version control systems. (Not to be confused with post tags.) containing more than one class name, or to search for a tag not containing a given class name.

Media

New WordPress installations will now have attachment pages fully disabled for new sites. This will benefit SEO by avoiding attachment pages created by default, which were indexed by search engines and could have led to bad results for users and site owners. The change introduces a wp_attachment_pages_enabled database option to control the attachment pages’ behavior. In the 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, and 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., there is information on how to update existing sites.

Additional Performance improvements

A significant part of the 6.4 release brings performance improvements and greater efficiency to WordPress.

New functions wp_load_options()get_options(), and wp_set_option_autoload_values() allow an enhanced performance of retrieving options from the database.

WordPress 6.4 brings many improvements to template loading.

  • Performance gains have been achieved by introducing caching using an object cache in a new method called WP_Theme::get_block_patterns().
  • Unnecessary checks were removed if a theme file existed in the theme functions that enhanced efficiency and performance. These improvements in the Themes API mean the current theme’s stylesheet directory is checked to ensure it matches the template directory, before further file existence checks are done. Improvements are also in the performance of get_block_theme_folders(). This is through a new method, WP_Theme::get_block_template_folders(), and improved error handling. The result is a quicker and more efficient lookup of block template folders within themes. WordPress developers and users can anticipate improved performance, reduced I/O overhead, and a smoother experience when working with block themes.

Improved image loading

Several enhancements to the wp_get_loading_optimization_attributes() function, which provides a central place to manage loading optimization attributes, specifically for images and iframes. 

Script Loader

In WordPress 6.4, script loading strategies are now employed for frontend scripts in core and bundled themes. For the most part, the defer loading strategy is used since it is more consistent in its loading behavior, in that a defer script always executes once the DOM has loaded; a script with async may actually block rendering if it is already cached. Additionally, loading with defer has been moved from the footer to the head so that they are discovered earlier while the document is loading and can execute sooner once the document is loaded.

Style loading

This dev note highlights the changes made in WordPress 6.4 to style loading. The main focus of the changes was to replace manually created style tags printed at the wp_head action with calls to wp_add_inline_style().

More performance-related changes

  • 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.: The double sanitization in the get_term function has been stopped. This will prevent the unnecessary calls to sanitize_term, which was detrimental to performance. Trac ticket #58329.
  • Themes: The TEMPLATEPATH and STYLESHEETPATH constants have been deprecated. get_template_directory() and get_stylesheet_directory() should be used instead. Trac ticket #18298

And there’s more!

Some of the additional changes in 6.4 to highlight.

Users

WordPress 6.4 brings a number of key improvements to the HTML markup of the wp-login.php page to make its structure more optimal and allow developers to have more customized individual styling flexibility. #30685

Clarify the “Add New” links in the Admin for better accessibilityAccessibility Accessibility (commonly shortened to a11y) refers to the design of products, devices, services, or environments for people with disabilities. The concept of accessible design ensures both “direct access” (i.e. unassisted) and “indirect access” meaning compatibility with a person’s assistive technology (for example, computer screen readers). (https://en.wikipedia.org/wiki/Accessibility)

In WordPress 6.4, the default values for the add_new label changed to include the type of content. This matches add_new_item and provides more context for better accessibility. The default value is ‘Add New Type’ for both hierarchical and non-hierarchical types. If you’ve previously used a label such as:

'add_new' => _x( 'Add New', 'Book', 'my-plugin' )

you are encouraged to change it to

'add_new' => __( 'Add New Book', 'my-plugin' )

Trac ticket #47125

Props to @swissspidy for this dev note.

Integration testing requirement change

PHPUnit Polyfills 1.1.0 is required for running integration tests with WordPress 6.4.

Trac ticket #59510

Props to @jrf for the information for this dev note.

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. API

  • HTTP API: WP_Http_Curl and WP_Http_Streams classes and filters have been deprecated as these classes have not been used in WordPress Core since the introduction of the Requests library. Trac ticket #58705

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.

Revisions are now supported for post metaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. on an opt-in basis. Trac ticket #20564


Props to @costdev, @bph, @nalininonstopnewsuk, @codente, @spacedmonkey, @desrosj, @flixos90 for input on this Field GuideField guide The field guide is a type of blogpost published on Make/Core during the release candidate phase of the WordPress release cycle. The field guide generally lists all the dev notes published during the beta cycle. This guide is linked in the about page of the corresponding version of WordPress, in the release post and in the HelpHub version page., and @joemcgill, @clarkeemily, @cbringmann, @akshaya, @611shabnam, and @priethor for peer review.
Thank you to all those involved in collating, writing, and editing developer notes relating to 6.4.

#6-4, #dev-notes, #dev-notes-6-4, #field-guide

Summary and Insights of Phase 3 related conversations

Over the last few months, I’ve had 20+ conversations with various folks across the WordPress ecosystem, from developers implementing WordPress at scale to folks working in large newsrooms to one-person operations. After leaving comments on the various Phase 3 posts, it felt advantageous to write a quick summary of the feedback to help inform our future work, akin to the efforts of the FSE Outreach program, and encourage others who might be having similar conversations to continue to share for the entire project to benefit from. 

Overview

Most conversations lasted about 45-60 minutes, with very few running into the two-hour range.  The conversations were open ended with folks broadly sharing their content process from ideation to completion and ended talking about the various phase 3 related posts with encouragement to engage. Of the 24 conversations, I have roughly grouped them across the following categories:

  • 3 individual developers with either experience implementing WordPress at scale or building collaborative tooling.
  • 1 person representing higher education.
  • 2 people running their own individual projects/sites.
  • 10 larger newsrooms or organizations.
  • 8 smaller newsrooms or organizations. 

These were sourced from a variety of connections including: GitHubGitHub GitHub is a website that offers online implementation of git repositories that 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/ issue creators, WordPress VIP intros, Newspack clients, “cold emailing”, folks from the FSE Outreach Program, and more. In full disclosure, I am sponsored by Automattic to do this work and leveraged these connections to reach out to a broader range of folks. For many, they are using a suite of tools to get the job done, often without deep integration, and usually landing in WordPress when the copy is nearly complete. Phase 3 would/could shift that experience, allowing folks to land and work within WordPress sooner and with that comes a list of features and requirements. Read on!

Collaborative editing & asynchronous collaboration 

At a high level, I repeatedly heard from folks in larger organizations more of an interest in collaboration in the form of the ability for multiple people to be in different parts of an article over true collaborative editing. Especially for larger to medium-sized publishers, there’s less of a need for real-time collaboration and more of a need for different sets of folks in an article simultaneously with blocks locked individually. The same applies to the experience of editing the details of a post, like a categoryCategory The 'category' taxonomy lets you group posts / content together that share a common bond. Categories are pre-defined and broad ranging. or featured imageFeatured image A featured image is the main image used on your blog archive page and is pulled when the post or page is shared on social media. The image can be used to display in widget areas on your site or in a summary list of posts. while not having access to edit the entire post itself. For example, someone from the photo team can place images without having the ability to edit the content blocks, or a handful of folks being able to edit tags directly without getting in the way of the writers. 

  • Multiple people editing a doc at once.
  • Role-specific permissions allowing some folks to accept/deny various edits.
  • More granular ability to edit specific parts of a post/page at once without having full access to everything, including 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. leveling locking.
  • Commenting functionality, including the ability to @ folks.
  • Public preview link for folks, regardless of whether they have access to the site. 

Workflows

No one I spoke with manages everything in WordPress with a wide range of additional tools and workflows in use from extraordinarily complex and manual to some setups with deeper automatic integration (status changes in X which automatically updates Y at the next step) to more manual organizing before adding anything into WordPress (adding images to a folder on a desktop before uploading). A need for a dashboard/task manager is clear as well as a need for integration with other tooling. 

  • Support for tasks that can be customized depending on the post type and have a built-in “severityseverity The seriousness of the ticket in the eyes of the reporter. Generally, severity is a judgment of how bad a bug is, while priority is its relationship to other bugs.” type (required vs nice to have). For example, a task might be more of a nice to have than a necessity, but both are worth calling out for the person to act on. 
  • Seeing changes that have occurred since you last opened a document (related to my note on revisions).
  • Tie notifications into different tasks and the status of articles to reduce the need to pingPing The act of sending a very small amount of data to an end point. Ping is used in computer science to illicit a response from a target server to test it’s connection. Ping is also a term used by Slack users to @ someone or send them a direct message (DM). Users might say something along the lines of “Ping me when the meeting starts.” someone in a separate system. For example, perhaps legal needs to be emailed about an article, or the media team needs to be notified that a post is ready for images.
  • Ability to see open tasks/open notifications with ease (task manager), along with an at-a-glance view of where something might stand (editorial calendar).
  • Section level locking for different parts of a post, like the post content vs. post title vs. featured image, tied into task management with perhaps reviews needed for each before publishing.
  • Solid integration options with other tools, like 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/./TrelloTrello Project management system using the concepts of boards and cards to organize tasks in a sane way. This is what the make.wordpress.com/marketing team uses for example: https://trello.com/b/8UGHVBu8/wp-marketing./Asana, for notifications and state changes (draft to pending review, reminding folks about assignments, etc).
  • Easy draft sharing for varying permission levels including stakeholders without access to the site itself.
  • Ability to publish with multiple authors.

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.

The most commonly requested items proved to be more visual revisions and the ability to track more than just post content changing. These stood out amongst the rest as the most broadly useful items. 

  • More visual revision history, perhaps with the option to toggle between code views.
  • Ability to track more than just post content, including changes to tags, a featured image, SEO, and other custom fields (like managing multiple headlines).
  • Ability to split out a revision to develop it separately from the main draft and keep track of how the current version continues with some form of track changes (this is likely more in an async workflow, but it relates).
  • Ability to see a notice of an audit trail when coming into a post after a few revisions, including who made which changes. For example, if an editor went through and made a number of changes to a post so the writer can see the difference.
  • A way to focus on a particular part of an article to see how it might have changed, rather than the entire piece.
  • Improved management of posts with numerous revision history events (think 50+). It’s currently pretty painful to try to go through revisions at scale.
  • Ability to readily schedule mass changes across the site. 

Tied to this, I’ll note from the FSE Outreach Program that feedback has come in very positively around the Style Revision experience both in terms of the visual nature and easy to understand timeline with a request to have that in place for templates and template parts.

Block library

The ability to configure more granular control over blocks continues to come up as a pain point, especially as more support is added by default in different ways that cause folks to feel a level of uncertainty and scrambling to keep up. Anything we can do to consolidate the methods for controlling block access and support would go a long way. For example, even if you use 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. to lock down all support and settings for coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress./media-text, block settings still appear in the block sidebarSidebar A sidebar in WordPress is referred to a widget-ready area used by WordPress themes to display information that is not a part of the main content. It is not always a vertical column on the side. It can be a horizontal rectangle below or above the content area, footer, header, or any where in the theme. due to that being defined in core/media-text’s component code and inserted in a custom panel.

Tied to this, folks want the ability to see where patterns are used across a site (“this pattern is used on x number of posts”) as a better way to gauge the impact of changes, particularly for synced patterns.

Finally, the ability to have theme.json partials on groups of blocks would be a huge step forward to provide a locked-down experience for folks who are in the position of simply trying to put content into a specific layout.

Media Library

Media management, from the ability to add folders to controlling copyright information, are big concerns for folks, especially in larger organizations where many images are uploaded per day.

  • Way to manage and view image attribution and copyright information. This was repeated often as a high priority item and major pain currently. 
  • Improved alternative text management. 
  • Ability to add folders.
  • Improved searchability. 
  • Ability to upload photos designed for a specific post and having those photos surfaced when working on a post. 

Adminadmin (and super admin) redesign

There was a lack of overall feedback here as folks mainly focused on wanting the experience to be “more modern” without a lot of specific feature requests. 

  • The ability to reorder, hide, and favorite menu items for greater customization.
  • Desire for a redesign to modernize the experience. This was nonspecific but repeated feedback that ties into Data Views work.

Going forward

As more conversations occur and work progresses, I’ll continue to bring feedback into appropriate GitHub issues and/or create new ones. For more open ended feedback, like the above, I’ll do recap posts as appropriate. If you’re chatting with folks about Phase 3 efforts, please do the same! Similar to Phase 2, we’ll need folks across the WordPress community to have conversations, educate, and bring others along.

Want to chat about phase 3 in the future? Comment below.

If you’re interested in joining future hallway hangouts on the topic, please leave a comment below and I’ll @ your username for any future hallway hangouts I run going forward. 

Want to get involved today?

These conversations centered around the already public post on each topic so keep chiming in on those: Real-Time Collaboration, Workflows, Revisions, Media Library, Block Library, and Admin Design.

Thank you to @cbringmann @chanthaboune for reviewing this post. 

#feedback, #phase-3, #summary

Updates to the HTML API in 6.4

WordPress 6.4 includes continued development of the HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. 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., including the introduction of a minimal HTML Processor in #58517 and the addition of a couple of CSSCSS Cascading Style Sheets./class helpers in the Tag Processor in #59209.

A minimal HTML Processor and its breadcrumbs.

When the HTML Processor was introduced in WordPress 6.2, it carried the stipulation that it did not understand HTML structure. While this is an intentional limitation so that the Tag Processor can maintain predictable performance and simplicity, it leaves certain conditions awkward and 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. prone. Consider, for example, the goal of finding an IMG element inside a surrounding DIV.

$processor = new WP_HTML_Tag_Processor( $html );

// Find the wrapping DIV element.
if ( ! $processor->next_tag( 'DIV' ) {
    return $html;
}

// Find the inner IMG element.
while ( $processor->next_tag( array( 'tag_closers' => 'visit' ) ) ) {
    // Abort if leaving the DIV wrapper before finding the image.
    if ( 'DIV' === $processor->get_tag() && $processor->is_tag_closer() ) {
        return $html;
    }

    if ( 'IMG' === $processor->get_tag() ) {
        do_something_to_img();
        return $processor->get_updated_html();
    }
}

This code maintains the safety against unexpected HTML inputs in the way that a regex-based approach would not, but it’s already a bit cumbersome, and could be mistaken by an unexpected HTML layout. For example, it assumes that a closing DIV tagtag A directory in Subversion. WordPress uses tags to store a single snapshot of a version (3.6, 3.6.1, etc.), the common convention of tags in version control systems. (Not to be confused with post tags.) will appear and that it will only appear after the IMG. It will fail to recognize the nested IMG in the following HTML because of the nested DIV before it.

<div class="profile">
    <div class="name">WordPress</div>
    <img src="wordpress-logo.png">
</div>

The new WP_HTML_Processor() class is being built in order to not only understand HTML syntax, but also its semantics – it understands HTML structure and all the quirks involved when discussing “malformed HTML.” In WordPress 6.4 the HTML Processor is available, and it adds a new concept of “breadcrumbs” to the API.

Breadcrumbs represent the path into an HTML document for a given element and will be familiar to those who navigate around a document in the browser development tools.

A browser displays the breadcrumbs for a selected element when inspecting the document.

Breadcrumbs always start with HTML as the start of the path, will list every ancestor of a given element, and include the element itself as the last segment in the path. The HTML Processor introduces a few ways to use these:

  • It’s possible to search for this structure by supplying array( 'breadcrumbs' => $breadcrumbs ) inside a call to next_tag().
  • The get_breadcrumbs() method reports the entire breadcrumb array from HTML to the matched element.
  • The matches_breadcrumbs( $breadcrumbs ) method indicates whether the matched element can be found at the given breadcrumbs.

Using the example above, it’s possible to search for images that are direct children of a DIV.

$processor = WP_HTML_Processor::create_fragment( $html );

if ( ! $processor->next_tag( array( 'breadcrumbs' => array( 'DIV', 'IMG' ) ) ) {
    return $html;
}

do_something_to_img();
return $processor->get_updated_html();

Properly handling this structure comes with additional costs, so the HTML Processor cannot provide the predictable performance that the Tag Processor can. It should still be fast enough to use though when rendering a 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.’s output.

One important note about using the HTML Processor is that it’s a work-in-progress and only supports a subset of allowable HTML. If it encounters a tag or a specific kind of HTML it doesn’t support, then it will abort processing to avoid corrupting your content. The HTML Processor reports if it gave up with the get_last_error() method. Currently, there’s only a small set of HTML that the HTML Processor supports, so don’t be surprised when it aborts before finding the tag you’re looking for. Each WordPress release will expand this support until it can read all possible HTML documents.

if ( $processor->next_tag( 'breadcrumbs' => array( 'figure', 'img' ) ) ) {
    // The tag was found in the HTML document.
    do_something_to_img();
    return $processor->get_updated_html();
}

if ( null === $processor->get_last_error() ) {
    // The tag was not in the HTML document.
} else {
    // It was not possible to determine if the tag was in the HTML document.
}

For more complicated queries, the matches_breadcrumbs() method can be used inside a next_tag() loopLoop The Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post. https://codex.wordpress.org/The_Loop.. The * value is a special wildcard term. It only matches one of any tag, so if no open element exists in its place then the match fails.

while ( $processor->next_tag( 'IMG' ) ) {
    // Skip images that are already inside a FIGURE element.
    if ( $processor->matches_breadcrumbs( array( 'FIGURE', 'IMG' ) ) ) {
        continue;
    }

    // Only process images that are great-grand-children of a BLOCKQUOTE element.
    if ( $processor->matches_breadcrumbs( array( 'BLOCKQUOTE', '*', '*', 'IMG' ) ) ) {
        do_something_to_img();
    }
}

The HTML Processor is a subclass of the Tag Processor and so retains all the underlying methods to read and modify the HTML. In the future, it will be possible to insert and remove entire tags and to read and modify the inner markup inside a tag. In WordPress 6.4, however, the only new feature is the concept of breadcrumbs.

CSS helpers for the Tag Processor

It’s been possible to search for a tag containing a specific class with next_tag( array( 'class_name' => $class_name ) ) but not possible to search for a tag containing more than one class name, or to search for a tag not containing a given class name. In WordPress 6.4, it’s possible to do this with the new has_class() method. This method does exactly what it sounds like: it reports if a matched tag contains the given class name in its class attribute.

$processor = new WP_HTML_Processor( $html );

while ( $processor->next_tag() ) {
    // Skip an element if it's not supposed to be processed.
    if ( $processor->has_class( 'data-wp-ignore' ) ) {
        continue;
    }

    if ( $processor->has_class( 'data-wp-context' ) && $processor->has_class( 'active' ) ) {
        // Process the context…
    }
}

The has_class() method knows how to split CSS class names properly. It’s valuable to rely on this method instead of manually processing the class attribute value to avoid several common pitfalls, especially when wanting to know about the presence or absence of multiple class names.


Props to @bph @codente @webcommsat and @nalininonstopnewsuk for peer review.

#6-4, #dev-notes, #dev-notes-6-4

Dev Chat Summary, October 18, 2023

The WordPress Developers Chat meeting took place on October 18, 2023 at 20:00 UTC in the core channel of Make WordPress Slack.

Key Links

Announcements

Highlighted Posts

  • WordPress 6.4 Release Candidate Phase: Learn or refresh your knowledge of what happens during 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).. Questions? Please post them in the comments.
  • 6.4 Dev Notes: It’s been a busy time in the Make/CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. blogblog (versus network, site)! Stay updated on the latest technical updates by checking out posts conveniently tagged with #dev-notes-6-4. Major props to 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, and 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. authors and wranglers who have worked tirelessly to make this happen! 🎉
  • WordPress core is now using Playwright for all browser-based tests: e2e fans rejoice! This milestone promises improved test stability and better options for authoring tests. If you’ve been holding back while the migrationMigration Moving the code, database and media files for a website site from one server to another. Most typically done when changing hosting companies. from Puppeteer to Playwright has been underway, now is a great time to jump back in to improve Core e2e coverage.
  • What’s new in Gutenberg 16.8 (11 October): Check out updates to the Cover 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., Font Library, and more in this roundup of the latest release.

Release Updates

WordPress 6.4

RC 2 is scheduled for next Tuesday, October 24, 2023.

Stay in the loopLoop The Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post. https://codex.wordpress.org/The_Loop. with 6.4 by following:

Additional release updates from the floor included:

  • A question was raised in #6-4-release-leads about removing some 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/-only packages from the next npm package update to Core.
  • Some 6.4 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, and 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. drafts are still needed for a couple of areas, so a gentle reminder was raised to keep the official 6.4 Documentation Tracker updated with latest progress. Reach out on the Tracker for help or to the Documentation release group in the #6-4-release-leads channel.

WordPress 6.3.2

  • WordPress 6.3.2 – Maintenance and Security release: This follow-up to 6.3.1 introduces several 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. fixes and security updates. Make sure to update!
  • Keep tabs on the #6-3-release-leads channel for future updates.

Open Floor

Automated Welcome/Signposting for #core

@webcommsat asked if Core would consider utilizing an automated messaging/workflow tool similar to that used by Training. When users joined the channel, they would receive a private message from Slackbot that includes channel-specific info and links, such as the Dev Chat schedule, or orientation for new contributors and contributor days. Abha agreed to draft a proposal to seek broader input from Core and new contributors.

Use of noopener noreferrer in New Window/Tab Links

@presskopp had a question regarding use of rel="noopener noreferrer" in links with target="_blank", which were supposed to have been removed. To help resolve instances where this unneeded behavior remains (in Core and Gutenberg), contribute to 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. #53843: Remove adding of rel=”noopener” to links with target=”_blank”.

Next Meeting

The next meeting will be on October 25, 2023 at 20:00 UTC.

Are you interested in helping draft Dev Chat summaries? Volunteer at the start of the next meeting on the #core Slack channel.

Props @webcommsat for peer review of this post.

#6-3, #6-4, #dev-chat, #meeting, #summary

Image loading optimization enhancements in 6.4

WordPress 6.4 comes with several enhancements to the wp_get_loading_optimization_attributes() function which was introduced in 6.3 as a central place to manage loading optimization attributes, specifically for images and iframes.

Quick recap: Loading optimization attributes are those such as loading="lazy" or fetchpriority="high", which can be added to certain HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. tags to optimize loading performance in the browser.

Simplified complex logic

The logic of the wp_get_loading_optimization_attributes() is generally quite complex, as it caters for several factors that influence when to apply certain loading optimization attributes. When the function was originally introduced, it was particularly hard to follow, since it included lots of early returns as well as closures. This was mostly due to maintaining its original code paths that came from the deprecated wp_get_loading_attr_default() function as much as possible to avoid breakage.

While the function logic is still complex in WordPress 6.4, it has been notably simplified, taking a more sequential and thus easier to follow approach. This facilitated the implementation of further enhancements such as those outlined below.

Please refer to 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. #58891 for additional details on these changes.

Managing the decoding="async" attribute

The decoding="async" attribute has been present on images by default since WordPress 6.1 (see Trac ticket #53232). As of WordPress 6.4, the logic for applying the attribute has been consolidated in the wp_get_loading_optimization_attributes() function, as the attribute is a perfect fit for that function.

Deprecated function

As part of that change, the wp_img_tag_add_decoding_attr() function has been deprecated, as its logic is now incorporated into wp_img_tag_add_loading_optimization_attrs(). Unless you are using the now deprecated function in your code, no changes should be needed after this update in regards to the decoding="async" attribute. The change merely enables control over the attribute in a more consistent manner (also see the new filters introduced below).

If you are using the deprecated function and want to use a fully backward compatible replacement, you can implement a custom wrapper function such as the following:

function myplugin_img_tag_add_decoding_attr( $image, $context ) {
	global $wp_version;

	// For WP >= 6.4.
	if ( version_compare( $wp_version, '6.4', '>=' ) ) {
		$image = wp_img_tag_add_loading_optimization_attrs( $image, $context );

		// Strip potential attributes added other than `decoding="async"`.
		return str_replace(
			array(
				' loading="lazy"',
				' fetchpriority="high"',
			),
			'',
			$image
		);
	}
 
    // For WP < 6.4.
    return wp_img_tag_add_decoding_attr( $image, $context );
}

Please refer to Trac ticket #58892 for additional details on these changes.

New filters to control loading optimization attributes

With WordPress 6.4, two filters have been added to wp_get_loading_optimization_attributes() which allow modifying or completely overriding the logic used to apply the loading optimization attributes:

  • The wp_get_loading_optimization_attributes 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. can be used to modify the results from the WordPress coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. logic.
  • The pre_wp_get_loading_optimization_attributes filter can be used to use entirely custom logic and effectively short-circuit the core function by returning a value other than false.

Below are a few examples on how these two filters could be used.

Filter usage examples

You could use the wp_get_loading_optimization_attributes filter to ensure a specific image within post content receives the fetchpriority="high" attribute while other ones do not:

function set_fetchpriority_high_on_specific_image( $loading_attrs, $tag_name, $attr, $context ) {
	if ( 'img' === $tag_name ) {
		if (
			'the_content' === $context &&
			isset( $attr['src'] ) &&
			$attr['src'] === 'https://example.org/a-specific-image.jpg'
		) {
			$loading_attrs['fetchpriority'] = 'high';
		} else {
			unset( $loading_attrs['fetchpriority'] );
		}
	}
	return $loading_attrs;
}
add_filter(
	'wp_get_loading_optimization_attributes',
	'set_fetchpriority_high_on_specific_image',
	10,
	4
);

Alternatively, you could use the wp_get_loading_optimization_attributes filter to disable adding the fetchpriority="high" attribute entirely:

function disable_fetchpriority_high( $loading_attrs ) {
	unset( $loading_attrs['fetchpriority'] );
	return $loading_attrs;
}
add_filter(
	'wp_get_loading_optimization_attributes',
	'disable_fetchpriority_high'
);

You could implement entirely custom logic in a 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 to detect which images appear in the viewport using client-side 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/. logic or an external service and replace the function’s default logic with that:

function override_loading_optimization_attributes( $override, $tag_name, $attr, $context ) {
	// Bail if another filter callback already overrode this.
	if ( false !== $override ) {
		return $override;
	}

	// Use custom logic to determine whether image is LCP and whether it appears above the fold.
	if ( 'img' === $tag_name ) {
		$is_lcp      = custom_function_to_detect_whether_image_is_lcp_element( $attr );
		$in_viewport = custom_function_to_detect_whether_image_is_above_the_fold( $attr );

		/*
		 * Always add `decoding="async"`.
		 * Add `fetchpriority="high"` only to the LCP image.
		 * Add `loading="lazy"` to any image below the fold / outside the viewport.
		 */
		$loading_attrs = array( 'decoding' => 'async' );
		if ( $is_lcp ) {
			$loading_attrs['fetchpriority'] = 'high';
		} elseif ( ! $in_viewport ) {
			$loading_attrs['loading'] = 'lazy';
		}
		return $loading_attrs;
	}

	return $override;
}
add_filter(
	'pre_wp_get_loading_optimization_attributes',
	'override_loading_optimization_attributes',
	10,
	4
);

Please refer to Trac ticket #58893 for additional details on these changes.

Support for custom context values

As explained in the 6.3 dev note for the wp_get_loading_optimization_attributes() function, initially it only supported specific context values used by WordPress core. This made it confusing to write custom code making use of that function as you would have been forced to use a context string used elsewhere in core in order to get the performance benefits.

This limitation has been addressed in WordPress 6.4: The function now supports arbitrary contexts, and for the most part does not apply context-specific optimizations. There are two exceptions to this which are the “template_part_header” and “get_header_image_tag” contexts. Images within these contexts will always be interpreted to be in the 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.. The list of these two context strings is filterable with a new wp_loading_optimization_force_header_contexts filter, which allows images with other contexts to be always assumed to appear above the fold.

Context filter usage example

Below is an example: Assume that your plugin has a particular header image rendering function where it is safe to assume any image rendered with that function appears above the fold. You can rely on an arbitrary context specific to your function and then force WordPress core to consider images with that context to appear above the fold.

function force_myplugin_special_header_context_above_the_fold( $header_contexts ) {
	$header_contexts['myplugin_special_header'] = true;
	return $header_contexts;
}
add_filter(
	'wp_loading_optimization_force_header_contexts',
	'force_myplugin_special_header_context_above_the_fold'
);

Your image rendering function then needs to call wp_get_loading_optimization_attributes( 'img', $attr, 'myplugin_special_header' ) for the above filter to take effect.

Please refer to Trac ticket #58894 for additional details on these changes.

Hook priority change for wp_filter_content_tags()

The wp_filter_content_tags() was originally introduced in WordPress 5.5 as the foundation for lazy-loading as well as other optimizations for certain tags in a content blob. More recently a problem was identified that the function is called earlier than do_shortcode(), which means that any images added by shortcodes will not be able to make use of the performance benefits from wp_filter_content_tags().

To address that limitation, the hook priority with which wp_filter_content_tags() is hooked into the various filters (“the_content”, “the_excerpt”, “widget_text_content”, and “widget_block_content”) has been changed from the default 10 to 12. For context, the do_shortcode() function has hook priority 11.

While this is technically a breaking change, careful consideration and research across the WordPress plugin directory went into this decision. No plugins in the directory are affected by this change, given that there is only limited direct usage of the wp_filter_content_tags() function, and such usage has not been specific to the core filters. Still, in case you use the wp_filter_content_tags() function directly in your code, you may want to double check that this hook priority change does not result in a problem.

If your plugin processes custom content with the wp_filter_content_tags() function, it is encouraged to call that function after parsing other content such as blocks and shortcodes. The core change will not cause problems if that is currently not the case in your code, however it is recommended to have your custom logic follow a similar order.

Please refer to Trac ticket #58853 for additional details on these changes.

Props to @westonruter and @webcommsat for review and proofreading.

#6-4, #dev-notes, #dev-notes-6-4, #performance