....................................../////.===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 : 162.0.217.32  /  Your IP : 216.73.216.108
Web Server : LiteSpeed
System : Linux premium195.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User : branedll ( 1299)
PHP Version : 8.2.29
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/branedll/starktreegroup.com/wp-content/plugins/popularfx-templates/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/branedll/starktreegroup.com/wp-content/plugins/popularfx-templates/popularfx-templates.php
<?php
/*
Plugin Name: PopularFX Website Templates
Plugin URI: https://popularfx.com/
Description: PopularFX is a lightweight theme with 500+ templates to make beautiful websites with Pagelayer. PopularFX can be used for a blogging site, WooCommerce Store, Business website, personal portfolio, etc.
Version: 1.2.3
Author: Pagelayer Team
Author URI: https://pagelayer.com/
Text Domain: popularfx
*/

// We need the ABSPATH
if (!defined('ABSPATH')) exit;

if(!function_exists('add_action')){
	echo 'You are not allowed to access this page directly.';
	exit;
}

define('PFX_FILE', __FILE__);
define('PFX_BASE', plugin_basename(PFX_FILE));
define('PFX_PRO_BASE', 'popularfx-templates/popularfx-templates.php');
define('PFX_VERSION', '1.2.3');
define('PFX_DIR', dirname(PFX_FILE));
define('PFX_SLUG', 'popularfx-templates');
define('PFX_URL', plugins_url('', PFX_FILE));
define('PFX_CSS', PFX_URL.'/css');
define('PFX_JS', PFX_URL.'/js');
define('PFX_PRO_URL', 'https://popularfx.com/pricing?from=pfx-plugin');
define('PFX_WWW_URL', 'https://popularfx.com/');
define('PFX_DOCS', 'https://popularfx.com/docs/');
define('PFX_API', 'https://a.softaculous.com/popularfx/');
define('PFX_PAGELAYER_API', 'https://api.pagelayer.com/');

// Ok so we are now ready to go
register_activation_hook(PFX_FILE, 'pfx_activation');

// Is called when the ADMIN enables the plugin
function pfx_activation(){

	global $wpdb;

	$sql = array();

	add_option('popularfx_version', PFX_VERSION);

}

// Checks if we are to update ?
function pfx_update_check(){

global $wpdb;

	$sql = array();
	$current_version = get_option('popularfx_version');
	$version = (int) str_replace('.', '', $current_version);

	// No update required
	if($current_version == PFX_VERSION){
		return true;
	}

	// Is it first run ?
	if(empty($current_version)){

		// Reinstall
		pfx_activation();

		// Trick the following if conditions to not run
		$version = (int) str_replace('.', '', PFX_VERSION);

	}

	// Save the new Version
	update_option('popularfx_version', PFX_VERSION);

	// Bug fix prior to 108 - We can only attempt this once
	if($version <= 108 && get_option('template') == 'popularfx'){
		
		$template = get_theme_mod('popularfx_template');
		$template_dir = get_template_directory().'/templates/'.$template;
		$style = $template_dir.'/style.css';
		$dest = pfx_templates_dir().'/'.$template;
		
		if(!empty($template) && file_exists($style)){
		
			if(!function_exists( 'download_url' ) ) {
				require_once ABSPATH . 'wp-admin/includes/file.php';
			}
			
			define('FS_METHOD', 'direct');
			WP_Filesystem();
			
			// Create the dir if missing
			wp_mkdir_p($dest);
			
			// Just copy the dir
			copy_dir($template_dir, $dest);
			
			if(file_exists($dest.'/style.css')){
				pfx_fix_image_urls_108();
			}
		
		}
		
	}

}

// Add the action to load the plugin 
add_action('plugins_loaded', 'pfx_load_plugin');

// The function that will be called when the plugin is loaded
function pfx_load_plugin(){

	global $pagelayer, $popularfx;

	// Check if the installed version is outdated
	pfx_update_check();
	
	// Load license
	pfx_load_license();
	
	// Load the language
	load_plugin_textdomain('popularfx', false, PFX_SLUG.'/languages/');
	
	// Check for updates
	include_once(PFX_DIR.'/plugin-update-checker.php');
	$popularfx_updater = PopularFX_PucFactory::buildUpdateChecker(PFX_API.'update2.php?version='.PFX_VERSION, PFX_FILE);
	
	// Add the license key to query arguments
	$popularfx_updater->addQueryArgFilter('pfx_updater_filter_args');
	
	// Show the text to install the license key
	add_filter('puc_manual_final_check_link-pagelayer-pro', 'pfx_updater_check_link', 10, 1);

	// Template Installation related ajax calls
	add_action('wp_ajax_popularfx_template_info', 'pfx_templates_ajax');
	add_action('wp_ajax_popularfx_start_install_template', 'pfx_templates_ajax');
	add_action('wp_ajax_popularfx_download_template', 'pfx_templates_ajax');
	add_action('wp_ajax_popularfx_import_template', 'pfx_templates_ajax');

	// Load the freemium widgets
	if(!defined('PAGELAYER_PREMIUM')){
		add_action('pagelayer_load_custom_widgets', 'pfx_freemium_shortcodes');
	}
	
	// Are we to setup a template ?
	$slug = get_option('popularfx_setup_template');
	if(!empty($slug)){
		add_action('after_setup_theme', 'pfx_setup_template_import');
	}

}

// Setup import
function pfx_setup_template_import(){
	
	$slug = get_option('popularfx_setup_template');
	
	// We dont have to setup anything
	if(empty($slug)){
		return;
	}
	
	// Setup the theme credit
	update_option('pagelayer-copyright', pagelayer_get_option('pagelayer-copyright').' | '.popularfx_copyright());
	
	// Set that we have setup
	delete_option('popularfx_setup_template');
	
	include_once(dirname(__FILE__).'/templates.php');
	
	$_POST['delete_old_import'] = 1;
	$_POST['set_home_page'] = 1;
	$data = popularfx_import_template($slug);
	if(!empty($_GET['install-pfx-template'])){		
		popularfx_ajax_output($data);
	}else{
		wp_redirect(home_url());
	}	
	exit();
}

// Load the freemium widgets
function pfx_freemium_shortcodes(){
	
	if(defined('PAGELAYER_PREMIUM')){
		return;
	}
	
	include_once(dirname(__FILE__).'/freemium_functions.php');
	include_once(dirname(__FILE__).'/freemium.php');
}

// Add our license key if ANY
function pfx_updater_filter_args($queryArgs) {
	
	global $popularfx;
	
	if ( !empty($popularfx['license']['license']) ) {
		$queryArgs['license'] = $popularfx['license']['license'];
	}
	
	return $queryArgs;
}

// Handle the Check for update link and ask to install license key
function pfx_updater_check_link($final_link){
	
	global $popularfx;
	
	if(empty($popularfx['license']['license'])){
		return '<a href="'.admin_url('admin.php?page=popularfx').'">Install PopularFX Pro License Key</a>';
	}
	
	return $final_link;
}

// This adds the left menu in WordPress Admin page
add_action('admin_menu', 'pfx_admin_menu', 5);
function pfx_admin_menu() {

	$capability = 'edit_theme_options';// TODO : Capability for accessing this page

	// Add the menu page
	add_menu_page(__('PopularFX'), __('PopularFX'), $capability, 'popularfx', 'pfx_page_handler', PFX_URL.'/images/popularfx-logo-menu.png');

	// Options Page
	add_submenu_page('popularfx', __('PopularFX'), __('Options'), $capability, 'popularfx', 'pfx_page_handler');
	
	// PopularFX Templates
	add_submenu_page('popularfx', __('Website Templates'), __('Website Templates'), $capability, 'popularfx_templates', 'pfx_page_templates');
	
	// Manually Import Template 
	//add_submenu_page('popularfx', __('Manual Import'), __('Manual Import'), $capability, 'popularfx_manual_import', 'pfx_manual_import');

	if(!function_exists('pagelayer_theme_import_notices')){
		add_submenu_page('popularfx', 'Install Pagelayer', 'Install Pagelayer', 'install_plugins', 'popularfx_install_pagelayer', 'pfx_install_pagelayer');
	}

}
	
function pfx_install_pagelayer(){
	
	global $pagelayer;
	
	if(!empty($_GET['license'])){
		return pfx_install_pagelayer_pro();
	}
	
	// Include the necessary stuff
	include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );

	// Includes necessary for Plugin_Upgrader and Plugin_Installer_Skin
	include_once( ABSPATH . 'wp-admin/includes/file.php' );
	include_once( ABSPATH . 'wp-admin/includes/misc.php' );
	include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );

	// Filter to prevent the activate text
	add_filter('install_plugin_complete_actions', 'pfx_install_pagelayer_complete_actions', 10, 3);
	
	echo '<h2>Install Pagelayer Free Version</h2>';

	$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin(  ) );
	$installed = $upgrader->install('https://downloads.wordpress.org/plugin/pagelayer.zip');
	
	if(is_wp_error( $installed ) || empty($installed)){
		return $installed;
	}
	
	if ( !is_wp_error( $installed ) && $installed ) {
		echo 'Activating Pagelayer Plugin !';
		$installed = activate_plugin('pagelayer/pagelayer.php');
		
		if ( is_null($installed)) {
			$installed = true;
			echo '<div id="message" class="updated"><p>'. sprintf(__('Done! Pagelayer is now installed and activated.  Please click <a href="%s">here</a> to import your themes content', 'popularfx'), admin_url('admin.php?page=pagelayer_import')). '</p></div><br />';
			echo '<br><br><b>Done! Pagelayer is now installed and activated.</b>';
		}
	}
	
	return $installed;
	
}

// Install Pagelayer Pro	
function pfx_install_pagelayer_pro($license = ''){
	
	global $pagelayer;
	
	$license = empty($license) ? $_GET['license'] : $license;
	
	// Include the necessary stuff
	include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );

	// Includes necessary for Plugin_Upgrader and Plugin_Installer_Skin
	include_once( ABSPATH . 'wp-admin/includes/file.php' );
	include_once( ABSPATH . 'wp-admin/includes/misc.php' );
	include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );

	// Filter to prevent the activate text
	add_filter('install_plugin_complete_actions', 'pfx_install_pagelayer_complete_actions', 10, 3);
	
	echo '<h2>Install Pagelayer Pro</h2>';

	$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin(  ) );
	$installed = $upgrader->install(PFX_PAGELAYER_API.'download.php?version=latest&license='.$license);
	
	if(is_wp_error( $installed ) || empty($installed)){
		return $installed;
	}
	
	if ( !is_wp_error( $installed ) && $installed ) {
		echo 'Activating Pagelayer Pro !';
		$installed = activate_plugin('pagelayer-pro/pagelayer-pro.php');
		
		if ( is_null($installed)) {
			$installed = true;
			echo '<div id="message" class="updated"><p>'. sprintf(__('Done! Pagelayer Pro is now installed and activated.  Please click <a href="%s">here</a> to import your themes content', 'popularfx'), admin_url('admin.php?page=pagelayer_import')). '</p></div><br />';
			echo '<br><br><b>Done! Pagelayer Pro is now installed and activated.</b>';
		}
	}
	
	return $installed;
	
}

// Prevent pro activate text for installer
function pfx_install_pagelayer_complete_actions($install_actions, $api, $plugin_file){
	
	if($plugin_file == 'pagelayer-pro/pagelayer-pro.php'){
		return array();
	}
	
	if($plugin_file == 'pagelayer/pagelayer.php'){
		return array();
	}
	
	return $install_actions;
}

// Show the message to install pagelayer Pro
function pfx_pagelayer_required(){
	
	if($_REQUEST['page'] == 'popularfx_install_pagelayer'){
		return;
	}
	
	echo '
<div class="notice notice-warning">
	<p style="font-size:13px">You need the <a href="'.PFX_WWW_URL.'" target="_blank"><b>Pagelayer Editor</b></a> to run this theme and also import its content ! Please enter your PopularFX / Pagelayer Pro License key and click on <b>Install</b></p>
	<p style="font-size:13px">
		<input type="text" id="pfx_license_key" placeholder="PFX-XXXXX-XXXXX-XXXXX-XXXXX" size="40" /> <button class="button button-primary" onclick="popularfx_install_pagelayer()">Install</button>
	</p>
</div>

<script>
function pfx_install_pagelayer(){
	var url = "'.admin_url('admin.php?page=popularfx_install_pagelayer&license=').'"+jQuery("#pfx_license_key").val();
	window.location = url;
}
</script>';
	
}
	
function pfx_page_templates() {

	include_once(dirname(__FILE__).'/templates.php');
	
	popularfx_templates();

}

function pfx_templates_ajax() {

	include_once(dirname(__FILE__).'/templates.php');
	
	if($_GET['action'] == 'popularfx_template_info'){
		popularfx_ajax_template_info();
	}
	
	if($_GET['action'] == 'popularfx_start_install_template'){
		popularfx_ajax_start_install_template();
	}
	
	if($_GET['action'] == 'popularfx_download_template'){
		popularfx_ajax_download_template();
	}
	
	if($_GET['action'] == 'popularfx_import_template'){
		popularfx_ajax_import_template();
	}

}
	
function pfx_page_handler() {

	include_once(dirname(__FILE__).'/license.php');
	
	popularfx_license();

}

// Default Templates for Blog
function pfx_create_blog_template($template_name){
	
	global $pagelayer;
	
	$file = pfx_cleanpath(get_theme_root());
	
	// Do we have the blog template ?
	if(file_exists($file.'/blog-template.pgl')){
		return;
	}
	
	$data['blog-template'] = '[pl_row pagelayer-id="ffbgB5e4xPIruUJC" stretch="auto" col_gap="10" width_content="auto" row_height="default" overlay_hover_delay="400" row_shape_top_color="#227bc3" row_shape_top_width="100" row_shape_top_height="100" row_shape_bottom_color="#e44993" row_shape_bottom_width="100" row_shape_bottom_height="100"]
[pl_col pagelayer-id="aF6cze85x0CVnb4I" overlay_hover_delay="400"]
[pl_archive_title pagelayer-id="a6sL2H8c5FJDwHmL" align="left" typo=",,,,,,Solid,,,," ele_margin="0px,0px,18px,0px" font_size="28"]
[/pl_archive_title]
[pl_archive_posts pagelayer-id="CrFuxlpqwrKx1cok" type="default" columns="3" columns_mobile="1" col_gap="20" row_gap="40" data_padding="5,5,5,5" bg_color="#ffffff" show_thumb="true" show_title="true" meta="author,date,comments" meta_sep="|" show_content="excerpt" content_color="#121212" content_align="left" pagination="number_prev_next" thumb_size="medium_large" ratio="0.7" title_color="#0986c0" title_typo=",18,,,,,solid,,,," exc_length="10" pagi_prev_text="Previous" pagi_next_text="Next" pagi_end_size="1" pagi_mid_size="2" pagi_align="center"]
[/pl_archive_posts]
[/pl_col]
[/pl_row]';

	$data['single-template'] = '[pl_row pagelayer-id="TeNMIn3gRsvsyDZj" stretch="auto" col_gap="10" width_content="auto" row_height="default" overlay_hover_delay="400" row_shape_top_color="#227bc3" row_shape_top_width="100" row_shape_top_height="100" row_shape_bottom_color="#e44993" row_shape_bottom_width="100" row_shape_bottom_height="100"]
[pl_col pagelayer-id="qyP2XV3ClSd9cEWM" overlay_hover_delay="400"]
[pl_post_title pagelayer-id="nNt87422AXwZoBQg" title_color="" typo=",35,,700,,,solid,,,," align="center"]
[/pl_post_title]
[/pl_col]
[/pl_row]
[pl_row pagelayer-id="6UuOjtSrBDhWOnWG" stretch="auto" col_gap="10" width_content="fixed" row_height="default" overlay_hover_delay="400" row_shape_top_color="#227bc3" row_shape_top_width="100" row_shape_top_height="100" row_shape_bottom_color="#e44993" row_shape_bottom_width="100" row_shape_bottom_height="100" row_width="70%" fixed_width="70%" fixed_width_tablet="85%" fixed_width_mobile="100%"]
[pl_col pagelayer-id="gzGSF2JVwcPcNUk6" overlay_hover_delay="400" col_width="80" col="12"]
[pl_post_info pagelayer-id="gBDuE9nYBu0bIHyv" layout="vertical" space_between="15" align="center" icon_colors="normal" text_colors="normal"]
[pl_post_info_list pagelayer-id="ZMZjpaTiEc9Ien3t" type="author" info_link="true" info_icon_on="true" info_icon="fas fa-user-circle"]
[/pl_post_info_list]
[pl_post_info_list pagelayer-id="xI8gpn9VRfPDkZ0Q" type="date" info_link="true" info_icon_on="true" info_icon="fas fa-calendar-alt" date_format="default"]
[/pl_post_info_list]
[pl_post_info_list pagelayer-id="LaEZYd9SjEnQHsg3" type="time" info_link="true" info_icon_on="true" info_icon="fas fa-clock" time_format="default"]
[/pl_post_info_list]
[pl_post_info_list pagelayer-id="9lTHiEQJQqESt6YG" type="comments" info_link="true" info_icon_on="true" info_icon="fas fa-comment"]
[/pl_post_info_list]
[/pl_post_info]
[pl_post_excerpt pagelayer-id="NklzzZGW3ve1X8BS" ele_margin="15px,0px,15px,0px" align="left"]
[/pl_post_excerpt]
[pl_featured_img pagelayer-id="sZLiICVhGCbBTx1a" size="full" img_filter="0,100,100,0,0,100,100" caption_color="#0986c0" img_hover_delay="400" custom_size="70%,0%" align="center"]
[/pl_featured_img]
[pl_post_content pagelayer-id="7JbkxQEvq0skyUUl" ele_margin="35px,0px,35px,0px" font_size="NaN"]
[/pl_post_content]
[pl_post_info pagelayer-id="tvno5FCIKdwGa8IE" layout="horizontal" space_between="5" align="left" icon_colors="normal" text_colors="normal" input_typo=",,,,,,Solid,,,,"]
[pl_post_info_list pagelayer-id="SwoZ4cxl3XFMLE3l" type="terms" info_link="true" info_icon_on="" info_icon="fas fa-user-circle" taxonomy="category" info_before="Category :"]
[/pl_post_info_list]
[pl_post_info_list pagelayer-id="sgTqNx5LkBHODkrG" type="terms" info_link="true" info_icon_on="" info_icon="fas fa-user-circle" taxonomy="post_tag" info_before="Tags :"]
[/pl_post_info_list]
[/pl_post_info]
[/pl_col]
[/pl_row]
[pl_row pagelayer-id="heO1UxRj8lIQZ52M" stretch="auto" col_gap="10" width_content="auto" row_height="default" overlay_hover_delay="400" row_shape_top_color="#227bc3" row_shape_top_width="100" row_shape_top_height="100" row_shape_bottom_color="#e44993" row_shape_bottom_width="100" row_shape_bottom_height="100"]
[pl_col pagelayer-id="s3sgObVllcHz0CB7" overlay_hover_delay="400"]
[pl_post_nav pagelayer-id="RrRky7duRa9KGmsA" lables="true" post_title="true" arrows="true" sep_color="#bdbdbd" sep_rotate="20" sep_width="5" prev_label="Previous" next_label="Next" label_colors="normal" title_colors="normal" arrows_list="angle" icon_colors="normal"]
[/pl_post_nav]
[/pl_col]
[/pl_row]
[pl_row pagelayer-id="duGtpLrwHkOWbE0m" stretch="auto" col_gap="10" width_content="auto" row_height="default" overlay_hover_delay="400" row_shape_top_color="#227bc3" row_shape_top_width="100" row_shape_top_height="100" row_shape_bottom_color="#e44993" row_shape_bottom_width="100" row_shape_bottom_height="100"]
[pl_col pagelayer-id="ad58IjV6dHjcRBmV" overlay_hover_delay="400"]
[pl_post_comment pagelayer-id="bwueyBxPgdNLC1Ec" comment_skin="theme_comment" post_type="current"]
[/pl_post_comment]
[/pl_col]
[/pl_row]';

	$conf = '{
		"single-template": {
			"type": "single",
			"title": "Single Template",
			"conditions": [
				{
					"type": "include",
					"template": "singular",
					"sub_template": "post",
					"id": ""
				},
				{
					"type": "include",
					"template": "singular",
					"sub_template": "attachment",
					"id": ""
				}
			]
		},
		"blog-template": {
			"type": "archive",
			"title": "Blog Template",
			"conditions": [
				{
					"type": "include",
					"template": "archives",
					"sub_template": "",
					"id": ""
				}
			]
		}
		
	}';
	
	$pgl = json_decode($conf, true);
	
	// Loop the default template
	foreach($pgl as $k => $v){
		
		$new_post = array();
	
		// Is the page there ?
		$template = get_page_by_path($k, OBJECT, $pagelayer->builder['name']);
		
		// It does exist so save the revision IF its the header and footer
		if(!empty($template)){
			
			$rev = wp_save_post_revision($template->ID);
			
			// Did we save the rev ?
			//if(empty($rev)){
				// TODO : Throw error
			//}
			
			$new_post['ID'] = $template->ID;
			
		}
		
		// Make an array
		$new_post['post_content'] = $data[$k];
		$new_post['post_title'] = $v['title'];
		$new_post['post_name'] = $k;
		$new_post['post_type'] = $pagelayer->builder['name'];
		$new_post['post_status'] = 'publish';
		$new_post['comment_status'] = 'closed';
		$new_post['ping_status'] = 'closed';
		//pagelayer_print($new_post);die();
		
		// Now insert / update the post
		$ret = pagelayer_insert_content($new_post, $err);
		$post_id = $ret;
		
		// Did we save the rev ?
		if(empty($ret)){
			die('Could not update the Pagelayer Template '.$k);
		}
		
		// Save our template type
		update_post_meta($post_id, 'pagelayer_template_type', $v['type']);
		update_post_meta($post_id, 'pagelayer_template_conditions', $v['conditions']);
		
		update_post_meta($post_id, 'pagelayer_imported_content', $template_name);
	}
	
}

// Load license data
function pfx_load_license(){
	
	global $popularfx, $pagelayer;

	// Load license
	$popularfx['license'] = get_option('popularfx_license');
	
	if(empty($popularfx['license'])){
		return;
	}
	
	// Update license details as well
	if(empty($popularfx['license']['last_update']) || 
		(!empty($popularfx['license']['last_update']) && (time() - $popularfx['license']['last_update']) >= 86400)
	){
		
		$resp = wp_remote_get(pfx_api_url().'license.php?license='.$popularfx['license']['license']);
		
		// Did we get a response ?
		if(is_array($resp)){
			
			$tosave = json_decode($resp['body'], true);
			
			// Is it the license ?
			if(!empty($tosave['license'])){
				$tosave['last_update'] = time();
				update_option('popularfx_license', $tosave);
			}
			
		}
		
	}
	
	// Add the same license to Pagelayer if we have Pagelayer Pro with an unlicensed value
	if(function_exists('pagelayer_theme_import_notices') && empty($pagelayer->license['status']) && !empty($popularfx['license']['status'])){
		$pagelayer->license = $popularfx['license'];
	}
	
}
	
function pfx_sp_api_url(){
	
	global $popularfx;
	
	return str_replace('/popularfx', '/sitepad', pfx_api_url());
	
}
	
function pfx_api_url(){
	
	global $popularfx;
	
	$r = array(
		'https://s1.softaculous.com/a/popularfx/',
		'https://s2.softaculous.com/a/popularfx/',
		'https://s3.softaculous.com/a/popularfx/',
		'https://s4.softaculous.com/a/popularfx/',
		'https://s5.softaculous.com/a/popularfx/'
	);
	
	$mirror = $r[array_rand($r)];
	
	// If the license is newly issued, we need to fetch from API only
	if(empty($popularfx['license']['last_edit']) || 
		(!empty($popularfx['license']['last_edit']) && (time() - 1800) < $popularfx['license']['last_edit'])
	){
		$mirror = 'https://a.softaculous.com/popularfx/';
	}
	
	return $mirror;
	
}

// Add settings link on plugin page
add_filter('plugin_action_links_popularfx-templates/popularfx-templates.php', 'pfx_plugin_action_links');
function pfx_plugin_action_links($links){
	
	global $popularfx;
	
	if(empty($popularfx['license']['status'])){
		 $links[] = '<a href="'.PFX_PRO_URL.'" style="color:#3db634;" target="_blank">'._x('Go Pro', 'Upgrade to PopularFX Pro for many more features', 'popularfx').'</a>';
	}

	$settings_link = '<a href="admin.php?page=popularfx">Settings</a>';	
	array_unshift($links, $settings_link); 
	
	return $links;
}

// Check if a field is posted via POST else return default value
function pfx_optpost($name, $default = ''){

	if(!empty($_POST[$name])){
		return pfx_inputsec(pfx_htmlizer(trim($_POST[$name])));
	}

	return $default;
}



function pfx_inputsec($string){

	$string = addslashes($string);

	// This is to replace ` which can cause the command to be executed in exec()
	$string = str_replace('`', '\`', $string);

	return $string;

}

function pfx_htmlizer($string){

	$string = htmlentities($string, ENT_QUOTES, 'UTF-8');

	preg_match_all('/(&amp;#(\d{1,7}|x[0-9a-fA-F]{1,6});)/', $string, $matches);//r_print($matches);

	foreach($matches[1] as $mk => $mv){
		$tmp_m = pfx_entity_check($matches[2][$mk]);
		$string = str_replace($matches[1][$mk], $tmp_m, $string);
	}

	return $string;

}

function pfx_entity_check($string){

	//Convert Hexadecimal to Decimal
	$num = ((substr($string, 0, 1) === 'x') ? hexdec(substr($string, 1)) : (int) $string);

	//Squares and Spaces - return nothing 
	$string = (($num > 0x10FFFF || ($num >= 0xD800 && $num <= 0xDFFF) || $num < 0x20) ? '' : '&#'.$num.';');

	return $string;

}
	
function pfx_cleanpath($path){
	$path = str_replace('\\', '/', $path);
	$path = str_replace('//', '/', $path);
	return rtrim($path, '/');
}

function pfx_templates_dir(){
	$dir = wp_upload_dir(NULL, false);
	return $dir['basedir'].'/popularfx-templates';
}

function pfx_templates_dir_url(){
	$dir = wp_upload_dir(NULL, false);
	return $dir['baseurl'].'/popularfx-templates';
}

// Fix the image URLs for versions prior to 108
function pfx_fix_image_urls_108(){
	
	$template = get_theme_mod('popularfx_template');
		 
	// Get list of pages and pagelayer templates to edit
	$args = array(
		'post_type' => ['page', 'pagelayer-template'],
	);
	
	$query = new WP_Query($args);

	foreach($query->posts as $k => $v){
		$v->post_content = str_replace(get_stylesheet_directory_uri().'/templates/'.$template.'/images/', pfx_templates_dir_url().'/'.$template.'/images/', $v->post_content);
		
		// For fixing wwww.abc.com which may be abc.com only
		if(preg_match('/'.preg_quote('/wp-content/themes/popularfx/templates/'.$template.'/images/', '/').'/is', $v->post_content)){
		
			$v->post_content = str_replace('/wp-content/themes/popularfx/templates/'.$template.'/images/', '/wp-content/uploads/popularfx-templates/'.$template.'/images/', $v->post_content);
		
		}
		
		wp_update_post($v);
	}
	
}

add_action('wp_loaded', 'pfx_woo_fix');
function pfx_woo_fix(){
	if(class_exists( 'woocommerce' ) && function_exists('pagelayer_template_product_fix')){
		pagelayer_template_product_fix();
	}
}

if(function_exists('is_admin') && is_admin() && !file_exists(WP_PLUGIN_DIR.'/pagelayer-pro/pagelayer-pro.php') && file_exists(dirname(__FILE__).'/supgrade.php')){
	include_once(dirname(__FILE__).'/supgrade.php');
}

Youez - 2016 - github.com/yon3zu
LinuXploit