Writing add-ons for ExpressionEngine isn’t terribly difficult once you know what you’re doing. However, before you know what you’re doing it can be a frustrating tangle of guess and check. I vividly remember writing my first plugin, and then my first extension, trying to wrap my head around how hooks work. Then I tried my hand at writing a Multiple Site Manager compatible extension and there was more confusion there.
I want to walk you through writing a plugin, the best first step towards building ExpressionEngine add-ons. This tutorial will be a start-to-finish adventure, starting with the plugin skeleton and working our way to putting it on GitHub for everyone to download. I’ll explain my methods and my approach to building plugins, and by extension, software in general. Additionally, this particular plugin will be replacing the aging MagPie plugin, since MagPie is no longer being maintained.