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 ?

  • Now I might be mistaken, but the majority of Wordpress plugins are not very object-structured. So UML diagrams could be difficult to find. -- Btw, you could consider flagging your question for moderator attention to have it moved to wordpress.stackexchange.com
    – mario
    Commented Mar 20, 2011 at 10:01
  • OK you're right I'll flag to request the move.
    – user310291
    Commented Mar 20, 2011 at 11:26
  • You are not looking for architecture but for designs. Architect <> Designer. Architecture is on meta level e.g. togaf.info/togaf9/togafSlides9/TOGAF-V9-M7-Metamodel.pdf designing is e.g. uml / logical data models /operational models.
    – edelwater
    Commented Mar 20, 2011 at 23:31

2 Answers 2


There is not much to it, really.

  1. During the loading of WordPress engine wp-settings.php file is processed.

  2. Among other things this files calls wp_get_active_and_valid_plugins() function, that gets list of activated (through admin interface) plugins from active_plugins option (stored in database).

  3. For each active plugin its main file (the one holding plugin header) is included 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.

  • OK thanks it's a good start for me to look for in the right place :)
    – user310291
    Commented Mar 20, 2011 at 14:37
  • @user310291 only be careful that third party xrefs can be of outdated WP versions. It's not cross-referenced but you can explore code in official subversion repository via trac core.trac.wordpress.org/browser/tags/3.1
    – Rarst
    Commented Mar 20, 2011 at 15:34
  • the official site doesn't seem as practical: how can I get all "Functions defined on the site" like on phpxref ?
    – user310291
    Commented Oct 30, 2011 at 15:53
  • @user310291 in which context and for which purpose? You can always generate your own xref. Or retrieve this via PHP code. Or use IDE with such functionality. Also see my Codex Generator plugin that gives you interface to explore active functions.
    – Rarst
    Commented Oct 30, 2011 at 16:46

The WP plugin architecture is event based and is very simple:

Events are attached using add_action() and add_filter().

Events are triggered using do_action() and apply_filters().

All these functions are found in wp-includes/plugin.php

More information can be found here: http://codex.wordpress.org/Plugin_API

For a "flow diagram" of sorts, see this site: http://wp-roadmap.com/demo/

  • Once again I'm not looking for How to create a plugin, I'm looking for the architecture of the ENGINE. Like I'm not asking about how to assemble a PC, I'm asking about the architecture of the Processor.
    – user310291
    Commented Mar 20, 2011 at 13:38
  • OOP can be and mostly is Event Based since it's non-linear programming. But that is not the problem, architecture schema can be done OOP or not OOP.
    – user310291
    Commented Mar 20, 2011 at 13:40
  • Updated answer.
    – scribu
    Commented Mar 20, 2011 at 14:47
  • Related answer: wordpress.stackexchange.com/questions/12576/…
    – scribu
    Commented Mar 21, 2011 at 0:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.