فارسی · English
قالب مشترک افزونههای How to WP. هر محصول یک افزونه است: هستهٔ Bluwp داخل lib/bluwp قرار دارد و مشتری افزونهٔ جداگانهای نصب نمیکند. اگر Bluwp مستقل روی سایت فعال باشد، همان نسخه استفاده میشود. ظاهر پیشخوان با React و کامپوننتهای VibeFarsi ساخته میشود (npm run build → assets/admin). React از خود وردپرس میآید.
git clone [email protected]:howtowp/my-plugin.git && cd my-plugin
./scripts/init.sh my-plugin "My Plugin" MyPlugin mp
cd my-plugin && composer install
composer lint && composer phpcs && composer phpstan && composer test
php ../scripts/check-catalog.phpBluwp 0.3.0 داخل افزونه است (lib/bluwp، namespace Howtowp\Bluwp، بازهٔ >= 0.3.0 < 0.4.0). بهروزرسانی آن: ./scripts/update-bluwp.sh <path-or-tgz>. ساخت پیشخوان: cd plugin-template && npm ci && npm run build. جزئیات در docs/design-system.md. افزونهای که از این قالب ساخته شده باید همان namespace را به کار ببرد؛ فهرست دقیق تغییرها در CONTRIBUTING.md.
افزونهی قابلانتشار فقط داخل یک زیرپوشه است. docs/، data/، design/، research/، scripts/ و dev/ داخل zip نمیروند.
my-plugin/
├── my-plugin/ خود افزونه (نام پوشه = slug)
│ ├── my-plugin.php هدر، ثابتها، HTW_*_FILE = __FILE__
│ ├── lib/bluwp/ هستهٔ Bluwp؛ مشتری جدا نصب نمیکند
│ ├── bootstrap/ pages/ routes/ app/ src/Text.php
│ ├── hooks/early/ سازگاری HPOS با همان فایل اصلی
│ ├── crons/ database/ assets/ development/
│ └── AI-GUIDE.md readme.txt
├── product.json product.schema.json
├── docs/ AGENTS.md .release.yml .github/
└── scripts/init.sh scripts/check-catalog.php
product.json فیلد version ندارد (اسکیما اجازه نمیدهد). خط Plugin-Version در AI-GUIDE.md باید با هدر افزونه یکی باشد. php scripts/check-catalog.php این را، بهعلاوهی capability یکسان صفحه و REST و استفادهنکردن از نام فایل سختکدشده، چک میکند.
مجوز بازتوزیع فونت IranSans هنوز باز است. جزئیات: docs/design-system.md. چکلیست مهاجرت افزونههای قدیمی: docs/migrating.md.
نسخه را در هدر، HTW_*_VERSION، readme.txt، AI-GUIDE.md و package.json بالا ببرید و روی main تگ vX.Y.Z بزنید. راهنما: docs/releasing.md.
Shared starter for How to WP plugins. Each product is one install: Bluwp 0.3.0 is embedded in lib/bluwp under the PHP namespace Howtowp\Bluwp (>= 0.3.0 and < 0.4.0). A site that already runs the standalone Bluwp plugin keeps using that copy when it is active and on the same line. The admin UI is React + VibeFarsi (MIT), built with Vite. WordPress's React is reused via wp-element.
git clone [email protected]:howtowp/my-plugin.git && cd my-plugin
./scripts/init.sh my-plugin "My Plugin" MyPlugin mp # slug, name, namespace, short prefix
cd my-plugin && composer install
composer lint && composer phpcs && composer phpstan && composer test
php ../scripts/check-catalog.phpBluwp 0.3.0 ships in lib/bluwp (Howtowp\Bluwp). Refresh it with ./scripts/update-bluwp.sh <path-or-tgz>. Build the admin with cd plugin-template && npm ci && npm run build. See docs/design-system.md. A plugin that already consumes this template must follow CONTRIBUTING.md.
- Embedded Bluwp 0.3.0 in
lib/bluwp, namespaceHowtowp\Bluwp, booted withBluwpBridgeV1::consume(). NoRequires Plugins: bluwp. - Bluwp layout:
bootstrap/,pages/,routes/,app/,src/Text.php,hooks/early/,crons/,database/migrations/,assets/. - One schema-driven settings page, one REST route with the same capability constant and a
wp_restnonce. - HPOS and checkout-blocks compatibility declared with
HTW_PT_FILE(the real main file, not a hardcoded name). scripts/init.shrenames slug, namespace, and prefix.scripts/check-catalog.phpkeeps the header,readme.txt,package.json, andAI-GUIDE.mdPlugin-Versionin lockstep.product.jsonhas no version field.- Release workflow, Plugin Check, security rules, and
product.schema.jsonstay.
IranSans redistribution is an open licensing question. Migration checklist: docs/migrating.md. Release guide: docs/releasing.md.
License: GPL-2.0-or-later. © How to WP.