Changeset 3312955
- Timestamp:
- 06/17/2025 07:05:14 AM (8 months ago)
- Location:
- unusedcss
- Files:
-
- 2 added
- 2 deleted
- 14 edited
- 1 copied
-
tags/3.1.15 (copied) (copied from unusedcss/trunk)
-
tags/3.1.15/constants.php (modified) (1 diff)
-
tags/3.1.15/includes/modules/javascript/RapidLoad_Javascript_Enqueue.php (modified) (1 diff)
-
tags/3.1.15/includes/modules/javascript/assets/js/inline-scripts/delay-script-footer.js (modified) (1 diff)
-
tags/3.1.15/includes/modules/javascript/assets/js/inline-scripts/delay-script-footer.min.js (modified) (1 diff)
-
tags/3.1.15/includes/modules/optimizer/RapidLoad_Optimizer.php (modified) (1 diff)
-
tags/3.1.15/rapidload_cron.php (added)
-
tags/3.1.15/readme.txt (modified) (2 diffs)
-
tags/3.1.15/run (deleted)
-
tags/3.1.15/unusedcss.php (modified) (1 diff)
-
trunk/constants.php (modified) (1 diff)
-
trunk/includes/modules/javascript/RapidLoad_Javascript_Enqueue.php (modified) (1 diff)
-
trunk/includes/modules/javascript/assets/js/inline-scripts/delay-script-footer.js (modified) (1 diff)
-
trunk/includes/modules/javascript/assets/js/inline-scripts/delay-script-footer.min.js (modified) (1 diff)
-
trunk/includes/modules/optimizer/RapidLoad_Optimizer.php (modified) (1 diff)
-
trunk/rapidload_cron.php (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/run (deleted)
-
trunk/unusedcss.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
unusedcss/tags/3.1.15/constants.php
r3306114 r3312955 26 26 27 27 if ( ! defined( 'RAPIDLOAD_VERSION' ) ) { 28 define( 'RAPIDLOAD_VERSION', '3.1.1 4' );28 define( 'RAPIDLOAD_VERSION', '3.1.15' ); 29 29 } 30 30 -
unusedcss/tags/3.1.15/includes/modules/javascript/RapidLoad_Javascript_Enqueue.php
r3298454 r3312955 164 164 // get the file content from ./assets/js/inline-scripts/delay-script-footer.min.js 165 165 $content = "//!injected by RapidLoad \n 166 (function(){var totalScripts=prepareScripts();const events=['click','mousemove','touchstart','keydown','scroll'];let userInteracted=false;function rpDebug(method='log',...args){if(window.location.search.includes('rapidload_debug_js')){console[method](...args)}}rpDebug('info','totalScripts');rpDebug('table',totalScripts);function onScriptLoad(script,success=true){totalScripts=totalScripts.map(s=>s.id===script.id&&script.loaded===null?{...script,loaded:true,success:success}:s);if(totalScripts.filter(s=>s.loaded).length===totalScripts.length){window.rapidloadScripts=totalScripts;var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent);rpDebug('table',totalScripts);rpDebug('info','fired: RapidLoad:DelayedScriptsLoaded')}}function prepareScripts(){var allScripts=Array.from(document.querySelectorAll('[data-rapidload-src], noscript[data-rapidload-delayed]')); return allScripts.map(function(script,index){if(script.tagName.toLowerCase()==='noscript'){return{id:`script-${index}`,scriptElement:script,loaded:null,success:false,content:script.innerHTML,type:'inline'}}var scriptId=script.getAttribute('id');var src=script.getAttribute('data-rapidload-src');return{id:scriptId||`script-${index}`,scriptElement:script,loaded:null,success:false,src:src,type:'external'}})}function loadScript(script){return new Promise((resolve,reject)=>{var scriptElement=script.scriptElement;scriptElement.addEventListener('load',()=>{onScriptLoad(script);rpDebug('info','loaded',script.src);resolve()});scriptElement.addEventListener('error',()=>{onScriptLoad(script,false);rpDebug('info','error',script.src);resolve()});setTimeout(()=>{if(script.src){scriptElement.setAttribute('src',script.src);scriptElement.removeAttribute('data-rapidload-src')}},0)})}async function preloadScripts(scripts){const externalScripts=scripts.filter(script=>script.type==='external');const preloadPromises=[];externalScripts.forEach(script=>{const link=document.createElement('link');link.rel='preload';link.as='script';link.fetchpriority='high';link.href=script.src;let promise=null;try{promise=new Promise((resolve,reject)=>{link.onload=()=>{link.parentNode.removeChild(link);resolve(script)};link.onerror=error=>{link.parentNode.removeChild(link);resolve(script)}})}catch(e){console.log(e)}if(promise){preloadPromises.push(promise)}document.head.appendChild(link)});await Promise.all(preloadPromises)}function loadInlineScript(script){return new Promise(resolve=>{const newScript=document.createElement('script');const inlineScript=document.createTextNode(script.content);newScript.appendChild(inlineScript);script.scriptElement.parentNode.insertBefore(newScript,script.scriptElement);script.scriptElement.parentNode.removeChild(script.scriptElement);onScriptLoad(script,true);rpDebug('info','loaded inline script',script.content);resolve()})}async function loadScriptsInDependencyOrder(){await preloadScripts(totalScripts);for(const script of totalScripts){if(script.type==='inline'){await loadInlineScript(script)}else{await loadScript(script)}}}var listener=async function(){if(!userInteracted){userInteracted=true;removeEventListeners();await loadScriptsInDependencyOrder();if(totalScripts===0){var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent)}}};events.forEach(function(event){addEventListener(event,listener)});function removeEventListeners(){events.forEach(function(event){removeEventListener(event,listener)})}function load_inline_delayed(){Array.from(document.getElementsByTagName('noscript')).forEach(function(e){var tag=e.getAttribute('data-rapidload-delayed');if(tag!==null&&tag!==undefined){var newScript=document.createElement('script');var inlineScript=document.createTextNode(e.innerHTML);newScript.appendChild(inlineScript);e.parentNode.insertBefore(newScript,e)}})}})();";166 (function(){var totalScripts=prepareScripts();const events=['click','mousemove','touchstart','keydown','scroll'];let userInteracted=false;function rpDebug(method='log',...args){if(window.location.search.includes('rapidload_debug_js')){console[method](...args)}}rpDebug('info','totalScripts');rpDebug('table',totalScripts);function onScriptLoad(script,success=true){totalScripts=totalScripts.map(s=>s.id===script.id&&script.loaded===null?{...script,loaded:true,success:success}:s);if(totalScripts.filter(s=>s.loaded).length===totalScripts.length){window.rapidloadScripts=totalScripts;var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent);rpDebug('table',totalScripts);rpDebug('info','fired: RapidLoad:DelayedScriptsLoaded')}}function prepareScripts(){var allScripts=Array.from(document.querySelectorAll('[data-rapidload-src], noscript[data-rapidload-delayed]'));var scriptIndex=0;return allScripts.map(function(script){if(script.tagName.toLowerCase()==='noscript'){return{id:'script-'+(scriptIndex++),scriptElement:script,loaded:null,success:false,content:script.innerHTML,type:'inline'}}var scriptId=script.getAttribute('id');var src=script.getAttribute('data-rapidload-src');return{id:scriptId||'script-'+(scriptIndex++),scriptElement:script,loaded:null,success:false,src:src,type:'external'}})}function loadScript(script){return new Promise((resolve,reject)=>{var scriptElement=script.scriptElement;scriptElement.addEventListener('load',()=>{onScriptLoad(script);rpDebug('info','loaded',script.src);resolve()});scriptElement.addEventListener('error',()=>{onScriptLoad(script,false);rpDebug('info','error',script.src);resolve()});setTimeout(()=>{if(script.src){scriptElement.setAttribute('src',script.src);scriptElement.removeAttribute('data-rapidload-src')}},0)})}async function preloadScripts(scripts){const externalScripts=scripts.filter(script=>script.type==='external');const preloadPromises=[];externalScripts.forEach(script=>{const link=document.createElement('link');link.rel='preload';link.as='script';link.fetchpriority='high';link.href=script.src;let promise=null;try{promise=new Promise((resolve,reject)=>{link.onload=()=>{link.parentNode.removeChild(link);resolve(script)};link.onerror=error=>{link.parentNode.removeChild(link);resolve(script)}})}catch(e){console.log(e)}if(promise){preloadPromises.push(promise)}document.head.appendChild(link)});await Promise.all(preloadPromises)}function loadInlineScript(script){return new Promise(resolve=>{const newScript=document.createElement('script');const inlineScript=document.createTextNode(script.content);newScript.appendChild(inlineScript);script.scriptElement.parentNode.insertBefore(newScript,script.scriptElement);script.scriptElement.parentNode.removeChild(script.scriptElement);onScriptLoad(script,true);rpDebug('info','loaded inline script',script.content);resolve()})}async function loadScriptsInDependencyOrder(){await preloadScripts(totalScripts);for(const script of totalScripts){if(script.type==='inline'){await loadInlineScript(script)}else{await loadScript(script)}}}var listener=async function(){if(!userInteracted){userInteracted=true;removeEventListeners();await loadScriptsInDependencyOrder();if(totalScripts===0){var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent)}}};events.forEach(function(event){addEventListener(event,listener)});function removeEventListeners(){events.forEach(function(event){removeEventListener(event,listener)})}function load_inline_delayed(){Array.from(document.getElementsByTagName('noscript')).forEach(function(e){var tag=e.getAttribute('data-rapidload-delayed');if(tag!==null&&tag!==undefined){var newScript=document.createElement('script');var inlineScript=document.createTextNode(e.innerHTML);newScript.appendChild(inlineScript);e.parentNode.insertBefore(newScript,e)}})}})();"; 167 167 168 168 if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG === true || defined('RAPIDLOAD_DEV_MODE') && RAPIDLOAD_DEV_MODE === true) { -
unusedcss/tags/3.1.15/includes/modules/javascript/assets/js/inline-scripts/delay-script-footer.js
r3298454 r3312955 37 37 } 38 38 39 function prepareScripts() { 40 // Get all script elements at once 41 var allScripts = Array.from(document.querySelectorAll('[data-rapidload-src], noscript[data-rapidload-delayed]')); 42 43 return allScripts.map(function (script, index) { 44 // Check if it's an inline script (noscript element) 45 if (script.tagName.toLowerCase() === 'noscript') { 46 return { 47 id: `script-${index}`, 48 scriptElement: script, 49 loaded: null, 50 success: false, 51 content: script.innerHTML, 52 type: 'inline' 53 }; 39 function prepareScripts(){ 40 var allScripts=Array.from(document.querySelectorAll('[data-rapidload-src], noscript[data-rapidload-delayed]')); 41 var scriptIndex=0; 42 return allScripts.map(function(script){ 43 if(script.tagName.toLowerCase()==='noscript'){ 44 return{id:'script-'+(scriptIndex++),scriptElement:script,loaded:null,success:false,content:script.innerHTML,type:'inline'} 54 45 } 55 56 // It's an external script 57 var scriptId = script.getAttribute('id'); 58 var src = script.getAttribute('data-rapidload-src'); 59 60 return { 61 id: scriptId || `script-${index}`, 62 scriptElement: script, 63 loaded: null, 64 success: false, 65 src: src, 66 type: 'external' 67 }; 68 }); 46 var scriptId=script.getAttribute('id'); 47 var src=script.getAttribute('data-rapidload-src'); 48 return{id:scriptId||'script-'+(scriptIndex++),scriptElement:script,loaded:null,success:false,src:src,type:'external'} 49 }) 69 50 } 70 51 -
unusedcss/tags/3.1.15/includes/modules/javascript/assets/js/inline-scripts/delay-script-footer.min.js
r3298454 r3312955 1 (function(){var totalScripts=prepareScripts();const events=['click','mousemove','touchstart','keydown','scroll'];let userInteracted=false;function rpDebug(method='log',...args){if(window.location.search.includes('rapidload_debug_js')){console[method](...args)}}rpDebug('info','totalScripts');rpDebug('table',totalScripts);function onScriptLoad(script,success=true){totalScripts=totalScripts.map(s=>s.id===script.id&&script.loaded===null?{...script,loaded:true,success:success}:s);if(totalScripts.filter(s=>s.loaded).length===totalScripts.length){window.rapidloadScripts=totalScripts;var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent);rpDebug('table',totalScripts);rpDebug('info','fired: RapidLoad:DelayedScriptsLoaded')}}function prepareScripts(){var allScripts=Array.from(document.querySelectorAll('[data-rapidload-src], noscript[data-rapidload-delayed]')); return allScripts.map(function(script,index){if(script.tagName.toLowerCase()==='noscript'){return{id:`script-${index}`,scriptElement:script,loaded:null,success:false,content:script.innerHTML,type:'inline'}}var scriptId=script.getAttribute('id');var src=script.getAttribute('data-rapidload-src');return{id:scriptId||`script-${index}`,scriptElement:script,loaded:null,success:false,src:src,type:'external'}})}function loadScript(script){return new Promise((resolve,reject)=>{var scriptElement=script.scriptElement;scriptElement.addEventListener('load',()=>{onScriptLoad(script);rpDebug('info','loaded',script.src);resolve()});scriptElement.addEventListener('error',()=>{onScriptLoad(script,false);rpDebug('info','error',script.src);resolve()});setTimeout(()=>{if(script.src){scriptElement.setAttribute('src',script.src);scriptElement.removeAttribute('data-rapidload-src')}},0)})}async function preloadScripts(scripts){const externalScripts=scripts.filter(script=>script.type==='external');const preloadPromises=[];externalScripts.forEach(script=>{const link=document.createElement('link');link.rel='preload';link.as='script';link.fetchpriority='high';link.href=script.src;let promise=null;try{promise=new Promise((resolve,reject)=>{link.onload=()=>{link.parentNode.removeChild(link);resolve(script)};link.onerror=error=>{link.parentNode.removeChild(link);resolve(script)}})}catch(e){console.log(e)}if(promise){preloadPromises.push(promise)}document.head.appendChild(link)});await Promise.all(preloadPromises)}function loadInlineScript(script){return new Promise(resolve=>{const newScript=document.createElement('script');const inlineScript=document.createTextNode(script.content);newScript.appendChild(inlineScript);script.scriptElement.parentNode.insertBefore(newScript,script.scriptElement);script.scriptElement.parentNode.removeChild(script.scriptElement);onScriptLoad(script,true);rpDebug('info','loaded inline script',script.content);resolve()})}async function loadScriptsInDependencyOrder(){await preloadScripts(totalScripts);for(const script of totalScripts){if(script.type==='inline'){await loadInlineScript(script)}else{await loadScript(script)}}}var listener=async function(){if(!userInteracted){userInteracted=true;removeEventListeners();await loadScriptsInDependencyOrder();if(totalScripts===0){var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent)}}};events.forEach(function(event){addEventListener(event,listener)});function removeEventListeners(){events.forEach(function(event){removeEventListener(event,listener)})}function load_inline_delayed(){Array.from(document.getElementsByTagName('noscript')).forEach(function(e){var tag=e.getAttribute('data-rapidload-delayed');if(tag!==null&&tag!==undefined){var newScript=document.createElement('script');var inlineScript=document.createTextNode(e.innerHTML);newScript.appendChild(inlineScript);e.parentNode.insertBefore(newScript,e)}})}})();1 (function(){var totalScripts=prepareScripts();const events=['click','mousemove','touchstart','keydown','scroll'];let userInteracted=false;function rpDebug(method='log',...args){if(window.location.search.includes('rapidload_debug_js')){console[method](...args)}}rpDebug('info','totalScripts');rpDebug('table',totalScripts);function onScriptLoad(script,success=true){totalScripts=totalScripts.map(s=>s.id===script.id&&script.loaded===null?{...script,loaded:true,success:success}:s);if(totalScripts.filter(s=>s.loaded).length===totalScripts.length){window.rapidloadScripts=totalScripts;var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent);rpDebug('table',totalScripts);rpDebug('info','fired: RapidLoad:DelayedScriptsLoaded')}}function prepareScripts(){var allScripts=Array.from(document.querySelectorAll('[data-rapidload-src], noscript[data-rapidload-delayed]'));var scriptIndex=0;return allScripts.map(function(script){if(script.tagName.toLowerCase()==='noscript'){return{id:'script-'+scriptIndex++,scriptElement:script,loaded:null,success:false,content:script.innerHTML,type:'inline'}}var scriptId=script.getAttribute('id');var src=script.getAttribute('data-rapidload-src');return{id:scriptId||'script-'+scriptIndex++,scriptElement:script,loaded:null,success:false,src:src,type:'external'}})}function loadScript(script){return new Promise((resolve,reject)=>{var scriptElement=script.scriptElement;scriptElement.addEventListener('load',()=>{onScriptLoad(script);rpDebug('info','loaded',script.src);resolve()});scriptElement.addEventListener('error',()=>{onScriptLoad(script,false);rpDebug('info','error',script.src);resolve()});setTimeout(()=>{if(script.src){scriptElement.setAttribute('src',script.src);scriptElement.removeAttribute('data-rapidload-src')}},0)})}async function preloadScripts(scripts){const externalScripts=scripts.filter(script=>script.type==='external');const preloadPromises=[];externalScripts.forEach(script=>{const link=document.createElement('link');link.rel='preload';link.as='script';link.fetchpriority='high';link.href=script.src;let promise=null;try{promise=new Promise((resolve,reject)=>{link.onload=()=>{link.parentNode.removeChild(link);resolve(script)};link.onerror=error=>{link.parentNode.removeChild(link);resolve(script)}})}catch(e){console.log(e)}if(promise){preloadPromises.push(promise)}document.head.appendChild(link)});await Promise.all(preloadPromises)}function loadInlineScript(script){return new Promise(resolve=>{const newScript=document.createElement('script');const inlineScript=document.createTextNode(script.content);newScript.appendChild(inlineScript);script.scriptElement.parentNode.insertBefore(newScript,script.scriptElement);script.scriptElement.parentNode.removeChild(script.scriptElement);onScriptLoad(script,true);rpDebug('info','loaded inline script',script.content);resolve()})}async function loadScriptsInDependencyOrder(){await preloadScripts(totalScripts);for(const script of totalScripts){if(script.type==='inline'){await loadInlineScript(script)}else{await loadScript(script)}}}var listener=async function(){if(!userInteracted){userInteracted=true;removeEventListeners();await loadScriptsInDependencyOrder();if(totalScripts===0){var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent)}}};events.forEach(function(event){addEventListener(event,listener)});function removeEventListeners(){events.forEach(function(event){removeEventListener(event,listener)})}function load_inline_delayed(){Array.from(document.getElementsByTagName('noscript')).forEach(function(e){var tag=e.getAttribute('data-rapidload-delayed');if(tag!==null&&tag!==undefined){var newScript=document.createElement('script');var inlineScript=document.createTextNode(e.innerHTML);newScript.appendChild(inlineScript);e.parentNode.insertBefore(newScript,e)}})}})(); -
unusedcss/tags/3.1.15/includes/modules/optimizer/RapidLoad_Optimizer.php
r3305591 r3312955 735 735 'titan' => true, 736 736 'options' => [ 737 'strategy' => self::$strategy === 'desktop' ? ' desktop' : 'mobile'737 'strategy' => self::$strategy === 'desktop' ? 'mobile' : 'desktop' 738 738 ] 739 739 ]); -
unusedcss/tags/3.1.15/readme.txt
r3306114 r3312955 6 6 Requires at least: 5.0 7 7 Tested up to: 6.8 8 Stable tag: 3.1.1 48 Stable tag: 3.1.15 9 9 Requires PHP: 5.4 10 10 License: GPLv3 … … 144 144 == Changelog == 145 145 146 = 3.1.15 - 17/06/2025 = 147 * fix: minor bugs 148 146 149 = 3.1.14 - 04/06/2025 = 147 150 * fix: minor bugs -
unusedcss/tags/3.1.15/unusedcss.php
r3306114 r3312955 4 4 Plugin URI: https://rapidload.ai/ 5 5 Description: Supercharge your website with RapidLoad AI, featuring cutting-edge AI to automate optimizing CSS, JavaScript, images, fonts, and caching. 6 Version: 3.1.1 46 Version: 3.1.15 7 7 Author: RapidLoad 8 8 Author URI: https://rapidload.ai/ -
unusedcss/trunk/constants.php
r3306114 r3312955 26 26 27 27 if ( ! defined( 'RAPIDLOAD_VERSION' ) ) { 28 define( 'RAPIDLOAD_VERSION', '3.1.1 4' );28 define( 'RAPIDLOAD_VERSION', '3.1.15' ); 29 29 } 30 30 -
unusedcss/trunk/includes/modules/javascript/RapidLoad_Javascript_Enqueue.php
r3298454 r3312955 164 164 // get the file content from ./assets/js/inline-scripts/delay-script-footer.min.js 165 165 $content = "//!injected by RapidLoad \n 166 (function(){var totalScripts=prepareScripts();const events=['click','mousemove','touchstart','keydown','scroll'];let userInteracted=false;function rpDebug(method='log',...args){if(window.location.search.includes('rapidload_debug_js')){console[method](...args)}}rpDebug('info','totalScripts');rpDebug('table',totalScripts);function onScriptLoad(script,success=true){totalScripts=totalScripts.map(s=>s.id===script.id&&script.loaded===null?{...script,loaded:true,success:success}:s);if(totalScripts.filter(s=>s.loaded).length===totalScripts.length){window.rapidloadScripts=totalScripts;var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent);rpDebug('table',totalScripts);rpDebug('info','fired: RapidLoad:DelayedScriptsLoaded')}}function prepareScripts(){var allScripts=Array.from(document.querySelectorAll('[data-rapidload-src], noscript[data-rapidload-delayed]')); return allScripts.map(function(script,index){if(script.tagName.toLowerCase()==='noscript'){return{id:`script-${index}`,scriptElement:script,loaded:null,success:false,content:script.innerHTML,type:'inline'}}var scriptId=script.getAttribute('id');var src=script.getAttribute('data-rapidload-src');return{id:scriptId||`script-${index}`,scriptElement:script,loaded:null,success:false,src:src,type:'external'}})}function loadScript(script){return new Promise((resolve,reject)=>{var scriptElement=script.scriptElement;scriptElement.addEventListener('load',()=>{onScriptLoad(script);rpDebug('info','loaded',script.src);resolve()});scriptElement.addEventListener('error',()=>{onScriptLoad(script,false);rpDebug('info','error',script.src);resolve()});setTimeout(()=>{if(script.src){scriptElement.setAttribute('src',script.src);scriptElement.removeAttribute('data-rapidload-src')}},0)})}async function preloadScripts(scripts){const externalScripts=scripts.filter(script=>script.type==='external');const preloadPromises=[];externalScripts.forEach(script=>{const link=document.createElement('link');link.rel='preload';link.as='script';link.fetchpriority='high';link.href=script.src;let promise=null;try{promise=new Promise((resolve,reject)=>{link.onload=()=>{link.parentNode.removeChild(link);resolve(script)};link.onerror=error=>{link.parentNode.removeChild(link);resolve(script)}})}catch(e){console.log(e)}if(promise){preloadPromises.push(promise)}document.head.appendChild(link)});await Promise.all(preloadPromises)}function loadInlineScript(script){return new Promise(resolve=>{const newScript=document.createElement('script');const inlineScript=document.createTextNode(script.content);newScript.appendChild(inlineScript);script.scriptElement.parentNode.insertBefore(newScript,script.scriptElement);script.scriptElement.parentNode.removeChild(script.scriptElement);onScriptLoad(script,true);rpDebug('info','loaded inline script',script.content);resolve()})}async function loadScriptsInDependencyOrder(){await preloadScripts(totalScripts);for(const script of totalScripts){if(script.type==='inline'){await loadInlineScript(script)}else{await loadScript(script)}}}var listener=async function(){if(!userInteracted){userInteracted=true;removeEventListeners();await loadScriptsInDependencyOrder();if(totalScripts===0){var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent)}}};events.forEach(function(event){addEventListener(event,listener)});function removeEventListeners(){events.forEach(function(event){removeEventListener(event,listener)})}function load_inline_delayed(){Array.from(document.getElementsByTagName('noscript')).forEach(function(e){var tag=e.getAttribute('data-rapidload-delayed');if(tag!==null&&tag!==undefined){var newScript=document.createElement('script');var inlineScript=document.createTextNode(e.innerHTML);newScript.appendChild(inlineScript);e.parentNode.insertBefore(newScript,e)}})}})();";166 (function(){var totalScripts=prepareScripts();const events=['click','mousemove','touchstart','keydown','scroll'];let userInteracted=false;function rpDebug(method='log',...args){if(window.location.search.includes('rapidload_debug_js')){console[method](...args)}}rpDebug('info','totalScripts');rpDebug('table',totalScripts);function onScriptLoad(script,success=true){totalScripts=totalScripts.map(s=>s.id===script.id&&script.loaded===null?{...script,loaded:true,success:success}:s);if(totalScripts.filter(s=>s.loaded).length===totalScripts.length){window.rapidloadScripts=totalScripts;var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent);rpDebug('table',totalScripts);rpDebug('info','fired: RapidLoad:DelayedScriptsLoaded')}}function prepareScripts(){var allScripts=Array.from(document.querySelectorAll('[data-rapidload-src], noscript[data-rapidload-delayed]'));var scriptIndex=0;return allScripts.map(function(script){if(script.tagName.toLowerCase()==='noscript'){return{id:'script-'+(scriptIndex++),scriptElement:script,loaded:null,success:false,content:script.innerHTML,type:'inline'}}var scriptId=script.getAttribute('id');var src=script.getAttribute('data-rapidload-src');return{id:scriptId||'script-'+(scriptIndex++),scriptElement:script,loaded:null,success:false,src:src,type:'external'}})}function loadScript(script){return new Promise((resolve,reject)=>{var scriptElement=script.scriptElement;scriptElement.addEventListener('load',()=>{onScriptLoad(script);rpDebug('info','loaded',script.src);resolve()});scriptElement.addEventListener('error',()=>{onScriptLoad(script,false);rpDebug('info','error',script.src);resolve()});setTimeout(()=>{if(script.src){scriptElement.setAttribute('src',script.src);scriptElement.removeAttribute('data-rapidload-src')}},0)})}async function preloadScripts(scripts){const externalScripts=scripts.filter(script=>script.type==='external');const preloadPromises=[];externalScripts.forEach(script=>{const link=document.createElement('link');link.rel='preload';link.as='script';link.fetchpriority='high';link.href=script.src;let promise=null;try{promise=new Promise((resolve,reject)=>{link.onload=()=>{link.parentNode.removeChild(link);resolve(script)};link.onerror=error=>{link.parentNode.removeChild(link);resolve(script)}})}catch(e){console.log(e)}if(promise){preloadPromises.push(promise)}document.head.appendChild(link)});await Promise.all(preloadPromises)}function loadInlineScript(script){return new Promise(resolve=>{const newScript=document.createElement('script');const inlineScript=document.createTextNode(script.content);newScript.appendChild(inlineScript);script.scriptElement.parentNode.insertBefore(newScript,script.scriptElement);script.scriptElement.parentNode.removeChild(script.scriptElement);onScriptLoad(script,true);rpDebug('info','loaded inline script',script.content);resolve()})}async function loadScriptsInDependencyOrder(){await preloadScripts(totalScripts);for(const script of totalScripts){if(script.type==='inline'){await loadInlineScript(script)}else{await loadScript(script)}}}var listener=async function(){if(!userInteracted){userInteracted=true;removeEventListeners();await loadScriptsInDependencyOrder();if(totalScripts===0){var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent)}}};events.forEach(function(event){addEventListener(event,listener)});function removeEventListeners(){events.forEach(function(event){removeEventListener(event,listener)})}function load_inline_delayed(){Array.from(document.getElementsByTagName('noscript')).forEach(function(e){var tag=e.getAttribute('data-rapidload-delayed');if(tag!==null&&tag!==undefined){var newScript=document.createElement('script');var inlineScript=document.createTextNode(e.innerHTML);newScript.appendChild(inlineScript);e.parentNode.insertBefore(newScript,e)}})}})();"; 167 167 168 168 if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG === true || defined('RAPIDLOAD_DEV_MODE') && RAPIDLOAD_DEV_MODE === true) { -
unusedcss/trunk/includes/modules/javascript/assets/js/inline-scripts/delay-script-footer.js
r3298454 r3312955 37 37 } 38 38 39 function prepareScripts() { 40 // Get all script elements at once 41 var allScripts = Array.from(document.querySelectorAll('[data-rapidload-src], noscript[data-rapidload-delayed]')); 42 43 return allScripts.map(function (script, index) { 44 // Check if it's an inline script (noscript element) 45 if (script.tagName.toLowerCase() === 'noscript') { 46 return { 47 id: `script-${index}`, 48 scriptElement: script, 49 loaded: null, 50 success: false, 51 content: script.innerHTML, 52 type: 'inline' 53 }; 39 function prepareScripts(){ 40 var allScripts=Array.from(document.querySelectorAll('[data-rapidload-src], noscript[data-rapidload-delayed]')); 41 var scriptIndex=0; 42 return allScripts.map(function(script){ 43 if(script.tagName.toLowerCase()==='noscript'){ 44 return{id:'script-'+(scriptIndex++),scriptElement:script,loaded:null,success:false,content:script.innerHTML,type:'inline'} 54 45 } 55 56 // It's an external script 57 var scriptId = script.getAttribute('id'); 58 var src = script.getAttribute('data-rapidload-src'); 59 60 return { 61 id: scriptId || `script-${index}`, 62 scriptElement: script, 63 loaded: null, 64 success: false, 65 src: src, 66 type: 'external' 67 }; 68 }); 46 var scriptId=script.getAttribute('id'); 47 var src=script.getAttribute('data-rapidload-src'); 48 return{id:scriptId||'script-'+(scriptIndex++),scriptElement:script,loaded:null,success:false,src:src,type:'external'} 49 }) 69 50 } 70 51 -
unusedcss/trunk/includes/modules/javascript/assets/js/inline-scripts/delay-script-footer.min.js
r3298454 r3312955 1 (function(){var totalScripts=prepareScripts();const events=['click','mousemove','touchstart','keydown','scroll'];let userInteracted=false;function rpDebug(method='log',...args){if(window.location.search.includes('rapidload_debug_js')){console[method](...args)}}rpDebug('info','totalScripts');rpDebug('table',totalScripts);function onScriptLoad(script,success=true){totalScripts=totalScripts.map(s=>s.id===script.id&&script.loaded===null?{...script,loaded:true,success:success}:s);if(totalScripts.filter(s=>s.loaded).length===totalScripts.length){window.rapidloadScripts=totalScripts;var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent);rpDebug('table',totalScripts);rpDebug('info','fired: RapidLoad:DelayedScriptsLoaded')}}function prepareScripts(){var allScripts=Array.from(document.querySelectorAll('[data-rapidload-src], noscript[data-rapidload-delayed]')); return allScripts.map(function(script,index){if(script.tagName.toLowerCase()==='noscript'){return{id:`script-${index}`,scriptElement:script,loaded:null,success:false,content:script.innerHTML,type:'inline'}}var scriptId=script.getAttribute('id');var src=script.getAttribute('data-rapidload-src');return{id:scriptId||`script-${index}`,scriptElement:script,loaded:null,success:false,src:src,type:'external'}})}function loadScript(script){return new Promise((resolve,reject)=>{var scriptElement=script.scriptElement;scriptElement.addEventListener('load',()=>{onScriptLoad(script);rpDebug('info','loaded',script.src);resolve()});scriptElement.addEventListener('error',()=>{onScriptLoad(script,false);rpDebug('info','error',script.src);resolve()});setTimeout(()=>{if(script.src){scriptElement.setAttribute('src',script.src);scriptElement.removeAttribute('data-rapidload-src')}},0)})}async function preloadScripts(scripts){const externalScripts=scripts.filter(script=>script.type==='external');const preloadPromises=[];externalScripts.forEach(script=>{const link=document.createElement('link');link.rel='preload';link.as='script';link.fetchpriority='high';link.href=script.src;let promise=null;try{promise=new Promise((resolve,reject)=>{link.onload=()=>{link.parentNode.removeChild(link);resolve(script)};link.onerror=error=>{link.parentNode.removeChild(link);resolve(script)}})}catch(e){console.log(e)}if(promise){preloadPromises.push(promise)}document.head.appendChild(link)});await Promise.all(preloadPromises)}function loadInlineScript(script){return new Promise(resolve=>{const newScript=document.createElement('script');const inlineScript=document.createTextNode(script.content);newScript.appendChild(inlineScript);script.scriptElement.parentNode.insertBefore(newScript,script.scriptElement);script.scriptElement.parentNode.removeChild(script.scriptElement);onScriptLoad(script,true);rpDebug('info','loaded inline script',script.content);resolve()})}async function loadScriptsInDependencyOrder(){await preloadScripts(totalScripts);for(const script of totalScripts){if(script.type==='inline'){await loadInlineScript(script)}else{await loadScript(script)}}}var listener=async function(){if(!userInteracted){userInteracted=true;removeEventListeners();await loadScriptsInDependencyOrder();if(totalScripts===0){var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent)}}};events.forEach(function(event){addEventListener(event,listener)});function removeEventListeners(){events.forEach(function(event){removeEventListener(event,listener)})}function load_inline_delayed(){Array.from(document.getElementsByTagName('noscript')).forEach(function(e){var tag=e.getAttribute('data-rapidload-delayed');if(tag!==null&&tag!==undefined){var newScript=document.createElement('script');var inlineScript=document.createTextNode(e.innerHTML);newScript.appendChild(inlineScript);e.parentNode.insertBefore(newScript,e)}})}})();1 (function(){var totalScripts=prepareScripts();const events=['click','mousemove','touchstart','keydown','scroll'];let userInteracted=false;function rpDebug(method='log',...args){if(window.location.search.includes('rapidload_debug_js')){console[method](...args)}}rpDebug('info','totalScripts');rpDebug('table',totalScripts);function onScriptLoad(script,success=true){totalScripts=totalScripts.map(s=>s.id===script.id&&script.loaded===null?{...script,loaded:true,success:success}:s);if(totalScripts.filter(s=>s.loaded).length===totalScripts.length){window.rapidloadScripts=totalScripts;var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent);rpDebug('table',totalScripts);rpDebug('info','fired: RapidLoad:DelayedScriptsLoaded')}}function prepareScripts(){var allScripts=Array.from(document.querySelectorAll('[data-rapidload-src], noscript[data-rapidload-delayed]'));var scriptIndex=0;return allScripts.map(function(script){if(script.tagName.toLowerCase()==='noscript'){return{id:'script-'+scriptIndex++,scriptElement:script,loaded:null,success:false,content:script.innerHTML,type:'inline'}}var scriptId=script.getAttribute('id');var src=script.getAttribute('data-rapidload-src');return{id:scriptId||'script-'+scriptIndex++,scriptElement:script,loaded:null,success:false,src:src,type:'external'}})}function loadScript(script){return new Promise((resolve,reject)=>{var scriptElement=script.scriptElement;scriptElement.addEventListener('load',()=>{onScriptLoad(script);rpDebug('info','loaded',script.src);resolve()});scriptElement.addEventListener('error',()=>{onScriptLoad(script,false);rpDebug('info','error',script.src);resolve()});setTimeout(()=>{if(script.src){scriptElement.setAttribute('src',script.src);scriptElement.removeAttribute('data-rapidload-src')}},0)})}async function preloadScripts(scripts){const externalScripts=scripts.filter(script=>script.type==='external');const preloadPromises=[];externalScripts.forEach(script=>{const link=document.createElement('link');link.rel='preload';link.as='script';link.fetchpriority='high';link.href=script.src;let promise=null;try{promise=new Promise((resolve,reject)=>{link.onload=()=>{link.parentNode.removeChild(link);resolve(script)};link.onerror=error=>{link.parentNode.removeChild(link);resolve(script)}})}catch(e){console.log(e)}if(promise){preloadPromises.push(promise)}document.head.appendChild(link)});await Promise.all(preloadPromises)}function loadInlineScript(script){return new Promise(resolve=>{const newScript=document.createElement('script');const inlineScript=document.createTextNode(script.content);newScript.appendChild(inlineScript);script.scriptElement.parentNode.insertBefore(newScript,script.scriptElement);script.scriptElement.parentNode.removeChild(script.scriptElement);onScriptLoad(script,true);rpDebug('info','loaded inline script',script.content);resolve()})}async function loadScriptsInDependencyOrder(){await preloadScripts(totalScripts);for(const script of totalScripts){if(script.type==='inline'){await loadInlineScript(script)}else{await loadScript(script)}}}var listener=async function(){if(!userInteracted){userInteracted=true;removeEventListeners();await loadScriptsInDependencyOrder();if(totalScripts===0){var allScriptsLoadedEvent=new CustomEvent('RapidLoad:DelayedScriptsLoaded',{bubbles:true,cancelable:true});document.dispatchEvent(allScriptsLoadedEvent)}}};events.forEach(function(event){addEventListener(event,listener)});function removeEventListeners(){events.forEach(function(event){removeEventListener(event,listener)})}function load_inline_delayed(){Array.from(document.getElementsByTagName('noscript')).forEach(function(e){var tag=e.getAttribute('data-rapidload-delayed');if(tag!==null&&tag!==undefined){var newScript=document.createElement('script');var inlineScript=document.createTextNode(e.innerHTML);newScript.appendChild(inlineScript);e.parentNode.insertBefore(newScript,e)}})}})(); -
unusedcss/trunk/includes/modules/optimizer/RapidLoad_Optimizer.php
r3305591 r3312955 735 735 'titan' => true, 736 736 'options' => [ 737 'strategy' => self::$strategy === 'desktop' ? ' desktop' : 'mobile'737 'strategy' => self::$strategy === 'desktop' ? 'mobile' : 'desktop' 738 738 ] 739 739 ]); -
unusedcss/trunk/readme.txt
r3306114 r3312955 6 6 Requires at least: 5.0 7 7 Tested up to: 6.8 8 Stable tag: 3.1.1 48 Stable tag: 3.1.15 9 9 Requires PHP: 5.4 10 10 License: GPLv3 … … 144 144 == Changelog == 145 145 146 = 3.1.15 - 17/06/2025 = 147 * fix: minor bugs 148 146 149 = 3.1.14 - 04/06/2025 = 147 150 * fix: minor bugs -
unusedcss/trunk/unusedcss.php
r3306114 r3312955 4 4 Plugin URI: https://rapidload.ai/ 5 5 Description: Supercharge your website with RapidLoad AI, featuring cutting-edge AI to automate optimizing CSS, JavaScript, images, fonts, and caching. 6 Version: 3.1.1 46 Version: 3.1.15 7 7 Author: RapidLoad 8 8 Author URI: https://rapidload.ai/
Note: See TracChangeset
for help on using the changeset viewer.