ericrisco/rsc-harness / skills/wordpress
wordpress
VerifiedUse when building or hardening WordPress sites or WooCommerce stores and treating WordPress as the product rather than just writing PHP — block themes with theme.json, plugins with block.json and proper hooks, wp-config security hardening, performance (object cache, asset loading, autoloaded options), and WP-CLI operations. NOT a Laravel app (that is `laravel`).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.6 KB |
| evals/README.md | markdown | 852 B |
| evals/cases.yaml | config | 3.1 KB |
| references/hardening.md | markdown | 3.8 KB |
| references/performance.md | markdown | 3.2 KB |
| references/woocommerce.md | markdown | 2.6 KB |
| scripts/verify.shexecutable | script | 3.3 KB |
references/woocommerce.md
View on GitHub# WooCommerce
The store layer behind the SKILL.md WooCommerce section. WordPress owns the back end; a Shopify store is a different platform (the `shopify` sibling).
## HPOS (High-Performance Order Storage)
Since WooCommerce 8.2, **HPOS is the default order datastore for new installs**. Orders, order items, and metadata move out of `wp_posts`/`wp_postmeta` into dedicated `wc_orders*` tables — fewer joins, faster queries, no autoload bloat.
Three states matter:
1. **Legacy posts storage** — orders in `wp_posts` (old sites).
2. **Compatibility mode** — writes to both stores, keeps them in sync (safe interim during migration).
3. **HPOS authoritative** — custom tables are the source of truth.
## Enable / migrate / verify (WP-CLI)
```bash
# Inspect current state
wp wc cot status
# Turn on custom order tables
wp wc hpos enable
# Backfill existing orders into the new tables (idempotent; re-runnable)
wp wc cot sync
# Verify parity before making HPOS authoritative
wp wc cot verify_cot_data
# Only after a clean verify: flip authority and (optionally) stop syncing legacy
```
Always `wp db export` before migrating a production store. Run `sync` and `verify_cot_data` again after the final plugin updates to catch drift.
## Plugin compatibility declaration
A plugin that reads or writes orders **must** declare HPOS compatibility or WooCommerce will disable it when HPOS is authoritative:
```php
add_action( 'before_woocommerce_init', function () {
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility(
'custom_order_tables', __FILE__, true
);
}
} );
```
Then stop using `WP_Query`/`get_post_meta` for orders. Use the CRUD API — `wc_get_orders()`, `wc_get_order( $id )`, `$order->get_meta()` / `$order->update_meta_data()` / `$order->save()` — which works against whichever datastore is active.
## Store setup checklist
- General: store address, currency, selling/shipping locations.
- Products: product types (simple/variable/grouped), tax classes, stock management.
- Payments: a gateway with a tested webhook path; never store raw card data.
- Checkout: use the **block-based Cart/Checkout blocks** (the modern default) over the classic shortcodes for new stores.
- Tax & shipping zones configured before launch; test a real end-to-end order in staging.
- Emails: verify transactional order emails actually deliver (sender domain, SPF/DKIM).
## Store-specific CLI
```bash
wp wc product list --user=admin
wp wc shop_order list --user=admin # legacy alias still works in compat mode
wp wc tool run regenerate_product_lookup_tables --user=admin
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |