Skip to content

Releases: weDevsOfficial/wp-utils

v2.0.0

14 Mar 05:08

Choose a tag to compare

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 TraitsSoftDeletes, HasTimestamps, HasHash
  • Helper functionswputils_class_uses_recursive(), wputils_trait_uses_recursive()

Trait Improvements (Breaking)

  • Renamed: ContainerTraitContainer, HookTraitHooks, LogTraitLogger, SingletonTraitSingleton
  • 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(), and WP_DEBUG gate 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 use statements:
    • ContainerTraitContainer
    • HookTraitHooks
    • LogTraitLogger
    • SingletonTraitSingleton
  • Minimum PHP version: 7.4

v1.1

06 Jun 13:40

Choose a tag to compare

Fixed the container setter method.

v1.0

06 Jun 13:20

Choose a tag to compare

Initial release with few Traits:

  • ContainerTrait
  • HookTrait
  • LogTrait
  • SingletonTrait