diff --git a/plugins/auto-sizes/auto-sizes.php b/plugins/auto-sizes/auto-sizes.php index 62e557bef..dc549e485 100644 --- a/plugins/auto-sizes/auto-sizes.php +++ b/plugins/auto-sizes/auto-sizes.php @@ -5,7 +5,7 @@ * Description: Improves responsive images with better sizes calculations and auto-sizes for lazy-loaded images. * Requires at least: 6.6 * Requires PHP: 7.2 - * Version: 1.3.0 + * Version: 1.4.0 * Author: WordPress Performance Team * Author URI: https://make.wordpress.org/performance/ * License: GPLv2 or later @@ -25,7 +25,7 @@ return; } -define( 'IMAGE_AUTO_SIZES_VERSION', '1.3.0' ); +define( 'IMAGE_AUTO_SIZES_VERSION', '1.4.0' ); require_once __DIR__ . '/includes/auto-sizes.php'; require_once __DIR__ . '/includes/improve-calculate-sizes.php'; diff --git a/plugins/auto-sizes/includes/auto-sizes.php b/plugins/auto-sizes/includes/auto-sizes.php index 44df012d4..02ecad68b 100644 --- a/plugins/auto-sizes/includes/auto-sizes.php +++ b/plugins/auto-sizes/includes/auto-sizes.php @@ -3,7 +3,7 @@ * Functionality to implement auto-sizes for lazy loaded images. * * @package auto-sizes - * @since n.e.x.t + * @since 1.4.0 */ /** diff --git a/plugins/auto-sizes/includes/improve-calculate-sizes.php b/plugins/auto-sizes/includes/improve-calculate-sizes.php index db1573c43..7b57f08e3 100644 --- a/plugins/auto-sizes/includes/improve-calculate-sizes.php +++ b/plugins/auto-sizes/includes/improve-calculate-sizes.php @@ -3,13 +3,13 @@ * Functionality to improve the calculation of image `sizes` attributes. * * @package auto-sizes - * @since n.e.x.t + * @since 1.4.0 */ /** * Primes attachment into the cache with a single database query. * - * @since n.e.x.t + * @since 1.4.0 * * @param string|mixed $content The HTML content. * @return string The HTML content. @@ -130,7 +130,7 @@ function auto_sizes_filter_image_tag( $content, array $parsed_block, WP_Block $b /** * Modifies the sizes attribute of an image based on layout context. * - * @since n.e.x.t + * @since 1.4.0 * * @param int $id The image attachment post ID. * @param string|array{int, int} $size Image size name or array of width and height. @@ -228,7 +228,7 @@ function auto_sizes_calculate_better_sizes( int $id, $size, string $align, int $ /** * Retrieves the layout width for an alignment defined in theme.json. * - * @since n.e.x.t + * @since 1.4.0 * * @param string $alignment The alignment value. * @return string The alignment width based. @@ -248,7 +248,7 @@ function auto_sizes_get_layout_width( string $alignment ): string { /** * Filters the context keys that a block type uses. * - * @since n.e.x.t + * @since 1.4.0 * * @param string[] $uses_context Array of registered uses context for a block type. * @param WP_Block_Type $block_type The full block type object. @@ -271,7 +271,7 @@ function auto_sizes_filter_uses_context( array $uses_context, WP_Block_Type $blo /** * Modifies the block context during rendering to blocks. * - * @since n.e.x.t + * @since 1.4.0 * * @param array $context Current block context. * @param array $block The block being rendered. diff --git a/plugins/auto-sizes/readme.txt b/plugins/auto-sizes/readme.txt index b5cca6307..73a53923f 100644 --- a/plugins/auto-sizes/readme.txt +++ b/plugins/auto-sizes/readme.txt @@ -2,7 +2,7 @@ Contributors: wordpressdotorg Tested up to: 6.7 -Stable tag: 1.3.0 +Stable tag: 1.4.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: performance, images, auto-sizes @@ -52,6 +52,23 @@ Contributions are always welcome! Learn more about how to get involved in the [C == Changelog == += 1.4.0 = + +**Features** + +* Accurate Sizes: Incorporate layout constraints in image sizes calculations. ([1738](https://github.com/WordPress/performance/pull/1738)) + +**Enhancements** + +* Accurate sizes: Pass parent alignment context to images. ([1701](https://github.com/WordPress/performance/pull/1701)) +* Accurate sizes: Reorganize file structure by feature. ([1699](https://github.com/WordPress/performance/pull/1699)) +* Accurate sizes: Support relative alignment widths. ([1737](https://github.com/WordPress/performance/pull/1737)) +* Remove `auto_sizes_get_layout_settings()`. ([1743](https://github.com/WordPress/performance/pull/1743)) + +**Bug Fixes** + +* Accurate sizes: Disable layout calculations for classic themes. ([1744](https://github.com/WordPress/performance/pull/1744)) + = 1.3.0 = **Enhancements** diff --git a/plugins/dominant-color-images/hooks.php b/plugins/dominant-color-images/hooks.php index c60f1d7a4..40ccf1c67 100644 --- a/plugins/dominant-color-images/hooks.php +++ b/plugins/dominant-color-images/hooks.php @@ -194,7 +194,7 @@ function dominant_color_render_generator(): void { * to apply background color based on the dominant color for attachment previews * in the WordPress admin interface. * - * @since n.e.x.t + * @since 1.2.0 */ function dominant_color_admin_inline_style(): void { $handle = 'dominant-color-admin-styles'; @@ -213,7 +213,7 @@ function dominant_color_admin_inline_style(): void { * the attachment template. It adds attributes for dominant color and transparency * to the template, allowing these properties to be displayed in the media library. * - * @since n.e.x.t + * @since 1.2.0 * @see wp_print_media_templates() */ function dominant_color_admin_script(): void { @@ -249,7 +249,7 @@ function dominant_color_admin_script(): void { * the dominant color and transparency of the image. It modifies the response array to include * these additional properties, which can be used in the media library interface. * - * @since n.e.x.t + * @since 1.2.0 * * @param array|mixed $response The current response array for the attachment. * @param WP_Post $attachment The attachment post object. diff --git a/plugins/dominant-color-images/load.php b/plugins/dominant-color-images/load.php index e2e3c0c1b..56a7f51b7 100644 --- a/plugins/dominant-color-images/load.php +++ b/plugins/dominant-color-images/load.php @@ -5,7 +5,7 @@ * Description: Displays placeholders based on an image's dominant color while the image is loading. * Requires at least: 6.6 * Requires PHP: 7.2 - * Version: 1.1.2 + * Version: 1.2.0 * Author: WordPress Performance Team * Author URI: https://make.wordpress.org/performance/ * License: GPLv2 or later @@ -25,7 +25,7 @@ return; } -define( 'DOMINANT_COLOR_IMAGES_VERSION', '1.1.2' ); +define( 'DOMINANT_COLOR_IMAGES_VERSION', '1.2.0' ); require_once __DIR__ . '/helper.php'; require_once __DIR__ . '/hooks.php'; diff --git a/plugins/dominant-color-images/readme.txt b/plugins/dominant-color-images/readme.txt index b639dc4e5..1aa6df61f 100644 --- a/plugins/dominant-color-images/readme.txt +++ b/plugins/dominant-color-images/readme.txt @@ -2,7 +2,7 @@ Contributors: wordpressdotorg Tested up to: 6.7 -Stable tag: 1.1.2 +Stable tag: 1.2.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: performance, images, dominant color @@ -47,6 +47,12 @@ Contributions are always welcome! Learn more about how to get involved in the [C == Changelog == += 1.2.0 = + +**Enhancements** + +* Enhance admin media UI with dominant color support. ([1719](https://github.com/WordPress/performance/pull/1719)) + = 1.1.2 = **Enhancements** diff --git a/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php b/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php index a1d02b98f..9c30bdfc7 100644 --- a/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php +++ b/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php @@ -81,7 +81,7 @@ private function is_embed_wrapper( OD_HTML_Tag_Processor $processor ): bool { * Otherwise, if the embed is not in any initial viewport, it will add lazy-loading logic. * * @since 0.2.0 - * @since n.e.x.t Adds preconnect links for each viewport group and skips if the element is not in the viewport for that group. + * @since 0.4.0 Adds preconnect links for each viewport group and skips if the element is not in the viewport for that group. * * @param OD_Tag_Visitor_Context $context Tag visitor context. * @return bool Whether the tag should be tracked in URL Metrics. diff --git a/plugins/embed-optimizer/hooks.php b/plugins/embed-optimizer/hooks.php index 988a5a2df..e32e360cc 100644 --- a/plugins/embed-optimizer/hooks.php +++ b/plugins/embed-optimizer/hooks.php @@ -428,7 +428,7 @@ function embed_optimizer_render_generator(): void { /** * Gets the path to a script or stylesheet. * - * @since n.e.x.t + * @since 0.4.0 * * @param string $src_path Source path, relative to plugin root. * @param string|null $min_path Minified path. If not supplied, then '.min' is injected before the file extension in the source path. diff --git a/plugins/embed-optimizer/load.php b/plugins/embed-optimizer/load.php index 4510fb5dc..eda818a6e 100644 --- a/plugins/embed-optimizer/load.php +++ b/plugins/embed-optimizer/load.php @@ -5,7 +5,7 @@ * Description: Optimizes the performance of embeds through lazy-loading, preconnecting, and reserving space to reduce layout shifts. * Requires at least: 6.6 * Requires PHP: 7.2 - * Version: 0.3.0 + * Version: 0.4.0 * Author: WordPress Performance Team * Author URI: https://make.wordpress.org/performance/ * License: GPLv2 or later @@ -70,7 +70,7 @@ static function ( string $global_var_name, string $version, Closure $load ): voi } )( 'embed_optimizer_pending_plugin', - '0.3.0', + '0.4.0', static function ( string $version ): void { if ( defined( 'EMBED_OPTIMIZER_VERSION' ) ) { return; diff --git a/plugins/embed-optimizer/readme.txt b/plugins/embed-optimizer/readme.txt index a36210a5a..65c30a2a1 100644 --- a/plugins/embed-optimizer/readme.txt +++ b/plugins/embed-optimizer/readme.txt @@ -2,7 +2,7 @@ Contributors: wordpressdotorg Tested up to: 6.7 -Stable tag: 0.3.0 +Stable tag: 0.4.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: performance, embeds @@ -67,6 +67,13 @@ The [plugin source code](https://github.com/WordPress/performance/tree/trunk/plu == Changelog == += 0.4.0 = + +**Enhancements** + +* Incorporate media queries into preconnect links to account for whether embeds are in viewport. ([1654](https://github.com/WordPress/performance/pull/1654)) +* Serve unminified scripts when `SCRIPT_DEBUG` is enabled. ([1643](https://github.com/WordPress/performance/pull/1643)) + = 0.3.0 = **Enhancements** diff --git a/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php b/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php index c6570d4d2..0661bdfb9 100644 --- a/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php +++ b/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php @@ -29,7 +29,7 @@ final class Image_Prioritizer_Background_Image_Styled_Tag_Visitor extends Image_ /** * Class name used to indicate a background image which is lazy-loaded. * - * @since n.e.x.t + * @since 0.3.0 * @var string */ const LAZY_BG_IMAGE_CLASS_NAME = 'od-lazy-bg-image'; @@ -37,7 +37,7 @@ final class Image_Prioritizer_Background_Image_Styled_Tag_Visitor extends Image_ /** * Whether the lazy-loading script and stylesheet have been added. * - * @since n.e.x.t + * @since 0.3.0 * @var bool */ private $added_lazy_assets = false; @@ -45,7 +45,7 @@ final class Image_Prioritizer_Background_Image_Styled_Tag_Visitor extends Image_ /** * Tuples of URL Metric group and the common LCP element external background image. * - * @since n.e.x.t + * @since 0.3.0 * @var array */ private $group_common_lcp_element_external_background_images; @@ -99,7 +99,7 @@ public function __invoke( OD_Tag_Visitor_Context $context ): bool { /** * Gets the common LCP element external background image for a URL Metric group. * - * @since n.e.x.t + * @since 0.3.0 * * @param OD_URL_Metric_Group $group Group. * @return LcpElementExternalBackgroundImage|null @@ -135,7 +135,7 @@ private function get_common_lcp_element_external_background_image( OD_URL_Metric /** * Maybe preloads external background image. * - * @since n.e.x.t + * @since 0.3.0 * * @param OD_Tag_Visitor_Context $context Context. */ @@ -182,7 +182,7 @@ private function maybe_preload_external_lcp_background_image( OD_Tag_Visitor_Con /** * Adds an image preload link for the group. * - * @since n.e.x.t + * @since 0.3.0 * * @param OD_Link_Collection $link_collection Link collection. * @param OD_URL_Metric_Group $group URL Metric group. @@ -205,7 +205,7 @@ private function add_image_preload_link( OD_Link_Collection $link_collection, OD /** * Optimizes an element with a background image based on whether it is displayed in any initial viewport. * - * @since n.e.x.t + * @since 0.3.0 * * @param OD_Tag_Visitor_Context $context Tag visitor context, with the cursor currently at block with a background image. */ diff --git a/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php b/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php index ba14edf57..15a3008ce 100644 --- a/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php +++ b/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php @@ -25,7 +25,7 @@ final class Image_Prioritizer_Img_Tag_Visitor extends Image_Prioritizer_Tag_Visi * Visits a tag. * * @since 0.1.0 - * @since n.e.x.t Separate the processing of IMG and PICTURE elements. + * @since 0.3.0 Separate the processing of IMG and PICTURE elements. * * @param OD_Tag_Visitor_Context $context Tag visitor context. * @return bool Whether the tag should be tracked in URL Metrics. @@ -46,7 +46,7 @@ public function __invoke( OD_Tag_Visitor_Context $context ): bool { /** * Process an IMG element. * - * @since n.e.x.t + * @since 0.3.0 * * @param OD_HTML_Tag_Processor $processor HTML tag processor. * @param OD_Tag_Visitor_Context $context Tag visitor context. @@ -183,7 +183,7 @@ private function process_img( OD_HTML_Tag_Processor $processor, OD_Tag_Visitor_C /** * Process a PICTURE element. * - * @since n.e.x.t + * @since 0.3.0 * * @param OD_HTML_Tag_Processor $processor HTML tag processor. * @param OD_Tag_Visitor_Context $context Tag visitor context. @@ -283,7 +283,7 @@ private function process_picture( OD_HTML_Tag_Processor $processor, OD_Tag_Visit * Returns null if the src attribute is not a string (i.e. src was used as a boolean attribute was used), if it * it has an empty string value after trimming, or if it is a data: URL. * - * @since n.e.x.t + * @since 0.3.0 * * @param OD_HTML_Tag_Processor $processor Processor. * @param 'src'|'srcset' $attribute_name Attribute name. @@ -304,7 +304,7 @@ private function get_valid_src( OD_HTML_Tag_Processor $processor, string $attrib /** * Adds a LINK with the supplied attributes for each viewport group when the provided XPath is the LCP element. * - * @since n.e.x.t + * @since 0.3.0 * * @param OD_Tag_Visitor_Context $context Tag visitor context. * @param string $xpath XPath of the element. @@ -351,7 +351,7 @@ static function ( $attribute_value ) { /** * Gets the parent tag name. * - * @since n.e.x.t + * @since 0.3.0 * * @param OD_Tag_Visitor_Context $context Tag visitor context. * @return string|null The parent tag name or null if not found. diff --git a/plugins/image-prioritizer/detect.js b/plugins/image-prioritizer/detect.js index 6a73074c2..54fe64d09 100644 --- a/plugins/image-prioritizer/detect.js +++ b/plugins/image-prioritizer/detect.js @@ -34,7 +34,7 @@ const externalBackgroundImages = []; /** * Logs a message. * - * @since n.e.x.t + * @since 0.3.0 * * @param {...*} message */ @@ -46,7 +46,7 @@ function log( ...message ) { /** * Logs a warning. * - * @since n.e.x.t + * @since 0.3.0 * * @param {...*} message */ @@ -58,7 +58,7 @@ function warn( ...message ) { /** * Initializes extension. * - * @since n.e.x.t + * @since 0.3.0 * * @type {InitializeCallback} * @param {InitializeArgs} args Args. @@ -80,7 +80,7 @@ export async function initialize( { isDebug, onLCP } ) { /** * Gets the performance resource entry for a given URL. * - * @since n.e.x.t + * @since 0.3.0 * * @param {string} url - Resource URL. * @return {PerformanceResourceTiming|null} Resource entry or null. @@ -101,7 +101,7 @@ function getPerformanceResourceByURL( url ) { /** * Handles a new LCP metric being reported. * - * @since n.e.x.t + * @since 0.3.0 * * @param {LCPMetric} metric - LCP Metric. * @param {boolean} isDebug - Whether in debug mode. @@ -203,7 +203,7 @@ function handleLCPMetric( metric, isDebug ) { /** * Finalizes extension. * - * @since n.e.x.t + * @since 0.3.0 * * @type {FinalizeCallback} * @param {FinalizeArgs} args Args. diff --git a/plugins/image-prioritizer/helper.php b/plugins/image-prioritizer/helper.php index 75c3e18d4..3e8dd49cf 100644 --- a/plugins/image-prioritizer/helper.php +++ b/plugins/image-prioritizer/helper.php @@ -83,7 +83,7 @@ function image_prioritizer_register_tag_visitors( OD_Tag_Visitor_Registry $regis /** * Filters the list of Optimization Detective extension module URLs to include the extension for Image Prioritizer. * - * @since n.e.x.t + * @since 0.3.0 * @access private * * @param string[]|mixed $extension_module_urls Extension module URLs. @@ -100,7 +100,7 @@ function image_prioritizer_filter_extension_module_urls( $extension_module_urls /** * Filters additional properties for the element item schema for Optimization Detective. * - * @since n.e.x.t + * @since 0.3.0 * @access private * * @param array $additional_properties Additional properties. @@ -145,7 +145,7 @@ function image_prioritizer_add_element_item_schema_properties( array $additional /** * Validates URL for a background image. * - * @since n.e.x.t + * @since 0.3.0 * @access private * * @param string $url Background image URL. @@ -271,7 +271,7 @@ static function ( $host ) { * potentially no URL Metrics would ever be collected if, for example, the background image URL is pointing to a * disallowed origin. Then none of the other optimizations would be able to be applied. * - * @since n.e.x.t + * @since 0.3.0 * @access private * * @phpstan-param WP_REST_Request> $request @@ -322,7 +322,7 @@ function image_prioritizer_filter_rest_request_before_callbacks( $response, arra /** * Gets the path to a script or stylesheet. * - * @since n.e.x.t + * @since 0.3.0 * @access private * * @param string $src_path Source path, relative to plugin root. @@ -384,7 +384,7 @@ function image_prioritizer_get_video_lazy_load_script(): string { * * Load the background image when it approaches the viewport using an IntersectionObserver. * - * @since n.e.x.t + * @since 0.3.0 * @access private * * @return string Lazy load script. @@ -397,7 +397,7 @@ function image_prioritizer_get_lazy_load_bg_image_script(): string { /** * Gets the stylesheet to lazy-load background images. * - * @since n.e.x.t + * @since 0.3.0 * @access private * * @return string Lazy load stylesheet. diff --git a/plugins/image-prioritizer/load.php b/plugins/image-prioritizer/load.php index 8fa0be02b..ce40dff41 100644 --- a/plugins/image-prioritizer/load.php +++ b/plugins/image-prioritizer/load.php @@ -6,7 +6,7 @@ * Requires at least: 6.6 * Requires PHP: 7.2 * Requires Plugins: optimization-detective - * Version: 0.2.0 + * Version: 0.3.0 * Author: WordPress Performance Team * Author URI: https://make.wordpress.org/performance/ * License: GPLv2 or later @@ -71,7 +71,7 @@ static function ( string $global_var_name, string $version, Closure $load ): voi } )( 'image_prioritizer_pending_plugin', - '0.2.0', + '0.3.0', static function ( string $version ): void { if ( defined( 'IMAGE_PRIORITIZER_VERSION' ) ) { return; diff --git a/plugins/image-prioritizer/readme.txt b/plugins/image-prioritizer/readme.txt index 867272d30..36a942c81 100644 --- a/plugins/image-prioritizer/readme.txt +++ b/plugins/image-prioritizer/readme.txt @@ -2,7 +2,7 @@ Contributors: wordpressdotorg Tested up to: 6.7 -Stable tag: 0.2.0 +Stable tag: 0.3.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: performance, optimization, image, lcp, lazy-load @@ -11,7 +11,7 @@ Prioritizes the loading of images and videos based on how visible they are to ac == Description == -This plugin optimizes the loading of images (and videos) with prioritization, lazy loading, and more accurate image size selection. +This plugin optimizes the loading of images (and videos) with prioritization to improve [Largest Contentful Paint](https://web.dev/articles/lcp) (LCP), lazy loading, and more accurate image size selection. The current optimizations include: @@ -21,7 +21,7 @@ The current optimizations include: 3. An element with a CSS `background-image` inline `style` attribute. 4. An element with a CSS `background-image` applied with a stylesheet (when the image is from an allowed origin). 5. A `VIDEO` element's `poster` image. -2. Ensure `fetchpriority=high` is only added to an `IMG` when it is the Largest Contentful Paint (LCP) element across all responsive breakpoints. +2. Ensure `fetchpriority=high` is only added to an `IMG` when it is the LCP element across all responsive breakpoints. 3. Add `fetchpriority=low` to `IMG` tags which appear in the initial viewport but are not visible, such as when they are subsequent carousel slides. 4. Lazy loading: 1. Apply lazy loading to `IMG` tags based on whether they appear in any breakpoint’s initial viewport. @@ -70,6 +70,16 @@ The [plugin source code](https://github.com/WordPress/performance/tree/trunk/plu == Changelog == += 0.3.0 = + +**Enhancements** + +* Add preload links LCP picture elements. ([1707](https://github.com/WordPress/performance/pull/1707)) +* Harden validation of user-submitted LCP background image URL. ([1713](https://github.com/WordPress/performance/pull/1713)) +* Lazy load background images added via inline style attributes. ([1708](https://github.com/WordPress/performance/pull/1708)) +* Preload image URLs for LCP elements with external background images. ([1697](https://github.com/WordPress/performance/pull/1697)) +* Serve unminified scripts when `SCRIPT_DEBUG` is enabled. ([1643](https://github.com/WordPress/performance/pull/1643)) + = 0.2.0 = **Enhancements** diff --git a/plugins/optimization-detective/class-od-html-tag-processor.php b/plugins/optimization-detective/class-od-html-tag-processor.php index 16952a23f..48ad11d12 100644 --- a/plugins/optimization-detective/class-od-html-tag-processor.php +++ b/plugins/optimization-detective/class-od-html-tag-processor.php @@ -497,7 +497,7 @@ public function release_bookmark( $name ): bool { * A breadcrumb consists of a tag name and its sibling index. * * @since 0.4.0 - * @since n.e.x.t Renamed from get_breadcrumbs() to get_indexed_breadcrumbs(). + * @since 0.9.0 Renamed from get_breadcrumbs() to get_indexed_breadcrumbs(). * * @return Generator Breadcrumb. */ @@ -513,7 +513,7 @@ private function get_indexed_breadcrumbs(): Generator { * Breadcrumbs start at the outermost parent and descend toward the matched element. * They always include the entire path from the root HTML node to the matched element. * - * @since n.e.x.t + * @since 0.9.0 * @see WP_HTML_Processor::get_breadcrumbs() * * @return string[] Array of tag names representing path to matched node. diff --git a/plugins/optimization-detective/class-od-url-metric-group-collection.php b/plugins/optimization-detective/class-od-url-metric-group-collection.php index c87ac93e3..56d257402 100644 --- a/plugins/optimization-detective/class-od-url-metric-group-collection.php +++ b/plugins/optimization-detective/class-od-url-metric-group-collection.php @@ -38,7 +38,7 @@ final class OD_URL_Metric_Group_Collection implements Countable, IteratorAggrega /** * The current ETag. * - * @since n.e.x.t + * @since 0.9.0 * @var non-empty-string */ private $current_etag; @@ -186,7 +186,7 @@ public function __construct( array $url_metrics, string $current_etag, array $br /** * Gets the current ETag. * - * @since n.e.x.t + * @since 0.9.0 * * @return non-empty-string Current ETag. */ @@ -427,7 +427,7 @@ public function get_groups_by_lcp_element( string $xpath ): array { * Gets common LCP element. * * @since 0.3.0 - * @since n.e.x.t An LCP element is also considered common if it is the same in the narrowest and widest viewport groups, and all intermediate groups are empty. + * @since 0.9.0 An LCP element is also considered common if it is the same in the narrowest and widest viewport groups, and all intermediate groups are empty. * * @return OD_Element|null Common LCP element if it exists. */ diff --git a/plugins/optimization-detective/class-od-url-metric-group.php b/plugins/optimization-detective/class-od-url-metric-group.php index f8772eca7..1e81641fd 100644 --- a/plugins/optimization-detective/class-od-url-metric-group.php +++ b/plugins/optimization-detective/class-od-url-metric-group.php @@ -183,7 +183,7 @@ public function get_maximum_viewport_width(): int { /** * Gets the sample size for URL Metrics for a given breakpoint. * - * @since n.e.x.t + * @since 0.9.0 * * @todo Eliminate in favor of readonly public property. * @phpstan-return positive-int @@ -196,7 +196,7 @@ public function get_sample_size(): int { /** * Gets the freshness age (TTL) for a given URL Metric. * - * @since n.e.x.t + * @since 0.9.0 * * @todo Eliminate in favor of readonly public property. * @phpstan-return 0|positive-int @@ -265,7 +265,7 @@ static function ( OD_URL_Metric $a, OD_URL_Metric $b ): int { * and all of these URL Metrics are fresh. * * @since 0.1.0 - * @since n.e.x.t If the current environment's generated ETag does not match the URL Metric's ETag, the URL Metric is considered stale. + * @since 0.9.0 If the current environment's generated ETag does not match the URL Metric's ETag, the URL Metric is considered stale. * * @return bool Whether complete. */ @@ -385,7 +385,7 @@ public function get_lcp_element(): ?OD_Element { /** * Gets all elements from all URL Metrics in the viewport group keyed by the elements' XPaths. * - * @since n.e.x.t + * @since 0.9.0 * * @return array> Keys are XPaths and values are the element instances. */ @@ -411,7 +411,7 @@ public function get_xpath_elements_map(): array { /** * Gets the max intersection ratios of all elements in the viewport group and its captured URL Metrics. * - * @since n.e.x.t + * @since 0.9.0 * * @return array Keys are XPaths and values are the intersection ratios. */ @@ -439,7 +439,7 @@ public function get_all_element_max_intersection_ratios(): array { /** * Gets the max intersection ratio of an element in the viewport group and its captured URL Metrics. * - * @since n.e.x.t + * @since 0.9.0 * * @param string $xpath XPath for the element. * @return float|null Max intersection ratio of null if tag is unknown (not captured). @@ -473,7 +473,7 @@ public function count(): int { /** * Clears result cache. * - * @since n.e.x.t + * @since 0.9.0 */ public function clear_cache(): void { $this->result_cache = array(); diff --git a/plugins/optimization-detective/class-od-url-metric.php b/plugins/optimization-detective/class-od-url-metric.php index f4a4e25cc..0a164edc9 100644 --- a/plugins/optimization-detective/class-od-url-metric.php +++ b/plugins/optimization-detective/class-od-url-metric.php @@ -156,7 +156,7 @@ public function set_group( OD_URL_Metric_Group $group ): void { * Gets JSON schema for URL Metric. * * @since 0.1.0 - * @since n.e.x.t Added the 'etag' property to the schema. + * @since 0.9.0 Added the 'etag' property to the schema. * * @todo Cache the return value? * @@ -431,7 +431,7 @@ public function get_uuid(): string { /** * Gets ETag. * - * @since n.e.x.t + * @since 0.9.0 * * @return non-empty-string|null ETag. */ diff --git a/plugins/optimization-detective/helper.php b/plugins/optimization-detective/helper.php index bc9bbfb7f..27073205d 100644 --- a/plugins/optimization-detective/helper.php +++ b/plugins/optimization-detective/helper.php @@ -68,7 +68,7 @@ function od_render_generator_meta_tag(): void { /** * Gets the path to a script or stylesheet. * - * @since n.e.x.t + * @since 0.9.0 * * @param string $src_path Source path, relative to plugin root. * @param string|null $min_path Minified path. If not supplied, then '.min' is injected before the file extension in the source path. diff --git a/plugins/optimization-detective/load.php b/plugins/optimization-detective/load.php index 7000e184e..81b60cb75 100644 --- a/plugins/optimization-detective/load.php +++ b/plugins/optimization-detective/load.php @@ -5,7 +5,7 @@ * 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.6 * Requires PHP: 7.2 - * Version: 0.9.0-alpha + * Version: 0.9.0 * Author: WordPress Performance Team * Author URI: https://make.wordpress.org/performance/ * License: GPLv2 or later @@ -70,7 +70,7 @@ static function ( string $global_var_name, string $version, Closure $load ): voi } )( 'optimization_detective_pending_plugin', - '0.9.0-alpha', + '0.9.0', static function ( string $version ): void { if ( defined( 'OPTIMIZATION_DETECTIVE_VERSION' ) ) { return; diff --git a/plugins/optimization-detective/optimization.php b/plugins/optimization-detective/optimization.php index 74548eef1..fa72a6194 100644 --- a/plugins/optimization-detective/optimization.php +++ b/plugins/optimization-detective/optimization.php @@ -98,7 +98,7 @@ function_exists( 'perflab_server_timing_use_output_buffer' ) * Determines whether the current response can be optimized. * * @since 0.1.0 - * @since n.e.x.t Response is optimized for admin users as well when in 'plugin' development mode. + * @since 0.9.0 Response is optimized for admin users as well when in 'plugin' development mode. * * @access private * diff --git a/plugins/optimization-detective/readme.txt b/plugins/optimization-detective/readme.txt index 1e783ef82..62dac5293 100644 --- a/plugins/optimization-detective/readme.txt +++ b/plugins/optimization-detective/readme.txt @@ -2,7 +2,7 @@ Contributors: wordpressdotorg Tested up to: 6.7 -Stable tag: 0.8.0 +Stable tag: 0.9.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: performance, optimization, rum @@ -47,25 +47,25 @@ As mentioned above, this plugin is a dependency that doesn't provide features on **[Image Prioritizer](https://wordpress.org/plugins/image-prioritizer/) ([GitHub](https://github.com/WordPress/performance/tree/trunk/plugins/image-prioritizer)):** 1. Add breakpoint-specific `fetchpriority=high` preload links (`LINK[rel=preload]`) for image URLs of LCP elements: - 1. An `IMG` element, including the `srcset`/`sizes` attributes supplied as `imagesrcset`/`imagesizes` on the `LINK`. ([1](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L167-L177), [2](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L304-L349)) - 2. The first `SOURCE` element with a `type` attribute in a `PICTURE` element. (Art-directed `PICTURE` elements using media queries are not supported.) ([1](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L192-L275), [2](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L304-L349)) - 3. An element with a CSS `background-image` inline `style` attribute. ([1](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php#L62-L92), [2](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php#L182-L203)) - 4. An element with a CSS `background-image` applied with a stylesheet (when the image is from an allowed origin). ([1](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php#L82-L83), [2](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php#L135-L203), [3](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/helper.php#L83-L264), [4](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/detect.js)) - 5. A `VIDEO` element's `poster` image. ([1](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-video-tag-visitor.php#L127-L161)) -2. Ensure `fetchpriority=high` is only added to an `IMG` when it is the Largest Contentful Paint (LCP) element across all responsive breakpoints. ([1](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L65-L91), [2](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L137-L146)) -3. Add `fetchpriority=low` to `IMG` tags which appear in the initial viewport but are not visible, such as when they are subsequent carousel slides. ([1](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L105-L123), [2](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L137-L146)) + 1. An `IMG` element, including the `srcset`/`sizes` attributes supplied as `imagesrcset`/`imagesizes` on the `LINK`. ([1](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L167-L177), [2](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L304-L349)) + 2. The first `SOURCE` element with a `type` attribute in a `PICTURE` element. (Art-directed `PICTURE` elements using media queries are not supported.) ([1](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L192-L275), [2](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L304-L349)) + 3. An element with a CSS `background-image` inline `style` attribute. ([1](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php#L62-L92), [2](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php#L182-L203)) + 4. An element with a CSS `background-image` applied with a stylesheet (when the image is from an allowed origin). ([1](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/hooks.php#L14-L16), [2](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php#L82-L83), [3](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php#L135-L203), [4](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/helper.php#L83-L320), [5](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/detect.js)) + 5. A `VIDEO` element's `poster` image. ([1](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-video-tag-visitor.php#L127-L161)) +2. Ensure `fetchpriority=high` is only added to an `IMG` when it is the LCP element across all responsive breakpoints. ([1](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L65-L91), [2](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L137-L146)) +3. Add `fetchpriority=low` to `IMG` tags which appear in the initial viewport but are not visible, such as when they are subsequent carousel slides. ([1](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L105-L123), [2](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L137-L146)) 4. Lazy loading: - 1. Apply lazy loading to `IMG` tags based on whether they appear in any breakpoint’s initial viewport. ([1](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L124-L133)) - 2. Implement lazy loading of CSS background images added via inline `style` attributes. ([1](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php#L205-L238), [2](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/helper.php#L369-L382), [3](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/lazy-load-bg-image.js)) - 3. Lazy-load `VIDEO` tags by setting the appropriate attributes based on whether they appear in the initial viewport. If a `VIDEO` is the LCP element, it gets `preload=auto`; if it is in an initial viewport, the `preload=metadata` default is left; if it is not in an initial viewport, it gets `preload=none`. Lazy-loaded videos also get initial `preload`, `autoplay`, and `poster` attributes restored when the `VIDEO` is going to enter the viewport. ([1](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-video-tag-visitor.php#L163-L246), [2](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/helper.php#L352-L367), [3](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/lazy-load-video.js)) -5. Ensure that [`sizes=auto`](https://make.wordpress.org/core/2024/10/18/auto-sizes-for-lazy-loaded-images-in-wordpress-6-7/) is added to all lazy-loaded `IMG` elements. ([1](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L148-L163)) -6. Reduce the size of the `poster` image of a `VIDEO` from full size to the size appropriate for the maximum width of the video (on desktop). ([1](https://github.com/WordPress/performance/blob/e1d0ac9dd935634b782d711c7e1ae85d296f44cf/plugins/image-prioritizer/class-image-prioritizer-video-tag-visitor.php#L84-L125)) + 1. Apply lazy loading to `IMG` tags based on whether they appear in any breakpoint’s initial viewport. ([1](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L124-L133)) + 2. Implement lazy loading of CSS background images added via inline `style` attributes. ([1](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php#L205-L238), [2](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/helper.php#L365-L380), [3](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/lazy-load-bg-image.js)) + 3. Lazy-load `VIDEO` tags by setting the appropriate attributes based on whether they appear in the initial viewport. If a `VIDEO` is the LCP element, it gets `preload=auto`; if it is in an initial viewport, the `preload=metadata` default is left; if it is not in an initial viewport, it gets `preload=none`. Lazy-loaded videos also get initial `preload`, `autoplay`, and `poster` attributes restored when the `VIDEO` is going to enter the viewport. ([1](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-video-tag-visitor.php#L163-L246), [2](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/helper.php#L365-L380), [3](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/lazy-load-video.js)) +5. Ensure that [`sizes=auto`](https://make.wordpress.org/core/2024/10/18/auto-sizes-for-lazy-loaded-images-in-wordpress-6-7/) is added to all lazy-loaded `IMG` elements. ([1](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php#L148-L163)) +6. Reduce the size of the `poster` image of a `VIDEO` from full size to the size appropriate for the maximum width of the video (on desktop). ([1](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/image-prioritizer/class-image-prioritizer-video-tag-visitor.php#L84-L125)) **[Embed Optimizer](https://wordpress.org/plugins/embed-optimizer/) ([GitHub](https://github.com/WordPress/performance/tree/trunk/plugins/embed-optimizer)):** -1. Lazy loading embeds just before they come into view. ([1](https://github.com/WordPress/performance/blob/ce76a6a77c15248126b5dab895bc11d0adda0baa/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php#L191-L194), [2](https://github.com/WordPress/performance/blob/ce76a6a77c15248126b5dab895bc11d0adda0baa/plugins/embed-optimizer/hooks.php#L168-L336)) -2. Adding preconnect links for embeds in the initial viewport. ([1](https://github.com/WordPress/performance/blob/ce76a6a77c15248126b5dab895bc11d0adda0baa/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php#L114-L190)) -3. Reserving space for embeds that resize to reduce layout shifting. ([1](https://github.com/WordPress/performance/blob/ce76a6a77c15248126b5dab895bc11d0adda0baa/plugins/embed-optimizer/hooks.php#L81-L144), [2](https://github.com/WordPress/performance/blob/ce76a6a77c15248126b5dab895bc11d0adda0baa/plugins/embed-optimizer/detect.js), [3](https://github.com/WordPress/performance/blob/ce76a6a77c15248126b5dab895bc11d0adda0baa/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php#L218-L285)) +1. Lazy loading embeds just before they come into view. ([1](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php#L191-L194), [2](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/embed-optimizer/hooks.php#L168-L336)) +2. Adding preconnect links for embeds in the initial viewport. ([1](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php#L114-L190)) +3. Reserving space for embeds that resize to reduce layout shifting. ([1](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/embed-optimizer/hooks.php#L64-L65), [2](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/embed-optimizer/hooks.php#L81-L144), [3](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/embed-optimizer/detect.js), [4](https://github.com/WordPress/performance/blob/f5f50f9179c26deadeef966734367d199ba6de6f/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php#L218-L285)) = Hooks = @@ -319,6 +319,25 @@ The [plugin source code](https://github.com/WordPress/performance/tree/trunk/plu == Changelog == += 0.9.0 = + +**Enhancements** + +* Add `fetchpriority=high` to `IMG` when it is the LCP element on desktop and mobile with other viewport groups empty. ([1723](https://github.com/WordPress/performance/pull/1723)) +* Improve debugging stored URL Metrics in Optimization Detective. ([1656](https://github.com/WordPress/performance/pull/1656)) +* Incorporate page state into ETag computation. ([1722](https://github.com/WordPress/performance/pull/1722)) +* Mark existing URL Metrics as stale when a new tag visitor is registered. ([1705](https://github.com/WordPress/performance/pull/1705)) +* Set development mode to 'plugin' in the dev environment and allow pages to be optimized when admin is logged-in (when in plugin dev mode). ([1700](https://github.com/WordPress/performance/pull/1700)) +* Add `get_xpath_elements_map()` helper methods to `OD_URL_Metric_Group_Collection` and `OD_URL_Metric_Group`, and add `get_all_element_max_intersection_ratios`/`get_element_max_intersection_ratio` methods to `OD_URL_Metric_Group`. ([1654](https://github.com/WordPress/performance/pull/1654)) +* Add `get_breadcrumbs()` method to `OD_HTML_Tag_Processor`. ([1707](https://github.com/WordPress/performance/pull/1707)) +* Add `get_sample_size()` and `get_freshness_ttl()` methods to `OD_URL_Metric_Group`. ([1697](https://github.com/WordPress/performance/pull/1697)) +* Expose `onTTFB`, `onFCP`, `onLCP`, `onINP`, and `onCLS` from web-vitals.js to extension JS modules via args their `initialize` functions. ([1697](https://github.com/WordPress/performance/pull/1697)) + +**Bug Fixes** + +* Prevent submitting URL Metric if viewport size changed. ([1712](https://github.com/WordPress/performance/pull/1712)) +* Fix construction of XPath expressions for implicitly closed paragraphs. ([1707](https://github.com/WordPress/performance/pull/1707)) + = 0.8.0 = **Enhancements** diff --git a/plugins/optimization-detective/storage/data.php b/plugins/optimization-detective/storage/data.php index 4c51c49ab..367637f00 100644 --- a/plugins/optimization-detective/storage/data.php +++ b/plugins/optimization-detective/storage/data.php @@ -143,7 +143,7 @@ function od_get_url_metrics_slug( array $query_vars ): string { /** * Gets the current template for a block theme or a classic theme. * - * @since n.e.x.t + * @since 0.9.0 * @access private * * @global string|null $_wp_current_template_id Current template ID. @@ -173,7 +173,7 @@ function od_get_current_theme_template() { * posts in The Loop, and theme information in the current environment. This ETag * is used to assess if the URL Metrics are stale when its value changes. * - * @since n.e.x.t + * @since 0.9.0 * @access private * * @param OD_Tag_Visitor_Registry $tag_visitor_registry Tag visitor registry. @@ -238,7 +238,7 @@ static function ( $post ): ?array { /** * Filters the data that goes into computing the current ETag for URL Metrics. * - * @since n.e.x.t + * @since 0.9.0 * * @param array $data Data. */ @@ -253,7 +253,7 @@ static function ( $post ): ?array { * This is used in the REST API to authenticate the storage of new URL Metrics from a given URL. * * @since 0.8.0 - * @since n.e.x.t Introduced the `$current_etag` parameter. + * @since 0.9.0 Introduced the `$current_etag` parameter. * @access private * * @see od_verify_url_metrics_storage_hmac() @@ -274,7 +274,7 @@ function od_get_url_metrics_storage_hmac( string $slug, string $current_etag, st * Verifies HMAC for storing URL Metrics for a specific slug. * * @since 0.8.0 - * @since n.e.x.t Introduced the `$current_etag` parameter. + * @since 0.9.0 Introduced the `$current_etag` parameter. * @access private * * @see od_get_url_metrics_storage_hmac() diff --git a/plugins/performance-lab/includes/admin/load.php b/plugins/performance-lab/includes/admin/load.php index 8416f3e74..aecac103d 100644 --- a/plugins/performance-lab/includes/admin/load.php +++ b/plugins/performance-lab/includes/admin/load.php @@ -216,7 +216,7 @@ function perflab_dismiss_wp_pointer_wrapper(): void { /** * Gets the path to a script or stylesheet. * - * @since n.e.x.t + * @since 3.7.0 * * @param string $src_path Source path. * @param string|null $min_path Minified path. If not supplied, then '.min' is injected before the file extension in the source path. diff --git a/plugins/performance-lab/load.php b/plugins/performance-lab/load.php index 3cc067403..8b5fbd772 100644 --- a/plugins/performance-lab/load.php +++ b/plugins/performance-lab/load.php @@ -5,7 +5,7 @@ * Description: Performance plugin from the WordPress Performance Team, which is a collection of standalone performance features. * Requires at least: 6.6 * Requires PHP: 7.2 - * Version: 3.6.1 + * Version: 3.7.0 * Author: WordPress Performance Team * Author URI: https://make.wordpress.org/performance/ * License: GPLv2 or later @@ -19,7 +19,7 @@ exit; // Exit if accessed directly. } -define( 'PERFLAB_VERSION', '3.6.1' ); +define( 'PERFLAB_VERSION', '3.7.0' ); define( 'PERFLAB_MAIN_FILE', __FILE__ ); define( 'PERFLAB_PLUGIN_DIR_PATH', plugin_dir_path( PERFLAB_MAIN_FILE ) ); define( 'PERFLAB_SCREEN', 'performance-lab' ); diff --git a/plugins/performance-lab/readme.txt b/plugins/performance-lab/readme.txt index 8cac6e2c0..98276fc6e 100644 --- a/plugins/performance-lab/readme.txt +++ b/plugins/performance-lab/readme.txt @@ -2,7 +2,7 @@ Contributors: wordpressdotorg Tested up to: 6.7 -Stable tag: 3.6.1 +Stable tag: 3.7.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: performance, site health, measurement, optimization, diagnostics @@ -71,6 +71,19 @@ Contributions are always welcome! Learn more about how to get involved in the [C == Changelog == += 3.7.0 = + +**Enhancements** + +* Add guidance for managing Performance feature plugins. ([1734](https://github.com/WordPress/performance/pull/1734)) +* Automatically discover plugin dependencies when obtaining Performance feature plugins from WordPress.org. ([1680](https://github.com/WordPress/performance/pull/1680)) +* Disregard transient cache in `perflab_query_plugin_info()` when a plugin is absent. ([1694](https://github.com/WordPress/performance/pull/1694)) +* Minify script used for ajax activation of features; warn if absent and serve original file when SCRIPT_DEBUG is enabled. ([1658](https://github.com/WordPress/performance/pull/1658)) + +**Bug Fixes** + +* Fix latest plugin version not being downloaded consistently. ([1693](https://github.com/WordPress/performance/pull/1693)) + = 3.6.1 = **Bug Fixes** diff --git a/plugins/web-worker-offloading/load.php b/plugins/web-worker-offloading/load.php index 831e965da..a540a131d 100644 --- a/plugins/web-worker-offloading/load.php +++ b/plugins/web-worker-offloading/load.php @@ -5,7 +5,7 @@ * 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.6 * Requires PHP: 7.2 - * Version: 0.1.1 + * Version: 0.2.0 * Author: WordPress Performance Team * Author URI: https://make.wordpress.org/performance/ * License: GPLv2 or later @@ -43,7 +43,7 @@ ); } -define( 'WEB_WORKER_OFFLOADING_VERSION', '0.1.1' ); +define( 'WEB_WORKER_OFFLOADING_VERSION', '0.2.0' ); require_once __DIR__ . '/helper.php'; require_once __DIR__ . '/hooks.php'; diff --git a/plugins/web-worker-offloading/readme.txt b/plugins/web-worker-offloading/readme.txt index db93c984c..e2d6623c0 100644 --- a/plugins/web-worker-offloading/readme.txt +++ b/plugins/web-worker-offloading/readme.txt @@ -2,7 +2,7 @@ Contributors: wordpressdotorg Tested up to: 6.7 -Stable tag: 0.1.1 +Stable tag: 0.2.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: performance, JavaScript, web worker, partytown, analytics @@ -26,10 +26,10 @@ Unlike with the script loading strategies (async/defer), any inline before/after Otherwise, the plugin currently ships with built-in integrations to offload Google Analytics to a web worker for the following plugin: +* [Rank Math SEO](https://wordpress.org/plugins/seo-by-rank-math/) +* [Site Kit by Google](https://wordpress.org/plugins/google-site-kit/) * [WooCommerce](https://wordpress.org/plugins/woocommerce/) -Support for [Site Kit by Google](https://wordpress.org/plugins/google-site-kit/) and [Rank Math SEO](https://wordpress.org/plugins/seo-by-rank-math/) are [planned](https://github.com/WordPress/performance/issues/1455). - Please monitor your analytics once activating to ensure all the expected events are being logged. At the same time, monitor your INP scores to check for improvement. This plugin relies on the [Partytown 🎉](https://partytown.builder.io/) library by Builder.io, released under the MIT license. This library is in beta and there are quite a few [open bugs](https://github.com/BuilderIO/partytown/issues?q=is%3Aopen+is%3Aissue+label%3Abug). @@ -94,6 +94,18 @@ The [plugin source code](https://github.com/WordPress/performance/tree/trunk/plu == Changelog == += 0.2.0 = + +**Enhancements** + +* Integrate Web Worker Offloading with Google Site Kit. ([1686](https://github.com/WordPress/performance/pull/1686)) +* Integrate Web Worker Offloading with Rank Math SEO. ([1685](https://github.com/WordPress/performance/pull/1685)) +* Serve unminified scripts when `SCRIPT_DEBUG` is enabled. ([1643](https://github.com/WordPress/performance/pull/1643)) + +**Bug Fixes** + +* Fix tracking events like add_to_cart in WooCommerce integration. ([1740](https://github.com/WordPress/performance/pull/1740)) + = 0.1.1 = **Enhancements** diff --git a/plugins/web-worker-offloading/third-party/google-site-kit.php b/plugins/web-worker-offloading/third-party/google-site-kit.php index 535c9cd92..cf334056e 100644 --- a/plugins/web-worker-offloading/third-party/google-site-kit.php +++ b/plugins/web-worker-offloading/third-party/google-site-kit.php @@ -2,7 +2,7 @@ /** * Web Worker Offloading integration with Site Kit by Google. * - * @since n.e.x.t + * @since 0.2.0 * @package web-worker-offloading */ @@ -13,7 +13,7 @@ /** * Configures WWO for Site Kit and Google Analytics. * - * @since n.e.x.t + * @since 0.2.0 * @access private * @link https://partytown.builder.io/google-tag-manager#forward-events * @@ -53,7 +53,7 @@ function plwwo_google_site_kit_configure( $configuration ): array { /** * Filters inline script attributes to offload Google Site Kit's GTag script tag to Partytown. * - * @since n.e.x.t + * @since 0.2.0 * @access private * @link https://github.com/google/site-kit-wp/blob/abbb74ff21f98a8779fbab0eeb9a16279a122bc4/includes/Core/Consent_Mode/Consent_Mode.php#L244-L259 * diff --git a/plugins/web-worker-offloading/third-party/seo-by-rank-math.php b/plugins/web-worker-offloading/third-party/seo-by-rank-math.php index 7436e924b..302d218b5 100644 --- a/plugins/web-worker-offloading/third-party/seo-by-rank-math.php +++ b/plugins/web-worker-offloading/third-party/seo-by-rank-math.php @@ -2,7 +2,7 @@ /** * Web Worker Offloading integration with Rank Math SEO. * - * @since n.e.x.t + * @since 0.2.0 * @package web-worker-offloading */ @@ -13,7 +13,7 @@ /** * Configures WWO for Rank Math SEO and Google Analytics. * - * @since n.e.x.t + * @since 0.2.0 * @access private * @link https://partytown.builder.io/google-tag-manager#forward-events * @@ -43,7 +43,7 @@ function plwwo_rank_math_configure( $configuration ): array { /** * Filters script attributes to offload Rank Math's GTag script tag to Partytown. * - * @since n.e.x.t + * @since 0.2.0 * @access private * @link https://github.com/rankmath/seo-by-rank-math/blob/c78adba6f78079f27ff1430fabb75c6ac3916240/includes/modules/analytics/class-gtag.php#L161-L167 * @@ -63,7 +63,7 @@ function plwwo_rank_math_filter_script_attributes( $attributes ) { /** * Filters inline script attributes to offload Rank Math's GTag script tag to Partytown. * - * @since n.e.x.t + * @since 0.2.0 * @access private * @link https://github.com/rankmath/seo-by-rank-math/blob/c78adba6f78079f27ff1430fabb75c6ac3916240/includes/modules/analytics/class-gtag.php#L169-L174 * diff --git a/plugins/webp-uploads/helper.php b/plugins/webp-uploads/helper.php index b89e442ba..2ca917012 100644 --- a/plugins/webp-uploads/helper.php +++ b/plugins/webp-uploads/helper.php @@ -414,7 +414,7 @@ function webp_uploads_is_fallback_enabled(): bool { /** * Checks if the `perflab_generate_all_fallback_sizes` option is enabled. * - * @since n.e.x.t + * @since 2.4.0 * * @return bool Whether the option is enabled. Default is false. */ diff --git a/plugins/webp-uploads/hooks.php b/plugins/webp-uploads/hooks.php index 0e36bbca5..3f5e5014d 100644 --- a/plugins/webp-uploads/hooks.php +++ b/plugins/webp-uploads/hooks.php @@ -784,7 +784,7 @@ function webp_uploads_init(): void { /** * Automatically opt into extra image sizes when generating fallback images. * - * @since n.e.x.t + * @since 2.4.0 * * @global array $_wp_additional_image_sizes Associative array of additional image sizes. */ @@ -810,7 +810,7 @@ function webp_uploads_opt_in_extra_image_sizes(): void { /** * Enables additional MIME type support for all image sizes based on the generate all fallback sizes settings. * - * @since n.e.x.t + * @since 2.4.0 * * @param array $allowed_sizes A map of image size names and whether they are allowed to have additional MIME types. * @return array Modified map of image sizes with additional MIME type support. diff --git a/plugins/webp-uploads/load.php b/plugins/webp-uploads/load.php index b474812a3..3ba80c299 100644 --- a/plugins/webp-uploads/load.php +++ b/plugins/webp-uploads/load.php @@ -5,7 +5,7 @@ * Description: Converts images to more modern formats such as WebP or AVIF during upload. * Requires at least: 6.6 * Requires PHP: 7.2 - * Version: 2.3.0 + * Version: 2.4.0 * Author: WordPress Performance Team * Author URI: https://make.wordpress.org/performance/ * License: GPLv2 or later @@ -25,7 +25,7 @@ return; } -define( 'WEBP_UPLOADS_VERSION', '2.3.0' ); +define( 'WEBP_UPLOADS_VERSION', '2.4.0' ); define( 'WEBP_UPLOADS_MAIN_FILE', plugin_basename( __FILE__ ) ); require_once __DIR__ . '/helper.php'; diff --git a/plugins/webp-uploads/readme.txt b/plugins/webp-uploads/readme.txt index 9c793785c..559b3c23a 100644 --- a/plugins/webp-uploads/readme.txt +++ b/plugins/webp-uploads/readme.txt @@ -2,7 +2,7 @@ Contributors: wordpressdotorg Tested up to: 6.7 -Stable tag: 2.3.0 +Stable tag: 2.4.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: performance, images, webp, avif, modern image formats @@ -60,6 +60,14 @@ By default, the Modern Image Formats plugin will only generate WebP versions of == Changelog == += 2.4.0 = + +**Enhancements** + +* Automatically opt into 1536x1536 and 2048x2048 sizes when generating fallback images. ([1679](https://github.com/WordPress/performance/pull/1679)) +* Convert WebP to AVIF on upload. ([1724](https://github.com/WordPress/performance/pull/1724)) +* Enable end user opt-in to generate all sizes in fallback format. ([1689](https://github.com/WordPress/performance/pull/1689)) + = 2.3.0 = **Enhancements** diff --git a/plugins/webp-uploads/settings.php b/plugins/webp-uploads/settings.php index cad0352e1..fa27269c4 100644 --- a/plugins/webp-uploads/settings.php +++ b/plugins/webp-uploads/settings.php @@ -204,7 +204,7 @@ function webp_uploads_generate_webp_jpeg_setting_callback(): void { /** * Renders the settings field for generating all fallback image sizes. * - * @since n.e.x.t + * @since 2.4.0 */ function webp_uploads_generate_all_fallback_sizes_callback(): void { $all_fallback_sizes_enabled = webp_uploads_should_generate_all_fallback_sizes();