Skip to content
Back to skills

Woocommerce

ASecurity

WooCommerce extension development (HPOS, Store API, blocks). Use when a project extends WooCommerce

  • 109 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 15, 2026
developmentrustphpsqltestingapisecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add TheBeardedBearSAS/claude-craft --skill woocommerce --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Woocommerce?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Woocommerce
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/thebeardedbearsas-woocommerce/badge)](https://www.skillsdirectory.com/skills/thebeardedbearsas-woocommerce)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "woocommerce"
description: "WooCommerce extension development (HPOS, Store API, blocks). Use when a project extends WooCommerce"
allowed-tools:
  - Read
  - Glob
  - Grep
---

# WooCommerce Extension Development

Optional module of the WordPress stack (WooCommerce 11.2 line, WordPress 7.0+, PHP 7.4+). Load it only when the project depends on WooCommerce. The WordPress core rules (hooks, security, i18n, tests) still apply.

## When to Use

- Plugin header has `Requires Plugins: woocommerce`, or code calls `wc_*` functions, `WC_Order`, `WC_Product`, `WC()`
- Work touches orders, products, customers, cart, checkout, payment gateways, shipping, emails or webhooks
- A `before_woocommerce_init` hook or `FeaturesUtil` call is present or missing

## Key Rules

1. **HPOS first**: orders are not posts. Use `wc_get_order()`, `wc_get_orders()`, `$order->get_meta()` and `$order->update_meta_data()` followed by `$order->save()`. Never `get_post()`, `WP_Query` or `*_post_meta()` on orders
2. **Declare compatibility** on `before_woocommerce_init` with `FeaturesUtil::declare_compatibility()` for `custom_order_tables` and `cart_checkout_blocks`, guarded by `class_exists()`
3. **Use the CRUD layer** (`WC_Data`, `WC_Product`, `WC_Customer`, `WC_Order`) for reads and writes; avoid direct SQL on WooCommerce tables
4. **Blocks-ready checkout**: extend Cart and Checkout through the Store API (`woocommerce_store_api_register_endpoint_data`, `ExtendSchema`) and block integrations (`IntegrationInterface`, slot-fills), not only classic template hooks
5. **Security**: verify payment webhooks (signature plus `hash_equals()`), never trust client-sent prices or totals, check capabilities (`manage_woocommerce`, `edit_shop_order`), escape all order data on output
6. **Dependency guard**: do not run when WooCommerce is inactive; rely on `Requires Plugins` and check `class_exists( 'WooCommerce' )` for load-order safety

## Where to Look

- Detailed APIs, snippets, hooks, Store API, gateways, REST, testing: `REFERENCE.md` (this folder)
- Auditable items for reviews and `/bear-wordpress:check`: `checklist.md` (this folder)
- Core WordPress rules: `.claude/references/wordpress/rules/`

## Workflow

1. Read `REFERENCE.md` sections matching the task (HPOS, CRUD, blocks, gateway, REST, tests)
2. Write the failing test first (`WP_UnitTestCase` with WooCommerce active in `wp-env`)
3. Implement through CRUD and hooks; declare feature compatibility
4. Walk `checklist.md` before commit and report findings separately from the core WordPress score

Files in this skill

  • REFERENCE.md13.6 KB
  • SKILL.md2.6 KB
  • checklist.md5.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.