Alex King explains how they handle including plugin functionality in their themes:
Since the theme is loading in last, we can use that to our advantage. If the plugin has been installed separately as a plugin (and not as part of the theme), we will be able to see that it is active. If it is already active, we don’t want to load it again a second time.
In our FavePersonal theme we added an additional check in the if statement to see if the setting to activate the Social plugin was turned on. This allows us to avoid loading the plugin if the site owner has decided to disable this functionality.
If you must include a plugin’s functionality in your theme, this is the way to do it.
I disagree. By included a plugin in your theme you completely remove the ability to upgrade it.
I’d much rather use something like the TGM Plugin Activation class to include necessary plugins. The class is pretty heavy and can be over kill, but I’d argue that it’s much better than included the plugin directly in the theme.
It’s incrementally better, at least. Themes deferring to plugins if they’re active is a step in the right direction.
Yes, that I can agree with 🙂
Totally agree!
I totally agree. TGM Plugin Activation Class is definitely the way to go, not bundling the plugins in like that.