| 1 |
<?php |
| 2 |
|
| 3 |
namespace HelloPlus\Modules\Theme\Components; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; // Exit if accessed directly |
| 7 |
} |
| 8 |
|
| 9 |
use HelloPlus\Includes\Utils; |
| 10 |
|
| 11 |
class Theme_Dependency { |
| 12 |
public function activate() { |
| 13 |
if ( ! Utils::has_hello_biz() ) { |
| 14 |
deactivate_plugins( HELLOPLUS_PLUGIN_BASE ); |
| 15 |
|
| 16 |
wp_die( |
| 17 |
wp_kses( __( '<strong>Hello+ needs an active Hello suite theme to work</strong>. Install and activate a theme from the Elementor Hello suite to start using the plugin.', 'hello-plus' ), |
| 18 |
[ |
| 19 |
'strong' => [], |
| 20 |
] |
| 21 |
), |
| 22 |
esc_html__( 'Plugin Activation Error', 'hello-plus' ), |
| 23 |
[ 'back_link' => true ] |
| 24 |
); |
| 25 |
} |
| 26 |
|
| 27 |
if ( Utils::is_elementor_active() && ! Utils::is_active_elementor_version_supported() ) { |
| 28 |
deactivate_plugins( HELLOPLUS_PLUGIN_BASE ); |
| 29 |
|
| 30 |
wp_die( |
| 31 |
esc_html( Utils::get_update_elementor_message() ), |
| 32 |
esc_html__( 'Plugin Activation Error', 'hello-plus' ), |
| 33 |
[ 'back_link' => true ] |
| 34 |
); |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
public function __construct() { |
| 39 |
add_action( 'hello-plus/activate', [ $this, 'activate' ] ); |
| 40 |
} |
| 41 |
} |
| 42 |
|