Gaps Anaylsis: Installing Multiple Plugins until OJS 3.5.0-6
Abstract. OJS 3.5 installs plugins one at a time and has no notion of installing multiple plugins or one plugin depending on another. A journal that needs a set of plugins (a theme, metadata exporters, statistics, a block or two) must therefore order, activate and verify them itself. This article explains how OJS 3.5 decides that a plugin is installed, what happens when a set is installed in the wrong order, and a procedure that has held up on production upgrades. The source-code findings were checked against pkp-lib stable-3_5_0 (commit b0f7eae) and main (3.6, commit f2c2784) on 20 November 2026 [1, 2].
1. What „installed“ means in OJS 3.5
OJS treats a plugin as installed when two things agree: a row in the versions table (product_type such as plugins.generic, current = 1) and a folder at plugins/<category>/<name>/. The Plugin Gallery combines both into one status [3]:
| Status | Condition |
|---|---|
| Available | no versions row |
| Newer | installed release is newer than the gallery’s |
| Upgradable | installed release is older, or the row exists but the folder is missing |
| Current | same release and the folder exists |
Installed is not the same as enabled. Enabling is stored per journal as the enabled setting in plugin_settings [8]. A freshly installed plugin is therefore switched off in every journal.
OJS has no way to declare that one plugin needs another. A plugin’s version.xml may contain only application, type, release, tag, date, lazy-load, sitewide and class [5]. The gallery schema records only compatibility with an OJS release and a certification level [9].
2. Installing several plugins
Each gallery install runs the same six steps: download the package, check its MD5, unpack it and read version.xml, copy it to plugins/<category>/<name>/, run its install.xml against the database, and write the versions row [4, 10]. If either of the last two steps fails, the copied folder is deleted again. A second install of a plugin that already has both a row and a folder is refused, with „please upgrade“ or „newest version already installed“ [4]. On the command line, php lib/pkp/towasols/installPluginVersion.php path/to/version.xml registers a plugin whose files are already in place [12].
Only site administrators may install; journal managers can only enable and configure [14]. The gallery offers only releases marked compatible with the running OJS version, but an uploaded .tar.gz is not checked for compatibility [20]. No bulk installer exists: the gallery, the upload form and the CLI tool all handle one plugin per action. The closest thing to a batch is the upgrade script, whose last step, addPluginVersions, writes a versions row for every plugin found on disk [18]. OJS 3.5 requires PHP 8.2, and the current release is 3.5.0-6 LTS (November 2026) [15, 19].
Nothing in this process looks at other plugins. If plugin B needs code from plugin A and A is missing, B still installs. What happens next depends on where B touches A’s code [6, 7]:
- In
register()or the class definition (for exampleextendsa class from A): the error is caught and logged as „failed to be registered“. B is silently not loaded, and administrators see no message. - In a hook callback: only that callback fails; the page still renders.
- In a page handler, template or
install.xml: the error is not caught. Readers get HTTP 500, or B’s installation fails and its folder is removed.
Installing A afterwards does not repair B on its own: A arrives disabled. Once an administrator enables A in the journal, both load on the next request and B works without being reinstalled. The exception is a B whose install.xml needed A’s tables; that install already failed and must be repeated. Plugins in a category also load in getSeq() order, so B should look A up only after PluginRegistry::categoryLoaded::generic fires, not inside its own register() [6].
3. Pitfalls seen in practice
These come from two production upgrades for AEGIS-OA [25].
- Orphaned registry rows. The
versionstable keeps rows for plugins whose code was removed years ago, and an upgrade adds more rather than cleaning them up. On OJS 3.3 the Plugins tab returned HTTP 500 on them. OJS 3.5 skips a row without code silently, and the gallery lists that plugin as Upgradable [3, 6]. Match orphans by plugin name acrossplugins/andlib/pkp/plugins/, never by registry category: some apparent orphans had only moved category (usageStats,counter,crossref,pubmed,browse). - Themes outside core. OJS 3.5 ships only the
defaulttheme; Bootstrap3, Classic, Health Sciences and others come from the gallery. On 3.3 a missing active theme caused HTTP 500 on every page. - Local edits overwritten. A gallery upgrade deletes the plugin folder before copying the new release, and an install over a folder with no
versionsrow writes over it [4]. - Case-sensitive block names. The sidebar setting is a list of block names, looked up as exact array keys [24].
WebFeedBlockPluginkeeps its CamelCase class name [22], whileInformationBlockPlugininherits the lowercase default,informationblockplugin[8]. A wrong case fails silently. - Partial upgrades. Skipped schema steps in a 3.3.0.21 → 3.5.0.3 upgrade left keyword saves failing with MySQL error 1364. Check the upgrade log for „Successfully upgraded“ as well as the exit code. In OJS 3.3,
tools/upgrade.phpexits 0 even when the upgrade fails; 3.5 exits 2 [21].
4. Putting it into practice
The findings leave four gaps to close: OJS has no dependency field, installing does not enable, failures go only to the log, and upgrades replace folders. Each gap needs its own step, whether an administrator does the work or a tool does.
By hand. Keep a short dependency list (plugin, category, minimum release, what it requires), then work through it with these commands:
1. Gallery releases compatible with this OJS, with install status
php lib/pkp/tools/plugins.php list
2. Registry rows without a folder (orphans), matched by name
mysql -N ojs -e "SELECT product_type, product FROM versions
WHERE current=1 AND product_type LIKE 'plugins.%'" |
while read type product; do
find plugins lib/pkp/plugins -mindepth 2 -maxdepth 2 -type d \
-name "$product" | grep -q . || echo "orphan: $type $product"
done
3. Providers first; the CLI route skips the compatibility check
tar xzf provider.tar.gz -C plugins/generic/
php lib/pkp/tools/installPluginVersion.php plugins/generic/provider/version.xml
4. What is enabled, per journal
mysql ojs -e "SELECT plugin_name, context_id FROM plugin_settings
WHERE setting_name='enabled' AND setting_value='1'"
5. Plugins that failed without a message
grep -E "failed to be registered|Instantiation of the plugin" php_errors.log
6. Local edits that an upgrade would delete
diff -r plugins/themes/bootstrap3 /tmp/bootstrap3-newAfter step 4, enable providers first in each journal. Then open each feature’s page (sidebar, OAI, a /download/ URL); the plugin list alone proves nothing.
In a tool. An installer plugin for plugin sets can automate the same steps with the 3.5 classes:
- Ship the dependency manifest with the tool and install in topological order [5, 9].
- Read status with
PluginGalleryDAO::getNewestCompatible()andGalleryPlugin::getCurrentStatus(). These also flag a row without a folder as Upgradable [3, 20]. - Install by repeating the gallery handler’s steps: download, compare the MD5, then
PluginHelper::installPlugin(), which removes the folder again on failure [4, 10]. Allow it for site administrators only, as the gallery does [14]. - Enable providers first, in every journal, with
$plugin->updateSetting($contextId, 'enabled', true, 'bool').setEnabled()covers only the current journal [8]. - Check dependencies after
PluginRegistry::categoryLoaded::genericfires, and show administrators a report; OJS itself only logs [6]. - Before an upgrade, compare the installed folder with the release and stop on differences, because
upgradePlugin()deletes the folder first [4].
These classes are not an official API, and 3.5 has no hook that runs before files are copied [13]. In OJS 3.6 the tool must also respect [security] allow_plugin_install (on, gallery_only, upgrade_only, off) [11].
References
- pkp-lib, branch
stable-3_5_0, commit b0f7eae. GitHub. https://github.com/pkp/pkp-lib/tree/b0f7eaecc220cba9a0e1ad50556378cc3c6d16dd - pkp-lib, branch
main(3.6), commit f2c2784. GitHub. https://github.com/pkp/pkp-lib/tree/f2c2784895bdc7c14fc1565f441119b5a83c3617 GalleryPlugin::getCurrentStatus(). pkp-lib. GalleryPlugin.php#L356-L377PluginHelper::installPlugin()andupgradePlugin(). pkp-lib. PluginHelper.php#L105-L148- Plugin version DTD. pkp-lib. dtd/pluginVersion.dtd
PluginRegistry(registration, instantiation, load order). pkp-lib. PluginRegistry.php#L83-L91Hook(callback error handling). pkp-lib. Hook.php#L163-L201LazyLoadPlugin::getName()andgetEnabled(). pkp-lib. LazyLoadPlugin.php#L48-L73- Plugin Gallery (
plugins.xml,plugins.xsd). GitHub, 2026. https://github.com/pkp/plugin-gallery PluginGalleryGridHandler::installPlugin(). pkp-lib. PluginGalleryGridHandler.php#L284-L328- „Add support for a configuration option to lock down plugin installation“, pkp-lib issue #12181, 2026. https://github.com/pkp/pkp-lib/issues/12181
tools/installPluginVersion.php. pkp-lib. installPluginVersion.phpInstallerhooks (preInstall,postInstall,updateVersion). pkp-lib. Installer.php#L182- Plugin Inventory. PKP Docs. https://docs.sfu.ca/plugin-inventory/en/
- OJS/OMP/OPS 3.5 Release Notebook, 2025. https://docs.sfu.ca/dev/release-notebooks/en/3.5-release-notebook
- Upgrade Guide. PKP Docs. https://docs.sfu.ca/dev/upgrade-guide/en/
- Plugin Guide: Release a Plugin, 2025. https://docs.sfu.ca/dev/plugin-guide/en/release
- OJS
dbscripts/xml/upgrade.xml(addPluginVersions), branchstable-3_5_0. upgrade.xml - Download OJS (3.5.0-6 LTS, released 1 November 2026). https://sfu.ca/software/ojs/download/
PluginGalleryDAO(compatibility filtering). pkp-lib, branchstable-3_5_0. PluginGalleryDAO.phpUpgradeToolexit codes: 3.5 UpgradeTool.php#L97-L111; 3.3 UpgradeTool.inc.phpWebFeedBlockPlugin::getName(). pkp/webFeed, commit 3eec193 (the OJS 3.5 submodule). WebFeedBlockPlugin.php#L30-L33- „PHP fatal error after upgrade when the current theme plugin is missing“, pkp-lib issue #11396, fixed in 3.4.0-10, 2025. https://github.com/pkp/pkp-lib/issues/11396
PKPTemplateManager::displaySidebar(). pkp-lib. PKPTemplateManager.php#L1611-L1630- https://edch.eu/aegis-oa
Disclaimer
Part of the texted was checked,formatted , grammar corrected and verified with the help of DeepL and ChatGPT
#OJS #openJounralSystems #plugins #aegeisOa