Skip to content

Commit

Permalink
2.0.2 (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
remyperona authored Jan 10, 2019
1 parent 5981ed4 commit 68dfa89
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 30 deletions.
12 changes: 6 additions & 6 deletions composer.lock

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

8 changes: 7 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.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.

Expand Down Expand Up @@ -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
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.0
* Version: 2.0.2
* Author: WP Media
* Author URI: https://wp-rocket.me
* Text Domain: rocket-lazy-load
Expand All @@ -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__));
Expand Down
47 changes: 27 additions & 20 deletions src/Subscriber/ThirdParty/AMPSubscriber.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php
namespace RocketLazyLoadPlugin\Subscriber\ThirdParty;

use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
use RocketLazyLoadPlugin\EventManagement\EventManager;
use RocketLazyLoadPlugin\EventManagement\EventManagerAwareSubscriberInterface;

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

Expand All @@ -11,21 +12,40 @@
* @since 2.0
* @author Remy Perona
*/
class AMPSubscriber implements SubscriberInterface
class AMPSubscriber implements EventManagerAwareSubscriberInterface
{
/**
* @inheritDoc
*/
public function getSubscribedEvents()
{
$events = [];
return [
'wp' => '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;
}

/**
Expand All @@ -44,17 +64,4 @@ private function isAmpEndpoint()

return false;
}

/**
* Returns false
*
* @since 2.0
* @author Remy Perona
*
* @return void
*/
public function returnFalse()
{
\__return_false();
}
}
2 changes: 1 addition & 1 deletion views/admin-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<<?php echo $heading_tag; ?> class="screen-reader-text"><?php echo esc_html(get_admin_page_title()); ?></<?php echo $heading_tag; ?>>
<div class="rocket-lazyload-header">
<div>
<p class="rocket-lazyload-title"><img src="<?php echo esc_url(ROCKET_LL_ASSETS_URL . 'img/logo.png'); ?>" srcset="<?php echo esc_url(ROCKET_LL_ASSETS_URL . 'img/[email protected] 2x'); ?>" alt="<?php echo esc_attr(get_admin_page_title()); ?>" width="216" height="59"></p>
<p class="rocket-lazyload-title"><img src="<?php echo esc_url(ROCKET_LL_ASSETS_URL . 'img/logo.png'); ?>" srcset="<?php echo esc_url(ROCKET_LL_ASSETS_URL . 'img/[email protected]'); ?> 2x" alt="<?php echo esc_attr(get_admin_page_title()); ?>" width="216" height="59"></p>
<p class="rocket-lazyload-subtitle"><?php esc_html_e('Settings', 'rocket-lazy-load'); ?></p>
</div>
<?php $rocket_lazyload_rate_url = 'https://wordpress.org/support/plugin/rocket-lazy-load/reviews/?rate=5#postform'; ?>
Expand Down

0 comments on commit 68dfa89

Please sign in to comment.