installPlugin($plugin_uri, $plugin_version, $install_path); echo json_encode($return); } catch (Exception $e) { http_response_code(422); // unprocessable content echo json_encode(['error' => $e->getMessage()]); } } else { http_response_code(400); // Bad Request echo json_encode(['error' => 'Plugin URI, version, and install path are required']); exit; }