As required by WordPress the file index.php is loaded when WordPress initializes the plug-in. index.php registers the activation and uninstall hooks and the callbacks which are executed when all plugins have been loaded (plugins_loaded).

To differentiate between a single and multisite installation NextADInt_Adi_Init::run() and NextADInt_Adi_Init::runMultisite() are always executed.

Run Multisite

runMultisite is only executed when the current user has the role Super Admin and views the network dashboard. The method only registers the menu and UI extensions.

Run single site

run is executed if the current user is not viewing the network dashboard. If the configuration option Is active of the current blog/site profile is enabled, it registers all required hooks by calling runCore. If the current user is viewing the blog administration panel the menu entries are shown. The menu entries are shown, regardless from the Is active setting: this ensures that the blog administrator is able to activate the ADI plug-in by himself.

Dependencies, Performance & Memory

Dependencies between the different classes are managed inside the NextADInt_Adi_Dependencies and autoloaded by using Autoloader.php. The dependencies are only loaded when required to keep the memory footprint and loading times as low as possible.