• On the plugin ver. 3.7.7 you changed the function site_lockout_tasks() to static in AIOWPSecurity_WP_Loaded_Tasks which we used to subclass in our client themes in order to fully customize maintenance mode. This of course felt like a hack but there was no other apparent way going about it.

    Is it possible to add custom maintenance support?

    One way going about it could be by checking in the Theme directory for a specific php file such as maintenance.php or wp-security-visitor-lockout-page.php (as a drop in) before loading the default so that we can override and/or fully customize maintenance mode (see also WP_Maintenance_Mode plugin) like so:


    $template = AIO_WP_SECURITY_PATH.'/other-includes/wp-security-visitor-lockout-page.php';
    if( file_exists( trailingslashit( get_template_directory() ) . 'maintenance.php' ) )
    {
    $template = trailingslashit( get_template_directory() ) . 'maintenance.php';
    }
    if( is_child_theme() && file_exists( trailingslashit( get_stylesheet_directory()) . 'maintenance.php' ) )
    {
    $template = trailingslashit( get_stylesheet_directory() ) . 'maintenance.php';
    }
    include_once( $template );

    We would be more than willing to help out!

    Thank you in advance for looking into this!

    https://ww.wp.xz.cn/plugins/all-in-one-wp-security-and-firewall/

Viewing 4 replies - 1 through 4 (of 4 total)
  • I think the best way to handle it is via a filter. We can add a filter in the site lockout function. Your custom code will use that filter to return whatever content you want to show (instead of the plugin’s default lockout content). I can add this filter in the next release.

    If that sounds good, please contact me here and I can give you a copy of the plugin with that filter so you can test.
    http://support.tipsandtricks-hq.com/contact

    Thread Starter iSoftware

    (@isoftware)

    As you suggest the other approach would be a filter to get the template , perhaps as such:

    if ( $template = apply_filters('aiowps_site_lockout_template_include', AIO_WP_SECURITY_PATH.'/other-includes/wp-security-visitor-lockout-page.php')) {
    include_once( $template );
    }

    I would also suggest moving $maintenance_msg code found inside the template into a global function such as aiowps_maintenance_message() to echo or return the message so that theme developers can use that on the fly.

    You can send me a copy of the plugin when you put together the changes to test it

    Thank you

    I added two filters in there. One for the whole message and one for just the template include file.

    One of these filters should help you do what you are after.

    Thread Starter iSoftware

    (@isoftware)

    Great!, where can I get a copy of the plugin to test it out?

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

The topic ‘Customizing Maintenance Mode’ is closed to new replies.