| 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( sprintf( __( 'The Hello Plus plugin requires the Hello Biz theme to be installed and active. <a href="%s">Check it out!</a>', 'hello-plus' ), admin_url( 'theme-install.php?theme=hello-biz' ) ), |
| 18 |
[ |
| 19 |
'a' => [ |
| 20 |
'href' => [], |
| 21 |
], |
| 22 |
] |
| 23 |
), |
| 24 |
esc_html__( 'Plugin Activation Error', 'hello-plus' ), |
| 25 |
[ 'back_link' => true ] |
| 26 |
); |
| 27 |
} |
| 28 |
|
| 29 |
if ( Utils::is_elementor_active() && ! Utils::is_active_elementor_version_supported() ) { |
| 30 |
deactivate_plugins( HELLOPLUS_PLUGIN_BASE ); |
| 31 |
|
| 32 |
wp_die( |
| 33 |
esc_html( Utils::get_update_elementor_message() ), |
| 34 |
esc_html__( 'Plugin Activation Error', 'hello-plus' ), |
| 35 |
[ 'back_link' => true ] |
| 36 |
); |
| 37 |
} |
| 38 |
} |
| 39 |
|
| 40 |
public function __construct() { |
| 41 |
add_action( 'hello-plus/activate', [ $this, 'activate' ] ); |
| 42 |
} |
| 43 |
} |
| 44 |
|