'class-frankwall-config.php', 'FrankWall_Geo' => 'class-frankwall-geo.php', 'FrankWall_Telemetry' => 'class-frankwall-telemetry.php', 'FrankWall_Perimeter' => 'class-frankwall-perimeter.php', 'FrankWall_Camouflage' => 'class-frankwall-camouflage.php', 'FrankWall_Hardening' => 'class-frankwall-hardening.php', 'FrankWall_Auth' => 'class-frankwall-auth.php', 'FrankWall_UEBA' => 'class-frankwall-ueba.php', 'FrankWall_FIM' => 'class-frankwall-fim.php', 'FrankWall_Engagements_Table' => 'class-frankwall-table.php', 'FrankWall_Admin' => 'class-frankwall-admin.php', ]; if ( isset( $map[ $class_name ] ) ) { $file = FRANKWALL_INCLUDES_DIR . $map[ $class_name ]; if ( file_exists( $file ) ) { require_once $file; } } } ); final class FrankWall_Plugin { private static ?self $instance = null; private FrankWall_Config $config; private FrankWall_Geo $geo; private FrankWall_Telemetry $telemetry; private FrankWall_Perimeter $perimeter; private FrankWall_Camouflage $camouflage; private FrankWall_Hardening $hardening; private FrankWall_Auth $auth; private FrankWall_UEBA $ueba; private FrankWall_FIM $fim; private FrankWall_Admin $admin; public static function boot(): self { if ( self::$instance === null ) { self::$instance = new self(); } return self::$instance; } private function __construct() { $this->config = new FrankWall_Config(); $this->geo = new FrankWall_Geo( $this->config ); $this->telemetry = new FrankWall_Telemetry( $this->config, $this->geo ); $this->perimeter = new FrankWall_Perimeter( $this->config, $this->geo, $this->telemetry ); $this->camouflage = new FrankWall_Camouflage( $this->config, $this->perimeter ); $this->hardening = new FrankWall_Hardening( $this->config, $this->geo, $this->telemetry ); $this->auth = new FrankWall_Auth( $this->config, $this->geo, $this->telemetry, $this->perimeter ); $this->ueba = new FrankWall_UEBA( $this->config, $this->geo, $this->telemetry, $this->perimeter ); $this->fim = new FrankWall_FIM( $this->telemetry ); $this->admin = new FrankWall_Admin( FRANKWALL_PLUGIN_FILE, FRANKWALL_VERSION, $this->config, $this->geo, $this->telemetry, $this->perimeter, $this->camouflage, $this->hardening, $this->auth, $this->ueba, $this->fim ); register_activation_hook( FRANKWALL_PLUGIN_FILE, [ $this, 'on_activate' ] ); register_deactivation_hook( FRANKWALL_PLUGIN_FILE, [ $this, 'on_deactivate' ] ); add_action( $this->telemetry->get_cron_hook(), [ $this, 'run_weekly_digest_cron' ] ); $this->telemetry->sync_weekly_cron(); $this->perimeter->register_hooks(); $this->camouflage->register_hooks(); $this->hardening->register_hooks(); $this->auth->register_hooks(); $this->ueba->register_hooks(); if ( is_admin() ) { $this->admin->register_hooks(); } } public function on_activate(): void { if ( $this->config->is_enabled( 'block_php_uploads' ) ) { $this->hardening->update_uploads_htaccess( true ); } if ( $this->config->is_enabled( 'enable_camouflage' ) ) { $this->camouflage->update_root_htaccess( true ); } $this->telemetry->sync_weekly_cron(); } public function on_deactivate(): void { $this->hardening->update_uploads_htaccess( false ); $this->camouflage->update_root_htaccess( false ); $this->telemetry->unschedule_cron(); } public function run_weekly_digest_cron(): void { $this->telemetry->send_weekly_digest_email( $this->fim->get_last_report() ); } } FrankWall_Plugin::boot();