Two of Redux’s users reported a conflict with Maintenance Mode and Redux. Upon investigation, I found the problem with Maintenance Mode to be that it breaks compatibility with the entire pluggable architecture. Maintenance Mode probably breaks a lot more plugins then people realize, it’s just that most plugins don’t report the fact. That’s a nice feature inherited from Register Plus.
The offending code follows:
if (!function_exists('wp_get_current_user')) require (ABSPATH . WPINC . '/pluggable.php');
The plugin author was kind enough to explain the purpose of this code: “For current_user_can() -> “wp_get_current_user() in wp-includescapabilities.php on line 969″. We need to include now since it is by default included AFTER plugins are being loaded.” So there was a problem with the current_user_can code not working. I’m surprised by that because current user_can is a pretty basic function for a plugin.
The following two posts in the WordPress Support Forum actually address the very problem Maintenance Mode must have been having…
Looking into it further, it appears the ApplyMaintenceMode function is the real culprit it makes a call to current_user_can() and to another function which in turn is dependent on current_user_can(). Regardless, all this is done in the constructor so it’s done pretty much immediately. We can fix this by changing the line
add_action('plugins_loaded', array($myMaMo, 'ApplyMaintenanceMode')); and commenting out the
if (!function_exists('wp_get_current_user')) require (ABSPATH . WPINC . '/pluggable.php'); line.
Thank you to pixelprohet for verifying these changes work!