wc-development

Build and debug WooCommerce extension plugins with HPOS-safe APIs and Blocks integration.

Updated Sep 22, 2024
One-click install
npx skills add https://github.com/WordPressBugBounty/plugins-woocommerce-for-japan --skill wc-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wc-development
Source: https://github.com/WordPressBugBounty/plugins-woocommerce-for-japan/tree/main/woocommerce-for-japan/.claude/skills/wc-development
Command: npx skills add https://github.com/WordPressBugBounty/plugins-woocommerce-for-japan --skill wc-development

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires node, fs, path, and includes scripts (resource) and references (resource) components.

What problem does it solve?

WooCommerce extension developers need a reliable, HPOS-safe, Block/Store API-compatible approach for implementing gateways, shipping methods, order logic, product data, REST endpoints, and security without triggering compatibility warnings or breaking checkout flows.

Core Features & Use Cases

  • HPOS-safe order handling: Use WooCommerce order APIs and avoid legacy wp_posts/wp_postmeta access for reads, writes, and queries.
  • Payment & shipping extension building: Implement WC_Payment_Gateway and WC_Shipping_Method behaviors that work in both shortcode and block-based checkout.
  • Blocks/Store API integration: Register Blocks payment methods, extend Store API schemas, and move frontend-selected data into server-side processing.
  • Order lifecycle management: Use WooCommerce status transition hooks and correct payment-complete flows for consistent stock and email behavior.
  • Product and REST customization: Safely extend product meta/types and add REST fields/endpoints with correct authentication and caching considerations.
  • Security guardrails: Apply nonce verification, input sanitization/escaping, and webhook signature verification patterns (PCI-safe tokenization rules).

Quick Start

Use the wc-development skill to validate and implement a WooCommerce gateway that supports HPOS and WooCommerce Blocks/Store API for order payment processing.

Frequently Asked Questions about wc-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make a WooCommerce payment gateway compatible with HPOS and Blocks checkout?

To build a WooCommerce payment gateway compatible with HPOS and Blocks, implement `WC_Payment_Gateway` using HPOS-safe APIs like `wc_get_orders` and register the payment method through Blocks integration hooks and JavaScript for block-based checkout.

What is the correct way to query and update WooCommerce orders safely with HPOS?

The correct way to query and update WooCommerce orders safely with HPOS is using `wc_get_orders` for retrieval and `$order->get_meta`, `update_meta_data`, and `save` for metadata, avoiding legacy `wp_posts` and `wp_postmeta` direct database access.

How do I extend the WooCommerce Store API schema for custom checkout data?

To extend the WooCommerce Store API schema for custom checkout data, use Store API schema extension hooks to register new fields and move frontend-selected data into server-side processing to maintain data integrity and security.

Does my WooCommerce extension need PHP 8.2 to support WooCommerce 10.x features?

Yes, building and debugging WooCommerce 10.x extensions with Block and Store API behavior requires PHP 8.2+ running on WordPress 6.6+ or 7.0+ to ensure full compatibility with HPOS-safe APIs and modern security practices.

How do I verify webhook signatures and ensure security in WooCommerce payment processing?

To verify webhook signatures and ensure security in WooCommerce payment processing, apply strict nonce verification, input sanitization, output escaping, and webhook signature validation patterns following PCI-safe tokenization rules within your extension logic.

What is the best way to add REST endpoints and custom fields to WooCommerce products?

The best way to add REST endpoints and custom fields to WooCommerce products is using the REST API to register fields and endpoints with correct authentication, input sanitization, and caching considerations to safely extend product meta and types.