Title: Script version
Last modified: January 17, 2021

---

# Script version

 *  Resolved [Camilo](https://wordpress.org/support/users/camilo517/)
 * (@camilo517)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/script-version/)
 * The plugin uses version 16.1 and the latest version is 17.3 of the lazy load 
   script
    [https://github.com/verlok/vanilla-lazyload/releases](https://github.com/verlok/vanilla-lazyload/releases)
   Improvements have been added such as the script now weighs less and various performance
   improvements

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [WP Media](https://wordpress.org/support/users/wp_media/)
 * (@wp_media)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/script-version/#post-13933460)
 * Hi [@camilo517](https://wordpress.org/support/users/camilo517/),
 * Thank you for this feedback, I have passed it to our developers.
 * Best Regards,
    Jurica
 *  [roam92](https://wordpress.org/support/users/roam92/)
 * (@roam92)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/script-version/#post-14175689)
 * Hi [@wp_media](https://wordpress.org/support/users/wp_media/),
 * Any chance this will be updated soon?
 * Also wondering if the inline <script> that the plugin puts into every page can
   be minified? (would save 1.5k per pageload)
 * Thanks very much!
 *  Plugin Author [WP Media](https://wordpress.org/support/users/wp_media/)
 * (@wp_media)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/script-version/#post-14183880)
 * Hi [@roam92](https://wordpress.org/support/users/roam92/) !
 * Thank you for your questions!
 * Yes, we have a high priority for the update. You can follow this GitHub thread
   for the updates: [https://github.com/wp-media/wp-rocket/issues/3510](https://github.com/wp-media/wp-rocket/issues/3510)
 * The inline script is already minified (here is a screenshot of the markup: [https://jmp.sh/AX9SqbQ](https://jmp.sh/AX9SqbQ)),
   as well as the lazyload.min.js which is loaded at the footer asynchronously.
 * Best regards,
    Natalia
 *  [roam92](https://wordpress.org/support/users/roam92/)
 * (@roam92)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/script-version/#post-14196113)
 * Hi [@wp_media](https://wordpress.org/support/users/wp_media/) – thank you for
   your fast response!
 * That’s great news that the script update is coming and is high priority.
 * Regarding the minification, I don’t see that in the current version 2.3.4… When
   I view source on any page of my site, the inline script is _not_ minified.
 * Screenshot here: [https://prnt.sc/10oa5vi](https://prnt.sc/10oa5vi)
 * So, at a loss to explain why you’re seeing it but I’m not? Any possible reason?
 * Thanks again!
 *  Plugin Contributor [WP Rocket](https://wordpress.org/support/users/wp_rocket/)
 * (@wp_rocket)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/script-version/#post-14202899)
 * Hi [@roam92](https://wordpress.org/support/users/roam92/)!
 * Jorge from WP Rocket here. Thank you for taking the time to contact support.
 * To be able to check that, would you please provide the whole script from the 
   starting <script> tag and so we’re able to check why this is happening?
 * Thank you for your time and patience on this matter. I’ll be waiting for your
   reply. I hope you have a great day!
 * Regards,
 *  [roam92](https://wordpress.org/support/users/roam92/)
 * (@roam92)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/script-version/#post-14203309)
 * Sure, here it is, straight from “View Source” – and inline (unminified) at the
   very bottom of each page on my site:
 *     ```
       <script>window.lazyLoadOptions = {
                       elements_selector: "img[data-lazy-src],.rocket-lazyload,iframe[data-lazy-src]",
                       data_src: "lazy-src",
                       data_srcset: "lazy-srcset",
                       data_sizes: "lazy-sizes",
                       class_loading: "lazyloading",
                       class_loaded: "lazyloaded",
                       threshold: 300,
                       callback_loaded: function(element) {
                           if ( element.tagName === "IFRAME" && element.dataset.rocketLazyload == "fitvidscompatible" ) {
                               if (element.classList.contains("lazyloaded") ) {
                                   if (typeof window.jQuery != "undefined") {
                                       if (jQuery.fn.fitVids) {
                                           jQuery(element).parent().fitVids();
                                       }
                                   }
                               }
                           }
                       }};
               window.addEventListener('LazyLoad::Initialized', function (e) {
                   var lazyLoadInstance = e.detail.instance;
   
                   if (window.MutationObserver) {
                       var observer = new MutationObserver(function(mutations) {
                           var image_count = 0;
                           var iframe_count = 0;
                           var rocketlazy_count = 0;
   
                           mutations.forEach(function(mutation) {
                               for (i = 0; i < mutation.addedNodes.length; i++) {
                                   if (typeof mutation.addedNodes[i].getElementsByTagName !== 'function') {
                                       return;
                                   }
   
                                  if (typeof mutation.addedNodes[i].getElementsByClassName !== 'function') {
                                       return;
                                   }
   
                                   images = mutation.addedNodes[i].getElementsByTagName('img');
                                   is_image = mutation.addedNodes[i].tagName == "IMG";
                                   iframes = mutation.addedNodes[i].getElementsByTagName('iframe');
                                   is_iframe = mutation.addedNodes[i].tagName == "IFRAME";
                                   rocket_lazy = mutation.addedNodes[i].getElementsByClassName('rocket-lazyload');
   
                                   image_count += images.length;
       			                iframe_count += iframes.length;
       			                rocketlazy_count += rocket_lazy.length;
   
                                   if(is_image){
                                       image_count += 1;
                                   }
   
                                   if(is_iframe){
                                       iframe_count += 1;
                                   }
                               }
                           } );
   
                           if(image_count > 0 || iframe_count > 0 || rocketlazy_count > 0){
                               lazyLoadInstance.update();
                           }
                       } );
   
                       var b      = document.getElementsByTagName("body")[0];
                       var config = { childList: true, subtree: true };
   
                       observer.observe(b, config);
                   }
               }, false);</script><script async data-no-minify="1" async src="/wp-content/plugins/rocket-lazy-load/assets/js/16.1/lazyload.min.js"></script><script>function lazyLoadThumb(e){var t='<img loading="lazy" data-lazy-src="https://i.ytimg.com/vi/ID/hqdefault.jpg" alt="" width="480" height="360"><noscript><img src="https://i.ytimg.com/vi/ID/hqdefault.jpg" alt="" width="480" height="360"></noscript>',a='<div class="play"></div>';return t.replace("ID",e)+a}function lazyLoadYoutubeIframe(){var e=document.createElement("iframe"),t="ID?autoplay=1";t+=0===this.dataset.query.length?'':'&'+this.dataset.query;e.setAttribute("src",t.replace("ID",this.dataset.src)),e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen","1"),e.setAttribute("allow", "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"),this.parentNode.replaceChild(e,this)}document.addEventListener("DOMContentLoaded",function(){var e,t,a=document.getElementsByClassName("rll-youtube-player");for(t=0;t<a.length;t++)e=document.createElement("div"),e.setAttribute("data-id",a[t].dataset.id),e.setAttribute("data-query", a[t].dataset.query),e.setAttribute("data-src", a[t].dataset.src),e.innerHTML=lazyLoadThumb(a[t].dataset.id),e.onclick=lazyLoadYoutubeIframe,a[t].appendChild(e)});</script>
       ```
   
 *  Plugin Contributor [WP Rocket](https://wordpress.org/support/users/wp_rocket/)
 * (@wp_rocket)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/script-version/#post-14210308)
 * Hi [@roam92](https://wordpress.org/support/users/roam92/)!
 * We don’t indeed minify the inline script. There is no minification method on 
   our plugin.
 * We try to keep things simple 🙂
 * I just added it as a feature request – [https://github.com/wp-media/rocket-lazy-load/issues/122](https://github.com/wp-media/rocket-lazy-load/issues/122)
 * It’s up to the product team to decide 🙂
 * Best regards,
 * Adame
 *  [roam92](https://wordpress.org/support/users/roam92/)
 * (@roam92)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/script-version/#post-14210890)
 * Hello Adame,
 * Appreciate that – thank you for the clarification, and for the update with feature
   request!
 * Also looking forward to the next release of the plugin with the latest version
   of the Verlok script, as soon as you can complete it. 🙂

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Script version’ is closed to new replies.

 * ![](https://ps.w.org/rocket-lazy-load/assets/icon-256x256.png?rev=2715509)
 * [LazyLoad Plugin – Lazy Load Images, Videos, and Iframes](https://wordpress.org/plugins/rocket-lazy-load/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rocket-lazy-load/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rocket-lazy-load/)
 * [Active Topics](https://wordpress.org/support/plugin/rocket-lazy-load/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rocket-lazy-load/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rocket-lazy-load/reviews/)

 * 8 replies
 * 4 participants
 * Last reply from: [roam92](https://wordpress.org/support/users/roam92/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/script-version/#post-14210890)
 * Status: resolved