Version Description
MobilePress compatible
Download this release
Release Info
Developer | bjornjohansen |
Plugin | BJ Lazy Load |
Version | 0.6.6 |
Comparing to | |
See all releases |
Code changes from version 0.6.5 to 0.6.6
- admin.php +10 -0
- bj-lazy-load.php +34 -3
- readme.txt +9 -3
admin.php
CHANGED
@@ -98,6 +98,16 @@ class BJLL_Admin_Page extends scbAdminPage {
|
|
98 |
);
|
99 |
}
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
echo $this->form_table( $optionfields );
|
102 |
|
103 |
}
|
98 |
);
|
99 |
}
|
100 |
|
101 |
+
if ( BJLL::has_mobilepress() ) {
|
102 |
+
$optionfields[] = array(
|
103 |
+
'title' => __( 'Disable on MobilePress', 'bj_lazy_load' ),
|
104 |
+
'type' => 'radio',
|
105 |
+
'name' => 'disable_on_mobilepress',
|
106 |
+
'value' => array( 'yes' => __( 'Yes', 'bj_lazy_load' ), 'no' => __( 'No', 'bj_lazy_load' ) ),
|
107 |
+
'desc' => sprintf( '<p class="description">%s</p>', __( 'Disables BJ Lazy Load when the MobilePress mobile theme is used', 'bj_lazy_load' ) ),
|
108 |
+
);
|
109 |
+
}
|
110 |
+
|
111 |
echo $this->form_table( $optionfields );
|
112 |
|
113 |
}
|
bj-lazy-load.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: BJ Lazy Load
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/bj-lazy-load/
|
5 |
Description: Lazy image loading makes your site load faster and saves bandwidth.
|
6 |
-
Version: 0.6.
|
7 |
Author: Bjørn Johansen
|
8 |
Author URI: http://twitter.com/bjornjohansen
|
9 |
License: GPL2
|
@@ -25,13 +25,22 @@ License: GPL2
|
|
25 |
|
26 |
*/
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
require_once( dirname(__FILE__) . '/scb/load.php' );
|
30 |
|
31 |
if ( ! class_exists( 'BJLL' ) ) {
|
32 |
class BJLL {
|
33 |
|
34 |
-
const version = '0.6.
|
35 |
protected $_placeholder_url;
|
36 |
protected $_skip_classes;
|
37 |
|
@@ -50,6 +59,10 @@ if ( ! class_exists( 'BJLL' ) ) {
|
|
50 |
return;
|
51 |
}
|
52 |
|
|
|
|
|
|
|
|
|
53 |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
54 |
|
55 |
$skip_classes = $options->get( 'skip_classes' );
|
@@ -216,7 +229,8 @@ if ( ! class_exists( 'BJLL' ) ) {
|
|
216 |
'skip_classes' => '',
|
217 |
'load_hidpi' => 'no',
|
218 |
'load_responsive' => 'no',
|
219 |
-
'disable_on_wptouch' => '
|
|
|
220 |
'infinite_scroll' => 'no'
|
221 |
) );
|
222 |
}
|
@@ -256,6 +270,23 @@ if ( ! class_exists( 'BJLL' ) ) {
|
|
256 |
|
257 |
return false;
|
258 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
|
260 |
}
|
261 |
}
|
3 |
Plugin Name: BJ Lazy Load
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/bj-lazy-load/
|
5 |
Description: Lazy image loading makes your site load faster and saves bandwidth.
|
6 |
+
Version: 0.6.6
|
7 |
Author: Bjørn Johansen
|
8 |
Author URI: http://twitter.com/bjornjohansen
|
9 |
License: GPL2
|
25 |
|
26 |
*/
|
27 |
|
28 |
+
function print_filters_for( $hook = '' ) {
|
29 |
+
global $wp_filter;
|
30 |
+
if( empty( $hook ) || !isset( $wp_filter[$hook] ) )
|
31 |
+
return;
|
32 |
+
|
33 |
+
print '<pre>';
|
34 |
+
print_r( $wp_filter[$hook] );
|
35 |
+
print '</pre>';
|
36 |
+
}
|
37 |
|
38 |
require_once( dirname(__FILE__) . '/scb/load.php' );
|
39 |
|
40 |
if ( ! class_exists( 'BJLL' ) ) {
|
41 |
class BJLL {
|
42 |
|
43 |
+
const version = '0.6.6';
|
44 |
protected $_placeholder_url;
|
45 |
protected $_skip_classes;
|
46 |
|
59 |
return;
|
60 |
}
|
61 |
|
62 |
+
if ( 'yes' == $options->get( 'disable_on_mobilepress' ) && self::is_mobilepress() ) {
|
63 |
+
return;
|
64 |
+
}
|
65 |
+
|
66 |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
67 |
|
68 |
$skip_classes = $options->get( 'skip_classes' );
|
229 |
'skip_classes' => '',
|
230 |
'load_hidpi' => 'no',
|
231 |
'load_responsive' => 'no',
|
232 |
+
'disable_on_wptouch' => 'yes',
|
233 |
+
'disable_on_mobilepress' => 'yes',
|
234 |
'infinite_scroll' => 'no'
|
235 |
) );
|
236 |
}
|
270 |
|
271 |
return false;
|
272 |
}
|
273 |
+
|
274 |
+
static function is_mobilepress() {
|
275 |
+
|
276 |
+
if ( function_exists( 'mopr_get_option' ) && WP_CONTENT_DIR . mopr_get_option( 'mobile_theme_root', 1 ) == get_theme_root() ) {
|
277 |
+
return true;
|
278 |
+
}
|
279 |
+
|
280 |
+
return false;
|
281 |
+
}
|
282 |
+
|
283 |
+
static function has_mobilepress() {
|
284 |
+
if ( class_exists( 'Mobilepress_core' ) ) {
|
285 |
+
return true;
|
286 |
+
}
|
287 |
+
|
288 |
+
return false;
|
289 |
+
}
|
290 |
|
291 |
}
|
292 |
}
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: images, iframes, lazy loading, jquery, javascript, optimize, performance,
|
|
5 |
Author URI: http://twitter.com/bjornjohansen
|
6 |
Requires at least: 3.3
|
7 |
Tested up to: 3.5.1
|
8 |
-
Stable tag: 0.6.
|
9 |
|
10 |
Lazy loading makes your site load faster and saves bandwidth. Uses jQuery and degrades gracefully for non-js users. Works with both images and iframes.
|
11 |
|
@@ -57,7 +57,10 @@ Probably, your theme does not call wp_footer(). Edit the plugin settings to load
|
|
57 |
= How can I verify that the plugin is working? =
|
58 |
Check your HTML source or see the magic at work in Web Inspector, FireBug or similar.
|
59 |
|
60 |
-
== Changelog ==
|
|
|
|
|
|
|
61 |
|
62 |
= Version 0.6.5 =
|
63 |
* Iframe lazy loading is now compatible with Gravity Forms' ajax forms.
|
@@ -149,7 +152,10 @@ Check your HTML source or see the magic at work in Web Inspector, FireBug or sim
|
|
149 |
* Released 2011-12-05
|
150 |
* It works (or at least it does for me)
|
151 |
|
152 |
-
== Upgrade Notice ==
|
|
|
|
|
|
|
153 |
|
154 |
= 0.6.5 =
|
155 |
Improved compability with Gravity Forms
|
5 |
Author URI: http://twitter.com/bjornjohansen
|
6 |
Requires at least: 3.3
|
7 |
Tested up to: 3.5.1
|
8 |
+
Stable tag: 0.6.6
|
9 |
|
10 |
Lazy loading makes your site load faster and saves bandwidth. Uses jQuery and degrades gracefully for non-js users. Works with both images and iframes.
|
11 |
|
57 |
= How can I verify that the plugin is working? =
|
58 |
Check your HTML source or see the magic at work in Web Inspector, FireBug or similar.
|
59 |
|
60 |
+
== Changelog ==
|
61 |
+
|
62 |
+
= Version 0.6.6 =
|
63 |
+
* Option to disable BJ Lazy Load for MobilePress
|
64 |
|
65 |
= Version 0.6.5 =
|
66 |
* Iframe lazy loading is now compatible with Gravity Forms' ajax forms.
|
152 |
* Released 2011-12-05
|
153 |
* It works (or at least it does for me)
|
154 |
|
155 |
+
== Upgrade Notice ==
|
156 |
+
|
157 |
+
= 0.6.6 =
|
158 |
+
MobilePress compatible
|
159 |
|
160 |
= 0.6.5 =
|
161 |
Improved compability with Gravity Forms
|