A couple other bugs impacting functionality
-
In addition to my earlier post about JavaScript support, here are a couple other bugs in the Rocket Lazy Load plugin which impact basic functionality… I have also provided quick patches below to address these:
1. The plugin promises to lazy load <iframe>s when turned on, but except for YouTube iframes, this didn’t seem to work for me… The reason is because of a slight coding issue in rocket-lazy-load.php where it’s reassigning the same variable without ever using the first result…
Original code:
$iframe_lazyload = str_replace( $iframe[2], ' data-rocket-lazyload="fitvidscompatible" data-lazy-src="' . esc_url( $iframe[1] ) . '"' . $iframe[2], $iframe[0] );Replaced with:
$iframe_lazyload = str_replace( $iframe[2], ' data-rocket-lazyload="fitvidscompatible" data-lazy-src="' . esc_url( $iframe[1] ) . '"' . $iframe[2], $iframe_lazyload );2. As noted, the plugin does replace YouTube video iframes with a <div> plus an img for lazy loading… However, oddly, it doesn’t end up lazy loading its own replaced img!
So I added the following (as well as “alt” tags)…
Original code:
<script>function lazyLoadThumb(e){var t='<img src="https://i.ytimg.com/vi/ID/$thumbnail_resolution.jpg">',a='<div class="play"></div>';Replaced with:
<script>function lazyLoadThumb(e){var t='<img src="" data-lazy-src="https://i.ytimg.com/vi/ID/$thumbnail_resolution.jpg" alt="Play Video" title="Play Video">',a='<div class="play"></div>';Ideally, it would use the “placeholder” here for the original img, but the patch above did the trick for me.
Again, I like this plugin a lot and will continue using it – just hope these fixes get integrated properly into the main plugin code base. Thanks again!
The topic ‘A couple other bugs impacting functionality’ is closed to new replies.