vonaffenfels/wp-plugin-skeleton
Composer 安装命令:
composer create-project vonaffenfels/wp-plugin-skeleton
包简介
Skeleton for development of Wordpress plugins using the vAF Wordpress Framework
README 文档
README
Skeleton for development of Wordpress plugins using the vAF Wordpress Framework
Create a new plugin
To create a new plugin simply run composer create-project vonaffenfels/wp-plugin-skeleton <new-plugin-slug>.
Composer will install all required dependencies for you, ask you some questions about your new plugin and will modifiy/create all necessary files for you.
Vendor prefixing
To counter the dependancy conflict problem when using Wordpress plugins that have composer dependencies, we decided to use a technic called "Vendor Prefixing".
Here we create a new namespace where all dependencies can live in.
Take a look at the file src/Plugin.php so see how it works.
While developing, you MUST NOT use the dependency inside the vendor directory but instead
use the dependency inside the vendor_prefixed directory. IDEs will normally show you
the namespace the required class is in. Make sure, that it is prefixed with the namespace
you selected when creating the new plugin.
Best way to make sure you only used the dependencies inside the vendor_prefixed directory,
is to run the command composer install --no-dev after every install. That way all packages
will get removed and will not be found by any IDE.
When you install a new package you MUST require it as a development dependency by
running composer require --dev <package>.
If you need a development dependency that should not be included in the final plugin package,
simply add a new line to the file scoper.inc.php where you mark that packages as ignored.
It will then not be prefixed.
Packaging/Deployment
You MUST always commit the cached dependency injection container (which can be found
in directory container).
To build the container before committing/packaging, simply run composer build-container.
The container will then be updated to the current state.
If you want to deploy your plugin using composer (like in a Bedrock Wordpress environment)
you don't have to do anything special.
If you want to deploy your plugin as ZIP file to use in standard Wordpress installations,
run the command composer install --no-dev to remove all packages from vendor directory.
Then you can ZIP the complete plugin. And don't forget to include the vendor directory.
It contains the necessary autoloader files.
Container building
To rebuild the dependency injection container, simply run composer build-container.
vonaffenfels/wp-plugin-skeleton 适用场景与选型建议
vonaffenfels/wp-plugin-skeleton 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 61 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 08 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 vonaffenfels/wp-plugin-skeleton 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vonaffenfels/wp-plugin-skeleton 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 61
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-08-29