<?php
/**
 * AntivirusVulnerabilityScanner — DEPRECATED stub.
 *
 * This page was previously registered under the Antivirus module as a subpage
 * with id='vulnerability-scanner'. It has been superseded by the dedicated
 * VulnerabilityModule which owns that page ID and its own DB tables, AJAX
 * handlers, and virtual patching engine.
 *
 * The page registration was removed from AntivirusModule::register_pages() so
 * this class is never instantiated in practice. It is kept as a stub to avoid
 * fatal errors in case any third-party code still references the class name,
 * and will be removed in a future release.
 *
 * @package UltraguardPro\modules\antivirus\pages
 * @deprecated Superseded by UltraguardPro\modules\vulnerability\pages\VulnerabilityDashboard
 */

namespace UltraguardPro\modules\antivirus\pages;

use UltraguardPro\Plugin;
use UltraguardPro\modules\core\BasePage;

if ( ! defined( 'ABSPATH' ) ) { exit; }

class AntivirusVulnerabilityScanner extends BasePage {

    public function __construct( Plugin $plugin ) {
        parent::__construct( $plugin );
    }

    /**
     * Render a redirect notice pointing to the new module page.
     * This will only ever be seen if the page is somehow re-registered externally.
     */
    public function get_scheme( $context ): array {
        $new_url = admin_url( 'admin.php?page=ultraguard-security-suite-dashboard&ug_page=vulnerability-scanner' );

        return [
            'type'      => 'page',
            'id'        => 'ultraguard-vuln-scanner-legacy',
            'page_slug' => 'vulnerability-scanner',
            'class'     => 'ultraguard-page-no-sidebar',
            'header'    => [
                'title'    => __( 'Vulnerability Scanner', 'ultraguard-security-suite' ),
                'subtitle' => __( 'This page has moved.', 'ultraguard-security-suite' ),
                'icon'     => 'dashicons-shield-alt',
            ],
            'data' => [
                [
                    'type'       => 'alert-box',
                    'alert_type' => 'info',
                    'title'      => __( 'Page Moved', 'ultraguard-security-suite' ),
                    'message'    => __( 'The Vulnerability Scanner is now a dedicated module with CVE scanning, CVSS scoring, and virtual patching. You will be redirected automatically.', 'ultraguard-security-suite' ),
                    'actions'    => [
                        [
                            'type'         => 'button',
                            'text'         => __( 'Go to Vulnerability Scanner →', 'ultraguard-security-suite' ),
                            'button_style' => 'primary',
                            'url'          => $new_url,
                        ],
                    ],
                ],
            ],
        ];
    }
}
