Skip to content

Commit

Permalink
Merge pull request #1663 from WordPress/trunk
Browse files Browse the repository at this point in the history
Merge latest changes to feature branch
  • Loading branch information
felixarntz authored Nov 18, 2024
2 parents 614b1a5 + 04a2e5a commit 9e276f1
Show file tree
Hide file tree
Showing 60 changed files with 1,683 additions and 551 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
38 changes: 35 additions & 3 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'
- 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@v4
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@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage-multisite-${{ github.sha }}.xml
flags: multisite
name: ${{ matrix.php }}-multisite-coverage
fail_ci_if_error: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ nbproject/

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

############
Expand Down
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
12 changes: 6 additions & 6 deletions composer.lock

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

110 changes: 51 additions & 59 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
},
"dependencies": {
"@builder.io/partytown": "github:westonruter/partytown#add/wp-i18n-workaround",
"web-vitals": "4.2.3"
"web-vitals": "4.2.4"
},
"devDependencies": {
"@octokit/rest": "^21.0.2",
"@wordpress/env": "^10.10.0",
"@wordpress/prettier-config": "^4.9.0",
"@wordpress/scripts": "^30.3.0",
"@wordpress/env": "^10.11.0",
"@wordpress/prettier-config": "^4.11.0",
"@wordpress/scripts": "^30.4.0",
"commander": "12.1.0",
"copy-webpack-plugin": "^12.0.2",
"fast-glob": "^3.3.2",
Expand All @@ -25,7 +25,7 @@
"micromatch": "^4.0.8",
"npm-run-all": "^4.1.5",
"typescript": "^5.6.3",
"webpackbar": "^6.0.1"
"webpackbar": "^7.0.0"
},
"scripts": {
"changelog": "./bin/plugin/cli.js changelog",
Expand Down
6 changes: 3 additions & 3 deletions plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private function is_embed_figure( OD_HTML_Tag_Processor $processor ): bool {
* @since 0.3.0
*
* @param OD_HTML_Tag_Processor $processor Processor.
* @return bool Whether the tag should be measured and stored in URL metrics.
* @return bool Whether the tag should be measured and stored in URL Metrics.
*/
private function is_embed_wrapper( OD_HTML_Tag_Processor $processor ): bool {
return (
Expand Down Expand Up @@ -83,7 +83,7 @@ private function is_embed_wrapper( OD_HTML_Tag_Processor $processor ): bool {
* @since 0.2.0
*
* @param OD_Tag_Visitor_Context $context Tag visitor context.
* @return bool Whether the tag should be tracked in URL metrics.
* @return bool Whether the tag should be tracked in URL Metrics.
*/
public function __invoke( OD_Tag_Visitor_Context $context ): bool {
$processor = $context->processor;
Expand All @@ -103,7 +103,7 @@ public function __invoke( OD_Tag_Visitor_Context $context ): bool {

$this->reduce_layout_shifts( $context );

// Preconnect links and lazy-loading can only be done once there are URL metrics collected for both mobile and desktop.
// Preconnect links and lazy-loading can only be done once there are URL Metrics collected for both mobile and desktop.
if (
$context->url_metric_group_collection->get_first_group()->count() > 0
&&
Expand Down
4 changes: 2 additions & 2 deletions plugins/embed-optimizer/detect.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Embed Optimizer module for Optimization Detective
*
* When a URL metric is being collected by Optimization Detective, this module adds a ResizeObserver to keep track of
* the changed heights for embed blocks. This data is extended/amended onto the element data of the pending URL metric
* When a URL Metric is being collected by Optimization Detective, this module adds a ResizeObserver to keep track of
* the changed heights for embed blocks. This data is extended/amended onto the element data of the pending URL Metric
* when it is submitted for storage.
*/

Expand Down
Loading

0 comments on commit 9e276f1

Please sign in to comment.