function dbmanager_options() { $text = ''; $backup_options = get_option('dbmanager_options'); $old_backup_options = $backup_options; if (!empty($_POST['Submit'])) { check_admin_referer('wp-dbmanager_options'); $backup_options['mysqldumppath'] = sanitize_text_field($_POST['db_mysqldumppath']); $backup_options['mysqlpath'] = sanitize_text_field($_POST['db_mysqlpath']); $backup_options['path'] = sanitize_text_field($_POST['db_path']); $backup_options['max_backup'] = intval($_POST['db_max_backup']); $backup_options['backup'] = intval($_POST['db_backup']); $backup_options['backup_gzip'] = intval($_POST['db_backup_gzip']); $backup_options['backup_period'] = intval($_POST['db_backup_period']); $backup_options['backup_email'] = sanitize_email($_POST['db_backup_email']); $backup_options['backup_email_from'] = sanitize_email($_POST['db_backup_email_from']); $backup_options['backup_email_from_name'] = sanitize_text_field($_POST['db_backup_email_from_name']); $backup_options['backup_email_subject'] = sanitize_text_field($_POST['db_backup_email_subject']); $backup_options['optimize'] = intval($_POST['db_optimize']); $backup_options['optimize_period'] = intval($_POST['db_optimize_period']); $backup_options['repair'] = intval($_POST['db_repair']); $backup_options['repair_period'] = intval($_POST['db_repair_period']); $backup_options['hide_admin_notices'] = intval($_POST['db_hide_admin_notices']); if (realpath($backup_options['path']) === false) { $text = '<div id="message" class="error"><p>' . sprintf(__('%s is not a valid backup path', 'wp-dbmanager'), stripslashes($backup_options['path'])) . '</p></div>'; $backup_options['path'] = $old_backup_options['path']; } else { if (dbmanager_is_valid_path($backup_options['mysqldumppath']) === 0) { $text = '<div id="message" class="error"><p>' . sprintf(__('%s is not a valid mysqldump path', 'wp-dbmanager'), stripslashes($backup_options['mysqldumppath'])) . '</p></div>'; $backup_options['mysqldumppath'] = $old_backup_options['mysqldumppath']; } else { if (dbmanager_is_valid_path($backup_options['mysqlpath']) === 0) { $text = '<div id="message" class="error"><p>' . sprintf(__('%s is not a valid mysql path', 'wp-dbmanager'), stripslashes($backup_options['mysqlpath'])) . '</p></div>'; $backup_options['mysqlpath'] = $old_backup_options['mysqlpath']; } } } $update_db_options = update_option('dbmanager_options', $backup_options); if ($update_db_options) { $text = '<div id="message" class="updated"><p>' . __('Database Options Updated', 'wp-dbmanager') . '</p></div>'; } if (empty($text)) { $text = '<div id="message" class="error"><p>' . __('No Database Option Updated', 'wp-dbmanager') . '</p></div>'; } wp_clear_scheduled_hook('dbmanager_cron_backup'); if ($backup_options['backup_period'] > 0) { if (!wp_next_scheduled('dbmanager_cron_backup')) { wp_schedule_event(time(), 'dbmanager_backup', 'dbmanager_cron_backup'); } } wp_clear_scheduled_hook('dbmanager_cron_optimize'); if ($backup_options['optimize_period'] > 0) { if (!wp_next_scheduled('dbmanager_cron_optimize')) { wp_schedule_event(time(), 'dbmanager_optimize', 'dbmanager_cron_optimize'); } } wp_clear_scheduled_hook('dbmanager_cron_repair'); if ($backup_options['repair_period'] > 0) { if (!wp_next_scheduled('dbmanager_cron_repair')) { wp_schedule_event(time(), 'dbmanager_repair', 'dbmanager_cron_repair'); } } } $path = detect_mysql(); // Default Options if (!isset($backup_options['backup_email_from'])) { $backup_options['backup_email_from'] = dbmanager_default_options('backup_email_from'); } if (!isset($backup_options['backup_email_from_name'])) { $backup_options['backup_email_from_name'] = dbmanager_default_options('backup_email_from_name'); } if (!isset($backup_options['backup_email_subject'])) { $backup_options['backup_email_subject'] = dbmanager_default_options('backup_email_subject'); } if (!isset($backup_options['hide_admin_notices'])) { $backup_options['hide_admin_notices'] = dbmanager_default_options('hide_admin_notices'); } ?> <script type="text/javascript"> /* <![CDATA[*/ function mysqlpath() { jQuery("#db_mysqlpath").val("<?php echo $path['mysql']; ?> "); } function mysqldumppath() { jQuery("#db_mysqldumppath").val("<?php echo $path['mysqldump']; ?> "); } /* ]]> */ </script> <?php if (!empty($text)) { echo $text; } ?> <!-- Database Options --> <form method="post" action="<?php echo admin_url('admin.php?page=' . plugin_basename(__FILE__)); ?> "> <?php wp_nonce_field('wp-dbmanager_options'); ?> <div class="wrap"> <h2><?php _e('Database Options', 'wp-dbmanager'); ?> </h2> <h3><?php _e('Paths', 'wp-dbmanager'); ?> </h3> <table class="form-table"> <tr> <td width="20%" valign="top"><strong><?php _e('Path To mysqldump:', 'wp-dbmanager'); ?> </strong></td> <td width="80%"> <input type="text" id="db_mysqldumppath" name="db_mysqldumppath" size="60" maxlength="100" value="<?php echo stripslashes($backup_options['mysqldumppath']); ?> " dir="ltr" /> <input type="button" value="<?php _e('Auto Detect', 'wp-dbmanager'); ?> " onclick="mysqldumppath();" /> <p><?php _e('The absolute path to mysqldump without trailing slash. If unsure, please email your server administrator about this.', 'wp-dbmanager'); ?> </p> </td> </tr> <tr> <td valign="top"><strong><?php _e('Path To mysql:', 'wp-dbmanager'); ?> </strong></td> <td> <input type="text" id="db_mysqlpath" name="db_mysqlpath" size="60" maxlength="100" value="<?php echo stripslashes($backup_options['mysqlpath']); ?> " dir="ltr" /> <input type="button" value="<?php _e('Auto Detect', 'wp-dbmanager'); ?> " onclick="mysqlpath();" /> <p><?php _e('The absolute path to mysql without trailing slash. If unsure, please email your server administrator about this.', 'wp-dbmanager'); ?> </p> </td> </tr> <tr> <td valign="top"><strong><?php _e('Path To Backup:', 'wp-dbmanager'); ?> </strong></td> <td> <input type="text" name="db_path" size="60" maxlength="100" value="<?php echo stripslashes($backup_options['path']); ?> " dir="ltr" /> <p><?php _e('The absolute path to your database backup folder without trailing slash. Make sure the folder is writable.', 'wp-dbmanager'); ?> </p> </td> </tr> <tr> <td valign="top"><strong><?php _e('Maximum Backup Files:', 'wp-dbmanager'); ?> </strong></td> <td> <input type="text" name="db_max_backup" size="5" maxlength="5" value="<?php echo stripslashes($backup_options['max_backup']); ?> " /> <p><?php _e('The maximum number of database backup files that is allowed in the backup folder as stated above. The oldest database backup file is always deleted in order to maintain this value. This is to prevent the backup folder from getting too large.', 'wp-dbmanager'); ?> </p> </td> </tr> </table> <h3><?php _e('Note', 'wp-dbmanager'); ?> </h3> <table class="form-table"> <tr> <td> <strong><?php _e('Windows Server', 'wp-dbmanager'); ?> </strong><br /> <?php _e('For mysqldump path, you can try \'<strong>mysqldump.exe</strong>\'.', 'wp-dbmanager'); ?> <br /> <?php _e('For mysql path, you can try \'<strong>mysql.exe</strong>\'.', 'wp-dbmanager'); ?> </td> </tr> <tr> <td> <strong><?php _e('Linux Server', 'wp-dbmanager'); ?> </strong><br /> <?php _e('For mysqldump path, normally is just \'<strong>mysqldump</strong>\'.', 'wp-dbmanager'); ?> <br /> <?php _e('For mysql path, normally is just \'<strong>mysql</strong>\'.', 'wp-dbmanager'); ?> </td> </tr> <tr> <td> <strong><?php _e('Note', 'wp-dbmanager'); ?> </strong><br /> <?php _e('The \'Auto Detect\' function does not work for some servers. If it does not work for you, please contact your server administrator for the MYSQL and MYSQL DUMP paths.', 'wp-dbmanager'); ?> </td> </tr> </table> <h3><?php _e('Automatic Scheduling', 'wp-dbmanager'); ?> </h3> <table class="form-table"> <tr> <td valign="top"><strong><?php _e('Automatic Backing Up Of DB:', 'wp-dbmanager'); ?> </strong></td> <td> <?php _e('Next backup date: ', 'wp-dbmanager'); if (wp_next_scheduled('dbmanager_cron_backup')) { echo '<strong>' . mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', wp_next_scheduled('dbmanager_cron_backup') + get_option('gmt_offset') * 3600)) . '</strong>'; } else { _e('N/A', 'wp-dbmanager'); } ?> <p> <?php _e('Every', 'wp-dbmanager'); ?> <input type="text" name="db_backup" size="3" maxlength="5" value="<?php echo intval($backup_options['backup']); ?> " /> <select name="db_backup_period" size="1"> <option value="0"<?php selected('0', $backup_options['backup_period']); ?> ><?php _e('Disable', 'wp-dbmanager'); ?> </option> <option value="60"<?php selected('60', $backup_options['backup_period']); ?> ><?php _e('Minutes(s)', 'wp-dbmanager'); ?> </option> <option value="3600"<?php selected('3600', $backup_options['backup_period']); ?> ><?php _e('Hour(s)', 'wp-dbmanager'); ?> </option> <option value="86400"<?php selected('86400', $backup_options['backup_period']); ?> ><?php _e('Day(s)', 'wp-dbmanager'); ?> </option> <option value="604800"<?php selected('604800', $backup_options['backup_period']); ?> ><?php _e('Week(s)', 'wp-dbmanager'); ?> </option> <option value="2592000"<?php selected('2592000', $backup_options['backup_period']); ?> ><?php _e('Month(s)', 'wp-dbmanager'); ?> </option> </select> <?php _e('Gzip', 'wp-dbmanager'); ?> <select name="db_backup_gzip" size="1"> <option value="0"<?php selected('0', $backup_options['backup_gzip']); ?> ><?php _e('No', 'wp-dbmanager'); ?> </option> <option value="1"<?php selected('1', $backup_options['backup_gzip']); ?> ><?php _e('Yes', 'wp-dbmanager'); ?> </option> </select> </p> <p><?php _e('WP-DBManager can automatically backup your database after a certain period.', 'wp-dbmanager'); ?> </p> </td> </tr> <tr> <td valign="top"><strong><?php _e('Automatic Optimizing Of DB:', 'wp-dbmanager'); ?> </strong></td> <td> <?php _e('Next optimize date: ', 'wp-dbmanager'); if (wp_next_scheduled('dbmanager_cron_optimize')) { echo '<strong>' . mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', wp_next_scheduled('dbmanager_cron_optimize') + get_option('gmt_offset') * 3600)) . '</strong>'; } else { _e('N/A', 'wp-dbmanager'); } ?> <p> <?php _e('Every', 'wp-dbmanager'); ?> <input type="text" name="db_optimize" size="3" maxlength="5" value="<?php echo intval($backup_options['optimize']); ?> " /> <select name="db_optimize_period" size="1"> <option value="0"<?php selected('0', $backup_options['optimize_period']); ?> ><?php _e('Disable', 'wp-dbmanager'); ?> </option> <option value="60"<?php selected('60', $backup_options['optimize_period']); ?> ><?php _e('Minutes(s)', 'wp-dbmanager'); ?> </option> <option value="3600"<?php selected('3600', $backup_options['optimize_period']); ?> ><?php _e('Hour(s)', 'wp-dbmanager'); ?> </option> <option value="86400"<?php selected('86400', $backup_options['optimize_period']); ?> ><?php _e('Day(s)', 'wp-dbmanager'); ?> </option> <option value="604800"<?php selected('604800', $backup_options['optimize_period']); ?> ><?php _e('Week(s)', 'wp-dbmanager'); ?> </option> <option value="2592000"<?php selected('2592000', $backup_options['optimize_period']); ?> ><?php _e('Month(s)', 'wp-dbmanager'); ?> </option> </select> </p> <p><?php _e('WP-DBManager can automatically optimize your database after a certain period.', 'wp-dbmanager'); ?> </p> </td> </tr> <tr> <td valign="top"><strong><?php _e('Automatic Repairing Of DB:', 'wp-dbmanager'); ?> </strong></td> <td> <?php _e('Next repair date: ', 'wp-dbmanager'); if (wp_next_scheduled('dbmanager_cron_repair')) { echo '<strong>' . mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', wp_next_scheduled('dbmanager_cron_repair') + get_option('gmt_offset') * 3600)) . '</strong>'; } else { _e('N/A', 'wp-dbmanager'); } ?> <p> <?php _e('Every', 'wp-dbmanager'); ?> <input type="text" name="db_repair" size="3" maxlength="5" value="<?php echo intval($backup_options['repair']); ?> " /> <select name="db_repair_period" size="1"> <option value="0"<?php selected('0', $backup_options['repair_period']); ?> ><?php _e('Disable', 'wp-dbmanager'); ?> </option> <option value="60"<?php selected('60', $backup_options['repair_period']); ?> ><?php _e('Minutes(s)', 'wp-dbmanager'); ?> </option> <option value="3600"<?php selected('3600', $backup_options['repair_period']); ?> ><?php _e('Hour(s)', 'wp-dbmanager'); ?> </option> <option value="86400"<?php selected('86400', $backup_options['repair_period']); ?> ><?php _e('Day(s)', 'wp-dbmanager'); ?> </option> <option value="604800"<?php selected('604800', $backup_options['repair_period']); ?> ><?php _e('Week(s)', 'wp-dbmanager'); ?> </option> <option value="2592000"<?php selected('2592000', $backup_options['repair_period']); ?> ><?php _e('Month(s)', 'wp-dbmanager'); ?> </option> </select> </p> <p><?php _e('WP-DBManager can automatically repair your database after a certain period.', 'wp-dbmanager'); ?> </p> </td> </tr> </table> <h3><?php _e('Backup Email Options', 'wp-dbmanager'); ?> </h3> <table class="form-table"> <tr> <td valign="top"><strong><?php _e('To', 'wp-dbmanager'); ?> </strong></td> <td> <p> <input type="text" name="db_backup_email" size="30" maxlength="250" placeholder="<?php _e('To E-mail', 'wp-dbmanager'); ?> " value="<?php echo esc_attr(stripslashes($backup_options['backup_email'])); ?> " dir="ltr" /> </p> <p><?php _e('(Leave blank to disable this feature)', 'wp-dbmanager'); ?> </p> </td> </tr> <tr> <td valign="top"><strong><?php _e('From', 'wp-dbmanager'); ?> </strong></td> <td> <p> <input type="text" name="db_backup_email_from_name" size="60" maxlength="250" placeholder="<?php _e('From Name', 'wp-dbmanager'); ?> " value="<?php echo esc_attr(stripslashes($backup_options['backup_email_from_name'])); ?> " dir="ltr" /> <<input type="text" name="db_backup_email_from" size="30" maxlength="250" placeholder="<?php _e('From E-mail', 'wp-dbmanager'); ?> " value="<?php echo esc_attr(stripslashes($backup_options['backup_email_from'])); ?> " dir="ltr" />> </p> <p><?php _e('(Leave blank to use the default)', 'wp-dbmanager'); ?> </p> </td> </tr> <tr> <td valign="top"><strong><?php _e('Subject:', 'wp-dbmanager'); ?> </strong></td> <td> <p> <input type="text" name="db_backup_email_subject" size="90" maxlength="255" placeholder="<?php _e('Subject', 'wp-dbmanager'); ?> " value="<?php echo esc_attr(stripslashes($backup_options['backup_email_subject'])); ?> " dir="ltr" /> </p> <p><?php _e('(Leave blank to use the default)', 'wp-dbmanager'); ?> </p> </td> </tr> </table> <h3><?php _e('Miscellaneous Options', 'wp-dbmanager'); ?> </h3> <table class="form-table"> <tr> <td valign="top"><strong><?php _e('Hide Admin Notices', 'wp-dbmanager'); ?> </strong></td> <td> <p> <input type="radio" name="db_hide_admin_notices" value="1"<?php echo intval($backup_options['hide_admin_notices']) === 1 ? ' checked="checked"' : ''; ?> /> <?php _e('Yes', 'wp-dbmanager'); ?> <input type="radio" name="db_hide_admin_notices" value="0"<?php echo intval($backup_options['hide_admin_notices']) === 0 ? ' checked="checked"' : ''; ?> /> <?php _e('No', 'wp-dbmanager'); ?> </p> </td> </tr> </table> <p class="submit"> <input type="submit" name="Submit" class="button" value="<?php _e('Save Changes', 'wp-dbmanager'); ?> " /> </p> </div> </form> <?php }
function dbmanager_options() { global $wpdb; $text = ''; $backup_options = array(); $backup_options = get_option('dbmanager_options'); if ($_POST['Submit']) { $backup_options['mysqldumppath'] = trim($_POST['db_mysqldumppath']); $backup_options['mysqlpath'] = trim($_POST['db_mysqlpath']); $backup_options['path'] = trim($_POST['db_path']); $backup_options['max_backup'] = intval($_POST['db_max_backup']); $backup_options['backup'] = intval($_POST['db_backup']); $backup_options['backup_gzip'] = intval($_POST['db_backup_gzip']); $backup_options['backup_period'] = intval($_POST['db_backup_period']); $backup_options['backup_email'] = trim(addslashes($_POST['db_backup_email'])); $backup_options['optimize'] = intval($_POST['db_optimize']); $backup_options['optimize_period'] = intval($_POST['db_optimize_period']); $update_db_options = update_option('dbmanager_options', $backup_options); if ($update_db_options) { $text = '<font color="green">' . __('Database Options Updated', 'wp-dbmanager') . '</font>'; } if (empty($text)) { $text = '<font color="red">' . __('No Database Option Updated', 'wp-dbmanager') . '</font>'; } wp_clear_scheduled_hook('dbmanager_cron_backup'); if ($backup_options['backup_period'] > 0) { if (!wp_next_scheduled('dbmanager_cron_backup')) { wp_schedule_event(time(), 'dbmanager_backup', 'dbmanager_cron_backup'); } } wp_clear_scheduled_hook('dbmanager_cron_optimize'); if ($backup_options['optimize_period'] > 0) { if (!wp_next_scheduled('dbmanager_cron_optimize')) { wp_schedule_event(time(), 'dbmanager_optimize', 'dbmanager_cron_optimize'); } } } $path = detect_mysql(); ?> <script type="text/javascript"> /* <![CDATA[*/ function mysqlpath() { jQuery("#db_mysqlpath").val("<?php echo $path['mysql']; ?> "); } function mysqldumppath() { jQuery("#db_mysqldumppath").val("<?php echo $path['mysqldump']; ?> "); } /* ]]> */ </script> <?php if (!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>' . $text . '</p></div>'; } ?> <!-- Database Options --> <form method="post" action="<?php echo admin_url('admin.php?page=' . plugin_basename(__FILE__)); ?> "> <div class="wrap"> <div id="icon-wp-dbmanager" class="icon32"><br /></div> <h2><?php _e('Database Options', 'wp-dbmanager'); ?> </h2> <h3><?php _e('Paths', 'wp-dbmanager'); ?> </h3> <table class="form-table"> <tr> <td width="20%" valign="top"><strong><?php _e('Path To mysqldump:', 'wp-dbmanager'); ?> </strong></td> <td width="80%"> <input type="text" id="db_mysqldumppath" name="db_mysqldumppath" size="60" maxlength="100" value="<?php echo stripslashes($backup_options['mysqldumppath']); ?> " dir="ltr" /> <input type="button" value="<?php _e('Auto Detect', 'wp-dbmanager'); ?> " onclick="mysqldumppath();" /> <p><?php _e('The absolute path to mysqldump without trailing slash. If unsure, please email your server administrator about this.', 'wp-dbmanager'); ?> </p> </td> </tr> <tr> <td valign="top"><strong><?php _e('Path To mysql:', 'wp-dbmanager'); ?> </strong></td> <td> <input type="text" id="db_mysqlpath" name="db_mysqlpath" size="60" maxlength="100" value="<?php echo stripslashes($backup_options['mysqlpath']); ?> " dir="ltr" /> <input type="button" value="<?php _e('Auto Detect', 'wp-dbmanager'); ?> " onclick="mysqlpath();" /> <p><?php _e('The absolute path to mysql without trailing slash. If unsure, please email your server administrator about this.', 'wp-dbmanager'); ?> </p> </td> </tr> <tr> <td valign="top"><strong><?php _e('Path To Backup:', 'wp-dbmanager'); ?> </strong></td> <td> <input type="text" name="db_path" size="60" maxlength="100" value="<?php echo stripslashes($backup_options['path']); ?> " dir="ltr" /> <p><?php _e('The absolute path to your database backup folder without trailing slash. Make sure the folder is writable.', 'wp-dbmanager'); ?> </p> </td> </tr> <tr> <td valign="top"><strong><?php _e('Maximum Backup Files:', 'wp-dbmanager'); ?> </strong></td> <td> <input type="text" name="db_max_backup" size="5" maxlength="5" value="<?php echo stripslashes($backup_options['max_backup']); ?> " /> <p><?php _e('The maximum number of database backup files that is allowed in the backup folder as stated above. The oldest database backup file is always deleted in order to maintain this value. This is to prevent the backup folder from getting too large.', 'wp-dbmanager'); ?> </p> </td> </tr> </table> <h3><?php _e('Note', 'wp-dbmanager'); ?> </h3> <table class="form-table"> <tr> <td> <strong><?php _e('Windows Server', 'wp-dbmanager'); ?> </strong><br /> <?php _e('For mysqldump path, you can try \'<strong>mysqldump.exe</strong>\'.', 'wp-dbmanager'); ?> <br /> <?php _e('For mysql path, you can try \'<strong>mysql.exe</strong>\'.', 'wp-dbmanager'); ?> </td> </tr> <tr> <td> <strong><?php _e('Linux Server', 'wp-dbmanager'); ?> </strong><br /> <?php _e('For mysqldump path, normally is just \'<strong>mysqldump</strong>\'.', 'wp-dbmanager'); ?> <br /> <?php _e('For mysql path, normally is just \'<strong>mysql</strong>\'.', 'wp-dbmanager'); ?> </td> </tr> <tr> <td> <strong><?php _e('Note', 'wp-dbmanager'); ?> </strong><br /> <?php _e('The \'Auto Detect\' function does not work for some servers. If it does not work for you, please contact your server administrator for the MYSQL and MYSQL DUMP paths.', 'wp-dbmanager'); ?> </td> </tr> </table> <h3><?php _e('Automatic Scheduling', 'wp-dbmanager'); ?> </h3> <table class="form-table"> <tr> <td valign="top"><strong><?php _e('Automatic Backing Up Of DB:', 'wp-dbmanager'); ?> </strong></td> <td> <?php _e('Next backup date: ', 'wp-dbmanager'); if (wp_next_scheduled('dbmanager_cron_backup')) { echo '<strong>' . mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', wp_next_scheduled('dbmanager_cron_backup') + get_option('gmt_offset') * 3600)) . '</strong>'; } else { _e('N/A', 'wp-dbmanager'); } ?> <p> <?php _e('Every', 'wp-dbmanager'); ?> <input type="text" name="db_backup" size="3" maxlength="5" value="<?php echo intval($backup_options['backup']); ?> " /> <select name="db_backup_period" size="1"> <option value="0"<?php selected('0', $backup_options['backup_period']); ?> ><?php _e('Disable', 'wp-dbmanager'); ?> </option> <option value="60"<?php selected('60', $backup_options['backup_period']); ?> ><?php _e('Minutes(s)', 'wp-dbmanager'); ?> </option> <option value="3600"<?php selected('3600', $backup_options['backup_period']); ?> ><?php _e('Hour(s)', 'wp-dbmanager'); ?> </option> <option value="86400"<?php selected('86400', $backup_options['backup_period']); ?> ><?php _e('Day(s)', 'wp-dbmanager'); ?> </option> <option value="604800"<?php selected('604800', $backup_options['backup_period']); ?> ><?php _e('Week(s)', 'wp-dbmanager'); ?> </option> <option value="18144000"<?php selected('18144000', $backup_options['backup_period']); ?> ><?php _e('Month(s)', 'wp-dbmanager'); ?> </option> </select> <?php _e('Gzip', 'wp-dbmanager'); ?> <select name="db_backup_gzip" size="1"> <option value="0"<?php selected('0', $backup_options['backup_gzip']); ?> ><?php _e('No', 'wp-dbmanager'); ?> </option> <option value="1"<?php selected('1', $backup_options['backup_gzip']); ?> ><?php _e('Yes', 'wp-dbmanager'); ?> </option> </select> </p> <p><?php _e('E-mail backup to:', 'wp-dbmanager'); ?> <input type="text" name="db_backup_email" size="30" maxlength="50" value="<?php echo stripslashes($backup_options['backup_email']); ?> " dir="ltr" /> <?php _e('(Leave blank to disable this feature)', 'wp-dbmanager'); ?> </p> <p><?php _e('WP-DBManager can automatically backup your database after a certain period.', 'wp-dbmanager'); ?> </p> </td> </tr> <tr> <td valign="top"><strong><?php _e('Automatic Optimizing Of DB:', 'wp-dbmanager'); ?> </strong></td> <td> <?php _e('Next optimize date: ', 'wp-dbmanager'); if (wp_next_scheduled('dbmanager_cron_optimize')) { echo '<strong>' . mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', wp_next_scheduled('dbmanager_cron_optimize') + get_option('gmt_offset') * 3600)) . '</strong>'; } else { _e('N/A', 'wp-dbmanager'); } ?> <p> <?php _e('Every', 'wp-dbmanager'); ?> <input type="text" name="db_optimize" size="3" maxlength="5" value="<?php echo intval($backup_options['optimize']); ?> " /> <select name="db_optimize_period" size="1"> <option value="0"<?php selected('0', $backup_options['optimize_period']); ?> ><?php _e('Disable', 'wp-dbmanager'); ?> </option> <option value="60"<?php selected('60', $backup_options['optimize_period']); ?> ><?php _e('Minutes(s)', 'wp-dbmanager'); ?> </option> <option value="3600"<?php selected('3600', $backup_options['optimize_period']); ?> ><?php _e('Hour(s)', 'wp-dbmanager'); ?> </option> <option value="86400"<?php selected('86400', $backup_options['optimize_period']); ?> ><?php _e('Day(s)', 'wp-dbmanager'); ?> </option> <option value="604800"<?php selected('604800', $backup_options['optimize_period']); ?> ><?php _e('Week(s)', 'wp-dbmanager'); ?> </option> <option value="18144000"<?php selected('18144000', $backup_options['optimize_period']); ?> ><?php _e('Month(s)', 'wp-dbmanager'); ?> </option> </select> </p> <p><?php _e('WP-DBManager can automatically optimize your database after a certain period.', 'wp-dbmanager'); ?> </p> </td> </tr> </table> <p class="submit"> <input type="submit" name="Submit" class="button" value="<?php _e('Save Changes', 'wp-dbmanager'); ?> " /> </p> </div> </form> <?php }