Performance Chat Summary: 3 June 2025

The full chat log is available beginning here on Slack.

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 (and other performance plugins)

  • @westonruter announced that the initial release of the View Transitions plugin is now live on 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/. 🎉
    • @jonoaldersonwp and @westonruter both installed the plugin on their personal sites and reported positive feedback on its visual smoothness and polish.
    • @flixos90 shared that a blogblog (versus network, site) post is being prepared to explain the plugin’s background a bit more, and there are plans to explore it further with contributors at WordCampWordCamp WordCamps are casual, locally-organized conferences covering everything related to WordPress. They're one of the places where the WordPress community comes together to teach one another what they’ve learned throughout the year and share the joy. Learn more. Europe.
    • @flixos90 highlighted the significant value of achieving these transitions without needing to rearchitect the entire site or work around WordPress’s default behavior.
    • @jonoaldersonwp noted that this solution is preferable to the old AMP-based AJAX content wrapper approach.

Open Floor

  • @b1ink0 reminded everyone that the upcoming Performance Bug Scrub is scheduled for June 10, 2025, noted an open host slot, and invited anyone interested to lead it.
    • @flixos90 volunteered to host the 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 on June 10, due to a scheduling conflictconflict A conflict occurs when a patch changes code that was modified after the patch was created. These patches are considered stale, and will require a refresh of the changes before it can be applied, or the conflicts will need to be resolved. with the originally planned slot on June 24.

Our next chat will be held on Tuesday, June 17, 2025 at 15:00 UTC in the #core-performance channel in Slack.

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

Performance Chat Summary: 20 May 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 shared work on #61734 / PR #8815 adding fetchpriority support for Scripts and Script Modules.
  • @spacedmonkey shared a desire to see some eyes on #59592
    • @spacedmonkey says it seems to have a massive effect for those using object caching. The change has unit tests and has been been reviewed by a non committercommitter A developer with commit access. WordPress has five lead developers and four permanent core developers with commit access. Additionally, the project usually has a few guest or component committers - a developer receiving commit access, generally for a single release cycle (sometimes renewed) and/or for a specific component.. Just needs another committers to give it the thumbs up.
    • @spacedmonkey would like to land this ASAP, to allow as much time as possible to test this change.
    • @rmccue confirmed support for the proposal but cannot review the code in the short term.
    • @westonruter asked whether there’s TTFB benchmarking data available for the 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..
      • @spacedmonkey noted there would’t be any noticeable difference there. This change would help high traffic site and helps database and object cache performance.
      • @tillkruess noted It will just reduce memory usage in the cache significantly, or make it easier to keep it low.
  • @spacedmonkey noted that #58001, #63021, and #57496 are still awaiting a second round of review.

Open Floor

  • @b1ink0 brought up some confusion around the 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 timing, asking if the schedule should be revisited to avoid conflicts. (Bug scrub schedule link)
    • @westonruter asked if the time had already been moved to avoid conflicting with coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. dev chat.
    • @westonruter confirmed that, according to the Make Meetings page, it had not been adjusted.
    • @swissspidy suggested moving the bug scrub to Tuesdays on alternate weeks from office hours.
    • @westonruter and @flixos90 both supported the idea.
    • @swissspidy updated the Make Meetings page and Bug scrub schedule, then shared the schedule for the next meetings as follows:
      • May 27 – bug scrub (potentially led by @adamsilverstein)
      • June 3 – office hours (@swissspidy would probably cancel that one because of WordCampWordCamp WordCamps are casual, locally-organized conferences covering everything related to WordPress. They're one of the places where the WordPress community comes together to teach one another what they’ve learned throughout the year and share the joy. Learn more. Europe)
      • June 10 – bug scrub
      • June 17 – office hours

Our next chat will be held on Tuesday, June 3, 2025 at 15:00 UTC in the #core-performance channel in Slack.

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

Performance Chat Summary: 6 May 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 asked if any performance-related fixes were included in the WordPress 6.8.1 release.
    • @b1ink0 confirmed that the update focused primarily on general 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 across WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. and 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, with no specific performance items.
  • @westonruter noted that he has some pending PRs to review and merge.

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 (and other performance plugins)

  • @flixos90 has started work on the new View Transitions feature pluginFeature Plugin A plugin that was created with the intention of eventually being proposed for inclusion in WordPress Core. See Features as Plugins. (see issue #1997). The work is being tracked through a series of iterative PRs, starting with theme support and dynamic transition name handling. It builds on the experimental Core PR wordpress-develop#8370 and will include a UIUI User interface for customizing transitions.
    • @flixos90 plans to work on the next PRs later this week, with most work focused on porting the experimental code into plugin shape.
    • When asked if the plugin would be considered stable or experimental upon release by @mukesh27, @flixos90 noted that it depends on the final feature set and the team’s evaluation at that time.
  • @mukesh27 briefly noted progress on Accurate Sizes (part of the Auto Sizes plugin) and will share a more detailed update later this week.

Our next chat will be held on Tuesday, May 20, 2025 at 15:00 UTC in the #core-performance channel in Slack.

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

Performance Chat Summary: 22 April 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

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 (and other performance plugins)

  • No immediate updates or blockers were reported for the Performance Lab plugin suite.
  • @flixos90 shared that work is beginning on a new View Transitions feature pluginFeature Plugin A plugin that was created with the intention of eventually being proposed for inclusion in WordPress Core. See Features as Plugins. (issue #1963). This plugin aims to provide a WordPress-specific 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. for enabling cross-document view transitions.
    • Development will start with a few experimental PRs, similar to the approach taken with the Web Worker Offloading plugin. A public release will only happen once an MVPMinimum Viable Product "A minimum viable product (MVP) is a product with just enough features to satisfy early customers, and to provide feedback for future product development." - WikiPedia is ready.
    • For those curious about the planned approach, @flixos90 pointed to an experimental PR opened against CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.: wordpress-develop#8370, which will serve as the basis before being ported over to plugin form.

Open Floor

  • @flixos90 removed the milestone due dates from the performance plugin repo, following the team’s decision to move to an on-demand release schedule. Due dates will now be set only when a specific plugin release is planned.
  • @flixos90 shared an adapted 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/ Actions workflow originally created by @shyamgadde to bump the “Tested up to” version in readme.txt without triggering a full deployment. The updated version works for single-plugin repos and can be reused by most plugins on 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/. Example: bump-tested-up-to-dotorg.yml
    • @flixos90 is planning to write a blogblog (versus network, site) post to promote the workflow.

Our next chat will be held on Tuesday, May 6, 2025 at 15:00 UTC in the #core-performance channel in Slack.

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

WP_Query changes in WordPress 6.8

WordPress 6.8 includes some caching optimizations that may affect themes and plugins using the WP_Query::get() method and the WP_Query::$query_vars property.

In #59516, WP_Query was optimized to improve cache hits for queries with equivalent arguments.

This enhancementenhancement Enhancements are simple improvements to WordPress, such as the addition of a hook, a new feature, or an improvement to an existing feature. improves performance for sites that run equivalent queries with a different order of arguments. The impact will be most noticeable on sites without a persistent cache, as these equivalent queries would run multiple times on a single page request, whereas they will now run once.

As such theme and 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 authors making use of filters within WP_Query (source code: GitHub, trac) are recommended to check their code for compatibility with WordPress 6.8. An example of code that would be affected by this is using equality to check for the contents of an array:

$query = new WP_Query( array( 'post_type' => array( 'post', 'page' ) ) );

add_filter( 'posts_where', function ( $where, $query ) {
        // True in WordPress 6.7, false in WordPress 6.8
        // WordPress 6.7 returns array( 'post', 'page' )
        // WordPress 6.8 returns array( 'page', 'post' )
        if ( array( 'post', 'page' ) === $query->get( 'post_type' ) ) {
                // Modify WHERE clause.
        }

        return $where;
}, 10, 2 );

When comparing the contents of two arrays for equivalence, it is recommended to use the code empty( array_diff( /* arrays */ ) ) rather than equality comparisons. See this example for a demonstration.

Standardized arguments.

The most common example of where these changes will improve performance is when querying multiple post types:

$q1 = new WP_Query( [ 'post_type' => [ 'post', 'page' ] ] );
$q2 = new WP_Query( [ 'post_type' => [ 'page', 'post'] ] );
$q3 = new WP_Query( [ 'post_type' => [ 'page', 'post', 'post' ] ] );

In WordPress 6.7 and earlier, these queries would each result in database queries as they were not seen as equivalent in the resulting database query and cache key.

To standardize equivalent queries, WP_Query now sorts and type casts arguments as appropriate. For each of the queries above the post types are sorted alphabetically and any duplicates removed. In WordPress 6.8 the ::get() method and ::$query_vars property will differ from the arguments passed to $q1 and $q3:

$q1->get( 'post_type' ) // returns [ 'page', 'post' ]
$q2->get( 'post_type' ) // returns [ 'page', 'post' ]
$q3->get( 'post_type' ) // returns [ 'page', 'post' ]

$q1->query_vars['post_type'] === [ 'page', 'post' ]
$q2->query_vars['post_type'] === [ 'page', 'post' ]
$q3->query_vars['post_type'] === [ 'page', 'post' ]

For items that accept values as either an integer or a string, these have been sorted and typecast as appropriate, for example author__not_in => [ '2', '1' ] becomes author__not_in => [ 1, 2 ]. A full list of affected arguments can be found in the commit message [59766].

Due to differences in the code paths when the post type and status are passed as a string, these are not type cast to an array 

$q4 = new WP_Query( [ 'post_type' => 'post' ] );
$q4->get( 'post_type' ) // returns 'post'

These changes are part of an ongoing effort to improve the performance of WordPress. The coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. team are monitoring the changes for any major issues that may occur, see #63255

Props @joemcgill and @jorbin for their review of this post.

#6-8, #dev-notes, #dev-notes-6-8, #performance

WordPress 6.8 performance improvements

This post is the latest in a series of updates focused on the performance improvements of major releases (see 6.76.66.56.46.3, and 6.2).

WordPress 6.8, “Cecil” is the first and likely only major version WordPress released in 2025. It includes numerous significant performance improvements to the editing and browsing experience, spearheaded by the speculative loading feature. The release pays special attention to performance 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, frontend interactivity, block type registration, and query caching.

This post summarizes the performance changes since the 6.7 release, both in terms of enhancements and concrete metrics. For a comprehensive overview of new features and enhancements beyond just performance, please explore the WordPress 6.8 Field Guide.

Key improvements

In total, there were 24 performance related improvements included in this release: 1 feature, 14 enhancements, and 9 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. This section summarizes a few highlights among them.

Speculative loading for near-instance page loads

In #62503, the speculative loading feature was added. It can notably improve the Largest Contentful Paint (LCP) performance and, depending on the configuration, lead to truly instant page loads. To accomplish this, the feature uses the Speculation Rules API, a web platform 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. that allows defining rules for which kinds of URLs to prefetch or prerender, and how eagerly speculative loading should occur. By default, URLs are prefetched when the user interacts with a link to them (“conservative” eagerness). For an additional performance boost, up to the instant page loads, the configuration can be adjusted through filters or by using the canonical Speculative Loading plugin.

Please refer to the Speculative Loading dev note for details on the feature’s behavior and how to customize it.

Asynchronous Interactivity API event listeners by default for smoother interactions

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/ issue #64944, the foundation was set for asynchronous event listeners by default for the Interactivity API. Running event listener logic asynchronously helps avoid long tasks in the browser, which can notably improve the Interaction to Next Paint (INP) performance and thus ensure the website responds to user interactions without any delays. WordPress 6.8 does not actually implement this change just yet, but it prepares for the change to launch in a following release by introducing a withSyncEvent() utility function that needs to be used by any Interactivity API store action that is attached to an event and needs to run synchronously.

Please refer to the Interactivity API best practices dev note for details on how to use withSyncEvent() and how to avoid deprecation warnings.

Smarter WP_Query cache key generation for increased cache hit chance

In #59516, the logic around generating a cache key for post queries via WP_Query was improved to increase the chance for a cache hit. In other words, it reduces the need to run SQL queries for queries that are sure to yield the same results even though their query variables may technically differ. In particular, any query variables that expect arrays in which the order of items does not matter are now being normalized prior to generating the cache key.

count_user_posts() caching to avoid potentially slow queries

In #39242, caching was added to the count_user_posts() function to avoid a SQL query that in certain setups could previously occur on every page load. On sites with many registered users, this query can be slow, which is why caching its results can lead to a notable server-side performance boost. While this primarily applies to WP Adminadmin (and super admin), certain themes also call this function, so it can have a notable impact on the website’s frontend performance as well.

get_option() 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. from WordPress 6.4 identified and addressed

In #62692, a performance regression due to a problem introduced in WordPress 6.4 in the get_option() function was identified and fixed. The lookup of a non-existent option was leading to an unnecessary wp_cache_get() call that would always evaluate to false. For large WordPress sites, this could significantly increase the load on caching servers. The fix ensures the unnecessary wp_cache_get() call no longer happens, leading to a constant number of wp_cache_get() calls per non-existent option, even if it is requested many times.

Performance metrics

The performance benchmarks for the WordPress 6.8 release show a small regression in both server-side performance and client-side performance across block themes and classic themes.

The median Largest Contentful Paint (LCP) time, which is the metric most representative of the overall performance, increased by 3.40 ms (1.76%) for Twenty Twenty-One, 2.65 ms (1.92%) for Twenty Twenty-Three, and 10.05 ms (1.73%) for Twenty Twenty-Five. The increased time signifies a decrease in performance, albeit a small one.

While it is natural that every new feature or enhancementenhancement Enhancements are simple improvements to WordPress, such as the addition of a hook, a new feature, or an improvement to an existing feature. can incur a performance cost, ideally the regression needs to be investigated for whether there is a specific change that is primarily responsible for it or whether it is simply due to the accumulation of several new features and enhancements with a minor performance cost. At first glance, it might be the latter because a similar degree of regression can be noted more or less across all metrics.

It is worth noting that the performance metrics do not benefit from the new speculative loading feature, since it only helps with performance when navigating from one URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org of the site to another URL of the site. Because the benchmarks rely on individual requests to specific URLs though, speculative loading does not trigger. In other words, it is fair to assume that the actual performance impact of WordPress 6.8 for users navigating through a WordPress site is more positive than the benchmarks indicate.

How release performance is measured

The performance measurements used for the overview are based on benchmarks conducted using an automated workflow 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/ action runners. Benchmarks were taken from the homepage of the Twenty Twenty-One, Twenty Twenty-Three, and Twenty Twenty-Five themes, comparing WordPress 6.8-RC3 with WordPress 6.7.2, which was the latest version of 6.7 available as of the 6.8 release.

Under the hood, the automated workflow collects performance metrics from 100 runs for both Web Vitals and Server Timing metrics using CLI scripts from the WPP Research repo.

Full benchmark data

What’s next?

Once WordPress 6.8 has been used for at least a month, additional research should be conducted to assess its performance impact in the field by using CrUX data. This will clarify to what extent the regression shown by the benchmarks is an actual reason to worry or not. Additionally, the performance impact of the speculative loading feature should be assessed as part of that, to see how much it influences LCP in practice.

Other than that, the focus of the CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Performance Team remains to iterate on the performance of WordPress by identifying areas of improvement and addressing them. With the reduced major release cadence following the 6.8 release, it may be even more important to focus on all the little things that can be done to improve performance—they add up. Minor releases will continue to ship as necessary, and as mentioned in the linked post there will be a more relaxed barrier for inclusion of enhancements. In other words, WordPress Core continues to provide lots of opportunities for improving its performance.

Props @joemcgill for review and proofreading.

#6-8, #core, #core-performance, #performance

Performance Chat Summary: 8 April 2025

The full chat log is available beginning here on Slack.

Announcements / Reminders

  • The Performance team is shifting the timing of out meetings to 3pm UTC to match many countries having shifted their time 1 hour in recent weeks. Our next chat will be held on Tuesday, April 22, 2025 at 15:00 UTC.

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

    There wasn’t much to discuss on performance tickets for the upcoming 6.8 release, since it is coming out next week.

    The team discussed the recently announced slowing 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. cadence and how that might impact the team’s work. While this means we will have more time to land new features in 6.9, @swissspidy pointed out what “with more time between releases it becomes even more important to keep an eye on any performance regressions over time”. He plans to work to better document the existing tools we have that help address that. He also pointed out that plugins become more important, so we might want to build more Performance Lab plugins going forward.

    Meeting time

    With many countries having shifted their time 1 hour in the last few weeks, the team discussed and emoji-voted on whether to move our meeting time to match. The decision was to change the time from 4pm UTC to 3pm UTC. The time at https://make.wordpress.org/meetings/ was adjusted to reflect this change. The same one hour shift was made to the timing of our 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 as well.

    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 (and other performance plugins)

        Our next chat will be held on Tuesday, April 22, 2025 at 15:00 UTC in the #core-performance channel in Slack.

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

        Performance Chat Summary: 25 March 2025

        The full chat log is available beginning here on Slack.

        Performance Lab plugins

        • As a consequence from the previous meeting and last week’s release (which for the first time saw releases for only a few of the performance plugins, without Performance Lab), changes to the release cadence were defined
        • Specifically, the team will change release cadence from monthly to on-demand (which could be more frequent or less frequent).
        • Consequently, the release procedure will be much more streamlined, avoiding the previously used “release party” format in favor of someone simply following the release handbook and sharing progress along the way.
        • Related to that, @westonruter has taken the separate release party chats handbook docs and moved the relevant example chats inline with the sections in the releasing the plugin handbook page. This eliminates the duplication of release instructions between the two resources.
        • @mukesh27 shared that PRs #1795 and #1818 are ready for review.

        Our next chat will be held on Tuesday, April 8, 2025 at 15:00 UTC in the #core-performance channel in Slack.

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

        Interactivity API best practices in 6.8

        WordPress 6.8 comes with a few new best practices and requirements in the Interactivity 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. that are part of a longer-term continuous-improvement effort. Some of the relevant changes in 6.8 are an intermediary step: They do not include these enhancements themselves, but they prepare the project to add them in a future release by adding two new deprecation warnings.

        If you have been using the Interactivity API in your project, especially if you have been writing your own stores, please read on to learn how you can prepare your changes for the latest and future behavior of the API.

        How to apply the latest best practices (and avoid deprecation warnings)

        To help the Interactivity API speed up WordPress, the project is working towards running most store actions asynchronously by default, as a better foundation for achieving good INP (“Interaction to Next Paint”) performance. Right now, browsers invoke all synchronous Interactivity API event handlers as part of the same task—this means they stack up. This can make the user wait for longer than 50 milliseconds (also called a “long task”) for the site to reactReact React is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org/. to some interaction, like clicking a button.

        Starting with 6.8, and going forward, the Interactivity API’s push towards asynchronous handlers as the default will make those long tasks less likely. The 6.8 release only prepares for the transition. In the following WordPress release, the API will automatically yield to the main thread in between handlers, so ideally there’s nothing to stack up, and nothing to make the user wait. (Also refer to async actions and the splitTask() function.)

        This performance enhancementenhancement Enhancements are simple improvements to WordPress, such as the addition of a hook, a new feature, or an improvement to an existing feature. also helps with cross-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 compatibility, as handlers for the same event may come from different plugins. The new requirements outlined below are an important step to prepare the Interactivity API for that future.

        Wrap certain action callbacks in withSyncEvent()

        Pay attention to any store action that is attached to an event listener (like data-wp-on--click) and accesses the event object: If the action callback uses any of the event properties or methods below, you need to wrap it in a newly added utility function called withSyncEvent():

        • Property: event.currentTarget
        • Method: event.preventDefault()
        • Method: event.stopImmediatePropagation()
        • Method: event.stopPropagation()

        Starting in WordPress 6.8, if any action callback uses the above event properties or methods and is not wrapped in withSyncEvent(), that action callback will trigger a deprecation warning. For now, the logic will continue to work as before. But in a future WordPress release it will break if you do not migrate. For example, event.preventDefault() will not prevent the default action since the action will be asynchronous by default. As such, please make sure to resolve any deprecation warnings you see.

        This correct (✅) code example illustrates how to use withSyncEvent():

        import { store, withSyncEvent } from '@wordpress/interactivity';
        
        store( 'myPlugin', {
        	actions: {
        		// `event.preventDefault()` requires synchronous event access.
        		preventNavigation: withSyncEvent( ( event ) => {
        			event.preventDefault();
        		} ),
        
        		// `event.target` does not require synchronous event access.
        		logTarget: ( event ) => {
        			console.log( 'event target => ', event.target );
        		},
        
        		// Not using `event` at all does not require synchronous event access.
        		logSomething: () => {
        			console.log( 'something' );
        		},
        	},
        } );
        

        This bad (❌) example will, going forward, emit a deprecation warning:

        import { store } from '@wordpress/interactivity';
        
        store( 'myPlugin', {
        	actions: {
        		// Missing `withSyncEvent()` around synchronous event access.
        		preventNavigation: ( event ) => {
        			event.preventDefault();
        		},
        	},
        } );
        

        Do not use actions to determine HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. attribute values

        If you have been relying on Interactivity API store functions (like actions or callbacks) to determine HTML attribute values (e.g. via data-wp-bind--attr), please revise these attributes now. Instead, use global state, local context, or derived state. And please do not combine these function calls with directive logic like the ! operator.

        Starting in WordPress 6.8, any directive using a store function in combination with the ! operator will emit a deprecation warning. The logic will continue to work as before for now, but in a future WordPress release it will break if you do not migrate. More broadly, if you are using store functions in directives that determine HTML attribute values, please migrate to using global state, local context, or derived state instead. More deprecation warnings around incorrect usage of store functions are expected soon, and eventually unmigrated code is going to break.

        Please refer to the following correct (✅) code example to illustrate how to use derived state:

        import { store } from '@wordpress/interactivity';
        
        store( 'myPlugin', {
        	state: {
        		get isOpen() {
        			const ctx = getContext();
        			return !! ctx.open;
        		},
        	},
        } );
        
        <div
        	data-wp-interactive="myPlugin"
        	data-wp-bind--hidden="!state.isOpen"
        >
        	Content.
        </div>
        

        This bad (❌) example will, going forward, emit a deprecation warning:

        import { store } from '@wordpress/interactivity';
        
        store( 'myPlugin', {
        	actions: {
        		isOpen() {
        			const ctx = getContext();
        			return !! ctx.open;
        		},
        	},
        } );
        
        <div
        	data-wp-interactive="myPlugin"
        	data-wp-bind--hidden="!actions.isOpen"
        >
        	Content.
        </div>
        

        To provide context on why this new requirement is relevant: Using store functions for anything other than the “on”, “init”, or “watch” groups of directives has always been an anti-pattern. It is now being more formally discouraged, and will in the future be made impossible.

        Support for the .length property in directives

        An additional Interactivity API enhancement in WordPress 6.8 is support for the .length property on strings and numeric arrays in directives, ensuring consistency between server and client rendering.

        Previously, the .length property was unavailable on the server, requiring workarounds. This update allows developers to use .length within all directives that reference global state, local context, or derived state, aligning behavior across environments.

        This code example illustrates using the .length property:

        <div data-wp-interactive="example">
          <div data-wp-bind--hidden="!state.list.length">
            <input type="range" min="1" data-wp-bind--max="state.list.length">
          </div>
          <div data-wp-bind--hidden="!state.string.length">
            <h1 data-wp-text="state.string"></h1>
          </div>
        </div>
        

        This improvement streamlines logic and improves developer experience.

        Summary and further reading

        Please refer to the following links for further reading:

        • 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/ pull request #68097 for the withSyncEvent and new directive requirement enhancements
        • Gutenberg issues #64944 and #69552 with additional context on the long-term plans to run Interactivity API actions asynchronously by default.
        • Gutenberg issue #69269 with additional context on the long-term plans to more clearly separate directives that do something vs that determine a value.
        • 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. #62582 for support of the .length property.
        • Documentation for understanding global state, local context, or derived state.

        Co-authored by @gziolo.
        Props to @westonruter, @jonsurrell, @webcommsat, @marybaum for review and proofreading.

        #6-8, #dev-notes, #dev-notes-6-8, #interactivity-api, #performance

        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 be 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