public function get_log_file()
 {
     if (!$this->logFile) {
         WP_Backup::create_dump_dir();
         $path = WP_Backup_Registry::config()->get_backup_dir() . DIRECTORY_SEPARATOR . self::LOGFILE;
         $files = glob($path . '.*');
         if (isset($files[0])) {
             $this->logFile = $files[0];
         } else {
             $this->logFile = $path . '.' . WP_Backup_Registry::get_secret($file);
         }
     }
     return $this->logFile;
 }
 * @license This program is free software; you can redistribute it and/or modify
 *          it under the terms of the GNU General Public License as published by
 *          the Free Software Foundation; either version 2 of the License, or
 *          (at your option) any later version.
 *
 *          This program is distributed in the hope that it will be useful,
 *          but WITHOUT ANY WARRANTY; without even the implied warranty of
 *          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *          GNU General Public License for more details.
 *
 *          You should have received a copy of the GNU General Public License
 *          along with this program; if not, write to the Free Software
 *          Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA.
 */
$config = WP_Backup_Config::construct();
$backup = new WP_Backup();
if (array_key_exists('stop_backup', $_POST)) {
    check_admin_referer('backup_to_dropbox_monitor_stop');
    $backup->stop();
} else {
    if (array_key_exists('start_backup', $_POST)) {
        check_admin_referer('backup_to_dropbox_monitor_stop');
        $backup->backup_now();
        $started = true;
    }
}
?>
<script type="text/javascript" language="javascript">
	function reload() {
		jQuery.post(ajaxurl, { action:'progress' },  function(data) {
			if (data.length > 3) {
 *          GNU General Public License for more details.
 *
 *          You should have received a copy of the GNU General Public License
 *          along with this program; if not, write to the Free Software
 *          Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA.
 */
try {
    $v = phpversion();
    if ($v < 5) {
        throw new Exception(sprintf(__('Your PHP version (%s) is too old for this plugin to function correctly please update to PHP 5.2 or higher.'), $v));
    }
    global $wpdb;
    $validation_errors = null;
    $dropbox = Dropbox_Facade::construct();
    $config = WP_Backup_Config::construct();
    $backup = new WP_Backup();
    $disable_backup_now = $config->in_progress();
    //We have a form submit so update the schedule and options
    if (array_key_exists('save_changes', $_POST)) {
        check_admin_referer('backup_to_dropbox_options_save');
        $config->set_schedule($_POST['day'], $_POST['time'], $_POST['frequency']);
        $options = array('store_in_subfolder' => $_POST['store_in_subfolder'] == "on", 'dump_location' => $_POST['dump_location'], 'dropbox_location' => $_POST['dropbox_location']);
        $validation_errors = $config->set_options($options);
    } else {
        if (array_key_exists('unlink', $_POST)) {
            check_admin_referer('backup_to_dropbox_options_save');
            $dropbox->unlink_account();
        } else {
            if (array_key_exists('clear_history', $_POST)) {
                check_admin_referer('backup_to_dropbox_options_save');
                $config->clear_history();
/**
 * @return void
 */
function run_dropbox_backup()
{
    $backup = new WP_Backup();
    $backup->execute();
}
 *          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *          GNU General Public License for more details.
 *
 *          You should have received a copy of the GNU General Public License
 *          along with this program; if not, write to the Free Software
 *          Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA.
 */
try {
    if ($errors = get_option('wpb2d-init-errors')) {
        delete_option('wpb2d-init-errors');
        throw new Exception(__('WordPress Backup to Dropbox failed to initialize due to these database errors.', 'wpbtd') . '<br /><br />' . $errors);
    }
    $validation_errors = null;
    $dropbox = WP_Backup_Registry::dropbox();
    $config = WP_Backup_Registry::config();
    $backup = new WP_Backup();
    $backup->create_dump_dir();
    $disable_backup_now = $config->get_option('in_progress');
    //We have a form submit so update the schedule and options
    if (array_key_exists('wpb2d_save_changes', $_POST)) {
        check_admin_referer('backup_to_dropbox_options_save');
        if (preg_match('/[^A-Za-z0-9-_.\\/]/', $_POST['dropbox_location'])) {
            $error_msg = __('The sub directory must only contain alphanumeric characters.', 'wpbtd');
            $dropbox_location = $_POST['dropbox_location'];
            $store_in_subfolder = true;
        } else {
            $config->set_schedule($_POST['day'], $_POST['time'], $_POST['frequency'])->set_option('store_in_subfolder', $_POST['store_in_subfolder'] == "on")->set_option('dropbox_location', $_POST['dropbox_location']);
        }
    } else {
        if (array_key_exists('unlink', $_POST)) {
            check_admin_referer('backup_to_dropbox_options_save');