v1.0.0
Initial release. Requires PHP 8.2+.
Added
- Loaders
AssetLoader— registers scripts, styles and script modules from a build
directory, reading dependencies and versions from the generated
*.asset.phpmanifests, with ahandle()helper for namespaced handles.TemplateLoader— locates and renders templates across the child theme,
parent theme and the package's own directory, honouring WordPress'
locate_template()precedence, with a per-request location cache.ComponentLoader— resolves and renders self-contained component packages
across the same hierarchy and registers their assets on demand. Render and
asset hooks are namespaced per loader context, so one package's listeners
never fire for another's.
- Composition
Containerand theLoadertrait — instantiate a list of classes, register
hooks for anythingRegistrable, and cache anythingShareable.- Contracts:
Registrable,ConditionallyRegistrable,Shareable,
CLICommand. Singletontrait, storing one instance per concrete class so a parent and
subclass never share one.
- Abstract base classes —
AbstractModule,AbstractFeature,
AbstractBlock,AbstractPostType,AbstractTaxonomy,AbstractUserRole,
AbstractShortcode,AbstractAdminPage,AbstractSettingsPageand
AbstractRESTController. - Utilities
Cache— object-cache wrapper with group namespacing and opt-in
stale-while-revalidate.Encryptor— authenticated encryption (AES-256-GCM by default), injectable
per key domain, with akey()seam for sourcing secrets from a KMS or
environment. Secrets of any length are derived to a full cipher-length key.FeatureSelectorandFeatureSelectorSettingsPage— feature flags stored in
a single option, overridable by PHP constants for hard locks.Transients— prefix-namespaced transient access.Timer— named, multi-scope timing.Logger— levelled logging.
- Reference documentation under
docs/, a GPL-2.0-or-laterLICENSE.md, and a
WordPress integration test suite running against@wordpress/env.
Install
composer require rtcamp/wp-framework:^1.0This package is not on Packagist. Add the repository to your composer.json:
{
"repositories": [
{ "type": "vcs", "url": "https://github.com/rtCamp/wp-framework.git" }
]
}Full changelog: CHANGELOG.md