Version Description
- 2014/12/23 =
- Tweak - Applied lazy load for 'wp_get_attachment_image_attributes' filter tag for WordPress default [gallery] shortcode
- Tweak - Added link to a3 Lazy Load wordpress.org support forum on plugins description that show on plugins menu
- Dev - Defined 'a3_lazy_load_enable' function when Enable Lazy Load is set to ON. Plugin and Theme developers can use the function to edit their image attribute so that a3 lazy load script can apply to the images.
- Dev - Defined 'a3_lazy_load_skip_classes' filter tag. Developers can add another class css name for images that they don't want lazy load applied too.
- Fix - Lazy Load does not apply to images added by shortcode, excluding the WordPress default [gallery] shortcode
Download this release
Release Info
Developer | a3rev |
Plugin | a3 Lazy Load |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
- a3-lazy-load.php +10 -2
- admin/a3-lazy-load-admin.php +2 -2
- classes/class-a3-lazy-load.php +21 -3
- languages/a3_lazy_load.mo +0 -0
- languages/a3_lazy_load.po +10 -4
- readme.txt +24 -12
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.0.
|
6 |
Author: a3 Revolution
|
7 |
Author URI: http://www.a3rev.com/
|
8 |
Requires at least: 3.8
|
@@ -17,7 +17,7 @@ License: GPLv2 or later
|
|
17 |
*/
|
18 |
?>
|
19 |
<?php
|
20 |
-
define('A3_LAZY_VERSION', '1.0.
|
21 |
define('A3_LAZY_LOAD_FILE_PATH', dirname(__FILE__));
|
22 |
define('A3_LAZY_LOAD_DIR_NAME', basename(A3_LAZY_LOAD_FILE_PATH));
|
23 |
define('A3_LAZY_LOAD_FOLDER', dirname(plugin_basename(__FILE__)));
|
@@ -43,6 +43,14 @@ include( 'classes/class-a3-lazy-load-filter.php' );
|
|
43 |
|
44 |
include( 'admin/a3-lazy-load-admin.php' );
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
/**
|
47 |
* Call when the plugin is activated
|
48 |
*/
|
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.0.1
|
6 |
Author: a3 Revolution
|
7 |
Author URI: http://www.a3rev.com/
|
8 |
Requires at least: 3.8
|
17 |
*/
|
18 |
?>
|
19 |
<?php
|
20 |
+
define('A3_LAZY_VERSION', '1.0.1');
|
21 |
define('A3_LAZY_LOAD_FILE_PATH', dirname(__FILE__));
|
22 |
define('A3_LAZY_LOAD_DIR_NAME', basename(A3_LAZY_LOAD_FILE_PATH));
|
23 |
define('A3_LAZY_LOAD_FOLDER', dirname(plugin_basename(__FILE__)));
|
43 |
|
44 |
include( 'admin/a3-lazy-load-admin.php' );
|
45 |
|
46 |
+
// Defined this function for check Lazy Load is enabled that 3rd party plugins or theme can use to check
|
47 |
+
$a3_lazy_load_global_settings = get_option( 'a3_lazy_load_global_settings', array( 'a3l_apply_to_loadimages' => 1 ) );
|
48 |
+
if ( 1 == $a3_lazy_load_global_settings['a3l_apply_to_loadimages'] ) {
|
49 |
+
function a3_lazy_load_enable() {
|
50 |
+
return true;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
/**
|
55 |
* Call when the plugin is activated
|
56 |
*/
|
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.0.
|
6 |
|
7 |
// Set Settings Default from Admin Init
|
8 |
global $a3_lazy_load_admin_init;
|
@@ -25,7 +25,7 @@ function a3_lazy_load_init() {
|
|
25 |
|
26 |
load_plugin_textdomain( 'a3_lazy_load', false, A3_LAZY_LOAD_FOLDER.'/languages' );
|
27 |
|
28 |
-
update_option('a3_lazy_load_version', '1.0.
|
29 |
}
|
30 |
|
31 |
global $a3_lazy_load_admin_init;
|
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.0.1');
|
6 |
|
7 |
// Set Settings Default from Admin Init
|
8 |
global $a3_lazy_load_admin_init;
|
25 |
|
26 |
load_plugin_textdomain( 'a3_lazy_load', false, A3_LAZY_LOAD_FOLDER.'/languages' );
|
27 |
|
28 |
+
update_option('a3_lazy_load_version', '1.0.1');
|
29 |
}
|
30 |
|
31 |
global $a3_lazy_load_admin_init;
|
classes/class-a3-lazy-load.php
CHANGED
@@ -42,15 +42,15 @@ class A3_Lazy_Load
|
|
42 |
add_filter( 'a3_lazy_load_html', array( $this, 'filter' ), 10, 1 );
|
43 |
add_filter( 'a3_lazy_load_images', array( $this, 'filter' ), 10, 1 );
|
44 |
|
45 |
-
$skip_classes = $a3_lazy_load_global_settings['a3l_skip_image_with_class'];
|
46 |
if ( strlen( trim( $skip_classes ) ) ) {
|
47 |
-
$this->_skip_classes = array_map( 'trim', explode( ',', $
|
48 |
}
|
49 |
|
50 |
$this->_placeholder_url = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
|
51 |
|
52 |
if ( $a3_lazy_load_global_settings['a3l_apply_to_content'] == true ) {
|
53 |
-
add_filter( 'the_content', array( $this, '
|
54 |
}
|
55 |
if ( $a3_lazy_load_global_settings['a3l_apply_to_textwidget'] == true ) {
|
56 |
add_filter( 'widget_text', array( $this, 'filter' ), 200 );
|
@@ -143,6 +143,24 @@ class A3_Lazy_Load
|
|
143 |
return false;
|
144 |
}
|
145 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
static function filter( $content ) {
|
147 |
if( is_admin() ){
|
148 |
return $content;
|
42 |
add_filter( 'a3_lazy_load_html', array( $this, 'filter' ), 10, 1 );
|
43 |
add_filter( 'a3_lazy_load_images', array( $this, 'filter' ), 10, 1 );
|
44 |
|
45 |
+
$skip_classes = apply_filters( 'a3_lazy_load_skip_classes', $a3_lazy_load_global_settings['a3l_skip_image_with_class'] );
|
46 |
if ( strlen( trim( $skip_classes ) ) ) {
|
47 |
+
$this->_skip_classes = array_map( 'trim', explode( ',', $skip_classes ) );
|
48 |
}
|
49 |
|
50 |
$this->_placeholder_url = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
|
51 |
|
52 |
if ( $a3_lazy_load_global_settings['a3l_apply_to_content'] == true ) {
|
53 |
+
add_filter( 'the_content', array( $this, 'filter_content' ), 7 );
|
54 |
}
|
55 |
if ( $a3_lazy_load_global_settings['a3l_apply_to_textwidget'] == true ) {
|
56 |
add_filter( 'widget_text', array( $this, 'filter' ), 200 );
|
143 |
return false;
|
144 |
}
|
145 |
|
146 |
+
static function filter_content( $content ) {
|
147 |
+
$A3_Lazy_Load = A3_Lazy_Load::_instance();
|
148 |
+
add_filter( 'wp_get_attachment_image_attributes', array( $A3_Lazy_Load, 'get_attachment_image_attributes' ), 200 );
|
149 |
+
|
150 |
+
return $A3_Lazy_Load->filter( $content );
|
151 |
+
}
|
152 |
+
|
153 |
+
static function get_attachment_image_attributes( $attr ) {
|
154 |
+
$A3_Lazy_Load = A3_Lazy_Load::_instance();
|
155 |
+
|
156 |
+
$attr['data-src'] = $attr['src'];
|
157 |
+
$attr['src'] = $A3_Lazy_Load->_placeholder_url;
|
158 |
+
$attr['class'] = 'lazy-hidden '. $attr['class'];
|
159 |
+
$attr['data-lazy-type'] = 'image';
|
160 |
+
|
161 |
+
return $attr;
|
162 |
+
}
|
163 |
+
|
164 |
static function filter( $content ) {
|
165 |
if( is_admin() ){
|
166 |
return $content;
|
languages/a3_lazy_load.mo
CHANGED
Binary file
|
languages/a3_lazy_load.po
CHANGED
@@ -2,8 +2,8 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: a3 Lazy Load\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: 2014-12-
|
6 |
-
"PO-Revision-Date: 2014-12-
|
7 |
"Last-Translator: Nguyen Cong Tuan <mr.nguyencongtuan@gmail.com>\n"
|
8 |
"Language-Team: a3rev\n"
|
9 |
"Language: en\n"
|
@@ -212,6 +212,7 @@ msgid "Reset Settings"
|
|
212 |
msgstr ""
|
213 |
|
214 |
#: admin/admin-pages/admin-settings-page.php:62
|
|
|
215 |
msgid "a3 Lazy Load"
|
216 |
msgstr ""
|
217 |
|
@@ -219,6 +220,11 @@ msgstr ""
|
|
219 |
msgid "Lazy Load"
|
220 |
msgstr ""
|
221 |
|
|
|
|
|
|
|
|
|
|
|
222 |
#: admin/admin-ui.php:135
|
223 |
#, php-format
|
224 |
msgid "Settings inside this yellow border are %s Features."
|
@@ -370,6 +376,6 @@ msgstr ""
|
|
370 |
msgid "Comming Soon"
|
371 |
msgstr ""
|
372 |
|
373 |
-
#: classes/class-a3-lazy-load-filter.php:
|
374 |
-
msgid "
|
375 |
msgstr ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: a3 Lazy Load\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2014-12-23 17:37+0700\n"
|
6 |
+
"PO-Revision-Date: 2014-12-23 17:37+0700\n"
|
7 |
"Last-Translator: Nguyen Cong Tuan <mr.nguyencongtuan@gmail.com>\n"
|
8 |
"Language-Team: a3rev\n"
|
9 |
"Language: en\n"
|
212 |
msgstr ""
|
213 |
|
214 |
#: admin/admin-pages/admin-settings-page.php:62
|
215 |
+
#: admin/admin-pages/admin-settings-page.php:77
|
216 |
msgid "a3 Lazy Load"
|
217 |
msgstr ""
|
218 |
|
220 |
msgid "Lazy Load"
|
221 |
msgstr ""
|
222 |
|
223 |
+
#: admin/admin-pages/admin-settings-page.php:78
|
224 |
+
#: classes/class-a3-lazy-load-filter.php:16
|
225 |
+
msgid "Settings"
|
226 |
+
msgstr ""
|
227 |
+
|
228 |
#: admin/admin-ui.php:135
|
229 |
#, php-format
|
230 |
msgid "Settings inside this yellow border are %s Features."
|
376 |
msgid "Comming Soon"
|
377 |
msgstr ""
|
378 |
|
379 |
+
#: classes/class-a3-lazy-load-filter.php:17
|
380 |
+
msgid "Support"
|
381 |
msgstr ""
|
readme.txt
CHANGED
@@ -4,17 +4,17 @@ Contributors: a3rev, A3 Revolution Software Development team
|
|
4 |
Tags: a3 lazy load, Lazy Loading , image lazy load, lazyload
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.1.0
|
7 |
-
Stable tag: 1.0.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
11 |
-
Use a3 Lazy Load to instantly improve your sites load time while dramatically improving site visitors user experience.
|
12 |
-
|
13 |
== Description ==
|
14 |
|
15 |
Inspired by Facebook lazy Load UI - a3 lazy Load is a Mobile Oriented, easily customizable plugin that will speed up site performance, the more content heavy your site the better the plugin will perform and the more you will see the improvements in performance. a3 Lazy Load is inspired by and powered by the ressio [Lazy-Load-xt JavaScript](https://github.com/ressio/lazy-load-xt).
|
16 |
|
17 |
-
a3 Lazy load reduces the number of http calls when a page loads by only loading elements on a page that are visible in the users browser. As the user scroll down the page the next lot of elements are loaded as they become visible in the view port.
|
18 |
|
19 |
= Easy Configuration =
|
20 |
|
@@ -28,7 +28,7 @@ From the admin panel use ON | OFF switches to activate or deactivate lazy load o
|
|
28 |
|
29 |
= Lazy Load Effects =
|
30 |
|
31 |
-
a3 lazy Load gives you the option to lazy load images with a FADE IN or SPINNER effect.
|
32 |
|
33 |
* FADEIN [see demo](http://ressio.github.io/lazy-load-xt/demo/fadein.htm)
|
34 |
* SPINNER [see demo](http://ressio.github.io/lazy-load-xt/demo/spinner.htm)
|
@@ -39,7 +39,7 @@ a3 lazy Load is built and tested to be fully compatible with the WooCommerce plu
|
|
39 |
|
40 |
= Asset Load =
|
41 |
|
42 |
-
a3 Lazy Load gives you the option to load its script from your sites HEAD or from the FOOT.
|
43 |
|
44 |
* Note that your theme must have the wp_footer() function if you select FOOTER load.
|
45 |
* Note the plugin CSS is always loaded from the HEAD.
|
@@ -83,10 +83,10 @@ a3 lazy Load is tested 100% compatible with all major browsers.
|
|
83 |
|
84 |
* Full support for responsive images.
|
85 |
* Full support of jQueryMobile framework
|
86 |
-
* WordPress Multi site ready.
|
87 |
* Backend support for RTL display.
|
88 |
* Translation ready
|
89 |
-
|
90 |
|
91 |
== Installation ==
|
92 |
|
@@ -95,7 +95,7 @@ a3 lazy Load is tested 100% compatible with all major browsers.
|
|
95 |
* WordPress 4.0
|
96 |
* PHP version 5.2.4 or greater
|
97 |
* MySQL version 5.1.73 or greater
|
98 |
-
|
99 |
= Automatic installation =
|
100 |
|
101 |
Automatic installation is the easiest option as WordPress handles the file transfers itself and you don't even need to leave your web browser. To do an automatic install of a3 Lazy Load, log in to your WordPress admin panel, navigate to the Plugins menu and click Add New. Search a3 Lazy load, select and install.
|
@@ -103,19 +103,31 @@ Automatic installation is the easiest option as WordPress handles the file trans
|
|
103 |
== Screenshots ==
|
104 |
|
105 |
1. Admin Dashboard.
|
106 |
-
|
107 |
-
|
108 |
== Usage ==
|
109 |
|
110 |
1. Install and activate the plugin
|
111 |
|
112 |
2. On wp-admin a3 Lazy Laod one page admin panel check the settings.
|
113 |
|
114 |
-
3. Enjoy
|
115 |
|
116 |
|
117 |
== Changelog ==
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
= 1.0.0 - 2014/12/20 =
|
120 |
* First working release
|
121 |
|
|
|
|
|
|
|
|
|
|
4 |
Tags: a3 lazy load, Lazy Loading , image lazy load, lazyload
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.1.0
|
7 |
+
Stable tag: 1.0.1
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
11 |
+
Use a3 Lazy Load to instantly improve your sites load time while dramatically improving site visitors user experience.
|
12 |
+
|
13 |
== Description ==
|
14 |
|
15 |
Inspired by Facebook lazy Load UI - a3 lazy Load is a Mobile Oriented, easily customizable plugin that will speed up site performance, the more content heavy your site the better the plugin will perform and the more you will see the improvements in performance. a3 Lazy Load is inspired by and powered by the ressio [Lazy-Load-xt JavaScript](https://github.com/ressio/lazy-load-xt).
|
16 |
|
17 |
+
a3 Lazy load reduces the number of http calls when a page loads by only loading elements on a page that are visible in the users browser. As the user scroll down the page the next lot of elements are loaded as they become visible in the view port.
|
18 |
|
19 |
= Easy Configuration =
|
20 |
|
28 |
|
29 |
= Lazy Load Effects =
|
30 |
|
31 |
+
a3 lazy Load gives you the option to lazy load images with a FADE IN or SPINNER effect.
|
32 |
|
33 |
* FADEIN [see demo](http://ressio.github.io/lazy-load-xt/demo/fadein.htm)
|
34 |
* SPINNER [see demo](http://ressio.github.io/lazy-load-xt/demo/spinner.htm)
|
39 |
|
40 |
= Asset Load =
|
41 |
|
42 |
+
a3 Lazy Load gives you the option to load its script from your sites HEAD or from the FOOT.
|
43 |
|
44 |
* Note that your theme must have the wp_footer() function if you select FOOTER load.
|
45 |
* Note the plugin CSS is always loaded from the HEAD.
|
83 |
|
84 |
* Full support for responsive images.
|
85 |
* Full support of jQueryMobile framework
|
86 |
+
* WordPress Multi site ready.
|
87 |
* Backend support for RTL display.
|
88 |
* Translation ready
|
89 |
+
|
90 |
|
91 |
== Installation ==
|
92 |
|
95 |
* WordPress 4.0
|
96 |
* PHP version 5.2.4 or greater
|
97 |
* MySQL version 5.1.73 or greater
|
98 |
+
|
99 |
= Automatic installation =
|
100 |
|
101 |
Automatic installation is the easiest option as WordPress handles the file transfers itself and you don't even need to leave your web browser. To do an automatic install of a3 Lazy Load, log in to your WordPress admin panel, navigate to the Plugins menu and click Add New. Search a3 Lazy load, select and install.
|
103 |
== Screenshots ==
|
104 |
|
105 |
1. Admin Dashboard.
|
106 |
+
|
107 |
+
|
108 |
== Usage ==
|
109 |
|
110 |
1. Install and activate the plugin
|
111 |
|
112 |
2. On wp-admin a3 Lazy Laod one page admin panel check the settings.
|
113 |
|
114 |
+
3. Enjoy
|
115 |
|
116 |
|
117 |
== Changelog ==
|
118 |
|
119 |
+
= 1.0.1 - 2014/12/23 =
|
120 |
+
* Tweak - Applied lazy load for 'wp_get_attachment_image_attributes' filter tag for WordPress default [gallery] shortcode
|
121 |
+
* Tweak - Added link to a3 Lazy Load wordpress.org support forum on plugins description that show on plugins menu
|
122 |
+
* Dev - Defined 'a3_lazy_load_enable' function when Enable Lazy Load is set to ON. Plugin and Theme developers can use the function to edit their image attribute so that a3 lazy load script can apply to the images.
|
123 |
+
* Dev - Defined 'a3_lazy_load_skip_classes' filter tag. Developers can add another class css name for images that they don't want lazy load applied too.
|
124 |
+
* Fix - Lazy Load does not apply to images added by shortcode, excluding the WordPress default [gallery] shortcode
|
125 |
+
|
126 |
= 1.0.0 - 2014/12/20 =
|
127 |
* First working release
|
128 |
|
129 |
+
|
130 |
+
== Update Notice ==
|
131 |
+
|
132 |
+
= 1.0.1 =
|
133 |
+
Upgrade your plugin now for apply lazy load to shortcodes fix plus plus a new developer function and class.
|