Title: minify the inline script
Last modified: May 31, 2020

---

# minify the inline script

 *  [evil](https://wordpress.org/support/users/p47ri0t/)
 * (@p47ri0t)
 * [6 years ago](https://wordpress.org/support/topic/minify-the-inline-script-2/)
 * Hi,
    when i use “Lazy Load by WP Rocket” i see an inline script which is NOT 
   minified so i get a warning from GTmetrix about it. please minify this inline
   script or at least give an option if i want to use the minified version or not
 *     ```
       <script>
                   window.lazyLoadOptions = {
                       elements_selector: "img[data-lazy-src],.rocket-lazyload",
                       data_src: "lazy-src",
                       data_srcset: "lazy-srcset",
                       data_sizes: "lazy-sizes",
                       skip_invisible: false,
                       class_loading: "lazyloading",
                       class_loaded: "lazyloaded",
                       threshold: 300,
                       callback_load: 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();
                                       }
                                   }
                               }
                           }
                       }
                   };
   
               // Listen to the Initialized event
               window.addEventListener('LazyLoad::Initialized', function (e) {
                   // Get the instance and puts it in the lazyLoadInstance variable
                   var lazyLoadInstance = e.detail.instance;
   
                   if (window.MutationObserver) {
                       var observer = new MutationObserver(function(mutations) {
                           mutations.forEach(function(mutation) {
                               mutation.addedNodes.forEach(function(node) {
                                   if (typeof node.getElementsByTagName !== 'function') {
                                       return;
                                   }
   
                                   imgs = node.getElementsByTagName('img');
                                   iframes = node.getElementsByTagName('iframe');
                                   rocket_lazy = node.getElementsByClassName('rocket-lazyload');
   
                                   if ( 0 === imgs.length && 0 === iframes.length && 0 === rocket_lazy.length ) {
                                       return;
                                   }
   
                                   lazyLoadInstance.update();
                               } );
                           } );
                       } );
   
                       var b      = document.getElementsByTagName("body")[0];
                       var config = { childList: true, subtree: true };
   
                       observer.observe(b, config);
                   }
               }, false);
               </script>
       ```
   

The topic ‘minify the inline script’ 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/)

 * 0 replies
 * 1 participant
 * Last reply from: [evil](https://wordpress.org/support/users/p47ri0t/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/minify-the-inline-script-2/)
 * Status: not resolved