PHP 8.2.30
Preview: prooptimizations.php Size: 2.12 KB
/proc/thread-self/root/var/softaculous/sitepad/editor/site-data/plugins/speedycache-pro/main/prooptimizations.php

<?php

namespace SpeedyCache;

if(!defined('ABSPATH')){
	die('HACKING ATTEMPT');
}

class ProOptimizations{
	static $content = '';

	// function init(&$content){
		// self::$content = $content;
	// }
	
	static function defer_js(&$content){
		global $speedycache;

		\SpeedyCache\Enhanced::init();
		$content = \SpeedyCache\Enhanced::render_blocking($content);
	}
	
	static function delay_js(&$content){
		global $speedycache;

		\SpeedyCache\Enhanced::init();
		if(empty($speedycache->enhanced)){
			$speedycache->enhanced['html'] = $content;
		}

		$content = \SpeedyCache\Enhanced::delay_js($content);
	}
	
	static function unused_css(){
		$url = esc_url(speedycache_optserver('HTTP_HOST'). speedycache_optserver('REQUEST_URI'));

		if(strpos($url, '?test_speedycache') !== FALSE){
			\SpeedyCache\UnusedCss::generate(array($url));
		} else {
			\SpeedyCache\UnusedCss::schedule('speedycache_unused_css', array($url));
		}
	}
	
	static function critical_css(){
		$url = esc_url(speedycache_optserver('HTTP_HOST'). speedycache_optserver('REQUEST_URI'));

		if(strpos($url, '?test_speedycache') !== FALSE){
			\SpeedyCache\CriticalCss::generate(array($url));
		} else {
			\SpeedyCache\CriticalCss::schedule('speedycache_generate_ccss', array($url));
		}
	}
	
	static function img_lazy_load(&$content){

		// to disable for Ajax Load More on the pages
		if(speedycache_is_plugin_active('ajax-load-more/ajax-load-more.php') && !empty($_SERVER['REQUEST_URI']) && preg_match("/\/page\/\d+\//", sanitize_url(wp_unslash($_SERVER['REQUEST_URI'])))){
			return;
		}

		$content = \SpeedyCache\Enhanced::lazy_load($content);
		$lazy_load_js = '';
		
		if(file_exists(SPEEDYCACHE_PRO_DIR . '/main/lazyload.php')){
			$lazy_load_js = \SpeedyCache\LazyLoad::get_js_source();
		}

		$content = preg_replace("/\s*<\/head\s*>/i", $lazy_load_js.'</head>', $content, 1);
	}
	
	static function remove_gfonts(&$content){
		global $speedycache;

		if(!empty($speedycache->bloat['remove_gfonts'])){
			$content = preg_replace('/<link[^<>]*\/\/fonts\.(googleapis|google|gstatic)\.com[^<>]*>/i', '', $content);
		}
	}
}

Directory Contents

Dirs: 0 × Files: 25

Name Size Perms Modified Actions
24.34 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
10.18 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
1.63 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
3.65 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
9.98 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
2.60 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
47.30 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
5.60 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
71.20 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
91 B lrw-r--r-- 2026-02-18 23:32:28
Edit Download
14.83 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
4.12 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
7.61 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
1.97 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
1.57 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
10.86 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
8.47 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
52.86 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
423 B lrw-r--r-- 2026-02-18 23:32:28
Edit Download
2.12 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
36.80 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
36.78 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
4.25 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
7.45 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download
2.29 KB lrw-r--r-- 2026-02-18 23:32:28
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).