There are plenty of articles which explain how to create a wordpress plugin. I’m not looking for that, I’m looking for a schema of the core architecture of a wordpress plugin (an UML class diagram and sequence for example).
Has somebody seen anything like that somewhere ?
Update: I know plugin can be as simple as a function. It’s not my question. My question is about the architecture of the CALLER that calls the plugin, that is the architecture of the SYSTEM pertaining to the call of the plugin.
At least in which PHP module(s) is it implemented by the WordPress Core System files ?
2 s
There is not much to it, really.
-
During the loading of WordPress engine
wp-settings.php
file is processed. -
Among other things this files calls
wp_get_active_and_valid_plugins()
function, that gets list of activated (through admin interface) plugins fromactive_plugins
option (stored in database). - For each active plugin its main file (the one holding plugin header) is
include
d and from there it is up to plugin how it uses Plugins API (more commonly known as hooks) to integrate with WordPress.
Basically it is only a thin layer of active/inactive controls on top of straight PHP include
.