I recently walked through the process of using a class’ constructor to prevent a plugin from working if it an expected dependency isn’t loaded.
Though I don’t consider this particular strategy a problem for a one-off dependency or in certain situations, there are ways this can lead to code smells.
It also prevents us from using a native feature of Core called WordPress subactions:
https://twitter.com/JJJ/status/822265137935646720
But before looking at subactions, I want to make sure I’m clear around the problems using the conditional approach (versus subactions) can breed with code smells.


