$message]); exit(); } /** * */ public function updateNotificationsStatus() { check_ajax_referer('wp_rest', 'wps_nonce'); $hasUpdatedNotifications = NotificationProcessor::updateNotificationsStatus(); if ($hasUpdatedNotifications) { $message = __('Notifications status has been updated.', 'wp-statistics'); } else { $message = __('Notifications status has not been updated.', 'wp-statistics'); } wp_send_json_success(['message' => $message]); exit(); } }