wp-plugin-development

작성자: wordpress

WordPress 플러그인 개발의 전체 워크플로우를 아키텍처부터 보안 및 릴리스 패키징까지 다룹니다. 플러그인 구조, 훅/액션/필터, 활성화/비활성화/제거 생애주기, 관리자 UI 및 옵션 관리를 위한 Settings API를 포함합니다. 필수 보안 기준인 입력 검증/정화, nonce, 권한 확인, $wpdb->prepare()를 통한 매개변수화된 SQL 쿼리를 포함합니다. 데이터 저장 패턴, 멱등성을 고려한 크론 작업 설정, 스키마 마이그레이션 등을 지원합니다.

npx skills add https://github.com/wordpress/agent-skills --skill wp-plugin-development

WP Plugin Development

When to use

Use this skill for plugin work such as:

  • creating or refactoring plugin structure (bootstrap, includes, namespaces/classes)
  • adding hooks/actions/filters
  • activation/deactivation/uninstall behavior and migrations
  • adding settings pages / options / admin UI (Settings API)
  • security fixes (nonces, capabilities, sanitization/escaping, SQL safety)
  • packaging a release (build artifacts, readme, assets)

Inputs required

  • Repo root + target plugin(s) (path to plugin main file if known).
  • Where this plugin runs: single site vs multisite; WP.com conventions if applicable.
  • Target WordPress + PHP versions (affects available APIs and placeholder support in $wpdb->prepare()).

Procedure

0) Triage and locate plugin entrypoints

  1. Run triage:
    • node skills/wp-project-triage/scripts/detect_wp_project.mjs
  2. Detect plugin headers (deterministic scan):
    • node skills/wp-plugin-development/scripts/detect_plugins.mjs

If this is a full site repo, pick the specific plugin under wp-content/plugins/ or mu-plugins/ before changing code.

1) Follow a predictable architecture

Guidelines:

  • Keep a single bootstrap (main plugin file with header).
  • Avoid heavy side effects at file load time; load on hooks.
  • Prefer a dedicated loader/class to register hooks.
  • Keep admin-only code behind is_admin() (or admin hooks) to reduce frontend overhead.

See:

  • references/structure.md

2) Hooks and lifecycle (activation/deactivation/uninstall)

Activation hooks are fragile; follow guardrails:

  • register activation/deactivation hooks at top-level, not inside other hooks
  • flush rewrite rules only when needed and only after registering CPTs/rules
  • uninstall should be explicit and safe (uninstall.php or register_uninstall_hook)

See:

  • references/lifecycle.md

3) Settings and admin UI (Settings API)

Prefer Settings API for options:

  • register_setting(), add_settings_section(), add_settings_field()
  • sanitize via sanitize_callback

See:

  • references/settings-api.md

4) Security baseline (always)

Before shipping:

  • Validate/sanitize input early; escape output late.
  • Use nonces to prevent CSRF and capability checks for authorization.
  • Avoid directly trusting $_POST / $_GET; use wp_unslash() and specific keys.
  • Use $wpdb->prepare() for SQL; avoid building SQL with string concatenation.

See:

  • references/security.md

5) Data storage, cron, migrations (if needed)

  • Prefer options for small config; custom tables only if necessary.
  • For cron tasks, ensure idempotency and provide manual run paths (WP-CLI or admin).
  • For schema changes, write upgrade routines and store schema version.

See:

  • references/data-and-cron.md

Verification

  • Plugin activates with no fatals/notices.
  • Settings save and read correctly (capability + nonce enforced).
  • Uninstall removes intended data (and nothing else).
  • Run repo lint/tests (PHPUnit/PHPCS if present) and any JS build steps if the plugin ships assets.

Failure modes / debugging

  • Activation hook not firing:
    • hook registered incorrectly (not in main file scope), wrong main file path, or plugin is network-activated
  • Settings not saving:
    • settings not registered, wrong option group, missing capability, nonce failure
  • Security regressions:
    • nonce present but missing capability checks; or sanitized input not escaped on output

See:

  • references/debugging.md

Escalation

For canonical detail, consult the Plugin Handbook and security guidelines before inventing patterns.

wordpress의 다른 스킬

blueprint
wordpress
WordPress Playground blueprint JSON 파일을 생성, 편집 또는 검토할 때 사용합니다. blueprint, Playground 구성 또는 요청에 대한 언급 시 트리거됩니다.
official
wordpress-router
wordpress
We need to translate the given text from English to Korean. The text describes a skill called "wordpress-router" but the instruction says not to include the name unless it appears in the source text. The name does appear in the source? Actually the source text starts with "Classify WordPress codebases..." and does not include "wordpress-router" in the provided text. The instruction says "Do not include the name unless it appears in the source text." So we should not add "wordpress-router" in the translation. The text is a description of the skill. We need to preserve product names like WordPress, WP-CLI, PHP, etc. Also preserve technical terms like "repo type", "plugin", "theme", "block theme", "Gutenberg blocks", "WP core", "bash/Node filesystem operations", "WP-CLI", "PHP 7.2.24+", "WordPress 6.9+". Also preserve numbers and URLs (none here). Translate the rest naturally into Korean. The text: "Classify WordPress codebases and
official
wp-abilities-api
wordpress
WordPress Abilities API 등록, REST 노출, WordPress 6.9+용 클라이언트 측 사용. PHP에서 wp_register_ability() 및 wp_register_ability_category()를 사용하여 안정적인 ID, 레이블, 메타데이터로 능력과 카테고리를 등록합니다. meta.show_in_rest: true를 설정하여 /wp-json/wp-abilities/v1/ REST 엔드포인트를 통해 클라이언트에 능력을 노출합니다. @wordpress/abilities 패키지를 사용하여 JavaScript에서 능력을 사용하고 클라이언트 측 접근 및 권한 확인을 수행합니다. WordPress 6.9+ 필요...
official
wp-abilities-audit
wordpress
WordPress 플러그인의 REST 표면을 감사하고 Abilities API 등록을 제안하는 표준화된 감사 문서를 생성합니다. YAML이 포함된 마크다운 문서를 산출합니다…
official
wp-abilities-verify
wordpress
WordPress 플러그인의 Abilities API 등록을 검증합니다: 능력을 열거하고, 콜백 동작이 각 주석의 주장(적대적…)과 일치하는지 확인합니다.
official
wp-block-development
wordpress
WordPress 블록 개발 for Gutenberg: 메타데이터, 등록, 렌더링 및 빌드 워크플로우. 블록 생성, block.json 구성, 정적 vs 동적 렌더링, register_block_type_from_metadata()를 사용한 서버 측 PHP 등록을 다룹니다. WordPress 6.9+ 호환성을 위해 apiVersion: 3을 적용하며, iframe 편집기 지원 및 스타일 격리를 포함합니다. 속성 직렬화, "잘못된 블록" 오류를 방지하기 위한 폐기/마이그레이션, 내부 블록 구성을 처리합니다. 포함...
official
wp-block-themes
wordpress
WordPress 블록 테마 개발: theme.json, 템플릿, 패턴 및 사이트 편집기 문제 해결. theme.json 편집(프리셋, 설정, 블록별 스타일), 템플릿 및 템플릿 부분, 패턴, WordPress 6.9+에서의 스타일 변형을 다룹니다. 테마 루트와 블록 테마 구조를 감지하는 트라이지 스크립트와 새 테마 생성 또는 클래식 테마 변환을 위한 안내 절차를 포함합니다. 스타일 계층 문제, 사용자 맞춤 재정의 및 사이트 편집기 관련 디버깅 워크플로우를 제공합니다.
official
wp-interactivity-api
wordpress
WordPress Interactivity API 기능(데이터-wp-* 지시문, @wordpress/interactivity 스토어/상태/액션, 블록 viewScriptModule…)을 구축하거나 디버깅할 때 사용합니다.
official