Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Plugin validation: Difference between revisions

From MoodleDocs
mNo edit summary
Line 6: Line 6:
* The subfolder must be laid out in such a way that the uploaded file could be unzipped directly into the top-level folder for that plugin type (e.g. an activity plugin called 'myplugin' should install correctly when unzipped in the Moodle /mod folder, creating a subfolder /mod/myplugin with all the standard files within it).
* The subfolder must be laid out in such a way that the uploaded file could be unzipped directly into the top-level folder for that plugin type (e.g. an activity plugin called 'myplugin' should install correctly when unzipped in the Moodle /mod folder, creating a subfolder /mod/myplugin with all the standard files within it).
* The subfolder must contain a file called [[version.php]] (follow the link for more details about what should be contained within that file).
* The subfolder must contain a file called [[version.php]] (follow the link for more details about what should be contained within that file).
* (Recommended) the subfolder should contain a file called README (or README.txt) with details about the current release of the plugin.
* (Recommended) the subfolder should contain a file called README.txt (the validator can automatically rename README to README.txt) with details about the current release of the plugin.
 
==Database tables==
==Database tables==



Revision as of 20:10, 14 December 2011

Before a plugin can be made available via the Modules and plugins database it has to pass both an automatic and a manual validation process. This is repeated for each new version of the plugin that is added.

Automatic validation

The exact rules for the validation depends on the type of plugin being validated, but there are some general rules that apply to all plugins:

  • The plugin must be uploaded as a single zip file
  • The zip file must contain a single subfolder, named after your plugin (although the validator can also automatically rename subfolders generated by repos such as GitHub, which appear in the form 'username-moodle-pluginname-branchname')
  • The subfolder must be laid out in such a way that the uploaded file could be unzipped directly into the top-level folder for that plugin type (e.g. an activity plugin called 'myplugin' should install correctly when unzipped in the Moodle /mod folder, creating a subfolder /mod/myplugin with all the standard files within it).
  • The subfolder must contain a file called version.php (follow the link for more details about what should be contained within that file).
  • (Recommended) the subfolder should contain a file called README.txt (the validator can automatically rename README to README.txt) with details about the current release of the plugin.

Database tables

The names of all database tables should start with the 'frankenstyle' plugin name. For example block_myblock, or auth_paypal. Except

  • Activity modules names miss out the mod_ prefix for historical reasons. For example forum_posts or quiz_attempts.
  • Question types are allowed to have tables whose names start question_ (for historical reasons). This is, however, deprecated. Note that this is currently broken: MDLSITE-1621

Manual checks

Before the plugin is publicly viewable a trusted reviewer will look through the code to make sure it is a valid plugin. These checks include:

  • The plugin installs cleanly
  • It does not contain any obviously harmful code
  • It is not a spam entry
  • It is not a duplicate of an already uploaded plugin