Tovább a tartalomhoz

Példák

Valódi REST-hívások az LW Site Managerrel: állapotfelmérés, bejegyzéslista, frissítések, bővítmények, rendelések, mentés és új bejegyzés.

A válaszok egy tesztoldalról valók. Az író hívásoknál a válasz alakját mutatjuk.

Terminál
curl -u "admin:xxxx xxxx xxxx xxxx xxxx xxxx" "https://pelda.hu/wp-json/wp-abilities/v1/abilities/site-manager/health-check/run"
Válasz (rövidítve)
{
"status": "recommended",
"score": 79,
"issues": [
{ "type": "warning", "message": "3 theme update(s) available", "category": "updates" },
{ "type": "warning", "message": "Site is not using HTTPS", "category": "security" }
],
"php_version": "8.3.28",
"wp_version": "7.1.3",
"memory": { "limit": "128 MB", "usage": "20 MB", "percent": 15.63 }
}

A status lehet good, recommended, should_be_improved vagy critical. A teljes válasz a tárhely-használatot, a szerver gépnevét és a fájlrendszer-útvonalakat is tartalmazza, ezért csak megbízható kliensnek add ki. Az include_debug: true bővebb adatot ad.

Terminál
curl -u "admin:xxxx xxxx xxxx xxxx xxxx xxxx" -G "https://pelda.hu/wp-json/wp-abilities/v1/abilities/site-manager/list-posts/run" \
--data-urlencode "input[limit]=2"
Válasz
{
"posts": [
{ "id": 24, "title": "Őszi kollekció 2026", "slug": "oszi-kollekcio-2026", "status": "publish", "type": "post",
"date": "2026-10-28 18:08:22", "modified": "2026-10-28 18:08:22", "author": 0, "featured_image_id": null },
{ "id": 25, "title": "Ajándékötletek karácsonyra", "slug": "ajandekotletek-karacsonyra", "status": "publish", "type": "post",
"date": "2026-10-28 18:08:22", "modified": "2026-10-28 18:08:22", "author": 0, "featured_image_id": null }
],
"total": 3, "total_pages": 2, "limit": 2, "offset": 0, "has_more": true
}
Terminál
curl -u "admin:xxxx xxxx xxxx xxxx xxxx xxxx" "https://pelda.hu/wp-json/wp-abilities/v1/abilities/site-manager/check-updates/run"
Válasz
{ "core": { "current": "7.1.3", "available": "7.1.3", "has_update": false },
"plugins": [],
"themes": [
{ "slug": "twentytwentyfive", "name": "Twenty Twenty-Five", "current": "1.3", "available": "1.5" },
{ "slug": "twentytwentyfour", "name": "Twenty Twenty-Four", "current": "1.3", "available": "1.6" },
{ "slug": "twentytwentythree", "name": "Twenty Twenty-Three", "current": "1.6", "available": "1.7" } ],
"total_updates": 3 }
Terminál
curl -u "admin:xxxx xxxx xxxx xxxx xxxx xxxx" "https://pelda.hu/wp-json/wp-abilities/v1/abilities/site-manager/list-plugins/run"
Válasz (13 elemből kettő)
{ "plugins": [
{ "slug": "lw-site-manager/lw-site-manager.php", "name": "LW Site Manager", "version": "1.6.0", "author": "LW Plugins",
"description": "Lightweight site manager — full site maintenance via AI/REST using Abilities API.", "active": true },
{ "slug": "woocommerce/woocommerce.php", "name": "WooCommerce", "version": "11.2.1", "author": "Automattic",
"description": "An ecommerce toolkit that helps you sell anything. Beautifully.", "active": true } ],
"total": 13, "active_count": 13, "inactive_count": 0 }

A státuszok címkéi a WooCommerce saját magyar fordításai.

Terminál
curl -u "admin:xxxx xxxx xxxx xxxx xxxx xxxx" "https://pelda.hu/wp-json/wp-abilities/v1/abilities/site-manager/wc-orders-totals/run"
Válasz
{ "success": true,
"totals": [
{ "status": "pending", "label": "Fizetés függőben", "count": 0 },
{ "status": "processing", "label": "Feldolgozás alatt", "count": 0 },
{ "status": "on-hold", "label": "Fizetés folyamatban", "count": 0 },
{ "status": "completed", "label": "Teljesítve", "count": 0 },
{ "status": "cancelled", "label": "Visszamondva", "count": 0 },
{ "status": "refunded", "label": "Visszatérítve", "count": 0 },
{ "status": "failed", "label": "Sikertelen", "count": 0 },
{ "status": "checkout-draft", "label": "Vázlat", "count": 0 } ],
"grand_total": 0 }
Terminál
curl -u "admin:xxxx xxxx xxxx xxxx xxxx xxxx" -X POST -H "Content-Type: application/json" \
-d '{"input":{"title":"Hello","content":"<p>Szia</p>","status":"draft","categories":[5],"tags":["hirek"]}}' \
"https://pelda.hu/wp-json/wp-abilities/v1/abilities/site-manager/create-post/run"
Válasz (alak)
{ "success": true, "message": "Post created successfully", "post": { "…": "…" }, "id": 123 }

Romboló és idempotens, ezért DELETE. Végleges törléshez add hozzá: input[force]=true.

Terminál
curl -u "admin:xxxx xxxx xxxx xxxx xxxx xxxx" -X DELETE -G --data-urlencode "input[id]=123" \
"https://pelda.hu/wp-json/wp-abilities/v1/abilities/site-manager/delete-post/run"

A mentés a háttérben, WP-Cronnal készül. Indítás után az állapotát a backup-status mutatja.

Terminál
curl -u "admin:xxxx xxxx xxxx xxxx xxxx xxxx" -X POST -H "Content-Type: application/json" \
-d '{"input":{"include_database":true,"include_files":true}}' \
"https://pelda.hu/wp-json/wp-abilities/v1/abilities/site-manager/create-backup/run"
Válasz (alak)
{ "success": true, "message": "Backup job started", "backup_id": "2026-10-28_10-00-00_ab12cd34", "status": "pending" }
Terminál
curl -u "admin:xxxx xxxx xxxx xxxx xxxx xxxx" -G \
--data-urlencode "input[backup_id]=2026-10-28_10-00-00_ab12cd34" \
"https://pelda.hu/wp-json/wp-abilities/v1/abilities/site-manager/backup-status/run"

Üres oldalon a list-backups válasza: { "backups": [], "total": 0 }.

Tiszteletben tartjuk a magánszférádat

Sütiket használunk a böngészési élmény javítására és a forgalom elemzésére. Az analitika csak akkor indul, ha engeded. Adatvédelmi irányelvek, Sütitájékoztató.

Sütibeállítások