X-post: A Month in Core โ€“ February 2025

X-comment from +make.wordpress.org/updates: Comment on A Month in Core โ€“ February 2025

Data: A helpful performance warning for developers in the ‘useSelect’ hook

useSelectย is a ReactReact React is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org hook that lets you subscribe to WordPress data in 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. editor. It checks if consumed data has changed and then rerenders your components accordingly.

Usually, things just work, and consumers donโ€™t have to worry about unnecessary rerenders. However, sometimes data is directly manipulated in theย mapSelectย callback, which can mislead theย useSelectย hook into thinking that the data has changed when it has not.

Example:

export function ExampleWithWarning() {
	const { nameAndIds } = useSelect( function mapSelect( select ) {
		const authors = select( 'core' ).getUsers( {
			who: 'authors',
			context: 'view',
		} );

		return {
			// `Array.map` will return a new array for every call,
			// even if the data is the same.
			nameAndIds: authors?.map( ( { id, name } ) => ( { id, name } ) ),
		};
	}, [] );

	return <>{ /* Your rendering logic here */ }</>;
}

WordPress will now display aย warningย whenย SCRIPT_DEBUGย is enabled to help consumers identify possible performance bottlenecks.

Example warning:

Theย useSelectย hook returns different values when called with the same state and parameters. This can lead to unnecessary re-renders and performance issues if not fixed.

Non-equal value keys: nameAndIds

This warning can be fixed by requesting only the values needed to render a component or moving data manipulation outside theย mapSelectย callback. The actual solution can vary based on your code and logic.

Please refer to the fantastic articleย โ€œHow to work effectively with the useSelect hookโ€ย to learn more about best practices for using theย useSelectย hook.

Hereโ€™s how I would fix the example code from this post:

export function ExampleWithWarning() {
	const authors = useSelect( function mapSelect( select ) {
		return select( 'core' ).getUsers( {
			who: 'authors',
			context: 'view',
		} );
	}, [] );

	// Derive required values from the `authors` outside the `useSelect` callback.
	const nameAndIds = authors?.map( ( { id, name } ) => ( { id, name } ) );

	return <>{ /* Your rendering logic here */ }</>;
}

Props toย @kirasong for the review.

#6-8, #dev-notes, #dev-notes-6-8, #editor

Roster of design tools per block (WordPress 6.8 edition)

Below you find a table that lists all coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. blocks available in the inserter marks in the grid the feature they support in 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. editor. Itโ€™s a basic lookup table that helps developers to find the information quickly.

While this post is released as part of 6.8, the content summarizes changes between 6.1 and 6.8. This is an updated of the 6.7 edition and provides a cumulative list of design supports added with the last six WordPress releases. The icon โ˜‘๏ธ indicates new in 6.8.

The features covered are:

  • Align
  • Typography,
  • Color,
  • Dimension,
  • Border,
  • Layout,
  • Gradient,
  • Duotone,
  • Shadow,
  • Background image
  • Pattern overrides / Block Bindings (PO/BB)

Work in progress

The issue Tracking: Addressing Design Tooling Consistency lists tracking issues for individual block supports.

Props to @audrasjb for review.

#6-8, #dev-notes, #dev-notes-6-8, #editor

Internationalization improvements in 6.8

Various internationalization (i18n) improvements are in WordPress 6.8, and this developers note focuses on these.

Localized PHPMailer messages

Over 12 years after #23311 was reported, WordPress 6.8 now properly localizes any user-visible PHPMailer error messages. To achieve this, a new WP_PHPMailer class extending PHPMailer was introduced to leverage the WordPress 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. system with PHPMailer. Note that developers donโ€™t typically interact with this class directly outside of wp_mail() or the phpmailer_init action.

See [59592] for more context.

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. update emails in the adminadmin (and super admin)โ€™s localeLocale A locale is a combination of language and regional dialect. Usually locales correspond to countries, as is the case with Portuguese (Portugal) and Portuguese (Brazil). Other examples of locales include Canadian English and U.S. English.

This was reported and fixed in #62496. Itโ€™s a follow-up to the email localization change introduced in WordPress 6.7, where this instance was missed. Now, plugin update emails are correctly sent in the admin locale (if the admin email matches a user on the site).

See [59460] and [59478] for details.

Just-in-time translationtranslation The process (or result) of changing text, words, and display formatting to support another language. Also see localization, internationalization. loading for plugins/themes not in the WordPress.orgWordPress.org The community site where WordPress code is created and shared by the users. This is where you can download the source code for WordPress core, plugins and themes as well as the central location for community conversations and organization. https://wordpress.org/ directory

Back in version 4.6, WordPress introduced just-in-time translation loading for any plugin or theme that is hosted on WordPress.org. That meant plugins no longer had to call load_plugin_textdomain() or load_theme_textdomain().

With WordPress 6.8, this is now expanded to all other plugins and themes by looking at the text domain information provided by the plugin/theme. Extensions with a customย Text Domainย andย Domain Pathย 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. no longer need to callย load_plugin_textdomain()ย orย load_theme_textdomain(). This reduces the risk of calling them too late, after some translation calls already happened, and generally makes it easier to properly internationalize a plugin or theme.

In short:

  • If your plugin/theme is hosted on WordPress.org and requires WordPress 4.6 or higher: you donโ€™t need to use load_*_textdomain()
  • Else, if your plugin/theme provides the Text Domainย andย Domain Path headers and requires WordPress 6.8 or higher: you donโ€™t need to use load_*_textdomain()

See #62244 for more.


Props to @audrasjb, @stevenlinx for review.

#6-8, #dev-notes, #dev-notes-6-8, #i18n

Agenda, Dev Chat, Mar 12, 2025

The next WordPress Developers Chat will take place on Wednesday at 15:00 UTC in theย coreย channel onย Make WordPress Slack.

The live meeting will focus on the discussion for upcoming releases, and have an open floor section.

Additional items will be referred to in the various curated agenda sections below. If you haveย ticketticket Created for both bug reports and feature development on the bug tracker.ย requests for help, please continue to post details in the comments section at the end of this agenda.

Announcements ๐Ÿ“ข

WordPress 6.8 | 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.ย 2 is now available ๐Ÿฅณ

The Beta 2 release of WordPress 6.8 is now available! A heartfelt thank you to everyone who joined the Release Party. We appreciate your testing and feedback.

Help Test 6.8 Beta version ๐Ÿงช

The Test-Team has written two helpful guides for people interested in testing:

Thanks @ankit-k-gupt and @krupajnanda for your contribution!

Forthcoming releases ๐Ÿš€

Nextย 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/ version: 20.5

Gutenberg 20.5 is scheduled for release onย Wednesday, March 19th.
This will be the first version of Gutenberg to be merged into WordPress 6.9.

Nextย Betaย 3 of 6.8: March 18th

Theย Beta 3ย release of WordPress 6.8 will be available onย Tuesday, March 18th.

A detailed overview of the release schedule for WordPress 6.8 can be found here. The article also includes information about the individuals assigned to each release party.

Nextย major releasemajor release A release, identified by the first two numbers (3.6), which is the focus of a full release cycle and feature development. WordPress uses decimaling count for major release versions, so 2.8, 2.9, 3.0, and 3.1 are sequential and comparable in scope.: 6.8

We are currently in theย WordPress 6.8 release cycle. Read more aboutย the release squad, timeline and focus for this release.

Reminder

We have only two weeks until RCrelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta). 1. Dev notes should be in progress. Please check @jeffpaulโ€˜s message onย Slack for details.

Discussions ๐Ÿค”

The discussion section of the agenda is to provide a place to discuss important topics affecting the upcoming release or larger initiatives that impact the CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Team. To nominate a topic for discussion, please leave a comment on this agenda with a summary of the topic, any relevant links that will help people get context for the discussion, and what kind of feedback you are looking for from others participating in the discussion.

Editor Updates ๐Ÿ”„

You can keep up to date with the major Editor features with the weekly updates, now on the blogblog (versus network, site)!
Editor Weekly Updates: Mar 3 โ€“ Mar 7

Open floor ย ๐Ÿ’ฌ

Any topic can be raised for discussion in the comments, as well as requests for assistance on tickets. Tickets in the milestone for the next major or maintenance release will be prioritized.

Please include details of tickets / PRs and the links in the comments, and indicate whether you intend to be available during the meeting for discussion or will be async.

Props to @benjamin_zekavica for reviewing the agenda.

#6-8, #agenda, #dev-chat

Editor Weekly Updates: Mar 3 โ€“ Mar 7

What happened 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/ during the first week of March 2025? Below, youโ€™ll find an overview of the key changes and improvements.

A special thanks goes to @krupaly2k for collecting all the topics!

Need Design Feedback:

Enhancements:

Feedback:

  • Query total: It is confusing that the editor and front does not matchย โ€“ When I inserted this block, I thought I was seeing a 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. introduced by the changes to the query in WordPress 6.8.
  • Query total: The icons are confusingย โ€“ When I inserted this block I honestly did not even understand that there was an option in the toolbar.

Need Decision:

Bug:

Thanks toย @krupaly2k for helping to create this post and @benjamin_zekavica for the review

#6-8, #core, #editor-update, #gutenberg

Performance Chat Summary: 11 March 2025

The full chat log is available beginning here on Slack.

WordPress Performance TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. tickets

  • @westonruter The second beta of 6.8 was just released.
  • @westonruter There are 5 performance tickets in the milestone.
    • @johnbillion RE #63026, this is an issue with the performance of the tests due to the high number of user fixtures, all of which generate and hash a password for the user with each fixture. The regular performance tests are not indicatiny any general performance 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.. I think we can therefore remove the performance focus unless thereโ€™s an objection.

Performance Lab plugins

Discussing the upcoming release scheduled for Monday, Mar 17, 2025 at 17:00 UTC.

  • @westonruter Letโ€™s start with the upcoming set of Performance Lab releases which is due March 17th.
  • @westonruter As noted by @flixos90, this release wonโ€™t actually include any update to the Performance Lab 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. itself. Instead there will be updates to Optimization Detective, Image Prioritizer, Embed Optimizer, Speculative Loading, and Modern Image Formats. Therefore, he suggests that we take this as an opportunity move away from using the PLโ€™s version for the release tags. In reality this should have been done long ago when we split up the plugin into standalone plugins. So instead of the release branchbranch A directory in Subversion. WordPress uses branches to store the latest development code for each major release (3.9, 4.0, etc.). Branches are then updated with code for any minor releases of that branch. Sometimes, a major version of WordPress and its minor versions are collectively referred to as a "branch", such as "the 4.0 branch". being release/4.0.0 it could instead be release/20250317. The title of the release then I suppose would be 2025-03-17 as well.
  • @mukesh27 Does the release triggered manually as we didnโ€™t release PL plugin?
    • @westonruter The GHA workflow doesnโ€™t depend on releasing the PL plugin anymore, right? I mean, ever since the plugin was split into standalone plugins, I donโ€™t think this was the case
  • @flixos90 It would feel a bit odd to have a release called 2025-03-17 in the 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 by the repository owner. https://github.com/ releases page, but Iโ€™d argue thatโ€™s only because of the previous releases using the PL version number. Itโ€™s already odd now in that each release is labelled by the PL version number, but actually includes multiple releases using different versions. So I think that would be fine.
  • @westonruter We can include a note in the release description that explains the naming convention change.
  • @mukesh27 What happens in the future if we find ourselves in the same situation? Will we use the release date again?
  • @westonruter Yeah, I think weโ€™ll use dates from now on.
    • @flixos90 Are you saying we should use dates for the release branches and GH releases going forward even when PL is among the released plugins? If we are going to do that, we should modify the documentation in the CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Performance Handbook.
    • @westonruter Yes, I think we should use dates going forward.
    • @swissspidy Agreed. Would be even more confusing otherwise.
  • @westonruter There are 4 milestones for Monday which have issues/PRs:
  • @westonruter Looks like Modern Image Formats primarily just needs a couple tweaks prior to merging one PR. It looks like the other PR will need to get bumped.
  • @flixos90 Regarding the changed branch naming and release naming strategy, anyone up for updating the Make Core Performance Handbook documentation accordingly?
    • @westonruter I can do it. I typically tweak the handbook after going through the release based on how it went.
  • @mukesh27 I have to share update on the accurate sizes project: I picked it up and started working on it this week. The PR #1795 adds the ancestor 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. context and is ready for review.

Our next chat will be held on Tuesday, Mar 25, 2025 at 16:00 UTC in the #core-performance channel in Slack.

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

Speculative Loading in 6.8

WordPress 6.8 introduces speculative loading, which can lead to near-instant page load times by loading URLs before the user navigates to them. The feature relies on the Speculation Rules API, a web platform feature that allows defining rules for which kinds of URLs to prefetch or prerender, and how early such speculative loading should occur.

Please refer to the speculative loading announcement post for additional information about the Speculation Rules 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. and related prior art in WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress..

Context

Prior to being implemented in WordPress Core, the feature has been successfully used on over 50,000 WordPress sites via the Speculative Loading feature plugin, which has been ported over to Core now, with a few modifications. Based on data queried from the HTTP Archive and Chrome User Experience Report (CrUX) datasets over all the time since the 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. launched, the sites that enabled speculative loading improved their Largest Contentful Paint (LCP) passing rate by ~1.9% at the median which, while it may seem a small number, is a huge boost for a single feature, considering that a lot of sites with various performance implications contribute to the data.

The Speculation Rules API was first introduced in early 2023 and has seen ever increasing usage since then. Today, over 8% of Chrome navigations rely on Speculation Rules. A related significant launch happened a few months ago when Cloudflare enabled speculative loading at large scale via its Speed Brain feature.

The Speculation Rules API is supported by Chrome, Edge, and Opera so far, which means the vast majority of end users browsing the web can benefit from its capabilitiescapability Aย capabilityย is permission to perform one or more types of task. Checking if a user has a capability is performed by the current_user_can function. Each user of a WordPress site might have some permissions but not others, depending on theirย role. For example, users who have the Author role usually have permission to edit their own posts (the โ€œedit_postsโ€ capability), but not permission to edit other usersโ€™ posts (the โ€œedit_others_postsโ€ capability).. For users of browsers without support for the API, there are no adverse effects, since the Speculation Rules API is a progressive enhancementenhancement Enhancements are simple improvements to WordPress, such as the addition of a hook, a new feature, or an improvement to an existing feature.. Browsers without support simply ignore its presence, i.e. sites maintain the same behavior as before.

Default behavior and customization

The WordPress Core implementation enables speculative loading by default in the frontend of all sites, except when a user is logged in or when a site has pretty permalinks disabled. URLs are prefetched with conservative eagerness: this means that prefetching is triggered when a user starts to click on a link. While this is typically only a fraction of a second before the actual navigation occurs, it is still enough to lead to a notable performance improvement.

This default of prefetch with conservative eagerness is used as a reasonable starting point to enable speculative loading at the scale of WordPress. It is in line with the configuration that Cloudflare uses in its speculative loading feature, and it minimizes the chance of any speculative loads without a subsequent navigation to the URLURL A specific web address of a website or web page on the Internet, such as a websiteโ€™s URL www.wordpress.org. The Speculative Loading plugin uses a default of prerender with moderate eagerness, which leads to a larger performance improvement due to the speculative load being triggered earlier as well as prerendering the URL, but also has tradeoffs related to certain client-side behavior inadvertently being triggered even in case the user never ends up navigating to the URL.

Customization via actions and filters

Excluding URL patterns from speculative loading

When a URL is prefetched, the server response is loaded before the user navigates to it. In most cases, this is not an issue since server responses for frontend URLs do not typically change the state of the site in any way. However, there may be plugins that use the pattern of so-called โ€œaction URLsโ€, where simply navigating to a specific URL (with a GET request) a state change occursโ€”for example on an e-commerce WordPress site, it could be adding a product to the shopping cart or marking an item as a favorite. It is worth noting that this is an antipattern, since state changes should typically be triggered only by POST requests, e.g. via form submissions, and GET requests are supposed to be โ€œidempotentโ€. Despite that, plugins that use this pattern should ensure that such URLs are excluded from prefetching and prerendering. In the case of conservative eagerness, this should not be an issue since itโ€™s almost guaranteed the user will also navigate to the URL. But for sites that use a more eager configuration there is a chance the navigation will never occur, which is why excluding such URLs is important.

By default, any URLs that include query parameters are excluded from prefetching and prerendering automatically, which should cater for the majority of such action URLs. However, in case a plugin is implementing its own rewrite rules for these URLs instead of using custom query parameters, they can use the wp_speculation_rules_href_exclude_paths filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output. to provide URL patterns to exclude.

This example ensures that any URLs with a path starting in โ€œ/cart/โ€ will be excluded from speculative loading, regardless of whether itโ€™s prefetch or prerender:

add_filter(
	'wp_speculation_rules_href_exclude_paths',
	function ( $href_exclude_paths ) {
		$href_exclude_paths[] = '/cart/*';
		return $href_exclude_paths;
	}
);

All URL patterns provided should follow the URL Pattern web specification, and they will all be considered relative to the frontend of the site. For sites where the home URL is in a subdirectory, WordPress will automatically prefix the corresponding path segment so that plugin developers do not need to worry about that.

While WordPress Coreโ€™s default behavior is to prefetch URLs, sites may opt in to prerendering URLs. This leads to a significant performance boost, but also has additional implications on the speculatively loaded URLs, since even their client-side code will be loaded. If a site contains any client-side logic that should only run once the user actually navigates to the URL, it needs to check for whether the site is being prerendered first and only trigger such logic once the navigation has occurred (see โ€œDetect prerender in JavaScriptโ€ documentation). A common use-case for that is analytics tooling (see โ€œImpact on analyticsโ€ documentation). Many popular providers already support prerendering, so no change is necessary. But if your site or your plugin includes such functionality on certain URLs and you havenโ€™t updated the 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 to support prerendering yet, you can temporarily exclude the relevant URLs from prerendering specifically.

This example ensures that any URLs with a path starting in โ€œ/personalized-area/โ€ will be excluded from prerender speculative loading only:

add_filter(
	'wp_speculation_rules_href_exclude_paths',
	function ( $href_exclude_paths, $mode ) {
		if ( 'prerender' === $mode ) {
			$href_exclude_paths[] = '/personalized-area/*';
		}
		return $href_exclude_paths;
	},
	10,
	2
);

Modifying the default speculative loading configuration

As mentioned before, WordPress sites are able to modify the default speculative loading configuration. For further improved performance, you may want the configuration to be more eager or to leverage prerendering. This can be achieved via the wp_speculation_rules_configuration filter, which receives either an associative array with mode and eagerness keys to control the configuration, or null to disable speculative loading for the current request.

The default value for the filter is array( 'mode' => 'auto', 'eagerness' => 'auto' ), unless a user is logged-in or the site has pretty permalinks disabled, in which case the default value is null. For both configuration parameters, the value auto signifies that WordPress Core will decide on the configuration, which as of today effectively leads to a mode of prefetch and an eagerness of conservative. Depending on various criteria such as the state of the Speculation Rules API and ecosystem support, the behavior may change in a future WordPress release.

Here is an example that uses the filter to increase the eagerness to moderate. This will improve the performance benefits, while increasing the tradeoff for a speculative load without subsequent navigation:

add_filter(
	'wp_speculation_rules_configuration',
	function ( $config ) {
		if ( is_array( $config ) ) {
			$config['eagerness'] = 'moderate';
		}
		return $config;
	}
);

The mode value can be either auto, prefetch, or prerender, and the eagerness value can be either auto, conservative, moderate, or eager. The Speculation Rules API also defines another eagerness value of immediate, however that value is strongly discouraged for document-level rules that speculatively load any URLs, so the WordPress Core API does not allow using it for its overall configuration.

If you wanted to opt for an even greater performance boost, here is an example that uses the filter to opt for prerender with moderate eagerness. This is similar to what the Speculative Loading feature plugin implements, and it can lead to a significant performance boost. Please keep in mind the effects of prerendering on client-side JavaScript logic explained in the previous section before enabling prerender.

add_filter(
	'wp_speculation_rules_configuration',
	function ( $config ) {
		if ( is_array( $config ) ) {
			$config['mode']      = 'prerender';
			$config['eagerness'] = 'moderate';
		}
		return $config;
	}
);

As mentioned before, speculative loading is disabled by default for sites that do not use pretty permalinks. This is because the aforementioned exclusion of URLs with query parameters would not reliably apply anymore if even WordPress Coreโ€™s arguments used query parameters. There may however be cases where, as a site owner of a site without pretty permalinks, you are confident that your site is not using any of the problematic patterns that are the reason for this exclusion in the first place, or you already identified them and explicitly excluded URLs with the specific query parameters from being speculatively loaded. In that case, you could use the filter to enable speculative loading, as seen here:

add_filter(
	'wp_speculation_rules_configuration',
	function ( $config ) {
		if ( ! $config && ! get_option( 'permalink_structure' ) ) {
			$config = array(
				'mode'      => 'auto',
				'eagerness' => 'auto',
			);
		}
		return $config;
	}
);

Please use caution when opting into speculative loading like this. WordPress Coreโ€™s defaults were carefully considered to cater for the majority of sites in a safe way, so only use this code snippet if you are confident it will not have adverse effects on your site.

Including additional speculation rules

The Speculation Rules API allows defining multiple rules to configure how the browser should speculatively load URLs. By default, WordPress Core only includes a single rule that handles all the aforementioned behavior. More advanced customization is possible by providing entirely new speculation rules in addition to Coreโ€™s main rule, which can be accomplished by using the wp_load_speculation_rules action. The action receives an instance of the new WP_Speculation_Rules class, which has validation mechanisms built in and can be amended as needed. By adding new rules, you can implement entirely custom configurations that will be applied on top of WordPress Coreโ€™s main rule.

Here is an example, which directly relates to the previous example that changes the default configuration to prerender with moderate eagerness. You may prefer not to change the default, but there may be specific URLs where you would like to enable prerender with moderate eagerness. You could add a custom URL-level speculation rule for that:

add_action(
	'wp_load_speculation_rules',
	function ( WP_Speculation_Rules $speculation_rules ) {
		$speculation_rules->add_rule(
			'prerender',
			'my-moderate-prerender-url-rule',
			array(
				'source'    => 'list',
				'urls'      => array(
					'/some-url/',
					'/another-url/',
					'/yet-another-url/',
				),
				'eagerness' => 'moderate',
			)
		);
	}
);

Taking this example further, maybe there is no easy way to provide a list of URLs, e.g. in case they change often or more URLs need to be added regularly. In that case, you consider using a document-level speculation rule that applies for all links that are marked with a specific class, or where a parent element has a specific class:

add_action(
	'wp_load_speculation_rules',
	function ( WP_Speculation_Rules $speculation_rules ) {
		$speculation_rules->add_rule(
			'prerender',
			'my-moderate-prerender-optin-rule',
			array(
				'source'    => 'document',
				'where'     => array(
					'selector_matches' => '.moderate-prerender, .moderate-prerender a',
				),
				'eagerness' => 'moderate',
			)
		);
	}
);

With this rule in place, users would be able to add a moderate-prerender class to any 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. that supports the advanced UIUI User interface for adding classes, and that way they could manually opt in any link on demand.

Please refer to the Speculation Rules API specification for details on what a rule definition can look like.

Customization via UI

The previous example already hints at how speculative loading can be customized via the UI. While a dedicated UI for the feature like it exists in the Speculative Loading feature plugin is out of scope for WordPress Core, many block types provide an โ€œAdditional CSSCSS Cascading Style Sheets. class(es)โ€ field in the โ€œAdvancedโ€ panel 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..

WordPress Core has built-in support for the CSS classes no-prefetch and no-prerender. You can add these to any block so that links within that block are opted out of prefetching or prerendering respectively. Note that no-prefetch opts out of both, i.e. opts out of speculative loading entirely, since prefetching is part of prerendering. Please refer to the section about excluding URL patterns for guidance on when it may be useful to exclude URLs from prefetching or prerendering.

This mechanism makes it easy for advanced users to take granular control over speculative loading for specific blocks.

Summary and further reading

The speculative loading feature in WordPress 6.8 is a great win for performance of WordPress and the web overall, by starting the page load process even before the user navigation occurs. By fine-tuning it further based on your siteโ€™s needs, you can achieve even greater performance boosts than with the default configuration.

Please see the following links for further reading:

Props to @westonruter, @tunetheweb, @adamsilverstein, @joemcgill for review and proofreading.

#6-8, #dev-notes, #dev-notes-6-8, #feature-projects, #performance, #speculative-loading

Summary, Dev Chat, Mar 5, 2025

Startย of the meeting 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/, facilitated by @benjamin_zekavica. ๐Ÿ”— Agenda post.

Announcements ๐Ÿ“ข

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/ version 20.4 was released!

Gutenberg version 20.4 was officially released today! This update brings a variety of enhancements and improvements to 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. editor. This version is the final release to be merged into WordPress 6.8.

A detailed changelog article will follow shortly, providing an in-depth look at the features and changes in this version.

Forthcoming releases ๐Ÿš€

Nextย major releasemajor release A release, identified by the first two numbers (3.6), which is the focus of a full release cycle and feature development. WordPress uses decimaling count for major release versions, so 2.8, 2.9, 3.0, and 3.1 are sequential and comparable in scope.: 6.8 โ€“ 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. 2

The Beta 2 release of WordPress 6.8 will be available on Tuesday, March 11th.
Join the Release Party to test new features and provide feedback!

Nextย major release: 6.8

We are currently in theย WordPress 6.8 release cycle. Read more aboutย the release squad, timeline and focus for this release.

Editor Updates ๐Ÿ”„

Stay tuned for weekly updates to keep you informed about the latest in WordPress editor development. Whether youโ€™re a developer, designer, or content creator, these updates will keep you 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 on all the key changes.

Donโ€™t miss out โ€” check out the weekly update and get ready for more!

Discussion ๐Ÿค”

To avoid listing the topics here twice, all the necessary links and information can be found in the agenda. This section now includes a few additions.

6.8 โ€“ Beta 1 | Current update issue with versions older than 5.1 โš ๏ธ

A 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. was found preventing updates for versions older than 5.1 in Beta 1, with ticketticket Created for both bug reports and feature development on the bug tracker. #63052 created. @joemcgill mentioned that @johnbillion will handle it when heโ€™s back this week, and it shouldnโ€™t affect Beta 2. ๐Ÿฅณ

6.8 | Preparing Documentation for the 6.8 Release

@jeffpaul mentioned that the document is intended for the Helphub page, similar to the 6.7 release. Additionally, @milana_cap shared details on docs-related topics here.

Call for the Security Role for the upcoming 6.8 release parties

@desrosj mentioned that he can take on the security role, as it involves running the security test suite. He is open to involving more team members if anyone is interested, but heโ€™s fine handling it on his own.

Open Floor ๐Ÿ’ฌ

6.8 Beta 1 | Feedback

After the Beta 1 release, a ticket was created for an issue (#63055) regarding missing template parts, related to #62574. @jeffpaul confirmed that changes from #62574 wonโ€™t be included in 6.8 as is, but updates will resolve the gaps.

Thanks toย @francina for helping review this summary.

#6-8, #core, #dev-chat, #summary

Agenda, Dev Chat, Mar 5, 2025

The next WordPress Developers Chat will take place on Wednesday at 15:00 UTC in theย coreย channel onย Make WordPress Slack.

The live meeting will focus on the discussion for upcoming releases, and have an open floor section.

Additional items will be referred to in the various curated agenda sections below. If you haveย ticketticket Created for both bug reports and feature development on the bug tracker.ย requests for help, please continue to post details in the comments section at the end of this agenda.

Announcements ๐Ÿ“ข

WordPress 6.8 | 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 is now available ๐Ÿฅณ

The Beta 1 release of WordPress 6.8 is now available! A heartfelt thank you to everyone who joined the Release Party. We appreciate your testing and feedback.

Help Test 6.8 Beta version ๐Ÿงช

The Test-Team has written a comprehensive article that explains all the features in detail. Additionally, it outlines how the testing should be carried out. Further helpful tips can also be found in the article.

At this point, we would like to express our sincere thanks to @krupajnanda for this wonderful article.

Forthcoming releases ๐Ÿš€

Nextย 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/ version: 20.4

Gutenberg 20.4 is scheduled for release onย Wednesday, March 5th.
This will be the final release to be merged into WordPress 6.8.

Nextย Betaย 2 of 6.8: March 11th

Theย Beta 2ย release of WordPress 6.8 will be available onย Tuesday, March 11th.

A detailed overview of the release schedule for WordPress 6.8 can be found here. The article also includes information about the individuals assigned to each release party.

Nextย major releasemajor release A release, identified by the first two numbers (3.6), which is the focus of a full release cycle and feature development. WordPress uses decimaling count for major release versions, so 2.8, 2.9, 3.0, and 3.1 are sequential and comparable in scope.: 6.8

We are currently in theย WordPress 6.8 release cycle. Read more aboutย the release squad, timeline and focus for this release.

Discussions ๐Ÿค”

The discussion section of the agenda is to provide a place to discuss important topics affecting the upcoming release or larger initiatives that impact the CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Team. To nominate a topic for discussion, please leave a comment on this agenda with a summary of the topic, any relevant links that will help people get context for the discussion, and what kind of feedback you are looking for from others participating in the discussion.

6.8 โ€“ Beta 1 | Current update issue with versions older than 5.1 โš ๏ธ

Due to a 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., older versions cannot be updated to Beta 1. The core team is actively working on a fix for this issue. We will provide more information as soon as it becomes available. In the meantime, you can refer to the detailed article for further reading and updates on the matter.

As mentioned above, an issue occurs with WordPress versions older than 5.1. In this round, we should discuss the current status of the situation. See more here: #63052

6.8 | Dev-Note Spreadsheet

@marybaum shared a Google spreadsheet for Dev-Notes, sourced from the needs-dev-note TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. ticket. Anyone can edit, add their name as a Dev-Note author, and fill in relevant details as they draft, review, and publish. @jeffpaul also encouraged adding tickets 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 by the repository owner. https://github.com/ issues as needed, noting the sheet may not be complete. See here.

6.8 | Preparing Documentation for the 6.8 Release

@estelaris has already started preparing the documentation for 6.8. The remaining gaps need to be filled in. Itโ€™s important to keep this in mind, and all Core Team members are asked to contribute so we are ready for the April release. A Google Doc has been created by @estelaris for this purpose. See here.

Last Call for โ€œWhatโ€™s New for Developersโ€ Submissions

@marybaum reminded everyone to submit items for the March โ€œWhatโ€™s New for Developersโ€ edition. The deadline is March 5. The article will be published during the week of March 10.

If youโ€™d like to contribute to the Dev blogblog (versus network, site) or know someone who might, check out the Slack channel and join the editorial meeting this Thursday, March 6, at 15:00 UTC.

Call for the Security Role for the upcoming 6.8 release parties

@jeffpaul ask for assistance from the Core Team for the Security Role during the upcoming Release Parties. A detailed list of the dates can be found here: WordPress 6.8 Release Party Schedule. Should you be interested, please contact @jeffpaul.

Editor Updates ๐Ÿ”„

You can keep up to date with the major Editor features with the weekly updates, now on the blog!
Editor Weekly Updates: Feb 24 โ€“ Mar 2

Open floor ย ๐Ÿ’ฌ

Any topic can be raised for discussion in the comments, as well as requests for assistance on tickets. Tickets in the milestone for the next major or maintenance release will be prioritized.

Please include details of tickets / PRs and the links in the comments, and indicate whether you intend to be available during the meeting for discussion or will be async.

Props to @joemcgill and @jeffpaul for reviewing the agenda.

#6-8, #agenda, #dev-chat