From woocommerce-commerce
Creates WooCommerce plugins with file structure, headers, activation/deactivation hooks, custom DB tables via dbDelta, and Composer PSR-4 autoloading. Use for new extensions.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin woocommerce-commerceThis skill is limited to using the following tools:
**Fetch live docs**:
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Fetch live docs:
https://developer.wordpress.org/plugins/ for WordPress Plugin Handbookhttps://developer.woocommerce.com/docs/extension-guidelines/ for WooCommerce extension guidelinessite:developer.woocommerce.com extension development best practices for current patterns<?php
/**
* Plugin Name: My WooCommerce Extension
* Plugin URI: https://example.com/my-extension
* Description: A WooCommerce extension that does X.
* Version: 1.0.0
* Author: Your Name
* Author URI: https://example.com
* License: GPL-2.0-or-later
* Text Domain: my-woo-extension
* Domain Path: /languages
* Requires at least: 6.4
* Requires PHP: 8.0
* Requires Plugins: woocommerce
* WC requires at least: 8.0
* WC tested up to: 9.5
*/
Every PHP file starts with: defined( 'ABSPATH' ) || exit;
Before initializing, verify WooCommerce is active:
class_exists( 'WooCommerce' ) in a plugins_loaded hookRequires Plugins: woocommerce header (WordPress 6.5+)register_activation_hook( __FILE__, 'my_plugin_activate' ) — runs on first activation:
dbDelta())add_option())register_deactivation_hook( __FILE__, 'my_plugin_deactivate' ) — runs when deactivated:
Use uninstall.php (preferred) or register_uninstall_hook():
$wpdb and dbDelta()Create tables on activation:
$wpdb->prefix for table name prefixdbDelta() from wp-admin/includes/upgrade.phpdbDelta() is idempotent — handles CREATE and ALTERConvention: {$wpdb->prefix}wc_my_extension_tablename
Standard approach for namespaced classes:
autoload.psr-4 in composer.jsonrequire __DIR__ . '/vendor/autoload.php' in main plugin fileMyVendor\MyExtension\Legacy approach: require_once individual files in an includes/ directory. Still common in WooCommerce core.
Common WooCommerce extension pattern:
instance() methodinit() method that registers all hooksmy_extension())For larger extensions, use a lightweight DI container or service provider pattern with constructor injection.
Use WooCommerce's FeaturesUtil to declare compatibility:
custom_order_tables — HPOS supportcart_checkout_blocks — Block checkout supportif ( 'value' === $var )if ( $condition )esc_html(), esc_attr(), esc_url(), wp_kses()sanitize_text_field(), absint(), wp_unslash()Requires Plugins: woocommerce header (WordPress 6.5+)__(), _e(), esc_html__()load_plugin_textdomain()wp_remote_get() vs curl)Fetch the WordPress Plugin Handbook and WooCommerce extension guidelines for exact patterns and current requirements before implementing.