This is a great plugin, actually, but has a little bug. When someone lefts a comment, then the page reloads and scrolls down automatically to the comment text. After this, images from sidebar are don’t load.
]]>Hello,
I’m trying to lazy load a background video. Do I add a class so it’s targeted via the plugin?
Thanks
]]>Here’s my issue.
My site was created a long time ago, and it has lots of pages. In pages, there are lots of links and images.
Now, I decided to use Cloudflare Flexible SSL on my site. It works just fine (with either (one, two) of the plugins, but there is always an issue whenever I use any lazyload plugin to lazyload images – they load with HTTP in src attribute, because they seem to parse it at some point and carry it all the way till the page loads and script is used.
To make sure HTTPS works everywhere, I enabled Cloudflare’s “Automatic HTTPS Rewrites” function, but it doesn’t help with the issue as it doesn’t seem to rewrite contents of data-lazy-src in .
I tinhk the proper way to do it wolud be removing protocols from links to resources in content by myself (either by hand or via regex clean-up in the database), but I thought, as I settled on using your plugin of all the alternatives (they all share this flaw, as the way they work is identical I suppose), I might as well fix it with modyfing plugin source.
So, here’s the fix to be put in easy-loader-php.php:
...
foreach ( $matches[0] as $imgHTML ) {
// Support for Cloudflare (and the like) flexible SSL: remove protocols from src, data-src-lazy and noscript img
// Omit both HTTP and HTTPS from the beginnig of an image src link
$imgHTML = preg_replace( '/https*:/i', '', $imgHTML );
// Omit only HTTP
//$imgHTML = preg_replace( '/http:/i', '', $imgHTML );
preg_match( '/width=["|\']([^("|\')]+)["|\']/i', $imgHTML, $width_match );
...
I would suggest adding a checkbox in plugin’s options to enable/disable this behaviour at will, as it is needed only in this case, as far as I can tell. The least amount of processing arrays, the better, I guess.
]]>Please consider fixing these errors.
Warning: Division by zero in …/public/wp-content/plugins/easy-lazy-loader/easy-lazy-loader.php on line 949
Warning: imagecreatetruecolor() expects parameter 1 to be integer, float given in …/public/wp-content/plugins/easy-lazy-loader/easy-lazy-loader.php on line 958
Warning: imagecolorallocate() expects parameter 1 to be resource, null given in …/public/wp-content/plugins/easy-lazy-loader/easy-lazy-loader.php on line 968
Warning: imagecolortransparent() expects parameter 1 to be resource, null given in …/public/wp-content/plugins/easy-lazy-loader/easy-lazy-loader.php on line 969
Warning: imagedestroy() expects parameter 1 to be resource, null given in …/public/wp-content/plugins/easy-lazy-loader/easy-lazy-loader.php on line 993
]]>I’ve started using this plugin to lazy load images, including a custom method my theme uses for featured images. I noticed this issue on an article that doesn’t have a featured image at all, but I think the issue might occur in other situations as well.
In /wp-content/plugins/easy-lazy-loader/easy-lazy-loader.php on line 652
, I get the error that placeholder_color
is undefined.
Here’s how the code appears to be working:
// use low res preview image as placeholder if applicable
if ( 'lowres' === $placeholder_type && $img_id !== false ) {
$tiny_img_data = wp_get_attachment_image_src( $img_id, $this->OPTIONS['placeholder_image_size'] );
$tiny_url = $tiny_img_data[0];
$placeholder_url_used = $tiny_url;
}
// use color as placeholder if applicable
else if ( 'color' === $placeholder_type && class_exists( 'WordPress_Gallery_Extra' ) ) {
$placeholder_color = "";
if( $img_id !== false ) {
$placeholder_color = get_post_meta( $img_id, '_wgextra_dominant_color', true );
}
if ( !$placeholder_color ) {
$placeholder_color = $this->OPTIONS['default_image_placeholder_color'];
}
$placeholder_url_used = self::create_placeholder( $placeholder_color, (int) $width, (int) $height, 'Image loading...' );
}
// use transparent as placeholder if applicable
else if ( 'default' === $placeholder_type && !is_string( $width ) && !is_string( $height ) ) {
$placeholder_url_used = self::create_placeholder( $placeholder_color, (int) $width, (int) $height );
}
If I understand correctly, placeholder_color
is only defined if WordPress_Gallery_Extra
exists, but even if it does not exist, the plugin attempts to use it:
// use transparent as placeholder if applicable
else if ( 'default' === $placeholder_type && !is_string( $width ) && !is_string( $height ) ) {
$placeholder_url_used = self::create_placeholder( $placeholder_color, (int) $width, (int) $height );
}
It doesn’t seem like anything is keeping this placeholder method from being called, while looking for a color value that may not exist.
]]>Hi dear
I am testing the plugin and works fine but I have 2 problems:
adsense adverts load very slow, have a conflict with iframes?
i am testing low-res, but only load one time, after this first time the plugin not working
Thanks for support
]]>