From 752dd9112033fff2ea0ebc62db9b7e960143d88b Mon Sep 17 00:00:00 2001 From: Bartosz Gadomski Date: Mon, 6 Jul 2026 10:30:34 +0200 Subject: [PATCH 1/4] Harden live update preference authorization Enforce the view capability and always target the current user in the stream_enable_live_update AJAX handler so a user can only change their own live update preference. Drop the client-supplied user field from the markup and AJAX payload, and add PHPUnit coverage for the authorization behavior. Co-authored-by: Cursor --- classes/class-list-table.php | 3 - classes/class-live-update.php | 18 ++---- src/js/admin.js | 2 - tests/phpunit/test-class-live-update.php | 80 ++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 18 deletions(-) create mode 100644 tests/phpunit/test-class-live-update.php diff --git a/classes/class-list-table.php b/classes/class-list-table.php index d22133775..de41c1e19 100644 --- a/classes/class-list-table.php +++ b/classes/class-list-table.php @@ -1155,9 +1155,6 @@ public function screen_controls( $status, $args ) {
-
- -