<?php
/**
 * HappyFenceNG Total Enterprise Security Plugin
 * HAPPYWPRESS is a RazorVue Trademark.
 *
 * @package     HappyFenceNG
 * @developer   Simonluca Scillitani
 * @copyright   2025 RazorVue di Scillitani Simonluca
 * @link        https://razorvue.it
 * @author      RazorVue di Scillitani Simonluca
 * @brand       HappyWPress
 * @uri         https://happywpress.com
 * @set all
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
/**PHPCS -> code compliance: we put useful comments where needed.. */
final class HappyFenceNGMulti {

	/**PHPCS -> code compliance: we put useful comments where needed..
	 *
	 * @var HappyFenceNGMulti $instance .
	 */
	private static $instance = null;

	/**PHPCS -> code compliance: we put useful comments where needed.. */
	public static function get_instance(): ?self {

		if ( HappyFenceNGPROC::equals( self::$instance, null ) ) {
			self::$instance = new HappyFenceNGMulti();
		}
			return self::$instance;
	}

	public const _ALLOWED_UPLOAD_EXTENSIONS = 'png,jpg,jpeg,gif';

	public const _DEFAULT_IPBL = array(
		'10.0.0.0/8',
		'172.16.0.0/12',
		'192.168.0.0/16',
		'127.0.0.0/8',
		'169.254.0.0/16',
		'::1/128',
		'fc00::/7',
		'fe80::/10',
	);

	public const _LOGIN_RATE_INTERVAL = 5;
	public const _LOGIN_RATE_MAX      = 3;

	/**PHPCS -> code compliance: we put useful comments where needed..
	 *
	 * @param string $name ..
	 */
	public function __get( $name ) {
		switch ( $name ) {
			case 'enable_404_trap':
				return HappyFenceNGDF::B;
			case 'mode':
				return HappyFenceNGDF::S;
			case 'max_words':
				return HappyFenceNGDF::N;
			case 'template_page_id':
				return HappyFenceNGDF::N;
			case 'enable_cf_guard':
				return HappyFenceNGDF::B;
			case 'allowed_ips':
				return HappyFenceNGDF::S;
			case 'file':
				return HappyFenceNGDF::S;
			case 'remove_embed_script':
				return HappyFenceNGDF::B;
			case 'disable_oembed_discovery':
				return HappyFenceNGDF::B;
			case 'enable_filesystem_scan':
				return HappyFenceNGDF::B;
			case 'auto_remove_dangerous_files':
				return HappyFenceNGDF::B;
			case 'enabled_uri_patterns':
				return HappyFenceNGDF::AN;
			case 'disable_file_edit':
				return HappyFenceNGDF::B;
			case 'enable_plugin_monitoring':
				return HappyFenceNGDF::B;
			case 'geoip_block_enable':
				return HappyFenceNGDF::B;
			case 'geoip_provider':
				return HappyFenceNGDF::S;
			case 'geoip_blocked_countries':
				return HappyFenceNGDF::S;
			case 'geoip_api_key':
				return HappyFenceNGDF::S;
			case 'remove_x_pingback':
				return HappyFenceNGDF::B;
			case 'block_xmlrpc_pingback':
				return HappyFenceNGDF::B;
			case 'enable_post_filter':
				return HappyFenceNGDF::B;
			case 'enable_update_option_filter':
				return HappyFenceNGDF::B;
			case 'enable_rest_pre_dispatch_filter':
				return HappyFenceNGDF::B;
			case 'enable_cookie_banner':
				return HappyFenceNGDF::B;
			case 'enable_policy_banner':
				return HappyFenceNGDF::B;
			case 'enable_terms_banner':
				return HappyFenceNGDF::B;
			case 'text':
				return HappyFenceNGDF::S;
			case 'color':
				return HappyFenceNGDF::S;
			case 'text_color':
				return HappyFenceNGDF::S;
			case 'privacy_url':
				return HappyFenceNGDF::S;
			case 'cookie_url':
				return HappyFenceNGDF::S;
			case 'show_manage_link':
				return HappyFenceNGDF::S;
			case 'company_name':
				return HappyFenceNGDF::S;
			case 'owner_email':
				return HappyFenceNGDF::S;
			case 'treatment_location':
				return HappyFenceNGDF::S;
			case 'enable_shell_scanner':
				return HappyFenceNGDF::B;
			case 'quarantine_table':
				return HappyFenceNGDF::S;
			case 'block_rest_guests':
				return HappyFenceNGDF::B;
			case 'block_rest_users':
				return HappyFenceNGDF::B;
			case 'remove_rest_links':
				return HappyFenceNGDF::B;
			case 'blocked_endpoints':
				return HappyFenceNGDF::AN;
			case 'auto_patch_robots':
				return HappyFenceNGDF::B;
			case 'php_tag':
				return HappyFenceNGDF::B;
			case 'script_tag':
				return HappyFenceNGDF::B;
			case 'script_encoded':
				return HappyFenceNGDF::B;
			case 'eval_call':
				return HappyFenceNGDF::B;
			case 'base64_decode':
				return HappyFenceNGDF::B;
			case 'union_select':
				return HappyFenceNGDF::B;
			case 'select_from':
				return HappyFenceNGDF::B;
			case 'info_schema':
				return HappyFenceNGDF::B;
			case 'benchmark_call':
				return HappyFenceNGDF::B;
			case 'sleep_call':
				return HappyFenceNGDF::B;
			case 'or_1_equals_1':
				return HappyFenceNGDF::B;
			case 'path_traversal':
				return HappyFenceNGDF::B;
			case 'cmd_injection_cat':
				return HappyFenceNGDF::B;
			case 'cmd_injection_aws':
				return HappyFenceNGDF::B;
			case 'cmd_injection_passwd':
				return HappyFenceNGDF::B;
			case 'common_rce_tools':
				return HappyFenceNGDF::B;
			case 'aws_keys_probe':
				return HappyFenceNGDF::B;
			case 'query_param_exec':
				return HappyFenceNGDF::B;
			case 'env_file':
				return HappyFenceNGDF::B;
			case 'git_config':
				return HappyFenceNGDF::B;
			case 'bash_history':
				return HappyFenceNGDF::B;
			case 'aws_credentials':
				return HappyFenceNGDF::B;
			case 'passwd_file':
				return HappyFenceNGDF::B;
			case 'shadow_file':
				return HappyFenceNGDF::B;
			case 'cmd_cat_root':
				return HappyFenceNGDF::B;
			case 'cmd_cat_any':
				return HappyFenceNGDF::B;
			case 'rce_payloads':
				return HappyFenceNGDF::B;
			case 'double_dot':
				return HappyFenceNGDF::B;
			case 'wp_config_probe':
				return HappyFenceNGDF::B;
			case 'composer_json':
				return HappyFenceNGDF::B;
			case 'composer_lock':
				return HappyFenceNGDF::B;
			case 'env_dist':
				return HappyFenceNGDF::B;
			case 'vscode_settings':
				return HappyFenceNGDF::B;
			case 'id_rsa':
				return HappyFenceNGDF::B;
			case 'phpunit_test':
				return HappyFenceNGDF::B;
			case 'test_php':
				return HappyFenceNGDF::B;
			case 'laravel_log':
				return HappyFenceNGDF::B;
			case 'debug_bar':
				return HappyFenceNGDF::B;
			case 'wso_shell':
				return HappyFenceNGDF::B;
			case 'mailer_php':
				return HappyFenceNGDF::B;
			case 'db_backup_sql':
				return HappyFenceNGDF::B;
			case 'db_file_exposed':
				return HappyFenceNGDF::B;
			case 'config_backup':
				return HappyFenceNGDF::B;
			case 'env_local':
				return HappyFenceNGDF::B;
			case 'php_bak_files':
				return HappyFenceNGDF::B;
			case 'git_ignore':
				return HappyFenceNGDF::B;
			case 'svn_entries':
				return HappyFenceNGDF::B;
			case 'adminer_probe':
				return HappyFenceNGDF::B;
			case 'phpmyadmin_probe':
				return HappyFenceNGDF::B;
			case 'webshell_probe':
				return HappyFenceNGDF::B;
			case 'input_param_script':
				return HappyFenceNGDF::B;
			case 'src_data_uri':
				return HappyFenceNGDF::B;
			case 'onerror_injection':
				return HappyFenceNGDF::B;
			case 'iframe_injection':
				return HappyFenceNGDF::B;
			case 'node_modules':
				return HappyFenceNGDF::B;
			case 'vendor_autoload':
				return HappyFenceNGDF::B;
			case '.idea_folder':
				return HappyFenceNGDF::B;
			case 'uploads_php_exec':
				return HappyFenceNGDF::B;
			case 'wp_json_api':
				return HappyFenceNGDF::B;
			case 'license_probe':
				return HappyFenceNGDF::B;
			case 'rest_users_enumeration':
				return HappyFenceNGDF::B;
			case 'uploaded_archives':
				return HappyFenceNGDF::B;
			case 'backup_folder_probe':
				return HappyFenceNGDF::B;
			case 'wp_load_probe':
				return HappyFenceNGDF::B;
			case 'index_in_uploads':
				return HappyFenceNGDF::B;
			case 'favicon_probe':
				return HappyFenceNGDF::B;
			case 'user_agent_scan_tools':
				return HappyFenceNGDF::B;
			case 'enable_guard':
				return HappyFenceNGDF::B;
			case 'block_xmlrpc':
				return HappyFenceNGDF::B;
			case 'block_xmlrpc_pingback':
				return HappyFenceNGDF::B;
			case 'enable_htaccess_protection':
				return HappyFenceNGDF::B;

			case 'redirect_page':
				return HappyFenceNGDF::S;
			case 'mfa_enabled':
				return HappyFenceNGDF::B;
			case 'mfa_force_admin':
				return HappyFenceNGDF::B;
			case 'mfa_disable_admin':
				return HappyFenceNGDF::B;
			case 'allowed_upload_extensions':
				return self::_ALLOWED_UPLOAD_EXTENSIONS;
			case 'enable_ipbl_guard':
				return HappyFenceNGDF::B;
			case 'blacklist_ips':
				return implode( ',', self::_DEFAULT_IPBL );

			case 'PHP_TAG':
				return HappyFenceNGDF::B;
			case 'SCRIPT_TAG':
				return HappyFenceNGDF::B;
			case 'SCRIPT_ENCODED':
				return HappyFenceNGDF::B;
			case 'EVAL_CALL':
				return HappyFenceNGDF::B;
			case 'BASE64_DECODE':
				return HappyFenceNGDF::B;
			case 'UNION_SELECT':
				return HappyFenceNGDF::B;
			case 'SELECT_FROM':
				return HappyFenceNGDF::B;
			case 'INFO_SCHEMA':
				return HappyFenceNGDF::B;
			case 'BENCHMARK_CALL':
				return HappyFenceNGDF::B;
			case 'SLEEP_CALL':
				return HappyFenceNGDF::B;
			case 'OR_1_EQUALS_1':
				return HappyFenceNGDF::B;
			case 'PATH_TRAVERSAL':
				return HappyFenceNGDF::B;
			case 'CMD_INJECTION_CAT':
				return HappyFenceNGDF::B;
			case 'CMD_INJECTION_AWS':
				return HappyFenceNGDF::B;
			case 'CMD_INJECTION_PASSWD':
				return HappyFenceNGDF::B;
			case 'COMMON_RCE_TOOLS':
				return HappyFenceNGDF::B;
			case 'AWS_KEYS_PROBE':
				return HappyFenceNGDF::B;
			case 'QUERY_PARAM_EXEC':
				return HappyFenceNGDF::B;
			case 'ENV_FILE':
				return HappyFenceNGDF::B;
			case 'GIT_CONFIG':
				return HappyFenceNGDF::B;
			case 'BASH_HISTORY':
				return HappyFenceNGDF::B;
			case 'AWS_CREDENTIALS':
				return HappyFenceNGDF::B;
			case 'PASSWD_FILE':
				return HappyFenceNGDF::B;
			case 'SHADOW_FILE':
				return HappyFenceNGDF::B;
			case 'CMD_CAT_ROOT':
				return HappyFenceNGDF::B;
			case 'CMD_CAT_ANY':
				return HappyFenceNGDF::B;
			case 'RCE_PAYLOADS':
				return HappyFenceNGDF::B;
			case 'DOUBLE_DOT':
				return HappyFenceNGDF::B;
			case 'WP_CONFIG_PROBE':
				return HappyFenceNGDF::B;
			case 'COMPOSER_JSON':
				return HappyFenceNGDF::B;
			case 'COMPOSER_LOCK':
				return HappyFenceNGDF::B;
			case 'ENV_DIST':
				return HappyFenceNGDF::B;
			case 'VSCODE_SETTINGS':
				return HappyFenceNGDF::B;
			case 'ID_RSA':
				return HappyFenceNGDF::B;
			case 'PHPUNIT_TEST':
				return HappyFenceNGDF::B;
			case 'TEST_PHP':
				return HappyFenceNGDF::B;
			case 'LARAVEL_LOG':
				return HappyFenceNGDF::B;
			case 'DEBUG_BAR':
				return HappyFenceNGDF::B;
			case 'WSO_SHELL':
				return HappyFenceNGDF::B;
			case 'MAILER_PHP':
				return HappyFenceNGDF::B;
			case 'DB_BACKUP_SQL':
				return HappyFenceNGDF::B;
			case 'DB_FILE_EXPOSED':
				return HappyFenceNGDF::B;
			case 'CONFIG_BACKUP':
				return HappyFenceNGDF::B;
			case 'ENV_LOCAL':
				return HappyFenceNGDF::B;
			case 'PHP_BCK_FILES':
				return HappyFenceNGDF::B;
			case 'GIT_IGNORE':
				return HappyFenceNGDF::B;
			case 'SVN_ENTRIES':
				return HappyFenceNGDF::B;
			case 'ADMINER_PROBE':
				return HappyFenceNGDF::B;
			case 'PHPMYADMIN_PROBE':
				return HappyFenceNGDF::B;
			case 'WEBSHELL_PROBE':
				return HappyFenceNGDF::B;
			case 'INPUT_PARAM_SCRIPT':
				return HappyFenceNGDF::B;
			case 'SRC_DATA_URI':
				return HappyFenceNGDF::B;
			case 'ONERROR_INJECTION':
				return HappyFenceNGDF::B;
			case 'IFRAME_INJECTION':
				return HappyFenceNGDF::B;
			case 'NODE_MODULES':
				return HappyFenceNGDF::B;
			case 'VENDOR_AUTOLOAD':
				return HappyFenceNGDF::B;
			case 'IDEA_FOLDER':
				return HappyFenceNGDF::B;
			case 'UPLOADS_PHP_EXEC':
				return HappyFenceNGDF::B;
			case 'WP_JSON_API':
				return HappyFenceNGDF::B;
			case 'LICENSE_PROBE':
				return HappyFenceNGDF::B;
			case 'REST_USERS_ENUMERATION':
				return HappyFenceNGDF::B;
			case 'UPLOADED_ARCHIVES':
				return HappyFenceNGDF::B;
			case 'BACKUP_FOLDER_PROBE':
				return HappyFenceNGDF::B;
			case 'WP_LOAD_PROBE':
				return HappyFenceNGDF::B;
			case 'INDEX_IN_UPLOADS':
				return HappyFenceNGDF::B;
			case 'FAVICON_PROBE':
				return HappyFenceNGDF::B;
			case 'USER_AGENT_SCAN_TOOLS':
				return HappyFenceNGDF::B;

			default:
				return HappyFenceNGDF::B;
		}
	}

	/**PHPCS -> code compliance: we put useful comments where needed..
	 *
	 * @param string $name .
	 */
	public function __isset( $name ): bool {
		return true;
	}

	/**PHPCS -> code compliance: we put useful comments where needed..
	 *
	 * @param string $name .
	 * @param string $value .
	 */
	public function __set( $name, $value ): void {
	}

	/**PHPCS -> code compliance: we put useful comments where needed..
	 *
	 * @param string $name .
	 */
	public function __unset( $name ): void {
	}

	/**PHPCS -> code compliance: we put useful comments where needed..
	 *
	 * @param string $key .
	 * @param string $adefault .
	 */
	protected function jz( $key, $adefault = null ): void {
	}

	/**PHPCS -> code compliance: we put useful comments where needed.. */
	public function flush(): void {
	}
}
