Skip to content

Commit

Permalink
Merge pull request #98 from wp-media/branch-2.2.3
Browse files Browse the repository at this point in the history
2.2.3
  • Loading branch information
remyperona authored Jul 19, 2019
2 parents 8513daf + 99eb519 commit ba72442
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 43 deletions.
60 changes: 30 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: lazyload, lazy load, images, iframes, thumbnail, thumbnails, smiley, smili
Requires at least: 4.7
Tested up to: 5.2
Requires PHP: 5.6
Stable tag: 2.2.2
Stable tag: 2.2.3

Lazy Load your images and iframes, replace Youtube videos by a preview thumbnail.

Expand Down Expand Up @@ -85,6 +85,14 @@ You can also apply it manually. The element you want to apply lazyload on must h
The element must have the class `rocket-lazyload`, and a `data-bg` attribute, which value is the CSS url for the image.

== Changelog ==
= 2.2.3 =
* Enhancement: Improve compatibility for the picture element
* Enhancement: Apply lazyload on background images set on section, span and li elements
* Enhancement: also pass $width and $height values to the rocket_lazyload_placeholder filter
* Bugfix: Use 0 instead of 1 for the default placeholder dimensions to improve compatibility
* Bugfix: Improve infinite scroll support
* Bugfix: Exclude Enfold avia-background-fixed background images and data-large_image from lazyload

= 2.2.2 =
* Bugfix: Auto-exclude data-height-percentage attribute to prevent display issues
* Bugfix: Correctly handle responsive videos using fitVids again
Expand Down
4 changes: 2 additions & 2 deletions rocket-lazy-load.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Lazy Load by WP Rocket
* Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/
* Description: The tiny Lazy Load script for WordPress without jQuery or others libraries.
* Version: 2.2.2
* Version: 2.2.3
* Author: WP Rocket
* Author URI: https://wp-rocket.me
* Text Domain: rocket-lazy-load
Expand All @@ -29,7 +29,7 @@

defined('ABSPATH') || die('Cheatin\' uh?');

define('ROCKET_LL_VERSION', '2.2.2');
define('ROCKET_LL_VERSION', '2.2.3');
define('ROCKET_LL_WP_VERSION', '4.7');
define('ROCKET_LL_PHP_VERSION', '5.6');
define('ROCKET_LL_BASENAME', plugin_basename(__FILE__));
Expand Down
24 changes: 14 additions & 10 deletions src/Subscriber/LazyloadSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,23 @@ public function insertLazyloadScript()
*/
$polyfill = apply_filters('rocket_lazyload_polyfill', false);

$args = [
'base_url' => ROCKET_LL_FRONT_JS_URL,
$script_args = [
'base_url' => ROCKET_LL_FRONT_JS_URL,
'version' => '11.0.6',
'polyfill' => $polyfill,
];

$inline_args = [
'threshold' => $threshold,
'version' => '11.0.6',
'polyfill' => $polyfill,
];

if ($this->option_array->get('images')) {
$args['elements']['image'] = 'img[data-lazy-src]';
$args['elements']['background_image'] = '.rocket-lazyload';
$inline_args['elements']['image'] = 'img[data-lazy-src]';
$inline_args['elements']['background_image'] = '.rocket-lazyload';
}

if ($this->option_array->get('iframes')) {
$args['elements']['iframe'] = 'iframe[data-lazy-src]';
$inline_args['elements']['iframe'] = 'iframe[data-lazy-src]';
}

/**
Expand All @@ -158,11 +161,12 @@ public function insertLazyloadScript()
* @since 2.0
* @author Remy Perona
*
* @param array $args Arguments used for the lazyload script options.
* @param array $inline_args Arguments used for the lazyload script options.
*/
$args = apply_filters('rocket_lazyload_script_args', $args);
$inline_args = apply_filters('rocket_lazyload_script_args', $inline_args);

$this->assets->insertLazyloadScript($args);
echo '<script>' . $this->assets->getInlineLazyloadScript($inline_args) . '</script>';
$this->assets->insertLazyloadScript($script_args);
}

/**
Expand Down

0 comments on commit ba72442

Please sign in to comment.