Title: [Plugin: Maintenance Mode] 5.2 breaks pluggable function architecture
Last modified: August 19, 2016

---

# [Plugin: Maintenance Mode] 5.2 breaks pluggable function architecture

 *  [diablodale](https://wordpress.org/support/users/diablodale/)
 * (@diablodale)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-maintenance-mode-52-breaks-pluggable-function-architecture/)
 * Unfortunately, this plugin (at least version 5.2) breaks core functionality of
   WordPress 2.x by breaking the Pluggable functions architecture.
 * Line 37 of the plugin forces pluggable.php to load. This is *very* undesired.
 * WordPress is architected to load pluggable.php after all plugins load. This is
   a base assertion. Because this plugin forces pluggable.php to load out of order,
   it causes ALL PLUGINS that load after this maintenance mode plugin to NOT BE 
   ABLE TO PLUG FUNCTIONS.
 * See how the pluggable functions work:
    [http://codex.wordpress.org/Plugin_API#Pluggable_Functions](http://codex.wordpress.org/Plugin_API#Pluggable_Functions)
 * Then see wp-settings lines 595-601 to see how plugins and pluggable.php are loaded.
 * No known workaround.
 * [http://wordpress.org/extend/plugins/maintenance-mode/](http://wordpress.org/extend/plugins/maintenance-mode/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [PriMoThemes](https://wordpress.org/support/users/primothemes/)
 * (@primothemes)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-maintenance-mode-52-breaks-pluggable-function-architecture/#post-1533565)
 * Yes, I ran into this problem as well. I’m the s2Member developer for WordPress,
   and my plugin is broken by Maintenance Mode.
 * Please, please, please, remove the pluggable.php include call. A WordPress plugin
   should never force this file to be loaded ahead of others. ~Thanks. Otherwise,
   I’m a huge fan of your plugin!
 *  [mwillberg](https://wordpress.org/support/users/mwillberg/)
 * (@mwillberg)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-maintenance-mode-52-breaks-pluggable-function-architecture/#post-1533573)
 * The documentation even has an example how current_user_can is used properly:
 * [http://codex.wordpress.org/Adding_Administration_Menus](http://codex.wordpress.org/Adding_Administration_Menus)
 *  [Anointed](https://wordpress.org/support/users/anointed/)
 * (@anointed)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-maintenance-mode-52-breaks-pluggable-function-architecture/#post-1533625)
 * has this been fixed or is there a patch available for this problem?
 *  [radiok](https://wordpress.org/support/users/radiok/)
 * (@radiok)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-maintenance-mode-52-breaks-pluggable-function-architecture/#post-1533631)
 * A user recently reported this problem to me with my own plugin, Register Plus
   Redux. I wanted to hack together a fork of this plugin that fixes this issue,
   mwillberg, I don’t see the fix you mentioned on that page, can you clarify? I
   was considering nestling the include into the functions he uses current_user_can,
   to see if that would remotely help.
 * [http://wordpress.org/extend/plugins/register-plus-redux/](http://wordpress.org/extend/plugins/register-plus-redux/)
 *  [radiok](https://wordpress.org/support/users/radiok/)
 * (@radiok)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-maintenance-mode-52-breaks-pluggable-function-architecture/#post-1533633)
 * I did some heavy digging into the Maintenance Mode code and came up with the 
   following changes to correct Maintenance Mode’s faux pas.
 * In maintenance-mode.php, comment out the following line (37):
    `if (!function_exists('
   wp_get_current_user')) require (ABSPATH . WPINC . '/pluggable.php');`
 * Also in maintenance-mode.php, change the following line (632) from:
    `$myMaMo-
   >ApplyMaintenanceMode();` To: `add_action('plugins_loaded', array($myMaMo, 'ApplyMaintenanceMode'));`
 * So what we just did was remove the import of pluggable.php and delayed the initialization
   of Maintenance Mode until all other plugins are loaded (including pluggable).
   So no more jumping the gun!
 * [http://radiok.info/blog/the-case-of-maintenance-mode/](http://radiok.info/blog/the-case-of-maintenance-mode/)
 *  [michael_](https://wordpress.org/support/users/michael_/)
 * (@michael_)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-maintenance-mode-52-breaks-pluggable-function-architecture/#post-1533635)
 * Has been fixed in the meantime (plugin version 5.3), thanks to radiok:
    [http://wordpress.org/extend/plugins/maintenance-mode/changelog/](http://wordpress.org/extend/plugins/maintenance-mode/changelog/)

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘[Plugin: Maintenance Mode] 5.2 breaks pluggable function architecture’
is closed to new replies.

 * 6 replies
 * 6 participants
 * Last reply from: [michael_](https://wordpress.org/support/users/michael_/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-maintenance-mode-52-breaks-pluggable-function-architecture/#post-1533635)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
