Skip to content

Commit 61fa5d2

Browse files
authored
Merge pull request #1933 from WordPress/release/2025-03-17
Post 2025-03-17 release merge
2 parents 47eef00 + 0d0ca8b commit 61fa5d2

23 files changed

+155
-387
lines changed

plugins/embed-optimizer/load.php

Lines changed: 2 additions & 2 deletions
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

Lines changed: 8 additions & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 13 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 9 additions & 9 deletions
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

Lines changed: 1 addition & 1 deletion
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/detect.js

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -329,23 +329,6 @@ function extendElementData( xpath, properties ) {
329329
Object.assign( elementData, properties );
330330
}
331331

332-
/**
333-
* Compresses a (JSON) string using CompressionStream API.
334-
*
335-
* @param {string} jsonString - JSON string to compress.
336-
* @return {Promise<Blob>} Compressed data.
337-
*/
338-
async function compress( jsonString ) {
339-
const encodedData = new TextEncoder().encode( jsonString );
340-
const compressedDataStream = new Blob( [ encodedData ] )
341-
.stream()
342-
.pipeThrough( new CompressionStream( 'gzip' ) );
343-
const compressedDataBuffer = await new Response(
344-
compressedDataStream
345-
).arrayBuffer();
346-
return new Blob( [ compressedDataBuffer ], { type: 'application/gzip' } );
347-
}
348-
349332
/**
350333
* @typedef {{timestamp: number, creationDate: Date}} UrlMetricDebugData
351334
* @typedef {{groups: Array<{url_metrics: Array<UrlMetricDebugData>}>}} CollectionDebugData
@@ -361,8 +344,6 @@ async function compress( jsonString ) {
361344
* @param {boolean} args.isDebug - Whether to show debug messages.
362345
* @param {string} args.restApiEndpoint - URL for where to send the detection data.
363346
* @param {string} [args.restApiNonce] - Nonce for the REST API when the user is logged-in.
364-
* @param {boolean} args.gzdecodeAvailable - Whether application/gzip can be sent to the REST API.
365-
* @param {number} args.maxUrlMetricSize - Maximum size of the URL Metric to send.
366347
* @param {string} args.currentETag - Current ETag.
367348
* @param {string} args.currentUrl - Current URL.
368349
* @param {string} args.urlMetricSlug - Slug for URL Metric.
@@ -381,8 +362,6 @@ export default async function detect( {
381362
extensionModuleUrls,
382363
restApiEndpoint,
383364
restApiNonce,
384-
gzdecodeAvailable,
385-
maxUrlMetricSize,
386365
currentETag,
387366
currentUrl,
388367
urlMetricSlug,
@@ -817,17 +796,7 @@ export default async function detect( {
817796
const maxBodyLengthBytes = maxBodyLengthKiB * 1024;
818797

819798
const jsonBody = JSON.stringify( urlMetric );
820-
if ( jsonBody.length > maxUrlMetricSize ) {
821-
error(
822-
`URL Metric is ${ jsonBody.length.toLocaleString() } bytes, exceeding the maximum size of ${ maxUrlMetricSize.toLocaleString() } bytes:`,
823-
urlMetric
824-
);
825-
return;
826-
}
827-
828-
const payloadBlob = gzdecodeAvailable
829-
? await compress( jsonBody )
830-
: new Blob( [ jsonBody ], { type: 'application/json' } );
799+
const payloadBlob = new Blob( [ jsonBody ], { type: 'application/json' } );
831800
const percentOfBudget =
832801
( payloadBlob.size / ( maxBodyLengthKiB * 1000 ) ) * 100;
833802

plugins/optimization-detective/detection.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ static function ( OD_URL_Metric_Group $group ): array {
140140
'storageLockTTL' => OD_Storage_Lock::get_ttl(),
141141
'freshnessTTL' => od_get_url_metric_freshness_ttl(),
142142
'webVitalsLibrarySrc' => $web_vitals_lib_src,
143-
'gzdecodeAvailable' => function_exists( 'gzdecode' ),
144-
'maxUrlMetricSize' => od_get_maximum_url_metric_size(),
145143
);
146144
if ( is_user_logged_in() ) {
147145
$detect_args['restApiNonce'] = wp_create_nonce( 'wp_rest' );
@@ -163,7 +161,7 @@ static function ( OD_URL_Metric_Group $group ): array {
163161
/**
164162
* Registers the REST API endpoint for storing URL Metrics.
165163
*
166-
* @since n.e.x.t
164+
* @since 1.0.0
167165
* @access private
168166
*/
169167
function od_register_rest_url_metric_store_endpoint(): void {
@@ -174,8 +172,6 @@ function od_register_rest_url_metric_store_endpoint(): void {
174172
$endpoint_controller::ROUTE_BASE,
175173
$endpoint_controller->get_registration_args()
176174
);
177-
178-
add_filter( 'rest_pre_dispatch', array( $endpoint_controller, 'decompress_rest_request_body' ), 10, 3 );
179175
}
180176

181177
/**
@@ -184,7 +180,7 @@ function od_register_rest_url_metric_store_endpoint(): void {
184180
* This is intended to flush any page cache for the URL after the new URL Metric was submitted so that the optimizations
185181
* which depend on that URL Metric can start to take effect.
186182
*
187-
* @since n.e.x.t
183+
* @since 1.0.0
188184
*
189185
* @param positive-int $cache_purge_post_id Cache purge post ID.
190186
*/

0 commit comments

Comments
 (0)