PluginProbe
Hello Plus / 1.5.2
Hello Plus v1.5.2
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.6.0 1.6.1 1.6.2 1.7.0 1.7.1 1.7.2 1.7.3 All 30 releases
hello-plus / modules / admin / classes / onboarding / install-elementor.php

install-elementor.php in Hello Plus 1.5.2, at modules/admin/classes/onboarding/install-elementor.php

35 lines 757 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace HelloPlus\Modules\Admin\Classes\Onboarding;
4
5 use HelloPlus\Includes\Utils;
6
7 if ( ! defined( 'ABSPATH' ) ) {
8 exit; // Exit if accessed directly.
9 }
10
11 class Install_Elementor {
12
13 public function install_and_activate() {
14 wp_ajax_install_plugin();
15 }
16
17 public function activate() {
18 if ( ! Utils::is_installed_elementor_version_supported() ) {
19 wp_send_json_error(
20 [
21 'errorMessage' => Utils::get_update_elementor_message(),
22 ],
23 );
24 }
25
26 $activated = activate_plugin( 'elementor/elementor.php' );
27
28 if ( is_wp_error( $activated ) ) {
29 wp_send_json_error( [ 'errorMessage' => $activated->get_error_message() ] );
30 }
31
32 wp_send_json_success( [ 'message' => __( 'Elementor activated successfully.', 'hello-plus' ) ] );
33 }
34 }
35