woo-guard
Fungsinya
Agent ini memeriksa apakah kode untuk toko online yang dibangun dengan WooCommerce sudah aman dan mutakhir. Agent ini memastikan kode berjalan dengan benar pada versi WooCommerce terbaru, terutama terkait pembayaran, pengiriman, dan cara pesanan diproses.
Kapan dipakai
- βSaat meninjau kode baru atau yang diubah untuk toko WooCommerce.
- βSebelum mempublikasikan fitur atau pembaruan baru untuk toko WooCommerce.
- βKetika kode berinteraksi dengan sistem pesanan, pembayaran, atau checkout.
Link skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/woo-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 ini untuk memastikan kode kompatibel dengan versi WooCommerce terbaru dan mengikuti praktik keamanan terbaik.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent menganalisis kode untuk memastikan kode menggunakan fungsi yang tepat untuk mengakses dan menyimpan data pesanan dan produk, serta validasi pembayaran dan checkout dilakukan di sisi server.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Woo Guard
You are reviewing generated or changed WooCommerce code before it ships. Apply the rules below as a guard pass after the first implementation pass. WooCommerce is a moving platform β order storage changed engines, checkout changed frameworks β and code written from memory targets the WooCommerce of three years ago. With money on the line, "works on my demo store" is not a standard.
These rules exist because AI agents produce WooCommerce code with systematic failures: order meta read through get_post_meta() (broken on HPOS stores), products updated by direct meta writes that skip lookup tables and hooks, checkout validated only in JavaScript, prices computed in floats, and woocommerce_* hooks registered before confirming WooCommerce is active.
When to Use
Use this skill when reviewing generated or changed WooCommerce code β extensions, payment and shipping integrations, checkout customizations, and order/product logic β before it ships. Activate it reactively after an agent writes or modifies WooCommerce hooks, HPOS logic, or checkout flows.
How to use this skill
Guard-pass mode (recommended): after WooCommerce code has been generated or edited, apply the rules to the diff or target files, then run the self-check before delivery.
Live mode (explicit): when the user invokes this skill before writing WooCommerce code, apply the same rules while writing, then run the self-check before delivery.
Review mode (the user asks you to review or audit WooCommerce code): walk references/review-checklist.md and produce a structured findings report. Do not edit code in review mode unless asked.
Security floor β these hold in all WooCommerce code, at maximum severity, because money is on the line:
- Escape all output with the context-correct
esc_*function. wp_unslash()then sanitize all request data before it touches logic.- Capability check plus nonce on every state change.
$wpdb->prepare()for every query containing a variable.
If wp-guard is installed, run it alongside for the full WordPress layer.
Adapt to the project first
- Read the project's agent instructions and the extension's declared WooCommerce version range. Project conventions win on conflict.
- Determine the order storage mode this code must support: HPOS, legacy posts, or both (the default assumption is both).
- Determine the checkout in play: Blocks/Store API, legacy shortcode checkout, or both. Hooks for one do not fire in the other.
- Check whether WooCommerce activity is guarded: feature checks or
class_exists( 'WooCommerce' )before anywc_*call orwoocommerce_*hook.
The Rules
Order and product data β must fix
Orders are not posts. Access orders only through the CRUD API:
wc_get_order(),wc_get_orders(),$order->get_meta(),$order->update_meta_data()+$order->save(). Forbidden on order data:get_post_meta(),update_post_meta(),WP_Query/get_posts()withpost_type => shop_order, and direct$wpdbjoins on postmeta. These work on legacy stores and silently break on HPOS stores. Details: references/hpos-and-crud.md.CRUD objects, getters/setters, then save. Products, customers, and coupons go through their CRUD objects (
wc_get_product(), setters,->save()). Direct meta writes skip lookup-table sync, skip the hooks other extensions rely on, and skip cache invalidation. Stock changes go throughwc_update_product_stock()semantics; order state changes through$order->update_status()β which fire the emails and hooks the store expects.Declare feature compatibility. Any extension touching orders declares HPOS compatibility (
FeaturesUtil::declare_compatibility( 'custom_order_tables', β¦ )); any extension touching checkout declarescart_checkout_blockscompatibility (or incompatibility, honestly). A missing declaration shows every store owner a warning banner with your plugin's name on it.
Checkout and money β must fix
- Checkout validation is server-side. Validate at
woocommerce_checkout_process(legacy) or through Store API extension schemas (Blocks). JavaScript validation is UX, never security. Know which checkout the store runs and wire both when the extension claims general compatibility.
β¦
Pertanyaan umum
Mengapa saya sebaiknya tidak menggunakan `get_post_meta()` untuk mengakses data pesanan?
Di versi WooCommerce yang lebih baru (HPOS), pesanan tidak lagi disimpan sebagai post biasa. Penggunaan `get_post_meta()` dapat membuat kode berhenti berfungsi dengan benar di toko-toko tersebut.
Apa maksud 'validasi checkout di sisi server'?
Artinya pemeriksaan penting untuk memastikan pesanan dapat diselesaikan, seperti ketersediaan stok atau informasi pembayaran, harus dilakukan di server, bukan hanya di browser klien. Ini sangat penting untuk keamanan.
Mengapa kode perlu menyatakan kompatibilitas dengan HPOS dan checkout blocks?
Pernyataan kompatibilitas memberi tahu WooCommerce dan developer lain bahwa kode Anda sudah diuji dan berjalan dengan cara baru mengelola pesanan (HPOS) serta sistem checkout modern (blocks). Dengan begitu, peringatan dan masalah bagi pemilik toko dapat dicegah.
Detail
Deskripsi asli dari pembuat
Review generated or changed WooCommerce extensions, payment and shipping integrations, checkout customizations, and order or product logic.
Popularitas
- Bintang GitHub
- 48k
- Peringkat
- #6193
- 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
api-connector-builder
280kMembuat agent Anda membangun koneksi API baru mengikuti pola yang sudah ada. Gunakan saat ingin menambah integrasi lagi tanpa membuat cara baru.
api-design
280kMembantu agent Anda merancang REST API sesuai praktik terbaik. Berguna untuk mengatur cara API berkomunikasi, menampilkan error, dan mengorganisasi data.
backend-patterns
280kMembantu agent Anda dengan pola arsitektur sisi server dan optimasi database. Berguna untuk membangun atau meninjau kode yang berjalan di server.