Lazy Load by WP Rocket - Version 1.0.4

Version Description

  • 28 apr. 2015
  • Bug Fix: Resolved a conflict between LazyLoad & Emoji since WordPress 4.2
Download this release

Release Info

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

Code changes from version 1.0.3 to 1.0.4

Files changed (2) hide show
  1. readme.txt +9 -3
  2. rocket-lazy-load.php +11 -4
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: juliobox, geekpress, wp_media
3
  Tags: lazyload, lazy load, images, thumbnail, thumbnails, smiley, smilies, avatar, gravatar
4
  Requires at least: 3.0
5
- Tested up to: 4.1
6
- Stable tag: 1.0.3
7
 
8
  The tiny Lazy Load script for WordPress without jQuery or others libraries.
9
 
@@ -15,7 +15,9 @@ This plugin works on thumbnails, all images in a post content or in a widget tex
15
 
16
  Simply install the plugin to enjoy a faster website. No options are available : you install it and the plugin takes care of everything.
17
 
18
- This script is used by WP Rocket plugin cache : http://wp-rocket.me
 
 
19
 
20
  == Installation ==
21
 
@@ -44,6 +46,10 @@ Simply add a 'data-no-lazy="1"' property in you IMG tag.
44
 
45
  == Changelog ==
46
 
 
 
 
 
47
  = 1.0.3 =
48
  * 08 jan. 2015
49
  * Bug Fix: Don't apply LazyLoad on captcha from Really Simple CAPTCHA to prevent conflicts.
2
  Contributors: juliobox, geekpress, wp_media
3
  Tags: lazyload, lazy load, images, thumbnail, thumbnails, smiley, smilies, avatar, gravatar
4
  Requires at least: 3.0
5
+ Tested up to: 4.5
6
+ Stable tag: 1.0.4
7
 
8
  The tiny Lazy Load script for WordPress without jQuery or others libraries.
9
 
15
 
16
  Simply install the plugin to enjoy a faster website. No options are available : you install it and the plugin takes care of everything.
17
 
18
+ = Related Plugins =
19
+ * <a href="https://wordpress.org/plugins/imagify/">Imagify</a>: Best Image Optimizer to speed up your website with lighter images.
20
+ * <a href="http://wp-rocket.me">WP Rocket</a>: Best caching plugin to speed-up your WordPress website.
21
 
22
  == Installation ==
23
 
46
 
47
  == Changelog ==
48
 
49
+ = 1.0.4 =
50
+ * 28 apr. 2015
51
+ * Bug Fix: Resolved a conflict between LazyLoad & Emoji since WordPress 4.2
52
+
53
  = 1.0.3 =
54
  * 08 jan. 2015
55
  * Bug Fix: Don't apply LazyLoad on captcha from Really Simple CAPTCHA to prevent conflicts.
rocket-lazy-load.php CHANGED
@@ -5,7 +5,7 @@ defined( 'ABSPATH' ) or die( 'Cheatin\' uh?' );
5
  Plugin Name: Rocket Lazy Load
6
  Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/
7
  Description: The tiny Lazy Load script for WordPress without jQuery or others libraries.
8
- Version: 1.0.3
9
  Author: WP Media
10
  Author URI: http://wp-rocket.me
11
 
@@ -161,16 +161,23 @@ function rocket_convert_smilies( $text ) {
161
  * @since 1.0
162
  */
163
  function rocket_translate_smiley( $matches ) {
164
-
165
  global $wpsmiliestrans;
166
 
167
- if ( ! count( $matches ) ) {
168
  return '';
169
- }
170
 
171
  $smiley = trim( reset( $matches ) );
172
  $img = $wpsmiliestrans[ $smiley ];
173
 
 
 
 
 
 
 
 
 
 
174
  /**
175
  * Filter the Smiley image URL before it's used in the image element.
176
  *
5
  Plugin Name: Rocket Lazy Load
6
  Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/
7
  Description: The tiny Lazy Load script for WordPress without jQuery or others libraries.
8
+ Version: 1.0.4
9
  Author: WP Media
10
  Author URI: http://wp-rocket.me
11
 
161
  * @since 1.0
162
  */
163
  function rocket_translate_smiley( $matches ) {
 
164
  global $wpsmiliestrans;
165
 
166
+ if ( count( $matches ) == 0 )
167
  return '';
 
168
 
169
  $smiley = trim( reset( $matches ) );
170
  $img = $wpsmiliestrans[ $smiley ];
171
 
172
+ $matches = array();
173
+ $ext = preg_match( '/\.([^.]+)$/', $img, $matches ) ? strtolower( $matches[1] ) : false;
174
+ $image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );
175
+
176
+ // Don't convert smilies that aren't images - they're probably emoji.
177
+ if ( ! in_array( $ext, $image_exts ) ) {
178
+ return $img;
179
+ }
180
+
181
  /**
182
  * Filter the Smiley image URL before it's used in the image element.
183
  *