'Best Practices for Elgg Plugin Developers' Cash Costello #ECSF
- 3. About Me
Elgg core developer
Author of Elgg Social Networking 1.8
Employed by Johns Hopkins University Applied
Physics Laboratory (JHU/APL)
R&D in machine learning
Driving force behind JHU/APL's collaborative
platform built on Elgg
- 5. 2. Make dependencies between plugins explicit
Plugin manifest, function_exists(), elgg_is_active_plugin()
- 6. 3. Create a site customization plugin as a catch all
for small modifications
Maintain a readme with list of customizations!
- 7. 4. Keep your plugin's start.php trim
elgg_register_library(), elgg_load_library(), class with static
methods
- 8. 5. Use inheritance with Elgg's data model
Remember to unregister your class when your plugin is disabled
using the deactivate.php script with update_subtype()
- 9. 6. Document what metadata is used with your
entities
@property in documentation of class or use getter/setter methods
- 10. 7. Avoid using many metadata key-value pairs
with elgg_get_entities*()
- 11. 8. Use Elgg's functions and classes when
interacting with the data model
- 12. 9. Be aware that setting metadata on an entity
clears Elgg's database cache
- 15. 12. Create views that correspond to visual
elements
Also look for common elements that can be reused
- 16. 13. Use the core views and CSS classes
whenever possible
- 17. 14. Learn the principles behind Elgg's new HTML/
CSS
Example: CSS selectors should not cross element boundaries