'Marked verified' ) ); } /** * Handle scan-now AJAX action. * * Runs verification scanner immediately. * * Side effects: Runs scan, returns JSON. * * @return void */ public static function handle_scan_now(): void { // Verify nonce. $nonce = sanitize_text_field( wp_unslash( $_POST['nonce'] ?? '' ) ); if ( ! wp_verify_nonce( $nonce, 'pr_core_scan_now' ) ) { wp_send_json_error( 'Invalid nonce' ); } // Verify capability. if ( ! current_user_can( 'manage_options' ) ) { wp_send_json_error( 'Unauthorized' ); } // Run scan. PR_Core_Verification_Scanner::run_scan(); wp_send_json_success( array( 'message' => 'Scan complete' ) ); } }