Skip to content

Commit 0d0ca8b

Browse files
authored
Merge pull request #1932 from WordPress/publish/2025-03-17
Prepare 2025-03-17 release
2 parents aef2e8d + 9062bb0 commit 0d0ca8b

20 files changed

+145
-46
lines changed

plugins/embed-optimizer/load.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: Optimizes the performance of embeds through lazy-loading, preconnecting, and reserving space to reduce layout shifts.
66
* Requires at least: 6.6
77
* Requires PHP: 7.2
8-
* Version: 1.0.0-beta1
8+
* Version: 1.0.0-beta2
99
* Author: WordPress Performance Team
1010
* Author URI: https://make.wordpress.org/performance/
1111
* License: GPLv2 or later
@@ -71,7 +71,7 @@ static function ( string $global_var_name, string $version, Closure $load ): voi
7171
}
7272
)(
7373
'embed_optimizer_pending_plugin',
74-
'1.0.0-beta1',
74+
'1.0.0-beta2',
7575
static function ( string $version ): void {
7676
if ( defined( 'EMBED_OPTIMIZER_VERSION' ) ) {
7777
return;

plugins/embed-optimizer/readme.txt

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Contributors: wordpressdotorg
44
Tested up to: 6.7
5-
Stable tag: 1.0.0-beta1
5+
Stable tag: 1.0.0-beta2
66
License: GPLv2 or later
77
License URI: https://www.gnu.org/licenses/gpl-2.0.html
88
Tags: performance, embeds
@@ -67,6 +67,13 @@ The [plugin source code](https://github.com/WordPress/performance/tree/trunk/plu
6767

6868
== Changelog ==
6969

70+
= 1.0.0-beta2 =
71+
72+
**Enhancements**
73+
74+
* Update `OD_HTML_Tag_Processor::next_tag()` to allow `$query` arg and prepare to skip visiting tag closers by default. ([1872](https://github.com/WordPress/performance/pull/1872))
75+
* Expose the logging functions to client-side extensions and automatically account for the value of `isDebug`. ([1895](https://github.com/WordPress/performance/pull/1895))
76+
7077
= 1.0.0-beta1 =
7178

7279
**Enhancements**

plugins/image-prioritizer/load.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Requires at least: 6.6
77
* Requires PHP: 7.2
88
* Requires Plugins: optimization-detective
9-
* Version: 1.0.0-beta1
9+
* Version: 1.0.0-beta2
1010
* Author: WordPress Performance Team
1111
* Author URI: https://make.wordpress.org/performance/
1212
* License: GPLv2 or later
@@ -72,7 +72,7 @@ static function ( string $global_var_name, string $version, Closure $load ): voi
7272
}
7373
)(
7474
'image_prioritizer_pending_plugin',
75-
'1.0.0-beta1',
75+
'1.0.0-beta2',
7676
static function ( string $version ): void {
7777
if ( defined( 'IMAGE_PRIORITIZER_VERSION' ) ) {
7878
return;

plugins/image-prioritizer/readme.txt

+13-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Contributors: wordpressdotorg
44
Tested up to: 6.7
5-
Stable tag: 1.0.0-beta1
5+
Stable tag: 1.0.0-beta2
66
License: GPLv2 or later
77
License URI: https://www.gnu.org/licenses/gpl-2.0.html
88
Tags: performance, optimization, image, lcp, lazy-load
@@ -72,6 +72,18 @@ The [plugin source code](https://github.com/WordPress/performance/tree/trunk/plu
7272

7373
== Changelog ==
7474

75+
= 1.0.0-beta2 =
76+
77+
**Enhancements**
78+
79+
* Update `OD_HTML_Tag_Processor::next_tag()` to allow `$query` arg and prepare to skip visiting tag closers by default. ([1872](https://github.com/WordPress/performance/pull/1872))
80+
* Expose the logging functions to client-side extensions and automatically account for the value of `isDebug`. ([1895](https://github.com/WordPress/performance/pull/1895))
81+
82+
**Bug Fixes**
83+
84+
* Fix URL encoding in Link HTTP response header. ([1907](https://github.com/WordPress/performance/pull/1907))
85+
* Fix unpredictable LCP element being identified in a URL Metric Group. ([1903](https://github.com/WordPress/performance/pull/1903))
86+
7587
= 1.0.0-beta1 =
7688

7789
**Enhancements**

plugins/optimization-detective/class-od-html-tag-processor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ final class OD_HTML_Tag_Processor extends WP_HTML_Tag_Processor {
239239
*
240240
* @inheritDoc
241241
* @since 0.4.0
242-
* @since n.e.x.t Passing a $query is now allowed. In the 1.0.0 release, this will default to skipping tag closers.
242+
* @since 1.0.0 Passing a $query is now allowed. TODO: In the final non-beta 1.0.0 release, also note that this will default to skipping tag closers.
243243
*
244244
* @param array{tag_name?: string|null, match_offset?: int|null, class_name?: string|null, tag_closers?: string|null}|null $query Query.
245245
* @return bool Whether a tag was matched.

plugins/optimization-detective/class-od-link-collection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ function ( $image_candidate ) {
323323
/**
324324
* Encodes a URL for serving in an HTTP response header.
325325
*
326-
* @since n.e.x.t
326+
* @since 1.0.0
327327
*
328328
* @param string $url URL to percent encode.
329329
* @return string Percent-encoded URL.

plugins/optimization-detective/class-od-template-optimization-context.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Optimization Detective: OD_Template_Optimization_Context class
44
*
55
* @package optimization-detective
6-
* @since n.e.x.t
6+
* @since 1.0.0
77
*/
88

99
// @codeCoverageIgnoreStart
@@ -15,7 +15,7 @@
1515
/**
1616
* Context for optimizing a template.
1717
*
18-
* @since n.e.x.t
18+
* @since 1.0.0
1919
*
2020
* @property-read OD_URL_Metric_Group_Collection $url_metric_group_collection URL Metric group collection.
2121
* @property-read positive-int|null $url_metrics_id ID for the od_url_metrics post which provided the URL Metrics in the collection.
@@ -28,7 +28,7 @@ final class OD_Template_Optimization_Context {
2828
/**
2929
* URL Metric group collection.
3030
*
31-
* @since n.e.x.t
31+
* @since 1.0.0
3232
* @var OD_URL_Metric_Group_Collection
3333
*/
3434
private $url_metric_group_collection;
@@ -38,39 +38,39 @@ final class OD_Template_Optimization_Context {
3838
*
3939
* May be null if no post has been created yet.
4040
*
41-
* @since n.e.x.t
41+
* @since 1.0.0
4242
* @var positive-int|null
4343
*/
4444
private $url_metrics_id;
4545

4646
/**
4747
* Normalized query vars.
4848
*
49-
* @since n.e.x.t
49+
* @since 1.0.0
5050
* @var array<string, mixed>
5151
*/
5252
private $normalized_query_vars;
5353

5454
/**
5555
* Slug for the od_url_metrics post.
5656
*
57-
* @since n.e.x.t
57+
* @since 1.0.0
5858
* @var non-empty-string
5959
*/
6060
private $url_metrics_slug;
6161

6262
/**
6363
* Link collection.
6464
*
65-
* @since n.e.x.t
65+
* @since 1.0.0
6666
* @var OD_Link_Collection
6767
*/
6868
private $link_collection;
6969

7070
/**
7171
* Constructor.
7272
*
73-
* @since n.e.x.t
73+
* @since 1.0.0
7474
* @access private
7575
*
7676
* @param OD_URL_Metric_Group_Collection $url_metric_group_collection URL Metric group collection.
@@ -90,7 +90,7 @@ public function __construct( OD_URL_Metric_Group_Collection $url_metric_group_co
9090
/**
9191
* Gets a property.
9292
*
93-
* @since n.e.x.t
93+
* @since 1.0.0
9494
*
9595
* @param string $name Property name.
9696
* @return mixed Property value.

plugins/optimization-detective/deprecated.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* @package optimization-detective
66
*
7-
* @since n.e.x.t
7+
* @since 1.0.0
88
*/
99

1010
// @codeCoverageIgnoreStart

plugins/optimization-detective/detection.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static function ( OD_URL_Metric_Group $group ): array {
161161
/**
162162
* Registers the REST API endpoint for storing URL Metrics.
163163
*
164-
* @since n.e.x.t
164+
* @since 1.0.0
165165
* @access private
166166
*/
167167
function od_register_rest_url_metric_store_endpoint(): void {
@@ -180,7 +180,7 @@ function od_register_rest_url_metric_store_endpoint(): void {
180180
* This is intended to flush any page cache for the URL after the new URL Metric was submitted so that the optimizations
181181
* which depend on that URL Metric can start to take effect.
182182
*
183-
* @since n.e.x.t
183+
* @since 1.0.0
184184
*
185185
* @param positive-int $cache_purge_post_id Cache purge post ID.
186186
*/

plugins/optimization-detective/docs/hooks.md

+46
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,52 @@ Refer to [Image Prioritizer](https://github.com/WordPress/performance/tree/trunk
105105
[Embed Optimizer](https://github.com/WordPress/performance/tree/trunk/plugins/embed-optimizer) for additional
106106
examples of how tag visitors are used.
107107

108+
### Action: `od_start_template_optimization` (argument: `OD_Template_Optimization_Context`)
109+
110+
Fires before Optimization Detective starts iterating over the document in the output buffer.
111+
112+
This is before any of the registered tag visitors have been invoked.
113+
114+
It is important to note that this action fires _after_ the entire template has been rendered into the output buffer. In
115+
other words, it will fire after the `wp_footer` action.
116+
117+
This action runs before any of the registered tag visitors have been invoked in the current response. It is useful for
118+
an extension to gather the required information from the currently-stored URL Metrics for tag visitors to later leverage.
119+
See [example](https://github.com/WordPress/performance/pull/1921) from the Image Prioritizer plugin where it can be used
120+
to determine what the common external LCP background-image is for each viewport group up front so that this doesn't have
121+
to be computed when a tag visitor is invoked.
122+
123+
This action can be used if a site wants to prevent storing a response in the page cache until it has collected URL Metrics
124+
from both mobile and desktop:
125+
126+
```php
127+
add_action(
128+
'od_start_template_optimization',
129+
static function ( OD_Template_Optimization_Context $context ) {
130+
if (
131+
$context->url_metric_group_collection->get_first_group()->count() === 0
132+
||
133+
$context->url_metric_group_collection->get_last_group()->count() === 0
134+
) {
135+
header( 'Cache-Control: private' );
136+
}
137+
}
138+
);
139+
```
140+
141+
This could just as well be done at `od_finish_template_optimization` since the headers are not sent until after that
142+
action completes and the output buffer is returned.
143+
144+
### Action: `od_finish_template_optimization` (argument: `OD_Template_Optimization_Context`)
145+
146+
Fires after Optimization Detective has finished iterating over the document in the output buffer.
147+
148+
This is after all the registered tag visitors have been invoked.
149+
150+
This action runs after all the tags in a document have been visited and so no additional tag visitor will be invoked.
151+
This action has limited usefulness at the moment, but see [#1931](https://github.com/WordPress/performance/issues/1931)
152+
for possibilities for what it could be used for in the future.
153+
108154
### Action: `od_url_metric_stored` (argument: `OD_URL_Metric_Store_Request_Context`)
109155

110156
Fires whenever a URL Metric was successfully stored.

plugins/optimization-detective/optimization.php

+8-4
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,11 @@ function od_optimize_template_output_buffer( string $buffer ): string {
286286
);
287287

288288
/**
289-
* Fires before Optimization Detective starts optimizing the template.
289+
* Fires before Optimization Detective starts iterating over the document in the output buffer.
290290
*
291-
* @since n.e.x.t
291+
* This is before any of the registered tag visitors have been invoked.
292+
*
293+
* @since 1.0.0
292294
*
293295
* @param OD_Template_Optimization_Context $template_optimization_context Template optimization context.
294296
*/
@@ -355,9 +357,11 @@ function od_optimize_template_output_buffer( string $buffer ): string {
355357
}
356358

357359
/**
358-
* Fires after Optimization Detective finishes optimizing the template.
360+
* Fires after Optimization Detective has finished iterating over the document in the output buffer.
361+
*
362+
* This is after all the registered tag visitors have been invoked.
359363
*
360-
* @since n.e.x.t
364+
* @since 1.0.0
361365
*
362366
* @param OD_Template_Optimization_Context $template_optimization_context Template optimization context.
363367
*/

plugins/optimization-detective/readme.txt

+21-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Contributors: wordpressdotorg
44
Tested up to: 6.7
5-
Stable tag: 1.0.0-beta2
5+
Stable tag: 1.0.0-beta3
66
License: GPLv2 or later
77
License URI: https://www.gnu.org/licenses/gpl-2.0.html
88
Tags: performance, optimization, rum
@@ -13,11 +13,11 @@ Provides a framework for leveraging real user metrics to detect optimizations fo
1313

1414
This plugin captures real user metrics about what elements are displayed on the page across a variety of device form factors (e.g. desktop, tablet, and phone) in order to apply loading optimizations which are not possible with WordPress’s current server-side heuristics.
1515

16-
This plugin is a dependency which does not provide end-user functionality on its own. For that, please install the dependent plugin [Image Prioritizer](https://wordpress.org/plugins/image-prioritizer/) or [Embed Optimizer](https://wordpress.org/plugins/embed-optimizer/) (among [others](https://github.com/WordPress/performance/labels/%5BPlugin%5D%20Optimization%20Detective) to come from the WordPress Core Performance team). There are currently **no settings** and no user interface for this plugin since it is designed to work without any configuration.
16+
This plugin is a framework dependency which does not provide optimization functionality on its own. For that, please install the [Image Prioritizer](https://wordpress.org/plugins/image-prioritizer/) and [Embed Optimizer](https://wordpress.org/plugins/embed-optimizer/) dependent plugins (among [others](https://github.com/WordPress/performance/labels/%5BPlugin%5D%20Optimization%20Detective) to come from the WordPress Core Performance team). There are currently **no settings** and no user interface for this plugin since it is designed to work without any configuration.
1717

18-
Your site must have the **REST API accessible** to frontend visitors since this is how metrics are collected about how a page should be optimized.
18+
Your site must currently have the **REST API accessible** to unauthenticated frontend visitors since this is how real user metrics are collected about pages on your site; nevertheless, [exploration](https://github.com/WordPress/performance/issues/1311) is underway for providing alternative mechanisms for collecting the metrics. Also, please note that no metrics are currently collected from Safari since it does not yet support the [Largest Contentful Paint](https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint) metric, but support for this [Core Web Vitals](https://web.dev/explore/learn-core-web-vitals) metric is coming this year [via Interop 2025](https://webkit.org/blog/16458/announcing-interop-2025/#core-web-vitals).
1919

20-
Please refer to the [full plugin documentation](https://github.com/WordPress/performance/blob/trunk/plugins/optimization-detective/docs/README.md) for a [technical introduction](https://github.com/WordPress/performance/blob/trunk/plugins/optimization-detective/docs/introduction.md), [filter/action hooks](https://github.com/WordPress/performance/blob/trunk/plugins/optimization-detective/docs/hooks.md), and [extensions](https://github.com/WordPress/performance/blob/trunk/plugins/optimization-detective/docs/extensions.md) that show use cases and examples.
20+
Please refer to the [full plugin documentation](https://github.com/WordPress/performance/blob/trunk/plugins/optimization-detective/docs/README.md) for a [technical introduction](https://github.com/WordPress/performance/blob/trunk/plugins/optimization-detective/docs/introduction.md), [filter/action hooks](https://github.com/WordPress/performance/blob/trunk/plugins/optimization-detective/docs/hooks.md), and [extensions](https://github.com/WordPress/performance/blob/trunk/plugins/optimization-detective/docs/extensions.md) that show use cases and examples. You can also watch the talk from WordCamp Asia 2025: [Boosting Performance with Optimization Detective](https://weston.ruter.net/2025/02/21/boosting-performance-with-optimization-detective/).
2121

2222
== Installation ==
2323

@@ -55,6 +55,23 @@ The [plugin source code](https://github.com/WordPress/performance/tree/trunk/plu
5555

5656
== Changelog ==
5757

58+
= 1.0.0-beta3 =
59+
60+
**Enhancements**
61+
62+
* Fire actions before and after Optimization Detective processes a document. ([1919](https://github.com/WordPress/performance/pull/1919))
63+
* Update `OD_HTML_Tag_Processor::next_tag()` to allow `$query` arg and prepare to skip visiting tag closers by default. ([1872](https://github.com/WordPress/performance/pull/1872))
64+
* Expose the logging functions to client-side extensions and automatically account for the value of `isDebug`. ([1895](https://github.com/WordPress/performance/pull/1895))
65+
* Update URL Metric storage REST API endpoint to return status code `423 Locked` instead of `403 Forbidden`. ([1863](https://github.com/WordPress/performance/pull/1863))
66+
* De-duplicate logic between REST API and URL Metrics post type. ([1867](https://github.com/WordPress/performance/pull/1867))
67+
68+
**Bug Fixes**
69+
70+
* Fix URL encoding in Link HTTP response header. ([1907](https://github.com/WordPress/performance/pull/1907))
71+
* Fix triggering post update actions after storing a URL Metric and refactor REST API endpoint logic into class. ([1865](https://github.com/WordPress/performance/pull/1865))
72+
* Fix unpredictable LCP element being identified in a URL Metric Group. ([1903](https://github.com/WordPress/performance/pull/1903))
73+
* Handle missing Web Crypto API in non-HTTPS contexts when generating the already-submitted `sessionStorage` key. ([1911](https://github.com/WordPress/performance/pull/1911))
74+
5875
= 1.0.0-beta2 =
5976

6077
**Enhancements**

0 commit comments

Comments
 (0)