Elgg Blog: Elgg 1.8: Plugin management

Elgg is intentionally modular by nature. The core is meant to be trim and efficient, and plugins are used to add new features, extend existing features, or change the theme. Because of this, plugins can often be complex and have many requirements. One of the goals in Elgg 1.8 is to improve the plugin experience for both developers and end-users.

Simple plugin managementFor end-users, the plugin administration has been split into simple and advanced areas.  Especially for those new to Elgg, this makes the experience of enabling main features of the site much easier.  In the simple view, plugins can be activated or deactivated en masse and are listed alphabetically instead of by load order.  The display of each plugin is streamlined, with only essential information showing.  

Advanced plugin managementThe traditional plugin administration has been moved to the advanced page and also includes enhancements.  Advanced users will know that some plugins need to be in a specific order and are familiar the annoyance of clicking “up” tens of times.  No more!  In Elgg 1.8, we’ve added the long requested feature of drag and drop plugin reordering.

Advanced plugins like Tidy Pics and Facebook Connect sometimes require additional PHP extensions or other Elgg plugins to work.  New users are often frustrated with discovering the specific requirements for plugins, and this frustration can spread to plugin authors if they receive bug reports that their plugin is broken when it’s actually just misconfigured.  Elgg 1.8 aims to fix this by introducing a plugins dependency system. 

By adding certain elements to the manifest file, plugin authors can specify that their plugin:

  • Requires a specific PHP extension,
  • Requires a specific PHP configuration option,
  • Requires a specific Elgg version,
  • Requires a specific Elgg plugin,
  • Must be loaded before or after another plugin,
  • Conflicts with a specific Elgg plugin or Elgg version,
  • Provides the same functionality as another plugin,
  • Should run certain functions on activation or deactivation.

Example dependencies for a fake pluginSystem that don't meet the requirements will not be able to activate the plugin until the system is compatible.  The dependency information is shown on the advanced page and also includes an assessment of the current system settings so end-users know what values need to change and can use the detected values as feedback when requesting support.  

For developers, plugins now have stricter requirements on their file structure.  In contrast to previous versions of Elgg, Elgg 1.8 requires that plugins have a start.php file, a manifest.xml file, and that specific values are set in the manifest file.  The manifest file also received an update: it now uses standard semantic XML.  Tightening up the requirements for plugins means plugins will be written better.

Plugins written for 1.7 will be compatible with the plugin system in 1.7, though they will likely require changes for the CSS and views changes in 1.8.  Developers interested in writing or upgrading plugins to for Elgg 1.8 should read the recently updated documentation about plugins, manifests, and the dependency system.

As development on 1.8 enters a stabilization phase, be sure to look for more posts about upcoming features!