From dca3714a5612d276bd2ccbd0d2da71248ac285c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20S=C3=B8derlind?= Date: Wed, 1 Oct 2025 20:43:01 +0200 Subject: [PATCH] Add comprehensive WordPress development instructions for Copilot - Introduced a detailed guide covering core principles, coding standards, security practices, internationalization, performance optimization, admin UI, REST API, block development, asset loading, testing strategies, and documentation best practices. - Emphasized the importance of following WordPress Coding Standards (WPCS) and provided examples for plugin headers, linting setup, and security measures. - Included a checklist to ensure compliance with best practices for plugin development. --- instructions/wordpress.instructions.md | 186 +++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 instructions/wordpress.instructions.md diff --git a/instructions/wordpress.instructions.md b/instructions/wordpress.instructions.md new file mode 100644 index 0000000..b429676 --- /dev/null +++ b/instructions/wordpress.instructions.md @@ -0,0 +1,186 @@ +--- +applyTo: "wp-content/plugins/**,wp-content/themes/**,**/*.php,**/*.inc,**/*.js,**/*.jsx,**/*.ts,**/*.tsx,**/*.css,**/*.scss,**/*.json" +description: "Coding, security, and testing rules for WordPress plugins and themes" +--- + +# WordPress Development — Copilot Instructions + +**Goal:** Generate WordPress code that is secure, performant, testable, and compliant with official WordPress practices. Prefer hooks, small functions, dependency injection (where sensible), and clear separation of concerns. + +## 1) Core Principles +- Never modify WordPress core. Extend via **actions** and **filters**. +- For plugins, always include a header and guard direct execution in entry PHP files. +- Use unique prefixes or PHP namespaces to avoid global collisions. +- Enqueue assets; never inline raw `