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
To minimise the number of plugins loaded by default
To dynamically load the required plugins for a particular post.
In the table of examples below
Plugin ref (_oik_sc_plugin ) is the delivering plugin set for each block
Depends on (_oikp_dependency ) records the component dependencies; the additional plugins needed to satisfy the request. May be set for oik-plugins, block and block_example CPTs.
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
Add a component-dependencies CSV file, built from the posts in oik-plugins, which contains the list of plugins referenced in the Depends on field.
The file will be keyed by the plugin name.
Each record will list the dependent plugins - comma separated
e.g.
Update the entries in the oik-loader.n.csv file for block and block_example to include the comma separated list of dependencies.
So, for the block_example "Magnetic poetry of Hello dolly" the record would be
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
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
andoik-shortcodes
plugins to register the_oikp_dependency
field foroik-plugins
,block
andblock_example
.Proposed solution
oik-plugins
, which contains the list of plugins referenced in theDepends on
field.oik-loader.n.csv
file forblock
andblock_example
to include the comma separated list of dependencies. So, for the block_example "Magnetic poetry of Hello dolly" the record would be