PluginProbe ʕ •ᴥ•ʔ
Core Web Vitals & PageSpeed Booster / 1.0.25
Core Web Vitals & PageSpeed Booster v1.0.25
trunk 1.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.29 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.7.1 1.0.7.2 1.0.8 1.0.9
core-web-vitals-pagespeed-booster / includes / javascript / delay-jswithjs.php
core-web-vitals-pagespeed-booster / includes / javascript Last commit date
delay-js.php 1 year ago delay-jswithjs.php 1 year ago lazyload.js 3 years ago lazyload.min.js 2 years ago
delay-jswithjs.php
15 lines
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly.
4 }
5
6 add_filter('cwvpsb_complete_html_after_dom_loaded','cwvpsb_load_js');
7 function cwvpsb_load_js($content) {
8 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
9 $content = preg_replace('/<script(.*?)<\/script>/is', '<script type="cwvlazyloadscript" $1</script>', $content);
10 $pattern = '/<head[^>]*>/i';
11 $lazyload_script = CWVPSB_PLUGIN_DIR."includes/javascript/lazyload{$min}.js";
12 $lazyload_script = cwvpsb_read_file_contents($lazyload_script);
13 $content = preg_replace( $pattern, "$0<script id='cwvpsb-delayed-script'>{$lazyload_script}</script>", $content, 1 );
14 return $content;
15 }