Skip to content

Commit

Permalink
Merge branch 'trunk' into try/performance-panel-ext
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Dec 19, 2024
2 parents 58b9fb4 + d0299a3 commit 09305c7
Show file tree
Hide file tree
Showing 160 changed files with 14,204 additions and 3,462 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# Performance Lab Plugin: Individual Site Health checks
/plugins/performance-lab/includes/site-health/avif-support @adamsilverstein
/plugins/performance-lab/includes/site-health/avif-headers @adamsilverstein
/plugins/performance-lab/includes/site-health/webp-support @adamsilverstein
/plugins/performance-lab/includes/site-health/audit-autoloaded-options @manuelRod @felixarntz @mukeshpanchal27
/plugins/performance-lab/includes/site-health/audit-enqueued-assets @manuelRod
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/js-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ jobs:
- name: npm install
run: npm ci
- name: JS Lint
run: npm run lint-js
run: npm run lint-js
- name: TypeScript compile
run: npm run tsc
40 changes: 36 additions & 4 deletions .github/workflows/php-test-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,17 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.2', '8.1', '8.0', '7.4', '7.3', '7.2']
php: ['8.1', '8.0', '7.4', '7.3', '7.2']
wp: [ 'latest' ]
coverage: [false]
include:
- php: '7.4'
wp: '6.5'
wp: '6.6'
- php: '8.3'
wp: 'trunk'
- php: '8.2'
wp: 'latest'
# coverage: true # TODO: Uncomment once coverage reports are fixed. See <https://github.com/WordPress/performance/pull/1586#issuecomment-2474498387>.
env:
WP_ENV_PHP_VERSION: ${{ matrix.php }}
WP_ENV_CORE: ${{ matrix.wp == 'trunk' && 'WordPress/WordPress' || format( 'https://wordpress.org/wordpress-{0}.zip', matrix.wp ) }}
Expand All @@ -68,6 +72,34 @@ jobs:
- name: Composer Install
run: npm run wp-env run tests-cli -- --env-cwd="wp-content/plugins/$(basename $(pwd))" composer install --no-interaction --no-progress
- name: Running single site unit tests
run: npm run test-php
run: |
if [ "${{ matrix.coverage }}" == "true" ]; then
npm run test-php -- --coverage-clover=coverage-${{ github.sha }}.xml
else
npm run test-php
fi
- name: Running multisite unit tests
run: npm run test-php-multisite
run: |
if [ "${{ matrix.coverage }}" == "true" ]; then
npm run test-php-multisite -- --coverage-clover=coverage-multisite-${{ github.sha }}.xml
else
npm run test-php-multisite
fi
- name: Upload single site coverage reports to Codecov
if: ${{ matrix.coverage == true }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage-${{ github.sha }}.xml
flags: single
name: ${{ matrix.php }}-single-site-coverage
fail_ci_if_error: true
- name: Upload multisite coverage reports to Codecov
if: ${{ matrix.coverage == true }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage-multisite-${{ github.sha }}.xml
flags: multisite
name: ${{ matrix.php }}-multisite-coverage
fail_ci_if_error: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ nbproject/

build
.wp-env.override.json
*.min.js
*.min.css
*.asset.php

############
Expand Down
5 changes: 5 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
"./plugins/webp-uploads"
],
"env": {
"development": {
"config": {
"WP_DEVELOPMENT_MODE": "plugin"
}
},
"tests": {
"config": {
"FS_METHOD": "direct"
Expand Down
67 changes: 36 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ The feature plugins which are currently featured by this plugin are:

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

[1]: https://wordpress.org/plugins/dominant-color-images/
[2]: https://wordpress.org/plugins/webp-uploads/
Expand All @@ -26,29 +27,33 @@ Plugin | Slug | Experimental | Lin
[5]: https://wordpress.org/plugins/embed-optimizer/
[6]: https://wordpress.org/plugins/auto-sizes/
[7]: https://wordpress.org/plugins/image-prioritizer/

[8]: https://github.com/WordPress/performance/tree/trunk/plugins/dominant-color-images
[9]: https://github.com/WordPress/performance/tree/trunk/plugins/webp-uploads
[10]: https://github.com/swissspidy/performant-translations
[11]: https://github.com/WordPress/performance/tree/trunk/plugins/speculation-rules
[12]: https://github.com/WordPress/performance/tree/trunk/plugins/embed-optimizer
[13]: https://github.com/WordPress/performance/tree/trunk/plugins/auto-sizes
[14]: https://github.com/WordPress/performance/tree/trunk/plugins/image-prioritizer

[15]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Image+Placeholders%22
[16]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Modern+Image+Formats%22
[17]: https://github.com/swissspidy/performant-translations/issues
[18]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Speculative+Loading%22
[19]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Embed+Optimizer%22
[20]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Enhanced+Responsive+Images%22
[21]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Image+Prioritizer%22

[22]: https://github.com/WordPress/performance/pulls?q=is%3Aopen+label%3A%22%5BPlugin%5D+Image+Placeholders%22
[23]: https://github.com/WordPress/performance/pulls?q=is%3Aopen+label%3A%22%5BPlugin%5D+Modern+Image+Formats%22
[24]: https://github.com/swissspidy/performant-translations/pulls
[25]: https://github.com/WordPress/performance/pulls?q=is%3Aopen+label%3A%22%5BPlugin%5D+Speculative+Loading%22
[26]: https://github.com/WordPress/performance/pulls?q=is%3Aopen+label%3A%22%5BPlugin%5D+Embed+Optimizer%22
[27]: https://github.com/WordPress/performance/pulls?q=is%3Aopen+label%3A%22%5BPlugin%5D+Enhanced+Responsive+Images%22
[28]: https://github.com/WordPress/performance/pulls?q=is%3Aopen+label%3A%22%5BPlugin%5D+Image+Prioritizer%22
[8]: https://wordpress.org/plugins/web-worker-offloading/

[9]: https://github.com/WordPress/performance/tree/trunk/plugins/dominant-color-images
[10]: https://github.com/WordPress/performance/tree/trunk/plugins/webp-uploads
[11]: https://github.com/swissspidy/performant-translations
[12]: https://github.com/WordPress/performance/tree/trunk/plugins/speculation-rules
[13]: https://github.com/WordPress/performance/tree/trunk/plugins/embed-optimizer
[14]: https://github.com/WordPress/performance/tree/trunk/plugins/auto-sizes
[15]: https://github.com/WordPress/performance/tree/trunk/plugins/image-prioritizer
[16]: https://github.com/WordPress/performance/tree/trunk/plugins/web-worker-offloading

[17]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Image+Placeholders%22
[18]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Modern+Image+Formats%22
[19]: https://github.com/swissspidy/performant-translations/issues
[20]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Speculative+Loading%22
[21]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Embed+Optimizer%22
[22]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Enhanced+Responsive+Images%22
[23]: https://github.com/WordPress/performance/issues?q=is%3Aopen+label%3A%22%5BPlugin%5D+Image+Prioritizer%22
[24]: https://github.com/WordPress/performance/issues?q=is%3Aopen%20label%3A%22%5BPlugin%5D%20Web%20Worker%20Offloading%22

[25]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Image+Placeholders%22
[26]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Modern+Image+Formats%22
[27]: https://github.com/swissspidy/performant-translations/pulls
[28]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Speculative+Loading%22
[29]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Embed+Optimizer%22
[30]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Enhanced+Responsive+Images%22
[31]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Image+Prioritizer%22
[32]: https://github.com/WordPress/performance/pulls?q=is%3Apr+is%3Aopen+label%3A%22%5BPlugin%5D+Web%20Worker%20Offloading%22

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.
15 changes: 15 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
codecov:
notify:
require_ci_to_pass: yes
coverage:
status:
project:
default:
target: auto
threshold: 80%
base: auto
informational: true
patch:
default:
threshold: 80%
informational: true
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"lint:web-worker-offloading": "@lint -- ./plugins/web-worker-offloading --standard=./plugins/web-worker-offloading/phpcs.xml.dist",
"lint:webp-uploads": "@lint -- ./plugins/webp-uploads --standard=./plugins/webp-uploads/phpcs.xml.dist",
"phpstan": "phpstan analyse --memory-limit=2048M",
"test": "phpunit",
"test": "phpunit --strict-coverage",
"test-multisite": [
"WP_MULTISITE=1 phpunit --exclude-group=ms-excluded"
],
Expand Down
63 changes: 32 additions & 31 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ const joinFiles = ( files ) => {
const PLUGIN_BASE_NAME = path.basename( __dirname );

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

Expand Down
Loading

0 comments on commit 09305c7

Please sign in to comment.