woocommerce-plugin-development

Build custom WooCommerce plugins using WordPress hooks, Settings API, and REST routes.

14|3|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/tomtoto757/ecomm-ai-skills-hub --skill woocommerce-plugin-development-tomtoto757
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: woocommerce-plugin-development
Source: https://github.com/tomtoto757/ecomm-ai-skills-hub/tree/main/skills/platform-integrations-infrastructure/finsilabs/platform-woocommerce/woocommerce-plugin-development
Command: npx skills add https://github.com/tomtoto757/ecomm-ai-skills-hub --skill woocommerce-plugin-development-tomtoto757

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Extend WooCommerce stores with custom, maintainable plugins that add features without modifying core code and remain compatible with modern WooCommerce storage (HPOS) and lifecycle expectations. The Skill reduces the risk of breaking stores during upgrades by prescribing safe initialization, dependency checks, and HPOS-compatible data access patterns.

Core Features & Use Cases

  • Plugin boilerplate & initialization: safe plugin header, ABSPATH guard, WooCommerce active check, and woocommerce_loaded initialization.
  • HPOS compatibility & CRUD: declare HPOS compatibility and use WooCommerce CRUD methods for reading and writing order meta to support custom order tables.
  • Hooks, Settings & REST: patterns for action/filter usage across order/product lifecycles, Settings API integration for admin configuration, REST route registration with permission callbacks, and custom shipping/payment/email extensions.
  • Use Case: implement a fulfillment integration that triggers on order completion, records a fulfillment token on the order in an HPOS-safe manner, and exposes an admin-only REST analytics endpoint.

Quick Start

Create a plugin file with the provided boilerplate, declare HPOS compatibility before_woocommerce_init, initialize on woocommerce_loaded, and implement order lifecycle handlers that read and write order meta using $order->get_meta(), $order->update_meta_data(), and $order->save().

Frequently Asked Questions about woocommerce-plugin-development

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

FAQPage Schema
How do I build a WooCommerce plugin that is safe for updates and HPOS?

To build an upgrade-safe WooCommerce plugin, use a boilerplate with an ABSPATH guard, WooCommerce active checks, and declare HPOS compatibility before_woocommerce_init. Initialize safely on woocommerce_loaded and use CRUD methods for data access.

How does HPOS compatibility affect WooCommerce order meta read and write operations?

HPOS compatibility requires using WooCommerce CRUD methods like $order->get_meta(), $order->update_meta_data(), and $order->save() for order meta operations. This ensures your custom order tables remain accessible and upgrade-safe with modern WooCommerce storage.

What's the best way to add a custom REST API endpoint to a WooCommerce plugin?

The best way to add a custom REST API endpoint is using register_rest_route with proper permission callbacks. This WooCommerce plugin pattern ensures secure admin-only access while exposing custom analytics or integration endpoints.

Do I need to check if WooCommerce is active before initializing my plugin?

Yes, you need a WooCommerce active check in your plugin boilerplate. This prevents fatal errors if WooCommerce is deactivated, ensuring your plugin only initializes hooks and filters when woocommerce_loaded fires successfully.

Can I use WordPress hooks and filters to extend WooCommerce product and order lifecycles?

Yes, you can use WordPress action and filter hooks to extend WooCommerce product and order lifecycles. This plugin pattern supports custom shipping, payment, discount, and product metadata implementations without modifying core code.

Why should I use the WooCommerce Settings API for my custom plugin configuration?

You should use the WooCommerce Settings API to build admin configuration pages that integrate seamlessly with existing store settings. This ensures maintainable, upgrade-safe plugin options without custom database tables or fragile admin UI code.