跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
安全

wp-woocommerce-dev

WooCommerce extension code review for HPOS compatibility, payment gateway security, cart optimization, and template overrides. Use when reviewing WooCommerce extension code, payment gateway development, shipping methods, custom product types, cart operations, checkout customization, or when user mentions "WooCommerce review", "WooCommerce extension", "WooCommerce plugin", "payment gateway", "shipping method", "HPOS", "High-Performance Order Storage", "wc_get_orders", "WC_Payment_Gateway", "WC_Shipping_Method", "cart fragments", "WooCommerce hooks", "WooCommerce template", "shop_order", "WooCommerce performance", "Action Scheduler", "WooCommerce REST API", "WooCommerce Blocks", "checkout block", "woocommerce_checkout". Detects HPOS issues, CRUD violations, payment security anti-patterns, performance problems, and template override mistakes in WooCommerce 8.2+ through 10.x code.

jorgerosal · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add jorgerosal/wordpress-skills --skill wp-woocommerce-dev

技能说明


name: wp-woocommerce-dev description: WooCommerce extension code review for HPOS compatibility, payment gateway security, cart optimization, and template overrides. Use when reviewing WooCommerce extension code, payment gateway development, shipping methods, custom product types, cart operations, checkout customization, or when user mentions "WooCommerce review", "WooCommerce extension", "WooCommerce plugin", "payment gateway", "shipping method", "HPOS", "High-Performance Order Storage", "wc_get_orders", "WC_Payment_Gateway", "WC_Shipping_Method", "cart fragments", "WooCommerce hooks", "WooCommerce template", "shop_order", "WooCommerce performance", "Action Scheduler", "WooCommerce REST API", "WooCommerce Blocks", "checkout block", "woocommerce_checkout". Detects HPOS issues, CRUD violations, payment security anti-patterns, performance problems, and template override mistakes in WooCommerce 8.2+ through 10.x code.

WooCommerce Development Review Skill

Overview

Systematic WooCommerce development review for WooCommerce 8.2+ through current 10.x. Core principle: WooCommerce has undergone a fundamental architectural shift—HPOS (High-Performance Order Storage) is default for new stores since WC 8.2 (October 2023), requiring all extensions to use CRUD APIs exclusively. Direct post access for orders is broken on modern WooCommerce installations.

Extensions must use WC_Data CRUD pattern (wc_get_order(), wc_get_orders(), WC_Order methods), Action Scheduler for background processing, and hooks-over-template-overrides for maintainability. Payment gateways must never store/log raw card data. Cart fragments must be conditionally loaded. Template overrides must preserve all action hooks.

Review validates HPOS compatibility, payment gateway security (code-level only, NOT PCI compliance audit), WooCommerce hook usage, template override quality, and performance patterns. Auto-detects WooCommerce context (extension, theme integration, payment gateway, shipping method, custom product type, WC Blocks integration) and adjusts review guidance. Report findings grouped by file with line numbers, severity labels (CRITICAL/WARNING/INFO), and BAD/GOOD code pairs.

Note: This skill touches all prior skills—security (payment data handling), plugin architecture (WC as extension), blocks (WC Blocks), themes (template overrides), and performance (cart fragments, queries). Cross-references provided throughout.

When to Use

Use when:

  • WooCommerce extension architecture review
  • HPOS compatibility audit (declare_compatibility check, CRUD-only validation)
  • Payment gateway code review (WC_Payment_Gateway patterns, security anti-patterns)
  • Shipping method review (WC_Shipping_Method, calculate_shipping)
  • Custom product type review (WC_Product extension, data stores)
  • WooCommerce hook usage analysis (order lifecycle, product data, cart/checkout)
  • Template override assessment (hooks preservation, version tracking)
  • Cart fragments performance analysis (site-wide loading detection)
  • Action Scheduler pattern review (vs wp_cron anti-patterns)
  • WooCommerce REST API extension review
  • WC Blocks integration check (Store API, Additional Checkout Fields API)
  • Webhook security review (signature verification)

Don't use for:

  • Generic plugin architecture (use wp-plugin-development)
  • Security-only audits (use wp-security-review for comprehensive analysis)
  • Block development outside WC (use wp-block-development)
  • Theme-only review without WC integration (use wp-theme-development)
  • Performance-only review (use wp-performance-review)
  • PCI compliance auditing (out of scope—infrastructure-level)
  • Store setup or hosting configuration (out of scope)

Code Review Workflow

Follow this eight-step workflow for systematic WooCommerce reviews:

1. Detect WooCommerce context from file structure

Extension/plugin:

  • Main plugin file with WC dependency check (WooCommerce in plugin header)
  • HPOS declaration via before_woocommerce_init hook
  • Most common context—full HPOS + CRUD + hook audit

Theme integration:

  • woocommerce/ directory in theme with template overrides
  • Template override focus with hooks-first guidance
  • Cross-reference wp-theme-development for theme patterns

Payment gateway:

  • Class extending WC_Payment_Gateway
  • Heightened security review (never store raw cards, HTTPS check)
  • Webhook verification if applicable

Shipping method:

  • Class extending WC_Shipping_Method
  • calculate_shipping() review, zone support, rate calculation

Custom product type:

  • Class extending WC_Product
  • Data store review, product type registration, class hierarchy

WC Blocks integration:

  • Store API usage, checkout block extension points
  • Additional Checkout Fields API (WC 8.6+)
  • Surface-level review, suggest wp-block-development for deep block patterns

2. Check HPOS compatibility (WOO-16)

CRITICAL if missing:

  • declare_compatibility() call in before_woocommerce_init hook
  • Pattern to find: add_action( 'before_woocommerce_init', ... ) with FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true )

CRITICAL violations:

  • get_posts() or WP_Query with post_type='shop_order'
  • get_post_meta() / update_post_meta() for order data
  • Direct $wpdb queries against wp_posts / wp_postmeta for orders

WARNING violations:

  • WP_Query with post_type='product' (future-breaking—custom product tables planned)

GOOD patterns:

  • wc_get_order( $order_id )
  • wc_get_orders( array( 'status' => 'completed', 'limit' => 10 ) )
  • $order->get_meta( 'key' ), $order->update_meta_data( 'key', $value ), $order->save()

Compatibility mode awareness:

  • Code should work in both HPOS and legacy modes
  • Use CRUD APIs exclusively—they handle both storage modes

3. Check data access patterns (WOO-02, WOO-17)

Product access:

  • GOOD: wc_get_product( $id ), WC_Product_Query
  • WARNING: WP_Query with `post_type='pro
阅读完整来源 ↗