Title: flying_scripts_rewrite_html fix
Last modified: April 15, 2024

---

# flying_scripts_rewrite_html fix

 *  [kubiq](https://wordpress.org/support/users/kubiq/)
 * (@kubiq)
 * [2 years ago](https://wordpress.org/support/topic/flying_scripts_rewrite_html-fix/)
 * Hello,
 * thank you for this great plugin!
 * There are some rare cases when `w3tc_process_content` is triggered multiple times
   and then function `flying_scripts_rewrite_html` will put `src` to `data-src` 
   and then it will remove `src`, so when it will run for the second time, then 
   it will again replace `data-src` this time with `<script>` innerHTML that is 
   ofc empty, so it will result in `data:text/javascript;base64,`
 * Easy fix is just wrap this condition part `if ($script->getAttribute("src")) {...}
   else { ... }` from `flying_scripts_rewrite_html` function into another condition
   checking if there is already `data-src`, eg. `if (!$script->getAttribute("data-
   src")){ ... }`
 * Can you please implement this fix ASAP?
 * Thank you very much.

The topic ‘flying_scripts_rewrite_html fix’ is closed to new replies.

 * ![](https://ps.w.org/flying-scripts/assets/icon-256x256.png?rev=2240444)
 * [Flying Scripts: Delay JavaScript to Improve Site Speed & Performance](https://wordpress.org/plugins/flying-scripts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/flying-scripts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/flying-scripts/)
 * [Active Topics](https://wordpress.org/support/plugin/flying-scripts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flying-scripts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flying-scripts/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [kubiq](https://wordpress.org/support/users/kubiq/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/flying_scripts_rewrite_html-fix/)
 * Status: not resolved