You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently a lot of themes and plugins have dependencies that are not required to run WonderCMS core. For example, a lot of themes I've created use php's DOMDocument. This mostly isn't a problem, since most shared hosts have this installed by default. But when one of these themes is installed, the whole site breaks and someone would need to go and delete the plugin/theme via ftp.
I would suggest some way to define dependencies from a theme or plugin. Either through a extra file, just like description and version, or by registering them through a php function.
I would also suggest the possibility to require plugins. This could make bundling dependencies that get used by multiple plugins easier, and less heavy on the disk. (e.g. a plugin that includes a icon font, and a theme could require this to be installed)
These will be read when installing, and the plugin will fail to install when these requirements are not met. With the plugin requirements we could maybe install the required plugin and try again.
Or via the plugin.php or functions.php in a theme:
This would be the first few lines of code in the file, and the plugin will stop loading if the requirements are not met.
My preference would go to the first option, since that would give people the option to delete a required plugin after installing if they know what they are doing. (When not using the icon font for example)
I think that this is a feature that has to be implemented into core, since a lot of plugins would require something like this. I'll take a look at what I can do with the core as a proof of concept.
The text was updated successfully, but these errors were encountered:
robiso
changed the title
[feature-request] Dependency handling.
[Feature request] Dependency handling
Aug 11, 2020
Currently a lot of themes and plugins have dependencies that are not required to run WonderCMS core. For example, a lot of themes I've created use php's DOMDocument. This mostly isn't a problem, since most shared hosts have this installed by default. But when one of these themes is installed, the whole site breaks and someone would need to go and delete the plugin/theme via ftp.
I would suggest some way to define dependencies from a theme or plugin. Either through a extra file, just like
description
andversion
, or by registering them through a php function.I would also suggest the possibility to require plugins. This could make bundling dependencies that get used by multiple plugins easier, and less heavy on the disk. (e.g. a plugin that includes a icon font, and a theme could require this to be installed)
Example of a
requirements
file:These will be read when installing, and the plugin will fail to install when these requirements are not met. With the plugin requirements we could maybe install the required plugin and try again.
Or via the
plugin.php
orfunctions.php
in a theme:This would be the first few lines of code in the file, and the plugin will stop loading if the requirements are not met.
My preference would go to the first option, since that would give people the option to delete a required plugin after installing if they know what they are doing. (When not using the icon font for example)
I think that this is a feature that has to be implemented into core, since a lot of plugins would require something like this. I'll take a look at what I can do with the core as a proof of concept.
The text was updated successfully, but these errors were encountered: