HEX
Server: Apache/2.4.67 (Debian)
System: Linux wordpress-f784ddd76-2rt5j 6.1.175-219.357.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jun 16 03:47:47 UTC 2026 x86_64
User: www-data (33)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/flying-scripts/inject-js.php
<?php

function flying_scripts_inject_js() {

  $timeout = esc_attr(get_option('flying_scripts_timeout'));
    ?>
<script type="text/javascript" id="flying-scripts">const loadScriptsTimer=setTimeout(loadScripts,<?php echo $timeout ?>*1000);const userInteractionEvents=['click', 'mousemove', 'keydown', 'touchstart', 'touchmove', 'wheel'];userInteractionEvents.forEach(function(event){window.addEventListener(event,triggerScriptLoader,{passive:!0})});function triggerScriptLoader(){loadScripts();clearTimeout(loadScriptsTimer);userInteractionEvents.forEach(function(event){window.removeEventListener(event,triggerScriptLoader,{passive:!0})})}
function loadScripts(){document.querySelectorAll("script[data-type='lazy']").forEach(function(elem){elem.setAttribute("src",elem.getAttribute("data-src"))})}</script>
    <?php
}

add_action( 'wp_print_footer_scripts', 'flying_scripts_inject_js');