First I like to propose a simplification in the "plugin" installer script and *not* store any -stale- plugins, just forget/ignore older plugin versions. I think that is less confusing for the end-user.
Next, I would like to make a feature request to the "plugin" manager which allows plugins to be installed as "system plugin", meaning they get installed in the directory '/boot/plugins' instead of '/boot/config/plugins'.
To make this work an additional attribute can be introduced, see example below
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name "webGui">
<!ENTITY author "Bergware">
<!ENTITY version "3.0.0">
<!ENTITY category "Core Functionality">
<!ENTITY pluginURL "https://raw.github.com/...">
]>
<PLUGIN name="&name;"
author="&author;"
version="&version;"
category="&category;"
pluginURL="&pluginURL;"
system="true">
The new attribute 'system' defaults to 'false' but can be set to 'true' to have the plugin installation changed.
This requires an update to the "plugin" installer script, for example:
// register successful install
// absence of "configfile" attribute indicates normal plugin; presence indicates a VM plugin
$configfile = plugin("configfile", $plugin_file, $error);
if ($configfile === false) {
// Bergware change: add user or system plugin selection
$system = plugin("system", $plugin_file, $error);
$target = $system === false ? "/boot/config/plugins/$plugin" : "/boot/plugins/$plugin";
if ($target != $plugin_file) copy($plugin_file, $target);
symlink($target, "/var/log/plugins/$plugin");