bobbingwide / oik-loader

WordPress Must Use plugin to load required plugins
0 stars 0 forks source link

Add a plugin dependencies map #2

Closed bobbingwide closed 2 years ago

bobbingwide commented 5 years ago

Currently each block is associated with a single plugin which needs to be activated in order for the block to work.
Some blocks have dependencies on other plugins and will not work unless those dependencies are satisfied.
To minimise the plugins that need to be active normally we would need to be able to dynamically load the plugins required to deliver the required functionality.

Requirements

In the table of examples below

Some example use cases below

Post type Name Plugin ref Depends
oik-plugin UK tides - oik
block UK tides oik-blocks -
oik-plugin oik-magnetic-poetry - -
block magnetic-poetry oik-magnetic-poetry -
block_example Magnetic poetry of Hello dolly - hello
oik-plugin woo-gutenberg-products-block - woocommerce

For any plugin listed in the Depends column we would also need to satisfy that plugin's dependencies. WordPress core is a given. The logic will have to cater for cyclical dependencies, but should not concern itself with the order in which the dependencies are satisfied.

This requires a pre-requisite change to the oik-plugins and oik-shortcodes plugins to register the _oikp_dependency field for oik-plugins, block and block_example.

Proposed solution

bobbingwide commented 2 years ago

I think this can now be closed. oik-loader v1.2.0 is latest version on wp-a2z.org