0

The idea is to create a very basic plugin for wordpress and enhance it with internal modules and some more plugins (e-plugins) if activated. This base plugin would have all the basic code of a wordpress plugin to work, and should load the modules and then the e-plugins if activated. The concept (very simplified here) I have is, to do this with an enhancement class/interface, to register all modules and plugins that will extend the base plugin. Then this base plugin can use all the functionality that will be implemented by the modules and all activated e-plugins. The advantage of this concept is that functionality that was formerly implemented in an e-plugin could easily integrated in major releases of the base plugin in just adding this e-plugin as a an internal module.

I have 2 questions:

  1. I don't want to reinvent the wheel, so does anyone know an already existing concept/framework/starting point for my described concept?
  2. The standard approach is to do enhancement of plugins with action and filter hooks. But this has its limitations. So should a WordPress plugin always and anyway be extended with hooks?

Thank's in advance

Tom

5
  • "But this has its limitations." - such as what?
    – Rup
    Sep 15 at 15:41
  • @Rup You obviously only can use those hooks which are implemented in the base plugin. And you cannot hook in complex functionality.
    – Tom
    Sep 15 at 15:47
  • But you're writing the base plugin here aren't you? And I see no reason you can't hook in complex functionality with the right hooks.
    – Rup
    Sep 15 at 15:49
  • Another option is to write a base class, and have your plugin's plugins extend that class. Then register that class with your base plugin and it can call methods on the class instead of calling hooks. I'm not sure that makes much practical difference though.
    – Rup
    Sep 15 at 15:55
  • @Rup OK, but when the plugin is out and used I cannot upgrade it easily. But this is always possible with some kind of code injection, so the base plugin doesn't have to know what functionality could be requested in the future. OK, you could implement many hooks, for any possible purpose, but I think for the security and the performance this is not the best way. ... 'write a base class, and have your plugin's plugins extend that class' that is the direction my thoughts are going.
    – Tom
    Sep 15 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.