From woocommerce-commerce
Implements WooCommerce security: nonces, capabilities, input sanitization, output escaping, validation, PCI compliance, and WordPress best practices. For hardening stores or security posture reviews.
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:
site:developer.wordpress.org plugins security for WordPress security handbooksite:developer.woocommerce.com security best practices for WooCommerce securitywordpress security hardening latest for current hardening guidanceWordPress nonces prevent Cross-Site Request Forgery:
wp_create_nonce( 'my_action' ) or wp_nonce_field( 'my_action', 'my_nonce' ) (for forms)wp_verify_nonce( $_POST['my_nonce'], 'my_action' ) or check_admin_referer( 'my_action', 'my_nonce' )wp_create_nonce( 'my_ajax_action' )wp_localize_script(): ['nonce' => wp_create_nonce('my_ajax_action')]check_ajax_referer( 'my_ajax_action', 'nonce' )X-WP-Nonce header with wp_create_nonce( 'wp_rest' )Always check capabilities before performing actions:
current_user_can( 'manage_woocommerce' ) — WooCommerce admincurrent_user_can( 'edit_shop_orders' ) — order managementcurrent_user_can( 'edit_products' ) — product managementcurrent_user_can( 'view_woocommerce_reports' ) — view reports| Capability | Access |
|---|---|
manage_woocommerce | Full WooCommerce admin |
edit_products | Create/edit products |
edit_shop_orders | Manage orders |
view_woocommerce_reports | View analytics/reports |
edit_shop_coupons | Manage coupons |
Register custom capabilities via add_cap() on role objects during plugin activation.
Always sanitize data before using or storing it:
| Function | Use For |
|---|---|
sanitize_text_field() | Single-line text input |
sanitize_textarea_field() | Multi-line text |
sanitize_email() | Email addresses |
sanitize_url() | URLs |
absint() | Positive integers |
intval() | Integers (any sign) |
floatval() | Float numbers |
wp_kses() | HTML with allowed tags |
wp_kses_post() | HTML safe for post content |
wc_clean() | WooCommerce string/array sanitizer |
wc_sanitize_textarea() | WooCommerce textarea sanitizer |
wc_clean() recursively sanitizes arrays — use for multi-value inputs.
wp_check_filetype()wp_handle_upload() for proper file upload processingAlways escape data on output:
| Function | Context |
|---|---|
esc_html() | Inside HTML tags |
esc_attr() | HTML attribute values |
esc_url() | URLs (href, src) |
esc_js() | Inline JavaScript |
esc_textarea() | Inside textarea elements |
wp_kses() | HTML with specific allowed tags |
wp_kses_post() | HTML safe for post content |
Combine translation with escaping:
esc_html__() / esc_html_e() — escaped translated stringsesc_attr__() / esc_attr_e() — escaped for attributeswp_kses( sprintf(...), $allowed_html ) — formatted HTMLSanitize early (on input), escape late (on output). Never trust any data from users, databases, or external APIs.
is_email(), wp_http_validate_url(), WordPress validatorswc_format_decimal(), wc_is_valid_url()WP_Error or wc_add_notice( $msg, 'error' )Always use $wpdb->prepare() for custom queries:
$wpdb->prepare( "SELECT * FROM {$wpdb->prefix}my_table WHERE id = %d", $id )%d (integer), %s (string), %f (float)Prefer WooCommerce CRUD and WordPress APIs over raw SQL:
wc_get_orders(), wc_get_products() — safe query builders$order->get_meta(), $product->get_price() — safe data accessDISALLOW_FILE_EDIT in wp-config.php.htaccess)rest_authentication_errors filter)add_filter( 'xmlrpc_enabled', '__return_false' )$wpdb->prepare() for any custom SQLFetch the WordPress Security handbook and WooCommerce security documentation for exact function signatures, capability mappings, and current best practices before implementing.