phpnomad/wp-plugin-starter
Composer 安装命令:
composer create-project phpnomad/wp-plugin-starter
包简介
Starter for scaffolding a new PHPNomad WordPress plugin. Run via composer create-project, then run the phpnomad/wp-plugin recipe to fill in your plugin.
README 文档
README
Scaffold a brand-new PHPNomad WordPress plugin in two commands.
Usage
composer create-project phpnomad/wp-plugin-starter my-plugin cd my-plugin vendor/bin/phpnomad make --from=phpnomad/wp-plugin '{ "pluginName": "My Plugin", "description": "What my plugin does.", "vendor": "acme", "package": "my-plugin", "namespace": "AcmeMyPlugin", "textDomain": "my-plugin", "authorName": "Your Name", "authorEmail": "you@example.com", "authorUrl": "" }'
That's it. After the recipe runs, you have a working PHPNomad WordPress plugin with the right entry file, Application class, root initializer, autoload, tests, and composer.json rewritten to match your plugin's identity.
Notes on the bootstrap arguments
namespace— single-segment, PascalCase, no backslashes (e.g.AcmeMyPlugin, notAcme\\MyPlugin). v1 of the bootstrap recipe doesn't support nested namespaces; if you need one, editcomposer.jsonafter scaffolding.authorUrl— pass an empty string if you don't have one. WordPress will still display the plugin without an Author URI line.
From there, use the rest of PHPNomad's recipes to add functionality. The initializer arg points at {namespace}\\AppInit — the root initializer the bootstrap created:
vendor/bin/phpnomad make --from=phpnomad/datastore '{"name":"Order","initializer":"AcmeMyPlugin\\\\AppInit"}' vendor/bin/phpnomad make --from=phpnomad/cpt-datastore '{"name":"Event","postType":"acme-event","pluralLabel":"Events","singularLabel":"Event","textDomain":"my-plugin","initializer":"AcmeMyPlugin\\\\AppInit"}'
Run vendor/bin/phpnomad recipes:list --all=1 to see everything available across the installed kits.
Why a starter plus recipes (and not a clone-this-template)
This starter is intentionally tiny. Its only job is to give you phpnomad/cli and phpnomad/wp-plugin-recipes in your project so the bootstrap recipe can run. The actual plugin structure lives in versioned recipes that improve and ship independently. If you cloned this starter today and again in six months, the second project benefits from improvements without you copying anything.
The previous template approach (phpnomad/wp-plugin-template) is being retired in favor of this pattern.
What you get after the bootstrap
my-plugin/
├── my-plugin.php # WordPress plugin entry file with proper plugin header
├── lib/
│ ├── Application.php # PHPNomad Application class wired for WordPress
│ └── AppInit.php # Root initializer — recipes register against this
├── tests/
│ └── bootstrap.php # Minimal PHPUnit bootstrap
├── composer.json # Rewritten with your plugin's identity and full deps
├── phpunit.xml
├── .gitignore
├── .phpnomad/
│ └── config.json # Active recipe set (defaults to all installed)
└── README.md # Your plugin's README
Requirements
- PHP 8.2 or higher
- Composer 2.0 or higher
- WordPress 6.0 or higher (when activated as a plugin)
License
MIT
phpnomad/wp-plugin-starter 适用场景与选型建议
phpnomad/wp-plugin-starter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 phpnomad/wp-plugin-starter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 phpnomad/wp-plugin-starter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 36
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-01