HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: /var/www/html/triad-infosec/wp-content/themes/Avada/includes/lib/inc/class-fusion-amp.php
<?php
/**
 * AMP methods for Avada & Avada Builder.
 *
 * @package Fusion-Library
 * @since 1.8.1
 */

/**
 * AMP methods.
 *
 * @since 1.8.1
 */
class Fusion_AMP {

	/**
	 * Determine if an AMP plugin is active.
	 *
	 * @static
	 * @access public
	 * @since 1.8.1
	 * @return bool
	 */
	public static function is_plugin_activated() {

		// Check for the "AMP" plugin.
		if ( function_exists( 'is_amp_endpoint' ) ) {
			return true;
		}

		// Check for the "AMP for WP – Accelerated Mobile Pages" plugin.
		if ( function_exists( 'ampforwp_is_amp_endpoint' ) ) {
			return true;
		}

		// Check for the "AMP WP" plugin.
		if ( function_exists( 'is_amp_wp' ) ) {
			return true;
		}

		return false;
	}

	/**
	 * Check if we're on an AMP endpoint.
	 *
	 * @static
	 * @access public
	 * @since 1.8.1
	 * @return bool
	 */
	public static function is_amp_endpoint() {

		// If an AMP plugin is not active then this is definitely not an AMP endpoint.
		if ( ! self::is_plugin_activated() ) {
			return false;
		}

		// Check for the "AMP" plugin.
		if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
			return true;
		}

		// Check for the "AMP for WP – Accelerated Mobile Pages" plugin.
		if ( function_exists( 'ampforwp_is_amp_endpoint' ) && ampforwp_is_amp_endpoint() ) {
			return true;
		}

		// Check for the "AMP WP" plugin.
		if ( function_exists( 'is_amp_wp' ) && is_amp_wp() ) {
			return true;
		}

		return false;
	}
}