# hello-plus/1.2.0/modules/admin/classes/onboarding/install-elementor.php

Hello Plus, version 1.2.0. 35 lines.

- Page: https://pluginprobe.com/plugins/hello-plus/1.2.0/code/modules/admin/classes/onboarding/install-elementor.php
- Raw: https://pluginprobe.com/plugins/hello-plus/1.2.0/raw/modules/admin/classes/onboarding/install-elementor.php
- Modified: 2024-12-24T15:30:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/hello-plus/1.2.0/code/modules/admin/classes/onboarding/install-elementor.php#L10-L20`.

```php
<?php

namespace HelloPlus\Modules\Admin\Classes\Onboarding;

use HelloPlus\Includes\Utils;

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

class Install_Elementor {

	public function install_and_activate() {
		wp_ajax_install_plugin();
	}

	public function activate() {
		if ( ! Utils::is_installed_elementor_version_supported() ) {
			wp_send_json_error(
				[
					'errorMessage' => Utils::get_update_elementor_message(),
				],
			);
		}

		$activated = activate_plugin( 'elementor/elementor.php' );

		if ( is_wp_error( $activated ) ) {
			wp_send_json_error( [ 'errorMessage' => $activated->get_error_message() ] );
		}

		wp_send_json_success( [ 'message' => __( 'Elementor activated successfully.', 'hello-plus' ) ] );
	}
}

```
