What is the best way to integrate a common library (like a framework) across multiple WordPress themes and plugins? Try to answer this from the library developer point of view. Keep in mind that this library is intended to be used by many users and for many plugins and themes.
As an external plugin - Create a plugin that will be loaded before all other plugins to initiate the common library. Create a WordPress plugin repository and update it occasionally.
- Pros - The library is more likely to stay updated.
- Cons - Requires the user to install another plugin just to use the theme/plugin that depends on that common library.
As a part of the depending theme/plugin - Include the library files inside the plugin/theme files.
- Pros - No additional plugin installation is required.
- Cons - Requires the depending plugin/theme to issue an update every time the library is updated. Ma create a conflict if different versions of the library exists within the same WordPress installation.
Are there any other ways? How would you do it?