diff --git a/README.md b/README.md index 7814e9c..4932186 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,10 @@ There is an optional third argument, you can use to specify the format. The avai ## Changelog +### 0.7.0 + +* Added a fallback for images without `wp-image-*` classes. The plugin can now determine the attachment ID from the image URL, using `attachment_url_to_postid`. This should add support for plugins like WooCommerce, who don't output their images with `wp-image-*` classes. Thanks, [@ecksite](https://github.com/Lorti/dominant-colors-lazy-loading-wordpress-plugin/pull/21)! + ### 0.6.3 * The first user interaction triggers a viewport check, that means the first `keydown`, `mousedown`, `mousemove` or `touchstart` event. Each `scroll` and `resize` events still triggers a viewport check. diff --git a/README.txt b/README.txt index 1cc0661..41e6c43 100755 --- a/README.txt +++ b/README.txt @@ -3,8 +3,8 @@ Contributors: manuelwieser Donate link: https://manu.ninja/ Tags: images, dominant colors, lazy loading, pinterest, javascript, optimization, performance, bandwidth Requires at least: 4.4 -Tested up to: 4.9 -Stable tag: 0.6.3 +Tested up to: 4.9.8 +Stable tag: 0.7.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -68,6 +68,10 @@ There is an optional third argument, you can use to specify the format. The avai ## Changelog +### 0.7.0 + +* Added a fallback for images without `wp-image-*` classes. The plugin can now determine the attachment ID from the image URL, using `attachment_url_to_postid`. This should add support for plugins like WooCommerce, who don't output their images with `wp-image-*` classes. Thanks, [@ecksite](https://github.com/Lorti/dominant-colors-lazy-loading-wordpress-plugin/pull/21)! + ### 0.6.3 * The first user interaction triggers a viewport check, that means the first `keydown`, `mousedown`, `mousemove` or `touchstart` event. Each `scroll` and `resize` events still triggers a viewport check. diff --git a/dominant-colors-lazy-loading.php b/dominant-colors-lazy-loading.php index 931e1ad..a28834d 100755 --- a/dominant-colors-lazy-loading.php +++ b/dominant-colors-lazy-loading.php @@ -17,7 +17,7 @@ * Plugin Name: Dominant Colors Lazy Loading * Plugin URI: https://manu.ninja/dominant-colors-for-lazy-loading-images * Description: This plugin allows you to lazy load your images while showing the dominant color of each image as a placeholder – like Pinterest or Google Images. - * Version: 0.6.3 + * Version: 0.7.0 * Author: Manuel Wieser * Author URI: https://manu.ninja/ * License: GPL-2.0+ diff --git a/includes/class-dominant-colors-lazy-loading.php b/includes/class-dominant-colors-lazy-loading.php index c2d2f91..429a919 100755 --- a/includes/class-dominant-colors-lazy-loading.php +++ b/includes/class-dominant-colors-lazy-loading.php @@ -76,7 +76,7 @@ class Dominant_Colors_Lazy_Loading { public function __construct() { $this->plugin_name = 'dominant-colors-lazy-loading'; - $this->version = '0.6.3'; + $this->version = '0.7.0'; $this->load_dependencies(); $this->set_locale(); diff --git a/public/class-dominant-colors-lazy-loading-public.php b/public/class-dominant-colors-lazy-loading-public.php index fad16f7..c46fff2 100755 --- a/public/class-dominant-colors-lazy-loading-public.php +++ b/public/class-dominant-colors-lazy-loading-public.php @@ -141,7 +141,7 @@ public function filter( $content ) { } else { $image_parts = array(); - //delete size from src-string (i.e. delete "-300x300") + // Delete size from URL (`-300x300`) preg_match( '/(.*)-(?!.*\1)([0-9]+x[0-9]+)(\..*)($|\n)/', $image_src[1], $image_parts ); $clean_src = $image_src[1]; if ( isset( $image_parts[1] ) && isset( $image_parts[3] ) ) {