diff --git a/composer.lock b/composer.lock index 7b0cb4e..6150925 100644 --- a/composer.lock +++ b/composer.lock @@ -153,16 +153,16 @@ }, { "name": "wp-media/rocket-lazyload-common", - "version": "v1.2", + "version": "v1.3", "source": { "type": "git", "url": "https://github.com/wp-media/rocket-lazyload-common.git", - "reference": "db45190dd9fb3dddcdc335e180fa522d6789d0bc" + "reference": "d2492d2e874a8e9fdeaf1c9e8117d5c211fad3cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/db45190dd9fb3dddcdc335e180fa522d6789d0bc", - "reference": "db45190dd9fb3dddcdc335e180fa522d6789d0bc", + "url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/d2492d2e874a8e9fdeaf1c9e8117d5c211fad3cb", + "reference": "d2492d2e874a8e9fdeaf1c9e8117d5c211fad3cb", "shasum": "" }, "require": { @@ -188,10 +188,10 @@ ], "description": "Common Code between WP Rocket and Lazyload by WP Rocket", "support": { - "source": "https://github.com/wp-media/rocket-lazyload-common/tree/v1.2", + "source": "https://github.com/wp-media/rocket-lazyload-common/tree/v1.3", "issues": "https://github.com/wp-media/rocket-lazyload-common/issues" }, - "time": "2019-01-08T22:32:27+00:00" + "time": "2019-01-09T17:31:57+00:00" } ], "packages-dev": [ diff --git a/readme.txt b/readme.txt index c980c39..b44d739 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: lazyload, lazy load, images, iframes, thumbnail, thumbnails, smiley, smili Requires at least: 4.7 Tested up to: 5.0.2 Requires PHP: 5.4 -Stable tag: 2.0 +Stable tag: 2.0.2 Lazy Load your images and iframes, replace Youtube videos by a preview thumbnail. @@ -78,6 +78,12 @@ The element you want to apply lazyload on must have this specific markup: The element must have the class `rocket-lazyload-bg`, and a `data-bg` attribute, which value is the CSS url for the image. == Changelog == += 2.0.2 = +* Bugfix: Fix an error in the compatibility for the AMP plugin + += 2.0.1 = +* Bugfix: Prevent a fatal error on case sensitive operating systems + = 2.0 = * Enhancement: Lazyload is now applied on the template_redirect hook, which should allow the plugin to apply the optimization on more images and encountering less conflicts at the same time * Enhancement: Specifically target with the lazyload script images/iframes elements with a data-lazy-src attribute diff --git a/rocket-lazy-load.php b/rocket-lazy-load.php index 1a793b4..dd14edd 100644 --- a/rocket-lazy-load.php +++ b/rocket-lazy-load.php @@ -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.0 + * Version: 2.0.2 * Author: WP Media * Author URI: https://wp-rocket.me * Text Domain: rocket-lazy-load @@ -27,7 +27,7 @@ defined('ABSPATH') || die('Cheatin\' uh?'); -define('ROCKET_LL_VERSION', '2.0'); +define('ROCKET_LL_VERSION', '2.0.2'); define('ROCKET_LL_WP_VERSION', '4.7'); define('ROCKET_LL_PHP_VERSION', '5.4'); define('ROCKET_LL_BASENAME', plugin_basename(__FILE__)); diff --git a/src/Subscriber/ThirdParty/AMPSubscriber.php b/src/Subscriber/ThirdParty/AMPSubscriber.php index 72ab298..9952d84 100644 --- a/src/Subscriber/ThirdParty/AMPSubscriber.php +++ b/src/Subscriber/ThirdParty/AMPSubscriber.php @@ -1,7 +1,8 @@ 'disableIfAMP' + ]; + } + + /** + * {@inheritdoc} + */ + public function setEventManager(EventManager $event_manager) + { + $this->event_manager = $event_manager; + } + /** + * Disable if on AMP page + * + * @since 2.0.2 + * @author Remy Perona + * + * @return void + */ + public function disableIfAMP() + { if ($this->isAmpEndpoint()) { - $events['do_rocket_lazyload'] = 'returnFalse'; - $events['do_rocket_lazyload_iframes'] = 'returnFalse'; + $this->event_manager->addCallback('do_rocket_lazyload', '__return_false'); + $this->event_manager->addCallback('do_rocket_lazyload_iframes', '__return_false'); } - - return $events; } /** @@ -44,17 +64,4 @@ private function isAmpEndpoint() return false; } - - /** - * Returns false - * - * @since 2.0 - * @author Remy Perona - * - * @return void - */ - public function returnFalse() - { - \__return_false(); - } } diff --git a/views/admin-page.php b/views/admin-page.php index 467d6e8..e6bb5a9 100644 --- a/views/admin-page.php +++ b/views/admin-page.php @@ -22,7 +22,7 @@ < class="screen-reader-text">>
-

<?php echo esc_attr(get_admin_page_title()); ?>

+

<?php echo esc_attr(get_admin_page_title()); ?>