HEX
Server: Apache
System: Linux ecngx285.inmotionhosting.com 4.18.0-553.79.1.lve.el8.x86_64 #1 SMP Wed Oct 15 17:59:35 UTC 2025 x86_64
User: zeusxp5 (3862)
PHP: 8.3.28
Disabled: NONE
Upload Files
File: /home/zeusxp5/chuair.org/wp-content/plugins/wd-framework/import/endpoints/options.php
<?php

namespace Webdevia\Main_Plugin;

if ( ! defined('ABSPATH') ) {
	exit;
}

class WD_ImportOptions extends Endpoint {

	public $action = 'wd_import_options';

	public function __construct() {
		parent::__construct();
	}

  public function action() {
		try {
			// TODO: add nonce

			$importer = new Importer();

			$folder = "/files/";
			if ( ! empty( $_POST['example'] ) )
				$folder = $_POST['example'] . "/";

			$importer->importOptions( $folder . 'options.txt' );

			wp_send_json( [
        'success'   => true,
        'message'   => esc_html__( "Options Imported successfully.", "webdevia" ),
        'output'    => ob_get_clean()
      ], 200 );
		} catch (\Exception $e) {
			// Handle the exception
			wp_send_json( [
        'success'   => false,
        'message'   => esc_html__( $e->getMessage(), 'webdevia' ),
        'output'    => ob_get_clean()
      ], 500 );
		}
	}
  
}