mirror of
https://github.com/proelements/proelements.git
synced 2026-05-05 17:15:58 +00:00
v4.0.4
This commit is contained in:
@@ -4,20 +4,22 @@ namespace ElementorPro\Modules\Interactions;
|
||||
|
||||
use ElementorPro\Plugin;
|
||||
use ElementorPro\Base\Module_Base;
|
||||
use ElementorPro\Core\Utils as ProUtils;
|
||||
use Elementor\Modules\AtomicWidgets\Module as AtomicWidgetsModule;
|
||||
use Elementor\Modules\Interactions\Module as InteractionsModule;
|
||||
use Elementor\Core\Experiments\Manager as ExperimentsManager;
|
||||
use ElementorPro\License\API;
|
||||
use ElementorPro\License\Admin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class Module extends Module_Base {
|
||||
const MODULE_NAME = 'e-interactions';
|
||||
const EXPERIMENT_NAME = 'e_pro_interactions';
|
||||
|
||||
public function get_name() {
|
||||
return self::MODULE_NAME;
|
||||
return ProUtils::get_class_constant( InteractionsModule::class, 'MODULE_NAME', 'e-interactions' );
|
||||
}
|
||||
|
||||
public static function get_experimental_data(): array {
|
||||
@@ -26,11 +28,23 @@ class Module extends Module_Base {
|
||||
'title' => esc_html__( 'Pro Interactions', 'elementor-pro' ),
|
||||
'description' => esc_html__( 'Enhanced interactions with replay support. Note: This feature requires both the "Atomic Widgets" and "Interactions" experiments to be enabled.', 'elementor-pro' ),
|
||||
'hidden' => true,
|
||||
'default' => ExperimentsManager::STATE_INACTIVE,
|
||||
'default' => ExperimentsManager::STATE_ACTIVE,
|
||||
'release_status' => ExperimentsManager::RELEASE_STATUS_DEV,
|
||||
];
|
||||
}
|
||||
|
||||
private function is_supported_by_current_license() {
|
||||
if ( empty( \ElementorPro\License\Admin::get_license_key() ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! API::is_license_active() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return API::is_licence_has_feature( 'pro-interactions', API::BC_VALIDATION_CALLBACK );
|
||||
}
|
||||
|
||||
private function hooks() {
|
||||
return new Hooks();
|
||||
}
|
||||
@@ -38,7 +52,7 @@ class Module extends Module_Base {
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
if ( ! $this->is_experiment_active() ) {
|
||||
if ( ! $this->is_experiment_active() || ! $this->is_supported_by_current_license() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -46,9 +60,10 @@ class Module extends Module_Base {
|
||||
}
|
||||
|
||||
private function is_experiment_active(): bool {
|
||||
return class_exists( 'Elementor\\Modules\\Interactions\\Module' )
|
||||
return version_compare( ELEMENTOR_VERSION, '4.0', '>=' )
|
||||
&& class_exists( 'Elementor\\Modules\\Interactions\\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( InteractionsModule::EXPERIMENT_NAME );
|
||||
&& Plugin::elementor()->experiments->is_feature_active( ProUtils::get_class_constant( InteractionsModule::class, 'EXPERIMENT_NAME', 'e_interactions' ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user