HEX
Server: LiteSpeed
System: Linux s3.sitechai.com 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64
User: workzeni (2217)
PHP: 8.1.32
Disabled: mail, show_source, system, shell_exec, passthru, exec, eval, shell
Upload Files
File: /home/workzeni/ecom.workzenix.com/wp-content/plugins/shopengine/core/export-import/import.php
<?php

namespace ShopEngine\Core\Export_Import;

class Import {

	public function init() {

		add_action('import_start', [$this, 'rum_importer']);
	}

	public function rum_importer() {

		// phpcs:ignore WordPress.Security.NonceVerification.Missing  -- This hook can access only admin and not possible nonce here
		if(empty($_POST['import_id'])) {
			return;
		}
		// phpcs:ignore WordPress.Security.NonceVerification.Missing  -- This hook can access only admin and not possible nonce here
		$im_id = intval($_POST['import_id']);
		$file  = get_attached_file($im_id);

		$dom     = new \DOMDocument;
		$success = $dom->loadXML(file_get_contents($file));

		if(!($success || isset($dom->doctype))) {

			return;
		}

		$xml = simplexml_import_dom($dom);
		unset($dom);

		if(!$xml) {

			return;
		}

		$options = $xml->xpath('/rss/channel/wp_options/wp_option');

		foreach($options as $option) {

			$nm = (string)$option->name;
			$vl = (string)$option->val;

			update_option($nm, $vl);
		}
	}
}