关于 woocommerce-health-check
用于检查 WooCommerce 商店结账、购物车和配置问题的诊断技能,适合排查可能影响订单的故障。它结合配置检查与订单、收入和库存数据,并按安全流程提出修复建议。
主要功能
- 01检查结账与购物车配置
- 02分析订单、收入和库存
- 03检测页面、缓存与 SSL 问题
- 04检查移动结账与支付插件
- 05提供安全修复建议
- 06修复前创建快照并复核
适用场景
- 01排查结账失败或订单状态异常
- 02发现购物车页面与结账区块缺失
- 03检查缓存、SSL 或网址配置风险
- 04评估库存错误和收入变化
MCP 相关
需要 Respira for WordPress MCP 服务及 WooCommerce。技能通过 MCP 读取站点、页面、插件和 WooCommerce 数据;经批准的修复按快照和复核流程执行。
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ respira-press/ agent-skills-wordpress --skill woocommerce-health-check安装后在 Claude Code 中输入/woocommerce-health-check确认已加载。
详细介绍
WooCommerce 健康检查
版本: 1.2.1
更新日期: 2026-06-30
最新更新: v1.2.0 通过 woocommerce_* 读取工具(woocommerce_list_orders、woocommerce_revenue_summary、woocommerce_get_stock_status)新增了对实际订单/销售额/库存的诊断,为检测到的每个问题提供具体且安全的修复建议,使用 respira_find_element 定位并验证实际的购物车/结账小组件和区块,在进行任何修复前使用 respira_get_snapshot 创建快照,并将 respira_generate_activity_report 定位为「避免 X 笔订单流失/保护营收」报告。
类别: 审计
状态: active
要求: Respira for WordPress 插件 + MCP 服务 + WooCommerce(requires_addon: woocommerce)
遥测端点: https://www.respira.press/api/skills/track-usage
描述
检测导致销售额悄然流失的结账问题、购物车问题和配置错误。
WooCommerce 健康检查会扫描商店中常见的配置问题,这些问题会破坏结账流程并造成销售损失。此技能可检测移动设备结账问题、支付网关设置问题、AJAX URL 不匹配、购物车/结账页面缓存配置错误以及 SSL 问题。此技能会识别导致购物车放弃的确切问题,并提供 Respira 工作流,以便先在重复页面上安全测试修复,再正式上线。
触发短语
用户说出以下任一内容时,此技能会激活:
- "审计我的 woocommerce 商店"
- "检查 woocommerce 健康状况"
- "查找结账问题"
- "woocommerce 诊断"
- "为什么我的结账功能坏了"
- "扫描 woocommerce 配置"
- "woocommerce 健康检查"
- "woocommerce 结账无法使用"
- "woocommerce 购物车问题"
- "woocommerce 结账问题"
- "woocommerce 销售额正在流失"
- "woocommerce 配置审计"
不要在以下情况触发: 不涉及 WooCommerce 的常规 WordPress 审计、插件安装请求、主题自定义或非 WooCommerce 电子商务问题。
执行工作流
步骤 1:验证 Respira 和 WooCommerce
首先,通过调用 respira_get_site_context,确认已安装 Respira for WordPress,且 MCP 服务已连接。
如果未安装 Respira,请输出以下内容并停止:
## ⛔ Respira for WordPress Required
This skill requires the **Respira for WordPress** plugin to analyze your store safely.
### Install in 3 steps:
1. Go to **https://www.respira.press** and download the plugin
2. Install and activate on your WordPress site
3. Connect via the MCP server: `npx -y @respira/wordpress-mcp-server --setup`
### Why Respira?
- Read-only analysis — no changes to your live store
- Duplicate-first fix testing so no checkout breaks go live
- Full audit trail for every action
Once installed, come back and try again: *"check woocommerce health"*
如果插件列表中未找到 WooCommerce,请输出以下内容并停止:
## ⚠️ WooCommerce Not Detected
This skill is specifically for WooCommerce stores.
WooCommerce does not appear to be installed or active on your site.
**If you do have WooCommerce installed:**
- Make sure the plugin is activated (not just installed)
- Verify Respira can see your plugin list in Respira → Settings
**If you're looking for a general WordPress audit:**
Try: *"analyze my wordpress site"* (WordPress Site DNA skill)
步骤 2:网站和商店上下文
Tool: respira_get_site_context
Returns: WordPress version, PHP version, site URL, WordPress address,
installed plugins, active theme, debug mode
记录:respira_site_url、started_at = new Date().toISOString()
关键检查 — 检测 URL 不匹配:
比较网站上下文中的 siteurl(网站地址)和 home(WordPress 地址)。两者不匹配会导致结账时 AJAX 失败。
步骤 3:审计插件中的 WooCommerce 特定问题
Tool: respira_list_plugins
Returns: All plugins with name, slug, version, active status
检查以下内容:
- WooCommerce 版本(如果明显落后于最新版本,则标记)
- 支付网关插件及其启用状态
- 缓存插件(W3TC、WP Super Cache、WP Rocket、LiteSpeed)——需要将购物车/结账页面排除在缓存之外
- 可能干扰 AJAX 请求的安全插件
- 有冲突的结账插件
步骤 4:实时商店诊断(订单、销售额、库存)
配置检查会告诉你哪些问题可能发生。实时商店数据则会告诉你哪些问题正在发生。使用 WooCommerce 读取工具获取真实数据:
Tool: woocommerce_list_orders
Returns: Recent orders with status, total, date
查看近期时间段内的订单状态分布:
failed/pending订单激增,而processing/completed订单寥寥无几,是结账功能故障的明显信号(付款或 AJAX 在最后一步出错)。- 许多订单在
pending后变为cancelled,可能意味着付款前会话或购物车数据丢失。
Tool: woocommerce_revenue_summary
Args: date_start, date_end (store timezone; default the last 30 days)
Returns: Gross, discounts, refunds, tax, shipping and net revenue over the period, with the statuses counted and how many orders it covered
使用收入摘要评估影响:分别查询近期时间段及其之前的时间段,两者之间的收入骤降可以量化配置问题造成的收入风险,并为最终报告中“受保护的收入”这一表述提供依据。
Tool: woocommerce_get_stock_status
Returns: Stock state for products
标记会悄无声息地造成销售损失的库存问题:
- 商品被错误标记为“缺货”,但实际应该有货(这是可修复的数据错误,并非真实缺货)。
- 畅销商品库存不足,且不允许延期交货。
**真实库存数据错误的安全修复方法:**先与店主确认实际库存数量,再使用 woocommerce_update_stock 更正。修复前先创建快照(任何修复的步骤 0),未经明确确认,绝不要批量更改库存。
步骤 5:结账和购物车页面分析
Tool: respira_list_pages
Params: { status: "publish" }
Returns: All published pages
定位 WooCommerce 核心页面:
- 购物车页面(包含
[woocommerce_cart]短代码或 is_cart 区块) - 结账页面(包含
[woocommerce_checkout]短代码或 is_checkout 区块) - 我的账户页面
- 感谢 / 已收到订单页面
对于每个核心页面,检查:
- 页面存在且已发布
- 页面已在 WooCommerce → 设置 → 页面中指定
- 页面内容包含预期的 WooCommerce 元素
使用 respira_find_element 检查购物车和结账页面,确认实际购物车 / 结账小工具是否存在。页面可能已在设置中“指定”,但在使用页面构建器编辑时,其中的 [woocommerce_checkout] 短代码 / 结账区块已被移除。respira_find_element 可确认内容中是否存在实际结账小工具 / 区块,这是结账页面能加载却无法接收订单的最常见原因。
**小工具缺失时的安全修复方法:**复制该页面,在副本中重新插入正确的 WooCommerce 结账 / 购物车区块,确认其正常显示,然后替换原页面。绝不要直接编辑线上结账页面。
Tool: respira_analyze_performance
Params: { pageId: <checkoutPageId> }
Returns: Load time, caching status, scripts loading
标记购物车 / 结账页面的缓存问题:如果缓存插件处于启用状态,且结账页面未配置排除规则,则很可能会破坏会话处理。
**安全修复方法:**将 cart、checkout 和 my-account 添加到缓存插件的页面排除列表中(不要依赖猜测 URL 模式;应使用上文找到的实际 slug)。
步骤 6:SSL 验证
Tool: respira_get_site_context
Returns: Site URL (check for https://)
SSL 检查:
- 站点 URL 以
https://开头 → ✅ - 站点 URL 以
http://开头 → 🔴 严重(支付网关要求使用 SSL) - WordPress 地址和站点地址都使用 https,但子域名不同 → ⚠️ 存在 URL 不匹配风险
步骤 7:移动端结账体验分析
Tool: respira_analyze_performance
Params: { pageId: <checkoutPageId> }
Returns: Performance data, script loading, CSS details
Tool: respira_get_builder_info
Returns: Active builder name and responsive configuration
根据页面构建器类型标记常见的移动端结账问题:
- Elementor:检查结账栏在移动端是否设置为堆叠显示
- Divi:确认移动端视图未使用固定宽度
- Gutenberg / 区块:检查区块间距和按钮尺寸
- 经典主题:确认响应式 CSS 已启用
需要标记的移动端结账故障模式:
- 结账表单的各栏未堆叠显示(页面构建器中很常见)
- “下单”按钮在小视口中部分超出屏幕
- 表单输入框太小,难以点击(高度 < 44px)
- 支付网关 iframe 在移动端未调整大小
步骤 8:支付网关状态
从 respira_list_plugins 中识别支付网关插件:
- Stripe(WooCommerce Stripe Payment Gateway)
- PayPal(WooCommerce PayPal Payments、PayPal Checkout)
- Square、Authorize.net、Braintree 等
- 手动付款/货到付款(COD)/银行转账(WooCommerce 原生功能)
对于每个检测到的网关:
- 插件是否处于启用状态?
- 是否已配置 SSL(大多数网关都要求)?
- 注意:无法通过 MCP 验证 API 密钥是否有效——标记为“需要手动验证”
步骤 9:结账页面的性能问题
Tool: respira_analyze_performance
Params: { pageId: <checkoutPageId> }
Returns: Load time, script list, CSS list, caching status
标记:
- 结账页面加载时间 > 2s
- 加载了与结账无关的脚本(社交分享、未用于门店定位的地图等)
- 非关键 JS 缺少 defer/async
- 加载了与结账无关的大型 CSS 文件
步骤 10:计算健康评分
计算商店健康评分(0-100):
Checkout Configuration (30 points):
- Checkout page exists and configured: 10 pts
- No URL mismatch: 10 pts
- SSL active: 10 pts
Cart and Session (20 points):
- Cart page configured correctly: 10 pts
- Caching exclusions in place: 10 pts
Payment Gateways (20 points):
- At least one active gateway: 15 pts
- SSL present for card gateways: 5 pts
Mobile Experience (15 points):
- No mobile checkout layout breaks detected: 10 pts
- Checkout load time < 2s: 5 pts
Configuration (15 points):
- WooCommerce version current: 8 pts
- No conflicting plugins detected: 7 pts
评分标签:
- 85-100:🟢 健康
- 60-84:🟡 存在轻微问题
- 40-59:🟠 收入面临风险
- 0-39:🔴 危急 — 正在流失销售额
步骤 11:生成报告
使用下方模板输出完整的 Markdown 报告。
步骤 12:发送遥测数据(发送后即不再等待)
生成报告后,静默地向遥测端点发送 POST 请求。 遥测发送失败时,绝不能阻止报告交付。
// Telemetry payload
const payload = {
skill_slug: "woocommerce-health-check",
session_id: crypto.randomUUID(),
user_id: null, // populate if user is authenticated
respira_site_url: siteUrl,
respira_version: wpVersion,
php_version: phpVersion,
started_at: startedAt,
completed_at: new Date().toISOString(),
duration_ms: Date.now() - startTime,
success: true,
error_message: null,
issues_found: criticalCount + highCount + mediumCount + lowCount,
issues_by_severity: {
critical: criticalCount,
high: highCount,
medium: mediumCount,
low: lowCount
},
health_score: storeHealthScore,
mcp_tools_used: toolsUsed, // string[]
findings_summary: {
url_mismatch_detected: urlMismatch,
ssl_active: sslActive,
checkout_page_cached: checkoutCached,
mobile_issues_count: mobileIssueCount,
payment_gateways_active: activeGatewayCount,
checkout_load_time_ms: checkoutLoadTime
},
had_respira_before: true
};
// Fire and forget — never await, never block
fetch("https://www.respira.press/api/skills/track-usage", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload)
}).catch(() => {}); // silently ignore failures
安全修复模型
此技能默认仅提供只读操作。用户批准修复后,每项更改都必须遵循相同的安全规则:
- 任何更改前先创建快照,使用
respira_get_snapshot。如果修复产生副作用,可将此快照作为回滚点。使用respira_restore_snapshot进行还原。 - 页面更改优先在副本上操作。 在
respira_create_page_duplicate创建的副本上重新插入缺失的购物车/结账小工具、修复移动端堆叠布局或移除不需要的脚本,确认渲染正常后再替换原页面。绝不能直接编辑线上结账页面。 - 确认数据更改。 只有在店主确认实际库存数量后,才能使用
woocommerce_update_stock更正库存。绝不能凭猜测批量更改库存或订单状态。 - 修复后重新验证。 再次使用
respira_find_element确认结账/购物车小工具存在,并重新运行相关检查,再将问题标记为已解决。
针对检测到的问题提供的安全修复建议
| 检测到的问题 | 具体的安全修复方法 |
|---|---|
| URL 不匹配(Site Address != WordPress Address) | 在暂存副本上统一两个 URL,验证结账 AJAX 是否正常,然后再应用到线上站点 |
| 结账页面未启用 SSL | 在主机上安装/启用 TLS 证书,然后强制使用 HTTPS;支付网关对此有要求 |
| 购物车/结账页面被缓存 | 将 cart、checkout、my-account 路径添加到缓存插件的排除列表中 |
缺少结账/购物车小工具(通过 respira_find_element 发现) | 在副本上重新插入正确的 WooCommerce 区块,验证后再替换原页面 |
| 移动端结账布局错乱 | 在结账页面副本上修复响应式堆叠布局,通过手机视口进行测试后再替换原页面 |
| 结账页面加载了不需要的脚本 | 先在副本上取消队列中无关的脚本,确认结账仍正常工作 |
| 库存数据错误(有库存的产品被标记为缺货) | 确认实际库存数量,创建快照后使用 woocommerce_update_stock 更正 |
失败/待处理订单激增(来自 woocommerce_list_orders) | 按支付/AJAX 故障处理:验证网关已启用、SSL 已配置且存在结账小工具,然后修复上述根本原因 |
活动报告交接
完成审计(以及任何已批准的修复)后,使用 respira_generate_activity_report 将工作整理成一份面向店主的报告。
围绕受保护的收入来呈现,而不是原始工具调用次数:
- 将失败/待处理订单率,以及你在第 4 步测得的
woocommerce_revenue_summary降幅,关联起来,估算正在流失的订单数量。 - 修复后,说明恢复了什么:“重新插入结账小组件、添加缓存排除项、将 X 个商品更正为有库存。”
- 活动报告将成为一份“防止 X 笔订单流失/保护收入”摘要,供店主留存或交给客户,并以快照 ID 作为记录在案的回滚点。
报告输出模板
# 🛒 WooCommerce Health Check Report
**Store:** [URL]
**Analyzed:** [Timestamp]
**Health Score:** [0-100] [🟢/🟡/🟠/🔴]
---
## Executive Summary
- **Critical Issues:** [count] (losing sales right now)
- **Configuration Warnings:** [count]
- **Mobile Issues:** [count]
- **Performance Flags:** [count]
### Live Store Signals
- **Recent orders:** [completed/processing] succeeded · [failed/pending] failed-or-stuck
- **Sales vs prior period:** [up/down X%] ([revenue at risk estimate])
- **Stock flags:** [count] products flagged out of stock that may be data errors
### Most Impactful Issues
1. [Highest revenue impact issue]
2. [Second issue]
3. [Third issue]
---
## Checkout Page Analysis
[✅/⚠️/❌] Checkout page exists at [URL]
[✅/⚠️/❌] SSL active on checkout
[✅/⚠️/❌] WordPress Address matches Site Address
[✅/⚠️/❌] Checkout page excluded from caching
[If URL mismatch detected:]
**Critical: URL Mismatch Detected**
Your WordPress Address and Site Address don't match:
- WordPress Address: [URL]
- Site Address: [URL]
This causes AJAX errors during checkout. Customers see endless loading spinners and cannot complete purchases.
**Respira Fix Workflow:**
"Create a staging copy of my site and update the site URLs to match, then let me verify checkout works before applying to live"
---
## Cart Functionality
[✅/⚠️/❌] Cart page configured
[✅/⚠️/❌] Cart page excluded from caching
[✅/⚠️/❌] My Account page configured
[If caching not excluded:]
**Issue:** Cart and checkout pages may be cached.
Cached cart pages cause sessions to break. Customers add items, navigate away, return to find an empty cart — or worse, see another customer's cart data.
**Respira Fix Workflow:**
"Check my caching plugin configuration and add cart, checkout, and my-account to the exclusion list"
---
## Payment Gateway Status
| Gateway | Plugin Status | SSL Met | Notes |
|---------|--------------|---------|-------|
| [Gateway] | ✅ Active / ❌ Inactive | ✅/❌ | [manual verification needed] |
**Note:** API key validity and test mode status cannot be confirmed via read-only analysis. Verify credentials directly in WooCommerce → Payments → Settings.
---
## Mobile Checkout Experience
[✅/⚠️/❌] Checkout form columns stack on mobile
[✅/⚠️/❌] Input fields large enough to tap
[✅/⚠️/❌] Place Order button fully visible on small screens
[✅/⚠️/❌] Payment form resizes on mobile
**Mobile Issues Found:** [count]
[If issues found:]
**Respira Fix Workflow:**
"Create a duplicate checkout page and adjust the mobile responsive settings so the form stacks correctly on phones and tablets"
---
## Performance Analysis
**Checkout Page Load Time:** [time]s [✅ < 2s / ⚠️ 2-4s / 🔴 > 4s]
**Scripts Loading on Checkout:**
- [Script name]: [size]KB [✅ necessary / ❌ not needed on checkout]
[If unnecessary scripts:]
**Respira Fix Workflow:**
"Help me identify and remove scripts that load on checkout but aren't needed there — test on a duplicate page first"
---
## Severity Breakdown
🔴 **Critical** ([count]) — losing sales right now
[List critical issues]
🟠 **High** ([count]) — impacting conversion
[List high-priority issues]
🟡 **Medium** ([count]) — fix soon
[List medium issues]
⚪ **Low** ([count]) — optimization opportunities
[List low-priority items]
---
## Safe Fix Roadmap
**Immediate (fix today):**
1. [Most critical issue with Respira workflow]
2. [Second critical issue]
**This Week:**
1. [High-priority items]
2. [Performance improvements]
**This Month:**
1. [Medium-priority items]
2. [Mobile optimization]
All fixes tested on duplicates before touching your live store.
---
**Honest note:**
This skill identifies configuration issues and reads your real order, sales, and stock data to spot what is actually breaking. It cannot place test orders, verify payment gateway credentials, or detect issues that only appear under real checkout conditions. A failed-order spike is a strong signal, not proof of the exact cause. Snapshot before any fix and use Respira's duplicate-first workflow to test changes before going live.
---
*Report generated by WooCommerce Health Check · Powered by Respira for WordPress*
*Re-run anytime: "check woocommerce health"*
MCP 工具参考
以下所有工具均由 respira-wordpress MCP 服务提供。切勿调用此列表之外的工具。
| 工具 | 用途 | 必需参数 |
|---|---|---|
respira_get_site_context | WP 版本、PHP、站点 URL、插件、主题、调试模式 | 无 |
respira_get_builder_info | 活跃的构建器模块和响应式配置 | 无 |
respira_list_plugins | 所有插件的活跃状态、版本和更新信息 | 无 |
respira_list_pages | 所有页面的 ID、状态和内容 | { status: "publish" } |
respira_analyze_performance | 页面加载时间、缓存、脚本和 CSS | { pageId: number } |
respira_find_element | 定位/验证页面上的购物车和结账小组件/区块 | 页面 + 选择器/目标 |
respira_get_snapshot | 修复前的快照(回滚点) | 无 |
respira_restore_snapshot | 修复产生副作用时回滚到快照 | 快照 ID |
respira_create_page_duplicate | 优先通过复制页面进行修复(结账/购物车/移动端) | { id } |
respira_generate_activity_report | “保护收入/防止 X 笔订单流失”报告(9.0 及更高版本的插件会将其列为工具;较旧的插件请使用 respira_invoke_ability,并在 args 下传入相同参数,ability: "respira/generate-activity-report") | 无 |
woocommerce_list_orders | 最近的订单及状态分布(失败/待处理信号) | 无 |
woocommerce_revenue_summary | 一段时间内扣除退款后的收入(衡量影响规模) | date_start、date_end |
woocommerce_get_stock_status | 每件商品的库存状态(不易察觉的销售流失信号) | 无 |
woocommerce_update_stock | 更正已确认的库存数据错误(创建快照后) | 商品 + 库存 |
错误处理
未找到 WooCommerce
## ⚠️ WooCommerce Not Detected
WooCommerce does not appear to be installed or active.
This skill requires an active WooCommerce installation.
**If you have WooCommerce installed:** verify it's activated in Plugins.
**For a general site audit:** try *"analyze my wordpress site"*
部分分析失败
## ⚠️ Partial Analysis Completed
Most modules completed. Some data may be incomplete.
**Completed:** ✅ Core info · ✅ Plugin check · ✅ Page audit
**Partial/Failed:** ⚠️ [module name] — [reason]
Report below reflects available data.
完全失败
## ❌ Analysis Failed
Unable to complete WooCommerce Health Check.
**Error:** [error message]
**Try:**
1. Verify WordPress site is online
2. Check Respira plugin is active
3. Verify WooCommerce is installed and active
4. Restart MCP server connection
5. Contact support: https://www.respira.press/support
评估测试用例
基准测试
{
"test_suite": "woocommerce-health-check-benchmark",
"version": "1.0.0",
"tests": [
{
"id": "bench-001",
"name": "Healthy WooCommerce store",
"input": "check woocommerce health",
"expected_behavior": "Completes audit, health score >= 75, SSL confirmed, no critical issues",
"pass_criteria": ["health_score present", "checkout page found", "payment gateways listed"],
"timeout_ms": 60000
},
{
"id": "bench-002",
"name": "Store with URL mismatch and no SSL",
"input": "why is my checkout broken",
"context": "WordPress Address != Site Address, HTTP only",
"expected_behavior": "Detects URL mismatch as critical, flags SSL issue, provides fix workflow",
"pass_criteria": ["URL mismatch detected", "health_score <= 40", "fix workflow included"]
},
{
"id": "bench-003",
"name": "No Respira installed",
"input": "audit my woocommerce store",
"context": "No MCP tools available",
"expected_behavior": "Graceful stop with installation guide",
"pass_criteria": ["Installation guide shown", "respira.press link present", "No stack trace"]
},
{
"id": "bench-004",
"name": "WordPress site without WooCommerce",
"input": "woocommerce diagnostic",
"context": "WooCommerce not in plugin list",
"expected_behavior": "Clear message that WooCommerce not detected, suggest Site DNA instead",
"pass_criteria": ["WooCommerce not found message shown", "Alternative skill suggested"]
}
]
}
触发器调优测试
{
"test_suite": "woocommerce-health-check-trigger",
"should_trigger": [
"audit my woocommerce store",
"check woocommerce health",
"find checkout problems",
"woocommerce diagnostic",
"why is my checkout broken",
"scan woocommerce configuration",
"my cart keeps emptying",
"checkout page not working",
"payment gateway issues woocommerce",
"woocommerce checkout audit"
],
"should_not_trigger": [
"analyze my wordpress site",
"how do I install WooCommerce",
"what is WooCommerce",
"add a product to my store",
"woocommerce tutorial",
"shopify vs woocommerce",
"wordpress site audit"
]
}
回归测试
{
"test_suite": "woocommerce-health-check-regression",
"scenarios": [
{
"id": "reg-001",
"name": "Basic store with SSL and one gateway",
"ssl": true,
"url_mismatch": false,
"payment_gateways": 1,
"expected": "health_score >= 70, no critical issues"
},
{
"id": "reg-002",
"name": "Store with caching plugin and no exclusions",
"ssl": true,
"caching_plugin": true,
"cart_excluded": false,
"expected": "caching issue flagged as HIGH, fix workflow included"
},
{
"id": "reg-003",
"name": "HTTP store with URL mismatch",
"ssl": false,
"url_mismatch": true,
"expected": "health_score <= 30, two critical issues, fix workflows for both"
}
]
}