Bypass by IP address
-
Thanks for your plugin, I like the simplicity ??
A feature request would be to bypass maintenance mode by IP address, this would make it easy for developers to show clients the work in progress. Also a great tool to test the site without being logged in.
I know you want to keep the plugin simple so I understand if this feature will not be added ??
However, would it be possible to hook the maintenance function so we can add this function ourselves?
Today I have to edit the plugin code directly and change it like so:
function maintenance() { $ip = $_SERVER['REMOTE_ADDR']; $allowed = array('123.123.123.123','123.123.123.123'); if ( ( ! in_array($ip, $allowed) ) && !(current_user_can( 'administrator' ) || current_user_can( 'super admin' )) || ( isset($_GET['ljmm']) && $_GET['ljmm'] == 'preview')) { $content = get_option('ljmm-content'); if(empty($content)) { // fallback $content = '<h1>Website Under Maintenance</h1><p>Our Website is currently undergoing scheduled maintenance. Please check back soon.</p>'; } $content = apply_filters('the_content', $content); wp_die($content, get_bloginfo( 'name' ) . ' - ' . __('Website Under Maintenance', LJMM_PLUGIN_DOMAIN), array('response' => '503')); } }
Cheers!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Bypass by IP address’ is closed to new replies.