403Webshell
Server IP : 198.54.115.198  /  Your IP : 216.73.216.142
Web Server : LiteSpeed
System : Linux server192.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User : seatpheu ( 1569)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/seatpheu/public_html/wp-content/plugins/elementor-pro/modules/variables/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/seatpheu/public_html/wp-content/plugins/elementor-pro/modules/variables//module.php
<?php

namespace ElementorPro\Modules\Variables;

use Elementor\Modules\Variables\PropTypes\Size_Variable_Prop_Type;
use ElementorPro\Plugin;
use ElementorPro\Base\Module_Base;
use Elementor\Modules\AtomicWidgets\Module as AtomicWidgetsModule;
use Elementor\Modules\Variables\Module as VariablesModule;
use Elementor\Core\Experiments\Manager as ExperimentsManager;
use ElementorPro\License\API;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

class Module extends Module_Base {
	const MODULE_NAME = 'e-variables';
	const EXPERIMENT_NAME = 'e_pro_variables';

	public function get_name() {
		return self::MODULE_NAME;
	}

	public static function get_experimental_data(): array {
		return [
			'name' => self::EXPERIMENT_NAME,
			'title' => esc_html__( 'Size Variables', 'elementor-pro' ),
			'description' => esc_html__( 'Allows the use of size variables within supported controls. Note: This feature requires both the "Atomic Widgets" and "Variables" experiments to be enabled.', 'elementor-pro' ),
			'hidden' => true,
			'default' => ExperimentsManager::STATE_ACTIVE,
			'release_status' => ExperimentsManager::RELEASE_STATUS_ALPHA,
		];
	}

	private function hooks() {
		return new Hooks();
	}

	private function is_supported_by_license() {
		return API::is_licence_has_feature( 'size-variable', API::BC_VALIDATION_CALLBACK );
	}

	public function __construct() {
		parent::__construct();

		if ( ! $this->is_experiment_active() || ! $this->is_supported_by_license() ) {
			return;
		}

		$this->hooks()->register();

		add_action( 'elementor/editor/before_enqueue_scripts', fn () => $this->enqueue_editor_scripts() );
	}

	private function is_experiment_active(): bool {
		return class_exists( 'Elementor\\Modules\\Variables\\Module' )
			&& Plugin::elementor()->experiments->is_feature_active( self::EXPERIMENT_NAME )
			&& Plugin::elementor()->experiments->is_feature_active( AtomicWidgetsModule::EXPERIMENT_NAME )
			&& Plugin::elementor()->experiments->is_feature_active( VariablesModule::EXPERIMENT_NAME );
	}

	private function get_quota_config( $limit ): array {
		return [
			Size_Variable_Prop_Type::get_key() => $limit,
		];
	}

	public function enqueue_editor_scripts() {
		$limit = 100000;

		if ( API::is_license_expired() ) {
			$limit = 0;
		}

		wp_add_inline_script(
			'elementor-common',
			'window.ElementorVariablesQuotaConfigExtended = ' . wp_json_encode( $this->get_quota_config( $limit ) ) . ';',
			'before'
		);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit