Skip to content

Commit 69ac2e1

Browse files
Merge branch 'feature/1511-incorporate-layout-constraints-from-ancestors' into update/use-filter-approach
2 parents de20e12 + 9e276f1 commit 69ac2e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1683
-551
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
# Performance Lab Plugin: Individual Site Health checks
99
/plugins/performance-lab/includes/site-health/avif-support @adamsilverstein
10+
/plugins/performance-lab/includes/site-health/avif-headers @adamsilverstein
1011
/plugins/performance-lab/includes/site-health/webp-support @adamsilverstein
1112
/plugins/performance-lab/includes/site-health/audit-autoloaded-options @manuelRod @felixarntz @mukeshpanchal27
1213
/plugins/performance-lab/includes/site-health/audit-enqueued-assets @manuelRod

.github/workflows/php-test-plugins.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,17 @@ jobs:
4141
strategy:
4242
fail-fast: false
4343
matrix:
44-
php: ['8.2', '8.1', '8.0', '7.4', '7.3', '7.2']
44+
php: ['8.1', '8.0', '7.4', '7.3', '7.2']
4545
wp: [ 'latest' ]
46+
coverage: [false]
4647
include:
4748
- php: '7.4'
4849
wp: '6.5'
4950
- php: '8.3'
5051
wp: 'trunk'
52+
- php: '8.2'
53+
wp: 'latest'
54+
# coverage: true # TODO: Uncomment once coverage reports are fixed. See <https://github.com/WordPress/performance/pull/1586#issuecomment-2474498387>.
5155
env:
5256
WP_ENV_PHP_VERSION: ${{ matrix.php }}
5357
WP_ENV_CORE: ${{ matrix.wp == 'trunk' && 'WordPress/WordPress' || format( 'https://wordpress.org/wordpress-{0}.zip', matrix.wp ) }}
@@ -68,6 +72,34 @@ jobs:
6872
- name: Composer Install
6973
run: npm run wp-env run tests-cli -- --env-cwd="wp-content/plugins/$(basename $(pwd))" composer install --no-interaction --no-progress
7074
- name: Running single site unit tests
71-
run: npm run test-php
75+
run: |
76+
if [ "${{ matrix.coverage }}" == "true" ]; then
77+
npm run test-php -- --coverage-clover=coverage-${{ github.sha }}.xml
78+
else
79+
npm run test-php
80+
fi
7281
- name: Running multisite unit tests
73-
run: npm run test-php-multisite
82+
run: |
83+
if [ "${{ matrix.coverage }}" == "true" ]; then
84+
npm run test-php-multisite -- --coverage-clover=coverage-multisite-${{ github.sha }}.xml
85+
else
86+
npm run test-php-multisite
87+
fi
88+
- name: Upload single site coverage reports to Codecov
89+
if: ${{ matrix.coverage == true }}
90+
uses: codecov/codecov-action@v4
91+
with:
92+
token: ${{ secrets.CODECOV_TOKEN }}
93+
files: coverage-${{ github.sha }}.xml
94+
flags: single
95+
name: ${{ matrix.php }}-single-site-coverage
96+
fail_ci_if_error: true
97+
- name: Upload multisite coverage reports to Codecov
98+
if: ${{ matrix.coverage == true }}
99+
uses: codecov/codecov-action@v4
100+
with:
101+
token: ${{ secrets.CODECOV_TOKEN }}
102+
files: coverage-multisite-${{ github.sha }}.xml
103+
flags: multisite
104+
name: ${{ matrix.php }}-multisite-coverage
105+
fail_ci_if_error: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ nbproject/
2424

2525
build
2626
.wp-env.override.json
27+
*.min.js
2728
*.asset.php
2829

2930
############

codecov.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
codecov:
2+
notify:
3+
require_ci_to_pass: yes
4+
coverage:
5+
status:
6+
project:
7+
default:
8+
target: auto
9+
threshold: 80%
10+
base: auto
11+
informational: true
12+
patch:
13+
default:
14+
threshold: 80%
15+
informational: true

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"lint:web-worker-offloading": "@lint -- ./plugins/web-worker-offloading --standard=./plugins/web-worker-offloading/phpcs.xml.dist",
9090
"lint:webp-uploads": "@lint -- ./plugins/webp-uploads --standard=./plugins/webp-uploads/phpcs.xml.dist",
9191
"phpstan": "phpstan analyse --memory-limit=2048M",
92-
"test": "phpunit",
92+
"test": "phpunit --strict-coverage",
9393
"test-multisite": [
9494
"WP_MULTISITE=1 phpunit --exclude-group=ms-excluded"
9595
],

composer.lock

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

package-lock.json

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

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
},
99
"dependencies": {
1010
"@builder.io/partytown": "github:westonruter/partytown#add/wp-i18n-workaround",
11-
"web-vitals": "4.2.3"
11+
"web-vitals": "4.2.4"
1212
},
1313
"devDependencies": {
1414
"@octokit/rest": "^21.0.2",
15-
"@wordpress/env": "^10.10.0",
16-
"@wordpress/prettier-config": "^4.9.0",
17-
"@wordpress/scripts": "^30.3.0",
15+
"@wordpress/env": "^10.11.0",
16+
"@wordpress/prettier-config": "^4.11.0",
17+
"@wordpress/scripts": "^30.4.0",
1818
"commander": "12.1.0",
1919
"copy-webpack-plugin": "^12.0.2",
2020
"fast-glob": "^3.3.2",
@@ -25,7 +25,7 @@
2525
"micromatch": "^4.0.8",
2626
"npm-run-all": "^4.1.5",
2727
"typescript": "^5.6.3",
28-
"webpackbar": "^6.0.1"
28+
"webpackbar": "^7.0.0"
2929
},
3030
"scripts": {
3131
"changelog": "./bin/plugin/cli.js changelog",

plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private function is_embed_figure( OD_HTML_Tag_Processor $processor ): bool {
5050
* @since 0.3.0
5151
*
5252
* @param OD_HTML_Tag_Processor $processor Processor.
53-
* @return bool Whether the tag should be measured and stored in URL metrics.
53+
* @return bool Whether the tag should be measured and stored in URL Metrics.
5454
*/
5555
private function is_embed_wrapper( OD_HTML_Tag_Processor $processor ): bool {
5656
return (
@@ -83,7 +83,7 @@ private function is_embed_wrapper( OD_HTML_Tag_Processor $processor ): bool {
8383
* @since 0.2.0
8484
*
8585
* @param OD_Tag_Visitor_Context $context Tag visitor context.
86-
* @return bool Whether the tag should be tracked in URL metrics.
86+
* @return bool Whether the tag should be tracked in URL Metrics.
8787
*/
8888
public function __invoke( OD_Tag_Visitor_Context $context ): bool {
8989
$processor = $context->processor;
@@ -103,7 +103,7 @@ public function __invoke( OD_Tag_Visitor_Context $context ): bool {
103103

104104
$this->reduce_layout_shifts( $context );
105105

106-
// Preconnect links and lazy-loading can only be done once there are URL metrics collected for both mobile and desktop.
106+
// Preconnect links and lazy-loading can only be done once there are URL Metrics collected for both mobile and desktop.
107107
if (
108108
$context->url_metric_group_collection->get_first_group()->count() > 0
109109
&&

plugins/embed-optimizer/detect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* Embed Optimizer module for Optimization Detective
33
*
4-
* When a URL metric is being collected by Optimization Detective, this module adds a ResizeObserver to keep track of
5-
* the changed heights for embed blocks. This data is extended/amended onto the element data of the pending URL metric
4+
* When a URL Metric is being collected by Optimization Detective, this module adds a ResizeObserver to keep track of
5+
* the changed heights for embed blocks. This data is extended/amended onto the element data of the pending URL Metric
66
* when it is submitted for storage.
77
*/
88

0 commit comments

Comments
 (0)