Logo Devvn Wp Security Audit

Devvn Wp Security Audit

Cộng đồng
levantoan
devvn-wp-security-audit

Comprehensive WordPress plugin/theme security and code quality audit following WPCS and Plugin Check standards. Scans all PHP files for SQL Injection, XSS, CSRF, Access Control, File Security, Forbidden Functions, Safe Redirect, Input Validation, and Code Quality issues. Reports with file:line references and fix suggestions. Use when reviewing security before releasing a plugin, checking for vulnerabilities, preparing for WordPress.org submission, or running a code quality audit.

Tổng quan

Nhà phát hànhlevantoan
Kho mãDevVN-WordPress-Skills
Tên kỹ năngdevvn-wp-security-audit
Sao
30
Bản fork
7
Tệp đi kèm
3
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 3 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được levantoan công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Devvn Wp Security Audit trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/levantoan/DevVN-WordPress-Skills/tree/main/skills/devvn-wp-security-audit
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/levantoan/DevVN-WordPress-Skills.git /tmp/DevVN-WordPress-Skills
mkdir -p .claude/skills
cp -r /tmp/DevVN-WordPress-Skills/skills/devvn-wp-security-audit .claude/skills/devvn-wp-security-audit
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Devvn Wp Security Audit trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Devvn Wp Security Audit ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Devvn Wp Security Audit không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

DevVN WordPress Security & Code Quality Audit

Performs a full security and code quality audit on WordPress plugins/themes against WPCS (WordPress Coding Standards) and WordPress Plugin Check standards. Covers 8 vulnerability categories with 40+ individual rules, plus code quality and performance checks.

When to use

Activate when:

  • User asks to "check security", "security audit", "kiểm tra bảo mật", "audit plugin"
  • User asks to "check code quality", "plugin check", "review code"
  • Before publishing/releasing a plugin or submitting to WordPress.org
  • User mentions "devvn-wp-security-audit"
  • User asks "are there any security vulnerabilities" or "có lỗi bảo mật không"
  • User asks about SQL injection, XSS, CSRF, nonce, escaping, sanitization

Audit process

Step 1: Identify scope

Scan all PHP files in the project:

  • src/**/*.php (controllers, services, admin handlers)
  • templates/**/*.php (highest XSS risk)
  • includes/**/*.php (legacy logic)
  • admin/**/*.php (admin views)
  • Root *.php (bootstrap files)
  • assets/**/*.js (check data passed from PHP via wp_localize_script, wp_add_inline_script)

Priority order: Controllers/Handlers > Templates > Services > Admin views > Bootstrap

Step 2: Run security audit

Use the Agent tool with subagent_type: feature-dev:code-reviewer. Pass the complete audit rules from references/audit-rules.md as the prompt.

Instruct the agent to:

  • Read ALL files completely before reporting
  • Report using the exact format from references/report-format.md
  • Only report confirmed issues, no false positives
  • Skip intelephense IDE warnings (undefined function for WP globals is normal)
  • Report duplicate patterns once, note "same pattern in N files"
  • Check current code state, not previously fixed issues

Step 3: Run code quality audit (if preparing for WordPress.org)

If the user is preparing for WordPress.org submission or asks for a full audit, also check rules from references/code-quality-rules.md. This covers:

  • Prefixing (all globals must have unique prefix)
  • Setting sanitization (register_setting() with sanitize_callback)
  • Performance (enqueued resources, WP_Query params, script loading strategy)
  • i18n (text domain, translator comments)
  • Localhost references
  • Forbidden file types
  • Plugin headers and uninstall handling

Step 4: Report

Output results in Vietnamese using the format from references/report-format.md. Include:

  • Each issue with [TYPE] - [Severity], file:line, code snippet, reason, fix
  • Summary table at the end
  • "PASS" section listing categories that were audited and found clean

Step 5: Fix

Fix reported issues from Critical to Low, but ask the user before fixing patterns that may be intentional:

  • SSL verification disabled in cURL fallback (may be needed for hosting compatibility)
  • Sensitive data passed to frontend JS via wp_localize_script() (may be required by frontend logic)
  • wp_redirect() usage (may be intentional for external redirects)
  • Development functions like error_log() (may be needed for debugging)
  • Other patterns where fixing could break existing functionality

Only auto-fix issues that are clearly unintentional (missing esc_html(), missing wp_check_filetype(), raw unserialize(), etc.). Run php -l on every modified file to verify syntax.

Audit categories

1. SQL Injection (SQLi)

  • $wpdb->prepare() required for all queries with user-supplied data
  • Placeholder count must match parameter count
  • $wpdb->esc_like() required for LIKE clauses
  • array_fill for IN() placeholders, never string concatenation
  • ORDER BY/GROUP BY must use whitelist validation, never %s
  • Prefer WP abstraction (get_posts, WP_Query) over direct $wpdb when possible

2. Cross-Site Scripting (XSS)

  • All $_GET/$_POST/$_REQUEST must be sanitized on input
  • All output must be escaped late (right before echo): esc_html(), esc_attr(), esc_url(), esc_textarea()
  • Flag any echo/print/printf of variables without esc_* functions
  • Even numeric DB values must be cast (int) or escaped before output
  • JS data from PHP must use wp_json_encode()
  • Flag unsafe printing functions and unescaped search queries

3. CSRF (Nonce)

  • Every action form/URL must have wp_nonce_field() or wp_nonce_url()
  • Every handler must verify with check_admin_referer() or wp_verify_nonce()
  • Flag any $_POST handler without nonce verification
  • Detect nonce conflicts when multiple handlers match same URL params
  • Detect buggy nonce patterns: unsafe if-statement logic, negated AND, problematic else

4. Access Control

  • current_user_can() required before every sensitive action
  • REST API write endpoints must have proper permission_callback
  • Every PHP file must have defined('ABSPATH') || exit (or WPINC)
  • Branch/multi-tenant isolation must verify ownership before writes

5. File & Remote Security

  • File uploads must validate type with wp_check_filetype()
  • Use WP_Filesystem API instead of raw file_put_contents()/fopen()
  • Never use unserialize() on remote data
  • Never disable SSL: CURLOPT_SSL_VERIFYPEER must be true
  • Sensitive tokens/keys must not appear in URLs or frontend output
  • Path traversal: validate_file() for user-supplied paths
  • ALLOW_UNFILTERED_UPLOADS constant is forbidden

6. Safe Redirect

  • Use wp_safe_redirect() instead of wp_redirect() for internal redirects
  • Always call exit or die after redirect
  • Never redirect inside page callbacks (headers already sent)

7. Forbidden & Dangerous Functions

  • Never use eval(), create_function(), assert() with string args
  • Never use move_uploaded_file() directly — use WP upload handling
  • Never use backtick operator (`) for shell execution
  • Flag set_time_limit(), ini_set() in production code
  • No code obfuscation (Zend Guard, ionCube, Source Guardian)
  • No goto construct

8. Input Validation

  • All superglobals must be validated AND sanitized before use
  • Use wp_unslash() before sanitizing $_POST/$_GET values
  • Never process the entire $_POST/$_GET array — read explicit keys
  • register_setting() must have sanitize_callback

Gotchas

Common false positives to avoid reporting:

  • esc_html__() and esc_attr_e() are valid — they combine escaping + translation
  • wp_kses_post() is valid sanitization for trusted HTML in admin context
  • absint() is valid sanitization for positive integers (no need for additional (int) cast)
  • $wpdb->prepare() with {$prefix} for table name is acceptable (table prefix, not user data)
  • WordPress core functions like wp_insert_post(), update_option() handle their own sanitization
  • __return_true as REST permission_callback is acceptable for public read endpoints

Common patterns that look safe but aren't:

  • intval($_GET['id']) without $wpdb->prepare() — still needs prepare for SQL
  • esc_html() on output but no sanitize_*() on input — both are needed
  • Nonce checked but no current_user_can() — nonce prevents CSRF, not authorization
  • wp_verify_nonce() in an if without early return on failure — code continues to execute

Important notes

  • All reports must be in Vietnamese — the audit rules and skill instructions are in English, but output to the user in Vietnamese
  • Do NOT report false positives — only confirmed issues
  • Do NOT report the same pattern multiple times — mention "same pattern in N files"
  • Prioritize exploitable issues first, defensive coding issues second
  • After fixing, verify with php -l syntax check on all modified files
  • When in doubt about severity, check references/report-format.md for severity definitions

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Devvn Wp Security Audit làm được gì?

Comprehensive WordPress plugin/theme security and code quality audit following WPCS and Plugin Check standards. Scans all PHP files for SQL Injection, XSS, CSRF, Access Control, File Security, Forbidden Functions, Safe Redirect, Input Validation, and Code Quality issues. Reports with file:line references and fix suggestions. Use when reviewing security before releasing a plugin, checking for vulnerabilities, preparing for WordPress.org submission, or running a code quality audit.

Vì sao nên dùng Devvn Wp Security Audit trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Devvn Wp Security Audit là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Devvn Wp Security Audit trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/levantoan/DevVN-WordPress-Skills/tree/main/skills/devvn-wp-security-audit. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Devvn Wp Security Audit?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Devvn Wp Security Audit với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Devvn Wp Security Audit với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Devvn Wp Security Audit có miễn phí không?

Kỹ năng này được levantoan phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇