Plugin System

Plugin System

por Martin Denyer -
Número de respostas: 23

Hi everyone, thanks for having me!

I wanted to ask if anyone else has concerns about Moodle's plugin system. Currently, updating a Moodle instance can take a longtime, mainly because of the many different directories involved. Wouldn’t it make more sense to have a single folder for plugins? I believe this would offer these benefits:

  1. Simplified updates
    Right now, hosting engineers have to search through multiple directories to find all their plugins, since Moodle stores core features and plugins together. This makes it hard to identify what needs to be transferred during an update.

    If all plugins were stored in a single directory, updating would be as simple as copying that folder, ensuring all plugins are transferred correctly and avoiding the risk of overwriting core features with outdated versions.

  2. Improved Docker utilization
    With the current setup, the entire Moodle instance needs to be persisted, which can be inefficient. By having a dedicated plugin directory, only that folder would need to be persisted, making Docker-based hosting more streamlined.
    Additionally, the config.php file wouldn’t need to be persisted either. Instead, it could leverage environment variables and secrets which would also significantly enhance security by preventing the storage of sensitive information in plain text.

is this something that could be considered?

Em resposta a 'Martin Denyer'

Plugin System

por Eduardo Kraus -
Foto de Particularly helpful Moodlers Foto de Plugin developers Foto de Testers

Hello, Martin! 🌟

Moodle is designed to maintain an organized structure where each plugin occupies its own space. This helps avoid conflicts and ensures that each functionality integrates correctly with the system. Imagine a large toolbox: if everything is mixed up, it becomes difficult to find what you need!

Keeping plugins in separate directories helps ensure that when updating, you can easily identify which plugins need attention. If they were all in a single directory, it would be a greater challenge to identify potential incompatibilities between plugin versions and the core of Moodle.

I understand that the idea of simplifying the update process is tempting, but I believe that the current system, with its organized directories, provides a structure that offers more long-term benefits.

Eduardo Kraus
Teacher and programmer

Em resposta a 'Eduardo Kraus'

Re: Plugin System

por Eduardo Kraus -
Foto de Particularly helpful Moodlers Foto de Plugin developers Foto de Testers
Although containers are lighter than virtual machines, there is still a certain performance overhead, especially in applications that require high performance.

Therefore, moving Moodle to Docker for the few who use it is not a good idea.
Em resposta a 'Eduardo Kraus'

Re: Plugin System

por Howard Miller -
Foto de Core developers Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Peer reviewers Foto de Plugin developers
I'm struggling to understand what this means. There are some great use-cases for Moodle running in containers. There was a HUGE thread about this, recently, which I don't want to start up again.
Em resposta a 'Eduardo Kraus'

Re: Plugin System

por Emma Richardson -
Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Plugin developers
I disagree totally with this response and have said many times that we need to move additional plugins to their own singular location.
Keeping plugins in separate directories make them much harder to identify, not easier.
If we had a single plugin folder for additional plugins, this would be so much easier. Upgrading would just involve moving a single folder over instead of having to search through so many plugin folders.
I do not see why their location in the file structure affects identifying if they need attention upon upgrading or not.
Em resposta a 'Emma Richardson'

Re: Plugin System

por Visvanath Ratnaweera -
Foto de Particularly helpful Moodlers Foto de Translators
Is Moodle App Plugins API Reference a phantasm? I think the developers tell a different story than the mere user.
Em resposta a 'Visvanath Ratnaweera'

Re: Plugin System

por Howard Miller -
Foto de Core developers Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Peer reviewers Foto de Plugin developers
I'm confused. We're not talking about the Moodle App, are we?
Em resposta a 'Howard Miller'

Re: Plugin System

por Visvanath Ratnaweera -
Foto de Particularly helpful Moodlers Foto de Translators
Em resposta a 'Visvanath Ratnaweera'

Re: Plugin System

por Howard Miller -
Foto de Core developers Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Peer reviewers Foto de Plugin developers
Yeh - but I think the point is that the whole lot should be moved under a 'plugins' directory. So you would have 'plugins/auth', 'plugins/local', 'plugins/enrol' and so on. Which would make dealing with plugins an order of magnitude easier.
Em resposta a 'Martin Denyer'

Re: Plugin System

por Howard Miller -
Foto de Core developers Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Peer reviewers Foto de Plugin developers
Yeh - it would make a load of things a lot easier. Now what?

Back in the day there was a weekly post saying something like, "I'm going to rewrite Moodle in Java". Hopefully, you take my point piscar o olho
Em resposta a 'Howard Miller'

Re: Plugin System

por Emma Richardson -
Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Plugin developers
Em resposta a 'Emma Richardson'

Re: Plugin System

por Howard Miller -
Foto de Core developers Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Peer reviewers Foto de Plugin developers
Em resposta a 'Howard Miller'

Re: Plugin System

por Marcus Green -
Foto de Core developers Foto de Particularly helpful Moodlers Foto de Plugin developers Foto de Testers
There is a tracker item for this but I cannot find it in the hell that is the tracker search capabilities. I vaguely worked on things linked to this, for example I have code somewhere that is designed to copy/move the contents of all "contrib" code to another folder. But then ooh look a squirrel/AI came along.
Em resposta a 'Marcus Green'

Re: Plugin System

por Howard Miller -
Foto de Core developers Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Peer reviewers Foto de Plugin developers
Jira == industry standard piscar o olho
Em resposta a 'Howard Miller'

Re: Plugin System

por Marcus Green -
Foto de Core developers Foto de Particularly helpful Moodlers Foto de Plugin developers Foto de Testers
Em resposta a 'Marcus Green'

Re: Plugin System

por Emma Richardson -
Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Plugin developers
Darn it - that one is cancelled - let's resurrect it!
Em resposta a 'Martin Denyer'

Re: Plugin System

por Ken Task -
Foto de Particularly helpful Moodlers

To ease the current pain, I wonder if an improvement to admin/cli/uninstall_plugins.php could be made to show paths when using the script?

'SoS', Ken

Em resposta a 'Ken Task'

Re: Plugin System

por Emma Richardson -
Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Plugin developers
I think the whole point is that it would make much more manageable and more like every other system out there if all contributed plugins were in one folder. Not everyone uses cli and it is not about uninstalling - it is just about overall ease of use. This would make it easier for any sort of site management - cli/web gui/host with file manager, etc
Em resposta a 'Emma Richardson'

Re: Plugin System

por Ken Task -
Foto de Particularly helpful Moodlers

I do understand the issue ... and the 'pain'.  Recently spent more time sorting out plugins on a broken moodle than anything else.   Pain in the arse!

Guess you've never used the un-install script ... it doesn't have to be used for un-installing ... can be used to id addons ... 

Yes, it's CLI only, but ... IMHO, any admin of a moodle that can't do a little CLI is greatly limiting themselves!

'Spirit of Sharing', 

Ken

Em resposta a 'Martin Denyer'

Re: Plugin System

por Howard Miller -
Foto de Core developers Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Peer reviewers Foto de Plugin developers
It could even be a gradual process. Each subsystem would have to start looking in two places for plugins, anyway. So start with an option to place (for example) themes in either 'themes/' or 'plugins/themes' and so on. In a few versions time, when all the dust has settled, move to 'plugins/' only.

I'm not saying it's simple sorriso