sherv/wp-plugin-foundation
最新稳定版本:v1.0.0
Composer 安装命令:
composer require sherv/wp-plugin-foundation
包简介
A structured foundation for building maintainable WordPress plugins using modern PHP practices, service providers, a DI container, and lifecycle management.
README 文档
README
A foundation package for building structured, maintainable WordPress plugins using modern PHP practices.
Requirements
- PHP 8.2+
- Composer
- WordPress
Installation
composer require sherv/wp-plugin-foundation
Quick Start
use Sherv\Foundation\Plugin; $plugin = Plugin::new( __FILE__ ) ->with_plugin_properties() ->with_providers() ->build(); register_activation_hook( __FILE__, [ $plugin, 'on_plugin_activation' ] ); register_deactivation_hook( __FILE__, [ $plugin, 'on_plugin_deactivation' ] ); add_action( 'plugins_loaded', [ $plugin, 'boot' ] );
Documentation
- Introduction: Overview, features, and quick start.
- Getting Started: Step-by-step setup for a new plugin.
- Architecture: Components overview and UML diagram.
- Plugin Builder: Builder API, paths, and plugin properties.
- Service Providers: Creating, registering, and booting providers.
- Plugin Lifecycle: Activation, deactivation, and boot process.
- Container: Accessing the DI container and resolving services.
- Requirements Validation: Pre-boot environment checks.
- Exceptions: Error handling reference.
Development
git clone https://github.com/shervElmi/wp-plugin-foundation.git
cd wp-plugin-foundation
composer install
Scripts
| Command | Description |
|---|---|
composer test |
Run the test suite |
composer test:coverage |
Run tests with code coverage |
composer lint |
Run PHP CodeSniffer |
composer format |
Auto-fix coding standards violations |
Contributing
Contributions are welcome. Please open an issue or pull request on GitHub.
Security
To report a security vulnerability, please see SECURITY.md.
Changelog
See CHANGELOG.md for a history of notable changes.
License
© Sherv Elmi. Licensed under the MIT License. Distributed without any warranty. See the license for details.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-01