requireAdminWithNonce(self::NONCE_ACTION); $confirm = $_POST['confirm'] ?? null; if (!is_scalar($confirm) || (string)$confirm !== '1') { wp_send_json_error(array( 'message' => __('Confirm diagnostic data deletion before continuing.', '404-solution'), ), 400); return; // @phpstan-ignore deadCode.unreachable } $token = ABJ_404_Solution_FeedbackSiteTokenStore::storedToken(); if ($token === '') { wp_send_json_error(array( 'message' => __('Diagnostic identity is not registered yet.', '404-solution'), ), 409); return; // @phpstan-ignore deadCode.unreachable } $result = ABJ_404_Solution_FeedbackDsrClient::deleteRows($token, true); if (empty($result['ok'])) { wp_send_json_error(array('message' => $result['message']), (int)$result['status']); return; // @phpstan-ignore deadCode.unreachable } wp_send_json_success($result['data']); } }