Lazy Load by WP Rocket - Version 2.0.2

Version Description

  • Bugfix: Fix an error in the compatibility for the AMP plugin
Download this release

Release Info

Developer wp_media
Plugin Icon 128x128 Lazy Load by WP Rocket
Version 2.0.2
Comparing to
See all releases

Code changes from version 2.0.1 to 2.0.2

assets/img/youtube.png CHANGED
Binary file
composer.lock CHANGED
@@ -153,16 +153,16 @@
153
  },
154
  {
155
  "name": "wp-media/rocket-lazyload-common",
156
- "version": "v1.2",
157
  "source": {
158
  "type": "git",
159
  "url": "https://github.com/wp-media/rocket-lazyload-common.git",
160
- "reference": "db45190dd9fb3dddcdc335e180fa522d6789d0bc"
161
  },
162
  "dist": {
163
  "type": "zip",
164
- "url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/db45190dd9fb3dddcdc335e180fa522d6789d0bc",
165
- "reference": "db45190dd9fb3dddcdc335e180fa522d6789d0bc",
166
  "shasum": ""
167
  },
168
  "require": {
@@ -188,10 +188,10 @@
188
  ],
189
  "description": "Common Code between WP Rocket and Lazyload by WP Rocket",
190
  "support": {
191
- "source": "https://github.com/wp-media/rocket-lazyload-common/tree/v1.2",
192
  "issues": "https://github.com/wp-media/rocket-lazyload-common/issues"
193
  },
194
- "time": "2019-01-08T22:32:27+00:00"
195
  }
196
  ],
197
  "packages-dev": [
153
  },
154
  {
155
  "name": "wp-media/rocket-lazyload-common",
156
+ "version": "v1.3",
157
  "source": {
158
  "type": "git",
159
  "url": "https://github.com/wp-media/rocket-lazyload-common.git",
160
+ "reference": "d2492d2e874a8e9fdeaf1c9e8117d5c211fad3cb"
161
  },
162
  "dist": {
163
  "type": "zip",
164
+ "url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/d2492d2e874a8e9fdeaf1c9e8117d5c211fad3cb",
165
+ "reference": "d2492d2e874a8e9fdeaf1c9e8117d5c211fad3cb",
166
  "shasum": ""
167
  },
168
  "require": {
188
  ],
189
  "description": "Common Code between WP Rocket and Lazyload by WP Rocket",
190
  "support": {
191
+ "source": "https://github.com/wp-media/rocket-lazyload-common/tree/v1.3",
192
  "issues": "https://github.com/wp-media/rocket-lazyload-common/issues"
193
  },
194
+ "time": "2019-01-09T17:31:57+00:00"
195
  }
196
  ],
197
  "packages-dev": [
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.0.2
6
  Requires PHP: 5.4
7
- Stable tag: 2.0.1
8
 
9
  Lazy Load your images and iframes, replace Youtube videos by a preview thumbnail.
10
 
@@ -78,6 +78,9 @@ The element you want to apply lazyload on must have this specific markup:
78
  The element must have the class `rocket-lazyload-bg`, and a `data-bg` attribute, which value is the CSS url for the image.
79
 
80
  == Changelog ==
 
 
 
81
  = 2.0.1 =
82
  * Bugfix: Prevent a fatal error on case sensitive operating systems
83
 
4
  Requires at least: 4.7
5
  Tested up to: 5.0.2
6
  Requires PHP: 5.4
7
+ Stable tag: 2.0.2
8
 
9
  Lazy Load your images and iframes, replace Youtube videos by a preview thumbnail.
10
 
78
  The element must have the class `rocket-lazyload-bg`, and a `data-bg` attribute, which value is the CSS url for the image.
79
 
80
  == Changelog ==
81
+ = 2.0.2 =
82
+ * Bugfix: Fix an error in the compatibility for the AMP plugin
83
+
84
  = 2.0.1 =
85
  * Bugfix: Prevent a fatal error on case sensitive operating systems
86
 
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.0.1
7
  * Author: WP Media
8
  * Author URI: https://wp-rocket.me
9
  * Text Domain: rocket-lazy-load
@@ -27,7 +27,7 @@
27
 
28
  defined('ABSPATH') || die('Cheatin\' uh?');
29
 
30
- define('ROCKET_LL_VERSION', '2.0.1');
31
  define('ROCKET_LL_WP_VERSION', '4.7');
32
  define('ROCKET_LL_PHP_VERSION', '5.4');
33
  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.0.2
7
  * Author: WP Media
8
  * Author URI: https://wp-rocket.me
9
  * Text Domain: rocket-lazy-load
27
 
28
  defined('ABSPATH') || die('Cheatin\' uh?');
29
 
30
+ define('ROCKET_LL_VERSION', '2.0.2');
31
  define('ROCKET_LL_WP_VERSION', '4.7');
32
  define('ROCKET_LL_PHP_VERSION', '5.4');
33
  define('ROCKET_LL_BASENAME', plugin_basename(__FILE__));
src/Subscriber/ThirdParty/AMPSubscriber.php CHANGED
@@ -1,7 +1,8 @@
1
  <?php
2
  namespace RocketLazyLoadPlugin\Subscriber\ThirdParty;
3
 
4
- use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
 
5
 
6
  defined('ABSPATH') || die('Cheatin\' uh?');
7
 
@@ -11,21 +12,40 @@ defined('ABSPATH') || die('Cheatin\' uh?');
11
  * @since 2.0
12
  * @author Remy Perona
13
  */
14
- class AMPSubscriber implements SubscriberInterface
15
  {
16
  /**
17
  * @inheritDoc
18
  */
19
  public function getSubscribedEvents()
20
  {
21
- $events = [];
 
 
 
 
 
 
 
 
 
 
 
22
 
 
 
 
 
 
 
 
 
 
 
23
  if ($this->isAmpEndpoint()) {
24
- $events['do_rocket_lazyload'] = 'returnFalse';
25
- $events['do_rocket_lazyload_iframes'] = 'returnFalse';
26
  }
27
-
28
- return $events;
29
  }
30
 
31
  /**
@@ -44,17 +64,4 @@ class AMPSubscriber implements SubscriberInterface
44
 
45
  return false;
46
  }
47
-
48
- /**
49
- * Returns false
50
- *
51
- * @since 2.0
52
- * @author Remy Perona
53
- *
54
- * @return void
55
- */
56
- public function returnFalse()
57
- {
58
- \__return_false();
59
- }
60
  }
1
  <?php
2
  namespace RocketLazyLoadPlugin\Subscriber\ThirdParty;
3
 
4
+ use RocketLazyLoadPlugin\EventManagement\EventManager;
5
+ use RocketLazyLoadPlugin\EventManagement\EventManagerAwareSubscriberInterface;
6
 
7
  defined('ABSPATH') || die('Cheatin\' uh?');
8
 
12
  * @since 2.0
13
  * @author Remy Perona
14
  */
15
+ class AMPSubscriber implements EventManagerAwareSubscriberInterface
16
  {
17
  /**
18
  * @inheritDoc
19
  */
20
  public function getSubscribedEvents()
21
  {
22
+ return [
23
+ 'wp' => 'disableIfAMP'
24
+ ];
25
+ }
26
+
27
+ /**
28
+ * {@inheritdoc}
29
+ */
30
+ public function setEventManager(EventManager $event_manager)
31
+ {
32
+ $this->event_manager = $event_manager;
33
+ }
34
 
35
+ /**
36
+ * Disable if on AMP page
37
+ *
38
+ * @since 2.0.2
39
+ * @author Remy Perona
40
+ *
41
+ * @return void
42
+ */
43
+ public function disableIfAMP()
44
+ {
45
  if ($this->isAmpEndpoint()) {
46
+ $this->event_manager->addCallback('do_rocket_lazyload', '__return_false');
47
+ $this->event_manager->addCallback('do_rocket_lazyload_iframes', '__return_false');
48
  }
 
 
49
  }
50
 
51
  /**
64
 
65
  return false;
66
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  }
vendor/composer/installed.json CHANGED
@@ -152,17 +152,17 @@
152
  },
153
  {
154
  "name": "wp-media/rocket-lazyload-common",
155
- "version": "v1.2",
156
- "version_normalized": "1.2.0.0",
157
  "source": {
158
  "type": "git",
159
  "url": "https://github.com/wp-media/rocket-lazyload-common.git",
160
- "reference": "db45190dd9fb3dddcdc335e180fa522d6789d0bc"
161
  },
162
  "dist": {
163
  "type": "zip",
164
- "url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/db45190dd9fb3dddcdc335e180fa522d6789d0bc",
165
- "reference": "db45190dd9fb3dddcdc335e180fa522d6789d0bc",
166
  "shasum": ""
167
  },
168
  "require": {
@@ -171,7 +171,7 @@
171
  "require-dev": {
172
  "squizlabs/php_codesniffer": "^3.2"
173
  },
174
- "time": "2019-01-08T22:32:27+00:00",
175
  "type": "library",
176
  "installation-source": "dist",
177
  "autoload": {
@@ -190,7 +190,7 @@
190
  ],
191
  "description": "Common Code between WP Rocket and Lazyload by WP Rocket",
192
  "support": {
193
- "source": "https://github.com/wp-media/rocket-lazyload-common/tree/v1.2",
194
  "issues": "https://github.com/wp-media/rocket-lazyload-common/issues"
195
  }
196
  }
152
  },
153
  {
154
  "name": "wp-media/rocket-lazyload-common",
155
+ "version": "v1.3",
156
+ "version_normalized": "1.3.0.0",
157
  "source": {
158
  "type": "git",
159
  "url": "https://github.com/wp-media/rocket-lazyload-common.git",
160
+ "reference": "d2492d2e874a8e9fdeaf1c9e8117d5c211fad3cb"
161
  },
162
  "dist": {
163
  "type": "zip",
164
+ "url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/d2492d2e874a8e9fdeaf1c9e8117d5c211fad3cb",
165
+ "reference": "d2492d2e874a8e9fdeaf1c9e8117d5c211fad3cb",
166
  "shasum": ""
167
  },
168
  "require": {
171
  "require-dev": {
172
  "squizlabs/php_codesniffer": "^3.2"
173
  },
174
+ "time": "2019-01-09T17:31:57+00:00",
175
  "type": "library",
176
  "installation-source": "dist",
177
  "autoload": {
190
  ],
191
  "description": "Common Code between WP Rocket and Lazyload by WP Rocket",
192
  "support": {
193
+ "source": "https://github.com/wp-media/rocket-lazyload-common/tree/v1.3",
194
  "issues": "https://github.com/wp-media/rocket-lazyload-common/issues"
195
  }
196
  }
views/admin-page.php CHANGED
@@ -22,7 +22,7 @@ $options = [
22
  <<?php echo $heading_tag; ?> class="screen-reader-text"><?php echo esc_html(get_admin_page_title()); ?></<?php echo $heading_tag; ?>>
23
  <div class="rocket-lazyload-header">
24
  <div>
25
- <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/logo@2x.png 2x'); ?>" alt="<?php echo esc_attr(get_admin_page_title()); ?>" width="216" height="59"></p>
26
  <p class="rocket-lazyload-subtitle"><?php esc_html_e('Settings', 'rocket-lazy-load'); ?></p>
27
  </div>
28
  <?php $rocket_lazyload_rate_url = 'https://wordpress.org/support/plugin/rocket-lazy-load/reviews/?rate=5#postform'; ?>
22
  <<?php echo $heading_tag; ?> class="screen-reader-text"><?php echo esc_html(get_admin_page_title()); ?></<?php echo $heading_tag; ?>>
23
  <div class="rocket-lazyload-header">
24
  <div>
25
+ <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/logo@2x.png'); ?> 2x" alt="<?php echo esc_attr(get_admin_page_title()); ?>" width="216" height="59"></p>
26
  <p class="rocket-lazyload-subtitle"><?php esc_html_e('Settings', 'rocket-lazy-load'); ?></p>
27
  </div>
28
  <?php $rocket_lazyload_rate_url = 'https://wordpress.org/support/plugin/rocket-lazy-load/reviews/?rate=5#postform'; ?>