شعار Secure Plugin Development

Secure Plugin Development

مؤسسة
wpultimatesecurity
secure-plugin-development

استخدم هذه المهارة عند بدء تطوير إضافة أو قالب WordPress جديد، أو إنشاء الهيكل الأساسي لملف إضافة، أو ربط الخطافات، أو إضافة أي ميزة تتعامل مع الطلبات أو الخيارات أو المخرجات. تضع أساسًا آمنًا افتراضيًا — حارس ABSPATH، وتدفق التحقق من الإمكانات + nonce + التنقية + الهروب، والاستعلامات المُعدّة، والقيم الافتراضية الآمنة — وتوجّه إلى مهارات الأمان المتخصصة لكل جانب. طبّقها استباقيًا في بداية أي عملية تطوير لـ WordPress.

Add to TypingMind

نظرة عامة

الناشرwpultimatesecurity
المستودعWordPress-Security-Skills
اسم المهارةsecure-plugin-development
النجوم
54
التفريعات
3
الملفات المرفقة
3
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 3

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها wpultimatesecurity على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Secure Plugin Development في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/wpultimatesecurity/WordPress-Security-Skills/tree/dev/skills/secure-plugin-development
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wpultimatesecurity/WordPress-Security-Skills.git /tmp/WordPress-Security-Skills
mkdir -p .claude/skills
cp -r /tmp/WordPress-Security-Skills/skills/secure-plugin-development .claude/skills/secure-plugin-development
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Secure Plugin Development في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Secure Plugin Development تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Secure Plugin Development بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Secure plugin & theme development (baseline)

When to use this skill

Use this skill at the start of any WordPress development work and whenever you add a feature that crosses a trust boundary:

  • Creating a new plugin main file or theme functions.php addition.
  • Registering hooks (add_action / add_filter) that handle input or render output.
  • Adding admin pages, settings, shortcodes, blocks, widgets, or REST routes.
  • Reviewing an existing plugin to bring it up to a secure baseline.

This is the router skill. Follow the security decision tree: choose the entry path (browser/API, renderer, cron, or CLI), then add the relevant data and policy branches. It explains when to combine focused skills and when browser nonce checks do not apply; do not load every skill for every task.

Core principles (and why they matter)

  1. Never trust input; always escape output. Every value from $_GET, $_POST, $_REQUEST, $_COOKIE, the database, or a remote API is untrusted until sanitized, and untrusted again the moment it is echoed. These are two separate jobs.
  2. Block direct file access. Plugin files are reachable by URL. Without an ABSPATH guard, an attacker can execute them outside WordPress, bypassing all your checks.
  3. Separate authentication, CSRF, and authorization. Use a nonce for cookie-authenticated state changes and an appropriate capability/object check for privileged actions. REST API credentials, cron, and CLI have different trust models; follow the decision tree rather than adding browser checks everywhere.
  4. Use core APIs, not hand-rolled code. Prefer maintained sanitize/escape/DB/HTTP APIs, but choose the API and its arguments for the actual trust boundary.
  5. Least privilege by default. Default options to the safe value, scope capabilities tightly, and expose the minimum surface.
  6. Fail closed. On any failed check, stop and return an error — never fall through.

Step-by-step implementation

  1. Guard the file: defined( 'ABSPATH' ) || exit; at the top of every PHP file.
  2. Namespace everything: prefix functions, hooks, options, and globals (e.g. my_plugin_*) to avoid collisions and accidental overrides.
  3. Choose the handler trust model using the decision tree:
    1. Apply transport-appropriate authentication and CSRF protection.
    2. Check authority over the action and specific resource.
    3. Validate input shape/type, unslash WordPress-slashed request input, and sanitize.
    4. Use $wpdb->prepare() for dynamic values in custom queries.
    5. Escape at each output sink for its actual context.
  4. Set safe defaults for all options; validate on save and on read.
  5. Enqueue assets properly (wp_enqueue_script/style) and pass data via wp_localize_script() rather than inline-echoing PHP into JS.
  6. Keep secrets out of the repo and out of client-readable output.

Supporting references

ReferenceLoad when
Secure plugin baseline checklistBefore final verification of the secure plugin baseline controls.
Choose the security review pathSelecting focused skills for the entry point and all relevant data and risk branches.
Secure plugin skeletonImplementing a capability-gated plugin admin page and the full settings-save flow.

Common AI mistakes / anti-patterns

Mistake 1 — No ABSPATH guard

php
// ❌ Insecure: file executes if requested directly over HTTP.
<?php
function my_plugin_init() { /* ... */ }
php
// ✅ Secure: bail unless loaded within WordPress.
<?php
defined( 'ABSPATH' ) || exit;

function my_plugin_init() { /* ... */ }

Mistake 2 — Doing the work before the security checks

php
// ❌ Insecure: option saved before anything is verified.
function my_plugin_save() {
    update_option( 'my_opt', $_POST['val'] );
    check_admin_referer( 'my_plugin_save' );
    current_user_can( 'manage_options' );
}
php
// ✅ Secure: verify, authorize, sanitize, THEN act.
function my_plugin_save() {
    check_admin_referer( 'my_plugin_save', 'my_plugin_nonce' );
    if ( ! current_user_can( 'manage_options' ) ) {
        wp_die( esc_html__( 'Forbidden', 'my-plugin' ), 403 );
    }
    $val = isset( $_POST['val'] ) ? sanitize_text_field( wp_unslash( $_POST['val'] ) ) : '';
    update_option( 'my_opt', $val );
}

Mistake 3 — Rolling your own instead of using core APIs

php
// ❌ Insecure: manual SQL, manual escaping, raw remote fetch.
$rows = $wpdb->get_results( "SELECT * FROM t WHERE id = " . $_GET['id'] );
echo "<a href=" . $_GET['url'] . ">x</a>";
$body = file_get_contents( $remote_url );
php
// ✅ Secure: prepared query, escaped output, HTTP API.
$id   = absint( $_GET['id'] ?? 0 );
$rows = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}t WHERE id = %d", $id ) );
echo '<a href="' . esc_url( wp_unslash( $_GET['url'] ?? '' ) ) . '">x</a>';
$response = wp_remote_get( $remote_url );
$body     = is_wp_error( $response ) ? '' : wp_remote_retrieve_body( $response );

Mistake 4 — Unsafe defaults

php
// ❌ Insecure: feature ships enabled, capability defaults wide open.
add_option( 'my_plugin_allow_uploads', true );
php
// ✅ Secure: default to the safe value; opt-in to risk.
add_option( 'my_plugin_allow_uploads', false );

Correct code examples

A minimal but complete secure plugin skeleton — ABSPATH guard, an admin page behind a capability, and the full verify → authorize → sanitize → act → escape flow — lives in references/secure-plugin-skeleton.php.

Checklist

  • Every PHP file opens with defined( 'ABSPATH' ) || exit;.
  • Functions, hooks, and options are uniquely prefixed.
  • Each request handler verifies nonce, then capability, then sanitizes input.
  • All custom DB access uses $wpdb->prepare().
  • All dynamic output is escaped at the point of echo.
  • Options have safe defaults and are validated on save.
  • Remote requests use the WP HTTP API (wp_remote_*), not file_get_contents/cURL.
  • No secrets, keys, or credentials are hard-coded or sent to the browser.
  • Scripts are enqueued and given data via wp_localize_script().

Official references

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة ما دامت المهارة محمّلة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Secure Plugin Development؟

استخدم هذه المهارة عند بدء تطوير إضافة أو قالب WordPress جديد، أو إنشاء الهيكل الأساسي لملف إضافة، أو ربط الخطافات، أو إضافة أي ميزة تتعامل مع الطلبات أو الخيارات أو المخرجات. تضع أساسًا آمنًا افتراضيًا — حارس ABSPATH، وتدفق التحقق من الإمكانات + nonce + التنقية + الهروب، والاستعلامات المُعدّة، والقيم الافتراضية الآمنة — وتوجّه إلى مهارات الأمان المتخصصة لكل جانب. طبّقها استباقيًا في بداية أي عملية تطوير لـ WordPress.

لماذا تستخدم Secure Plugin Development على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Secure Plugin Development عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Secure Plugin Development في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/wpultimatesecurity/WordPress-Security-Skills/tree/dev/skills/secure-plugin-development. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Secure Plugin Development؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Secure Plugin Development؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Secure Plugin Development معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Secure Plugin Development مجانية؟

نعم. نشرها wpultimatesecurity على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل
شعار affaan-m

Agent Architecture Audit

affaan-m
المجتمعشائع

تشخيص متكامل لتطبيقات الوكلاء وتطبيقات LLM. يدقّق تراجعات الأغلفة، وتلوث الذاكرة، وإخفاقات انضباط الأدوات، وحلقات الإصلاح المخفية، وأعطال العرض عبر طبقات مجموعة الوكلاء الـ12. ينشئ نتائج مرتبة حسب الأهمية مع إصلاحات تركّز على الكود. لا غنى عنه للمطورين الذين يبنون تطبيقات الوكلاء أو الحلقات المستقلة أو الميزات المدعومة بـ LLM.

39.1K
261.1K
التعليمات
عرض
شعار NousResearch

Antigravity Cli

NousResearch
مؤسسةشائع

تشغيل Antigravity CLI (agy): الإضافات والمصادقة وبيئة الاختبار المعزولة.

53.5K
250.4K
الملفات: 1
عرض
شعار langgenius

Backend Code Review

langgenius
مؤسسةشائع

استخدم هذه المهارة فقط عندما يطلب المستخدم صراحةً مراجعة أو تدقيقًا لشفرة الواجهة الخلفية ضمن `api/`. تدعم مراجعة التغييرات المعلّقة، والمراجعة التي تركز على ملفات محددة، ومراجعة الفروق الملصقة. لا تستخدمها لطلبات التنفيذ فقط،…

24.9K
157.6K
الملفات: 4
عرض
شعار langgenius

Frontend Code Review

langgenius
مؤسسةشائع

استخدم هذه المهارة فقط عندما يطلب المستخدم صراحةً مراجعة أو تدقيقًا لشفرة الواجهة الأمامية ضمن `web/` أو `packages/dify-ui/`. تدعم مراجعة التغييرات المعلّقة، والمراجعة التي تركز على ملفات محددة، ومراجعة الفروق الملصقة. لا تستخدمها لـ…

24.9K
157.6K
الملفات: 8
عرض

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇