HEX
Server: Apache/2.4.57 (Unix) OpenSSL/1.1.1k
System: Linux tam.zee-supreme-vps.net 4.18.0-513.9.1.el8_9.x86_64 #1 SMP Sat Dec 2 05:23:44 EST 2023 x86_64
User: adltc (1070)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/adltc/public_html/wp-content/plugins/jet-engine/includes/modules/forms/tabs/base-form-tab.php
<?php


namespace Jet_Engine\Modules\Forms\Tabs;


abstract class Base_Form_Tab {

	public $prefix = 'jet_engine_form_settings__';

	abstract public function slug();

	abstract public function on_get_request();

	abstract public function on_load();

	public function get_options( $default = array() ) {
		$response = get_option( $this->prefix . $this->slug(), false );

		$response = $response
			? json_decode( $response, true )
			: array();

		return array_merge( $default, $response );
	}

	public function update_options( $options ) {
		$options = json_encode( $options );

		return update_option( $this->prefix . $this->slug(), $options );
	}

	public function render_assets() {
	}

	public function verify_request() {

		if ( ! current_user_can( 'manage_options' ) ) {
			wp_send_json_error( array( 'message' => esc_html__( 'Access denied', 'jet-engine' ) ) );
		}

		$nonce = ! empty( $_REQUEST['_nonce'] ) ? $_REQUEST['_nonce'] : false;

		if ( ! $nonce || ! wp_verify_nonce( $nonce, jet_engine()->dashboard->get_nonce_action() ) ) {
			wp_send_json_error( array( 'message' => esc_html__( 'Nonce validation failed', 'jet-engine' ) ) );
		}

	}

}