Skip to content

Commit 09305c7

Browse files
committed
Merge branch 'trunk' into try/performance-panel-ext
2 parents 58b9fb4 + d0299a3 commit 09305c7

File tree

160 files changed

+14204
-3462
lines changed

Some content is hidden

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

160 files changed

+14204
-3462
lines changed

.github/CODEOWNERS

+1
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/js-lint.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,6 @@ jobs:
4747
- name: npm install
4848
run: npm ci
4949
- name: JS Lint
50-
run: npm run lint-js
50+
run: npm run lint-js
51+
- name: TypeScript compile
52+
run: npm run tsc

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

+36-4
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'
48-
wp: '6.5'
49+
wp: '6.6'
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@v5
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@v5
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

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ nbproject/
2424

2525
build
2626
.wp-env.override.json
27+
*.min.js
28+
*.min.css
2729
*.asset.php
2830

2931
############

.wp-env.json

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
"./plugins/webp-uploads"
1313
],
1414
"env": {
15+
"development": {
16+
"config": {
17+
"WP_DEVELOPMENT_MODE": "plugin"
18+
}
19+
},
1520
"tests": {
1621
"config": {
1722
"FS_METHOD": "direct"

README.md

+36-31
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ The feature plugins which are currently featured by this plugin are:
1111

1212
Plugin | Slug | Experimental | Links
1313
--------------------------------|---------------------------|--------------|-------------
14-
[Image Placeholders][1] | `dominant-color-images` | No | [Source][8], [Issues][15], [PRs][22]
15-
[Modern Image Formats][2] | `webp-uploads` | No | [Source][9], [Issues][16], [PRs][23]
16-
[Performant Translations][3] | `performant-translations` | No | [Source][10], [Issues][17], [PRs][24]
17-
[Speculative Loading][4] | `speculation-rules` | No | [Source][11], [Issues][18], [PRs][25]
18-
[Embed Optimizer][5] | `embed-optimizer` | Yes | [Source][12], [Issues][19], [PRs][26]
19-
[Enhanced Responsive Images][6] | `auto-sizes` | Yes | [Source][13], [Issues][20], [PRs][27]
20-
[Image Prioritizer][7] | `image-prioritizer` | Yes | [Source][14], [Issues][21], [PRs][28]
14+
[Image Placeholders][1] | `dominant-color-images` | No | [Source][9], [Issues][17], [PRs][25]
15+
[Modern Image Formats][2] | `webp-uploads` | No | [Source][10], [Issues][18], [PRs][26]
16+
[Performant Translations][3] | `performant-translations` | No | [Source][11], [Issues][19], [PRs][27]
17+
[Speculative Loading][4] | `speculation-rules` | No | [Source][12], [Issues][20], [PRs][28]
18+
[Embed Optimizer][5] | `embed-optimizer` | Yes | [Source][13], [Issues][21], [PRs][29]
19+
[Enhanced Responsive Images][6] | `auto-sizes` | Yes | [Source][14], [Issues][22], [PRs][30]
20+
[Image Prioritizer][7] | `image-prioritizer` | Yes | [Source][15], [Issues][23], [PRs][31]
21+
[Web Worker Offloading][8] | `web-worker-offloading` | Yes | [Source][16], [Issues][24], [PRs][32]
2122

2223
[1]: https://wordpress.org/plugins/dominant-color-images/
2324
[2]: https://wordpress.org/plugins/webp-uploads/
@@ -26,29 +27,33 @@ Plugin | Slug | Experimental | Lin
2627
[5]: https://wordpress.org/plugins/embed-optimizer/
2728
[6]: https://wordpress.org/plugins/auto-sizes/
2829
[7]: https://wordpress.org/plugins/image-prioritizer/
29-
30-
[8]: https://github.com/WordPress/performance/tree/trunk/plugins/dominant-color-images
31-
[9]: https://github.com/WordPress/performance/tree/trunk/plugins/webp-uploads
32-
[10]: https://github.com/swissspidy/performant-translations
33-
[11]: https://github.com/WordPress/performance/tree/trunk/plugins/speculation-rules
34-
[12]: https://github.com/WordPress/performance/tree/trunk/plugins/embed-optimizer
35-
[13]: https://github.com/WordPress/performance/tree/trunk/plugins/auto-sizes
36-
[14]: https://github.com/WordPress/performance/tree/trunk/plugins/image-prioritizer
37-
38-
[15]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Image+Placeholders%22
39-
[16]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Modern+Image+Formats%22
40-
[17]: https://github.com/swissspidy/performant-translations/issues
41-
[18]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Speculative+Loading%22
42-
[19]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Embed+Optimizer%22
43-
[20]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Enhanced+Responsive+Images%22
44-
[21]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Image+Prioritizer%22
45-
46-
[22]: https://github.com/WordPress/performance/pulls?q=is%3Aopen+label%3A%22%5BPlugin%5D+Image+Placeholders%22
47-
[23]: https://github.com/WordPress/performance/pulls?q=is%3Aopen+label%3A%22%5BPlugin%5D+Modern+Image+Formats%22
48-
[24]: https://github.com/swissspidy/performant-translations/pulls
49-
[25]: https://github.com/WordPress/performance/pulls?q=is%3Aopen+label%3A%22%5BPlugin%5D+Speculative+Loading%22
50-
[26]: https://github.com/WordPress/performance/pulls?q=is%3Aopen+label%3A%22%5BPlugin%5D+Embed+Optimizer%22
51-
[27]: https://github.com/WordPress/performance/pulls?q=is%3Aopen+label%3A%22%5BPlugin%5D+Enhanced+Responsive+Images%22
52-
[28]: https://github.com/WordPress/performance/pulls?q=is%3Aopen+label%3A%22%5BPlugin%5D+Image+Prioritizer%22
30+
[8]: https://wordpress.org/plugins/web-worker-offloading/
31+
32+
[9]: https://github.com/WordPress/performance/tree/trunk/plugins/dominant-color-images
33+
[10]: https://github.com/WordPress/performance/tree/trunk/plugins/webp-uploads
34+
[11]: https://github.com/swissspidy/performant-translations
35+
[12]: https://github.com/WordPress/performance/tree/trunk/plugins/speculation-rules
36+
[13]: https://github.com/WordPress/performance/tree/trunk/plugins/embed-optimizer
37+
[14]: https://github.com/WordPress/performance/tree/trunk/plugins/auto-sizes
38+
[15]: https://github.com/WordPress/performance/tree/trunk/plugins/image-prioritizer
39+
[16]: https://github.com/WordPress/performance/tree/trunk/plugins/web-worker-offloading
40+
41+
[17]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Image+Placeholders%22
42+
[18]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Modern+Image+Formats%22
43+
[19]: https://github.com/swissspidy/performant-translations/issues
44+
[20]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Speculative+Loading%22
45+
[21]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Embed+Optimizer%22
46+
[22]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Enhanced+Responsive+Images%22
47+
[23]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Image+Prioritizer%22
48+
[24]: https://github.com/WordPress/performance/issues?q=is%3Aopen%20label%3A%22%5BPlugin%5D%20Web%20Worker%20Offloading%22
49+
50+
[25]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Image+Placeholders%22
51+
[26]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Modern+Image+Formats%22
52+
[27]: https://github.com/swissspidy/performant-translations/pulls
53+
[28]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Speculative+Loading%22
54+
[29]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Embed+Optimizer%22
55+
[30]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Enhanced+Responsive+Images%22
56+
[31]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Image+Prioritizer%22
57+
[32]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Web%20Worker%20Offloading%22
5358

5459
Note that the plugin names sometimes diverge from the plugin slugs due to scope changes. For example, a plugin's purpose may change as some of its features are merged into WordPress core.

codecov.yml

+15
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

+1-1
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

+32-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lint-staged.config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ const joinFiles = ( files ) => {
2525
const PLUGIN_BASE_NAME = path.basename( __dirname );
2626

2727
module.exports = {
28-
'**/*.js': ( files ) => `npm run lint-js -- ${ joinFiles( files ) }`,
28+
'**/*.{js,ts}': ( files ) => {
29+
return [ `npm run lint-js -- ${ joinFiles( files ) }`, `npm run tsc` ];
30+
},
2931
'**/*.php': ( files ) => {
3032
const commands = [ 'composer phpstan' ];
3133

0 commit comments

Comments
 (0)