a3 Lazy Load - Version 1.5.1

Version Description

Maintenance Update. 2 Tweaks and 1 bug fix for themes that use loop code, or where 3rd party scripts add name to property attributes

Download this release

Release Info

Developer a3rev
Plugin Icon 128x128 a3 Lazy Load
Version 1.5.1
Comparing to
See all releases

Code changes from version 1.5.0 to 1.5.1

a3-lazy-load.php CHANGED
@@ -2,7 +2,7 @@
2
/*
3
Plugin Name: a3 Lazy Load
4
Description: Speed up your site and enhance frontend user's visual experience in PC's, Tablets and mobile with a3 Lazy Load.
5
- Version: 1.5.0
6
Author: a3 Revolution
7
Author URI: http://www.a3rev.com/
8
Requires at least: 3.8
2
/*
3
Plugin Name: a3 Lazy Load
4
Description: Speed up your site and enhance frontend user's visual experience in PC's, Tablets and mobile with a3 Lazy Load.
5
+ Version: 1.5.1
6
Author: a3 Revolution
7
Author URI: http://www.a3rev.com/
8
Requires at least: 3.8
admin/a3-lazy-load-admin.php CHANGED
@@ -2,7 +2,7 @@
2
update_option('a3rev_lazy_load_plugin', 'a3_lazy_load');
3
4
function a3_lazy_load_activated(){
5
- update_option('a3_lazy_load_version', '1.5.0');
6
7
// Set Settings Default from Admin Init
8
global $a3_lazy_load_admin_init;
@@ -59,6 +59,6 @@ function a3_lazy_load_upgrade_plugin() {
59
include( A3_LAZY_LOAD_DIR. '/includes/updates/a3-lazy-load-update-1.1.0.php' );
60
}
61
62
- update_option('a3_lazy_load_version', '1.5.0');
63
}
64
?>
2
update_option('a3rev_lazy_load_plugin', 'a3_lazy_load');
3
4
function a3_lazy_load_activated(){
5
+ update_option('a3_lazy_load_version', '1.5.1');
6
7
// Set Settings Default from Admin Init
8
global $a3_lazy_load_admin_init;
59
include( A3_LAZY_LOAD_DIR. '/includes/updates/a3-lazy-load-update-1.1.0.php' );
60
}
61
62
+ update_option('a3_lazy_load_version', '1.5.1');
63
}
64
?>
assets/images/lazy_placeholder.gif ADDED
Binary file
classes/class-a3-lazy-load.php CHANGED
@@ -49,7 +49,7 @@ class A3_Lazy_Load
49
add_filter( 'a3_lazy_load_html', array( $this, 'filter_html' ), 10, 2 );
50
51
//$this->_placeholder_url = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
52
- $this->_placeholder_url = A3_LAZY_LOAD_IMAGES_URL . '/placeholder.gif';
53
54
// Apply for Images
55
$skip_images_classes = apply_filters( 'a3_lazy_load_skip_images_classes', $a3_lazy_load_global_settings['a3l_skip_image_with_class'] );
@@ -297,7 +297,7 @@ class A3_Lazy_Load
297
foreach ( $matches[0] as $imgHTML ) {
298
299
// don't to the replacement if a skip class is provided and the image has the class, or if the image is a data-uri
300
- if ( ! ( is_array( $this->_skip_images_classes ) && preg_match( $skip_images_regex, $imgHTML ) ) && ! preg_match( "/src=['\"]data:image/is", $imgHTML ) ) {
301
$i++;
302
// replace the src and add the data-src attribute
303
$replaceHTML = '';
@@ -381,7 +381,7 @@ class A3_Lazy_Load
381
}
382
383
// don't to the replacement if a skip class is provided and the image has the class, or if the image is a data-uri
384
- if ( ! ( is_array( $this->_skip_videos_classes ) && preg_match( $skip_images_regex, $imgHTML ) ) && ! preg_match( "/data-src=['\"]/is", $imgHTML ) ) {
385
$i++;
386
// replace the src and add the data-src attribute
387
$replaceHTML = '';
@@ -424,7 +424,7 @@ class A3_Lazy_Load
424
foreach ( $matches[0] as $imgHTML ) {
425
426
// don't to the replacement if a skip class is provided and the image has the class, or if the image is a data-uri
427
- if ( ! ( is_array( $this->_skip_videos_classes ) && preg_match( $skip_images_regex, $imgHTML ) ) && ! preg_match( "/data-src=['\"]/is", $imgHTML ) ) {
428
$i++;
429
// replace the src and add the data-src attribute
430
@@ -472,7 +472,7 @@ class A3_Lazy_Load
472
foreach ( $matches[0] as $imgHTML ) {
473
474
// don't to the replacement if a skip class is provided and the image has the class, or if the image is a data-uri
475
- if ( ! ( is_array( $this->_skip_videos_classes ) && preg_match( $skip_images_regex, $imgHTML ) ) && ! preg_match( "/data-src=['\"]/is", $imgHTML ) ) {
476
$i++;
477
// replace the src and add the data-src attribute
478
$replaceHTML = '';
49
add_filter( 'a3_lazy_load_html', array( $this, 'filter_html' ), 10, 2 );
50
51
//$this->_placeholder_url = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
52
+ $this->_placeholder_url = A3_LAZY_LOAD_IMAGES_URL . '/lazy_placeholder.gif';
53
54
// Apply for Images
55
$skip_images_classes = apply_filters( 'a3_lazy_load_skip_images_classes', $a3_lazy_load_global_settings['a3l_skip_image_with_class'] );
297
foreach ( $matches[0] as $imgHTML ) {
298
299
// don't to the replacement if a skip class is provided and the image has the class, or if the image is a data-uri
300
+ if ( ! ( is_array( $this->_skip_images_classes ) && preg_match( $skip_images_regex, $imgHTML ) ) && ! preg_match( "/src=['\"]data:image/is", $imgHTML ) && ! preg_match( "/src=.*lazy_placeholder.gif['\"]/s", $imgHTML ) ) {
301
$i++;
302
// replace the src and add the data-src attribute
303
$replaceHTML = '';
381
}
382
383
// don't to the replacement if a skip class is provided and the image has the class, or if the image is a data-uri
384
+ if ( ! ( is_array( $this->_skip_videos_classes ) && preg_match( $skip_images_regex, $imgHTML ) ) && ! preg_match( "/ data-src=['\"]/is", $imgHTML ) ) {
385
$i++;
386
// replace the src and add the data-src attribute
387
$replaceHTML = '';
424
foreach ( $matches[0] as $imgHTML ) {
425
426
// don't to the replacement if a skip class is provided and the image has the class, or if the image is a data-uri
427
+ if ( ! ( is_array( $this->_skip_videos_classes ) && preg_match( $skip_images_regex, $imgHTML ) ) && ! preg_match( "/ data-src=['\"]/is", $imgHTML ) ) {
428
$i++;
429
// replace the src and add the data-src attribute
430
472
foreach ( $matches[0] as $imgHTML ) {
473
474
// don't to the replacement if a skip class is provided and the image has the class, or if the image is a data-uri
475
+ if ( ! ( is_array( $this->_skip_videos_classes ) && preg_match( $skip_images_regex, $imgHTML ) ) && ! preg_match( "/ data-src=['\"]/is", $imgHTML ) ) {
476
$i++;
477
// replace the src and add the data-src attribute
478
$replaceHTML = '';
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: a3rev, A3 Revolution Software Development team, nguyencongtuan
4
Tags: a3 lazy load, Lazy Loading , image lazy load, lazyload
5
Requires at least: 4.0
6
Tested up to: 4.4
7
- Stable tag: 1.5.0
8
License: GPLv3
9
License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
@@ -50,6 +50,11 @@ a3 Lazy Load has built in support for content that is added by iframe from any s
50
* Google+ Profile
51
* Google Maps
52
53
= Lazy Load Effects =
54
55
a3 Lazy Load gives you the option to lazy load images with a FADE IN or SPINNER effect.
@@ -144,6 +149,11 @@ Automatic installation is the easiest option as WordPress handles the file trans
144
145
== Changelog ==
146
147
= 1.5.0 - 2015/12/10 =
148
* Feature - Change media uploader to New UI of WordPress media uploader with WordPress Backbone and Underscore
149
* Feature - Apply Lazy Load for new Embed Post feature on WordPress 4.4
@@ -235,6 +245,9 @@ Automatic installation is the easiest option as WordPress handles the file trans
235
236
== Upgrade Notice ==
237
238
= 1.5.0 =
239
Feature Upgrade. 2 new features plus 1 bug fix and tweaks for full compatibility with WordPress major Version 4.4
240
4
Tags: a3 lazy load, Lazy Loading , image lazy load, lazyload
5
Requires at least: 4.0
6
Tested up to: 4.4
7
+ Stable tag: 1.5.1
8
License: GPLv3
9
License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
50
* Google+ Profile
51
* Google Maps
52
53
+ = WordPress 4.4 Post Embed =
54
+
55
+ * Fully compatible with WordPress 4.4 new embed post on any site feature
56
+ * Makes embed post load much faster
57
+
58
= Lazy Load Effects =
59
60
a3 Lazy Load gives you the option to lazy load images with a FADE IN or SPINNER effect.
149
150
== Changelog ==
151
152
+ = 1.5.1 - 2015/12/11 =
153
+ * Tweak - Change the placeholder image name from 'placeholder.gif' to 'lazy_placeholder.gif' to avoid conflict if thumb image has name like placehoder.gif
154
+ * Tweak - Change pattern parameter from "/data-src=['\"]/is" to "/ data-src=['\"]/is" to check 'data-src' exists as attribute of video, image, iframe, Solve the issue when 3rd party script adds attribute with format of name '***-data-src' to html tag.
155
+ * Fix - Use preg_match( "/src=.*lazy_placeholder.gif['\"]/s", $imgHTML ) On themes that have loop code was causing loading of the placeholder instead of the image
156
+
157
= 1.5.0 - 2015/12/10 =
158
* Feature - Change media uploader to New UI of WordPress media uploader with WordPress Backbone and Underscore
159
* Feature - Apply Lazy Load for new Embed Post feature on WordPress 4.4
245
246
== Upgrade Notice ==
247
248
+ = 1.5.1 =
249
+ Maintenance Update. 2 Tweaks and 1 bug fix for themes that use loop code, or where 3rd party scripts add name to property attributes
250
+
251
= 1.5.0 =
252
Feature Upgrade. 2 new features plus 1 bug fix and tweaks for full compatibility with WordPress major Version 4.4
253