|
Download rules/wordpress-plugin-security.md from sadrmanesh/commerce-agent-skills: direct link, hf CLI and curl.
- Browser
- Download file 996 Bytes
-
https://huggingface.co/datasets/sadrmanesh/commerce-agent-skills/resolve/main/rules/wordpress-plugin-security.md
- Command line
-
hf download hf://datasets/sadrmanesh/commerce-agent-skills/rules/wordpress-plugin-security.md
-
curl -L -o wordpress-plugin-security.md https://huggingface.co/datasets/sadrmanesh/commerce-agent-skills/resolve/main/rules/wordpress-plugin-security.md
996 Bytes
WordPress plugin security
- Check a capability with
current_user_can(), not a role name. Useedit_shop_orders,edit_products, ormanage_woocommercefor shop operations. - Verify a nonce on cookie-authenticated state changes. A nonce does not authenticate the user and does not belong on a server-to-server webhook.
- Unslash request data, sanitize it to a known type, and escape on output for the HTML, attribute, or URL context you are writing.
- Pass SQL values through
$wpdb->prepare(). Never build a table name or filesystem path from request input. - Give every private REST route a
permission_callbackthat checks a capability. Do not use__return_truefor order, customer, or payment data. - Authorize the specific object after you load it. A posted order id is not proof that this user may edit that order.
- Store structured meta as JSON or scalars. Do not
unserialize()request data. - Keep secrets, card data, and full
$_POSTpayloads out of logs and order notes.