HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/duplicatefoodfactor/public_html/wp-content/plugins/wp-time-capsule/Base/Config.php
<?php

#[AllowDynamicProperties]
abstract class Wptc_Base_Config {
	protected $config;
	protected $used_options;
	protected $used_wp_options;

	public function __construct() {
		$this->init();
	}

	private function init() {
		$this->used_options = array();
		$this->used_wp_options = array();
	}

	protected abstract function set_used_options();

	public function get_option($option_name = null) {
		if (array_key_exists($option_name, $this->used_options)) {
			return WPTC_Factory::get('config')->get_option($option_name);
		}
		wptc_log($option_name, "--------not registered Wptc_Base_Config--------");
	}

	public function set_option($option_name, $val = null) {
		if (array_key_exists($option_name, $this->used_options)) {
			return WPTC_Factory::get('config')->set_option($option_name, $val);
		}
		wptc_log($option_name, "--------not registered Wptc_Base_Config--------");
	}

	public function flush() {
		foreach ($this->used_options as $option_name => $v) {
			if ($v == 'flushable') {
				WPTC_Factory::get('config')->set_option($option_name, false);
			}
		}

		$this->flush_wp_options();
	}

	public function flush_wp_options() {
		if (empty($this->used_wp_options)) {
			return true;
		}

		foreach ($this->used_wp_options as $option_name => $v) {
			if ($v == 'flushable') {
				delete_option($option_name, false);
			}
		}
	}
}