Download the PHP package wp-media/plugin-family without Composer
On this page you can find all versions of the php package wp-media/plugin-family. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wp-media/plugin-family
More information about wp-media/plugin-family
Files in wp-media/plugin-family
Package plugin-family
Short Description Organizes and displays WP Media plugin family across other members.
License GPL-3.0-or-later
Informations about the package plugin-family
Plugin Family
This package bundles the WP Media plugin collection within a single plugin.
Functionality
This package gathers essential data about each member plugin and provides their installation and activation links, similar to the Imagify Partner package. It returns an installation link for plugins that are not installed, and an activation link for those that are installed but not active. For Imagify, the link generated by the Imagify Partner package is used.
PS: The Imagify Partner package needs be installed along side. refer here for more information.
Installations & Configurations
Mozart
It is strongly advised that this package is loaded using Mozart. This is to avoid package conflicts where the same package is being used in another plugin and loaded from the same namespace. So please, take the pain to install mozart as a development dependency of your plugin:
composer require coenjacobs/mozart --dev
- After installation, now you are set to configure mozart: see here or simply refer to how it's done on wp-rocket here, there's no shame.
- Lastly setup (post install & update) scripts as done here
Package
Now for the package, we need to come back to composer.json file again.
- Remember the
extra
key we added while setting up mozart some minutes ago, Bingo! Add a new property in it like this:"plugin_domain": "your_text_domain"
. Replaceyour_text_domain
with your actual text domain. e.g for WP Rocket, it'srocket
-
Now again, remember the (post install & update) script we also created, we'll add new properties there also like this:
Replace
Mozart\\dep_namespace
with thedep_namespace
you configured for mozart earlier.PS: The example above doesn't not take into consideration the mozart scripts. so don't copy directly and overwrite your scripts.
- Finally, install using composer:
composer require wp-media/plugin-family
Usage Instructions
- Import the model that holds the filtered data into your view class.
The model returns an array with 2 keys ( categorized & uncategorized ). This for plugins like WP Rocket that needs to display the plugins by category.
- The categorized version has the plugins grouped by their categories.
- The uncategorized version is the reverse of the former.
Next, we need to invoke the controller responsible for managing the installation and activation. This controller has a corresponding interface that needs to be implemented.
The methods ( install_activate
& display_error_notice
) are required.
PS: This example is based on the assumption that your plugin utilizes EDA. If EDA is not implemented, you can iterate through the events returned by PluginFamily::get_subscribed_events()
and use add_action
accordingly.
Development & Testing
To facilitate development and testing of the package, it is recommended to specify a development branch in the composer.json file of your project.
Taking WP Rocket as example
PS: Always have the dev prefix before the actual branch.