Version Description
- Enhancement: add a way to customize the lazyload script options
- Bugfix: Prevent error on Internet Explorer 11
- Bugfix: Prevent conflict with WooCommerce variation swatches
- Bugfix: Prevent empty
srcwhen the image is an inline base64 - Bugfix: Prevent issue when the original
srcattribute uses single quotes
Download this release
Release Info
| Developer | wp_media |
| Plugin | |
| Version | 2.2.1 |
| Comparing to | |
| See all releases | |
Code changes from version 2.2.2 to 2.2.1
composer.lock
CHANGED
|
@@ -273,16 +273,16 @@
|
|
| 273 |
},
|
| 274 |
{
|
| 275 |
"name": "wp-media/rocket-lazyload-common",
|
| 276 |
-
"version": "v2.3.
|
| 277 |
"source": {
|
| 278 |
"type": "git",
|
| 279 |
"url": "https://github.com/wp-media/rocket-lazyload-common.git",
|
| 280 |
-
"reference": "
|
| 281 |
},
|
| 282 |
"dist": {
|
| 283 |
"type": "zip",
|
| 284 |
-
"url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/
|
| 285 |
-
"reference": "
|
| 286 |
"shasum": ""
|
| 287 |
},
|
| 288 |
"require": {
|
|
@@ -317,7 +317,7 @@
|
|
| 317 |
}
|
| 318 |
],
|
| 319 |
"description": "Common Code between WP Rocket and Lazyload by WP Rocket",
|
| 320 |
-
"time": "2019-
|
| 321 |
}
|
| 322 |
],
|
| 323 |
"packages-dev": [
|
|
@@ -923,16 +923,16 @@
|
|
| 923 |
},
|
| 924 |
{
|
| 925 |
"name": "phpdocumentor/reflection-docblock",
|
| 926 |
-
"version": "4.3.
|
| 927 |
"source": {
|
| 928 |
"type": "git",
|
| 929 |
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
|
| 930 |
-
"reference": "
|
| 931 |
},
|
| 932 |
"dist": {
|
| 933 |
"type": "zip",
|
| 934 |
-
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/
|
| 935 |
-
"reference": "
|
| 936 |
"shasum": ""
|
| 937 |
},
|
| 938 |
"require": {
|
|
@@ -970,7 +970,7 @@
|
|
| 970 |
}
|
| 971 |
],
|
| 972 |
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
|
| 973 |
-
"time": "
|
| 974 |
},
|
| 975 |
{
|
| 976 |
"name": "phpdocumentor/type-resolver",
|
|
@@ -2097,7 +2097,7 @@
|
|
| 2097 |
},
|
| 2098 |
{
|
| 2099 |
"name": "symfony/yaml",
|
| 2100 |
-
"version": "v4.2.
|
| 2101 |
"source": {
|
| 2102 |
"type": "git",
|
| 2103 |
"url": "https://github.com/symfony/yaml.git",
|
| 273 |
},
|
| 274 |
{
|
| 275 |
"name": "wp-media/rocket-lazyload-common",
|
| 276 |
+
"version": "v2.3.3",
|
| 277 |
"source": {
|
| 278 |
"type": "git",
|
| 279 |
"url": "https://github.com/wp-media/rocket-lazyload-common.git",
|
| 280 |
+
"reference": "761a50eab8fe125716c52409c213fcba9af64b59"
|
| 281 |
},
|
| 282 |
"dist": {
|
| 283 |
"type": "zip",
|
| 284 |
+
"url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/761a50eab8fe125716c52409c213fcba9af64b59",
|
| 285 |
+
"reference": "761a50eab8fe125716c52409c213fcba9af64b59",
|
| 286 |
"shasum": ""
|
| 287 |
},
|
| 288 |
"require": {
|
| 317 |
}
|
| 318 |
],
|
| 319 |
"description": "Common Code between WP Rocket and Lazyload by WP Rocket",
|
| 320 |
+
"time": "2019-04-27T22:08:21+00:00"
|
| 321 |
}
|
| 322 |
],
|
| 323 |
"packages-dev": [
|
| 923 |
},
|
| 924 |
{
|
| 925 |
"name": "phpdocumentor/reflection-docblock",
|
| 926 |
+
"version": "4.3.0",
|
| 927 |
"source": {
|
| 928 |
"type": "git",
|
| 929 |
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
|
| 930 |
+
"reference": "94fd0001232e47129dd3504189fa1c7225010d08"
|
| 931 |
},
|
| 932 |
"dist": {
|
| 933 |
"type": "zip",
|
| 934 |
+
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08",
|
| 935 |
+
"reference": "94fd0001232e47129dd3504189fa1c7225010d08",
|
| 936 |
"shasum": ""
|
| 937 |
},
|
| 938 |
"require": {
|
| 970 |
}
|
| 971 |
],
|
| 972 |
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
|
| 973 |
+
"time": "2017-11-30T07:14:17+00:00"
|
| 974 |
},
|
| 975 |
{
|
| 976 |
"name": "phpdocumentor/type-resolver",
|
| 2097 |
},
|
| 2098 |
{
|
| 2099 |
"name": "symfony/yaml",
|
| 2100 |
+
"version": "v4.2.7",
|
| 2101 |
"source": {
|
| 2102 |
"type": "git",
|
| 2103 |
"url": "https://github.com/symfony/yaml.git",
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Tags: lazyload, lazy load, images, iframes, thumbnail, thumbnails, smiley, smili
|
|
| 4 |
Requires at least: 4.7
|
| 5 |
Tested up to: 5.2
|
| 6 |
Requires PHP: 5.6
|
| 7 |
-
Stable tag: 2.2.
|
| 8 |
|
| 9 |
Lazy Load your images and iframes, replace Youtube videos by a preview thumbnail.
|
| 10 |
|
|
@@ -85,10 +85,6 @@ You can also apply it manually. The element you want to apply lazyload on must h
|
|
| 85 |
The element must have the class `rocket-lazyload`, and a `data-bg` attribute, which value is the CSS url for the image.
|
| 86 |
|
| 87 |
== Changelog ==
|
| 88 |
-
= 2.2.2 =
|
| 89 |
-
* Bugfix: Auto-exclude data-height-percentage attribute to prevent display issues
|
| 90 |
-
* Bugfix: Correctly handle responsive videos using fitVids again
|
| 91 |
-
|
| 92 |
= 2.2.1 =
|
| 93 |
* Enhancement: add a way to customize the lazyload script options
|
| 94 |
* Bugfix: Prevent error on Internet Explorer 11
|
| 4 |
Requires at least: 4.7
|
| 5 |
Tested up to: 5.2
|
| 6 |
Requires PHP: 5.6
|
| 7 |
+
Stable tag: 2.2.1
|
| 8 |
|
| 9 |
Lazy Load your images and iframes, replace Youtube videos by a preview thumbnail.
|
| 10 |
|
| 85 |
The element must have the class `rocket-lazyload`, and a `data-bg` attribute, which value is the CSS url for the image.
|
| 86 |
|
| 87 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
= 2.2.1 =
|
| 89 |
* Enhancement: add a way to customize the lazyload script options
|
| 90 |
* Bugfix: Prevent error on Internet Explorer 11
|
rocket-lazy-load.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
* Plugin Name: Lazy Load by WP Rocket
|
| 4 |
* Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/
|
| 5 |
* Description: The tiny Lazy Load script for WordPress without jQuery or others libraries.
|
| 6 |
-
* Version: 2.2.
|
| 7 |
* Author: WP Rocket
|
| 8 |
* Author URI: https://wp-rocket.me
|
| 9 |
* Text Domain: rocket-lazy-load
|
|
@@ -29,7 +29,7 @@
|
|
| 29 |
|
| 30 |
defined('ABSPATH') || die('Cheatin\' uh?');
|
| 31 |
|
| 32 |
-
define('ROCKET_LL_VERSION', '2.2.
|
| 33 |
define('ROCKET_LL_WP_VERSION', '4.7');
|
| 34 |
define('ROCKET_LL_PHP_VERSION', '5.6');
|
| 35 |
define('ROCKET_LL_BASENAME', plugin_basename(__FILE__));
|
| 3 |
* Plugin Name: Lazy Load by WP Rocket
|
| 4 |
* Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/
|
| 5 |
* Description: The tiny Lazy Load script for WordPress without jQuery or others libraries.
|
| 6 |
+
* Version: 2.2.1
|
| 7 |
* Author: WP Rocket
|
| 8 |
* Author URI: https://wp-rocket.me
|
| 9 |
* Text Domain: rocket-lazy-load
|
| 29 |
|
| 30 |
defined('ABSPATH') || die('Cheatin\' uh?');
|
| 31 |
|
| 32 |
+
define('ROCKET_LL_VERSION', '2.2.1');
|
| 33 |
define('ROCKET_LL_WP_VERSION', '4.7');
|
| 34 |
define('ROCKET_LL_PHP_VERSION', '5.6');
|
| 35 |
define('ROCKET_LL_BASENAME', plugin_basename(__FILE__));
|
src/Subscriber/LazyloadSubscriber.php
CHANGED
|
@@ -7,6 +7,8 @@
|
|
| 7 |
|
| 8 |
namespace RocketLazyLoadPlugin\Subscriber;
|
| 9 |
|
|
|
|
|
|
|
| 10 |
use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
|
| 11 |
use RocketLazyLoadPlugin\Options\OptionArray;
|
| 12 |
use RocketLazyload\Assets;
|
|
@@ -238,8 +240,7 @@ class LazyloadSubscriber implements SubscriberInterface
|
|
| 238 |
|
| 239 |
$this->assets->insertYoutubeThumbnailCSS(
|
| 240 |
[
|
| 241 |
-
'base_url'
|
| 242 |
-
'responsive_embeds' => current_theme_supports('responsive-embeds'),
|
| 243 |
]
|
| 244 |
);
|
| 245 |
}
|
|
@@ -258,8 +259,17 @@ class LazyloadSubscriber implements SubscriberInterface
|
|
| 258 |
return false;
|
| 259 |
}
|
| 260 |
|
| 261 |
-
|
| 262 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 263 |
}
|
| 264 |
|
| 265 |
/**
|
|
@@ -277,32 +287,6 @@ class LazyloadSubscriber implements SubscriberInterface
|
|
| 277 |
return true;
|
| 278 |
}
|
| 279 |
|
| 280 |
-
/**
|
| 281 |
-
* Checks if current page is a page builder editor.
|
| 282 |
-
*
|
| 283 |
-
* @since 2.2.2
|
| 284 |
-
* @author Remy Perona
|
| 285 |
-
*
|
| 286 |
-
* @return bool
|
| 287 |
-
*/
|
| 288 |
-
private function isPageBuilder()
|
| 289 |
-
{
|
| 290 |
-
// Exclude Page Builders editors.
|
| 291 |
-
$excluded_parameters = [
|
| 292 |
-
'fl_builder',
|
| 293 |
-
'et_fb',
|
| 294 |
-
'ct_builder',
|
| 295 |
-
];
|
| 296 |
-
|
| 297 |
-
foreach ($excluded_parameters as $excluded) {
|
| 298 |
-
if (isset($_GET[ $excluded ])) {
|
| 299 |
-
return true;
|
| 300 |
-
}
|
| 301 |
-
}
|
| 302 |
-
|
| 303 |
-
return false;
|
| 304 |
-
}
|
| 305 |
-
|
| 306 |
/**
|
| 307 |
* Gets the content to lazyload
|
| 308 |
*
|
| 7 |
|
| 8 |
namespace RocketLazyLoadPlugin\Subscriber;
|
| 9 |
|
| 10 |
+
defined('ABSPATH') || die('Cheatin\' uh?');
|
| 11 |
+
|
| 12 |
use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
|
| 13 |
use RocketLazyLoadPlugin\Options\OptionArray;
|
| 14 |
use RocketLazyload\Assets;
|
| 240 |
|
| 241 |
$this->assets->insertYoutubeThumbnailCSS(
|
| 242 |
[
|
| 243 |
+
'base_url' => ROCKET_LL_ASSETS_URL,
|
|
|
|
| 244 |
]
|
| 245 |
);
|
| 246 |
}
|
| 259 |
return false;
|
| 260 |
}
|
| 261 |
|
| 262 |
+
// Exclude Page Builders editors.
|
| 263 |
+
$excluded_parameters = [
|
| 264 |
+
'fl_builder',
|
| 265 |
+
'et_fb',
|
| 266 |
+
'ct_builder',
|
| 267 |
+
];
|
| 268 |
+
|
| 269 |
+
foreach ($excluded_parameters as $excluded) {
|
| 270 |
+
if (isset($_GET[ $excluded ])) {
|
| 271 |
+
return false;
|
| 272 |
+
}
|
| 273 |
}
|
| 274 |
|
| 275 |
/**
|
| 287 |
return true;
|
| 288 |
}
|
| 289 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 290 |
/**
|
| 291 |
* Gets the content to lazyload
|
| 292 |
*
|
vendor/composer/installed.json
CHANGED
|
@@ -274,17 +274,17 @@
|
|
| 274 |
},
|
| 275 |
{
|
| 276 |
"name": "wp-media/rocket-lazyload-common",
|
| 277 |
-
"version": "v2.3.
|
| 278 |
-
"version_normalized": "2.3.
|
| 279 |
"source": {
|
| 280 |
"type": "git",
|
| 281 |
"url": "https://github.com/wp-media/rocket-lazyload-common.git",
|
| 282 |
-
"reference": "
|
| 283 |
},
|
| 284 |
"dist": {
|
| 285 |
"type": "zip",
|
| 286 |
-
"url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/
|
| 287 |
-
"reference": "
|
| 288 |
"shasum": ""
|
| 289 |
},
|
| 290 |
"require": {
|
|
@@ -302,7 +302,7 @@
|
|
| 302 |
"symfony/yaml": "2.8.*",
|
| 303 |
"wp-coding-standards/wpcs": "^2.0.0"
|
| 304 |
},
|
| 305 |
-
"time": "2019-
|
| 306 |
"type": "library",
|
| 307 |
"installation-source": "dist",
|
| 308 |
"autoload": {
|
| 274 |
},
|
| 275 |
{
|
| 276 |
"name": "wp-media/rocket-lazyload-common",
|
| 277 |
+
"version": "v2.3.3",
|
| 278 |
+
"version_normalized": "2.3.3.0",
|
| 279 |
"source": {
|
| 280 |
"type": "git",
|
| 281 |
"url": "https://github.com/wp-media/rocket-lazyload-common.git",
|
| 282 |
+
"reference": "761a50eab8fe125716c52409c213fcba9af64b59"
|
| 283 |
},
|
| 284 |
"dist": {
|
| 285 |
"type": "zip",
|
| 286 |
+
"url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/761a50eab8fe125716c52409c213fcba9af64b59",
|
| 287 |
+
"reference": "761a50eab8fe125716c52409c213fcba9af64b59",
|
| 288 |
"shasum": ""
|
| 289 |
},
|
| 290 |
"require": {
|
| 302 |
"symfony/yaml": "2.8.*",
|
| 303 |
"wp-coding-standards/wpcs": "^2.0.0"
|
| 304 |
},
|
| 305 |
+
"time": "2019-04-27T22:08:21+00:00",
|
| 306 |
"type": "library",
|
| 307 |
"installation-source": "dist",
|
| 308 |
"autoload": {
|
vendor/wp-media/rocket-lazyload-common/src/Assets.php
CHANGED
|
@@ -74,10 +74,11 @@ class Assets
|
|
| 74 |
data_src: "lazy-src",
|
| 75 |
data_srcset: "lazy-srcset",
|
| 76 |
data_sizes: "lazy-sizes",
|
|
|
|
| 77 |
class_loading: "lazyloading",
|
| 78 |
class_loaded: "lazyloaded",
|
| 79 |
threshold: ' . esc_attr($args['threshold']) . ',
|
| 80 |
-
|
| 81 |
if ( element.tagName === "IFRAME" && element.dataset.rocketLazyload == "fitvidscompatible" ) {
|
| 82 |
if (element.classList.contains("lazyloaded") ) {
|
| 83 |
if (typeof window.jQuery != "undefined") {
|
| 74 |
data_src: "lazy-src",
|
| 75 |
data_srcset: "lazy-srcset",
|
| 76 |
data_sizes: "lazy-sizes",
|
| 77 |
+
skip_invisible: false,
|
| 78 |
class_loading: "lazyloading",
|
| 79 |
class_loaded: "lazyloaded",
|
| 80 |
threshold: ' . esc_attr($args['threshold']) . ',
|
| 81 |
+
callback_load: function(element) {
|
| 82 |
if ( element.tagName === "IFRAME" && element.dataset.rocketLazyload == "fitvidscompatible" ) {
|
| 83 |
if (element.classList.contains("lazyloaded") ) {
|
| 84 |
if (typeof window.jQuery != "undefined") {
|
vendor/wp-media/rocket-lazyload-common/src/Image.php
CHANGED
|
@@ -235,7 +235,6 @@ class Image
|
|
| 235 |
'loading="lazy"',
|
| 236 |
'loading="eager"',
|
| 237 |
'swatch-img',
|
| 238 |
-
'data-height-percentage',
|
| 239 |
]
|
| 240 |
);
|
| 241 |
}
|
| 235 |
'loading="lazy"',
|
| 236 |
'loading="eager"',
|
| 237 |
'swatch-img',
|
|
|
|
| 238 |
]
|
| 239 |
);
|
| 240 |
}
|
