wp-guard
Fungsinya
Agent ini memeriksa kode plugin, tema, dan block WordPress dari sisi keamanan, internasionalisasi, performa, dan ketepatan penggunaan API. Agent ini membantu mencegah masalah umum yang sering muncul pada kode hasil generate AI.
Kapan dipakai
- βSetelah AI agent membuat atau mengubah kode WordPress.
- βSebelum mempublikasikan plugin atau tema WordPress baru.
- βSaat meninjau kode yang sudah ada untuk mencari celah keamanan atau kesalahan terjemahan.
Link skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/wp-guard/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βTinjau kode plugin WordPress ini untuk memastikan kodenya aman dan siap diterjemahkan.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent ini menganalisis kode untuk mencari kerentanan yang sudah dikenal, seperti tidak adanya proteksi keamanan, teks bahasa Inggris yang ditulis langsung di kode padahal seharusnya bisa diterjemahkan, atau query database yang kurang baik. Agent ini kemudian memberikan saran perbaikan untuk masalah tersebut.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
β οΈ AUTHORIZED USE ONLY This skill is for educational purposes or authorized security assessments only. You must have explicit, written permission from the system owner before using this tool. Misuse of this tool is illegal and strictly prohibited.
Mandatory confirmation gate Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:
- Ask the user to state the exact target URL, IP, account, or resource.
- Ask the user to confirm written authorization and the permitted scope.
- Show the exact command(s) and explain their expected effect.
- Wait for explicit confirmation in the current conversation.
Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.
WP Guard
[!WARNING] Authorized Use Only. Review only WordPress code and environments the user owns or is explicitly authorized to assess. Keep checks non-destructive and inside the approved scope.
You are reviewing generated or changed WordPress code before it ships. Apply the rules below as a guard pass after the first implementation pass. Be a sharp reviewer, not a pedantic one: flag what creates vulnerabilities, breaks translations, or melts servers β ignore cosmetic preferences WPCS tooling already handles.
These rules exist because AI agents produce WordPress code with systematic failures: raw echo of request data, AJAX handlers with neither nonce nor capability check, SQL built by string interpolation, English hardcoded into user-facing strings, posts_per_page => -1 on sites with a million posts, and hand-rolled replacements for APIs core already ships. Each one looks fine in a demo and fails in production.
When to Use
Use this skill when reviewing generated or changed WordPress code β plugins, themes, and blocks β before it ships. Activate it reactively after an agent writes, edits, or reviews code touching WordPress APIs: hooks, custom post types, REST endpoints, database queries, and block editor integrations.
How to use this skill
Guard-pass mode (recommended): after WordPress code has been generated or edited, apply the rules to the diff or target files, then run the self-check before delivery. Fix violations before showing the user.
Live mode (explicit): when the user invokes this skill before writing WordPress code, apply the same rules while writing, then run the self-check before delivery.
Review mode (the user asks you to review, audit, or rate WordPress code): walk references/review-checklist.md against the target files and produce a structured findings report. Do not edit code in review mode unless asked.
Pair this skill with clean-code-guard when both are installed: clean-code-guard owns generic code quality; wp-guard owns the WordPress layer.
Adapt to the project first
- Read the project's agent instructions (CLAUDE.md, AGENTS.md),
phpcs.xml/WPCS config, andcomposer.json. Project conventions win on conflict. - Identify the established prefix (functions, options, meta keys, handles) and the minimum supported WP/PHP versions. Match both.
- Detect context: WooCommerce APIs in play β apply woo-guard alongside this skill when it is installed; otherwise apply WooCommerce's HPOS, CRUD, and checkout rules from its developer documentation. Multilingual site (WPML/Polylang/multisite) β i18n rules are blocking, not advisory.
- Read one neighboring file before writing. Mirror its error handling, hook registration style, and escaping habits β unless they violate the security rules below, which are non-negotiable.
The Rules
Security β must fix, no exceptions
- Escape late, escape everything. Every variable crossing into HTML output goes through the context-correct function:
esc_html(),esc_attr(),esc_url(), orwp_kses()/wp_kses_post()for rich content. Data passed to inline JS goes throughwp_json_encode()+wp_add_inline_script()βesc_js()is legacy, for single-quoted strings in inline attributes only. Escaping happens at output, not at storage.echo $anything;without anesc_*wrapper fails review.
β¦
Pertanyaan umum
Mengapa saya perlu izin untuk menggunakan alat ini?
Alat ini cukup kuat dan bisa dipakai untuk mencari kerentanan. Penting untuk hanya menggunakannya pada sistem yang Anda miliki atau yang sudah Anda dapatkan izin tertulisnya untuk diuji, agar tidak menimbulkan masalah hukum dan etika.
Apa itu 'nonce' dan 'capability check'?
Keduanya adalah mekanisme keamanan di WordPress. 'Nonce' membantu memastikan bahwa sebuah permintaan dibuat oleh pengguna yang dituju dan tidak diubah di tengah jalan. 'Capability check' memeriksa apakah pengguna memiliki izin untuk melakukan tindakan yang diminta.
Apa maksud 'escape' dan 'sanitize' pada data?
'Sanitize' adalah proses membersihkan data yang masuk untuk membuang karakter yang berbahaya atau tidak valid. 'Escape' adalah proses memformat data sebelum ditampilkan agar tidak diartikan sebagai kode berbahaya (seperti HTML atau JavaScript).
Detail
Deskripsi asli dari pembuat
Review generated or changed WordPress plugins, themes, and blocks for security, internationalization, performance, and API correctness.
Popularitas
- Bintang GitHub
- 48k
- Peringkat
- #6205
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
00-andruia-consultant
48kMembantu agent Anda memulai atau meningkatkan proyek AI. Agent menganalisis kode, menyarankan tools, dan membuat rencana aksi dalam bahasa Spanyol.
007
48kMemungkinkan agent Anda melakukan audit keamanan dan threat modeling. Berguna untuk melindungi proyek dari serangan dan celah keamanan.
10-andruia-skill-smith
48kMembantu agent Anda membuat atau meningkatkan tools AI. Agent mendefinisikan cara kerja tools, menulis dokumentasi, dan memvalidasi strukturnya.
20-andruia-niche-intelligence
48kMemungkinkan agent Anda membuat ringkasan industri tertentu. Berguna untuk memahami konteks, aturan, pola penggunaan, dan risiko proyek dengan sumber terpercaya.
Skill serupa
test-driven-development
311kMengajari agent Anda menulis tes yang gagal dulu, melihatnya gagal, lalu menulis kode terkecil yang lulus, sebelum membangun fitur atau perbaikan apa pun.
verification-before-completion
311kMengajari agent Anda menjalankan pemeriksaan nyata dan membaca keluarannya sebelum menyatakan tugas, perbaikan, atau build sudah selesai atau lulus.
migrate-to-shoehorn
310kMengganti type cast berisiko di file tes Anda dengan pustaka shoehorn, sehingga tes bisa memakai data parsial dan tetap lulus pemeriksaan tipe.