From a58a2e7ca4700d3e23341fde767060a4c2c704a3 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 30 Aug 2026 21:04:37 +0000
Subject: [PATCH] =Minor tweaks to MenuBlock.php

---
 inc/rest/RestRouteManager.php |   24 +++++++++++-------------
 1 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/inc/rest/RestRouteManager.php b/inc/rest/RestRouteManager.php
index 34cf72f..b714389 100644
--- a/inc/rest/RestRouteManager.php
+++ b/inc/rest/RestRouteManager.php
@@ -71,10 +71,10 @@
      * @param string $nonceName nonce name to check
      * @param string|null $nonce optional additional nonce to check
      *
-     * @return void|WP_Error
-     */
-    public function verifyNonce(WP_REST_Request $request, string $nonceName = 'wp_rest', string|null $nonce = null):mixed
-    {
+     * @return bool|WP_Error
+	 */
+    public function verifyNonce(WP_REST_Request $request, string $nonceName = 'wp_rest', string|null $nonce = null): bool|WP_Error
+	{
         $nonce = (!is_null($nonce)) ? $nonce :  $request->get_header('X-WP-Nonce');
 
         if (!wp_verify_nonce($nonce, $nonceName)) {
@@ -95,7 +95,7 @@
      *
      * @return bool|WP_Error Whether or not we can proceed
      */
-    public function checkPermission(WP_REST_Request $request):bool
+    public function checkPermission(WP_REST_Request $request):bool|WP_Error
     {
         // Check rate limits first
         if (!$this->rate_limiter->checkLimit($request)) {
@@ -112,7 +112,7 @@
             return false;
         }
         // Verify nonces
-        $this->verifyNonce($request, 'wp_rest');
+        $this->verifyNonce($request);
         if ($this->action!=='') {
             $this->verifyNonce($request, $this->action . $user_id, $request->get_header('action_nonce'));
         }
@@ -564,15 +564,13 @@
 	}
 
 	// ========== HTTP CACHING METHODS ==========
-
 	/**
 	 * Check HTTP caching headers (ETag and If-Modified-Since)
 	 * Returns 304 Not Modified if content hasn't changed
-	 *
-	 * @param WP_REST_Request $request The REST request
-	 * @param string|array $content_types Content type(s) to check timestamps for
-	 * @param array $additional_params Additional params for ETag uniqueness (e.g., user_id, filters)
-	 * @return WP_REST_Response|null Returns 304 response if not modified, null to continue processing
+	 * @param WP_REST_Request $request
+	 * @param int|string|array $key Content type(s) to check timestamps for
+	 * @param string|array $group Additional params for ETag uniqueness (e.g., user_id, filters)
+	 * @return WP_REST_Response|false Returns 304 response if not modified, null to continue processing
 	 */
 	protected function checkHeaders(
 		WP_REST_Request $request,
@@ -925,7 +923,7 @@
 				$context,
 				'info'
 			);
-		} catch (\Exception $e) {
+		} catch (Exception $e) {
 			// Fallback to error_log if handler fails
 			error_log("Security Audit: {$event} - " . json_encode($context));
 		}

--
Gitblit v1.10.0