內容簡介
總結:這個外掛新增了一個自訂的 REST API 端點,可以回傳關於目前 WordPress 核心、啟用主題和啟用外掛的版本資訊。適用於遠端 WordPress 站點版本監控、記錄、CI/CD 檢查和自動更新流程。
1. 什麼是這個外掛的 HTTP 方法?
- GET
2. 哪個是這個外掛的 API 端點?
- /wp-json/vercheck-api/v1/status
3. 這個 API 端點需要如何驗證?
- 透過 Bearer token
4. 這個 API 會回傳什麼類型的資料?
- JSON 物件,包含目前的 WordPress 版本、具有可用更新的啟用外掛清單(包括它們目前與最新的版本)、具有可用更新的啟用主題清單(包括它們目前與最新的版本)
5. 提供一個範例回應:
```
{
"core": {
"current_version": "6.4.3",
"new_version": "6.5",
"is_outdated": true
},
"outdated_plugins": [
{
"name": "Example Plugin",
"current_version": "1.2.0",
"new_version": "1.3.0"
}
],
"outdated_themes": []
}
```
6. 額外資訊:每次 API 呼叫的唯一請求 ID 會在回應標頭中返回:
- X-Request-ID: {{unique-request-id}}
外掛標籤
開發者團隊
原文外掛簡介
This plugin adds a custom REST API endpoint that returns information about the current versions of the WordPress core, active themes, and active plugins.
Useful for remote WordPress site version monitoring & logging, CI/CD checks, and automated update workflows.
HTTP method: GET
API endpoint: /wp-json/vercheck-api/v1/status
Important: The endpoint requires authentication via a Bearer token.
The API returns a JSON object with the following data:
– The current WordPress version.
– A list of active plugins with available updates, including their current and latest versions.
– A list of active themes with available updates, including their current and latest versions.
Example response:
{
"core": {
"current_version": "6.4.3",
"new_version": "6.5",
"is_outdated": true
},
"outdated_plugins": [
{
"name": "Example Plugin",
"current_version": "1.2.0",
"new_version": "1.3.0"
}
],
"outdated_themes": []
}
Additional info:
The unique request ID for each API call is returned in the response header:
X-Request-ID: {{unique-request-id}}
