HEX
Server: Apache
System: Linux efa57bbe-abb1-400d-2985-3b056fbc2701.secureserver.net 6.1.147-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jul 24 12:33:32 EDT 2025 x86_64
User: root (0)
PHP: 8.0.30.4
Disabled: NONE
Upload Files
File: /var/www/wp-content/plugins/elementor/modules/ai/site-planner-connect/wp-rest-api.php
<?php

namespace Elementor\Modules\Ai\SitePlannerConnect;

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

/**
 * Just a simple rest api to validate new Site Planner Connect feature exists.
 */
class Wp_Rest_Api {

	public function register(): void {
		register_rest_route('elementor-ai/v1', 'permissions', [
			[
				'methods' => \WP_REST_Server::READABLE,
				'permission_callback' => function () {
					return current_user_can( 'manage_options' );
				},
				'callback' => function () {
					try {
						wp_send_json_success( [
							'site_planner_connect' => true,
						] );
					} catch ( \Exception $e ) {
						wp_send_json_error( [
							'message' => $e->getMessage(),
						] );
					}
				},
			],
		] );
	}
}