PluginProbe
Search Atlas SEO – OTTO AI SEO Automation for WordPress / 2.7.0
Search Atlas SEO – OTTO AI SEO Automation for WordPress v2.7.0
2.7.0 2.6.26 2.6.25 2.6.24 2.6.23 2.6.22 2.6.21 2.6.20 2.6.19 2.6.18 2.6.17 2.6.16 2.6.15 2.6.14 2.6.13 2.6.12 2.6.11 2.6.10 2.6.9 2.6.8 2.6.7 2.6.6 2.6.5 2.6.4 2.6.3 All 139 releases
← All changes | wp-mcp-server/class-mcp-json-rpc-handler.php +17 -1 2.6.212.7.0 View file →
@@ -63,9 +63,9 @@
63 63 /**
64 64 * Handle incoming JSON-RPC request
65 65 *
66 66 * @param string $request_body Raw request body
67 - * @return array Response array
67 + * @return array|null Response array, or null for a notification
68 68 */
69 69 public function handle_request($request_body) {
70 70 // Parse JSON
71 71 $request = json_decode($request_body, true);
@@ -88,8 +88,12 @@
88 88 $id = isset($request['id']) ? $request['id'] : null;
89 89
90 90 // Check if handler exists
91 91 if (!isset($this->handlers[$method])) {
92 + if (!array_key_exists('id', $request)) {
93 + return null;
94 + }
95 +
92 96 return $this->error_response($id, self::ERROR_METHOD_NOT_FOUND, "Method not found: {$method}");
93 97 }
94 98
95 99 try {
@@ -94,14 +98,26 @@
94 98
95 99 try {
96 100 // Call handler
97 101 $result = call_user_func($this->handlers[$method], $params);
102 + if (!array_key_exists('id', $request)) {
103 + return null;
104 + }
105 +
98 106 return $this->success_response($id, $result);
99 107 } catch (InvalidArgumentException $e) {
108 + if (!array_key_exists('id', $request)) {
109 + return null;
110 + }
111 +
100 112 return $this->error_response($id, self::ERROR_INVALID_PARAMS, $e->getMessage());
101 113 } catch (Exception $e) {
102 114 // Log error
103 115 error_log('MCP JSON-RPC Error: ' . $e->getMessage());
116 + if (!array_key_exists('id', $request)) {
117 + return null;
118 + }
119 +
104 120 return $this->error_response($id, self::ERROR_INTERNAL_ERROR, $e->getMessage());
105 121 }
106 122 }
107 123