diff --git a/.github/workflows/php-test-plugins.yml b/.github/workflows/php-test-plugins.yml index 3594515140..97e862abfd 100644 --- a/.github/workflows/php-test-plugins.yml +++ b/.github/workflows/php-test-plugins.yml @@ -46,7 +46,7 @@ jobs: coverage: [false] include: - php: '7.4' - wp: '6.5' + wp: '6.6' - php: '8.3' wp: 'trunk' - php: '8.2' diff --git a/composer.lock b/composer.lock index e7b3b19568..f2daba96fe 100644 --- a/composer.lock +++ b/composer.lock @@ -658,16 +658,16 @@ }, { "name": "phpstan/php-8-stubs", - "version": "0.4.6", + "version": "0.4.9", "source": { "type": "git", "url": "https://github.com/phpstan/php-8-stubs.git", - "reference": "25ba0a11dc14a02c062392786486ada62d36b66d" + "reference": "1857c330fea6e795af1f7435ed02a18652e7dd8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/php-8-stubs/zipball/25ba0a11dc14a02c062392786486ada62d36b66d", - "reference": "25ba0a11dc14a02c062392786486ada62d36b66d", + "url": "https://api.github.com/repos/phpstan/php-8-stubs/zipball/1857c330fea6e795af1f7435ed02a18652e7dd8c", + "reference": "1857c330fea6e795af1f7435ed02a18652e7dd8c", "shasum": "" }, "type": "library", @@ -684,9 +684,9 @@ "description": "PHP stubs extracted from php-src", "support": { "issues": "https://github.com/phpstan/php-8-stubs/issues", - "source": "https://github.com/phpstan/php-8-stubs/tree/0.4.6" + "source": "https://github.com/phpstan/php-8-stubs/tree/0.4.9" }, - "time": "2024-11-13T00:19:28+00:00" + "time": "2024-12-02T00:21:59+00:00" }, { "name": "phpstan/phpdoc-parser", diff --git a/package-lock.json b/package-lock.json index 012c513631..8c2d919131 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,9 +12,9 @@ }, "devDependencies": { "@octokit/rest": "^21.0.2", - "@wordpress/env": "^10.12.0", - "@wordpress/prettier-config": "^4.12.0", - "@wordpress/scripts": "^30.5.1", + "@wordpress/env": "^10.13.0", + "@wordpress/prettier-config": "^4.13.0", + "@wordpress/scripts": "^30.6.0", "commander": "12.1.0", "copy-webpack-plugin": "^12.0.2", "css-minimizer-webpack-plugin": "^7.0.0", @@ -4713,10 +4713,11 @@ } }, "node_modules/@wordpress/env": { - "version": "10.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-10.12.0.tgz", - "integrity": "sha512-+tsdVfngQYcysxdVonXRSwuJjqoqTSv7wwrcThCYXR1OBCMQ/xT2Ywfvf9a/yItJs5uicO9Vx8B5aIuvXiGVqg==", + "version": "10.13.0", + "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-10.13.0.tgz", + "integrity": "sha512-Q7ay+/jZ+O/Pkc65LDJ5BzoqTT/B0+gDgvYnWMyySPiMpFz+iQ+XoQibrj3VneiQDH7nJjtk/ZuyPHu7wGdlBg==", "dev": true, + "license": "GPL-2.0-or-later", "dependencies": { "chalk": "^4.0.0", "copy-dir": "^1.3.0", @@ -4875,10 +4876,11 @@ } }, "node_modules/@wordpress/prettier-config": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-4.12.0.tgz", - "integrity": "sha512-BY742iKLyqAXO65yNnt4BXrU2h30xcePWXsnCwSIe7wVCZfRK6zsniqPFV/6gvl2RA9chjz9hYyN+/KzmcHEYw==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-4.13.0.tgz", + "integrity": "sha512-TgjsY0dU6fwtQs4Re73OlKZnxilaHbXmwb373qouDY/AzG72VkpQpQ2KcenCoJ7Do1BKdWWehzDo609nQhk/Yg==", "dev": true, + "license": "GPL-2.0-or-later", "engines": { "node": ">=18.12.0", "npm": ">=8.19.2" @@ -4888,10 +4890,11 @@ } }, "node_modules/@wordpress/scripts": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/@wordpress/scripts/-/scripts-30.5.1.tgz", - "integrity": "sha512-VM5NViNfdQR69MWxLnptB8svvnrEV+oUVgWL8icsLdCt2CENgPwUIk/Gs0wzeAVK05cGjrCESapJnEgIXp5lzA==", + "version": "30.6.0", + "resolved": "https://registry.npmjs.org/@wordpress/scripts/-/scripts-30.6.0.tgz", + "integrity": "sha512-2i6wqCdvCcf00/vLi7twNzHUdAAOo8Uk0lqntZiBKpVrjHyLkzjmPwT3So6W/VYso5QMzEXRXYVHVKGE4wX4rg==", "dev": true, + "license": "GPL-2.0-or-later", "dependencies": { "@babel/core": "7.25.7", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", diff --git a/package.json b/package.json index 78dac054d4..123184509d 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,9 @@ }, "devDependencies": { "@octokit/rest": "^21.0.2", - "@wordpress/env": "^10.12.0", - "@wordpress/prettier-config": "^4.12.0", - "@wordpress/scripts": "^30.5.1", + "@wordpress/env": "^10.13.0", + "@wordpress/prettier-config": "^4.13.0", + "@wordpress/scripts": "^30.6.0", "commander": "12.1.0", "copy-webpack-plugin": "^12.0.2", "css-minimizer-webpack-plugin": "^7.0.0", diff --git a/plugins/auto-sizes/auto-sizes.php b/plugins/auto-sizes/auto-sizes.php index 48dbe6a46d..abd90c6321 100644 --- a/plugins/auto-sizes/auto-sizes.php +++ b/plugins/auto-sizes/auto-sizes.php @@ -3,7 +3,7 @@ * Plugin Name: Enhanced Responsive Images * Plugin URI: https://github.com/WordPress/performance/tree/trunk/plugins/auto-sizes * Description: Improves responsive images with better sizes calculations and auto-sizes for lazy-loaded images. - * Requires at least: 6.5 + * Requires at least: 6.6 * Requires PHP: 7.2 * Version: 1.3.0 * Author: WordPress Performance Team diff --git a/plugins/dominant-color-images/load.php b/plugins/dominant-color-images/load.php index 6f36b559eb..e2e3c0c1bc 100644 --- a/plugins/dominant-color-images/load.php +++ b/plugins/dominant-color-images/load.php @@ -3,7 +3,7 @@ * Plugin Name: Image Placeholders * Plugin URI: https://github.com/WordPress/performance/tree/trunk/plugins/dominant-color-images * Description: Displays placeholders based on an image's dominant color while the image is loading. - * Requires at least: 6.5 + * Requires at least: 6.6 * Requires PHP: 7.2 * Version: 1.1.2 * Author: WordPress Performance Team diff --git a/plugins/embed-optimizer/load.php b/plugins/embed-optimizer/load.php index 7dc81d13d7..4510fb5dc9 100644 --- a/plugins/embed-optimizer/load.php +++ b/plugins/embed-optimizer/load.php @@ -3,7 +3,7 @@ * Plugin Name: Embed Optimizer * Plugin URI: https://github.com/WordPress/performance/tree/trunk/plugins/embed-optimizer * Description: Optimizes the performance of embeds through lazy-loading, preconnecting, and reserving space to reduce layout shifts. - * Requires at least: 6.5 + * Requires at least: 6.6 * Requires PHP: 7.2 * Version: 0.3.0 * Author: WordPress Performance Team diff --git a/plugins/image-prioritizer/load.php b/plugins/image-prioritizer/load.php index 8e4ca92334..8fa0be02be 100644 --- a/plugins/image-prioritizer/load.php +++ b/plugins/image-prioritizer/load.php @@ -3,7 +3,7 @@ * Plugin Name: Image Prioritizer * Plugin URI: https://github.com/WordPress/performance/tree/trunk/plugins/image-prioritizer * Description: Prioritizes the loading of images and videos based on how visible they are to actual visitors; adds fetchpriority and applies lazy-loading. - * Requires at least: 6.5 + * Requires at least: 6.6 * Requires PHP: 7.2 * Requires Plugins: optimization-detective * Version: 0.2.0 diff --git a/plugins/optimization-detective/detect.js b/plugins/optimization-detective/detect.js index 28ac97f2eb..0fafe3ff77 100644 --- a/plugins/optimization-detective/detect.js +++ b/plugins/optimization-detective/detect.js @@ -331,6 +331,16 @@ export default async function detect( { return; } + // Keep track of whether the window resized. If it resized, we abort sending the URLMetric. + let didWindowResize = false; + window.addEventListener( + 'resize', + () => { + didWindowResize = true; + }, + { once: true } + ); + // TODO: Does this make sense here? // Prevent detection when page is not scrolled to the initial viewport. if ( doc.documentElement.scrollTop > 0 ) { @@ -542,10 +552,7 @@ export default async function detect( { // Only proceed with submitting the URL Metric if viewport stayed the same size. Changing the viewport size (e.g. due // to resizing a window or changing the orientation of a device) will result in unexpected metrics being collected. - if ( - window.innerWidth !== urlMetric.viewport.width || - window.innerHeight !== urlMetric.viewport.height - ) { + if ( didWindowResize ) { if ( isDebug ) { log( 'Aborting URL Metric collection due to viewport size change.' diff --git a/plugins/optimization-detective/load.php b/plugins/optimization-detective/load.php index 9753d24ed6..7000e184e8 100644 --- a/plugins/optimization-detective/load.php +++ b/plugins/optimization-detective/load.php @@ -3,7 +3,7 @@ * Plugin Name: Optimization Detective * Plugin URI: https://github.com/WordPress/performance/tree/trunk/plugins/optimization-detective * Description: Provides an API for leveraging real user metrics to detect optimizations to apply on the frontend to improve page performance. - * Requires at least: 6.5 + * Requires at least: 6.6 * Requires PHP: 7.2 * Version: 0.9.0-alpha * Author: WordPress Performance Team diff --git a/plugins/performance-lab/load.php b/plugins/performance-lab/load.php index 6e66981789..3cc0674036 100644 --- a/plugins/performance-lab/load.php +++ b/plugins/performance-lab/load.php @@ -3,7 +3,7 @@ * Plugin Name: Performance Lab * Plugin URI: https://github.com/WordPress/performance * Description: Performance plugin from the WordPress Performance Team, which is a collection of standalone performance features. - * Requires at least: 6.5 + * Requires at least: 6.6 * Requires PHP: 7.2 * Version: 3.6.1 * Author: WordPress Performance Team diff --git a/plugins/speculation-rules/load.php b/plugins/speculation-rules/load.php index ad186c06b6..2417295f91 100644 --- a/plugins/speculation-rules/load.php +++ b/plugins/speculation-rules/load.php @@ -3,7 +3,7 @@ * Plugin Name: Speculative Loading * Plugin URI: https://github.com/WordPress/performance/tree/trunk/plugins/speculation-rules * Description: Enables browsers to speculatively prerender or prefetch pages to achieve near-instant loads based on user interaction. - * Requires at least: 6.5 + * Requires at least: 6.6 * Requires PHP: 7.2 * Version: 1.3.1 * Author: WordPress Performance Team diff --git a/plugins/web-worker-offloading/load.php b/plugins/web-worker-offloading/load.php index c26e98c36c..831e965dab 100644 --- a/plugins/web-worker-offloading/load.php +++ b/plugins/web-worker-offloading/load.php @@ -3,7 +3,7 @@ * Plugin Name: Web Worker Offloading * Plugin URI: https://github.com/WordPress/performance/issues/176 * Description: Offloads select JavaScript execution to a Web Worker to reduce work on the main thread and improve the Interaction to Next Paint (INP) metric. - * Requires at least: 6.5 + * Requires at least: 6.6 * Requires PHP: 7.2 * Version: 0.1.1 * Author: WordPress Performance Team diff --git a/plugins/webp-uploads/load.php b/plugins/webp-uploads/load.php index f21ff414b3..b474812a31 100644 --- a/plugins/webp-uploads/load.php +++ b/plugins/webp-uploads/load.php @@ -3,7 +3,7 @@ * Plugin Name: Modern Image Formats * Plugin URI: https://github.com/WordPress/performance/tree/trunk/plugins/webp-uploads * Description: Converts images to more modern formats such as WebP or AVIF during upload. - * Requires at least: 6.5 + * Requires at least: 6.6 * Requires PHP: 7.2 * Version: 2.3.0 * Author: WordPress Performance Team