Skip to content

Commit b40f7d9

Browse files
Merge pull request #1909 from WordPress/trunk
Merge latest changes to feature branch
2 parents 3671902 + 1a7f906 commit b40f7d9

File tree

465 files changed

+16817
-6761
lines changed

Some content is hidden

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

465 files changed

+16817
-6761
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22

33
# Improve highlighting for PHPStan stub files.
44
*.stub linguist-language=PHP
5+
6+
# Hide diffs for Optimization Detective snapshots.
7+
plugins/*/tests/test-cases/*/expected.html linguist-generated=true

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ on:
1313
- '**/package.json'
1414
- 'package-lock.json'
1515
- 'phpunit.xml.dist'
16-
- 'tests/multisite.xml'
1716
- 'composer.json'
1817
- 'composer.lock'
1918
pull_request:
@@ -25,7 +24,6 @@ on:
2524
- '**/package.json'
2625
- 'package-lock.json'
2726
- 'phpunit.xml.dist'
28-
- 'tests/multisite.xml'
2927
- 'composer.json'
3028
- 'composer.lock'
3129
types:
@@ -52,7 +50,7 @@ jobs:
5250
- php: '8.2'
5351
phpunit: '9.6'
5452
wp: 'latest'
55-
coverage: true
53+
coverage: ${{ !startsWith(github.actor, 'dependabot') }}
5654
env:
5755
WP_ENV_PHP_VERSION: ${{ matrix.php }}
5856
WP_ENV_CORE: ${{ matrix.wp == 'trunk' && 'WordPress/WordPress' || format( 'https://wordpress.org/wordpress-{0}.zip', matrix.wp ) }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
############
2+
## Generated files during testing
3+
############
4+
5+
plugins/*/tests/**/actual.html
6+
17
############
28
## IDEs
39
############

README.md

Lines changed: 7 additions & 2 deletions
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+
[Embed Optimizer][5] | `embed-optimizer` | No | [Source][13], [Issues][21], [PRs][29]
1415
[Image Placeholders][1] | `dominant-color-images` | No | [Source][9], [Issues][17], [PRs][25]
16+
[Image Prioritizer][7] | `image-prioritizer` | No | [Source][15], [Issues][23], [PRs][31]
1517
[Modern Image Formats][2] | `webp-uploads` | No | [Source][10], [Issues][18], [PRs][26]
18+
[Optimization Detective][33] | `optimization-detective` | No | [Source][34], [Issues][35], [PRs][36]
1619
[Performant Translations][3] | `performant-translations` | No | [Source][11], [Issues][19], [PRs][27]
1720
[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]
1921
[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]
2122
[Web Worker Offloading][8] | `web-worker-offloading` | Yes | [Source][16], [Issues][24], [PRs][32]
2223

2324
[1]: https://wordpress.org/plugins/dominant-color-images/
@@ -28,6 +29,7 @@ Plugin | Slug | Experimental | Lin
2829
[6]: https://wordpress.org/plugins/auto-sizes/
2930
[7]: https://wordpress.org/plugins/image-prioritizer/
3031
[8]: https://wordpress.org/plugins/web-worker-offloading/
32+
[33]: https://wordpress.org/plugins/optimization-detective/
3133

3234
[9]: https://github.com/WordPress/performance/tree/trunk/plugins/dominant-color-images
3335
[10]: https://github.com/WordPress/performance/tree/trunk/plugins/webp-uploads
@@ -37,6 +39,7 @@ Plugin | Slug | Experimental | Lin
3739
[14]: https://github.com/WordPress/performance/tree/trunk/plugins/auto-sizes
3840
[15]: https://github.com/WordPress/performance/tree/trunk/plugins/image-prioritizer
3941
[16]: https://github.com/WordPress/performance/tree/trunk/plugins/web-worker-offloading
42+
[34]: https://github.com/WordPress/performance/tree/trunk/plugins/optimization-detective
4043

4144
[17]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Image+Placeholders%22
4245
[18]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Modern+Image+Formats%22
@@ -46,6 +49,7 @@ Plugin | Slug | Experimental | Lin
4649
[22]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Enhanced+Responsive+Images%22
4750
[23]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Image+Prioritizer%22
4851
[24]: https://github.com/WordPress/performance/issues?q=is%3Aopen%20label%3A%22%5BPlugin%5D%20Web%20Worker%20Offloading%22
52+
[35]: https://github.com/WordPress/performance/issues?q=is%3Aopen%20label%3A%22%5BPlugin%5D%20Optimization%20Detective%22
4953

5054
[25]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Image+Placeholders%22
5155
[26]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Modern+Image+Formats%22
@@ -55,5 +59,6 @@ Plugin | Slug | Experimental | Lin
5559
[30]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Enhanced+Responsive+Images%22
5660
[31]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Image+Prioritizer%22
5761
[32]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Web%20Worker%20Offloading%22
62+
[36]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Optimization%20Detective%22
5863

5964
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.

bin/plugin/commands/readme.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function updateReadmeChangelog( readmeFile, changelog ) {
5454
const fileContent = fs.readFileSync( readmeFile, 'utf-8' );
5555

5656
const stableTagVersionMatches = fileContent.match(
57-
/^Stable tag:\s*(\d+\.\d+\.\d+)$/m
57+
/^Stable tag:\s*(\d+\.\d+\.\d+(?:-[\w\.]+)?)$/m
5858
);
5959
if ( ! stableTagVersionMatches ) {
6060
throw new Error( `Unable to locate stable tag in ${ readmeFile }` );
@@ -112,7 +112,7 @@ function getStableTag( readmeFilePath ) {
112112
const readmeContents = fs.readFileSync( readmeFilePath, 'utf-8' );
113113

114114
const stableTagVersionMatches = readmeContents.match(
115-
/^Stable tag:\s*(\d+\.\d+\.\d+)$/m
115+
/^Stable tag:\s*(\d+\.\d+\.\d+(?:-[\w\.]+)?)$/m
116116
);
117117
if ( ! stableTagVersionMatches ) {
118118
throw new Error( `Unable to locate stable tag in ${ readmeFilePath }` );

bin/plugin/commands/since.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ exports.handler = async ( opt ) => {
6161
const readmeFile = path.resolve( pluginDirectory, 'readme.txt' );
6262
const readmeContent = fs.readFileSync( readmeFile, 'utf-8' );
6363
const readmeContentMatches = readmeContent.match(
64-
/^Stable tag:\s+(\d+\.\d+\.\d+)$/m
64+
/^Stable tag:\s+(\d+\.\d+\.\d+(?:-[\w\.]+)?)$/m
6565
);
6666
if ( ! readmeContentMatches ) {
6767
throw new Error(

bin/plugin/commands/versions.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ async function checkPluginDirectory( pluginDirectory ) {
3838
const readmeContents = fs.readFileSync( readmeFilePath, 'utf-8' );
3939

4040
const stableTagVersionMatches = readmeContents.match(
41-
/^Stable tag:\s*(\d+\.\d+\.\d+(?:-\w+)?)$/m
41+
/^Stable tag:\s*(\d+\.\d+\.\d+(?:-[\w\.]+)?)$/m
4242
);
4343
if ( ! stableTagVersionMatches ) {
4444
throw new Error( `Unable to locate stable tag in ${ readmeFilePath }` );
4545
}
4646
const stableTagVersion = stableTagVersionMatches[ 1 ];
4747

4848
const latestChangelogMatches = readmeContents.match(
49-
/^== Changelog ==\n+= (\d+\.\d+\.\d+(?:-\w+)?) =$/m
49+
/^== Changelog ==\n+= (\d+\.\d+\.\d+(?:-[\w\.]+)?) =$/m
5050
);
5151
if ( ! latestChangelogMatches ) {
5252
throw new Error(
53-
'Unable to latest version entry in readme changelog.'
53+
'Unable to locate latest version entry in readme changelog.'
5454
);
5555
}
5656
const latestChangelogVersion = latestChangelogMatches[ 1 ];
@@ -71,7 +71,7 @@ async function checkPluginDirectory( pluginDirectory ) {
7171
}
7272

7373
const headerVersionMatches = phpBootstrapFileContents.match(
74-
/^ \* Version:\s+(\d+\.\d+\.\d+(?:-\w+)?)$/m
74+
/^ \* Version:\s+(\d+\.\d+\.\d+(?:-[\w\.]+)?)$/m
7575
);
7676
if ( ! headerVersionMatches ) {
7777
throw new Error(
@@ -81,7 +81,7 @@ async function checkPluginDirectory( pluginDirectory ) {
8181
const headerVersion = headerVersionMatches[ 1 ];
8282

8383
const phpLiteralVersionMatches = phpBootstrapFileContents.match(
84-
/'(\d+\.\d+\.\d+(?:-\w+)?)'/
84+
/'(\d+\.\d+\.\d+(?:-[\w\.]+)?)'/
8585
);
8686
if ( ! phpLiteralVersionMatches ) {
8787
throw new Error( 'Unable to locate the PHP literal version.' );

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"szepeviktor/phpstan-wordpress": "^1.3",
3131
"wp-coding-standards/wpcs": "^3.1",
3232
"wp-phpunit/wp-phpunit": "^6.5",
33-
"yoast/phpunit-polyfills": "^2.0",
33+
"yoast/phpunit-polyfills": "^4.0",
3434
"phpstan/php-8-stubs": "^0.4.0",
3535
"phpstan/phpstan-strict-rules": "^1.6"
3636
},

composer.lock

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

0 commit comments

Comments
 (0)