Craft CMS offers two primary architectural patterns for packaging custom PHP code: Plugins and Modules. While structurally very similar, stemming from the concept of Yii modules , they serve distinct purposes and come with different features and implications.