OnPoint Plugins

  • Plugins
    • Advanced Sidebar Menu
      • Basic Version
        • Documenation
        • Usage
        • Developer Docs
      • PRO Version
        • Demo
        • Usage
        • Developer Docs
    • Go Live Update Urls
      • Basic Version
        • Documenation
        • Usage
        • Troubleshooting
      • PRO Version
        • Demo
        • Usage
        • URL History
  • About
    • Services
    • Showcase
  • Blog
  • Contact
  • Support
  • Log In

WordPress-Libs – Version 5.7.0

November 4, 2025

Version 5.7.0 of our WordPress Libs library is now available and ready for general use. This version focused on dialing in the theme resources system and reducing friction when external projects implement unit testing.

Table Of Contents

  1. New DI Container for Singleton Instances
  2. Script Resources Improvements
  3. Null Value Defaults from Meta Repo
  4. Miscellaneous

New DI Container for Singleton Instances

Historically all instances of singleton classes within the library were stored as a static variable within the object itself. This made setting up and using singleton classes simple and quick but had 1 important trade-off. Locally stored instances have to be reset manually in unit tests which call the singleton or may cause testing side effects.

A new, very basic DI container was added to the library to hold the instances and allow resetting them all at once with a single call. Paired with the wp-unit testing library, the container will automatically reset between tests.

The Singleton trait signature has been split out into 2 specific traits.

  1. Instance : A singleton class holding its instance in the container.
  2. Hooks: A singleton class which calls a hook method during init to register WordPress hooks.

Not all classes have yet been migrated to the new container; they will be migrated over time. For now, all common classes with side effects during testing have been migrated.

Script Resources Improvements

The Common scripts enqueuing system has been improved to no longer make assumptions about which types of resources an application has available. Instead of assuming usage of PostCSS and JavaScript, the system is extensible to support any number of resource types. This can be handy for fonts, SASS, or Svelte, just to name a few.

The previously exposed resource type constants have been deprecated in favor of supporting a new get_manifest method from any class implementing the ResourceHandles interface. If the get_manifest method is available, the library no longer does any type of resource to manifest translation. The PCSS_Manifest and JS_Manifest classes are still available, just won’t be automatically mapped.

The individual manifests now control the URL returned for the specific resource type instead of the Enqueue class translating for all. The dist_url call is still routed through the Handle but any translating of the finished URL is done by the manifest.

If you have deprecated errors configured on your local and you are using the Common system, you will see some guidance on migrating to the new improvements. Using the old signature will continue to work until version 6.

Null Value Defaults from Meta Repo

Basically from the beginning of the meta repo system in this library, the PHP docs have explained the default value for get calls will be null unless another default is passed. This is a modern reasonable signature as the PHP language does a good job of providing shortcuts for using null as default values.

It was discovered recently that under some circumstances the underlying calls to WP core functions were returning false instead of null when the value is not available. This has been resolved for both taxonomy singles and meta values. If the value is not available in the database, the default will be null.

There is a minimal chance of side effects to existing projects checking for resulting value against === false. The case is unlikely to exist and PHPStan would have complained about false not being a possible response type.

Miscellaneous

  • Checked WP_User->exists() when using exists on the User_Trait.
  • Improved PHP docs for the show_in_rest param.
  • Removed the @internal designation from the Tax_Query class.
  • Introduced a fluent interface for wp_list_categories.
  • Added basic PHPStan type for register_block_type.
  • Added an exit code of 17 to the exception in the Testing::exit class.

Filed Under: Programming, Published Work, Tools

« Using AI in WordPress Development
Go Live Update Urls – Version 7.1.2 »

Find Something

Categories

Follow Us

Subscribe to get the latest news and updates.

Follow

© 2025 · WordPress Development · Terms Of Service · Privacy Policy · Cookie Policy · Log in

  • Plugins
  • Blog
  • Contact