Releases: weDevsOfficial/wp-utils
Releases · weDevsOfficial/wp-utils
v2.0.0
What's New
Eloquent-inspired ORM for WordPress
- Model — Abstract base with configurable hook prefix, attribute accessors/mutators, casting, dirty tracking, CRUD operations, and hydration
- QueryBuilder — Fluent SQL builder with WHERE (basic, in, notIn, null, notNull, between, raw, or), ORDER BY, LIMIT/OFFSET, aggregates (sum, avg, max, min), pagination, and bulk operations
- Collection — Typed collection implementing Countable, IteratorAggregate, ArrayAccess, and JsonSerializable
- Model Traits —
SoftDeletes,HasTimestamps,HasHash - Helper functions —
wputils_class_uses_recursive(),wputils_trait_uses_recursive()
Trait Improvements (Breaking)
- Renamed:
ContainerTrait→Container,HookTrait→Hooks,LogTrait→Logger,SingletonTrait→Singleton - Container — Added
__isset()and__unset()support - Singleton — Fixed shared instance bug; now uses per-class instance isolation
- Logger — Added context data parameter, class name in output,
log_warning(), andWP_DEBUGgate for debug messages
Tooling
- PHPStan level 6 with
szepeviktor/phpstan-wordpress - PHPUnit 9.6 with Brain\Monkey + Mockery (209 tests, 393 assertions)
- PHP-CS-Fixer with WordPress coding standards
- Composer scripts:
test,analyse,format,lint
Documentation
- Full ORM documentation in
docs/models.md - Updated README with ORM examples
Breaking Changes
- Traits renamed — update
usestatements:ContainerTrait→ContainerHookTrait→HooksLogTrait→LoggerSingletonTrait→Singleton
- Minimum PHP version: 7.4