a3 Lazy Load - Version 1.8.9

Version Description

Maintenance update. This upgrade has 2 code tweaks for compatibility with themes and plugins that load images via the wp_kses_post sanitizer as WooCommerce does since version 3.4.0 with widgets and on Cart page.

Download this release

Release Info

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

Code changes from version 1.8.8 to 1.8.9

a3-lazy-load.php CHANGED
@@ -2,13 +2,15 @@
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.8.8
6
  Author: a3rev Software
7
  Author URI: https://a3rev.com/
8
  Requires at least: 4.0
9
  Tested up to: 4.9.6
10
  Text Domain: a3-lazy-load
11
  Domain Path: /languages
 
 
12
  License: GPLv2 or later
13
  Copyright © 2011 a3 Revolution Software Development team
14
  a3 Revolution Software Development team
@@ -30,7 +32,7 @@ define('A3_LAZY_LOAD_CSS_URL', A3_LAZY_LOAD_URL . '/assets/css');
30
  define('A3_LAZY_LOAD_IMAGES_URL', A3_LAZY_LOAD_URL . '/assets/images');
31
 
32
  define( 'A3_LAZY_LOAD_KEY', 'a3_lazy_load' );
33
- define( 'A3_LAZY_VERSION', '1.8.8' );
34
 
35
  /**
36
  * Load Localisation files.
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.8.9
6
  Author: a3rev Software
7
  Author URI: https://a3rev.com/
8
  Requires at least: 4.0
9
  Tested up to: 4.9.6
10
  Text Domain: a3-lazy-load
11
  Domain Path: /languages
12
+ WC requires at least: 2.0.0
13
+ WC tested up to: 3.4.1
14
  License: GPLv2 or later
15
  Copyright © 2011 a3 Revolution Software Development team
16
  a3 Revolution Software Development team
32
  define('A3_LAZY_LOAD_IMAGES_URL', A3_LAZY_LOAD_URL . '/assets/images');
33
 
34
  define( 'A3_LAZY_LOAD_KEY', 'a3_lazy_load' );
35
+ define( 'A3_LAZY_VERSION', '1.8.9' );
36
 
37
  /**
38
  * Load Localisation files.
admin/a3-lazy-load-admin.php CHANGED
@@ -64,4 +64,5 @@ function a3_lazy_load_upgrade_plugin() {
64
 
65
  update_option('a3_lazy_load_version', A3_LAZY_VERSION );
66
  }
 
67
  ?>
64
 
65
  update_option('a3_lazy_load_version', A3_LAZY_VERSION );
66
  }
67
+
68
  ?>
classes/class-a3-lazy-load.php CHANGED
@@ -110,6 +110,9 @@ class A3_Lazy_Load
110
  add_action( 'dynamic_sidebar_after', array( $this, 'sidebar_after_filter_videos' ), 1000 );
111
  }
112
  }
 
 
 
113
  }
114
 
115
  static function _instance() {
@@ -223,6 +226,38 @@ class A3_Lazy_Load
223
  return false;
224
  }
225
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  static function filter_html( $content, $include_noscript = null ) {
227
  if ( is_admin() ) {
228
  return $content;
110
  add_action( 'dynamic_sidebar_after', array( $this, 'sidebar_after_filter_videos' ), 1000 );
111
  }
112
  }
113
+
114
+ // Add lazy attributes to all allowed post tags list
115
+ add_filter( 'wp_kses_allowed_html', array( $this, 'add_lazy_attributes' ), 10, 2 );
116
  }
117
 
118
  static function _instance() {
226
  return false;
227
  }
228
 
229
+ static function add_lazy_attributes( $allowedposttags, $context ) {
230
+
231
+ if ( 'post' === $context && ! empty( $allowedposttags ) ) {
232
+
233
+ $lazy_attributes = array(
234
+ 'data-lazy-type' => true,
235
+ 'data-src' => true,
236
+ 'data-srcset' => true,
237
+ 'data-poster' => true,
238
+ );
239
+
240
+ foreach ( $allowedposttags as $tag => $attributes ) {
241
+ if ( true === $attributes ) {
242
+ $attributes = array();
243
+ }
244
+
245
+ if ( is_array( $attributes ) ) {
246
+ // Add lazy attributes to post tag
247
+ $allowedposttags[$tag] = array_merge( $attributes, $lazy_attributes );
248
+ }
249
+ }
250
+
251
+ // Add noscript tag to allowed post tags list
252
+ if ( ! isset( $allowedposttags['noscript'] ) ) {
253
+ $allowedposttags['noscript'] = array();
254
+ }
255
+
256
+ }
257
+
258
+ return $allowedposttags;
259
+ }
260
+
261
  static function filter_html( $content, $include_noscript = null ) {
262
  if ( is_admin() ) {
263
  return $content;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: a3rev, a3rev Software, nguyencongtuan
3
  Tags: a3 lazy load, Lazy Loading , image lazy load, lazyload
4
  Requires at least: 4.5
5
  Tested up to: 4.9.6
6
- Stable tag: 1.8.8
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -194,6 +194,12 @@ Filter tags to add to class name of theme to exclude lazy load on images or vide
194
 
195
  == Changelog ==
196
 
 
 
 
 
 
 
197
  = 1.8.8 - 2018/05/26 =
198
  * This maintenance update is for compatibility with WordPress 4.9.6 and the new GDPR compliance requirements for users in the EU
199
  * Tweak - Test for compatibility with WordPress 4.9.6
@@ -381,6 +387,9 @@ Filter tags to add to class name of theme to exclude lazy load on images or vide
381
 
382
  == Upgrade Notice ==
383
 
 
 
 
384
  = 1.8.8 =
385
  Maintenance Update. Compatibility WordPress 4.9.6 and the new GDPR compliance requirements for users in the EU
386
 
3
  Tags: a3 lazy load, Lazy Loading , image lazy load, lazyload
4
  Requires at least: 4.5
5
  Tested up to: 4.9.6
6
+ Stable tag: 1.8.9
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
194
 
195
  == Changelog ==
196
 
197
+ = 1.8.9 - 2018/06/04 =
198
+ * This Maintenance update has 2 code tweaks for compatibility with themes and plugins that load images via the wp_kses_post sanitizer as WooCommerce does since version 3.4.0 with widgets and on Cart page.
199
+ * Tweak - Append lazy attributes to attribute list of allowed post tags list so that lazy load can run on frontend when that content is output via wp_kses_post
200
+ * Tweak - Add noscript tag to allowed post tags list to resolve duplicate image if that image is output via wp_kses_post
201
+ * Tweak - Test for compatibility with WooCommerce version 3.4.1
202
+
203
  = 1.8.8 - 2018/05/26 =
204
  * This maintenance update is for compatibility with WordPress 4.9.6 and the new GDPR compliance requirements for users in the EU
205
  * Tweak - Test for compatibility with WordPress 4.9.6
387
 
388
  == Upgrade Notice ==
389
 
390
+ = 1.8.9 =
391
+ Maintenance update. This upgrade has 2 code tweaks for compatibility with themes and plugins that load images via the wp_kses_post sanitizer as WooCommerce does since version 3.4.0 with widgets and on Cart page.
392
+
393
  = 1.8.8 =
394
  Maintenance Update. Compatibility WordPress 4.9.6 and the new GDPR compliance requirements for users in the EU
395