Skip to content

Commit f544101

Browse files
authored
Merge branch 'trunk' into fix/wrong-image-size-picture-element
2 parents 2118cf0 + 1a7f906 commit f544101

File tree

14 files changed

+1735
-21
lines changed

14 files changed

+1735
-21
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"devDependencies": {
1414
"@octokit/rest": "^21.1.1",
15-
"@wordpress/env": "^10.18.0",
15+
"@wordpress/env": "^10.19.0",
1616
"@wordpress/prettier-config": "^4.19.0",
1717
"@wordpress/scripts": "^30.12.0",
1818
"commander": "13.1.0",

plugins/embed-optimizer/hooks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function embed_optimizer_update_markup( WP_HTML_Tag_Processor $html_processor, b
190190

191191
// As of 1.0.0-beta3, next_tag() allows $query and is beginning to migrate to skip tag closers by default.
192192
// In versions prior to this, the method always visited closers and passing a $query actually threw an exception.
193-
$tag_query = version_compare( OPTIMIZATION_DETECTIVE_VERSION, '1.0.0-beta3', '>=' )
193+
$tag_query = ! defined( 'OPTIMIZATION_DETECTIVE_VERSION' ) || version_compare( OPTIMIZATION_DETECTIVE_VERSION, '1.0.0-beta3', '>=' )
194194
? array( 'tag_closers' => 'visit' ) : null;
195195
try {
196196
/*
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<html lang="en">
2+
<head>
3+
<meta charset="utf-8">
4+
<title>...</title>
5+
</head>
6+
<body>
7+
<div class="wp-site-blocks">
8+
<header></header>
9+
<main>
10+
<div></div>
11+
<div>
12+
<ul>
13+
<li>
14+
<div>
15+
<figure>
16+
<a href="https://example.net/foo/">
17+
<img src="https://example.net/wp-content/uploads/foo.jpg" width="1600" height="1000" alt="Foo">
18+
</a>
19+
</figure>
20+
</div>
21+
</li>
22+
<li>
23+
<div>
24+
<figure>
25+
<a href="https://example.net/bar/">
26+
<img src="https://example.net/wp-content/uploads/bar.jpg" width="1600" height="1000" alt="Bar">
27+
</a>
28+
</figure>
29+
</div>
30+
</li>
31+
</ul>
32+
</div>
33+
</main>
34+
</div>
35+
</body>
36+
</html>

plugins/image-prioritizer/tests/test-cases/preload-links-with-one-half-stale-group/expected.html

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
return static function ( Test_Image_Prioritizer_Helper $test_case ): void {
3+
// Make sure we're using the same expected current ETag.
4+
// Note: The args don't matter because od_current_url_metrics_etag_data is filtered to be an empty array in Test_Image_Prioritizer_Helper::set_up().
5+
$current_etag = od_get_current_url_metrics_etag( new OD_Tag_Visitor_Registry(), null, null );
6+
7+
$url_metrics_data = json_decode( file_get_contents( __DIR__ . '/url-metrics.json' ), true );
8+
$collection = new OD_URL_Metric_Group_Collection(
9+
array_map(
10+
static function ( array $url_metric_data ) use ( $current_etag ): OD_URL_Metric {
11+
if ( 'f8527651f96776745f88cc49df70b62d' === $url_metric_data['etag'] ) {
12+
$url_metric_data['etag'] = $current_etag;
13+
}
14+
return new OD_URL_Metric( $url_metric_data );
15+
},
16+
$url_metrics_data
17+
),
18+
$current_etag,
19+
array( 480, 600, 782 ),
20+
3,
21+
WEEK_IN_SECONDS
22+
);
23+
24+
$test_case->assertFalse( $collection->is_every_group_complete() );
25+
$test_case->assertTrue( $collection->is_every_group_populated() );
26+
$test_case->assertTrue( $collection->is_any_group_populated() );
27+
$test_case->assertInstanceOf( OD_Element::class, $collection->get_common_lcp_element() );
28+
29+
$slug = od_get_url_metrics_slug( array() );
30+
$post_id = OD_URL_Metrics_Post_Type::update_post( $slug, $collection );
31+
$test_case->assertIsInt( $post_id );
32+
};

0 commit comments

Comments
 (0)