<?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.. */
class HappyFenceNGVRMCORE extends HappyFenceNGAVRoute {

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

			$nonce_save_settings = wp_create_nonce( 'happyfenceng_MCORE_save_settings' );
			$burn                = HappyFenceNGFailFast::setup();

			$params = array(
				'texts'  => array(
					'designed_for'          => esc_html__( 'Designed for individuals, professionals, agencies, and enterprises.', 'happyfenceng-total-enterprise-security' ),
					'built_for'             => esc_html__( 'Built to defend against modern threats with hardened, layered protection.', 'happyfenceng-total-enterprise-security' ),
					'disclaimer'            => esc_html__( 'Disclaimer', 'happyfenceng-total-enterprise-security' ),
					'disclaimer_1'          => esc_html__( 'HappyFenceNG helps protect your site, but it’s important to keep regular backups.', 'happyfenceng-total-enterprise-security' ),
					'disclaimer_2'          => esc_html__( 'The developer is not responsible for any unintended site issues or data loss.', 'happyfenceng-total-enterprise-security' ),
					'disclaimer_3'          => esc_html__( 'Use responsibly.', 'happyfenceng-total-enterprise-security' ),
					'title'                 => esc_html__( 'The next-generation WordPress security suite', 'happyfenceng-total-enterprise-security' ),
					'headline'              => esc_html__( 'The next-generation WordPress security suite', 'happyfenceng-total-enterprise-security' ),
					'core_features'         => esc_html__( 'Core Features', 'happyfenceng-total-enterprise-security' ),
					'line_title'            => esc_html__( 'Secured DB', 'happyfenceng-total-enterprise-security' ),
					'line'                  => esc_html__( 'Full encrypted configuration DB', 'happyfenceng-total-enterprise-security' ),
					'line_0_title'          => esc_html__( 'FailFast™ Anti Hijacking', 'happyfenceng-total-enterprise-security' ),
					'line_0'                => esc_html__( 'Dynamic OTT for secure access and configuration', 'happyfenceng-total-enterprise-security' ),
					'line_1_title'          => esc_html__( 'Multi-tier firewall', 'happyfenceng-total-enterprise-security' ),
					'line_1'                => esc_html__( 'Adaptive pattern detection for a complete protection', 'happyfenceng-total-enterprise-security' ),
					'line_2_title'          => esc_html__( 'Zero Trust Vector Engine', 'happyfenceng-total-enterprise-security' ),
					'line_2'                => esc_html__( 'ZTV Engine for in-memory hacking lockup', 'happyfenceng-total-enterprise-security' ),
					'line_3_title'          => esc_html__( 'Advanced login security', 'happyfenceng-total-enterprise-security' ),
					'line_3'                => esc_html__( 'Multi Factor Authentication with brute-force shields', 'happyfenceng-total-enterprise-security' ),
					'line_4_title'          => esc_html__( 'Fullset of advanced scanners', 'happyfenceng-total-enterprise-security' ),
					'line_4'                => esc_html__( 'Malware scanner, shell detection, and upload guard', 'happyfenceng-total-enterprise-security' ),
					'line_5_title'          => esc_html__( 'GeoIP seamless integration', 'happyfenceng-total-enterprise-security' ),
					'line_5'                => esc_html__( 'Easly connect to your preferred provider', 'happyfenceng-total-enterprise-security' ),
					'line_6_title'          => esc_html__( 'Logs and filters', 'happyfenceng-total-enterprise-security' ),
					'line_6'                => esc_html__( 'Real-time log analysis with severity and facility filters', 'happyfenceng-total-enterprise-security' ),
					'line_7_title'          => esc_html__( 'Privacy compliance', 'happyfenceng-total-enterprise-security' ),
					'line_7'                => esc_html__( 'One-click Easy Privacy banners setup', 'happyfenceng-total-enterprise-security' ),
					'line_8_title'          => esc_html__( 'Seamless SIEM integration', 'happyfenceng-total-enterprise-security' ),
					'line_8'                => esc_html__( 'SIEM-ready audit trail with DB/file syslog support', 'happyfenceng-total-enterprise-security' ),
					'line_9_title'          => esc_html__( 'Cloudflare/Reverse Proxy', 'happyfenceng-total-enterprise-security' ),
					'line_9'                => esc_html__( 'Cloudflare/RP guard and suspicious query trap', 'happyfenceng-total-enterprise-security' ),
					'line_10_title'         => esc_html__( 'Advanced admin protection', 'happyfenceng-total-enterprise-security' ),
					'line_10'               => esc_html__( 'Admin slug protection w/random generator', 'happyfenceng-total-enterprise-security' ),
					'line_11_title'         => esc_html__( 'Fine-grained advanced options', 'happyfenceng-total-enterprise-security' ),
					'line_11'               => esc_html__( 'Fine-grained advanced options for critical filters', 'happyfenceng-total-enterprise-security' ),
					'line_12_title'         => esc_html__( 'HappyFenceNg Shell', 'happyfenceng-total-enterprise-security' ),
					'line_12'               => esc_html__( 'WP-CLI Shell for critical operations with password protection', 'happyfenceng-total-enterprise-security' ),
					'line_13_title'         => esc_html__( 'IP Blacklist', 'happyfenceng-total-enterprise-security' ),
					'line_13'               => esc_html__( 'Block against attackers IP', 'happyfenceng-total-enterprise-security' ),
					'line_14_title'         => esc_html__( 'Anti Tampering', 'happyfenceng-total-enterprise-security' ),
					'line_14'               => esc_html__( 'Code-Autocheck with hack function block', 'happyfenceng-total-enterprise-security' ),

					'license'               => esc_html__( 'Licensing and Support', 'happyfenceng-total-enterprise-security' ),
					'lic_line_1'            => esc_html__( 'HappyFenceNG is available as a fully functional free edition, which includes all the essential features to protect your WordPress site.', 'happyfenceng-total-enterprise-security' ),
					'lic_line_2'            => esc_html__( 'For users who need more advanced protection, automation, and enterprise-level security, HappyFenceNG offers optional commercial tiers:', 'happyfenceng-total-enterprise-security' ),
					'lic_line_3'            => esc_html__( 'FREE: ', 'happyfenceng-total-enterprise-security' ),
					'lic_line_3a'           => esc_html__( 'Basic protection [ community and FAQ support ]', 'happyfenceng-total-enterprise-security' ),
					'lic_line_4'            => esc_html__( 'PROFESSIONAL: ', 'happyfenceng-total-enterprise-security' ),
					'lic_line_4a'           => esc_html__( 'Professional protection with best effort business support.', 'happyfenceng-total-enterprise-security' ),
					'lic_line_5'            => esc_html__( 'AGENCY: ', 'happyfenceng-total-enterprise-security' ),
					'lic_line_5a'           => esc_html__( 'Advanced protection with 5-business day priority support.', 'happyfenceng-total-enterprise-security' ),
					'lic_line_6'            => esc_html__( 'ENTERPRISE: ', 'happyfenceng-total-enterprise-security' ),
					'lic_line_6a'           => esc_html__( 'Enterprise-grade protection with 3-business day priority support.', 'happyfenceng-total-enterprise-security' ),
					'check_features'        => esc_html__( 'CHECK FULL FEATURES COMPARISON ON THE LICENSE MANAGEMENT PAGE!', 'happyfenceng-total-enterprise-security' ),
					'need_help'             => esc_html__( 'Need help or want to learn more? ', 'happyfenceng-total-enterprise-security' ),
					'visit_happywpress'     => esc_html__( 'Visit happywpress.com', 'happyfenceng-total-enterprise-security' ),

					'feature_requires'      => esc_html__( 'THIS FEATURE IS FREE', 'happyfenceng-total-enterprise-security' ),
					'save_settings'         => esc_html__( 'Save Settings', 'happyfenceng-total-enterprise-security' ),
					'settings_saved'        => esc_html__( 'Settings Saved', 'happyfenceng-total-enterprise-security' ),
					'error_saving_settings' => esc_html__( 'Error saving settings', 'happyfenceng-total-enterprise-security' ),
				),
				'links'  => array(
					'happyfenceng_logo_url' => esc_url( HAPPYFENCENG_PLUGIN_URL . 'assets/images/happyfenceng-small.png' ),

				),
				'values' => array(

					'checkbox_on'     => HappyFenceNGPlaceholder::CHECKBOX_ON,
					'checkbox_off'    => HappyFenceNGPlaceholder::CHECKBOX_OFF,
					'nonce'           => $nonce_save_settings,
					'burnNonce'       => $burn,
					'feature_enabled' => true,

				),
			);

			ob_start();
			HappyFenceNGVControl::renderView( $params, 'mcore' );
			// phpcs:ignore WordPress.Security.EscapeOutput
			echo ob_get_clean();

		} catch ( Throwable $e ) {
			HappyFenceNGLOGCORE::logcore(
				'HappyFenceNGVRNCORE - cannot render UI ' . $e->getMessage(),
				HappyFenceNGSyslogFacility::UI,
				HappyFenceNGSyslogSeverity::ERROR
			);
			ob_end_clean();
			HappyFenceNGCleaner::cleaner_oops();
		}
	}
}
