saveOptions("away_enable", $_POST['BWPS_away_enable']); $BWPS->saveOptions("away_mode", $_POST['BWPS_away_mode']); $BWPS->saveOptions("away_start", strtotime($startDate . " " . $startTime)); $BWPS->saveOptions("away_end", strtotime($endDate . " " . $endTime)); $opts = $BWPS->getOptions(); } else { $errorHandler = new WP_Error(); if (!checkdate($_POST['BWPS_away_startmonth'], $_POST['BWPS_away_startday'], $_POST['BWPS_away_startyear'])) { $errorHandler->add("1", __("You MUST enter a valid date for start time.")); } if (!checkdate($_POST['BWPS_away_endmonth'], $_POST['BWPS_away_endday'], $_POST['BWPS_away_endyear'])) { $errorHandler->add("2", __("You MUST enter a valid date for end time.")); } } if (is_wp_error($errorHandler)) { echo '

' . $errorHandler->get_error_message() . '

'; } else { echo '

Settings Saved

'; } $aedisplay = $_POST['BWPS_away_enable']; $modisplay = $_POST['BWPS_away_mode']; $smdisplay = $_POST['BWPS_away_startmonth']; $sddisplay = $_POST['BWPS_away_startday']; $sydisplay = $_POST['BWPS_away_startyear']; $shdisplay = $_POST['BWPS_away_starthour']; $sidisplay = $_POST['BWPS_away_startmin']; $ssdisplay = $_POST['BWPS_away_startsel']; $emdisplay = $_POST['BWPS_away_endmonth']; $eddisplay = $_POST['BWPS_away_endday']; $eydisplay = $_POST['BWPS_away_endyear']; $ehdisplay = $_POST['BWPS_away_endhour']; $eidisplay = $_POST['BWPS_away_endmin']; $esdisplay = $_POST['BWPS_away_endsel']; } else { $aedisplay = $opts['away_enable']; $modisplay = $opts['away_mode']; $sTime = $opts['away_start']; $eTime = $opts['away_end']; $shdisplay = date('g',$sTime); $sidisplay = date('i',$sTime); $ssdisplay = date('a',$sTime); $ehdisplay = date('g',$eTime); $eidisplay = date('i',$eTime); $esdisplay = date('a',$eTime); if ($opts['away_enable'] == 1) { $smdisplay = date('n',$sTime); $sddisplay = date('j',$sTime); $sydisplay = date('Y',$sTime); $emdisplay = date('n',$eTime); $eddisplay = date('j',$eTime); $eydisplay = date('Y',$eTime); } else { $sDate = strtotime(get_date_from_gmt(date('Y-m-d H:i:s',time() + 86400))); if ($eTime < (strtotime(get_date_from_gmt(date('Y-m-d H:i:s',time() - 86400))))) { $eDate = strtotime(get_date_from_gmt(date('Y-m-d H:i:s',time() + (86400 * 2)))); } else { $eDate = $eTime; } $smdisplay = date('n',$sDate); $sddisplay = date('j',$sDate); $sydisplay = date('Y',$sDate); $emdisplay = date('n',$eDate); $eddisplay = date('j',$eDate); $eydisplay = date('Y',$eDate); } } ?>

Better WP Security - Away Options

Away Mode Options

As many of us update our sites on a general schedule it is not always necessary to permit site access all of the time. The options below will disable the backend of the site for the specified period.

Selecting "One Time" will lock out the backend of your site from the start date and time to the end date and time. Selecting "Daily" will ignore the start and and dates and will disable your site backend from the start time to the end time.

, at :

Select the date and time at which access to the backend of this site will be disabled. Note that if "Daily" mode is selected the date will be ignored and access will be banned each day at the specified time.

, at :

Select the date and time at which access to the backend of this site will be restored. Note that if "Daily" mode is selected the date will be ignored and access will be restored each day at the specified time.

Access time rules.

every day"; $stime = "" . date('g:i a', $opts['away_start']) . ""; $etime = "" . date('g:i a', $opts['away_end']) . ""; } else { $freq = ""; $stime = "" . date('l, F jS, Y \a\\t g:i a', $opts['away_start']) . ""; $etime = "" . date('l, F jS, Y \a\\t g:i a', $opts['away_end']) . ""; } ?>

The backend (administrative section) of this site will be unavailable from until .

Please note that according to your Wordpress timezone settings your local time is getLocalTime()); ?>. If this is incorrect please correct it on the Wordpress general settings page by setting the appropriate time zone. Failure to do so may result in unintended lockouts.