....................................../////.===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 : 104.21.27.90  /  Your IP : 216.73.217.46
Web Server : nginx/1.28.3
System : Linux 4e27b89abc44 6.8.0-147-generic #147-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 24 11:33:16 UTC 2026 x86_64
User :  ( 1000)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /sites/xo-fab.com/www/graphmailerwp/wp-content_old/plugins/breeze/inc/cache/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /sites/xo-fab.com/www/graphmailerwp/wp-content_old/plugins/breeze/inc/cache//config-cache.php
<?php
/**
 * @copyright 2017  Cloudways  https://www.cloudways.com
 *
 *  Original development of this plugin by JoomUnited https://www.joomunited.com/
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
// Based on some work of simple-cache
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class Breeze_ConfigCache {

	/**
	 * Create advanced-cache file
	 */
	public function write() {
		$wp_filesystem = breeze_get_filesystem();

		$file = trailingslashit( WP_CONTENT_DIR ) . '/advanced-cache.php';

		// Create array of configuration files and their corresponding sites' URLs.
		$cache_configs = array(
			'breeze-config' => array(),
		);
		if ( is_multisite() ) {
			/**
			 * This is a multisite install, loop through all subsites.
			 * Use the given filter to define the number of subsites
			 * to fetch default is 100.
			 */
			$blogs = get_sites(
				array(
					'fields' => 'ids',
					'number' => apply_filters( 'breeze_subsites_fetch_count_modify', 100 ),
				)
			);

			foreach ( $blogs as $blog_id ) {
				switch_to_blog( $blog_id );

				// if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-active' ) ) ) {
				$inherit_option = get_blog_option( $blog_id, 'breeze_inherit_settings', '0' );
				$inherit_option = filter_var( $inherit_option, FILTER_VALIDATE_BOOLEAN );
				if ( false === $inherit_option ) {
					// Site uses own (custom) configuration.
					$cache_configs[ "breeze-config-{$blog_id}" ] = preg_replace( '(^https?://)', '', site_url() );
				} else {
					// Site uses global configuration.
					$cache_configs['breeze-config'][ $blog_id ] = preg_replace( '(^https?://)', '', site_url() );
				}
				// }
				restore_current_blog();
			}
		} elseif ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-active' ) ) ) {

				$cache_configs['breeze-config'][] = preg_replace( '(^https?://)', '', site_url() );
		}

		if ( empty( $cache_configs ) || ( 1 === count( $cache_configs ) && empty( $cache_configs['breeze-config'] ) ) ) {
			// No sites with caching enabled.
			$this->clean_config();

			return;
		} else {
			$file_string = '<?php ' .
							"\n\r" . 'defined( \'ABSPATH\' ) || exit;' .
							"\n\r" . 'define( \'BREEZE_ADVANCED_CACHE\', true );' .
							"\n\r" . 'if ( is_admin() ) { return; }' .
							"\n\r" . 'if ( ! @file_exists( \'' . BREEZE_PLUGIN_DIR . 'breeze.php\' ) ) { return; }';
		}

		if ( ! is_multisite() && 1 === count( $cache_configs ) ) {
			// Only 1 config file available.
			$blog_file    = trailingslashit( WP_CONTENT_DIR ) . 'breeze-config/breeze-config.php';
			$file_string .= "\n\$config['config_path'] = '$blog_file';";
		} else {
			// Multiple configuration files, load appropriate one by comparing URLs.
			$file_string .= "\n\r" . '$domain = strtolower( stripslashes( $_SERVER[\'HTTP_HOST\'] ) );' .
							"\n" . 'if ( substr( $domain, -3 ) == \':80\' ) {' .
							"\n" . '	$domain = substr( $domain, 0, -3 );' .
							"\n" . '} elseif ( substr( $domain, -4 ) == \':443\' ) {' .
							"\n" . '	$domain = substr( $domain, 0, -4 );' .
							"\n" . '}';
			if ( is_subdomain_install() ) {
				$file_string .= "\n" . '$site_url = $domain;';
			} else {
				$file_string .= <<<'FILE_STRING'

function breeze_get_current_url_formatted() {
	$domain = strtolower( stripslashes( $_SERVER['HTTP_HOST'] ) );
	if ( substr( $domain, -3 ) == ':80' ) {
		$domain = substr( $domain, 0, -3 );
	} elseif ( substr( $domain, -4 ) == ':443' ) {
		$domain = substr( $domain, 0, -4 );
	}
	$request_uri = stripslashes( $_SERVER['REQUEST_URI'] );
	$path        = explode( '?', $request_uri, 2 )[0];
	$full_url    = '//' . $domain . $path;
	return rtrim( $full_url, '/' );
}
$site_url = breeze_get_current_url_formatted();

FILE_STRING;

			}

			// Create conditional blocks for each site.
			$file_string .= "\n" . 'function breeze_fetch_configuration_data( $site_url ) {';
			$file_string .= "\n\t" . '$config = array();';
			$file_string .= "\n\t" . 'switch ( $site_url ) {';
			foreach ( array_reverse( $cache_configs ) as $filename => $urls ) {
				$blog_file = trailingslashit( WP_CONTENT_DIR ) . 'breeze-config/' . $filename . '.php';

				if ( ! is_array( $urls ) ) {
					$urls = array( $urls );
				}

				if ( empty( $urls ) ) {
					continue;
				}

				foreach ( $urls as $the_blog_id => $site_url ) {
					$file_string .= "\n\tcase '$site_url':";

					if ( is_multisite() ) {
						if ( empty( $the_blog_id ) ) {
							$e = explode( '-', $filename );
							if ( isset( $e[2] ) ) {
								$the_blog_id = (int) $e[2];
							}
						}

						$define_blog_identity = "\n\t\t\$config['blog_id']={$the_blog_id};";
						$file_string         .= "\n\t\t\$config['config_path'] = '$blog_file';" . $define_blog_identity . "\n\t\tbreak;";
					} else {
						$file_string .= "\n\t\t\$config['config_path'] = '$blog_file';" . "\n\t\tbreak;";
					}
				}
			}

			$file_string .= "\n\t}";
			$file_string .= "\n\t" . 'return $config;';
			$file_string .= "\n}";
			$file_string .= <<<'FILE_STRING'

function breeze_get_subsite_from_url( $url ) {
	$parsed_url    = parse_url( $url );
	$domain        = strtolower( $parsed_url['host'] );
	$path          = trim( $parsed_url['path'] ?? '', '/' );
	$path_segments = array();
	if ( ! empty( $path ) ) {
		$path_segments = explode( '/', $path );
	}
	if ( ':80' === substr( $domain, -3 ) ) {
		$domain = substr( $domain, 0, -3 );
	} elseif ( ':443' === substr( $domain, -4 ) ) {
		$domain = substr( $domain, 0, -4 );
	}
	$site_url = '';
	if ( count( $path_segments ) >= 2 ) {
		$site_url       = $domain . '/' . $path_segments[0] . '/' . $path_segments[1];
		$subsite_config = breeze_fetch_configuration_data( $site_url );

		if ( $subsite_config ) {
			return $subsite_config;
		}
	}
	if ( count( $path_segments ) >= 1 ) {
		$site_url       = $domain . '/' . $path_segments[0];
		$subsite_config = breeze_fetch_configuration_data( $site_url );
		if ( $subsite_config ) {
			return $subsite_config;
		}
	}
	$site_url       = $domain;
	$subsite_config = breeze_fetch_configuration_data( $site_url );
	if ( $subsite_config ) {
		return $subsite_config;
	}

	return '';
}

FILE_STRING;

			if ( is_subdomain_install() ) {
				$file_string .= "\n" . '$config = breeze_fetch_configuration_data( $site_url );';
			} else {
				$file_string .= <<<'FILE_STRING'

$config = breeze_get_subsite_from_url( $site_url );
				
FILE_STRING;
			}

			$file_string .= "\n" . 'if ( ';
			$file_string .= "\n" . ' empty( $config ) && ';
			$file_string .= "\n" . ' false === filter_var( SUBDOMAIN_INSTALL, FILTER_VALIDATE_BOOLEAN ) && ';
			$file_string .= "\n" . ' true === filter_var( MULTISITE, FILTER_VALIDATE_BOOLEAN ) && ';
			$file_string .= "\n" . ' false === strpos( $site_url, "robots.txt") && ';
			$file_string .= "\n" . ' false === strpos( $site_url, "favicon.ico") && ';
			$file_string .= "\n" . ' false === strpos( $site_url, "wp-cron.php")';
			$file_string .= "\n" . ' ) {';
			$file_string .= "\n\t" . '$xplode = explode( "/", $site_url);';
			$file_string .= "\n\t" . 'if(isset($xplode[0])){';
			$file_string .= "\n\t\t" . '$config   = breeze_fetch_configuration_data( $domain );';
			$file_string .= "\n\t" . '}';
			$file_string .= "\n" . '}';
		}

		$file_string .= "\nif ( empty( \$config ) || ! isset( \$config['config_path'] ) || ! @file_exists( \$config['config_path'] ) ) { return; }" .
						"\n\$breeze_temp_config = include \$config['config_path'];" .
						"\nif ( isset( \$config['blog_id'] ) ) { \$breeze_temp_config['blog_id'] = \$config['blog_id']; }" .
						"\n\$GLOBALS['breeze_config'] = \$breeze_temp_config; unset( \$breeze_temp_config );" .
						"\n" . 'if ( empty( $GLOBALS[\'breeze_config\'] ) || empty( $GLOBALS[\'breeze_config\'][\'cache_options\'][\'breeze-active\'] ) ) { return; }' .
						"\n" . 'if ( @file_exists( \'' . BREEZE_PLUGIN_DIR . 'inc/cache/execute-cache.php\' ) ) {' .
						"\n" . '	include_once \'' . BREEZE_PLUGIN_DIR . 'inc/cache/execute-cache.php\';' .
						"\n" . '}' . "\n";

		return $wp_filesystem->put_contents( $file, $file_string );
	}

	/**
	 * Function write parameter to breeze-config.
	 *
	 * @param bool $create_root_config Used in multisite, to reset/create breeze-config.php file
	 */
	public static function write_config_cache( $create_root_config = false ) {
		global $wmc_settings;
		if ( true === $create_root_config ) {
			$network_id = get_current_network_id();
			$settings   = Breeze_Options_Reader::fetch_all_saved_settings( true );
			// $settings     = get_network_option( $network_id, 'breeze_basic_settings' );
			$homepage_url = network_site_url();
		} else {
			$settings     = Breeze_Options_Reader::fetch_all_saved_settings();
			$homepage_url = get_site_url();
		}

		$ecommerce_exclude_urls = array();

		$storage = array(
			'homepage'              => $homepage_url,
			'cache_options'         => $settings,
			'disable_per_adminuser' => array(),
			'exclude_url'           => array(),
		);

		if ( is_multisite() ) {
			$storage['blog_id'] = get_current_blog_id();
		}

		$storage['wp-user-roles'] = breeze_all_wp_user_roles();

		$lazy_load         = Breeze_Options_Reader::get_option_value( 'breeze-lazy-load', false, $create_root_config );
		$lazy_load_native  = Breeze_Options_Reader::get_option_value( 'breeze-lazy-load-native', false, $create_root_config );
		$preload_links     = Breeze_Options_Reader::get_option_value( 'breeze-preload-links', false, $create_root_config );
		$lazy_load_iframes = Breeze_Options_Reader::get_option_value( 'breeze-lazy-load-iframes', false, $create_root_config );
		$lazy_load_videos  = Breeze_Options_Reader::get_option_value( 'breeze-lazy-load-videos', false, $create_root_config );

		$storage['enabled-lazy-load']        = ( isset( $lazy_load ) ? $lazy_load : 0 );
		$storage['use-lazy-load-native']     = ( isset( $lazy_load_native ) ? $lazy_load_native : 0 );
		$storage['breeze-preload-links']     = ( isset( $preload_links ) ? $preload_links : 0 );
		$storage['breeze-lazy-load-iframes'] = ( isset( $lazy_load_iframes ) ? $lazy_load_iframes : 0 );
		$storage['breeze-lazy-load-videos']  = ( isset( $lazy_load_videos ) ? $lazy_load_videos : 0 );

		// CURCY - WooCommerce Multi Currency Premium.
		if (
			class_exists( 'WOOMULTI_CURRENCY' ) ||
			class_exists( 'WOOMULTI_CURRENCY_F' )
		) {
			if ( empty( $wmc_settings ) ) {
				// if $wmc_settings is empty, we will check again.
				$wmc_settings = get_option( 'woo_multi_currency_params', array() );
			}
			// if the option exists and has values.
			if ( ! empty( $wmc_settings ) ) {
				$is_enable = filter_var( $wmc_settings['enable'], FILTER_VALIDATE_BOOLEAN );
				if ( $is_enable ) {
					$session_type = 'cookie';
					$is_session   = false;
					if ( isset( $wmc_settings['use_session'] ) ) {
						$is_session = filter_var( $wmc_settings['use_session'], FILTER_VALIDATE_BOOLEAN );
					}
					if ( $is_session ) {
						$session_type = 'session';
					}
					$storage['curcy-wmc-type'] = $session_type;
				}
			}
		}

		// WOOCS - WooCommerce Currency Switcher
		$woocs_is_active = false;
		if (
			class_exists( 'WOOCS_STARTER' )
		) {
			$woocs_is_active = true;
		}

		if ( isset( $_POST['woocommerce_default_customer_address'] ) ) {
			$storage['woocommerce_geolocation_ajax'] = ( 'geolocation_ajax' === $_POST['woocommerce_default_customer_address'] ) ? 1 : 0;
		} else {
			$storage['woocommerce_geolocation_ajax'] = ( 'geolocation_ajax' === get_option( 'woocommerce_default_customer_address', '' ) ) ? 1 : 0;
		}

		// permalink_structure
		if ( is_multisite() ) {
			if ( is_network_admin() ) {
				if ( true === $woocs_is_active ) {
					$storage['woocs-store-type'] = get_site_option( 'woocs_storage', 'transient' );
				}

				unset( $storage['woocommerce_geolocation_ajax'] );
				// network oes not have this setting.
				// we save for each sub-site.
				$blogs = get_sites();
				if ( ! empty( $blogs ) ) {
					foreach ( $blogs as $blog_data ) {
						$blog_id = $blog_data->blog_id;
						switch_to_blog( $blog_id );

						$storage['woocommerce_geolocation_ajax_inherit'][ 'subsite_' . $blog_id ] = ( 'geolocation_ajax' === get_blog_option( $blog_id, 'woocommerce_default_customer_address', '' ) ) ? 1 : 0;
						$storage['permalink_structure'][ 'blog_' . $blog_id ]                     = get_blog_option( $blog_id, 'permalink_structure', '' );

						restore_current_blog();
					}
				}
			} else {
				$network_id                     = get_current_blog_id();
				$storage['permalink_structure'] = get_blog_option( $network_id, 'permalink_structure', '' );
				if ( true === $woocs_is_active ) {
					$storage['woocs-store-type'] = get_blog_option( $network_id, 'woocs_storage', 'transient' );
				}
			}
		} else {
			$storage['permalink_structure'] = get_option( 'permalink_structure', '' );
			if ( true === $woocs_is_active ) {
				$storage['woocs-store-type'] = get_option( 'woocs_storage', 'transient' );
			}
		}

		if ( class_exists( 'WooCommerce' ) ) {
			$ecommerce_exclude_urls = Breeze_Ecommerce_Cache::factory()->ecommerce_exclude_pages();
		}

		if ( class_exists( 'BuddyPress' ) ) {
			$exclude_buddyboss_pages = Breeze_Ecommerce_Cache::factory()->buddyboss_exclude_urls();

			if ( ! empty( $exclude_buddyboss_pages ) ) {
				$ecommerce_exclude_urls = array_merge( $exclude_buddyboss_pages, $ecommerce_exclude_urls );
			}
		}

		if ( function_exists( 'EDD' ) ) {
			$exclude_edd_pages = Breeze_Ecommerce_Cache::factory()->exclude_edd_pages();

			if ( ! empty( $exclude_edd_pages ) ) {
				$ecommerce_exclude_urls = array_merge( $exclude_edd_pages, $ecommerce_exclude_urls );
			}

			/**
			 * Remove Easy Digital Downloads Software Licensing endpoint from cache
			 */
			if ( class_exists( 'EDD_Software_Licensing' ) && defined( 'EDD_SL_VERSION' ) ) {
				$ecommerce_exclude_urls[] = '/edd-sl/*';
			}
		}

		/**
		 * Give shop
		 */
		if ( function_exists( 'give_get_settings' ) ) {
			$exclude_give_pages = Breeze_Ecommerce_Cache::factory()->exclude_give_pages();

			if ( ! empty( $exclude_give_pages ) ) {
				$ecommerce_exclude_urls = array_merge( $exclude_give_pages, $ecommerce_exclude_urls );
			}
		}

		/**
		 * Big Commerce
		 */
		if ( function_exists( 'bigcommerce' ) ) {
			$exclude_bigcommerce_pages = Breeze_Ecommerce_Cache::factory()->exclude_big_commerce_pages();

			if ( ! empty( $exclude_bigcommerce_pages ) ) {
				$ecommerce_exclude_urls = array_merge( $exclude_bigcommerce_pages, $ecommerce_exclude_urls );
			}
		}

		/**
		 * CartFlows
		 */
		if ( class_exists( 'Cartflows_Loader' ) && defined( 'CARTFLOWS_FILE' ) ) {
			$exclude_cartflows_pages = Breeze_Ecommerce_Cache::factory()->exclude_cart_flows_pages();

			if ( ! empty( $exclude_cartflows_pages ) ) {
				$ecommerce_exclude_urls = array_merge( $exclude_cartflows_pages, $ecommerce_exclude_urls );
			}
		}

		/**
		 * MemberPress
		 */
		if ( class_exists( 'MeprJobs' ) && defined( 'MEPR_OPTIONS_SLUG' ) ) {
			$exclude_memberpress_pages = Breeze_Ecommerce_Cache::factory()->exclude_member_press_pages();

			if ( ! empty( $exclude_memberpress_pages ) ) {
				$ecommerce_exclude_urls = array_merge( $exclude_memberpress_pages, $ecommerce_exclude_urls );
			}
		}

		/**
		 * WP eCommerce
		 */
		if ( class_exists( 'WP_eCommerce' ) ) {
			$exclude_wp_ecommerce_pages = Breeze_Ecommerce_Cache::factory()->exclude_wp_e_commerce_pages();

			if ( ! empty( $exclude_wp_ecommerce_pages ) ) {
				$ecommerce_exclude_urls = array_merge( $exclude_wp_ecommerce_pages, $ecommerce_exclude_urls );
			}
		}

		/**
		 * Ecwid Ecommerce Shopping Cart
		 */
		if ( function_exists( 'ecwid_init_integrations' ) && defined( 'ECWID_PLUGIN_DIR' ) ) {
			$exclude_ecwid_pages = Breeze_Ecommerce_Cache::factory()->exclude_ecwid_store_pages();

			if ( ! empty( $exclude_ecwid_pages ) ) {
				$ecommerce_exclude_urls = array_merge( $exclude_ecwid_pages, $ecommerce_exclude_urls );
			}
		}

		/**
		 * WP EasyCart
		 */
		if ( defined( 'EC_PUGIN_NAME' ) && function_exists( 'wpeasycart_load_startup' ) ) {
			$exclude_wp_easy_cart_pages = Breeze_Ecommerce_Cache::factory()->exclude_easy_cart_pages();

			if ( ! empty( $exclude_wp_easy_cart_pages ) ) {
				$ecommerce_exclude_urls = array_merge( $exclude_wp_easy_cart_pages, $ecommerce_exclude_urls );
			}
		}

		if ( ! empty( Breeze_Options_Reader::get_option_value( 'breeze-disable-admin', false, $create_root_config ) ) ) {
			$storage['disable_per_adminuser'] = Breeze_Options_Reader::get_option_value( 'breeze-disable-admin', false, $create_root_config );
		}

		if ( ! empty( Breeze_Options_Reader::get_option_value( 'cached-query-strings', false, $create_root_config ) ) ) {
			$storage['cached-query-strings'] = Breeze_Options_Reader::get_option_value( 'cached-query-strings', false, $create_root_config );
		}

		$storage['exclude_url'] = array_merge(
			$ecommerce_exclude_urls,
			! empty( Breeze_Options_Reader::get_option_value( 'breeze-exclude-urls', false, $create_root_config ) ) ? Breeze_Options_Reader::get_option_value( 'breeze-exclude-urls', false, $create_root_config ) : array()
		);

		$saved_pages = get_option( 'breeze_exclude_url_pages', array() );

		if ( ! empty( $saved_pages ) ) {
			$saved_pages_urls = array();
			foreach ( $saved_pages as $page_id ) {
				$saved_pages_urls[] = get_permalink( $page_id );
			}

			$saved_pages_urls = array_unique( $saved_pages_urls );

			$storage['exclude_url'] = array_merge(
				$saved_pages_urls,
				! empty( Breeze_Options_Reader::get_option_value( 'breeze-exclude-urls', false, $create_root_config ) ) ? Breeze_Options_Reader::get_option_value( 'breeze-exclude-urls', false, $create_root_config ) : array(),
				$ecommerce_exclude_urls
			);
		}

		if ( class_exists( 'WC_Facebook_Loader' ) ) {
			$woocommerce_fb_feed_link = Breeze_Ecommerce_Cache::factory()->wc_facebook_feed();

			if ( ! empty( $woocommerce_fb_feed_link ) ) {
				$storage['exclude_url'] = array_merge(
					$woocommerce_fb_feed_link,
					! empty( Breeze_Options_Reader::get_option_value( 'breeze-exclude-urls', false, $create_root_config ) ) ? Breeze_Options_Reader::get_option_value( 'breeze-exclude-urls', false, $create_root_config ) : array(),
					$ecommerce_exclude_urls
				);
			}
		}

		$the_headers = breeze_helper_fetch_headers();

		$allowed_headers = apply_filters(
			'breeze_custom_headers_allow',
			array(
				'content-security-policy',
				'x-frame-options',
				'referrer-policy',
				'strict-transport-security',
				'X-Content-Type-Options',
				'Access-Control-Allow-Origin',
				'Cross-Origin-Opener-Policy',
				'Cross-Origin-Embedder-Policy',
				'Cross-Origin-Resource-Policy',
				'Permissions-Policy',
				'X-XSS-Protection',
			)
		);

		if ( is_array( $the_headers ) && ! empty( $the_headers ) ) {
			$to_save_headers = array();

			foreach ( $allowed_headers as $header_name ) {

				$header_name = strtolower( $header_name );

				if ( array_key_exists( $header_name, $the_headers ) ) {

					if ( is_array( $the_headers[ $header_name ] ) ) {
						$to_save_headers[ $header_name ] = $the_headers[ $header_name ][0];
					} else {
						$to_save_headers[ $header_name ] = $the_headers[ $header_name ];
					}
				}
			}
			if ( ! empty( $to_save_headers ) ) {
				$storage['breeze_custom_headers'] = $to_save_headers;
			}
		}

		return self::write_config( $storage, $create_root_config );
	}

	/**
	 * Create file config storage parameter used for cache.
	 *
	 * @param array $config Options array.
	 * @param bool  $create_root_config Used in multisite, to reset/create breeze-config.php file
	 */
	public static function write_config( $config, $create_root_config = false ) {
		$wp_filesystem = breeze_get_filesystem();

		$config_dir = trailingslashit( WP_CONTENT_DIR ) . 'breeze-config';
		$filename   = 'breeze-config';
		if ( false === $create_root_config && ( is_multisite() && ! is_network_admin() ) ) {
			$filename .= '-' . get_current_blog_id();
		}

		$config_file = $config_dir . DIRECTORY_SEPARATOR . $filename . '.php';

		if ( is_multisite() && ! is_network_admin() && breeze_does_inherit_settings() ) {
			// Site inherits network-level setting, do not create separate configuration file and remove existing configuration file.
			if ( $wp_filesystem->exists( $config_file ) ) {
				$wp_filesystem->delete( $config_file, true );
			}

			if ( false === $create_root_config ) {
				return;
			}
		}

		$wp_filesystem->mkdir( $config_dir );

		$config_file_string = '<?php ' . "\n\r" . "defined( 'ABSPATH' ) || exit;" . "\n\r" . 'return ' . var_export( $config, true ) . '; ' . "\n\r";

		return $wp_filesystem->put_contents( $config_file, $config_file_string, FS_CHMOD_FILE );
	}

	/**
	 * Turn on / off wp cache.
	 *
	 * @param bool $status If WP Cache is enabled or not.
	 *
	 * @return bool|void
	 */
	public function toggle_caching( $status ) {
		$allow_cache_toggle = true;
		if ( 'cli' !== php_sapi_name() && ( is_multisite() && ! is_network_admin() ) ) {
			$allow_cache_toggle = false;
		}

		if ( false === $allow_cache_toggle ) {
			return false;
		}

		$wp_filesystem = breeze_get_filesystem();
		if ( defined( 'WP_CACHE' ) && WP_CACHE === $status ) {
			return;
		}

		// Lets look 4 levels deep for wp-config.php
		$levels = 4;

		$file        = '/wp-config.php';
		$config_path = false;

		for ( $i = 1; $i <= 3; $i++ ) {
			if ( $i > 1 ) {
				$file = '/..' . $file;
			}

			if ( $wp_filesystem->exists( untrailingslashit( ABSPATH ) . $file ) ) {
				$config_path = untrailingslashit( ABSPATH ) . $file;
				break;
			}
		}

		// Couldn't find wp-config.php
		if ( ! $config_path ) {
			return false;
		}

		$config_file_string = $wp_filesystem->get_contents( $config_path );

		// Config file is empty. Maybe couldn't read it?
		if ( empty( $config_file_string ) ) {
			return false;
		}

		$config_file = preg_split( "#(\n|\r)#", $config_file_string );
		$line_key    = false;

		foreach ( $config_file as $key => $line ) {
			if ( ! preg_match( '/^\s*define\(\s*(\'|")([A-Z_]+)(\'|")(.*)/', $line, $match ) ) {
				continue;
			}

			if ( 'WP_CACHE' === $match[2] ) {
				$line_key = $key;
			}
		}

		if ( false !== $line_key ) {
			unset( $config_file[ $line_key ] );
		}

		$status_string = ( $status ) ? 'true' : 'false';

		array_shift( $config_file );
		array_unshift( $config_file, '<?php', "define( 'WP_CACHE', $status_string ); " );

		foreach ( $config_file as $key => $line ) {
			if ( '' === $line ) {
				unset( $config_file[ $key ] );
			}
		}

		if ( ! $wp_filesystem->put_contents( $config_path, implode( PHP_EOL, $config_file ) ) ) {
			return false;
		}

		return true;
	}

	/**
	 * Delete file for clean up.
	 *
	 * @return bool
	 */
	public function clean_up() {

		$wp_filesystem = breeze_get_filesystem();
		$file = untrailingslashit( WP_CONTENT_DIR ) . '/advanced-cache.php';

		$ret = true;

		if ( ! $wp_filesystem->delete( $file ) ) {
			$ret = false;
		}

		$folder = untrailingslashit( breeze_get_cache_base_path() );

		if ( ! $wp_filesystem->delete( $folder, true ) ) {
			$ret = false;
		}

		$folder = untrailingslashit( WP_CONTENT_DIR ) . '/cache/breeze-minification';

		if ( ! $wp_filesystem->delete( $folder, true ) ) {
			$ret = false;
		}

		return $ret;
	}

	/**
	 * Delete config file.
	 *
	 * @return mixed
	 */
	public function clean_config() {

		$wp_filesystem = breeze_get_filesystem();

		$folder = untrailingslashit( WP_CONTENT_DIR ) . '/breeze-config';

		return $wp_filesystem->delete( $folder, true );

		return true;
	}

	/**
	 * Singleton instance.
	 *
	 * @return Breeze_ConfigCache
	 */
	public static function factory() {

		static $instance;

		if ( ! $instance ) {
			$instance = new self();
		}

		return $instance;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit