| name | woocommerce-upgrade-safety |
| description | Pre-release upgrade safety review for WooCommerce plugins. Validates database migrations, settings compatibility, payment token preservation, hook deprecation, rollback safety, and merchant communication for version upgrades. Use before any minor or major version release, when a release includes database schema changes, settings restructuring, new feature declarations (HPOS, blocks), deprecated hooks/filters, or payment flow changes. Also trigger when reviewing a diff that shows install class changes, dbDelta calls, payment token modifications, hook removals, or minimum version bumps. Skip for patch releases that contain only bug fixes with no structural changes.
|
WooCommerce Plugin Upgrade Safety Review
You are performing an upgrade safety review for a WooCommerce plugin that is about
to ship a new version to existing merchants. This skill is concerned exclusively
with what happens to existing installations during and after the upgrade -- not
with the quality of the new code itself (that is covered by code review skills).
Foundation References
Read these before starting -- they define the patterns you are auditing against:
references/woocommerce-apis.md -- HPOS, CRUD, data stores, Payment Token API,
feature compatibility declarations
references/security.md -- Database patterns, Options API, prepared statements
references/plugin-architecture.md -- Plugin lifecycle hooks, activation/deactivation
When to Use
- Before any minor version (1.x -> 1.y) or major version (1.x -> 2.0) release
- When a release includes database schema changes, settings restructuring,
new feature declarations (HPOS, blocks), or deprecated hooks/filters
- When a release changes the payment flow (new tokenization method, new API
version, hosted fields migration)
- Skip for patch releases (1.0.x -> 1.0.y) that contain only bug fixes with no
structural changes
How to Detect When This Skill Is Needed
Scan the diff between the old and new version for these high-risk patterns:
| Pattern | Why It's Risky |
|---|
Changes to *-install.php, *-activator.php, *Install* classes | Database migration code changed |
New/modified dbDelta() calls or $wpdb->query("ALTER TABLE") | Schema migration |
Changes to WC_Payment_Token* classes or wc_payment_token meta | Payment token schema |
Removed add_action/add_filter calls | Hook removal |
Changes to process_payment(), process_refund() | Core payment flow |
New/changed delete_option() calls | Settings migration |
Changed Requires at least, WC requires at least, Requires PHP headers | Minimum version bump |
If any of these patterns appear, run this skill.
Step 0: Establish Upgrade Context
- Identify the current released version (what merchants have today)
- Identify the target version (what is about to ship)
- Produce a diff summary:
- Files added, modified, deleted
- Database schema changes (new tables, altered columns, new meta keys)
- Settings fields added, removed, or renamed
- Hooks/filters added, removed, or signature-changed
- Payment Token schema changes
- Minimum version requirements changed (PHP, WP, WC)
If both versions are in git:
git diff v<old>..v<new> --stat
git diff v<old>..v<new> -- src/Data/ includes/class-*-install.php
Step 1: Database Migration Safety
1.1 Schema Migrations
Severity:
| Issue | Level |
|---|
| Data loss (DROP without migration) | Critical |
| Non-idempotent migration | High |
| Missing version gate (runs on every load) | High |
| No schema version tracking | Medium |
1.2 Data Migrations
1.3 Options / Settings Migrations
Step 2: Payment Continuity
This section applies only to payment gateway plugins. Skip for non-payment plugins.
2.1 Saved Payment Tokens
Severity: Any token loss or breakage is Critical -- merchants' customers lose
saved payment methods, increasing checkout friction and abandoned carts.
2.2 Active Subscriptions
2.3 Pending Transactions
Step 3: Hook and Filter Compatibility
3.1 Removed or Renamed Hooks
3.2 Changed Signatures
3.3 New Feature Declarations
Step 4: Rollback Safety
4.1 Downgrade Resilience
4.2 WordPress Auto-Update Safety
Step 5: Changelog and Merchant Communication
5.1 Changelog Quality
5.2 Upgrade Notice
5.3 Version Metadata
Step 6: Synthesize Upgrade Safety Report
Deliverable: upgrade-safety-report.md
# Upgrade Safety Report
## Plugin: [name] v[current] -> v[target]
## Date: [date]
### Upgrade Risk Level: [LOW / MEDIUM / HIGH / CRITICAL]
| Risk Level | Definition |
|------------|------------|
| LOW | No schema changes, no breaking changes, patch-level fixes |
| MEDIUM | New settings or meta keys, new feature declarations, minor hook changes |
| HIGH | Database schema changes, payment flow changes, deprecated hooks |
| CRITICAL | Data migration required, payment token schema change, minimum version bump |
Note: Major version bumps (X.0.0) start at HIGH minimum regardless of content.
### Database Migrations
| Migration | Idempotent | Batched | Reversible | Status |
|-----------|-----------|---------|------------|--------|
| [description] | Yes/No | Yes/No | Yes/No | PASS/FAIL |
### Payment Continuity
| Check | Status | Notes |
|-------|--------|-------|
| Saved tokens preserved | PASS/FAIL/N/A | [details] |
| Active subscriptions safe | PASS/FAIL/N/A | [details] |
| Pending transactions safe | PASS/FAIL/N/A | [details] |
| Webhook backward compat | PASS/FAIL/N/A | [details] |
### Hook Compatibility
| Hook/Filter | Change | Deprecated? | Replacement | Status |
|-------------|--------|-------------|-------------|--------|
| [hook name] | Removed/Renamed/Signature | Yes/No | [replacement] | PASS/FAIL |
### Rollback Assessment
- Downgrade safe: [Yes / No / Partial]
- Auto-update safe: [Yes / No -- requires manual steps]
- Manual steps required: [list, or "None"]
### Changelog Review
- Breaking changes documented: [Yes / No / N/A]
- Upgrade notice present: [Yes / No]
- Version metadata current: [Yes / No]
### Prioritized Upgrade Issues
## Critical
### UPG-001: [Brief description]
- **Category:** [Database / Payment / Hooks / Rollback / Changelog]
- **File:** [path]
- **Lines:** [N-M]
- **Issue:** [What is wrong]
- **Merchant Impact:** [What breaks for existing merchants]
- **Fix:** [What to change, with before/after code]
- **Status:** [ ] Not started
## High
[...]
## Medium
[...]
Step 7: Save and Present
- Save the report
- Present a one-paragraph risk summary
- If Critical or High issues exist: recommend blocking the release until resolved
- If the upgrade risk level is HIGH or CRITICAL: recommend the partner include a
"backup before upgrading" notice in the release
Important Notes
- This skill does NOT evaluate code quality, security, or UX -- those are handled by
other review skills
- Focus exclusively on the delta between versions, not absolute quality
- Payment token preservation is the highest-stakes item -- verify thoroughly
- Database migrations that work on 10 test orders may fail on 10,000 production
orders due to memory/timeout -- always check for batching
- WordPress auto-updates mean merchants may upgrade without reading the changelog --
surface breaking changes via admin notices, not just documentation