Writing a code for Moodle Plugin: where to start?

Writing a code for Moodle Plugin: where to start?

by Wouter de Jong -
Number of replies: 4
Just out of curiosity (and maybe future development) I would like to learn how to write code for Moodle plugins. Where can I start best?

I am a bit familiar with JavaScript, HTML(5), CSS, MySQL and PHP but at a beginners level.


Average of ratings: -
In reply to Wouter de Jong

Re: Writing a code for Moodle Plugin: where to start?

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Another good idea to go along with the link Howard posted, create yourself a github account and dive right in.

  • Make a fork of someones plugin that has not been updated to the latest Moodle and try to make it work with the latest Moodle.
  • Find a plugin that is not listed as being compatible with PHP 7 and figure out what needs to be done to fix any debug messages. MANY of them will have multiple Deprecated warnings due to changes in PHP 7. (Click on the link for Learn More to see software supported details.)
  • Adopt a plugin looking for a new maintainer and, if needed, bring it up to date. https://moodle.org/plugins/browse.php?list=set&id=61
Average of ratings: Useful (5)
In reply to Wouter de Jong

Re: Writing a code for Moodle Plugin: where to start?

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Where can I start best?

Additionally to all other good suggestions above, I would recommend to start with setting the Moodle debugging level to DEBUG_DEVELOPER smile It may sound obvious but the experience says that many plugins authors simply do not pay attention to thrown notices.

Average of ratings: Useful (3)
In reply to David Mudrák

Re: Writing a code for Moodle Plugin: where to start?

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Get some kind of Integrated Development Environmnet. I use Netbeans (its free). Apart from the nice editor these will allow you to drill down through the code to find useful things and to easily search for bits of functionality. The pop up list of things available to objects can be very useful as well (see screen shot attached)
Attachment ide.png
Average of ratings: Useful (2)