wp-plugin-development

Develop WordPress plugin code with secure hooks, settings, and lifecycle handling.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

WordPress plugin development often derails due to fragile lifecycle handling, insecure input handling, misconfigured Settings API pages, and code that loads too early or fails to package correctly for release.

Core Features & Use Cases

  • Architecture and hook wiring: Establishes a predictable plugin structure (bootstrap/loader), minimizes side effects at load time, and guides safe hook registration patterns.
  • Lifecycle correctness: Covers activation/deactivation/uninstall flows, including rewrite flushing and safe uninstall data cleanup practices.
  • Admin settings with guardrails: Uses the Settings API with proper sanitize callbacks and capability/nonce-aware save flows.
  • Security and data safety: Enforces nonce + capability checks, sanitization/escaping rules, and $wpdb->prepare()-based SQL safety.
  • Operational readiness: Supports deterministic triage to locate plugin entrypoints and verification steps to reduce regressions before release packaging.

Quick Start

Use this skill when you are implementing a new WordPress plugin feature that adds admin settings, handles activation/uninstall behavior, and needs secure nonce/capability validation.

Frequently Asked Questions about wp-plugin-development

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

FAQPage Schema
How do I add WordPress admin settings pages using the Settings API securely?

To build secure WordPress admin pages, use the Settings API with proper sanitize callbacks, capability checks, and nonce-aware save flows. This approach validates user input and enforces permission checks before options are saved to the database.

What is the best way to handle WordPress plugin activation and uninstall hooks?

Handling WordPress plugin lifecycle hooks requires registering top-level activation and uninstall hooks to manage setup and safe data cleanup. This ensures deterministic triage of entrypoints and prevents side effects during activation or uninstallation flows.

Why do I need $wpdb->prepare() for SQL queries in WordPress plugin development?

You need $wpdb->prepare() for SQL queries in WordPress plugin development to enforce SQL safety and prevent database injection. It ensures version-aware placeholder usage so that dynamic data inserted into queries is properly escaped before execution.

How do I implement nonce and capability checks in a custom WordPress plugin?

Implementing nonces and capability checks in a WordPress plugin requires verifying user permissions before processing form submissions or administrative actions. You must enforce sanitize and escape discipline alongside capability-checked nonces to block unauthorized access attempts.

Does this WordPress plugin development approach work with WooCommerce extensions?

Yes, this WordPress plugin development approach works with WooCommerce extensions by applying deterministic triage and secure hook registration patterns. It safely guides architecture, settings implementation, and data storage workflows within WooCommerce plugin repositories.

When should I flush rewrite rules during WordPress plugin activation?

You should flush rewrite rules during WordPress plugin activation hooks to register new custom post type URLs or taxonomy endpoints. Flushing on activation prevents 404 errors and ensures permalink structures update safely without causing side effects at load time.