0

I have my wordpress websites running for already a year or more. I have hosted two websites on hostgator. All of sudden, both of my websites shows same error.

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'WP_Maintenance_Mode' not found in /home1/wp-includes/class-wp-hook.php on line 286

Can anybody please let me know how can I fix this problem.

Thanks... Any help is appreciated

1 Answer 1

-1

Somewhere in the theme, the WP_Maintenance_Mode class method is hooked to the filter or action. But when the hook is executed, this class doesn't exists or is not yet included.

I suspect that in the theme (file functions.php) this class is hooked to some event, but it is defined in an inactive plugin (I'm guessing it is "WP Maintenance Mode".)

Look for add_action and add_filter where this class is used as parameter.

add_action( 'some_action_name',  array('WP_Maintenance_Mode', 'method_name') );
add_action( 'some_action_name',  'WP_Maintenance_Mode::method_name' );
add_filter( 'some_filter_name',  array('WP_Maintenance_Mode', 'method_name') );

Try to comment out these lines or install the mentioned plugin and check if the warning disappears.

3
  • Thanks for the response. I looked on functions.php file but couldn't find WP_Maintenance_Mode in both add_action and add_filter. Also WP_Maintenance_Mode is not inside functions.php file.. Any other possible debug please :)
    – surazzarus
    Commented Aug 26, 2018 at 16:20
  • how do you know it is not a bug in the plugin itself? Commented Aug 26, 2018 at 17:35
  • So, if the class WP_Maintenance_Mode is not used in the theme, then you will have to check the plugins. Turn off all active plugins and start activating one by one, watching when the warning appears. Then check this plugin. @surazzarus
    – nmr
    Commented Aug 27, 2018 at 11:46

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.