<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Legacy compatibility shim.
 *
 * The runtime vulnerability route no longer depends on a separate third-party
 * WordPress-only scanner. This shim remains only so older call sites do not fatally error
 * if they are loaded from stale code.
 */
class ASA_Wordfence_Scan {

	public function build_payload( $scan_profile = '' ) {
		$scan_profile = sanitize_key( (string) $scan_profile );
		return array(
			'generated_at_gmt' => gmdate( 'Y-m-d H:i:s' ),
			'results'          => array(
				array(
					'severity' => 'info',
					'category' => 'vulnerability',
					'title'    => __( 'Legacy local component compatibility route executed', 'aegisify-audit-agent' ),
					'details'  => __( 'This legacy compatibility shim no longer performs a separate third-party WordPress-only vulnerability scan. Use the agent vulnerability route for local inventory, dependency audits, and SaaS-side OSV correlation.', 'aegisify-audit-agent' ),
				),
			),
			'findings'         => array(),
			'advisories'       => array(),
			'summary'          => array(
				'status'       => 'compatibility_only',
				'scan_profile' => $scan_profile,
			),
			'privacy'          => array(
				'mode'        => 'metadata_only',
				'description' => 'Local compatibility results exclude customer content, usernames, emails, comments, secrets, tokens, API keys, and database row content.',
			),
		);
	}
}
