Shared library management for WordPress plugins.
Features
- Supports sharing of libraries between plugins
- Easy to use API
- For plugins with dependencies
- For plugins that provide libraries
- Allows mixing and matching of plugins
- Optionally, runs as a Must Use (MU) plugin
Overview
The oik-lib plugin for shared libraries allows multiple plugins to deliver a common set of library functions that can be shared by other plugins.- Each participating plugin implements its own dependency on certain common functionality
- Until a dependency is satisfied a plugin’s function is limited
- A plugin may choose to deliver a certain a level of functionality by delivering the shared libraries itself
- The API makes it easy for each plugin to:
- Indicate which libraries it provides
- Request libraries
- Be informed when libraries have been loaded
Background
- The oik-bwtrace plugin implements debug trace facilities for WordPress
- It was closely coupled with the oik-base plugin
- It used common functions for the admin interface
- But it didn’t really need to depend upon the oik plugin
- In fact, there were certain components that could be configured to operate without an admin interface
- oik-bwtrace v2.0.0 was developed to be a standalone version; it operates without needing the oik base plugin
- The common logic was decoupled and reconnected through the functions provided by the oik-lib plugin
- Both the oik base plugin and oik-bwtrace were developed so that they could operate independently of each other
- Both were developed to integrate with the oik-lib plugin
Current situation
- The oik-lib plugin now has the capability to provide the packaged functionality required by plugins that were previously totally dependent upon oik
- Rather than explicitly requesting files from a particular location, plugins can request shared library functionality
Planned enhancements
- Integration with Composer to help manage the build time library dependency resolution
- Migration of plugins which currently depend upon the oik base plugin to use shared libraries
- Shared library functionality to be delivered by 3rd party plugins and/or libraries