<?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){ if(!empty($speedycache->bloat['remove_gfonts'])){ $content = preg_replace('/<link[^<>]*\/\/fonts\.(googleapis|google|gstatic)\.com[^<>]*>/i', '', $content); } } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
admin.php | File | 7.37 KB | 0644 |
|
bloat.php | File | 10.14 KB | 0644 |
|
cli.php | File | 1.63 KB | 0644 |
|
commoncss.php | File | 3.61 KB | 0644 |
|
criticalcss.php | File | 9.25 KB | 0644 |
|
db.php | File | 1.99 KB | 0644 |
|
enhanced.php | File | 45.29 KB | 0644 |
|
googlefonts.php | File | 5.57 KB | 0644 |
|
image.php | File | 70.58 KB | 0644 |
|
index.html | File | 91 B | 0644 |
|
lazyload.php | File | 14.7 KB | 0644 |
|
license.php | File | 4.04 KB | 0644 |
|
logs.php | File | 7.42 KB | 0644 |
|
metaboxpro.php | File | 1.97 KB | 0644 |
|
mobile.php | File | 1.57 KB | 0644 |
|
object-cache-lib.php | File | 10.86 KB | 0644 |
|
objectcache.php | File | 7.95 KB | 0644 |
|
plugin-update-checker.php | File | 52.86 KB | 0644 |
|
premium.php | File | 390 B | 0644 |
|
prooptimizations.php | File | 2.1 KB | 0644 |
|
renderblocking.php | File | 36.64 KB | 0644 |
|
settingspage.php | File | 33.3 KB | 0644 |
|
statistics.php | File | 4.28 KB | 0644 |
|
unusedcss.php | File | 7.45 KB | 0644 |
|
youtube.html | File | 2.29 KB | 0644 |
|