array_fill_keys( array( 'width', 'height', 'viewbox', 'fill', 'stroke', 'stroke-width', 'stroke-linecap', 'stroke-linejoin', 'aria-hidden' ), true ), 'path' => $geometry, 'rect' => $geometry, 'circle' => $geometry, 'ellipse' => $geometry, 'span' => array( 'class' => true ), ); } public static function icon( string $name ): string { if ( 'more-plugins' === $name ) { $name = 'overview'; } $paths = array( 'overview' => '', 'findings' => '', 'activity' => '', 'settings' => '', 'setup' => '', 'pro' => '', 'help' => '', 'data' => '', 'arrow' => '', 'shield' => '', 'file' => '', 'clock' => '', 'check' => '', 'lock' => '', 'pause' => '', ); return ''; } public static function brand(): string { return 'ShieldlumeSecurity'; } /** Separate attribution link; the original brand link and logo stay intact. */ public static function brandAttribution(): void { echo '' . esc_html__( 'by', 'shieldlume-security' ) . ' Plugins.shop ' . esc_html__( '(opens in a new tab)', 'shieldlume-security' ) . ''; } /** Identify this WordPress site separately from the product branding. */ public static function siteContext(): void { $host = wp_parse_url( home_url(), PHP_URL_HOST ); echo '
' . esc_html__( 'Site:', 'shieldlume-security' ) . ' ' . esc_html( $host ?: __( 'Your WordPress site', 'shieldlume-security' ) ) . '
'; } /** Native disclosure keeps display preferences reachable without JavaScript. */ public static function toolbarOptionsStart(): void { echo '
' . esc_html__( 'View options', 'shieldlume-security' ) . '
'; } public static function toolbarOptionsEnd(): void { echo '
'; } /** Render a native navigation disclosure. An active destination opens its group. */ public static function navigationGroup( string $id, string $label, string $icon, array $items, string $active ): void { if ( ! $items ) { return; } $current = isset( $items[ $active ] ); echo '
' . wp_kses( self::icon( $icon ), self::markupTags() ) . '' . esc_html( $label ) . '
'; foreach ( $items as $key => $item ) { self::navigationLink( $key, $item['label'], $item['url'], $active, $item['icon'] ?? $key, $item['badge'] ?? '' ); } echo '
'; } /** Own local destinations only; no data or action authority is added by a link. */ public static function navigationLink( string $key, string $label, string $url, string $active, string $icon = '', string $badge = '' ): void { $classes = $key === $active ? 'is-active' : ''; if ( 'more-plugins' === $key ) { $classes .= ' avai-more-nav'; } echo '' . wp_kses( self::icon( $icon ?: $key ), self::markupTags() ) . '' . esc_html( $label ) . '' . ( $badge ? '' . esc_html( $badge ) . '' : '' ) . ''; } /** Preview visibility is an existing local administrator preference, not a security mode. */ private static function previewNavigation( string $tab, array $labels ): void { $hidden = Journey::previewsHidden(); $available = ! is_multisite() && get_current_user_id() > 0 && current_user_can( 'manage_options' ); $return_tab = Journey::previewReturnTab( $tab ) ?: 'more-plugins'; echo '

' . esc_html__( 'Pro previews', 'shieldlume-security' ) . '

'; wp_nonce_field( 'antivirus_ai_journey_preferences', '_avai_journey_nonce', false ); echo '

' . esc_html__( 'For your administrator account on this site. Showing previews also restores individually dismissed Pro suggestions. Available to single-site administrators.', 'shieldlume-security' ) . '

'; } public static function open( string $tab, array $labels ): void { $pro = defined( 'ANTIVIRUS_AI_PRO_VERSION' ) && function_exists( 'antivirus_ai_pro_compatible' ) && antivirus_ai_pro_compatible(); echo '
' . esc_html__( 'Skip to plugin content', 'shieldlume-security' ) . '
' . wp_kses( self::brand(), self::markupTags() ) . ''; self::brandAttribution(); echo '

' . esc_html__( 'WORDPRESS SECURITY', 'shieldlume-security' ) . '

' . esc_html( $pro ? __( 'FREE + PRO INSTALLED', 'shieldlume-security' ) : __( 'YOUR FREE EDITION', 'shieldlume-security' ) ) . '' . esc_html( $pro ? ( Journey::proUnlocked() ? __( 'Local Pro tools unlocked', 'shieldlume-security' ) : __( 'Pro activation required', 'shieldlume-security' ) ) : __( 'Local scans and guidance', 'shieldlume-security' ) ) . ''; if ( $pro ) { echo '' . esc_html( Journey::proUnlocked() ? __( 'Open Pro workspace', 'shieldlume-security' ) : __( 'Activate your licence', 'shieldlume-security' ) ) . wp_kses( self::icon( 'arrow' ), self::markupTags() ) . ''; } echo '
' . esc_html( ANTIVIRUS_AI_VERSION ) . ' · ' . esc_html__( 'Evaluation release', 'shieldlume-security' ) . '
' . wp_kses( self::icon( $tab ), self::markupTags() ) . '' . esc_html( $labels[ $tab ] ) . '
'; self::siteContext(); echo '
'; self::toolbarOptionsStart(); WorkspaceDisplay::toolbar( $tab ); Appearance::toolbar(); echo ''; self::toolbarOptionsEnd(); echo '' . esc_html( $pro ? __( 'FREE + PRO', 'shieldlume-security' ) : __( 'FREE', 'shieldlume-security' ) ) . '
'; } public static function close( array $labels ): void { echo '

' . esc_html__( 'Where would you like to go?', 'shieldlume-security' ) . '

'; } public static function intro( string $eyebrow, string $title, string $copy ): void { echo '
' . esc_html( $eyebrow ) . '

' . esc_html( $title ) . '

' . esc_html( $copy ) . '

'; } public static function action( string $operation, string $label, string $id = '', string $style = 'primary', string $tab = 'overview' ): void { Admin::formStart( $operation, $tab ); if ( '' !== $id ) { echo ''; } submit_button( $label, $style, 'submit', false ); echo ''; } private static function evidence( string $title, array $data ): void { echo '
' . esc_html( $title ) . '
' . esc_html( wp_json_encode( $data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_INVALID_UTF8_SUBSTITUTE ) ) . '
'; } private static function state( ?array $scan ): array { $status = $scan['_status'] ?? 'not_started'; if ( ! $scan ) { return array( 'state' => $status, 'label' => __( 'Ready for your first scan', 'shieldlume-security' ), 'heading' => __( 'Your site. A clearer picture.', 'shieldlume-security' ), 'copy' => __( 'Start a scan to check supported files and database content. Then review any findings.', 'shieldlume-security' ) ); } if ( in_array( $status, array( 'queued', 'running' ), true ) ) { return array( 'state' => $status, 'label' => __( 'Scan in progress', 'shieldlume-security' ), 'heading' => __( 'Looking closer. In real time.', 'shieldlume-security' ), 'copy' => __( 'Progress is saved as the scan runs. WordPress cron can continue it after you leave this page.', 'shieldlume-security' ) ); } if ( 'confirmed_threat' === ( $scan['result_state'] ?? '' ) ) { $incomplete = SecurityBrief::snapshot( $scan )['incomplete']; return array( 'state' => $status, 'label' => $incomplete ? __( 'Confirmed threat found · coverage incomplete', 'shieldlume-security' ) : __( 'Confirmed threat found', 'shieldlume-security' ), 'heading' => __( 'This needs your attention.', 'shieldlume-security' ), 'copy' => $incomplete ? __( 'A confirmed threat was found, and some checks remain incomplete. Review the findings and coverage gaps before deciding your next step. Nothing has been repaired automatically.', 'shieldlume-security' ) : __( 'The completed checks found a confirmed threat. Open the findings, review the evidence and recommended action, and plan the next step carefully. Nothing has been repaired automatically.', 'shieldlume-security' ) ); } if ( SecurityBrief::snapshot( $scan )['incomplete'] ) { return array( 'state' => $status, 'label' => __( 'Scan incomplete', 'shieldlume-security' ), 'heading' => __( 'There is more to check.', 'shieldlume-security' ), 'copy' => __( 'Some checks could not finish. Your results are saved. Review what was skipped and any setup issues before scanning again.', 'shieldlume-security' ) ); } $clear = 'no_threats_detected' === ( $scan['result_state'] ?? '' ); return array( 'state' => $status, 'label' => $clear ? __( 'No threats detected in completed checks', 'shieldlume-security' ) : __( 'Findings need your attention', 'shieldlume-security' ), 'heading' => $clear ? __( 'Your scan, explained.', 'shieldlume-security' ) : __( 'A closer look is worth it.', 'shieldlume-security' ), 'copy' => $clear ? __( 'No threats were detected within the completed checks. Review the checked scope and any exclusions; this result does not guarantee that the whole site is clean.', 'shieldlume-security' ) : __( 'Open the findings and follow the suggested next steps. A change or vulnerability does not always mean malware.', 'shieldlume-security' ) ); } public static function overview( Store $store ): void { $scanner = new Scanner( $store ); $scan = $scanner->latest(); $history = $scanner->summary(); $state = self::state( $scan ); $active = in_array( $state['state'], array( 'queued', 'running' ), true ); $settings = get_option( 'antivirus_ai_settings', array() ); $count = $store->count( 'finding', 'open' ) + $store->count( 'finding', 'acknowledged' ); $counters = Diagnostics::scan( $scan )['counters'] ?? array(); $unknown = $scan ? __( 'Unknown', 'shieldlume-security' ) : '—'; self::intro( __( 'YOUR SECURITY WORKSPACE', 'shieldlume-security' ), __( 'Your security brief', 'shieldlume-security' ), __( 'Your latest results and what to do next.', 'shieldlume-security' ) ); SecurityBrief::render( $store, $scan, $state, $history ); echo '
' . esc_html__( 'All protection checks & setup choices', 'shieldlume-security' ) . ''; ProtectionChecklist::render( $store, $scan ); SecurityCenter::overview(); echo '
'; echo '
'; foreach ( array( array( 'checked', __( 'Files checked', 'shieldlume-security' ), isset( $counters['checked'] ) ? number_format_i18n( $counters['checked'] ) : $unknown, __( 'In the latest scan', 'shieldlume-security' ), 'file' ), array( 'outstanding', __( 'Findings to review', 'shieldlume-security' ), number_format_i18n( $count ), __( 'Open or acknowledged', 'shieldlume-security' ), 'findings' ), array( 'database_checked', __( 'Database rows checked', 'shieldlume-security' ), isset( $counters['database_checked'] ) ? number_format_i18n( $counters['database_checked'] ) : $unknown, __( 'In the latest scan', 'shieldlume-security' ), 'overview' ), array( 'skipped', __( 'Skipped or unreadable', 'shieldlume-security' ), isset( $counters['skipped'], $counters['unreadable'] ) ? number_format_i18n( $counters['skipped'] + $counters['unreadable'] ) : $unknown, __( 'Review coverage below', 'shieldlume-security' ), 'activity' ), ) as [$key, $title, $number, $hint, $icon] ) { echo '
' . esc_html( $title ) . wp_kses( self::icon( $icon ), self::markupTags() ) . '' . esc_html( $number ) . '' . esc_html( $hint ) . '
'; } echo '

' . esc_html__( 'See what was checked', 'shieldlume-security' ) . '

' . wp_kses( self::icon( 'file' ), self::markupTags() ) . '

' . esc_html__( 'Review the checks that finished and anything the scan could not assess.', 'shieldlume-security' ) . '

' . esc_html__( 'Review scan coverage', 'shieldlume-security' ) . wp_kses( self::icon( 'arrow' ), self::markupTags() ) . '

' . esc_html__( 'Protection, your way', 'shieldlume-security' ) . '

' . esc_html__( 'Manage', 'shieldlume-security' ) . '
    '; $loginRequested = ! empty( $settings['login_limit'] ); $loginEnabled = $loginRequested && ! LoginLimiter::conflicts() && ! ( defined( 'ANTIVIRUS_AI_DISABLE_LOGIN_LIMIT' ) && true === ANTIVIRUS_AI_DISABLE_LOGIN_LIMIT ); $capabilities = array( array( 'shield', __( 'Local scanning', 'shieldlume-security' ), __( 'Files, database content and saved results', 'shieldlume-security' ), __( 'Available', 'shieldlume-security' ), true ), array( 'clock', __( 'Scheduled scans', 'shieldlume-security' ), __( 'Scheduled through WordPress', 'shieldlume-security' ), ! empty( $settings['daily'] ) ? __( 'Enabled', 'shieldlume-security' ) : __( 'Off', 'shieldlume-security' ), ! empty( $settings['daily'] ) ), array( 'file', __( 'Official references', 'shieldlume-security' ), __( 'Optional WordPress.org comparisons', 'shieldlume-security' ), ! empty( $settings['online_references'] ) ? __( 'Allowed', 'shieldlume-security' ) : __( 'Off', 'shieldlume-security' ), ! empty( $settings['online_references'] ) ), array( 'lock', __( 'Login rate limiting', 'shieldlume-security' ), __( 'Local protection against repeated attempts', 'shieldlume-security' ), $loginEnabled ? __( 'Enabled', 'shieldlume-security' ) : ( $loginRequested ? __( 'Suspended', 'shieldlume-security' ) : __( 'Off', 'shieldlume-security' ) ), $loginEnabled ), ); foreach ( $capabilities as [$icon, $title, $hint, $label, $enabled] ) { echo '
  • ' . wp_kses( self::icon( $icon ), self::markupTags() ) . '
    ' . esc_html( $title ) . '' . esc_html( $hint ) . '
    ' . esc_html( $label ) . '
  • '; } echo '

' . esc_html__( 'Off means an optional check is disabled. It does not mean a threat was found.', 'shieldlume-security' ) . '

' . esc_html__( 'Scan details', 'shieldlume-security' ) . '

' . esc_html__( 'SAVED RESULTS', 'shieldlume-security' ) . '

' . esc_html__( 'Last completed site scan:', 'shieldlume-security' ) . ' ' . esc_html( $history['last_successful']['completed_at'] ?? __( 'Not yet recorded', 'shieldlume-security' ) ) . '

'; if ( $scan ) { echo '

' . esc_html( $scan['coverage']['declared_scope'] ?? __( 'Coverage is still being established.', 'shieldlume-security' ) ) . '

'; self::evidence( __( 'Checks completed and skipped', 'shieldlume-security' ), array( 'mode' => $scan['mode'] ?? 'full', 'status' => $scan['_status'], 'counters' => $counters, 'coverage' => $scan['coverage'] ?? array(), 'limitations' => $scan['limitations'] ?? array(), 'skipped_items' => $scan['skipped_items'] ?? array() ) ); self::evidence( __( 'Technical details and sources', 'shieldlume-security' ), array( 'inventory' => $scan['inventory'] ?? array(), 'rules' => $scan['rule_registry'] ?? array(), 'reference' => $scan['reference_source'] ?? array(), 'feed_freshness' => $scan['vulnerability_freshness'] ?? array(), 'repository' => $scan['repository_state'] ?? array() ) ); self::evidence( __( 'Site scan history', 'shieldlume-security' ), $history ); } else { echo '
' . wp_kses( self::icon( 'file' ), self::markupTags() ) . '

' . esc_html__( 'Your scan coverage will appear here after you start a scan. Until then, this site has not been assessed.', 'shieldlume-security' ) . '

'; } echo '

' . esc_html__( 'File counts can grow as folders are discovered. For a delayed or stalled scan, open Help & diagnostics.', 'shieldlume-security' ) . '

'; $events = $store->list( 'activity', null, 4 ); echo '
'; self::events( $events ); echo '
'; if ( ! Journey::proInstalled() && ! Journey::previewsHidden() ) { echo '
' . esc_html__( 'OPTIONAL PRO WORKFLOWS', 'shieldlume-security' ) . '

' . esc_html__( 'Keep your security review moving.', 'shieldlume-security' ) . '

' . esc_html__( 'Pro adds flexible schedules, related investigations and client summaries. Free keeps local scans, complete findings and guidance.', 'shieldlume-security' ) . '

'; } echo '
'; do_action( 'antivirus_ai_overview_extra', $store, $scan ); echo '
'; } public static function events( array $events, bool $details = false ): void { if ( ! $events ) { echo '
' . wp_kses( self::icon( 'activity' ), self::markupTags() ) . '

' . esc_html__( 'Your story starts here.', 'shieldlume-security' ) . '

' . esc_html__( 'Scan results, settings changes and review decisions will form a clear record here.', 'shieldlume-security' ) . '

'; return; } echo '
    '; foreach ( $events as $event ) { echo '
  1. ' . wp_kses( self::icon( 'activity' ), self::markupTags() ) . '
    ' . esc_html( ucwords( str_replace( '_', ' ', $event['event'] ?? 'Recorded activity' ) ) ) . ''; if ( $details ) { self::evidence( __( 'View recorded evidence', 'shieldlume-security' ), $event['details'] ?? array() ); } echo '
  2. '; } echo '
'; } public static function help(): void { echo '
'; foreach ( array( array( 'setup', __( 'A great first five minutes', 'shieldlume-security' ), __( 'Check your setup, choose your settings and start a scan.', 'shieldlume-security' ), 'setup', __( 'Open setup guide', 'shieldlume-security' ) ), array( 'findings', __( 'Understand a finding', 'shieldlume-security' ), __( 'See what was found, why it matters and what to check next.', 'shieldlume-security' ), 'findings', __( 'Explore your evidence', 'shieldlume-security' ) ), array( 'settings', __( 'Keep control of your data', 'shieldlume-security' ), __( 'Choose optional connections and email alerts. Your local scans work without them.', 'shieldlume-security' ), 'settings', __( 'Review permissions', 'shieldlume-security' ) ), ) as [$icon, $title, $copy, $tab, $label] ) { echo ''; } echo '

' . esc_html__( 'Good to know', 'shieldlume-security' ) . '

'; foreach ( array( __( 'Will a scan change my files?', 'shieldlume-security' ) => __( 'Scanning reads supported files and database records. Optional Pro file restoration is separate: review a specific plan and explicitly approve it. Protected recovery and browser verification must be available before a repair can run.', 'shieldlume-security' ), __( 'Why does a scan need another batch?', 'shieldlume-security' ) => __( 'Work is split into bounded batches to avoid a long-running request. WordPress cron can resume them. On a low-traffic site, use Continue scanning or have your host configure a regular WordPress cron worker.', 'shieldlume-security' ), __( 'Does “no threats detected” mean everything is clean?', 'shieldlume-security' ) => __( 'It applies only to the completed checks. Review excluded paths, unsupported content, unavailable references and scan limitations. A detector result cannot guarantee complete absence of malware.', 'shieldlume-security' ), __( 'Do I need PRO to inspect or repair findings?', 'shieldlume-security' ) => __( 'Free includes local scanning, complete findings, evidence exports, native WordPress editing links and rescanning. Pro adds eligible file restoration, early filtering, investigation, scheduling and optional connected services. Pro repairs require verified references, protected recovery and explicit approval.', 'shieldlume-security' ), ) as $question => $answer ) { echo '
' . esc_html( $question ) . '

' . esc_html( $answer ) . '

'; } echo '

' . esc_html__( 'Read scanner methods, testing & coverage limits', 'shieldlume-security' ) . '

'; echo '

' . esc_html__( 'Guides and reporting channels', 'shieldlume-security' ) . '

' . esc_html__( 'Open online documentation, request help or read private vulnerability-reporting guidance. These links open antivirus.ai in a new tab. No diagnostic file or finding is attached automatically.', 'shieldlume-security' ) . '

    '; foreach ( array( 'https://antivirus.ai/docs/' => __( 'Documentation and manuals (opens in a new tab)', 'shieldlume-security' ), 'https://antivirus.ai/help/' => __( 'Help and product support (opens in a new tab)', 'shieldlume-security' ), 'https://antivirus.ai/security/' => __( 'Private vulnerability-reporting guidance (opens in a new tab)', 'shieldlume-security' ), ) as $url => $label ) { echo '
  • ' . esc_html( $label ) . '
  • '; } echo '

' . esc_html__( 'Review and redact any evidence before choosing to share it. Support does not include managed malware cleanup or a guaranteed response time.', 'shieldlume-security' ) . '

'; } /** Local screenshots of practice tools and a fictional report, never current-site results. */ public static function editions(): void { ProPreviews::cards(); ProPreviews::offer(); echo '

' . esc_html__( 'Optional, separate Pro add-on', 'shieldlume-security' ) . '

' . esc_html__( 'Local analysis works in both editions. The separately installed Pro add-on offers optional AI explanations with an eligible account, your permission and an available provider. New Pro purchases include AI access; installing either plugin does not start a subscription.', 'shieldlume-security' ) . '

'; echo '
' . esc_html__( 'THE LOCAL FOUNDATION', 'shieldlume-security' ) . '

Shieldlume Security FREE

$0 ' . esc_html__( 'No account required', 'shieldlume-security' ) . '

' . esc_html__( 'Choose Free for manual or daily checks, full findings, account protection and native WordPress review.', 'shieldlume-security' ) . '

    '; foreach ( array( __( 'Manual and daily local scans', 'shieldlume-security' ), __( 'Local guidance and optional notifications', 'shieldlume-security' ), __( 'Complete findings and evidence exports', 'shieldlume-security' ), __( 'Native WordPress editing links and rescanning', 'shieldlume-security' ), __( 'Local request and account protection', 'shieldlume-security' ), __( 'Optional integrity and vulnerability checks', 'shieldlume-security' ) ) as $feature ) { echo '
  • ' . wp_kses( self::icon( 'check' ), self::markupTags() ) . esc_html( $feature ) . '
  • '; } echo '
' . esc_html__( 'Open your dashboard', 'shieldlume-security' ) . '
' . esc_html__( 'OPTIONAL, SEPARATE ADD-ON', 'shieldlume-security' ) . '

Shieldlume Security PRO

' . esc_html( Product::priceLabel() ) . '

' . esc_html__( 'Annual subscription', 'shieldlume-security' ) . '

' . esc_html__( 'One production site plus a paired staging site. Applicable tax is additional; renews annually until cancelled. Review the current purchase terms before subscribing.', 'shieldlume-security' ) . '

' . esc_html__( 'Choose Pro when you maintain a busy site or need organized investigations and reports for your work.', 'shieldlume-security' ) . '

    '; foreach ( array( __( 'Everything in FREE', 'shieldlume-security' ), __( 'Verified file restoration and protected recovery', 'shieldlume-security' ), __( 'Optional host-assisted early filtering', 'shieldlume-security' ), __( 'Flexible scan schedules', 'shieldlume-security' ), __( 'Grouped investigations', 'shieldlume-security' ), __( 'Reviewed repair batches, with approval before each repair', 'shieldlume-security' ), __( 'Printable reports, local daily summaries and longer history', 'shieldlume-security' ), __( 'Optional AI explanations through the Pro service, with separate permission', 'shieldlume-security' ) ) as $feature ) { echo '
  • ' . wp_kses( self::icon( 'check' ), self::markupTags() ) . esc_html( $feature ) . '
  • '; } echo '

' . esc_html__( 'Pro needs one successful online licence activation before local tools unlock. Earned local access then continues offline and after subscription expiry; connected services, references, updates and downloads retain their separate requirements.', 'shieldlume-security' ) . '

' . esc_html( ProPreviews::actionLabel() ) . '

' . esc_html__( 'Explore feature details', 'shieldlume-security' ) . '

'; echo '

' . esc_html__( 'Pro access & installation', 'shieldlume-security' ) . '

' . esc_html__( 'Review the Pro offer and subscription terms on antivirus.ai. Pro purchasers download the separate add-on from their authenticated account; existing grant holders use their supplied account access. Free remains available without an account.', 'shieldlume-security' ) . '

  1. ' . esc_html__( 'Back up your site and use a staging installation for evaluation.', 'shieldlume-security' ) . '
  2. ' . esc_html__( 'In WordPress, open Plugins → Add New Plugin → Upload Plugin. Install or update Free first, then the matching Pro package, without uninstalling either edition.', 'shieldlume-security' ) . '
  3. ' . esc_html__( 'Activate both editions, then open Connection and explicitly activate your licence. A matching saved task returns you to its tool; review and save your choices before anything is enabled.', 'shieldlume-security' ) . '

' . esc_html__( 'The public demo uses sample data. It does not scan your site or provide live cloud AI.', 'shieldlume-security' ) . '

' . esc_html__( 'Review Pro features & purchase terms', 'shieldlume-security' ) . '

'; } /** Read-only authenticated polling: no scan creation, advancement or external contact. */ public static function liveStatus(): void { if ( ! current_user_can( 'manage_options' ) ) { wp_send_json_error( array( 'message' => __( 'Administrator access is required.', 'shieldlume-security' ) ), 403 ); return; } // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.MissingUnslash -- The original nonce is read only for type and byte-length guards; sanitize_text_field(wp_unslash()) runs here before the standalone verifier and any requested operation. $nonce = isset( $_REQUEST['nonce'] ) && is_string( $_REQUEST['nonce'] ) && strlen( $_REQUEST['nonce'] ) <= 40 ? sanitize_text_field( wp_unslash( $_REQUEST['nonce'] ) ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Original nonce bytes are used only to reject sanitizer changes; only the bounded sanitized nonce reaches the following standalone verifier. if ( '' === $nonce || strlen( $nonce ) > 20 || $nonce !== wp_unslash( $_REQUEST['nonce'] ) ) { wp_send_json_error( array( 'message' => __( 'Refresh this page and try again.', 'shieldlume-security' ) ), 403 ); return; } if ( ! wp_verify_nonce( $nonce, 'antivirus_ai_status' ) ) { wp_send_json_error( array( 'message' => __( 'Refresh this page and try again.', 'shieldlume-security' ) ), 403 ); return; } nocache_headers(); try { $store = new Store(); $scan = ( new Scanner( $store ) )->latest(); $projection = Diagnostics::scan( $scan ); wp_send_json_success( array( 'scan' => $projection, 'state' => self::state( $scan ), 'id' => $scan['_id'] ?? '', 'outstanding' => $store->count( 'finding', 'open' ) + $store->count( 'finding', 'acknowledged' ) ) ); } catch ( \Throwable $error ) { wp_send_json_error( array( 'message' => __( 'Live progress is temporarily unavailable. Refresh to retry; no clean result can be inferred.', 'shieldlume-security' ) ), 503 ); } } }