From 5b99b4b1fa4757b06973ef541fa374cd603526c3 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Tue, 29 Sep 2015 22:18:38 -0500 Subject: [PATCH 01/10] Pass height and width to `tevkori_get_sizes()` By passing the height and width information about an image directly to `tevkori_get_sizes()` we can avoid an extra call to `image_downsize()`. --- wp-tevko-responsive-images.php | 45 ++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/wp-tevko-responsive-images.php b/wp-tevko-responsive-images.php index 2915172..31b71d2 100644 --- a/wp-tevko-responsive-images.php +++ b/wp-tevko-responsive-images.php @@ -64,13 +64,20 @@ function tevkori_get_picturefill() { */ function tevkori_get_sizes( $id, $size = 'thumbnail', $args = null ) { - // See which image is being returned and bail if none is found. - if ( ! $img = image_downsize( $id, $size ) ) { + // Try to get the image width from `$args` before calling `image_downsize()`. + if ( is_array( $args ) && ! empty( $args['width'] ) ) { + $img_width = (int) $args['width']; + } elseif ( $img = image_downsize( $id, $size ) ) { + $img_width = $img[1]; + } + + // Bail early if ``$image_width` isn't set. + if ( ! $img_width ) { return false; } - // Get the image width. - $img_width = $img[1] . 'px'; + // Set the image width in pixels. + $img_width = $img_width . 'px'; // Set up our default values. $defaults = array( @@ -348,7 +355,6 @@ function _tevkori_filter_content_images_callback( $image ) { } list( $image_html, $atts ) = $image; - $id = $size = false; // Bail early if a 'srcset' attribute already exists. if ( false !== strpos( $atts, 'srcset=' ) ) { @@ -366,20 +372,16 @@ function _tevkori_filter_content_images_callback( $image ) { } // Grab ID and size info from core classes. - if ( preg_match( '/wp-image-([0-9]+)/i', $atts, $class_id ) ) { - (int) $id = $class_id[1]; - } - if ( preg_match( '/size-([^\s|"]+)/i', $atts, $class_size ) ) { - $size = $class_size[1]; - } + $id = preg_match( '/wp-image-([0-9]+)/i', $atts, $class_id ) ? (int) $class_id[1] : false; + $size = preg_match( '/size-([^\s|"]+)/i', $atts, $class_size ) ? $class_size[1] : false; + $width = preg_match( '/ width="([0-9]+)"/', $atts, $atts_width ) ? (int) $atts_width[1] : false; + $height = preg_match( '/ height="([0-9]+)"/', $atts, $atts_height ) ? (int) $atts_height[1] : false; if ( $id && false === $size ) { - if ( preg_match( '/ width="([0-9]+)"/', $atts, $width ) && preg_match( '/ height="([0-9]+)"/', $atts, $height ) ) { - $size = array( - (int) $width[1], - (int) $height[1] - ); - } + $size = array( + $width, + $height + ); } /* @@ -416,7 +418,14 @@ function _tevkori_filter_content_images_callback( $image ) { // If we have an ID and size, try for 'srcset' and 'sizes' and update the markup. if ( $id && $size && $srcset = tevkori_get_srcset_string( $id, $size ) ) { - $sizes = tevkori_get_sizes_string( $id, $size ); + + // Pass height and width to `tevkori_get_sizes_string()`. + $args = array( + 'width' => $width, + 'height' => $height, + ); + + $sizes = tevkori_get_sizes_string( $id, $size, $args ); $image_html = ""; }; From a96d0fc6be77410f99ce96149e8e31479ee150fd Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Tue, 29 Sep 2015 22:46:37 -0500 Subject: [PATCH 02/10] Improve regex in display filter. Use `preg_quote()` to slash strings before passing them to our callbacks. Simplify the matching pattern used to find images in the post content and move the handling of traling slashes into the callback function. --- wp-tevko-responsive-images.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wp-tevko-responsive-images.php b/wp-tevko-responsive-images.php index 31b71d2..121af47 100644 --- a/wp-tevko-responsive-images.php +++ b/wp-tevko-responsive-images.php @@ -301,7 +301,9 @@ function tevkori_filter_content_images( $content ) { $uploads_dir = wp_upload_dir(); $path_to_upload_dir = $uploads_dir['baseurl']; - preg_match_all( '|]+' . $path_to_upload_dir . '[^>]+)[\s?][\/?]>|i', $content, $matches ); + // Pattern for matching all images with a `src` from the uploads directory. + $pattern = '|]+' . preg_quote( $path_to_upload_dir ) . '[^>]+)>|i'; + preg_match_all( $pattern, $content, $matches ); $images = $matches[0]; $ids = array(); @@ -334,7 +336,7 @@ function tevkori_filter_content_images( $content ) { } $content = preg_replace_callback( - '|]+' . $path_to_upload_dir . '[^>]+)[\s?][\/?]>|i', + $pattern, '_tevkori_filter_content_images_callback', $content ); @@ -426,6 +428,10 @@ function _tevkori_filter_content_images_callback( $image ) { ); $sizes = tevkori_get_sizes_string( $id, $size, $args ); + + // Strip trailing slashes and whitespaces from the `$atts` string. + $atts = trim( rtrim( $atts, '/' ) ); + $image_html = ""; }; From a8efdb5f08dbdb5d339823ae2914628b224484bb Mon Sep 17 00:00:00 2001 From: Jasper de Groot Date: Wed, 30 Sep 2015 11:04:01 +0200 Subject: [PATCH 03/10] Coding standards --- wp-tevko-responsive-images.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/wp-tevko-responsive-images.php b/wp-tevko-responsive-images.php index 2915172..58ee83d 100644 --- a/wp-tevko-responsive-images.php +++ b/wp-tevko-responsive-images.php @@ -302,14 +302,14 @@ function tevkori_filter_content_images( $content ) { foreach( $images as $image ) { if ( preg_match( '/wp-image-([0-9]+)/i', $image, $class_id ) ) { (int) $id = $class_id[1]; - if( $id ) { + if ( $id ) { $ids[] = $id; } } } if ( 0 < count( $ids ) ) { - /** + /* * Warm object caches for use with wp_get_attachment_metadata. * * To avoid making a database call for each image, WP_Query is called @@ -317,13 +317,13 @@ function tevkori_filter_content_images( $content ) { * the object cache with the meta information for all images. * * This loop is not used directly. - **/ - $attachments = new WP_Query(array( - 'post_type' => 'attachment', + */ + $attachments = new WP_Query( array( + 'post_type' => 'attachment', 'posts_per_page' => '-1', - 'post_status' => 'inherit', - 'post__in' => $ids, - )); + 'post_status' => 'inherit', + 'post__in' => $ids, + ) ); } $content = preg_replace_callback( @@ -384,13 +384,13 @@ function _tevkori_filter_content_images_callback( $image ) { /* * If attempts to parse the size value failed, attempt to use the image - * metadata to match the `src` angainst the available sizes for an attachment. + * metadata to match the 'src' angainst the available sizes for an attachment. */ if ( ! $size && ! empty( $id ) && $meta = wp_get_attachment_metadata( $id ) ) { preg_match( '/src="([^"]+)"/', $atts, $url ); - // Sanity check the `src` value and bail early it doesn't exist. + // Sanity check the 'src' value and bail early it doesn't exist. if ( ! $url[1] ) { return $image_html; } From c3057fb90c518aeef4c1ed248a93a22c1193ebf7 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Thu, 1 Oct 2015 22:26:44 -0500 Subject: [PATCH 04/10] Avoid calling `wp_get_attachment_image_src()` in srcset functions. Improve the performance of `tevkori_get_srcset_array()` by removing the call to `wp_get_attachment_image_src()` and use `image_get_intermediate_size()` in combination with data we already get in the attachment post_meta to produce a srcset value. This also gets around edge cases where the height and width attributes were being filtered in `image_downsize()`. Updates tests. --- tests/test-suite.php | 29 +++++++++++++++++++++++++---- wp-tevko-responsive-images.php | 34 +++++++++++++++++++--------------- 2 files changed, 44 insertions(+), 19 deletions(-) diff --git a/tests/test-suite.php b/tests/test-suite.php index 7821a01..b756f86 100644 --- a/tests/test-suite.php +++ b/tests/test-suite.php @@ -198,6 +198,25 @@ function test_tevkori_get_srcset_array() { $this->assertSame( $expected, $sizes ); } + function test_tevkori_get_srcset_array_random_size_name() { + // make an image + $id = $this->_test_img(); + $sizes = tevkori_get_srcset_array( $id, 'foo' ); + + $year_month = date('Y/m'); + $image = wp_get_attachment_metadata( $id ); + + $expected = array( + $image['sizes']['medium']['width'] => 'http://example.org/wp-content/uploads/' . $year_month = date('Y/m') . '/' + . $image['sizes']['medium']['file'] . ' ' . $image['sizes']['medium']['width'] . 'w', + $image['sizes']['large']['width'] => 'http://example.org/wp-content/uploads/' . $year_month = date('Y/m') . '/' + . $image['sizes']['large']['file'] . ' ' . $image['sizes']['large']['width'] . 'w', + $image['width'] => 'http://example.org/wp-content/uploads/' . $image['file'] . ' ' . $image['width'] .'w' + ); + + $this->assertSame( $expected, $sizes ); + } + function test_tevkori_get_srcset_array_no_date_upoads() { // Save the current setting for uploads folders $uploads_use_yearmonth_folders = get_option( 'uploads_use_yearmonth_folders' ); @@ -280,7 +299,7 @@ function test_tevkori_get_srcset_array_false() { function test_tevkori_get_srcset_array_no_width() { // Filter image_downsize() output. - add_filter( 'image_downsize', array( $this, '_test_tevkori_get_srcset_array_no_width_filter' ) ); + add_filter( 'wp_generate_attachment_metadata', array( $this, '_test_tevkori_get_srcset_array_no_width_filter' ) ); // Make our attachement. $id = $this->_test_img(); @@ -290,14 +309,16 @@ function test_tevkori_get_srcset_array_no_width() { $this->assertFalse( $srcset ); // Remove filter. - remove_filter( 'image_downsize', array( $this, '_test_tevkori_get_srcset_array_no_width_filter' ) ); + remove_filter( 'wp_generate_attachment_metadata', array( $this, '_test_tevkori_get_srcset_array_no_width_filter' ) ); } /** * Helper funtion to filter image_downsize and return zero values for width and height. */ - public function _test_tevkori_get_srcset_array_no_width_filter() { - return array( 'http://example.org/foo.jpg', 0, 0, false ); + public function _test_tevkori_get_srcset_array_no_width_filter( $meta ) { + $meta['sizes']['medium']['width'] = 0; + $meta['sizes']['medium']['height'] = 0; + return $meta; } function test_tevkori_get_srcset_string() { diff --git a/wp-tevko-responsive-images.php b/wp-tevko-responsive-images.php index 121af47..3b6ee69 100644 --- a/wp-tevko-responsive-images.php +++ b/wp-tevko-responsive-images.php @@ -179,32 +179,36 @@ function tevkori_get_sizes_string( $id, $size = 'thumbnail', $args = null ) { function tevkori_get_srcset_array( $id, $size = 'thumbnail' ) { $arr = array(); - // See which image is being returned and bail if none is found. - if ( ! $img = wp_get_attachment_image_src( $id, $size ) ) { - return false; - } + // Get the intermediate size. + $image = image_get_intermediate_size( $id, $size ); + // Get the post meta. + $img_meta = wp_get_attachment_metadata( $id ); - // Break image data into url, width, and height. - list( $img_url, $img_width, $img_height ) = $img; + // Extract the height and width from the intermediate or the full size. + $img_width = ( $image ) ? $image['width'] : $img_meta['width']; + $img_height = ( $image ) ? $image['height'] : $img_meta['height']; - // If we have no width to work with, we should bail (see issue #118). - if ( 0 == $img_width ) { + // Bail early if the width isn't greater that zero. + if ( ! $img_width > 0 ) { return false; } - // Get the image meta data and bail if none is found. - if ( ! is_array( $img_meta = wp_get_attachment_metadata( $id ) ) ) { - return false; + // Use the url from the intermediate size or build the url from the metadata. + if ( ! empty( $image['url'] ) ) { + $img_url = $image['url']; + } else { + $uploads_dir = wp_upload_dir(); + $img_file = ( $image ) ? path_join( dirname( $img_meta['file'] ) , $image['file'] ) : $img_meta['file']; + $img_url = $uploads_dir['baseurl'] . '/' . $img_file; } - // Build an array with image sizes. $img_sizes = $img_meta['sizes']; // Add full size to the img_sizes array. $img_sizes['full'] = array( 'width' => $img_meta['width'], 'height' => $img_meta['height'], - 'file' => basename( $img_meta['file'] ) + 'file' => wp_basename( $img_meta['file'] ) ); // Calculate the image aspect ratio. @@ -212,8 +216,8 @@ function tevkori_get_srcset_array( $id, $size = 'thumbnail' ) { /* * Images that have been edited in WordPress after being uploaded will - * contain a unique hash. We look for that hash and use it later to filter - * out images that are leftovers from previous renditions. + * contain a unique hash. Look for that hash and use it later to filter + * out images that are leftovers from previous versions. */ $img_edited = preg_match( '/-e[0-9]{13}/', $img_url, $img_edit_hash ); From 478956af3918cea151185f33702d8e02e6733272 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 2 Oct 2015 12:14:00 +1000 Subject: [PATCH 05/10] Remove second regular expression in content filter preg_match_all returns the string being replaced, it can be used with a simple str_replace in the second instance. --- wp-tevko-responsive-images.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wp-tevko-responsive-images.php b/wp-tevko-responsive-images.php index 90c14b4..79cf679 100644 --- a/wp-tevko-responsive-images.php +++ b/wp-tevko-responsive-images.php @@ -339,11 +339,15 @@ function tevkori_filter_content_images( $content ) { ) ); } - $content = preg_replace_callback( - $pattern, - '_tevkori_filter_content_images_callback', - $content - ); + foreach( $matches[0] as $k => $image ) { + $match = array( $image, $matches[1][$k] ); + $needle = $image; + $replacement = _tevkori_filter_content_images_callback( $match ); + if ( false === $replacement ) { + continue; + } + $content = str_replace( $image, $replacement, $content ); + } return $content; } From 9355133c070592fca1eecfa3c113923a8268fb5e Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 2 Oct 2015 12:22:21 +1000 Subject: [PATCH 06/10] Use correct cache warming function makes use of update_postmeta_cache resolves gh-197 --- wp-tevko-responsive-images.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/wp-tevko-responsive-images.php b/wp-tevko-responsive-images.php index 79cf679..d129351 100644 --- a/wp-tevko-responsive-images.php +++ b/wp-tevko-responsive-images.php @@ -325,18 +325,10 @@ function tevkori_filter_content_images( $content ) { /* * Warm object caches for use with wp_get_attachment_metadata. * - * To avoid making a database call for each image, WP_Query is called - * as a single query with the IDs of all images in the post. This warms - * the object cache with the meta information for all images. - * - * This loop is not used directly. - */ - $attachments = new WP_Query( array( - 'post_type' => 'attachment', - 'posts_per_page' => '-1', - 'post_status' => 'inherit', - 'post__in' => $ids, - ) ); + * To avoid making a database call for each image, a single query + * warms the object cache with the meta information for all images. + **/ + update_postmeta_cache( $ids ); } foreach( $matches[0] as $k => $image ) { From a1a6e84979301c03b8385c4a4cebcf5818cad085 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 2 Oct 2015 14:41:33 +1000 Subject: [PATCH 07/10] Prime post cache for attachements cache warming requires post data in addition to meta data. --- wp-tevko-responsive-images.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-tevko-responsive-images.php b/wp-tevko-responsive-images.php index d129351..7fb906a 100644 --- a/wp-tevko-responsive-images.php +++ b/wp-tevko-responsive-images.php @@ -328,7 +328,7 @@ function tevkori_filter_content_images( $content ) { * To avoid making a database call for each image, a single query * warms the object cache with the meta information for all images. **/ - update_postmeta_cache( $ids ); + _prime_post_caches( $ids, false, true ); } foreach( $matches[0] as $k => $image ) { From 2c4614bf0421470a1cf4297b7b00f01c86c10474 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Fri, 2 Oct 2015 16:09:21 -0500 Subject: [PATCH 08/10] Change default `$size` value for all function to 'medium' Several of our internal function are using 'thumbnail' as the default value for `$size`. Since the 'thumbnail' size is usually a hard crop and is less likely to result in a `srcset` list, it makes sense to switch that default to use 'medium' instead. Resolves #192 --- wp-tevko-responsive-images.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-tevko-responsive-images.php b/wp-tevko-responsive-images.php index 7fb906a..2dfaf76 100644 --- a/wp-tevko-responsive-images.php +++ b/wp-tevko-responsive-images.php @@ -62,7 +62,7 @@ function tevkori_get_picturefill() { * } * @return string|bool A valid source size value for use in a 'sizes' attribute or false. */ -function tevkori_get_sizes( $id, $size = 'thumbnail', $args = null ) { +function tevkori_get_sizes( $id, $size = 'medium', $args = null ) { // Try to get the image width from `$args` before calling `image_downsize()`. if ( is_array( $args ) && ! empty( $args['width'] ) ) { @@ -163,7 +163,7 @@ function tevkori_get_sizes( $id, $size = 'thumbnail', $args = null ) { * } * @return string|bool A valid source size list as a 'sizes' attribute or false. */ -function tevkori_get_sizes_string( $id, $size = 'thumbnail', $args = null ) { +function tevkori_get_sizes_string( $id, $size = 'medium', $args = null ) { $sizes = tevkori_get_sizes( $id, $size, $args ); return $sizes ? 'sizes="' . $sizes . '"' : false; @@ -176,7 +176,7 @@ function tevkori_get_sizes_string( $id, $size = 'thumbnail', $args = null ) { * @param string $size Optional. Name of image size. Default value: 'thumbnail'. * @return array|bool An array of of srcset values or false. */ -function tevkori_get_srcset_array( $id, $size = 'thumbnail' ) { +function tevkori_get_srcset_array( $id, $size = 'medium' ) { $arr = array(); // Get the intermediate size. @@ -262,7 +262,7 @@ function tevkori_get_srcset_array( $id, $size = 'thumbnail' ) { * @param string $size Optional. Name of image size. Default value: 'thumbnail'. * @return string|bool A 'srcset' value string or false. */ -function tevkori_get_srcset( $id, $size = 'thumbnail' ) { +function tevkori_get_srcset( $id, $size = 'medium' ) { $srcset_array = tevkori_get_srcset_array( $id, $size ); if ( count( $srcset_array ) <= 1 ) { @@ -281,7 +281,7 @@ function tevkori_get_srcset( $id, $size = 'thumbnail' ) { * @param string $size Optional. Name of image size. Default value: 'thumbnail'. * @return string|bool A full 'srcset' string or false. */ -function tevkori_get_srcset_string( $id, $size = 'thumbnail' ) { +function tevkori_get_srcset_string( $id, $size = 'medium' ) { $srcset_value = tevkori_get_srcset( $id, $size ); if ( empty( $srcset_value ) ) { From 3d40928b25902fc62c60d41d37bf7d6ab913cf7c Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Fri, 2 Oct 2015 16:44:01 -0500 Subject: [PATCH 09/10] Update inline docs for 2.5.2 --- wp-tevko-responsive-images.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/wp-tevko-responsive-images.php b/wp-tevko-responsive-images.php index 2dfaf76..7c22528 100644 --- a/wp-tevko-responsive-images.php +++ b/wp-tevko-responsive-images.php @@ -54,11 +54,12 @@ function tevkori_get_picturefill() { * @since 2.2.0 * * @param int $id Image attachment ID. - * @param string $size Optional. Name of image size. Default value: 'thumbnail'. + * @param string $size Optional. Name of image size. Default value: 'medium'. * @param array $args { * Optional. Arguments to retrieve posts. * * @type array|string $sizes An array or string containing of size information. + * @type int $width A single width value used in the default `sizes` string. * } * @return string|bool A valid source size value for use in a 'sizes' attribute or false. */ @@ -155,11 +156,12 @@ function tevkori_get_sizes( $id, $size = 'medium', $args = null ) { * @since 2.2.0 * * @param int $id Image attachment ID. - * @param string $size Optional. Name of image size. Default value: 'thumbnail'. + * @param string $size Optional. Name of image size. Default value: 'medium'. * @param array $args { * Optional. Arguments to retrieve posts. * * @type array|string $sizes An array or string containing of size information. + * @type int $width A single width value used in the default `sizes` string. * } * @return string|bool A valid source size list as a 'sizes' attribute or false. */ @@ -173,7 +175,7 @@ function tevkori_get_sizes_string( $id, $size = 'medium', $args = null ) { * Get an array of image sources candidates for use in a 'srcset' attribute. * * @param int $id Image attachment ID. - * @param string $size Optional. Name of image size. Default value: 'thumbnail'. + * @param string $size Optional. Name of image size. Default value: 'medium'. * @return array|bool An array of of srcset values or false. */ function tevkori_get_srcset_array( $id, $size = 'medium' ) { @@ -259,7 +261,7 @@ function tevkori_get_srcset_array( $id, $size = 'medium' ) { * @since 2.3.0 * * @param int $id Image attachment ID. - * @param string $size Optional. Name of image size. Default value: 'thumbnail'. + * @param string $size Optional. Name of image size. Default value: 'medium'. * @return string|bool A 'srcset' value string or false. */ function tevkori_get_srcset( $id, $size = 'medium' ) { @@ -278,7 +280,7 @@ function tevkori_get_srcset( $id, $size = 'medium' ) { * @since 2.1.0 * * @param int $id Image attachment ID. - * @param string $size Optional. Name of image size. Default value: 'thumbnail'. + * @param string $size Optional. Name of image size. Default value: 'medium'. * @return string|bool A full 'srcset' string or false. */ function tevkori_get_srcset_string( $id, $size = 'medium' ) { From 1643e632f9a7934ceecb522f02a1a06272b5668e Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 2 Oct 2015 20:47:58 -0400 Subject: [PATCH 10/10] updating version numbers and changelogs --- readme.md | 13 ++++++++++++- readme.txt | 12 +++++++++++- wp-tevko-responsive-images.php | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 80a2ff9..c91a780 100644 --- a/readme.md +++ b/readme.md @@ -140,10 +140,21 @@ We use a hook because if you attempt to dequeue a script before it's enqueued, w ## Version -2.5.1 +2.5.2 ## Changelog +- Numerous performance and usability improvements +- Pass height and width to `tevkori_get_sizes() +- Improved regex in display filter +- Avoid calling `wp_get_attachment_image_src()` in srcset functions +- Improved coding standards +- Removed second regular expression in content filter +- Improved cache warning function +- Change default `$size` value for all function to 'medium' + +**2.5.1** + - Query all images in single request before replacing - Minor fix to prevent a potential undefined variable notice - Remove third fallback query from the display filter diff --git a/readme.txt b/readme.txt index 9b62fb9..b247914 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://app.etapestry.com/hosted/BoweryResidentsCommittee/OnlineDon Tags: Responsive, Images, Responsive Images, SRCSET, Picturefill Requires at least: 4.1 Tested up to: 4.3 -Stable tag: 2.5.1 +Stable tag: 2.5.2 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.txt @@ -26,6 +26,16 @@ This plugin works by including all available image sizes for each image upload. == Changelog == += 2.5.2 = +* Numerous performance and usability improvements +* Pass height and width to `tevkori_get_sizes() +* Improved regex in display filter +* Avoid calling `wp_get_attachment_image_src()` in srcset functions +* Improved coding standards +* Removed second regular expression in content filter +* Improved cache warning function +* Change default `$size` value for all function to 'medium' + = 2.5.1 = * Query all images in single request before replacing * Minor fix to prevent a potential undefined variable notice diff --git a/wp-tevko-responsive-images.php b/wp-tevko-responsive-images.php index 7c22528..e0bf345 100644 --- a/wp-tevko-responsive-images.php +++ b/wp-tevko-responsive-images.php @@ -8,7 +8,7 @@ * Plugin Name: RICG Responsive Images * Plugin URI: http://www.smashingmagazine.com/2015/02/24/ricg-responsive-images-for-wordpress/ * Description: Bringing automatic default responsive images to wordpress - * Version: 2.5.1 + * Version: 2.5.2 * Author: The RICG * Author URI: http://responsiveimages.org/ * License: GPL-2.0+