pcfreak30 / wordpress-plugin-framework
A small WordPress plugin runtime boundary
Package info
github.com/pcfreak30/wordpress-plugin-framework
pkg:composer/pcfreak30/wordpress-plugin-framework
Requires
- composepress/dice: ^0.1.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-master
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.1
- 0.1.0
- dev-chore/configurable-scope-prefix
- dev-feat/upgrade-migrations
- dev-chore/scoped-build-ci
- dev-test/scoped-artifact-compat
- dev-feat/hook-removal
- dev-feat/requirements-diagnostics
- dev-refactor/lifecycle-capabilities
- dev-fix/boot-failure-state
- dev-chore/scoped-build
- dev-feat/composepress-modernization
This package is not auto-updated.
Last update: 2026-09-13 14:33:21 UTC
README
ComposePress Core is a small runtime boundary for WordPress plugins. It coordinates explicit plugin metadata, hook subscribers, and plugin lifecycle handlers without imposing a domain model or dependency container.
Requirements
- PHP 8.2 or newer
- WordPress loaded before WordPress-specific context or hook operations
Bootstrap
use ComposePress\Core\Plugin; use ComposePress\Core\PluginContext; use ComposePress\Core\WordPressHooks; $plugin = new Plugin( context: new PluginContext(__FILE__, 'example-plugin', '1.0.0'), subscribers: [new RegisterContentTypes()], hooks: new WordPressHooks(), ); $plugin->boot();
Subscribers receive their application dependencies through constructors and register only WordPress adapters. Business services do not need to depend on ComposePress.
Lifecycle capabilities are opt-in and independent. Implement PluginActivator for activation work and PluginDeactivator for deactivation work; uninstall remains a separate static PluginUninstall contract. Pass only the capabilities the plugin needs:
Requirements are explicit checks that run before subscribers are registered. Each PluginRequirement returns a RequirementResult; unmet results are reported through RequirementsNotMet instead of silently skipping boot.
$plugin = new Plugin( context: new PluginContext(__FILE__, 'example-plugin', '1.0.0'), requirements: [new RequiresWooCommerce('8.0')], );
$plugin = new Plugin( context: new PluginContext(__FILE__, 'example-plugin', '1.0.0'), activator: new InstallPlugin($migrator), deactivator: new DisablePlugin($scheduler), uninstaller: UninstallPlugin::class, );
Development
composer install
composer test
composer analyse
This is a clean-slate rewrite. The historical API and implementation are retired.