WordPress 6.0 will introduce performance improvements for custom pages – WP Tavern

Jonny Harris, WordPress core committer merge a patch in WordPress core for a 12 year old ticket which he says has the potential to bring “a massive effect on custom page performance.” The change, which will be included in the upcoming 6.0 release, stops unnecessary requests when developers use the do_parse_request filter, thanks to a patch updated by contributor Paul Bearne.

Harris summarized the issue and how the change improves performance in the commit message:

Plugin and theme developers can use the do_parse_request filter direct requests and log in early to view personalized pages. However, even though these queries may not require running post queries and 404 lookups, they still run. This can cause unnecessary SQL queries to be performed on these requests. By adding a return value to the parse_request method of WP class, these requests can now be ignored.

Core WordPress contributor Konstantin Kovshenin detailed the need for this change in a Twitter thread he posted in 2021, when asking for help with the ticket:

Harris conducted a quick review of plugins that use the filter and says he does not foresee any breakage. The search found 133 plugins using the filter. Some of the most popular include the Google Site Kit plugin (over 1 million installs), The Events Calendar (800,000 installs), and AMP (500,000 installs). Harris suggested the change requires a dev note because it may have unforeseen side effects. The dev note is likely to be released closer to the release date. The release of WordPress 6.0 is currently scheduled for May 24, 2022.

Esther L. Gunn