Location: PHPKode > scripts > Simple Debug > simple-debug/simple-debug.php
<?php

class Simple_Debug {
	/**
	 * Plugin version
	 *
	 * @var string
	 */
	public $version                 = '1.4.5';
	
	/**
	 * Array with default options
	 *
	 * @var array
	 */
	protected $_options             = array(
		
		'simple_debug_enabled' => true,
		'simple_debug_log_enabled' => false,
		'simple_debug_phpini_enabled' => false,
		'simple_debug_phpinfo_enabled' => false,
		'simple_debug_db_optimization_enabled' => false,
		'simple_debug_db_performance_enabled' => false,
		'simple_debug_display_error_log' => false,
		'simple_debug_error_log_location' => false
	);
	
	
	
	
	/**
	 * Plugin work path
	 *
	 * @var string
	 */
	protected $_plugin_dir          = null;
	
	/**
	 * Settings url
	 *
	 * @var string
	 */
	protected $_settings_url        = null;


	
	/**
	 * Get option by setting name with default value if option is unexistent
	 *
	 * @param string $setting
	 * @return mixed
	 */
	protected function get_option($setting) {
	    if(is_array($this->_options[$setting])) {
	        $options = array_merge($this->_options[$setting], get_option($setting));
	    } else {
	        $options = get_option($setting, $this->_options[$setting]);
	    }

	    return $options;
	}
	
	/**
	 * Get array with options
	 *
	 * @return array
	 */
	private function get_options() {
		$options = array();
		
		// loop through default options and get user defined options
		foreach($this->_options as $option => $value) {
			$options[$option] = $this->get_option($option);
		}
		
		return $options;
	}
	
	/**
	 * Merge configuration array with the default one
	 *
	 * @param array $default
	 * @param array $opt
	 * @return array
	 */
	private function mergeConfArray($default, $opt) {
		foreach($default as $option => $values)	{
			if(!empty($opt[$option])) {
				$default[$option] = is_array($values) ? array_merge($values, $opt[$option]) : $opt[$option];
				$default[$option] = is_array($values) ? array_intersect_key($default[$option], $values) : $opt[$option];
			}
		}

		return $default;
    }
	
	/**
	 * Plugin installation method
	 */
	public function activateSimpleDebug() {
		// record install time
		add_option('simple_debug_installed', time(), null, 'no');
				
		// loop through default options and add them into DB
		foreach($this->_options as $option => $value) {
			add_option($option, $value, null, 'no');	
		}
	}
	
	

	
	
}

?>
Return current item: Simple Debug