From 08d517644060273cc6b0ab0dab23b602b7e90612 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Mon, 18 Jul 2022 13:57:18 +0200 Subject: [PATCH 1/4] Update version to 1.3.0. --- load.php | 10 +++++----- modules/images/dominant-color/load.php | 6 +++--- modules/images/webp-uploads/can-load.php | 2 +- modules/images/webp-uploads/helper.php | 6 +++--- modules/images/webp-uploads/load.php | 8 ++++---- readme.txt | 2 +- .../demo-modules/images/demo-module-3/can-load.php | 1 - .../demo-modules/javascript/demo-module-1/can-load.php | 1 - 8 files changed, 17 insertions(+), 19 deletions(-) diff --git a/load.php b/load.php index 10ba39313a..17d16e998b 100644 --- a/load.php +++ b/load.php @@ -5,7 +5,7 @@ * Description: Performance plugin from the WordPress Performance Group, which is a collection of standalone performance modules. * Requires at least: 5.8 * Requires PHP: 5.6 - * Version: 1.2.0 + * Version: 1.3.0 * Author: WordPress Performance Group * Author URI: https://make.wordpress.org/core/tag/performance/ * License: GPLv2 or later @@ -15,7 +15,7 @@ * @package performance-lab */ -define( 'PERFLAB_VERSION', '1.2.0' ); +define( 'PERFLAB_VERSION', '1.3.0' ); define( 'PERFLAB_MAIN_FILE', __FILE__ ); define( 'PERFLAB_MODULES_SETTING', 'perflab_modules_settings' ); define( 'PERFLAB_MODULES_SCREEN', 'perflab-modules' ); @@ -140,7 +140,7 @@ function( $module_settings ) { /** * Gets the active and valid performance modules. * - * @since n.e.x.t + * @since 1.3.0 * * @param string $module Slug of the module. * @return bool True if the module is active and valid, otherwise false. @@ -195,7 +195,7 @@ function perflab_render_generator() { /** * Checks whether the given module can be loaded in the current environment. * - * @since n.e.x.t + * @since 1.3.0 * * @param string $module Slug of the module. * @return bool Whether the module can be loaded or not. @@ -224,7 +224,7 @@ function perflab_can_load_module( $module ) { * Loads the active and valid performance modules. * * @since 1.0.0 - * @since n.e.x.t Renamed to perflab_load_active_and_valid_modules(). + * @since 1.3.0 Renamed to perflab_load_active_and_valid_modules(). */ function perflab_load_active_and_valid_modules() { $active_and_valid_modules = array_filter( perflab_get_active_modules(), 'perflab_is_valid_module' ); diff --git a/modules/images/dominant-color/load.php b/modules/images/dominant-color/load.php index d97ff439c4..eb8ccc6fd3 100644 --- a/modules/images/dominant-color/load.php +++ b/modules/images/dominant-color/load.php @@ -339,7 +339,7 @@ function wp_get_attachment_file_path( $attachment_id, $size = 'medium' ) { /** * Gets the dominant color for an image attachment. * - * @since n.e.x.t + * @since 1.3.0 * * @param int $attachment_id Attachment ID for image. * @return string|null Hex value of dominant color or null if not set. @@ -363,7 +363,7 @@ function dominant_color_get_dominant_color( $attachment_id ) { /** * Returns whether an image attachment has transparency. * - * @since n.e.x.t + * @since 1.3.0 * * @param int $attachment_id Attachment ID for image. * @return bool|null Whether the image has transparency, or null if not set. @@ -385,7 +385,7 @@ function dominant_color_has_transparency( $attachment_id ) { /** * Gets hex color from RGB. * - * @since n.e.x.t + * @since 1.3.0 * * @param int $red Red 0-255. * @param int $green Green 0-255. diff --git a/modules/images/webp-uploads/can-load.php b/modules/images/webp-uploads/can-load.php index 9d5ef03b67..878c2da53d 100644 --- a/modules/images/webp-uploads/can-load.php +++ b/modules/images/webp-uploads/can-load.php @@ -2,7 +2,7 @@ /** * Can load function to determine if WebP Uploads module is already merged in WordPress core. * - * @since n.e.x.t + * @since 1.3.0 * @package performance-lab */ diff --git a/modules/images/webp-uploads/helper.php b/modules/images/webp-uploads/helper.php index af5c82068c..4d98c1a9c7 100644 --- a/modules/images/webp-uploads/helper.php +++ b/modules/images/webp-uploads/helper.php @@ -244,7 +244,7 @@ function webp_uploads_get_attachment_sources( $attachment_id, $size = 'thumbnail /** * Verifies if the request is for a frontend context within the tag. * - * @since n.e.x.t + * @since 1.3.0 * * @return bool True if in the within a frontend request, false otherwise. */ @@ -267,7 +267,7 @@ function webp_uploads_in_frontend_body() { /** * Check whether the additional image is larger than the original image. * - * @since n.e.x.t + * @since 1.3.0 * * @param array $original An array with the metadata of the attachment. * @param array $additional An array containing the filename and file size for additional mime. @@ -283,7 +283,7 @@ function webp_uploads_should_discard_additional_image_file( array $original, arr * By default the performance lab plugin will use the mime type with the smaller filesize * rather than defaulting to `webp`. * - * @since n.e.x.t + * @since 1.3.0 * * @param bool $preferred_filesize Prioritize file size over mime type. Default true. */ diff --git a/modules/images/webp-uploads/load.php b/modules/images/webp-uploads/load.php index f931f84a58..7c4e57d523 100644 --- a/modules/images/webp-uploads/load.php +++ b/modules/images/webp-uploads/load.php @@ -497,7 +497,7 @@ function webp_uploads_update_image_references( $content ) { * for the specified image sizes, the *.webp references are stored inside of each size. * * @since 1.0.0 - * @since n.e.x.t Remove `webp_uploads_prefer_smaller_image_file` filter + * @since 1.3.0 Remove `webp_uploads_prefer_smaller_image_file` filter * * @param string $original_image An tag where the urls would be updated. * @param string $context The context where this is function is being used. @@ -641,7 +641,7 @@ function webp_uploads_update_featured_image( $html, $post_id, $attachment_id ) { /** * Adds a fallback mechanism to replace webp images with jpeg alternatives on older browsers. * - * @since n.e.x.t + * @since 1.3.0 */ function webp_uploads_wepb_fallback() { // Get mime type transofrms for the site. @@ -691,7 +691,7 @@ function webp_uploads_wepb_fallback() { * Developers can control the generation of additional mime images for all sizes using the * webp_uploads_image_sizes_with_additional_mime_type_support filter. * - * @since n.e.x.t + * @since 1.3.0 * * @return array An array of image sizes that can have additional mime types. */ @@ -712,7 +712,7 @@ function webp_uploads_get_image_sizes_additional_mime_type_support() { /** * Filters whether additional mime types are allowed for image sizes. * - * @since n.e.x.t + * @since 1.3.0 * * @param array $allowed_sizes A map of image size names and whether they are allowed to have additional mime types. */ diff --git a/readme.txt b/readme.txt index 95f3293f8d..738b8facfa 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Contributors: wordpressdotorg Requires at least: 5.8 Tested up to: 6.0 Requires PHP: 5.6 -Stable tag: 1.2.0 +Stable tag: 1.3.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: performance, images, javascript, site health, measurement, object caching diff --git a/tests/testdata/demo-modules/images/demo-module-3/can-load.php b/tests/testdata/demo-modules/images/demo-module-3/can-load.php index a8aabaf890..753fca63ba 100644 --- a/tests/testdata/demo-modules/images/demo-module-3/can-load.php +++ b/tests/testdata/demo-modules/images/demo-module-3/can-load.php @@ -2,7 +2,6 @@ /** * Can load function to determine if module already marge in WordPress core. * - * @since n.e.x.t * @package performance-lab */ diff --git a/tests/testdata/demo-modules/javascript/demo-module-1/can-load.php b/tests/testdata/demo-modules/javascript/demo-module-1/can-load.php index 16a702c300..aa2a0607d3 100644 --- a/tests/testdata/demo-modules/javascript/demo-module-1/can-load.php +++ b/tests/testdata/demo-modules/javascript/demo-module-1/can-load.php @@ -2,7 +2,6 @@ /** * Can load function to determine if module already marge in WordPress core. * - * @since n.e.x.t * @package performance-lab */ From 6b9cc95a7d9022ddfbe128de3165c70f8b628601 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Mon, 18 Jul 2022 13:57:44 +0200 Subject: [PATCH 2/4] Update the modules enabled by default, now including Dominant Color. --- default-enabled-modules.php | 1 + 1 file changed, 1 insertion(+) diff --git a/default-enabled-modules.php b/default-enabled-modules.php index 0b3ae31c02..8199c05260 100644 --- a/default-enabled-modules.php +++ b/default-enabled-modules.php @@ -1,6 +1,7 @@ Date: Mon, 18 Jul 2022 13:58:18 +0200 Subject: [PATCH 3/4] Update module translations file. --- module-i18n.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module-i18n.php b/module-i18n.php index afb2efbe76..a921efff47 100644 --- a/module-i18n.php +++ b/module-i18n.php @@ -1,10 +1,10 @@ Date: Mon, 18 Jul 2022 14:00:14 +0200 Subject: [PATCH 4/4] Update readme with changelog for 1.3.0. --- readme.txt | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 738b8facfa..254977f175 100644 --- a/readme.txt +++ b/readme.txt @@ -17,8 +17,8 @@ The Performance Lab plugin is a collection of modules focused on enhancing perfo Currently the plugin includes the following performance modules: -* **WebP Uploads:** Creates WebP versions for new JPEG image uploads if supported by the server. * **Dominant Color:** Adds support to store dominant color for an image and create a placeholder background with that color. +* **WebP Uploads:** Creates WebP versions for new JPEG image uploads if supported by the server. * **Audit Full Page Cache:** Adds a check for full page cache in Site Health status. * **WebP Support:** Adds a WebP support check in Site Health status. * **Audit Autoloaded Options:** Adds a check for autoloaded options in Site Health status. @@ -68,6 +68,31 @@ Contributions welcome! There are several ways to contribute: == Changelog == += 1.3.0 = + +**Enhancements** + +* Images: Add replacing of images only in frontend context. ([424](https://github.com/WordPress/performance/pull/424)) +* Images: Allow control for which image sizes to generate additional MIME type versions. ([415](https://github.com/WordPress/performance/pull/415)) +* Images: Discard WebP image if it is larger than corresponding JPEG image. ([418](https://github.com/WordPress/performance/pull/418)) +* Images: Optimize computing dominant color and transparency for images by combining the two functions. ([381](https://github.com/WordPress/performance/pull/381)) +* Images: Provide fallback JPEG images in frontend when WebP is not supported by the browser. ([360](https://github.com/WordPress/performance/pull/360)) +* Images: Rely on `wp_get_image_editor()` methods argument to check whether it supports dominant color methods. ([404](https://github.com/WordPress/performance/pull/404)) +* Images: Remove experimental label from Dominant Color module and turn on by default for new installs. ([425](https://github.com/WordPress/performance/pull/425)) +* Site Health: Remove `perflab_aea_get_resource_file_size()` in favor of `wp_filesize()`. ([380](https://github.com/WordPress/performance/pull/380)) +* Site Health: Update documentation link for autoloaded options. ([408](https://github.com/WordPress/performance/pull/408)) +* Infrastructure: Implement mechanism to not load module if core version is available. ([390](https://github.com/WordPress/performance/pull/390)) + +**Bug Fixes** + +* Images: Ensure incorrect usage of `webp_uploads_upload_image_mime_transforms` filter is treated correctly. ([393](https://github.com/WordPress/performance/pull/393)) +* Images: Fix PHP notice and bug in logic for when `webp_uploads_prefer_smaller_image_file` filter is set to `true`. ([397](https://github.com/WordPress/performance/pull/397)) +* Images: Fix an infinite loop in the WebP fallback mechanism. ([433](https://github.com/WordPress/performance/pull/433)) +* Images: Fix dominant color upload process to not override potential third-party editors. ([401](https://github.com/WordPress/performance/pull/401)) +* Images: Remove additional image backup sources & sizes files when attachment deleted. ([411](https://github.com/WordPress/performance/pull/411)) +* Infrastructure: Avoid including .husky directory in plugin ZIP. ([421](https://github.com/WordPress/performance/pull/421)) +* Infrastructure: Do not show admin pointer in multisite Network Admin. ([394](https://github.com/WordPress/performance/pull/394)) + = 1.2.0 = **Features**