コード例 #1
0
ファイル: class-admin.php プロジェクト: demochko-ol/hezy
 /**
  * @static
  * @return \BackWPup
  */
 public static function get_instance()
 {
     if (NULL === self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
コード例 #2
0
 /**
  * Set needed filters and actions and load
  */
 private function __construct()
 {
     // Nothing else matters if we're not on the main site
     if (!is_main_site()) {
         return;
     }
     //auto loader
     spl_autoload_register(array($this, 'autoloader'));
     //start upgrade if needed
     if (get_site_option('backwpup_version') != self::get_plugin_data('Version')) {
         BackWPup_Install::activate();
     }
     //load pro features
     if (class_exists('BackWPup_Pro')) {
         BackWPup_Pro::get_instance();
     }
     //WP-Cron
     if (defined('DOING_CRON') && DOING_CRON) {
         if (!empty($_GET['backwpup_run']) && class_exists('BackWPup_Job')) {
             //early disable caches
             BackWPup_Job::disable_caches();
             //add action for running jobs in wp-cron.php
             add_action('wp_loaded', array('BackWPup_Cron', 'cron_active'), PHP_INT_MAX);
         } else {
             //add cron actions
             add_action('backwpup_cron', array('BackWPup_Cron', 'run'));
             add_action('backwpup_check_cleanup', array('BackWPup_Cron', 'check_cleanup'));
         }
         //if in cron the rest is not needed
         return;
     }
     //deactivation hook
     register_deactivation_hook(__FILE__, array('BackWPup_Install', 'deactivate'));
     //Admin bar
     if (get_site_option('backwpup_cfg_showadminbar', FALSE)) {
         add_action('init', array('BackWPup_Adminbar', 'get_instance'));
     }
     //only in backend
     if (is_admin() && class_exists('BackWPup_Admin')) {
         BackWPup_Admin::get_instance();
     }
     //work with wp-cli
     if (defined('WP_CLI') && WP_CLI && method_exists('WP_CLI', 'add_command')) {
         WP_CLI::add_command('backwpup', 'BackWPup_WP_CLI');
     }
 }
コード例 #3
0
 /**
  * @param $jobdest
  * @param $backupfile
  */
 public function file_delete($jobdest, $backupfile)
 {
     $files = get_site_transient('backwpup_' . strtolower($jobdest));
     list($jobid, $dest) = explode('_', $jobdest);
     if (BackWPup_Option::get($jobid, 'ftphost') && BackWPup_Option::get($jobid, 'ftpuser') && BackWPup_Option::get($jobid, 'ftppass') && function_exists('ftp_connect')) {
         $ftp_conn_id = FALSE;
         if (function_exists('ftp_ssl_connect') && BackWPup_Option::get($jobid, 'ftpssl')) {
             //make SSL FTP connection
             $ftp_conn_id = ftp_ssl_connect(BackWPup_Option::get($jobid, 'ftphost'), BackWPup_Option::get($jobid, 'ftphostport'), BackWPup_Option::get($jobid, 'ftptimeout'));
         } elseif (!BackWPup_Option::get($jobid, 'ftpssl')) {
             //make normal FTP conection if SSL not work
             $ftp_conn_id = ftp_connect(BackWPup_Option::get($jobid, 'ftphost'), BackWPup_Option::get($jobid, 'ftphostport'), BackWPup_Option::get($jobid, 'ftptimeout'));
         }
         $loginok = FALSE;
         if ($ftp_conn_id) {
             //FTP Login
             if (@ftp_login($ftp_conn_id, BackWPup_Option::get($jobid, 'ftpuser'), BackWPup_Encryption::decrypt(BackWPup_Option::get($jobid, 'ftppass')))) {
                 $loginok = TRUE;
             } else {
                 //if PHP ftp login don't work use raw login
                 ftp_raw($ftp_conn_id, 'USER ' . BackWPup_Option::get($jobid, 'ftpuser'));
                 $return = ftp_raw($ftp_conn_id, 'PASS ' . BackWPup_Encryption::decrypt(BackWPup_Option::get($jobid, 'ftppass')));
                 if (substr(trim($return[0]), 0, 3) <= 400) {
                     $loginok = TRUE;
                 }
             }
         }
         if ($loginok) {
             ftp_pasv($ftp_conn_id, BackWPup_Option::get($jobid, 'ftppasv'));
             ftp_delete($ftp_conn_id, $backupfile);
             //update file list
             foreach ($files as $key => $file) {
                 if (is_array($file) && $file['file'] == $backupfile) {
                     unset($files[$key]);
                 }
             }
         } else {
             BackWPup_Admin::message(__('FTP: Login failure!', 'backwpup'), TRUE);
         }
     }
     set_site_transient('backwpup_' . strtolower($jobdest), $files, YEAR_IN_SECONDS);
 }
コード例 #4
0
ファイル: class-easycron.php プロジェクト: yszar/linuxwp
 private static function query_api($endpoint, array $params)
 {
     $message = array('status' => 'error', 'error' => array('code' => 0, 'message' => 'Please setup EasyCron auth api key in settings'));
     $params['token'] = get_site_option('backwpup_cfg_easycronapikey');
     if (empty($params['token'])) {
         return $message;
     }
     $result = wp_remote_get('https://www.easycron.com/rest/' . $endpoint . '?' . http_build_query($params));
     if (wp_remote_retrieve_response_code($result) != 200) {
         $message['error']['code'] = wp_remote_retrieve_response_code($result);
         $message['error']['message'] = wp_remote_retrieve_response_message($result);
     } else {
         $json = wp_remote_retrieve_body($result);
         $message = json_decode($json, TRUE);
     }
     if ($message['status'] != 'success') {
         BackWPup_Admin::message(sprintf(__('EasyCron.com API returns (%s): %s', 'backwpup'), esc_attr($message['error']['code']), esc_attr($message['error']['message'])), TRUE);
     }
     return $message;
 }
コード例 #5
0
ファイル: class-page-backups.php プロジェクト: skinnard/FTL-2
    /**
     * Display the page content
     */
    public static function page()
    {
        ?>
		<div class="wrap" id="backwpup-page">
			<h1><?php 
        echo esc_html(sprintf(__('%s &rsaquo; Manage Backup Archives', 'backwpup'), BackWPup::get_plugin_data('name')));
        ?>
</h1>
			<?php 
        BackWPup_Admin::display_messages();
        ?>
            <form id="posts-filter" action="" method="get">
            	<input type="hidden" name="page" value="backwpupbackups" />
				<?php 
        self::$listtable->display();
        ?>
                <div id="ajax-response"></div>
            </form>
        </div>
		<?php 
    }
コード例 #6
0
 /**
  * @param $jobdest
  * @param $backupfile
  */
 public function file_delete($jobdest, $backupfile)
 {
     $files = get_site_transient('backwpup_' . strtolower($jobdest), array());
     list($jobid, $dest) = explode('_', $jobdest);
     if (BackWPup_Option::get($jobid, 's3accesskey') && BackWPup_Option::get($jobid, 's3secretkey') && BackWPup_Option::get($jobid, 's3bucket')) {
         try {
             $s3 = new AmazonS3(array('key' => BackWPup_Option::get($jobid, 's3accesskey'), 'secret' => BackWPup_Encryption::decrypt(BackWPup_Option::get($jobid, 's3secretkey')), 'certificate_authority' => TRUE));
             $base_url = $this->get_s3_base_url(BackWPup_Option::get($jobid, 's3region'), BackWPup_Option::get($jobid, 's3base_url'));
             if (stristr($base_url, 'amazonaws.com')) {
                 $s3->set_region(str_replace(array('http://', 'https://'), '', $base_url));
             } else {
                 $s3->set_hostname(str_replace(array('http://', 'https://'), '', $base_url));
                 $s3->allow_hostname_override(FALSE);
                 if (substr($base_url, -1) == '/') {
                     $s3->enable_path_style(TRUE);
                 }
             }
             if (stristr($base_url, 'http://')) {
                 $s3->disable_ssl();
             }
             $s3->delete_object(BackWPup_Option::get($jobid, 's3bucket'), $backupfile);
             //update file list
             foreach ($files as $key => $file) {
                 if (is_array($file) && $file['file'] == $backupfile) {
                     unset($files[$key]);
                 }
             }
             unset($s3);
         } catch (Exception $e) {
             BackWPup_Admin::message(sprintf(__('S3 Service API: %s', 'backwpup'), $e->getMessage()), TRUE);
         }
     }
     set_site_transient('backwpup_' . strtolower($jobdest), $files, 60 * 60 * 24 * 7);
 }
コード例 #7
0
    /**
     *
     */
    public static function page()
    {
        if (!empty($_GET['jobid'])) {
            $jobid = (int) $_GET['jobid'];
        } else {
            //generate jobid if not exists
            $newjobid = BackWPup_Option::get_job_ids();
            sort($newjobid);
            $jobid = end($newjobid) + 1;
        }
        $destinations = BackWPup::get_registered_destinations();
        $job_types = BackWPup::get_job_types();
        ?>
    <div class="wrap" id="backwpup-page">
		<?php 
        echo '<h2><span id="backwpup-page-icon">&nbsp;</span>' . sprintf(__('%1$s Job: %2$s', 'backwpup'), BackWPup::get_plugin_data('name'), '<span id="h2jobtitle">' . esc_html(BackWPup_Option::get($jobid, 'name')) . '</span>') . '</h2>';
        //default tabs
        $tabs = array('job' => array('name' => __('General', 'backwpup'), 'display' => TRUE), 'cron' => array('name' => __('Schedule', 'backwpup'), 'display' => TRUE));
        //add jobtypes to tabs
        $job_job_types = BackWPup_Option::get($jobid, 'type');
        foreach ($job_types as $typeid => $typeclass) {
            $tabid = 'jobtype-' . strtolower($typeid);
            $tabs[$tabid]['name'] = $typeclass->info['name'];
            $tabs[$tabid]['display'] = TRUE;
            if (!in_array($typeid, $job_job_types)) {
                $tabs[$tabid]['display'] = FALSE;
            }
        }
        //add destinations to tabs
        $jobdests = BackWPup_Option::get($jobid, 'destinations');
        foreach ($destinations as $destid => $dest) {
            $tabid = 'dest-' . strtolower($destid);
            $tabs[$tabid]['name'] = sprintf(__('To: %s', 'backwpup'), $dest['info']['name']);
            $tabs[$tabid]['display'] = TRUE;
            if (!in_array($destid, $jobdests)) {
                $tabs[$tabid]['display'] = FALSE;
            }
        }
        //display tabs
        echo '<h2 class="nav-tab-wrapper">';
        foreach ($tabs as $id => $tab) {
            $addclass = '';
            if ($id == $_GET['tab']) {
                $addclass = ' nav-tab-active';
            }
            $display = '';
            if (!$tab['display']) {
                $display = ' style="display:none;"';
            }
            echo '<a href="' . wp_nonce_url(network_admin_url('admin.php') . '?page=backwpupeditjob&tab=' . $id . '&jobid=' . $jobid, 'edit-job') . '" class="nav-tab' . $addclass . '" id="tab-' . $id . '" data-nexttab="' . $id . '" ' . $display . '>' . $tab['name'] . '</a>';
        }
        echo '</h2>';
        //display messages
        BackWPup_Admin::display_messages();
        echo '<form name="editjob" id="editjob" method="post" action="' . admin_url('admin-post.php') . '">';
        echo '<input type="hidden" id="jobid" name="jobid" value="' . $jobid . '" />';
        echo '<input type="hidden" name="tab" value="' . $_GET['tab'] . '" />';
        echo '<input type="hidden" name="nexttab" value="' . $_GET['tab'] . '" />';
        echo '<input type="hidden" name="page" value="backwpupeditjob" />';
        echo '<input type="hidden" name="action" value="backwpup" />';
        echo '<input type="hidden" name="anchor" value="" />';
        wp_nonce_field('backwpupeditjob_page');
        wp_nonce_field('backwpup_ajax_nonce', 'backwpupajaxnonce', FALSE);
        switch ($_GET['tab']) {
            case 'job':
                echo '<div class="table" id="info-tab-job">';
                ?>
				<h3 class="title"><?php 
                _e('Job Name', 'backwpup');
                ?>
</h3>
				<p></p>
				<table class="form-table">
					<tr>
						<th scope="row"><label for="name"><?php 
                _e('Please name this job.', 'backwpup');
                ?>
</label></th>
						<td>
							<input name="name" type="text" id="name" data-empty="<?php 
                _e('New Job', 'backwpup');
                ?>
"
								   value="<?php 
                echo BackWPup_Option::get($jobid, 'name');
                ?>
" class="regular-text" />
						</td>
					</tr>
				</table>

				<h3 class="title"><?php 
                _e('Job Tasks', 'backwpup');
                ?>
</h3>
				<p></p>
				<table class="form-table">
					<tr>
						<th scope="row"><?php 
                _e('This job is a&#160;&hellip;', 'backwpup');
                ?>
</th>
						<td>
							<fieldset>
								<legend class="screen-reader-text"><span><?php 
                _e('Job tasks', 'backwpup');
                ?>
</span>
								</legend><?php 
                foreach ($job_types as $id => $typeclass) {
                    $addclass = '';
                    if ($typeclass->creates_file()) {
                        $addclass .= ' filetype';
                    }
                    $title = '';
                    if (!empty($typeclass->info['help'])) {
                        $title = ' title="' . esc_attr($typeclass->info['help']) . '"';
                        $addclass .= ' help-tip';
                    }
                    echo '<label for="jobtype-select-' . strtolower($id) . '"><input class="jobtype-select checkbox' . $addclass . '"' . $title . '  id="jobtype-select-' . strtolower($id) . '" type="checkbox" ' . checked(TRUE, in_array($id, BackWPup_Option::get($jobid, 'type')), FALSE) . ' name="type[]" value="' . $id . '" /> ' . $typeclass->info['description'] . '</label><br />';
                }
                ?>
</fieldset>
						</td>
					</tr>
				</table>

				<h3 class="title hasdests"><?php 
                _e('Backup File Creation', 'backwpup');
                ?>
</h3>
				<p class="hasdests"></p>
				<table class="form-table hasdests">
					<?php 
                if (class_exists('BackWPup_Pro', FALSE)) {
                    ?>
					<tr>
						<th scope="row"><?php 
                    _e('Backup type', 'backwpup');
                    ?>
</th>
						<td>
							<fieldset>
								<legend class="screen-reader-text">	<span><?php 
                    _e('Backup type', 'backwpup');
                    ?>
</span></legend>
								<label for="idbackuptype-sync"><input class="radio"
									   type="radio"<?php 
                    checked('sync', BackWPup_Option::get($jobid, 'backuptype'), TRUE);
                    ?>
									   name="backuptype" id="idbackuptype-sync"
									   value="sync"/> <?php 
                    _e('Synchronize file by file to destination', 'backwpup');
                    ?>
</label><br/>
                                <label for="idbackuptype-archive"><input class="radio"
									   type="radio"<?php 
                    checked('archive', BackWPup_Option::get($jobid, 'backuptype'), TRUE);
                    ?>
									   name="backuptype" id="idbackuptype-archive"
									   value="archive"/> <?php 
                    _e('Create a backup archive', 'backwpup');
                    ?>
</label><br/>
							</fieldset>
						</td>
					</tr>
					<?php 
                }
                ?>
					<tr class="nosync">
						<th scope="row"><label for="archivename"><?php 
                _e('Archive name', 'backwpup');
                ?>
</label></th>
						<td>
							<input name="archivename" type="text" id="archivename"
								value="<?php 
                echo BackWPup_Option::get($jobid, 'archivename');
                ?>
"
								class="regular-text code help-tip" title="<?php 
                echo "<strong>" . esc_attr__('Replacement patterns:', 'backwpup') . "</strong><br />";
                echo esc_attr__('%d = Two digit day of the month, with leading zeros', 'backwpup') . '<br />';
                echo esc_attr__('%j = Day of the month, without leading zeros', 'backwpup') . '<br />';
                echo esc_attr__('%m = Day of the month, with leading zeros', 'backwpup') . '<br />';
                echo esc_attr__('%n = Representation of the month (without leading zeros)', 'backwpup') . '<br />';
                echo esc_attr__('%Y = Four digit representation for the year', 'backwpup') . '<br />';
                echo esc_attr__('%y = Two digit representation of the year', 'backwpup') . '<br />';
                echo esc_attr__('%a = Lowercase ante meridiem (am) and post meridiem (pm)', 'backwpup') . '<br />';
                echo esc_attr__('%A = Uppercase ante meridiem (AM) and post meridiem (PM)', 'backwpup') . '<br />';
                echo esc_attr__('%B = Swatch Internet Time', 'backwpup') . '<br />';
                echo esc_attr__('%g = Hour in 12-hour format, without leading zeros', 'backwpup') . '<br />';
                echo esc_attr__('%G = Hour in 24-hour format, without leading zeros', 'backwpup') . '<br />';
                echo esc_attr__('%h = Hour in 12-hour format, with leading zeros', 'backwpup') . '<br />';
                echo esc_attr__('%H = Hour in 24-hour format, with leading zeros', 'backwpup') . '<br />';
                echo esc_attr__('%i = Two digit representation of the minute', 'backwpup') . '<br />';
                echo esc_attr__('%s = Two digit representation of the second', 'backwpup') . '<br />';
                ?>
" />
							<?php 
                $current_time = current_time('timestamp');
                $datevars = array('%d', '%j', '%m', '%n', '%Y', '%y', '%a', '%A', '%B', '%g', '%G', '%h', '%H', '%i', '%s');
                $datevalues = array(date('d', $current_time), date('j', $current_time), date('m', $current_time), date('n', $current_time), date('Y', $current_time), date('y', $current_time), date('a', $current_time), date('A', $current_time), date('B', $current_time), date('g', $current_time), date('G', $current_time), date('h', $current_time), date('H', $current_time), date('i', $current_time), date('s', $current_time));
                $archivename = str_replace($datevars, $datevalues, BackWPup_Job::sanitize_file_name(BackWPup_Option::get($jobid, 'archivename')));
                echo '<p>Preview: <code><span id="archivefilename">' . $archivename . '</span><span id="archiveformat">' . BackWPup_Option::get($jobid, 'archiveformat') . '</span></code></p>';
                ?>
						</td>
					</tr>
					<tr class="nosync">
						<th scope="row"><?php 
                _e('Archive Format', 'backwpup');
                ?>
</th>
						<td>
							<fieldset>
								<legend class="screen-reader-text"><span><?php 
                _e('Archive Format', 'backwpup');
                ?>
</span></legend>
								<?php 
                if (function_exists('gzopen') || class_exists('ZipArchive')) {
                    echo '<label for="idarchiveformat-zip"><input class="radio help-tip" title="' . __('PHP Zip functions will be used if available (needs less memory). Otherwise the PCLZip class will be used.', 'backwpup') . '" type="radio"' . checked('.zip', BackWPup_Option::get($jobid, 'archiveformat'), FALSE) . ' name="archiveformat" id="idarchiveformat-zip" value=".zip" /> ' . __('Zip', 'backwpup') . '</label><br />';
                } else {
                    echo '<label for="idarchiveformat-zip"><input class="radio help-tip" title="' . __('Disabled due to missing PHP function.', 'backwpup') . '" type="radio"' . checked('.zip', BackWPup_Option::get($jobid, 'archiveformat'), FALSE) . ' name="archiveformat" id="idarchiveformat-zip" value=".zip" disabled="disabled" /> ' . __('Zip', 'backwpup') . '</label><br />';
                }
                echo '<label for="idarchiveformat-tar"><input class="radio help-tip" title="' . __('A tarballed, not compressed archive (fast and less memory)', 'backwpup') . '" type="radio"' . checked('.tar', BackWPup_Option::get($jobid, 'archiveformat'), FALSE) . ' name="archiveformat" id="idarchiveformat-tar" value=".tar" /> ' . __('Tar', 'backwpup') . '</label><br />';
                if (function_exists('gzopen')) {
                    echo '<label for="idarchiveformat-targz"><input class="radio help-tip" title="' . __('A tarballed, GZipped archive (fast and less memory)', 'backwpup') . '" type="radio"' . checked('.tar.gz', BackWPup_Option::get($jobid, 'archiveformat'), FALSE) . ' name="archiveformat" id="idarchiveformat-targz" value=".tar.gz" /> ' . __('Tar GZip', 'backwpup') . '</label><br />';
                } else {
                    echo '<label for="idarchiveformat-targz"><input class="radio help-tip" title="' . __('Disabled due to missing PHP function.', 'backwpup') . '" type="radio"' . checked('.tar.gz', BackWPup_Option::get($jobid, 'archiveformat'), FALSE) . ' name="archiveformat" id="idarchiveformat-targz" value=".tar.gz" disabled="disabled" /> ' . __('Tar GZip', 'backwpup') . '</label><br />';
                }
                if (function_exists('bzopen')) {
                    echo '<label for="idarchiveformat-tarbz2"><input class="radio help-tip" title="' . __('A tarballed, BZipped archive (fast and less memory)', 'backwpup') . '" type="radio"' . checked('.tar.bz2', BackWPup_Option::get($jobid, 'archiveformat'), FALSE) . ' name="archiveformat" id="idarchiveformat-tarbz2" value=".tar.bz2" /> ' . __('Tar BZip2', 'backwpup') . '</label><br />';
                } else {
                    echo '<label for="idarchiveformat-tarbz2"><input class="radio help-tip" title="' . __('Disabled due to missing PHP function.', 'backwpup') . '" type="radio"' . checked('.tar.bz2', BackWPup_Option::get($jobid, 'archiveformat'), FALSE) . ' name="archiveformat" id="idarchiveformat-tarbz2" value=".tar.bz2" disabled="disabled" /> ' . __('Tar BZip2', 'backwpup') . '</label><br />';
                }
                ?>
</fieldset>
						</td>
					</tr>
				</table>

				<h3 class="title hasdests"><?php 
                _e('Job Destination', 'backwpup');
                ?>
</h3>
				<p class="hasdests"></p>
				<table class="form-table hasdests">
					<tr>
						<th scope="row"><?php 
                _e('Where should your backup file be stored?', 'backwpup');
                ?>
</th>
						<td>
							<fieldset>
								<legend class="screen-reader-text"><span><?php 
                _e('Where should your backup file be stored?', 'backwpup');
                ?>
</span>
								</legend><?php 
                foreach ($destinations as $id => $dest) {
                    $syncclass = '';
                    if (!$dest['can_sync']) {
                        $syncclass = 'nosync';
                    }
                    $title = '';
                    $helpclass = '';
                    if (!empty($dest['info']['help'])) {
                        $title = ' title="' . esc_attr($dest['info']['help']) . '"';
                        $helpclass = ' help-tip';
                    }
                    echo '<span class="' . $syncclass . '"><label for="dest-select-' . strtolower($id) . '"><input class="checkbox' . $helpclass . '"' . $title . ' id="dest-select-' . strtolower($id) . '" type="checkbox" ' . checked(TRUE, in_array($id, BackWPup_Option::get($jobid, 'destinations')), FALSE) . ' name="destinations[]" value="' . $id . '" ' . disabled(!empty($dest['error']), TRUE, FALSE) . ' /> ' . $dest['info']['description'];
                    if (!empty($dest['error'])) {
                        echo '<br /><span class="description">' . $dest['error'] . '</span>';
                    }
                    echo '</label><br /></span>';
                }
                ?>
</fieldset>
						</td>
					</tr>
				</table>

				<h3 class="title"><?php 
                _e('Log Files', 'backwpup');
                ?>
</h3>
				<p></p>
				<table class="form-table">
					<tr>
						<th scope="row"><label for="mailaddresslog"><?php 
                _e('Send log to email address', 'backwpup');
                ?>
</label></th>
						<td>
							<input name="mailaddresslog" type="text" id="mailaddresslog"
								   value="<?php 
                echo BackWPup_Option::get($jobid, 'mailaddresslog');
                ?>
"
								   class="regular-text help-tip" title="<?php 
                esc_attr_e('Leave empty to not have log sent. Or separate with , for more than one receiver.', 'backwpup');
                ?>
" />
						</td>
					</tr>
					<tr>
						<th scope="row"><label for="mailaddresssenderlog"><?php 
                _e('Email FROM field', 'backwpup');
                ?>
</label></th>
						<td>
							<input name="mailaddresssenderlog" type="text" id="mailaddresssenderlog"
								   value="<?php 
                echo BackWPup_Option::get($jobid, 'mailaddresssenderlog');
                ?>
"
								   class="regular-text help-tip" title="<?php 
                esc_attr_e('Email "From" field (Name &lt;&#160;you@your-email-address.tld&#160;&gt;)', 'backwpup');
                ?>
" />
						</td>
					</tr>
					<tr>
						<th scope="row"><?php 
                _e('Errors only', 'backwpup');
                ?>
</th>
						<td>
                            <label for="idmailerroronly">
							<input class="checkbox" value="1" id="idmailerroronly"
								   type="checkbox" <?php 
                checked(BackWPup_Option::get($jobid, 'mailerroronly'), TRUE);
                ?>
								   name="mailerroronly" /> <?php 
                _e('Send email with log only when errors occur during job execution.', 'backwpup');
                ?>
							</label>
						</td>
					</tr>
				</table>
				<?php 
                echo '</div>';
                break;
            case 'cron':
                echo '<div class="table" id="info-tab-cron">';
                ?>
				<h3 class="title"><?php 
                _e('Job Schedule', 'backwpup');
                ?>
</h3>
				<p></p>
				<table class="form-table">
					<tr>
                        <th scope="row"><?php 
                _e('Start job', 'backwpup');
                ?>
</th>
                        <td>
                            <fieldset>
                                <legend class="screen-reader-text"><span><?php 
                _e('Start job', 'backwpup');
                ?>
</span></legend>
                                <label for="idactivetype"><input class="radio"
                                       type="radio"<?php 
                checked('', BackWPup_Option::get($jobid, 'activetype'), TRUE);
                ?>
                                       name="activetype" id="idactivetype"
                                       value="" /> <?php 
                _e('manually only', 'backwpup');
                ?>
</label><br/>
                                <label for="idactivetype-wpcron"><input class="radio"
                                       type="radio"<?php 
                checked('wpcron', BackWPup_Option::get($jobid, 'activetype'), TRUE);
                ?>
                                       name="activetype" id="idactivetype-wpcron"
                                       value="wpcron" /> <?php 
                _e('with WordPress cron', 'backwpup');
                ?>
</label><br/>
	                            <?php 
                $disabled = '';
                $easycron_api = get_site_option('backwpup_cfg_easycronapikey');
                if (empty($easycron_api)) {
                    $disabled = ' disabled="disabled"';
                }
                ?>
	                            <label for="idactivetype-easycron"><input class="radio help-tip"
			                            type="radio"<?php 
                checked('easycron', BackWPup_Option::get($jobid, 'activetype'), TRUE);
                ?>
			                            name="activetype" id="idactivetype-easycron"<?php 
                echo $disabled;
                ?>
			                            value="easycron" title="<?php 
                _e('Use EasyCron.com Cron jobs.');
                ?>
" /> <?php 
                _e('with <a href="https://www.easycron.com?ref=36673" class="help-tip" title="Affiliate Link!">EasyCron.com</a>', 'backwpup');
                ?>
	                            <?php 
                if (empty($easycron_api)) {
                    echo ' <strong>' . sprintf(__('Setup <a href="https://www.easycron.com?ref=36673" class="help-tip" title="Affiliate Link!">Account</a> / <a href="%s">API Key</a> first.', 'backwpup'), network_admin_url('admin.php') . '?page=backwpupsettings#backwpup-tab-apikey') . '</strong>';
                }
                ?>
	                            </label><br/>
	                            <?php 
                $url = BackWPup_Job::get_jobrun_url('runext', BackWPup_Option::get($jobid, 'jobid'));
                ?>
                                <label for="idactivetype-link"><input class="radio help-tip"
									   type="radio"<?php 
                checked('link', BackWPup_Option::get($jobid, 'activetype'), TRUE);
                ?>
									   name="activetype" id="idactivetype-link"
									   value="link" title="<?php 
                esc_attr_e('Copy the link for an external start. This option has to be activated to make the link work.', 'backwpup');
                ?>
" /> <?php 
                _e('with a link', 'backwpup');
                ?>
 <code><a href="<?php 
                echo $url['url'];
                ?>
" target="_blank"><?php 
                echo $url['url'];
                ?>
</a></code></label>
								<br />
                            </fieldset>
                        </td>
                    </tr>
                    <tr>
						<th scope="row"><?php 
                _e('Start job with CLI', 'backwpup');
                ?>
</th>
						<td class="help-tip" title="<?php 
                esc_attr_e('Use WP-CLI commands to let the job start with the server’s cron on command line interface.', 'backwpup');
                ?>
">
							<?php 
                _e('Use <a href="http://wp-cli.org/">WP-CLI</a> to run jobs from commandline.', 'backwpup');
                ?>
						</td>
                    </tr>
				</table>
				<h3 class="title wpcron"><?php 
                _e('Schedule execution time', 'backwpup');
                ?>
</h3>
				<?php 
                BackWPup_Page_Editjob::ajax_cron_text(array('cronstamp' => BackWPup_Option::get($jobid, 'cron'), 'crontype' => BackWPup_Option::get($jobid, 'cronselect')));
                ?>
				<table class="form-table wpcron">
					<tr>
						<th scope="row"><?php 
                _e('Scheduler type', 'backwpup');
                ?>
</th>
						<td>
							<fieldset>
								<legend class="screen-reader-text"><span><?php 
                _e('Scheduler type', 'backwpup');
                ?>
</span></legend>
                                <label for="idcronselect-basic"><input class="radio"
									   type="radio"<?php 
                checked('basic', BackWPup_Option::get($jobid, 'cronselect'), TRUE);
                ?>
									   name="cronselect" id="idcronselect-basic"
									   value="basic" /> <?php 
                _e('basic', 'backwpup');
                ?>
</label><br/>
                                <label for="idcronselect-advanced"><input class="radio"
									   type="radio"<?php 
                checked('advanced', BackWPup_Option::get($jobid, 'cronselect'), TRUE);
                ?>
									   name="cronselect" id="idcronselect-advanced"
									   value="advanced" /> <?php 
                _e('advanced', 'backwpup');
                ?>
</label><br/>
							</fieldset>
						</td>
					</tr>
					<?php 
                list($cronstr['minutes'], $cronstr['hours'], $cronstr['mday'], $cronstr['mon'], $cronstr['wday']) = explode(' ', BackWPup_Option::get($jobid, 'cron'), 5);
                if (strstr($cronstr['minutes'], '*/')) {
                    $minutes = explode('/', $cronstr['minutes']);
                } else {
                    $minutes = explode(',', $cronstr['minutes']);
                }
                if (strstr($cronstr['hours'], '*/')) {
                    $hours = explode('/', $cronstr['hours']);
                } else {
                    $hours = explode(',', $cronstr['hours']);
                }
                if (strstr($cronstr['mday'], '*/')) {
                    $mday = explode('/', $cronstr['mday']);
                } else {
                    $mday = explode(',', $cronstr['mday']);
                }
                if (strstr($cronstr['mon'], '*/')) {
                    $mon = explode('/', $cronstr['mon']);
                } else {
                    $mon = explode(',', $cronstr['mon']);
                }
                if (strstr($cronstr['wday'], '*/')) {
                    $wday = explode('/', $cronstr['wday']);
                } else {
                    $wday = explode(',', $cronstr['wday']);
                }
                ?>
                    <tr class="wpcronbasic"<?php 
                if (BackWPup_Option::get($jobid, 'cronselect') != 'basic') {
                    echo ' style="display:none;"';
                }
                ?>
>
                        <th scope="row"><?php 
                _e('Scheduler', 'backwpup');
                ?>
</th>
                        <td>
                            <table id="wpcronbasic">
                                <tr>
                                    <th>
										<?php 
                _e('Type', 'backwpup');
                ?>
                                    </th>
                                    <th>
                                    </th>
                                    <th>
										<?php 
                _e('Hour', 'backwpup');
                ?>
                                    </th>
                                    <th>
										<?php 
                _e('Minute', 'backwpup');
                ?>
                                    </th>
                                </tr>
                                <tr>
                                    <td><label for="idcronbtype-mon"><?php 
                echo '<input class="radio" type="radio"' . checked(TRUE, is_numeric($mday[0]), FALSE) . ' name="cronbtype" id="idcronbtype-mon" value="mon" /> ' . __('monthly', 'backwpup');
                ?>
</label></td>
                                    <td><select name="moncronmday"><?php 
                for ($i = 1; $i <= 31; $i++) {
                    echo '<option ' . selected(in_array("{$i}", $mday, TRUE), TRUE, FALSE) . '  value="' . $i . '" />' . __('on', 'backwpup') . ' ' . $i . '</option>';
                }
                ?>
</select></td>
                                    <td><select name="moncronhours"><?php 
                for ($i = 0; $i < 24; $i++) {
                    echo '<option ' . selected(in_array("{$i}", $hours, TRUE), TRUE, FALSE) . '  value="' . $i . '" />' . $i . '</option>';
                }
                ?>
</select></td>
                                    <td><select name="moncronminutes"><?php 
                for ($i = 0; $i < 60; $i = $i + 5) {
                    echo '<option ' . selected(in_array("{$i}", $minutes, TRUE), TRUE, FALSE) . '  value="' . $i . '" />' . $i . '</option>';
                }
                ?>
</select></td>
                                </tr>
                                <tr>
                                    <td><label for="idcronbtype-week"><?php 
                echo '<input class="radio" type="radio"' . checked(TRUE, is_numeric($wday[0]), FALSE) . ' name="cronbtype" id="idcronbtype-week" value="week" /> ' . __('weekly', 'backwpup');
                ?>
</label></td>
                                    <td><select name="weekcronwday">
										<?php 
                echo '<option ' . selected(in_array("0", $wday, TRUE), TRUE, FALSE) . '  value="0" />' . __('Sunday', 'backwpup') . '</option>';
                echo '<option ' . selected(in_array("1", $wday, TRUE), TRUE, FALSE) . '  value="1" />' . __('Monday', 'backwpup') . '</option>';
                echo '<option ' . selected(in_array("2", $wday, TRUE), TRUE, FALSE) . '  value="2" />' . __('Tuesday', 'backwpup') . '</option>';
                echo '<option ' . selected(in_array("3", $wday, TRUE), TRUE, FALSE) . '  value="3" />' . __('Wednesday', 'backwpup') . '</option>';
                echo '<option ' . selected(in_array("4", $wday, TRUE), TRUE, FALSE) . '  value="4" />' . __('Thursday', 'backwpup') . '</option>';
                echo '<option ' . selected(in_array("5", $wday, TRUE), TRUE, FALSE) . '  value="5" />' . __('Friday', 'backwpup') . '</option>';
                echo '<option ' . selected(in_array("6", $wday, TRUE), TRUE, FALSE) . '  value="6" />' . __('Saturday', 'backwpup') . '</option>';
                ?>
                                    </select></td>
                                    <td><select name="weekcronhours"><?php 
                for ($i = 0; $i < 24; $i++) {
                    echo '<option ' . selected(in_array("{$i}", $hours, TRUE), TRUE, FALSE) . '  value="' . $i . '" />' . $i . '</option>';
                }
                ?>
</select></td>
                                    <td><select name="weekcronminutes"><?php 
                for ($i = 0; $i < 60; $i = $i + 5) {
                    echo '<option ' . selected(in_array("{$i}", $minutes, TRUE), TRUE, FALSE) . '  value="' . $i . '" />' . $i . '</option>';
                }
                ?>
</select></td>
                                </tr>
                                <tr>
                                    <td><label for="idcronbtype-day"><?php 
                echo '<input class="radio" type="radio"' . checked("**", $mday[0] . $wday[0], FALSE) . ' name="cronbtype" id="idcronbtype-day" value="day" /> ' . __('daily', 'backwpup');
                ?>
</label></td>
                                    <td></td>
                                    <td><select name="daycronhours"><?php 
                for ($i = 0; $i < 24; $i++) {
                    echo '<option ' . selected(in_array("{$i}", $hours, TRUE), TRUE, FALSE) . '  value="' . $i . '" />' . $i . '</option>';
                }
                ?>
</select></td>
                                    <td><select name="daycronminutes"><?php 
                for ($i = 0; $i < 60; $i = $i + 5) {
                    echo '<option ' . selected(in_array("{$i}", $minutes, TRUE), TRUE, FALSE) . '  value="' . $i . '" />' . $i . '</option>';
                }
                ?>
</select></td>
                                </tr>
                                <tr>
                                    <td><label for="idcronbtype-hour"><?php 
                echo '<input class="radio" type="radio"' . checked("*", $hours[0], FALSE, FALSE) . ' name="cronbtype" id="idcronbtype-hour" value="hour" /> ' . __('hourly', 'backwpup');
                ?>
</label></td>
                                    <td></td>
                                    <td></td>
                                    <td><select name="hourcronminutes"><?php 
                for ($i = 0; $i < 60; $i = $i + 5) {
                    echo '<option ' . selected(in_array("{$i}", $minutes, TRUE), TRUE, FALSE) . '  value="' . $i . '" />' . $i . '</option>';
                }
                ?>
</select></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
					<tr class="wpcronadvanced"<?php 
                if (BackWPup_Option::get($jobid, 'cronselect') != 'advanced') {
                    echo ' style="display:none;"';
                }
                ?>
>
						<th scope="row"><?php 
                _e('Scheduler', 'backwpup');
                ?>
</th>
						<td>
                            <div id="cron-min-box">
                                <b><?php 
                _e('Minutes:', 'backwpup');
                ?>
</b><br/>
								<?php 
                echo '<label for="idcronminutes"><input class="checkbox" type="checkbox"' . checked(in_array("*", $minutes, TRUE), TRUE, FALSE) . ' name="cronminutes[]" id="idcronminutes" value="*" /> ' . __('Any (*)', 'backwpup') . '</label><br />';
                ?>
                                <div id="cron-min"><?php 
                for ($i = 0; $i < 60; $i = $i + 5) {
                    echo '<label for="idcronminutes-' . $i . '"><input class="checkbox" type="checkbox"' . checked(in_array("{$i}", $minutes, TRUE), TRUE, FALSE) . ' name="cronminutes[]" id="idcronminutes-' . $i . '" value="' . $i . '" /> ' . $i . '</label><br />';
                }
                ?>
                                </div>
                            </div>
                            <div id="cron-hour-box">
                                <b><?php 
                _e('Hours:', 'backwpup');
                ?>
</b><br/>
								<?php 
                echo '<label for="idcronhours"><input class="checkbox" type="checkbox"' . checked(in_array("*", $hours, TRUE), TRUE, FALSE) . ' name="cronhours[]" for="idcronhours" value="*" /> ' . __('Any (*)', 'backwpup') . '</label><br />';
                ?>
                                <div id="cron-hour"><?php 
                for ($i = 0; $i < 24; $i++) {
                    echo '<label for="idcronhours-' . $i . '"><input class="checkbox" type="checkbox"' . checked(in_array("{$i}", $hours, TRUE), TRUE, FALSE) . ' name="cronhours[]" id="idcronhours-' . $i . '" value="' . $i . '" /> ' . $i . '</label><br />';
                }
                ?>
                                </div>
                            </div>
                            <div id="cron-day-box">
                                <b><?php 
                _e('Day of Month:', 'backwpup');
                ?>
</b><br/>
                                <label for="idcronmday"><input class="checkbox" type="checkbox"<?php 
                checked(in_array("*", $mday, TRUE), TRUE, TRUE);
                ?>
                                       name="cronmday[]" id="idcronmday" value="*"/> <?php 
                _e('Any (*)', 'backwpup');
                ?>
</label>
                                <br/>

                                <div id="cron-day">
									<?php 
                for ($i = 1; $i <= 31; $i++) {
                    echo '<label for="idcronmday-' . $i . '"><input class="checkbox" type="checkbox"' . checked(in_array("{$i}", $mday, TRUE), TRUE, FALSE) . ' name="cronmday[]" id="idcronmday-' . $i . '" value="' . $i . '" /> ' . $i . '</label><br />';
                }
                ?>
                                </div>
                            </div>
                            <div id="cron-month-box">
                                <b><?php 
                _e('Month:', 'backwpup');
                ?>
</b><br/>
								<?php 
                echo '<label for="idcronmon"><input class="checkbox" type="checkbox"' . checked(in_array("*", $mon, TRUE), TRUE, FALSE) . ' name="cronmon[]" id="idcronmon" value="*" /> ' . __('Any (*)', 'backwpup') . '</label><br />';
                ?>
                                <div id="cron-month">
									<?php 
                echo '<label for="idcronmon-1"><input class="checkbox" type="checkbox"' . checked(in_array("1", $mon, TRUE), TRUE, FALSE) . ' name="cronmon[]" id="idcronmon-1" value="1" /> ' . __('January', 'backwpup') . '</label><br />';
                echo '<label for="idcronmon-2"><input class="checkbox" type="checkbox"' . checked(in_array("2", $mon, TRUE), TRUE, FALSE) . ' name="cronmon[]" id="idcronmon-2" value="2" /> ' . __('February', 'backwpup') . '</label><br />';
                echo '<label for="idcronmon-3"><input class="checkbox" type="checkbox"' . checked(in_array("3", $mon, TRUE), TRUE, FALSE) . ' name="cronmon[]" id="idcronmon-3" value="3" /> ' . __('March', 'backwpup') . '</label><br />';
                echo '<label for="idcronmon-4"><input class="checkbox" type="checkbox"' . checked(in_array("4", $mon, TRUE), TRUE, FALSE) . ' name="cronmon[]" id="idcronmon-4" value="4" /> ' . __('April', 'backwpup') . '</label><br />';
                echo '<label for="idcronmon-5"><input class="checkbox" type="checkbox"' . checked(in_array("5", $mon, TRUE), TRUE, FALSE) . ' name="cronmon[]" id="idcronmon-5" value="5" /> ' . __('May', 'backwpup') . '</label><br />';
                echo '<label for="idcronmon-6"><input class="checkbox" type="checkbox"' . checked(in_array("6", $mon, TRUE), TRUE, FALSE) . ' name="cronmon[]" id="idcronmon-6" value="6" /> ' . __('June', 'backwpup') . '</label><br />';
                echo '<label for="idcronmon-7"><input class="checkbox" type="checkbox"' . checked(in_array("7", $mon, TRUE), TRUE, FALSE) . ' name="cronmon[]" id="idcronmon-7" value="7" /> ' . __('July', 'backwpup') . '</label><br />';
                echo '<label for="idcronmon-8"><input class="checkbox" type="checkbox"' . checked(in_array("8", $mon, TRUE), TRUE, FALSE) . ' name="cronmon[]" id="idcronmon-8" value="8" /> ' . __('August', 'backwpup') . '</label><br />';
                echo '<label for="idcronmon-9"><input class="checkbox" type="checkbox"' . checked(in_array("9", $mon, TRUE), TRUE, FALSE) . ' name="cronmon[]" id="idcronmon-9" value="9" /> ' . __('September', 'backwpup') . '</label><br />';
                echo '<label for="idcronmon-10"><input class="checkbox" type="checkbox"' . checked(in_array("10", $mon, TRUE), TRUE, FALSE) . ' name="cronmon[]" id="idcronmon-10" value="10" /> ' . __('October', 'backwpup') . '</label><br />';
                echo '<label for="idcronmon-11"><input class="checkbox" type="checkbox"' . checked(in_array("11", $mon, TRUE), TRUE, FALSE) . ' name="cronmon[]" id="idcronmon-11" value="11" /> ' . __('November', 'backwpup') . '</label><br />';
                echo '<label for="idcronmon-12"><input class="checkbox" type="checkbox"' . checked(in_array("12", $mon, TRUE), TRUE, FALSE) . ' name="cronmon[]" id="idcronmon-12" value="12" /> ' . __('December', 'backwpup') . '</label><br />';
                ?>
                                </div>
                            </div>
                            <div id="cron-weekday-box">
                                <b><?php 
                _e('Day of Week:', 'backwpup');
                ?>
</b><br/>
								<?php 
                echo '<label for="idcronwday"><input class="checkbox" type="checkbox"' . checked(in_array("*", $wday, TRUE), TRUE, FALSE) . ' name="cronwday[]" id="idcronwday" value="*" /> ' . __('Any (*)', 'backwpup') . '</label><br />';
                ?>
                                <div id="cron-weekday">
									<?php 
                echo '<label for="idcronwday-0"><input class="checkbox" type="checkbox"' . checked(in_array("0", $wday, TRUE), TRUE, FALSE) . ' name="cronwday[]" id="idcronwday-0" value="0" /> ' . __('Sunday', 'backwpup') . '</label><br />';
                echo '<label for="idcronwday-1"><input class="checkbox" type="checkbox"' . checked(in_array("1", $wday, TRUE), TRUE, FALSE) . ' name="cronwday[]" id="idcronwday-1" value="1" /> ' . __('Monday', 'backwpup') . '</label><br />';
                echo '<label for="idcronwday-2"><input class="checkbox" type="checkbox"' . checked(in_array("2", $wday, TRUE), TRUE, FALSE) . ' name="cronwday[]" id="idcronwday-2" value="2" /> ' . __('Tuesday', 'backwpup') . '</label><br />';
                echo '<label for="idcronwday-3"><input class="checkbox" type="checkbox"' . checked(in_array("3", $wday, TRUE), TRUE, FALSE) . ' name="cronwday[]" id="idcronwday-3" value="3" /> ' . __('Wednesday', 'backwpup') . '</label><br />';
                echo '<label for="idcronwday-4"><input class="checkbox" type="checkbox"' . checked(in_array("4", $wday, TRUE), TRUE, FALSE) . ' name="cronwday[]" id="idcronwday-4" value="4" /> ' . __('Thursday', 'backwpup') . '</label><br />';
                echo '<label for="idcronwday-5"><input class="checkbox" type="checkbox"' . checked(in_array("5", $wday, TRUE), TRUE, FALSE) . ' name="cronwday[]" id="idcronwday-5" value="5" /> ' . __('Friday', 'backwpup') . '</label><br />';
                echo '<label for="idcronwday-6"><input class="checkbox" type="checkbox"' . checked(in_array("6", $wday, TRUE), TRUE, FALSE) . ' name="cronwday[]" id="idcronwday-6" value="6" /> ' . __('Saturday', 'backwpup') . '</label><br />';
                ?>
                                </div>
                            </div>
                            <br class="clear"/>
						</td>
					</tr>
				</table>
				<?php 
                echo '</div>';
                break;
            default:
                echo '<div class="table" id="info-tab-' . $_GET['tab'] . '">';
                if (strstr($_GET['tab'], 'dest-')) {
                    $dest_object = BackWPup::get_destination(str_replace('dest-', '', $_GET['tab']));
                    $dest_object->edit_tab($jobid);
                }
                if (strstr($_GET['tab'], 'jobtype-')) {
                    $id = strtoupper(str_replace('jobtype-', '', $_GET['tab']));
                    $job_types[$id]->edit_tab($jobid);
                }
                echo '</div>';
        }
        echo '<p class="submit">';
        submit_button(__('Save changes', 'backwpup'), 'primary', 'save', FALSE, array('tabindex' => '2', 'accesskey' => 'p'));
        echo '</p></form>';
        ?>
    </div>

    <script type="text/javascript">
    //<![CDATA[
    jQuery(document).ready(function ($) {
        // auto post if things changed
        var changed = false;
        $( '#editjob' ).change( function () {
            changed = true;
        });
		$( '.nav-tab' ).click( function () {
			if ( changed ) {
				$( 'input[name="nexttab"]' ).val( $(this).data( "nexttab" ) );
				$( '#editjob' ).submit();
				return false;
            }
		});
		<?php 
        //add inline js
        if (strstr($_GET['tab'], 'dest-')) {
            $dest_object = BackWPup::get_destination(str_replace('dest-', '', $_GET['tab']));
            $dest_object->edit_inline_js();
        }
        if (strstr($_GET['tab'], 'jobtype-')) {
            $id = strtoupper(str_replace('jobtype-', '', $_GET['tab']));
            $job_types[$id]->edit_inline_js();
        }
        ?>
    });
    //]]>
    </script>
	<?php 
    }
コード例 #8
0
    /**
     * Print the markup.
     *
     * @return void
     */
    public static function page()
    {
        // get wizards
        $wizards = BackWPup::get_wizards();
        ?>
        <div class="wrap" id="backwpup-page">
            <h2><span id="backwpup-page-icon">&nbsp;</span><?php 
        echo sprintf(__('%s Dashboard', 'backwpup'), BackWPup::get_plugin_data('name'));
        ?>
</h2>
			<?php 
        BackWPup_Admin::display_messages();
        if (class_exists('BackWPup_Pro', FALSE)) {
            ?>
				<div class="backwpup-welcome backwpup-max-width">
					<h3><?php 
            _ex('Planning backups', 'Dashboard heading', 'backwpup');
            ?>
</h3>
					<p><?php 
            _e('BackWPup’s job wizards make planning and scheduling your backup jobs a breeze.', 'backwpup');
            echo ' ';
            _e('Use your backup archives to save your entire WordPress installation including <code>/wp-content/</code>. Push them to an external storage service if you don’t want to save the backups on the same server.', 'backwpup');
            ?>
</p>
					<h3><?php 
            _ex('Restoring backups', 'Dashboard heading', 'backwpup');
            ?>
</h3>
					<p><?php 
            _e('With a single backup archive you are able to restore an installation. Use a tool like phpMyAdmin or a plugin like <a href="http://wordpress.org/plugins/adminer/" target="_blank">Adminer</a> to restore your database backup files.', 'backwpup');
            ?>
</p>
					<h3><?php 
            _ex('Ready to set up a backup job?', 'Dashboard heading', 'backwpup');
            ?>
</h3>
					<p><?php 
            printf(__('Use one of the wizards to plan a backup, or use <a href="%s">expert mode</a> for full control over all options.', 'backwpup'), network_admin_url('admin.php') . '?page=backwpupeditjob');
            echo ' ';
            _e('<strong>Please note: You are solely responsible for the security of your data; the authors of this plugin are not.</strong>', 'backwpup');
            ?>
</p>
				</div>
			<?php 
        } else {
            ?>
				<div class="backwpup-welcome backwpup-max-width">
					<h3><?php 
            _ex('Planning backups', 'Dashboard heading', 'backwpup');
            ?>
</h3>
					<p><?php 
            _e('Use the short links in the <strong>First steps</strong> box to plan and schedule backup jobs.', 'backwpup');
            echo ' ';
            _e('Use your backup archives to save your entire WordPress installation including <code>/wp-content/</code>. Push them to an external storage service if you don’t want to save the backups on the same server.', 'backwpup');
            ?>
</p>
					<h3><?php 
            _ex('Restoring backups', 'Dashboard heading', 'backwpup');
            ?>
</h3>
					<p><?php 
            _e('With a single backup archive you are able to restore an installation. Use a tool like phpMyAdmin or a plugin like <a href="http://wordpress.org/plugins/adminer/" target="_blank">Adminer</a> to restore your database backup files.', 'backwpup');
            ?>
</p>
					<h3><?php 
            _ex('Ready to set up a backup job?', 'Dashboard heading', 'backwpup');
            ?>
</h3>
					<p><?php 
            printf(__('<a href="%s">Add a new backup job</a> and plan what you want to save.', 'backwpup'), network_admin_url('admin.php') . '?page=backwpupeditjob');
            ?>
					<br /><?php 
            _e('<strong>Please note: You are solely responsible for the security of your data; the authors of this plugin are not.</strong>', 'backwpup');
            ?>
</p>
				</div>
			<?php 
        }
        if (current_user_can('backwpup_jobs_edit') && current_user_can('backwpup_logs') && current_user_can('backwpup_jobs_start')) {
            ?>
				<div  id="backwpup-first-steps" class="metabox-holder postbox backwpup-floated-postbox">
					<h3 class="hndle"><span><?php 
            _e('First Steps', 'backwpup');
            ?>
</span></h3>
					<div class="inside">
						<ul>
							<?php 
            if (class_exists('BackWPup_Pro', FALSE)) {
                ?>
								<li type="1"><a href="<?php 
                echo wp_nonce_url(network_admin_url('admin.php') . '?page=backwpupwizard&wizard_start=SYSTEMTEST', 'wizard');
                ?>
"><?php 
                _e('Test the installation', 'backwpup');
                ?>
</a></li>
								<li type="1"><a href="<?php 
                echo wp_nonce_url(network_admin_url('admin.php') . '?page=backwpupwizard&wizard_start=JOB', 'wizard');
                ?>
"><?php 
                _e('Create a Job', 'backwpup');
                ?>
</a></li>
							<?php 
            } else {
                ?>
                           		<li type="1"><a href="<?php 
                echo network_admin_url('admin.php') . '?page=backwpupsettings#backwpup-tab-information';
                ?>
"><?php 
                _e('Check the installation', 'backwpup');
                ?>
</a></li>
                            	<li type="1"><a href="<?php 
                echo network_admin_url('admin.php') . '?page=backwpupeditjob';
                ?>
"><?php 
                _e('Create a Job', 'backwpup');
                ?>
</a></li>
							<?php 
            }
            ?>
							<li type="1"><a href="<?php 
            echo network_admin_url('admin.php') . '?page=backwpupjobs';
            ?>
"><?php 
            _e('Run the created job', 'backwpup');
            ?>
</a></li>
							<li type="1"><a href="<?php 
            echo network_admin_url('admin.php') . '?page=backwpuplogs';
            ?>
"><?php 
            _e('Check the job log', 'backwpup');
            ?>
</a></li>
						</ul>
					</div>
				</div>
			<?php 
        }
        if (current_user_can('backwpup_jobs_start')) {
            ?>
				<div id="backwpup-one-click-backup" class="metabox-holder postbox backwpup-floated-postbox">
					<h3 class="hndle"><span><?php 
            _e('One click backup', 'backwpup');
            ?>
</span></h3>
					<div class="inside">
						<a href="<?php 
            echo wp_nonce_url(network_admin_url('admin.php') . '?page=backwpup&action=dbdumpdl', 'backwpupdbdumpdl');
            ?>
" class="button button-primary button-primary-bwp" title="<?php 
            _e('Generate a database backup of WordPress tables and download it right away!', 'backwpup');
            ?>
"><?php 
            _e('Download database backup', 'backwpup');
            ?>
</a><br />
					</div>
				</div>
			<?php 
        }
        ?>

			<div id="backwpup-rss-feed" class="metabox-holder postbox backwpup-cleared-postbox backwpup-max-width">
				<h3 class="hndle"><span><?php 
        _e('BackWPup News', 'backwpup');
        ?>
</span></h3>
				<div class="inside">
					<?php 
        add_action('wp_feed_options', array(__CLASS__, 'wp_feed_options'));
        $rss = fetch_feed(_x('https://marketpress.com/tag/backwpup/feed/', 'BackWPup News RSS Feed URL', 'backwpup'));
        remove_action('wp_feed_options', array(__CLASS__, 'wp_feed_options'));
        if (is_wp_error($rss)) {
            echo '<p>' . sprintf(__('<strong>RSS Error</strong>: %s', 'backwpup'), $rss->get_error_message()) . '</p>';
        } elseif (!$rss->get_item_quantity()) {
            echo '<ul><li>' . __('An error has occurred, which probably means the feed is down. Try again later.', 'backwpup') . '</li></ul>';
            $rss->__destruct();
            unset($rss);
        } else {
            echo '<ul>';
            $first = TRUE;
            foreach ($rss->get_items(0, 4) as $item) {
                $link = $item->get_link();
                while (stristr($link, 'http') != $link) {
                    $link = substr($link, 1);
                }
                $link = esc_url(strip_tags($link));
                $title = esc_attr(strip_tags($item->get_title()));
                if (empty($title)) {
                    $title = __('Untitled', 'backwpup');
                }
                $desc = str_replace(array("\n", "\r"), ' ', esc_attr(strip_tags(@html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset')))));
                $excerpt = wp_html_excerpt($desc, 360);
                // Append ellipsis. Change existing [...] to [&hellip;].
                if ('[...]' == substr($excerpt, -5)) {
                    $excerpt = substr($excerpt, 0, -5) . '[&hellip;]';
                } elseif ('[&hellip;]' != substr($excerpt, -10) && $desc != $excerpt) {
                    $excerpt .= ' [&hellip;]';
                }
                $excerpt = esc_html($excerpt);
                if ($first) {
                    $summary = "<div class='rssSummary'>{$excerpt}</div>";
                } else {
                    $summary = '';
                }
                $date = '';
                if ($first) {
                    $date = $item->get_date('U');
                    if ($date) {
                        $date = ' <span class="rss-date">' . date_i18n(get_option('date_format'), $date) . '</span>';
                    }
                }
                echo "<li><a href=\"{$link}\" title=\"{$desc}\">{$title}</a>{$date}{$summary}</li>";
                $first = FALSE;
            }
            echo '</ul>';
            $rss->__destruct();
            unset($rss);
        }
        ?>
				</div>
			</div>

			<?php 
        if (class_exists('BackWPup_Pro', FALSE)) {
            /* @var BackWPup_Pro_Wizards $wizard_class */
            foreach ($wizards as $wizard_class) {
                //check permissions
                if (!current_user_can($wizard_class->info['cap'])) {
                    continue;
                }
                //get info of wizard
                echo '<div id="wizard-' . strtolower($wizard_class->info['ID']) . '" class="wizardbox post-box backwpup-floated-postbox"><form method="get" action="' . network_admin_url('admin.php') . '">';
                echo '<h3 class="wizardbox_name">' . $wizard_class->info['name'] . '</h3>';
                echo '<p class="wizardbox_description">' . $wizard_class->info['description'] . '</p>';
                $conf_names = $wizard_class->get_pre_configurations();
                if (!empty($conf_names)) {
                    echo '<select id="wizardbox_pre_conf" name="pre_conf" size="1">';
                    foreach ($conf_names as $conf_key => $conf_name) {
                        echo '<option value="' . esc_attr($conf_key) . '">' . esc_attr($conf_name) . '</option>';
                    }
                    echo '</select>';
                } else {
                    echo '<input type="hidden" name="pre_conf" value="" />';
                }
                wp_nonce_field('wizard');
                echo '<input type="hidden" name="page" value="backwpupwizard" />';
                echo '<input type="hidden" name="wizard_start" value="' . esc_attr($wizard_class->info['ID']) . '" />';
                echo '<div class="wizardbox_start"><input type="submit" name="submit" class="button button-primary button-primary-bwp" value="' . esc_attr(__('Start wizard', 'backwpup')) . '" /></div>';
                echo '</form></div>';
            }
        }
        ?>


	        <div class="metabox-holder postbox backwpup-floated-postbox">
		        <h3 class="hndle"><span><a href="https://www.ostraining.com/">OSTraining</a> <?php 
        _e('Video: Introduction', 'backwpup');
        ?>
</span></h3>
		        <iframe class="inside" width="340" height="190" src="https://www.youtube.com/embed/pECMkLE27QQ?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>
	        </div>

	        <div class="metabox-holder postbox backwpup-floated-postbox">
		        <h3 class="hndle"><span><a href="https://www.ostraining.com/">OSTraining</a> <?php 
        _e('Video: Settings', 'backwpup');
        ?>
</span></h3>
		        <iframe class="inside" width="340" height="190" src="https://www.youtube.com/embed/F55xEoDnS0U?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>
	        </div>

	        <div class="metabox-holder postbox backwpup-floated-postbox">
		        <h3 class="hndle"><span><a href="https://www.ostraining.com/">OSTraining</a> <?php 
        _e('Video: Daily Backups', 'backwpup');
        ?>
</span></h3>
		        <iframe class="inside" width="340" height="190" src="https://www.youtube.com/embed/staZo0DS5m4?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>
	        </div>

	        <div class="metabox-holder postbox backwpup-floated-postbox">
		        <h3 class="hndle"><span><a href="https://www.ostraining.com/">OSTraining</a> <?php 
        _e('Video: Creating Full Backups', 'backwpup');
        ?>
</span></h3>
		        <iframe class="inside" width="340" height="190" src="https://www.youtube.com/embed/3N9FbmBuaac?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>
	        </div>

	        <div class="metabox-holder postbox backwpup-floated-postbox">
		        <h3 class="hndle"><span><a href="https://www.ostraining.com/">OSTraining</a> <?php 
        _e('Video: Restoring Backups', 'backwpup');
        ?>
</span></h3>
		        <iframe class="inside" width="340" height="190" src="https://www.youtube.com/embed/VIwDp87vYZY?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>
	        </div>

			<div id="backwpup-stats" class="metabox-holder postbox backwpup-cleared-postbox backwpup-max-width">
				<div class="backwpup-table-wrap">
				<?php 
        self::mb_next_jobs();
        self::mb_last_logs();
        ?>
				</div>
			</div>

			<?php 
        if (!class_exists('BackWPup_Pro', FALSE)) {
            ?>
			<div id="backwpup-thank-you" class="metabox-holder postbox backwpup-cleared-postbox backwpup-max-width">
				<h3 class="hndle"><span><?php 
            _ex('Thank you for using BackWPup!', 'Pro teaser box', 'backwpup');
            ?>
</span></h3>
				<div class="inside">
					<p><img class="backwpup-banner-img" src="<?php 
            echo BackWPup::get_plugin_data('URL') . '/assets/images/backwpupbanner-pro.png';
            ?>
" alt="BackWPup Banner" /></p>
					<h3 class="backwpup-text-center"><?php 
            _ex('Get access to:', 'Pro teaser box', 'backwpup');
            ?>
</h3>
					<ul class="backwpup-text-center">
						<li><?php 
            _ex('First-class <strong>dedicated support</strong> at MarketPress Helpdesk.', 'Pro teaser box', 'backwpup');
            ?>
</li>
						<li><?php 
            _ex('Differential backups to Google Drive and other cloud storage service.', 'Pro teaser box', 'backwpup');
            ?>
</li>
						<li><?php 
            _ex('Easy-peasy wizards to create and schedule backup jobs.', 'Pro teaser box', 'backwpup');
            ?>
</li>
						<li><?php 
            printf('<a href="http://marketpress.com/product/backwpup-pro/">%s</a>', _x('And more…', 'Pro teaser box, link text', 'backwpup'));
            ?>
</li>
					</ul>
					<p class="backwpup-text-center"><a href="http://marketpress.com/product/backwpup-pro/" class="button button-primary button-primary-bwp" title="<?php 
            _ex('Get BackWPup Pro now', 'Pro teaser box, link title', 'backwpup');
            ?>
"><?php 
            _ex('Get BackWPup Pro now', 'Pro teaser box, link text', 'backwpup');
            ?>
</a></p>
				</div>
			</div>
			<?php 
        }
        ?>

        </div>
	<?php 
    }
コード例 #9
0
 /**
  * @param $jobdest
  * @param $backupfile
  */
 public function file_delete($jobdest, $backupfile)
 {
     $files = get_site_transient('backwpup_' . strtolower($jobdest));
     list($jobid, $dest) = explode('_', $jobdest);
     if (BackWPup_Option::get($jobid, 's3accesskey') && BackWPup_Option::get($jobid, 's3secretkey') && BackWPup_Option::get($jobid, 's3bucket')) {
         try {
             $s3 = Aws\S3\S3Client::factory(array('key' => BackWPup_Option::get($jobid, 's3accesskey'), 'secret' => BackWPup_Encryption::decrypt(BackWPup_Option::get($jobid, 's3secretkey')), 'region' => BackWPup_Option::get($jobid, 's3region'), 'base_url' => $this->get_s3_base_url(BackWPup_Option::get($jobid, 's3region'), BackWPup_Option::get($jobid, 's3base_url')), 'scheme' => 'https', 'ssl.certificate_authority' => BackWPup::get_plugin_data('cacert')));
             $s3->deleteObject(array('Bucket' => BackWPup_Option::get($jobid, 's3bucket'), 'Key' => $backupfile));
             //update file list
             foreach ((array) $files as $key => $file) {
                 if (is_array($file) && $file['file'] == $backupfile) {
                     unset($files[$key]);
                 }
             }
             unset($s3);
         } catch (Exception $e) {
             BackWPup_Admin::message(sprintf(__('S3 Service API: %s', 'backwpup'), $e->getMessage()), TRUE);
         }
     }
     set_site_transient('backwpup_' . strtolower($jobdest), $files, YEAR_IN_SECONDS);
 }
コード例 #10
0
ファイル: backwpup.php プロジェクト: isrealconsulting/site
 /**
  * Set needed filters and actions and load
  */
 private function __construct()
 {
     // Nothing else matters if we're not on the main site
     if (!is_main_site()) {
         return;
     }
     //auto loader
     spl_autoload_register(array($this, 'autoloader'));
     //start upgrade if needed
     if (get_site_option('backwpup_version') != self::get_plugin_data('Version')) {
         BackWPup_Install::activate();
     }
     //load pro features
     if (class_exists('BackWPup_Pro')) {
         BackWPup_Pro::get_instance();
     }
     //WP-Cron
     if (defined('DOING_CRON') && DOING_CRON) {
         //early disable caches
         if (!empty($_GET['backwpup_run']) && class_exists('BackWPup_Job')) {
             BackWPup_Job::disable_caches();
         }
         // add normal cron actions
         add_action('backwpup_cron', array('BackWPup_Cron', 'run'));
         add_action('backwpup_check_cleanup', array('BackWPup_Cron', 'check_cleanup'));
         // add action for doing thinks if cron active
         // must done in int before wp-cron control
         add_action('init', array('BackWPup_Cron', 'cron_active'), 1);
         // if in cron the rest must not needed
         return;
     }
     //deactivation hook
     register_deactivation_hook(__FILE__, array('BackWPup_Install', 'deactivate'));
     //Things that must do in plugin init
     add_action('init', array($this, 'plugin_init'));
     //only in backend
     if (is_admin() && class_exists('BackWPup_Admin')) {
         BackWPup_Admin::get_instance();
     }
     //work with wp-cli
     if (defined('WP_CLI') && WP_CLI && method_exists('WP_CLI', 'add_command')) {
         WP_CLI::add_command('backwpup', 'BackWPup_WP_CLI');
     }
 }
コード例 #11
0
    /**
     * Print the markup.
     *
     * @return void
     */
    public static function page()
    {
        // get wizards
        $wizards = BackWPup::get_wizards();
        ?>
        <div class="wrap" id="backwpup-page">
            <h2><span id="backwpup-page-icon">&nbsp;</span><?php 
        echo sprintf(__('%s Dashboard', 'backwpup'), BackWPup::get_plugin_data('name'));
        ?>
</h2>
			<?php 
        BackWPup_Admin::display_messages();
        if (class_exists('BackWPup_Pro', FALSE)) {
            ?>
				<div class="backwpup-welcome backwpup-max-width">
					<h3><?php 
            _ex('Planning backups', 'Dashboard heading', 'backwpup');
            ?>
</h3>
					<p><?php 
            _e('BackWPup’s job wizards make planning and scheduling your backup jobs a breeze.', 'backwpup');
            echo ' ';
            _e('Use your backup archives to save your entire WordPress installation including <code>/wp-content/</code>. Push them to an external storage service if you don’t want to save the backups on the same server.', 'backwpup');
            ?>
</p>
					<h3><?php 
            _ex('Restoring backups', 'Dashboard heading', 'backwpup');
            ?>
</h3>
					<p><?php 
            _e('With a single backup archive you are able to restore an installation. Use a tool like phpMyAdmin or a plugin like <a href="http://wordpress.org/plugins/adminer/" target="_blank">Adminer</a> to restore your database backup files.', 'backwpup');
            ?>
</p>
					<h3><?php 
            _ex('Ready to set up a backup job?', 'Dashboard heading', 'backwpup');
            ?>
</h3>
					<p><?php 
            printf(__('Use one of the wizards to plan a backup, or use <a href="%s">expert mode</a> for full control over all options.', 'backwpup'), network_admin_url('admin.php') . '?page=backwpupeditjob');
            echo ' ';
            _e('<strong>Please note: You are solely responsible for the security of your data; the authors of this plugin are not.</strong>', 'backwpup');
            ?>
</p>
				</div>
			<?php 
        } else {
            ?>
				<div class="backwpup-welcome backwpup-max-width">
					<h3><?php 
            _ex('Planning backups', 'Dashboard heading', 'backwpup');
            ?>
</h3>
					<p><?php 
            _e('Use the short links in the <strong>First steps</strong> box to plan and schedule backup jobs.', 'backwpup');
            echo ' ';
            _e('Use your backup archives to save your entire WordPress installation including <code>/wp-content/</code>. Push them to an external storage service if you don’t want to save the backups on the same server.', 'backwpup');
            ?>
</p>
					<h3><?php 
            _ex('Restoring backups', 'Dashboard heading', 'backwpup');
            ?>
</h3>
					<p><?php 
            _e('With a single backup archive you are able to restore an installation. Use a tool like phpMyAdmin or a plugin like <a href="http://wordpress.org/plugins/adminer/" target="_blank">Adminer</a> to restore your database backup files.', 'backwpup');
            ?>
</p>
					<h3><?php 
            _ex('Ready to set up a backup job?', 'Dashboard heading', 'backwpup');
            ?>
</h3>
					<p><?php 
            printf(__('<a href="%s">Add a new backup job</a> and plan what you want to save.', 'backwpup'), network_admin_url('admin.php') . '?page=backwpupeditjob');
            ?>
					<br /><?php 
            _e('<strong>Please note: You are solely responsible for the security of your data; the authors of this plugin are not.</strong>', 'backwpup');
            ?>
</p>
				</div>
			<?php 
        }
        if (current_user_can('backwpup_jobs_edit') && current_user_can('backwpup_logs') && current_user_can('backwpup_jobs_start')) {
            ?>
				<div  id="backwpup-first-steps" class="metabox-holder postbox backwpup-floated-postbox">
					<h3 class="hndle"><span><?php 
            _e('First Steps', 'backwpup');
            ?>
</span></h3>
					<div class="inside">
						<ul>
							<?php 
            if (class_exists('BackWPup_Pro', FALSE)) {
                ?>
								<li type="1"><a href="<?php 
                echo wp_nonce_url(network_admin_url('admin.php') . '?page=backwpupwizard&wizard_start=SYSTEMTEST', 'wizard');
                ?>
"><?php 
                _e('Test the installation', 'backwpup');
                ?>
</a></li>
								<li type="1"><a href="<?php 
                echo wp_nonce_url(network_admin_url('admin.php') . '?page=backwpupwizard&wizard_start=JOB', 'wizard');
                ?>
"><?php 
                _e('Create a Job', 'backwpup');
                ?>
</a></li>
							<?php 
            } else {
                ?>
                           		<li type="1"><a href="<?php 
                echo network_admin_url('admin.php') . '?page=backwpupsettings#backwpup-tab-information';
                ?>
"><?php 
                _e('Check the installation', 'backwpup');
                ?>
</a></li>
                            	<li type="1"><a href="<?php 
                echo network_admin_url('admin.php') . '?page=backwpupeditjob';
                ?>
"><?php 
                _e('Create a Job', 'backwpup');
                ?>
</a></li>
							<?php 
            }
            ?>
							<li type="1"><a href="<?php 
            echo network_admin_url('admin.php') . '?page=backwpupjobs';
            ?>
"><?php 
            _e('Run the created job', 'backwpup');
            ?>
</a></li>
							<li type="1"><a href="<?php 
            echo network_admin_url('admin.php') . '?page=backwpuplogs';
            ?>
"><?php 
            _e('Check the job log', 'backwpup');
            ?>
</a></li>
						</ul>
					</div>
				</div>
			<?php 
        }
        if (current_user_can('backwpup_jobs_start')) {
            ?>
				<div id="backwpup-one-click-backup" class="metabox-holder postbox backwpup-floated-postbox">
					<h3 class="hndle"><span><?php 
            _e('One click backup', 'backwpup');
            ?>
</span></h3>
					<div class="inside">
						<a href="<?php 
            echo wp_nonce_url(network_admin_url('admin.php') . '?page=backwpup&action=dbdumpdl', 'backwpupdbdumpdl');
            ?>
" class="button button-primary button-primary-bwp" title="<?php 
            _e('Generate a database backup of WordPress tables and download it right away!', 'backwpup');
            ?>
"><?php 
            _e('Download database backup', 'backwpup');
            ?>
</a><br />
					</div>
				</div>
			<?php 
        }
        if (class_exists('BackWPup_Pro', FALSE)) {
            /* @var BackWPup_Pro_Wizards $wizard_class */
            foreach ($wizards as $wizard_class) {
                //check permissions
                if (!current_user_can($wizard_class->info['cap'])) {
                    continue;
                }
                //get info of wizard
                echo '<div id="wizard-' . strtolower($wizard_class->info['ID']) . '" class="wizardbox post-box backwpup-floated-postbox"><form method="get" action="' . network_admin_url('admin.php') . '">';
                echo '<h3 class="wizardbox_name">' . $wizard_class->info['name'] . '</h3>';
                echo '<p class="wizardbox_description">' . $wizard_class->info['description'] . '</p>';
                $conf_names = $wizard_class->get_pre_configurations();
                if (!empty($conf_names)) {
                    echo '<select id="wizardbox_pre_conf" name="pre_conf" size="1">';
                    foreach ($conf_names as $conf_key => $conf_name) {
                        echo '<option value="' . esc_attr($conf_key) . '">' . esc_attr($conf_name) . '</option>';
                    }
                    echo '</select>';
                } else {
                    echo '<input type="hidden" name="pre_conf" value="" />';
                }
                wp_nonce_field('wizard');
                echo '<input type="hidden" name="page" value="backwpupwizard" />';
                echo '<input type="hidden" name="wizard_start" value="' . esc_attr($wizard_class->info['ID']) . '" />';
                echo '<div class="wizardbox_start"><input type="submit" name="submit" class="button button-primary button-primary-bwp" value="' . esc_attr(__('Start wizard', 'backwpup')) . '" /></div>';
                echo '</form></div>';
            }
        }
        ?>

			<div id="backwpup-stats" class="metabox-holder postbox backwpup-cleared-postbox backwpup-max-width">
				<div class="backwpup-table-wrap">
				<?php 
        self::mb_next_jobs();
        self::mb_last_logs();
        ?>
				</div>
			</div>

			<?php 
        if (!class_exists('BackWPup_Pro', FALSE)) {
            ?>
			<div id="backwpup-thank-you" class="metabox-holder postbox backwpup-cleared-postbox backwpup-max-width">
				<h3 class="hndle"><span><?php 
            _ex('Thank you for using BackWPup!', 'Pro teaser box', 'backwpup');
            ?>
</span></h3>
				<div class="inside">
					<p><img class="backwpup-banner-img" src="<?php 
            echo BackWPup::get_plugin_data('URL') . '/assets/images/backwpupbanner-pro.png';
            ?>
" alt="BackWPup Banner" /></p>
					<h3 class="backwpup-text-center"><?php 
            _ex('Get access to:', 'Pro teaser box', 'backwpup');
            ?>
</h3>
					<ul class="backwpup-text-center">
						<li><?php 
            _ex('First-class <strong>dedicated support</strong> at MarketPress Helpdesk.', 'Pro teaser box', 'backwpup');
            ?>
</li>
						<li><?php 
            _ex('Differential backups to Google Drive and other cloud storage service.', 'Pro teaser box', 'backwpup');
            ?>
</li>
						<li><?php 
            _ex('Easy-peasy wizards to create and schedule backup jobs.', 'Pro teaser box', 'backwpup');
            ?>
</li>
						<li><?php 
            printf('<a href="http://marketpress.com/product/backwpup-pro/">%s</a>', _x('And more…', 'Pro teaser box, link text', 'backwpup'));
            ?>
</li>
					</ul>
					<p class="backwpup-text-center"><a href="http://marketpress.com/product/backwpup-pro/" class="button button-primary button-primary-bwp" title="<?php 
            _ex('Get BackWPup Pro now', 'Pro teaser box, link title', 'backwpup');
            ?>
"><?php 
            _ex('Get BackWPup Pro now', 'Pro teaser box, link text', 'backwpup');
            ?>
</a></p>
				</div>
			</div>
			<?php 
        }
        ?>

        </div>
	<?php 
    }
コード例 #12
0
    /**
     * Print the markup.
     *
     * @return void
     */
    public static function page()
    {
        ?>

        <div class="wrap" id="backwpup-page">

        	<div class="inpsyde">

            	<a href="http://inpsyde.com/" title="Inpsyde GmbH">Inpsyde</a>

            </div>

            <h2><span id="backwpup-page-icon">&nbsp;</span><?php 
        echo sprintf(__('%s Welcome', 'backwpup'), BackWPup::get_plugin_data('name'));
        ?>
</h2>

			<?php 
        BackWPup_Admin::display_messages();
        ?>

            <div class="welcome">

            	<div class="welcome_inner">

                	<div class="top">

						<?php 
        if (get_site_transient('backwpup_upgrade_from_version_two')) {
            ?>

                            <div id="update-notice" class="backwpup-welcome updated">

                                <h3><?php 
            _e('Heads up! You have updated from version 2.x', 'backwpup');
            ?>
</h3>

                                <p><?php 
            echo str_replace('\\"', '"', sprintf(__('Please <a href="%s">check your settings</a> after updating from version 2.x:', 'backwpup'), network_admin_url('admin.php') . '?page=backwpupjobs'));
            ?>
</a></p>

                                <ul><li><?php 
            _e('Dropbox authentication must be re-entered', 'backwpup');
            ?>
</li>

								<li><?php 
            _e('SugarSync authentication must be re-entered', 'backwpup');
            ?>
</li>

                                <li><?php 
            _e('S3 Settings', 'backwpup');
            ?>
</li>

                                <li><?php 
            _e('Google Storage is now a part of S3 service settings', 'backwpup');
            ?>
</li>

                                <li><?php 
            _e('All your passwords', 'backwpup');
            ?>
</li>

                                </ul>

                             </div>

                        <?php 
        }
        ?>

    				</div>

                    <?php 
        if (class_exists('BackWPup_Pro', FALSE)) {
            ?>

                    <div class="welcometxt">

                        <div class="backwpup-welcome">

							<img class="backwpup-banner-img" src="<?php 
            echo BackWPup::get_plugin_data('URL');
            ?>
/assets/images/backwpupbanner-pro.png" />

                            <h3><?php 
            _e('Welcome to BackWPup Pro', 'backwpup');
            ?>
</h3>

                            <p><?php 
            _e('BackWPup’s job wizards make planning and scheduling your backup jobs a breeze.', 'backwpup');
            echo ' ';
            _e('Use your backup archives to save your entire WordPress installation including <code>/wp-content/</code>. Push them to an external storage service if you don’t want to save the backups on the same server. With a single backup archive you are able to restore an installation. Use a tool like phpMyAdmin or a plugin like <a href="http://wordpress.org/plugins/adminer/" target="_blank">Adminer</a> to restore your database backup files.', 'backwpup');
            ?>
</p>

                            <p><?php 
            echo str_replace('\\"', '"', sprintf(__('Ready to <a href="%1$s">set up a backup job</a>? You can <a href="%2$s">use the wizards</a> or plan your backup in expert mode.', 'backwpup'), network_admin_url('admin.php') . '?page=backwpupeditjob', network_admin_url('admin.php') . '?page=backwpupwizard'));
            ?>
</p>

                        </div>

                    </div>

                    <?php 
        } else {
            ?>

                    <div class="welcometxt">

                        <div class="backwpup-welcome">

							<img class="backwpup-banner-img" src="<?php 
            echo BackWPup::get_plugin_data('URL');
            ?>
/assets/images/backwpupbanner-free.png" />

                            <h3><?php 
            _e('Welcome to BackWPup', 'backwpup');
            ?>
</h3>

                            <p><?php 
            _e('Use your backup archives to save your entire WordPress installation including <code>/wp-content/</code>. Push them to an external storage service if you don’t want to save the backups on the same server. With a single backup archive you are able to restore an installation. Use a tool like phpMyAdmin or a plugin like <a href="http://wordpress.org/plugins/adminer/" target="_blank">Adminer</a> to restore your database backup files.', 'backwpup');
            ?>
</p>

                            <p><?php 
            _e('Ready to set up a backup job? Use one of the wizards to plan what you want to save.', 'backwpup');
            ?>
</p>

                        </div>

                    </div>

                    <?php 
        }
        ?>

					<?php 
        if (class_exists('marketpress_autoupdate') && class_exists('BackWPup_Pro', FALSE)) {
            $autoupdate = $autoupdate = marketpress_autoupdate::get_instance(BackWPup::get_plugin_data('Slug'), BackWPup::get_plugin_data('MainFile'));
            if ($autoupdate->license_check() == 'false') {
                $plugins = get_plugins();
                $localplugin = FALSE;
                foreach ($plugins as $plugin) {
                    if (BackWPup::get_plugin_data('Name') == $plugin['Name']) {
                        $localplugin = TRUE;
                    }
                }
                ?>

		             		<div class="welcometxt">

		                        <div class="backwpup-welcome">

		                            <h3><?php 
                _e('Please activate your license', 'backwpup');
                ?>
</h3>

		                            <p><a href="<?php 
                echo $localplugin ? admin_url('plugins.php') : network_admin_url('plugins.php');
                ?>
"><?php 
                _e('Please go to your plugin page and active the license to have the autoupdates enabled.', 'backwpup');
                ?>
</a></p>

								</div>

							</div>

						<?php 
            }
            ?>

					<?php 
        }
        ?>

            		<div class="features">



                    	<div class="feature-box <?php 
        self::feature_class();
        ?>
">

                        	<div class="feature-image">

                                <img title="<?php 
        _e('Save your database', 'backwpup');
        ?>
" src="<?php 
        echo BackWPup::get_plugin_data('URL');
        ?>
/assets/images/imagesave.png" />

                            </div>

                            <div class="feature-text">

                            	<h3><?php 
        _e('Save your database regularly', 'backwpup');
        ?>
</h3>

                                <p><?php 
        echo str_replace('\\"', '"', sprintf(__('With BackWPup you can schedule the database backup to run automatically. With a single backup file you can restore your database. You should <a href="%s">set up a backup job</a>, so you will never forget it. There is also an option to repair and optimize the database after each backup.', 'backwpup'), network_admin_url('admin.php') . '?page=backwpupeditjob'));
        ?>
</p>

                            </div>

                        </div>

                        <div class="feature-box <?php 
        self::feature_class();
        ?>
">

                            <div class="feature-text">

                            	<h3><?php 
        _e('WordPress XML Export', 'backwpup');
        ?>
</h3>

                                <p><?php 
        _e('You can choose the built-in WordPress export format in addition or exclusive to save your data. This works in automated backups too of course. The advantage is: you can import these files into a blog with the regular WordPress importer.', 'backwpup');
        ?>
</p>

                            </div>

                            <div class="feature-image">

                            	<img title="<?php 
        _e('WordPress XML Export', 'backwpup');
        ?>
" src="<?php 
        echo BackWPup::get_plugin_data('URL');
        ?>
/assets/images/imagexml.png" />

                            </div>

                        </div>

                        <div class="feature-box <?php 
        self::feature_class();
        ?>
">

                            <div class="feature-image">

                            	<img title="<?php 
        _e('Save all data from the webserver', 'backwpup');
        ?>
" src="<?php 
        echo BackWPup::get_plugin_data('URL');
        ?>
/assets/images/imagedata.png" />

                            </div>

                            <div class="feature-text">

                            	<h3><?php 
        _e('Save all files', 'backwpup');
        ?>
</h3>

                                <p><?php 
        echo str_replace('\\"', '"', sprintf(__('You can backup all your attachments, also all system files, plugins and themes in a single file. You can <a href="%s">create a job</a> to update a backup copy of your file system only when files are changed.', 'backwpup'), network_admin_url('admin.php') . '?page=backwpupeditjob'));
        ?>
</p>

                            </div>

                        </div>

                        <div class="feature-box <?php 
        self::feature_class();
        ?>
">

                            <div class="feature-text">

                            	<h3><?php 
        _e('Security!', 'backwpup');
        ?>
</h3>

                                <p><?php 
        _e('By default everything is encrypted: connections to external services, local files and access to directories.', 'backwpup');
        ?>
</p>

                            </div>

                        	<div class="feature-image">

                            	<img title="<?php 
        _e('Security!', 'backwpup');
        ?>
" src="<?php 
        echo BackWPup::get_plugin_data('URL');
        ?>
/assets/images/imagesec.png" />

                            </div>

                        </div>

                        <div class="feature-box <?php 
        self::feature_class();
        ?>
">

                            <div class="feature-image">

                            	<img title="<?php 
        _e('Cloud Support', 'backwpup');
        ?>
" src="<?php 
        echo BackWPup::get_plugin_data('URL');
        ?>
/assets/images/imagecloud.png" />

                            </div>

                            <div class="feature-text">

                            	<h3><?php 
        _e('Cloud Support', 'backwpup');
        ?>
</h3>

                                <p><?php 
        _e('BackWPup supports multiple cloud services in parallel. This ensures backups are redundant.', 'backwpup');
        ?>
</p>

                            </div>

                        </div>

                    </div>

                </div>



				<?php 
        if (!class_exists('BackWPup_Pro', FALSE)) {
            ?>

					<div class="backwpup_comp">

						<h3><?php 
            _e('Features / differences between Free and Pro', 'backwpup');
            ?>
</h3>

						<table width="100%" border="0" cellspacing="0" cellpadding="0">

							<tr class="even ub">

								<td><?php 
            _e('Features', 'backwpup');
            ?>
</td>

								<td class="free"><?php 
            _e('FREE', 'backwpup');
            ?>
</td>

								<td class="pro"><?php 
            _e('PRO', 'backwpup');
            ?>
</td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('Complete database backup', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('Complete file backup', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('Database check', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('Data compression', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('WordPress XML export', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('List of installed plugins', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('Backup archives management', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('Log file management', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('Start jobs per WP-Cron, URL, system, backend or WP-CLI', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('Log report via email', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('Backup to Microsoft Azure', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('Backup as email', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('Backup to S3 services <small>(Amazon, Google Storage, Hosteurope and more)</small>', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('Backup to Dropbox', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('Backup to Rackspace Cloud Files', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('Backup to FTP server', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('Backup to your web space', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('Backup to SugarSync', 'backwpup');
            ?>
</td>

								<td class="tick"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('Backup to Google Drive', 'backwpup');
            ?>
</td>

								<td class="error"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('Backup to Amazon Glacier', 'backwpup');
            ?>
</td>

								<td class="error"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('Custom API keys for DropBox and SugarSync', 'backwpup');
            ?>
</td>

								<td class="error"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('XML database backup as PHPMyAdmin schema', 'backwpup');
            ?>
</td>

								<td class="error"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('Database backup as mysqldump per command line', 'backwpup');
            ?>
</td>

								<td class="error"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('Database backup for additional MySQL databases', 'backwpup');
            ?>
</td>

								<td class="error"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('Import and export job settings as XML', 'backwpup');
            ?>
</td>

								<td class="error"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('Wizard for system tests', 'backwpup');
            ?>
</td>

								<td class="error"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('Wizard for scheduled backup jobs', 'backwpup');
            ?>
</td>

								<td class="error"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('Wizard to import settings and backup jobs', 'backwpup');
            ?>
</td>

								<td class="error"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('Differential backup of changed directories to Dropbox', 'backwpup');
            ?>
</td>

								<td class="error"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('Differential backup of changed directories to Rackspace Cloud Files', 'backwpup');
            ?>
</td>

								<td class="error"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('Differential backup of changed directories to S3', 'backwpup');
            ?>
</td>

								<td class="error"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('Differential backup of changed directories to MS Azure', 'backwpup');
            ?>
</td>

								<td class="error"></td>

								<td class="tick"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('<strong>Premium support</strong>', 'backwpup');
            ?>
</td>

								<td class="error"></td>

								<td class="tick"></td>

							</tr>

							<tr class="even">

								<td><?php 
            _e('<strong>Dynamically loaded documentation</strong>', 'backwpup');
            ?>
</td>

								<td class="error" style="border-bottom:none;"></td>

								<td class="tick" style="border-bottom:none;"></td>

							</tr>

							<tr class="odd">

								<td><?php 
            _e('<strong>Automatic update from MarketPress</strong>', 'backwpup');
            ?>
</td>

								<td class="error" style="border-bottom:none;"></td>

								<td class="tick" style="border-bottom:none;"></td>

							</tr>

							<tr class="even ubdown">

								<td></td>

								<td></td>

								<td class="pro buylink"><a href="<?php 
            _e('http://marketpress.com/product/backwpup-pro/', 'backwpup');
            ?>
"><?php 
            _e('GET PRO', 'backwpup');
            ?>
</a></td>

							</tr>

						</table>

					</div>

				<?php 
        }
        ?>

            </div>

        </div>

	<?php 
    }
コード例 #13
0
    /**
     * Page Output
     */
    public static function page()
    {
        global $wpdb;
        ?>
    <div class="wrap" id="backwpup-page">
		<h1><?php 
        echo sprintf(__('%s &rsaquo; Settings', 'backwpup'), BackWPup::get_plugin_data('name'));
        ?>
</h1>
		<?php 
        $tabs = array('general' => __('General', 'backwpup'), 'job' => __('Jobs', 'backwpup'), 'log' => __('Logs', 'backwpup'), 'net' => __('Network', 'backwpup'), 'apikey' => __('API Keys', 'backwpup'), 'information' => __('Information', 'backwpup'));
        $tabs = apply_filters('backwpup_page_settings_tab', $tabs);
        echo '<h2 class="nav-tab-wrapper">';
        foreach ($tabs as $id => $name) {
            echo '<a href="#backwpup-tab-' . esc_attr($id) . '" class="nav-tab">' . esc_attr($name) . '</a>';
        }
        echo '</h2>';
        BackWPup_Admin::display_messages();
        ?>

    <form id="settingsform" action="<?php 
        echo admin_url('admin-post.php');
        ?>
" method="post">
		<?php 
        wp_nonce_field('backwpupsettings_page');
        ?>
        <input type="hidden" name="page" value="backwpupsettings" />
	    <input type="hidden" name="action" value="backwpup" />
    	<input type="hidden" name="anchor" value="#backwpup-tab-general" />

		<div class="table ui-tabs-hide" id="backwpup-tab-general">

			<h3 class="title"><?php 
        _e('Display Settings', 'backwpup');
        ?>
</h3>
            <p><?php 
        _e('Do you want to see BackWPup in the WordPress admin bar?', 'backwpup');
        ?>
</p>
            <table class="form-table">
                <tr>
                    <th scope="row"><?php 
        _e('Admin bar', 'backwpup');
        ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text"><span><?php 
        _e('Admin Bar', 'backwpup');
        ?>
</span></legend>
                            <label for="showadminbarmenu">
                                <input name="showadminbarmenu" type="checkbox" id="showadminbarmenu" value="1" <?php 
        checked(get_site_option('backwpup_cfg_showadminbar'), TRUE);
        ?>
 />
								<?php 
        _e('Show BackWPup links in admin bar.', 'backwpup');
        ?>
                            </label>
                        </fieldset>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Folder sizes', 'backwpup');
        ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text"><span><?php 
        _e('Folder sizes', 'backwpup');
        ?>
</span></legend>
                            <label for="showfoldersize">
                                <input name="showfoldersize" type="checkbox" id="showfoldersize" value="1" <?php 
        checked(get_site_option('backwpup_cfg_showfoldersize'), TRUE);
        ?>
 />
								<?php 
        _e('Display folder sizes in the files tab when editing a job. (Might increase loading time of files tab.)', 'backwpup');
        ?>
                            </label>
                        </fieldset>
                    </td>
                </tr>
            </table>
			<h3 class="title"><?php 
        _e('Security', 'backwpup');
        ?>
</h3>
			<p><?php 
        _e('Security option for BackWPup', 'backwpup');
        ?>
</p>
            <table class="form-table">
                <tr>
                    <th scope="row"><?php 
        _e('Protect folders', 'backwpup');
        ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text"><span><?php 
        _e('Protect folders', 'backwpup');
        ?>
</span></legend>
                            <label for="protectfolders">
                                <input name="protectfolders" type="checkbox" id="protectfolders" value="1" <?php 
        checked(get_site_option('backwpup_cfg_protectfolders'), TRUE);
        ?>
 />
								<?php 
        _e('Protect BackWPup folders ( Temp, Log and Backups ) with <code>.htaccess</code> and <code>index.php</code>', 'backwpup');
        ?>
                            </label>
                        </fieldset>
                    </td>
                </tr>
            </table>

			<?php 
        do_action('backwpup_page_settings_tab_generel');
        ?>

		</div>

        <div class="table ui-tabs-hide" id="backwpup-tab-log">

            <p><?php 
        _e('Every time BackWPup runs a backup job, a log file is being generated. Choose where to store your log files and how many of them.', 'backwpup');
        ?>
</p>
            <table class="form-table">
                <tr>
                    <th scope="row"><label for="logfolder"><?php 
        _e('Log file folder', 'backwpup');
        ?>
</label></th>
                    <td>
                        <input name="logfolder" type="text" id="logfolder" value="<?php 
        echo esc_attr(get_site_option('backwpup_cfg_logfolder'));
        ?>
" class="regular-text code"/>
	                    <p class="description"><?php 
        echo sprintf(__('You can use absolute or relative path! Relative path is relative to %s.', 'backwpup'), '<code>' . trailingslashit(str_replace('\\', '/', WP_CONTENT_DIR)) . '</code>');
        ?>
</p>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><label for="maxlogs"><?php 
        _e('Maximum log files', 'backwpup');
        ?>
</label></th>
                    <td>
                        <input name="maxlogs" type="number" min="0" step="1" id="maxlogs" value="<?php 
        echo absint(get_site_option('backwpup_cfg_maxlogs'));
        ?>
" class="small-text"/>
	                    <?php 
        _e('Maximum log files in folder.', 'backwpup');
        ?>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Compression', 'backwpup');
        ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text"><span><?php 
        _e('Compression', 'backwpup');
        ?>
</span></legend>
                            <label for="gzlogs">
                                <input name="gzlogs" type="checkbox" id="gzlogs" value="1" <?php 
        checked(get_site_option('backwpup_cfg_gzlogs'), TRUE);
        if (!function_exists('gzopen')) {
            echo ' disabled="disabled"';
        }
        ?>
 />
								<?php 
        _e('Compress log files with GZip.', 'backwpup');
        ?>
                            </label>
                        </fieldset>
                    </td>
                </tr>
	            <tr>
		            <th scope="row"><?php 
        _e('Logging Level', 'backwpup');
        ?>
</th>
		            <td>
			            <fieldset>
				            <legend class="screen-reader-text"><span><?php 
        _e('Logging Level', 'backwpup');
        ?>
</span></legend>
				            <label for="loglevel">
					            <select name="loglevel" size="1">
						            <option value="normal_translated" <?php 
        selected(get_site_option('backwpup_cfg_loglevel', 'normal_translated'), 'normal_translated');
        ?>
><?php 
        _e('Normal (translated)', 'backwpup');
        ?>
</option>
						            <option value="normal" <?php 
        selected(get_site_option('backwpup_cfg_loglevel'), 'normal');
        ?>
><?php 
        _e('Normal (not translated)', 'backwpup');
        ?>
</option>
						            <option value="debug_translated" <?php 
        selected(get_site_option('backwpup_cfg_loglevel'), 'debug_translated');
        ?>
><?php 
        _e('Debug (translated)', 'backwpup');
        ?>
</option>
						            <option value="debug" <?php 
        selected(get_site_option('backwpup_cfg_loglevel'), 'debug');
        ?>
><?php 
        _e('Debug (not translated)', 'backwpup');
        ?>
</option>
					            </select>
				            </label>
				            <p class="description"><?php 
        esc_attr_e('Debug log has much more informations than normal logs. It is for support and should be handled carefully. For support is the best to use a not translated log file. Usage of not translated logs can reduce the PHP memory usage too.', 'backwpup');
        ?>
</p>
			            </fieldset>
		            </td>
	            </tr>
            </table>

        </div>
        <div class="table ui-tabs-hide" id="backwpup-tab-job">

            <p><?php 
        _e('There are a couple of general options for backup jobs. Set them here.', 'backwpup');
        ?>
</p>
            <table class="form-table">
                <tr>
                    <th scope="row"><label for="jobstepretry"><?php 
        _e("Maximum number of retries for job steps", 'backwpup');
        ?>
</label></th>
                    <td>
                        <input name="jobstepretry" type="number" min="1" step="1" max="99" id="jobstepretry" value="<?php 
        echo absint(get_site_option('backwpup_cfg_jobstepretry'));
        ?>
" class="small-text" />
                    </td>
                </tr>
				<tr>
                    <th scope="row"><?php 
        _e('Maximum script execution time', 'backwpup');
        ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text"><span><?php 
        _e('Maximum PHP Script execution time', 'backwpup');
        ?>
</span></legend>
                            <label for="jobmaxexecutiontime">
                                <input name="jobmaxexecutiontime" type="number" min="0" step="1" max="300" id="jobmaxexecutiontime" value="<?php 
        echo absint(get_site_option('backwpup_cfg_jobmaxexecutiontime'));
        ?>
" class="small-text" />
								<?php 
        _e('seconds.', 'backwpup');
        ?>
	                            <p class="description"><?php 
        _e('Job will restart before hitting maximum execution time. Restarts will be disabled on CLI usage. If <code>ALTERNATE_WP_CRON</code> has been defined, WordPress Cron will be used for restarts, so it can take a while. 0 means no maximum.', 'backwpup');
        ?>
</p>
							</label>
                        </fieldset>
                    </td>
                </tr>
                <tr>
                    <th scope="row">
                        <label for="jobrunauthkey"><?php 
        _e('Key to start jobs externally with an URL', 'backwpup');
        ?>
</label>
                    </th>
                    <td>
                        <input name="jobrunauthkey" type="text" id="jobrunauthkey" value="<?php 
        echo esc_attr(get_site_option('backwpup_cfg_jobrunauthkey'));
        ?>
" class="text code"/>
	                    <p class="description"><?php 
        _e('Will be used to protect job starts from unauthorized person.', 'backwpup');
        ?>
</p>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Reduce server load', 'backwpup');
        ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text"><span><?php 
        _e('Reduce server load', 'backwpup');
        ?>
</span></legend>
                            <label for="jobwaittimems">
								<select name="jobwaittimems" size="1">
									<option value="0" <?php 
        selected(get_site_option('backwpup_cfg_jobwaittimems'), 0);
        ?>
><?php 
        _e('disabled', 'backwpup');
        ?>
</option>
                                    <option value="10000" <?php 
        selected(get_site_option('backwpup_cfg_jobwaittimems'), 10000);
        ?>
><?php 
        _e('minimum', 'backwpup');
        ?>
</option>
                                    <option value="30000" <?php 
        selected(get_site_option('backwpup_cfg_jobwaittimems'), 30000);
        ?>
><?php 
        _e('medium', 'backwpup');
        ?>
</option>
                                    <option value="90000" <?php 
        selected(get_site_option('backwpup_cfg_jobwaittimems'), 90000);
        ?>
><?php 
        _e('maximum', 'backwpup');
        ?>
</option>
                                </select>
                            </label>
	                        <p class="description"><?php 
        _e('This adds short pauses to the process. Can be used to reduce the CPU load.', 'backwpup');
        ?>
</p>
                        </fieldset>
                    </td>
                </tr>
	            <tr>
		            <th scope="row"><?php 
        _e('Empty output on working', 'backwpup');
        ?>
</th>
		            <td>
			            <fieldset>
				            <legend class="screen-reader-text"><span><?php 
        _e('Enable an empty Output on backup working.', 'backwpup');
        ?>
</span></legend>
				            <label for="jobdooutput">
					            <input name="jobdooutput" type="checkbox" id="jobdooutput" value="1" <?php 
        checked(get_site_option('backwpup_cfg_jobdooutput'), TRUE);
        ?>
 />
					            <?php 
        _e('Enable an empty Output on backup working.', 'backwpup');
        ?>
				            </label>
				            <p class="description"><?php 
        _e('This do an empty output on job working. This can help in some situations or can brake the working. You must test it.', 'backwpup');
        ?>
</p>
			            </fieldset>
		            </td>
	            </tr>
            </table>

        </div>

        <div class="table ui-tabs-hide" id="backwpup-tab-net">

			<h3><?php 
        echo sprintf(__('Authentication for <code>%s</code>', 'backwpup'), site_url('wp-cron.php'));
        ?>
</h3>
            <p><?php 
        _e('If you protected your blog with HTTP basic authentication (.htaccess), or you use a Plugin to secure wp-cron.php, then use the authentication methods below.', 'backwpup');
        ?>
</p>
            <?php 
        $authentication = get_site_option('backwpup_cfg_authentication', array('method' => '', 'basic_user' => '', 'basic_password' => '', 'user_id' => 0, 'query_arg' => ''));
        ?>
	        <table class="form-table">
	            <tr>
		            <th scope="row"><?php 
        _e('Authentication method', 'backwpup');
        ?>
</th>
		            <td>
			            <fieldset>
				            <legend class="screen-reader-text"><span><?php 
        _e('Authentication method', 'backwpup');
        ?>
</span></legend>
				            <label for="authentication_method">
					            <select name="authentication_method" id="authentication_method" size="1" >
						            <option value="" <?php 
        selected($authentication['method'], '');
        ?>
><?php 
        _e('none', 'backwpup');
        ?>
</option>
						            <option value="basic" <?php 
        selected($authentication['method'], 'basic');
        ?>
><?php 
        _e('Basic auth', 'backwpup');
        ?>
</option>
						            <option value="user" <?php 
        selected($authentication['method'], 'user');
        ?>
><?php 
        _e('WordPress User', 'backwpup');
        ?>
</option>
						            <option value="query_arg" <?php 
        selected($authentication['method'], 'query_arg');
        ?>
><?php 
        _e('Query argument', 'backwpup');
        ?>
</option>
					            </select>
				            </label>
			            </fieldset>
		            </td>
	            </tr>
                <tr class="authentication_basic" <?php 
        if ($authentication['method'] !== 'basic') {
            echo 'style="display:none"';
        }
        ?>
>
                    <th scope="row"><label for="authentication_basic_user"><?php 
        _e('Basic Auth Username:'******'backwpup');
        ?>
</label></th>
                    <td>
                        <input name="authentication_basic_user" type="text" id="authentication_basic_user" value="<?php 
        echo esc_attr($authentication['basic_user']);
        ?>
" class="regular-text" autocomplete="off" />
                    </td>
                </tr>
                <tr class="authentication_basic" <?php 
        if ($authentication['method'] !== 'basic') {
            echo 'style="display:none"';
        }
        ?>
>
			        <th scope="row"><label for="authentication_basic_password"><?php 
        _e('Basic Auth Password:'******'backwpup');
        ?>
</label></th>
			        <td>
				        <input name="authentication_basic_password" type="password" id="authentication_basic_password" value="<?php 
        echo esc_attr(BackWPup_Encryption::decrypt($authentication['basic_password']));
        ?>
" class="regular-text" autocomplete="off" />
		        </tr>
		        <tr class="authentication_user" <?php 
        if ($authentication['method'] !== 'user') {
            echo 'style="display:none"';
        }
        ?>
>
			        <th scope="row"><?php 
        _e('Select WordPress User', 'backwpup');
        ?>
</th>
			        <td>
				        <fieldset>
					        <legend class="screen-reader-text"><span><?php 
        _e('Select WordPress User', 'backwpup');
        ?>
</span>
					        </legend>
					        <label for="authentication_user_id">
						        <select name="authentication_user_id" size="1" >
							        <?php 
        $users = get_users(array('who' => 'administrators', 'number' => 99, 'orderby' => 'display_name'));
        foreach ($users as $user) {
            echo '<option value="' . $user->ID . '" ' . selected($authentication['user_id'], $user->ID, FALSE) . '>' . esc_attr($user->display_name) . '</option>';
        }
        ?>
						        </select>
					        </label>
				        </fieldset>
			        </td>
		        </tr>
		        <tr class="authentication_query_arg" <?php 
        if ($authentication['method'] != 'query_arg') {
            echo 'style="display:none"';
        }
        ?>
>
			        <th scope="row"><label for="authentication_query_arg"><?php 
        _e('Query arg key=value:', 'backwpup');
        ?>
</label></th>
			        <td>
				        ?<input name="authentication_query_arg" type="text" id="authentication_query_arg" value="<?php 
        echo esc_attr($authentication['query_arg']);
        ?>
" class="regular-text" />
			        </td>
		        </tr>
            </table>

        </div>

        <div class="table ui-tabs-hide" id="backwpup-tab-apikey">

			<?php 
        do_action('backwpup_page_settings_tab_apikey');
        ?>

        </div>

        <div class="table ui-tabs-hide" id="backwpup-tab-information">
			<br />
			<?php 
        echo '<table class="wp-list-table widefat fixed" cellspacing="0" style="width:85%;margin-left:auto;margin-right:auto;">';
        echo '<thead><tr><th width="35%">' . __('Setting', 'backwpup') . '</th><th>' . __('Value', 'backwpup') . '</th></tr></thead>';
        echo '<tfoot><tr><th>' . __('Setting', 'backwpup') . '</th><th>' . __('Value', 'backwpup') . '</th></tr></tfoot>';
        echo '<tr title="&gt;=3.2"><td>' . __('WordPress version', 'backwpup') . '</td><td>' . esc_html(BackWPup::get_plugin_data('wp_version')) . '</td></tr>';
        if (!class_exists('BackWPup_Pro', FALSE)) {
            echo '<tr title=""><td>' . __('BackWPup version', 'backwpup') . '</td><td>' . esc_html(BackWPup::get_plugin_data('Version')) . ' <a href="' . __('http://backwpup.com', 'backwpup') . '">' . __('Get pro.', 'backwpup') . '</a></td></tr>';
        } else {
            echo '<tr title=""><td>' . __('BackWPup Pro version', 'backwpup') . '</td><td>' . esc_html(BackWPup::get_plugin_data('Version')) . '</td></tr>';
        }
        $bit = '';
        if (PHP_INT_SIZE === 4) {
            $bit = ' (32bit)';
        }
        if (PHP_INT_SIZE === 8) {
            $bit = ' (64bit)';
        }
        echo '<tr title="&gt;=5.3.3"><td>' . __('PHP version', 'backwpup') . '</td><td>' . esc_html(PHP_VERSION . ' ' . $bit) . '</td></tr>';
        echo '<tr title="&gt;=5.0.7"><td>' . __('MySQL version', 'backwpup') . '</td><td>' . esc_html($wpdb->get_var("SELECT VERSION() AS version")) . '</td></tr>';
        if (function_exists('curl_version')) {
            $curlversion = curl_version();
            echo '<tr title=""><td>' . __('cURL version', 'backwpup') . '</td><td>' . esc_html($curlversion['version']) . '</td></tr>';
            echo '<tr title=""><td>' . __('cURL SSL version', 'backwpup') . '</td><td>' . esc_html($curlversion['ssl_version']) . '</td></tr>';
        } else {
            echo '<tr title=""><td>' . __('cURL version', 'backwpup') . '</td><td>' . __('unavailable', 'backwpup') . '</td></tr>';
        }
        echo '<tr title=""><td>' . __('WP-Cron url:', 'backwpup') . '</td><td>' . site_url('wp-cron.php') . '</td></tr>';
        //response test
        echo '<tr><td>' . __('Server self connect:', 'backwpup') . '</td><td>';
        $raw_response = BackWPup_Job::get_jobrun_url('test');
        $response_code = wp_remote_retrieve_response_code($raw_response);
        $response_body = wp_remote_retrieve_body($raw_response);
        if (strstr($response_body, 'BackWPup test request') === false) {
            $test_result = __('<strong>Not expected HTTP response:</strong><br>', 'backwpup');
            if (!$response_code) {
                $test_result .= sprintf(__('WP Http Error: <code>%s</code>', 'backwpup'), esc_html($raw_response->get_error_message())) . '<br>';
            } else {
                $test_result .= sprintf(__('Status-Code: <code>%d</code>', 'backwpup'), esc_html($response_code)) . '<br>';
            }
            $response_headers = wp_remote_retrieve_headers($raw_response);
            foreach ($response_headers as $key => $value) {
                $test_result .= esc_html(ucfirst($key)) . ': <code>' . esc_html($value) . '</code><br>';
            }
            $content = esc_html(wp_remote_retrieve_body($raw_response));
            if ($content) {
                $test_result .= sprintf(__('Content: <code>%s</code>', 'backwpup'), $content);
            }
            echo $test_result;
        } else {
            _e('Response Test O.K.', 'backwpup');
        }
        echo '</td></tr>';
        //folder test
        echo '<tr><td>' . __('Temp folder:', 'backwpup') . '</td><td>';
        if (!is_dir(BackWPup::get_plugin_data('TEMP'))) {
            echo sprintf(__('Temp folder %s doesn\'t exist.', 'backwpup'), esc_html(BackWPup::get_plugin_data('TEMP')));
        } elseif (!is_writable(BackWPup::get_plugin_data('TEMP'))) {
            echo sprintf(__('Temporary folder %s is not writable.', 'backwpup'), esc_html(BackWPup::get_plugin_data('TEMP')));
        } else {
            echo esc_html(BackWPup::get_plugin_data('TEMP'));
        }
        echo '</td></tr>';
        $log_folder = esc_html(get_site_option('backwpup_cfg_logfolder'));
        $log_folder = BackWPup_File::get_absolute_path($log_folder);
        echo '<tr><td>' . __('Log folder:', 'backwpup') . '</td><td>';
        if (!is_dir($log_folder)) {
            echo sprintf(__('Logs folder %s not exist.', 'backwpup'), $log_folder);
        } elseif (!is_writable($log_folder)) {
            echo sprintf(__('Log folder %s is not writable.', 'backwpup'), $log_folder);
        } else {
            echo $log_folder;
        }
        echo '</td></tr>';
        echo '<tr title=""><td>' . __('Server', 'backwpup') . '</td><td>' . esc_html($_SERVER['SERVER_SOFTWARE']) . '</td></tr>';
        echo '<tr title=""><td>' . __('Operating System', 'backwpup') . '</td><td>' . esc_html(PHP_OS) . '</td></tr>';
        echo '<tr title=""><td>' . __('PHP SAPI', 'backwpup') . '</td><td>' . esc_html(PHP_SAPI) . '</td></tr>';
        $php_user = __('Function Disabled', 'backwpup');
        if (function_exists('get_current_user')) {
            $php_user = get_current_user();
        }
        echo '<tr title=""><td>' . __('Current PHP user', 'backwpup') . '</td><td>' . esc_html($php_user) . '</td></tr>';
        echo '<tr title="&gt;=30"><td>' . __('Maximum execution time', 'backwpup') . '</td><td>' . esc_html(ini_get('max_execution_time')) . ' ' . __('seconds', 'backwpup') . '</td></tr>';
        if (defined('ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON) {
            echo '<tr title="ALTERNATE_WP_CRON"><td>' . __('Alternative WP Cron', 'backwpup') . '</td><td>' . __('On', 'backwpup') . '</td></tr>';
        } else {
            echo '<tr title="ALTERNATE_WP_CRON"><td>' . __('Alternative WP Cron', 'backwpup') . '</td><td>' . __('Off', 'backwpup') . '</td></tr>';
        }
        if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON) {
            echo '<tr title="DISABLE_WP_CRON"><td>' . __('Disabled WP Cron', 'backwpup') . '</td><td>' . __('On', 'backwpup') . '</td></tr>';
        } else {
            echo '<tr title="DISABLE_WP_CRON"><td>' . __('Disabled WP Cron', 'backwpup') . '</td><td>' . __('Off', 'backwpup') . '</td></tr>';
        }
        if (defined('FS_CHMOD_DIR')) {
            echo '<tr title="FS_CHMOD_DIR"><td>' . __('CHMOD Dir', 'backwpup') . '</td><td>' . esc_html(FS_CHMOD_DIR) . '</td></tr>';
        } else {
            echo '<tr title="FS_CHMOD_DIR"><td>' . __('CHMOD Dir', 'backwpup') . '</td><td>0755</td></tr>';
        }
        $now = localtime(time(), TRUE);
        echo '<tr title=""><td>' . __('Server Time', 'backwpup') . '</td><td>' . esc_html($now['tm_hour'] . ':' . $now['tm_min']) . '</td></tr>';
        echo '<tr title=""><td>' . __('Blog Time', 'backwpup') . '</td><td>' . date('H:i', current_time('timestamp')) . '</td></tr>';
        echo '<tr title=""><td>' . __('Blog Timezone', 'backwpup') . '</td><td>' . esc_html(get_option('timezone_string')) . '</td></tr>';
        echo '<tr title=""><td>' . __('Blog Time offset', 'backwpup') . '</td><td>' . sprintf(__('%s hours', 'backwpup'), (int) get_option('gmt_offset')) . '</td></tr>';
        echo '<tr title="WPLANG"><td>' . __('Blog language', 'backwpup') . '</td><td>' . get_bloginfo('language') . '</td></tr>';
        echo '<tr title="utf8"><td>' . __('MySQL Client encoding', 'backwpup') . '</td><td>';
        echo defined('DB_CHARSET') ? DB_CHARSET : '';
        echo '</td></tr>';
        echo '<tr title="URF-8"><td>' . __('Blog charset', 'backwpup') . '</td><td>' . get_bloginfo('charset') . '</td></tr>';
        echo '<tr title="&gt;=128M"><td>' . __('PHP Memory limit', 'backwpup') . '</td><td>' . esc_html(ini_get('memory_limit')) . '</td></tr>';
        echo '<tr title="WP_MEMORY_LIMIT"><td>' . __('WP memory limit', 'backwpup') . '</td><td>' . esc_html(WP_MEMORY_LIMIT) . '</td></tr>';
        echo '<tr title="WP_MAX_MEMORY_LIMIT"><td>' . __('WP maximum memory limit', 'backwpup') . '</td><td>' . esc_html(WP_MAX_MEMORY_LIMIT) . '</td></tr>';
        echo '<tr title=""><td>' . __('Memory in use', 'backwpup') . '</td><td>' . size_format(@memory_get_usage(TRUE), 2) . '</td></tr>';
        //disabled PHP functions
        $disabled = esc_html(ini_get('disable_functions'));
        if (!empty($disabled)) {
            $disabledarry = explode(',', $disabled);
            echo '<tr title=""><td>' . __('Disabled PHP Functions:', 'backwpup') . '</td><td>';
            echo implode(', ', $disabledarry);
            echo '</td></tr>';
        }
        //Loaded PHP Extensions
        echo '<tr title=""><td>' . __('Loaded PHP Extensions:', 'backwpup') . '</td><td>';
        $extensions = get_loaded_extensions();
        sort($extensions);
        echo esc_html(implode(', ', $extensions));
        echo '</td></tr>';
        echo '</table>';
        ?>
        </div>

		<?php 
        do_action('backwpup_page_settings_tab_content');
        ?>

        <p class="submit">
            <input type="submit" name="submit" id="submit" class="button-primary" value="<?php 
        _e('Save Changes', 'backwpup');
        ?>
" />
			&nbsp;
			<input type="submit" name="default_settings" id="default_settings" class="button-secondary" value="<?php 
        _e('Reset all settings to default', 'backwpup');
        ?>
" />
        </p>
    </form>
    </div>
	<?php 
    }
コード例 #14
0
 /**
  *
  * Check is folder readable and exists create it if not
  * add .htaccess or index.html file in folder to prevent directory listing
  *
  * @param string $folder the folder to check
  * @param bool   $donotbackup Create a file that the folder will not backuped
  * @return bool ok or not
  */
 public static function check_folder($folder, $donotbackup = FALSE)
 {
     $folder = untrailingslashit(str_replace('\\', '/', $folder));
     if (empty($folder)) {
         return FALSE;
     }
     //check that is not home of WP
     if ($folder == untrailingslashit(str_replace('\\', '/', ABSPATH)) || $folder == untrailingslashit(str_replace('\\', '/', WP_PLUGIN_DIR)) || $folder == untrailingslashit(str_replace('\\', '/', WP_CONTENT_DIR))) {
         BackWPup_Admin::message(sprintf(__('Folder %1$s not allowed, please use another folder.', 'backwpup'), $folder), TRUE);
         return FALSE;
     }
     //create folder if it not exists
     if (!is_dir($folder)) {
         if (!wp_mkdir_p($folder)) {
             BackWPup_Admin::message(sprintf(__('Cannot create folder: %1$s', 'backwpup'), $folder), TRUE);
             return FALSE;
         }
     }
     //check is writable dir
     if (!is_writable($folder)) {
         BackWPup_Admin::message(sprintf(__('Folder "%1$s" is not writable', 'backwpup'), $folder), TRUE);
         return FALSE;
     }
     //create .htaccess for apache and index.php for folder security
     if (get_site_option('backwpup_cfg_protectfolders') && !file_exists($folder . '/.htaccess')) {
         file_put_contents($folder . '/.htaccess', "<Files \"*\">" . PHP_EOL . "<IfModule mod_access.c>" . PHP_EOL . "Deny from all" . PHP_EOL . "</IfModule>" . PHP_EOL . "<IfModule !mod_access_compat>" . PHP_EOL . "<IfModule mod_authz_host.c>" . PHP_EOL . "Deny from all" . PHP_EOL . "</IfModule>" . PHP_EOL . "</IfModule>" . PHP_EOL . "<IfModule mod_access_compat>" . PHP_EOL . "Deny from all" . PHP_EOL . "</IfModule>" . PHP_EOL . "</Files>");
     }
     if (get_site_option('backwpup_cfg_protectfolders') && !file_exists($folder . '/index.php')) {
         file_put_contents($folder . '/index.php', "<?php" . PHP_EOL . "header( \$_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found' );" . PHP_EOL . "header( 'Status: 404 Not Found' );" . PHP_EOL);
     }
     //Create do not backup file for this folder
     if ($donotbackup && !file_exists($folder . '/.donotbackup')) {
         file_put_contents($folder . '/.donotbackup', __('BackWPup will not backup folders and subfolders when this file is inside.', 'backwpup'));
     }
     return TRUE;
 }
コード例 #15
0
    /**
     * Display the page content
     */
    public static function page()
    {
        ?>
		<div class="wrap" id="backwpup-page">
			<h2><span id="backwpup-page-icon">&nbsp;</span><?php 
        echo esc_html(sprintf(__('%s Logs', 'backwpup'), BackWPup::get_plugin_data('name')));
        ?>
</h2>
			<?php 
        BackWPup_Admin::display_messages();
        ?>
			<form id="posts-filter" action="" method="get">
				<input type="hidden" name="page" value="backwpuplogs" />
				<?php 
        self::$listtable->display();
        ?>
				<div id="ajax-response"></div>
			</form>
		</div>
		<?php 
    }
コード例 #16
0
    /**
     * Page Output
     */
    public static function page()
    {
        global $wpdb;
        ?>
    <div class="wrap" id="backwpup-page">
		<h2><span id="backwpup-page-icon">&nbsp;</span><?php 
        echo sprintf(__('%s Settings', 'backwpup'), BackWPup::get_plugin_data('name'));
        ?>
</h2>
		<?php 
        $tabs = array('general' => __('General', 'backwpup'), 'job' => __('Jobs', 'backwpup'), 'log' => __('Logs', 'backwpup'), 'net' => __('Network', 'backwpup'), 'apikey' => __('API Keys', 'backwpup'), 'information' => __('Information', 'backwpup'));
        $tabs = apply_filters('backwpup_page_settings_tab', $tabs);
        echo '<h2 class="nav-tab-wrapper">';
        foreach ($tabs as $id => $name) {
            echo '<a href="#backwpup-tab-' . $id . '" class="nav-tab">' . $name . '</a>';
        }
        echo '</h2>';
        BackWPup_Admin::display_messages();
        ?>

    <form id="settingsform" action="<?php 
        echo admin_url('admin-post.php?action=backwpup');
        ?>
" method="post">
		<?php 
        wp_nonce_field('backwpupsettings_page');
        ?>
        <input type="hidden" name="page" value="backwpupsettings" />
    	<input type="hidden" name="anchor" value="#backwpup-tab-general" />

		<div class="table ui-tabs-hide" id="backwpup-tab-general">

			<h3 class="title"><?php 
        _e('Display Settings', 'backwpup');
        ?>
</h3>
            <p><?php 
        _e('Do you want to see BackWPup in the WordPress admin bar?', 'backwpup');
        ?>
</p>
            <table class="form-table">
                <tr>
                    <th scope="row"><?php 
        _e('Admin bar', 'backwpup');
        ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text"><span><?php 
        _e('Admin Bar', 'backwpup');
        ?>
</span>
                            </legend>
                            <label for="showadminbar">
                                <input name="showadminbar" type="checkbox" id="showadminbar"
                                       value="1" <?php 
        checked(get_site_option('backwpup_cfg_showadminbar'), TRUE);
        ?>
 />
								<?php 
        _e('Show BackWPup links in admin bar.', 'backwpup');
        ?>
</label>
                        </fieldset>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Folder sizes', 'backwpup');
        ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text"><span><?php 
        _e('Folder sizes', 'backwpup');
        ?>
</span>
                            </legend>
                            <label for="showfoldersize">
                                <input name="showfoldersize" type="checkbox" id="showfoldersize"
                                       value="1" <?php 
        checked(get_site_option('backwpup_cfg_showfoldersize'), TRUE);
        ?>
 />
								<?php 
        _e('Display folder sizes in the files tab when editing a job. (Might increase loading time of files tab.)', 'backwpup');
        ?>
</label>
                        </fieldset>
                    </td>
                </tr>
            </table>
			<h3 class="title"><?php 
        _e('Security', 'backwpup');
        ?>
</h3>
			<p><?php 
        _e('Security option for BackWPup', 'backwpup');
        ?>
</p>
            <table class="form-table">
                <tr>
                    <th scope="row"><?php 
        _e('Protect folders', 'backwpup');
        ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text"><span><?php 
        _e('Protect folders', 'backwpup');
        ?>
</span>
                            </legend>
                            <label for="protectfolders">
                                <input name="protectfolders" type="checkbox" id="protectfolders"
                                       value="1" <?php 
        checked(get_site_option('backwpup_cfg_protectfolders'), TRUE);
        ?>
 />
								<?php 
        _e('Protect BackWPup folders ( Temp, Log and Backups ) with <code>.htaccess</code> and <code>index.php</code>', 'backwpup');
        ?>
                            </label>
                        </fieldset>
                    </td>
                </tr>
            </table>

			<?php 
        do_action('backwpup_page_settings_tab_generel');
        ?>

		</div>

        <div class="table ui-tabs-hide" id="backwpup-tab-log">

            <p><?php 
        _e('Every time BackWPup runs a backup job, a log file is being generated. Choose where to store your log files and how many of them.', 'backwpup');
        ?>
</p>
            <table class="form-table">
                <tr>
                    <th scope="row"><label for="logfolder"><?php 
        _e('Log file folder', 'backwpup');
        ?>
</label></th>
                    <td>
                        <input name="logfolder" type="text" id="logfolder"
                               value="<?php 
        echo get_site_option('backwpup_cfg_logfolder');
        ?>
"
                               class="regular-text code"/>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><label for="maxlogs"><?php 
        _e('Maximum number of log files in folder', 'backwpup');
        ?>
</label>
                    </th>
                    <td>
                        <input name="maxlogs" type="text" id="maxlogs" title="<?php 
        esc_attr_e('Oldest files will be deleted first.', 'backwpup');
        ?>
"
                               value="<?php 
        echo get_site_option('backwpup_cfg_maxlogs');
        ?>
" class="small-text code help-tip"/>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Compression', 'backwpup');
        ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text"><span><?php 
        _e('Compression', 'backwpup');
        ?>
</span>
                            </legend>
                            <label for="gzlogs">
                                <input name="gzlogs" type="checkbox" id="gzlogs"
                                       value="1" <?php 
        checked(get_site_option('backwpup_cfg_gzlogs'), TRUE);
        if (!function_exists('gzopen')) {
            echo " disabled=\"disabled\"";
        }
        ?>
 />
								<?php 
        _e('Compress log files with GZip.', 'backwpup');
        ?>
</label>
                        </fieldset>
                    </td>
                </tr>
            </table>

        </div>
        <div class="table ui-tabs-hide" id="backwpup-tab-job">

            <p><?php 
        _e('There are a couple of general options for backup jobs. Set them here.', 'backwpup');
        ?>
</p>
            <table class="form-table">
                <tr>
                    <th scope="row">
                        <label for="jobstepretry"><?php 
        _e("Maximum number of retries for job steps", 'backwpup');
        ?>
</label></th>
                    <td>
                        <input name="jobstepretry" type="text" id="jobstepretry"
                               value="<?php 
        echo get_site_option('backwpup_cfg_jobstepretry');
        ?>
"
                               class="small-text code" />
                    </td>
                </tr>
				<tr>
                    <th scope="row"><?php 
        _e('Maximum script execution time', 'backwpup');
        ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text"><span><?php 
        _e('Maximum PHP Script execution time', 'backwpup');
        ?>
</span>
                            </legend>
                            <label for="jobmaxexecutiontime">
                                <input name="jobmaxexecutiontime" type="text" id="jobmaxexecutiontime" size="3" title="<?php 
        esc_attr_e('Job will restart before hitting maximum execution time. It will not work with CLI and not on every step during execution. If <code>ALTERNATE_WP_CRON</code> has been defined, WordPress Cron will be used.', 'backwpup');
        ?>
"
                                       value="<?php 
        echo get_site_option('backwpup_cfg_jobmaxexecutiontime');
        ?>
" class="help-tip" />
								<?php 
        _e('seconds. 0 = disabled.', 'backwpup');
        ?>
							</label>
                        </fieldset>
                    </td>
                </tr>
				<tr>
                    <th scope="row"><?php 
        _e('Method for creating ZIP-file archives', 'backwpup');
        ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text"><span><?php 
        _e('Method for creating ZIP-file archives', 'backwpup');
        ?>
</span>
                            </legend>
                            <label for="jobziparchivemethod">
								<select name="jobziparchivemethod" size="1" class="help-tip" title="<?php 
        esc_attr_e('Auto = Uses PHP class ZipArchive if available; otherwise uses PclZip.<br />ZipArchive = Uses less memory, but many open files at a time.<br />PclZip = Uses more memory, but only 2 open files at a time.', 'backwpup');
        ?>
">
									<option value="" <?php 
        selected(get_site_option('backwpup_cfg_jobziparchivemethod'), '');
        ?>
><?php 
        _e('Auto', 'backwpup');
        ?>
</option>
                                    <option value="ZipArchive" <?php 
        selected(get_site_option('backwpup_cfg_jobziparchivemethod'), 'ZipArchive');
        disabled(function_exists('ZipArchive'), TRUE);
        ?>
><?php 
        _e('ZipArchive', 'backwpup');
        ?>
</option>
                                    <option value="PclZip" <?php 
        selected(get_site_option('backwpup_cfg_jobziparchivemethod'), 'PclZip');
        ?>
><?php 
        _e('PclZip', 'backwpup');
        ?>
</option>
                                </select>
                            </label>
                        </fieldset>
                    </td>
                </tr>
                <tr>
                    <th scope="row">
                        <label for="jobrunauthkey"><?php 
        _e('Key to start jobs externally with an URL', 'backwpup');
        ?>
</label>
                    </th>
                    <td>
                        <input name="jobrunauthkey" type="text" id="jobrunauthkey" title="<?php 
        esc_attr_e('empty = deactivated. Will be used to protect job starts from unauthorized person.', 'backwpup');
        ?>
"
                               value="<?php 
        echo get_site_option('backwpup_cfg_jobrunauthkey');
        ?>
" class="text code help-tip"/>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('No translation', 'backwpup');
        ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text"><span><?php 
        _e('No Translation', 'backwpup');
        ?>
</span>
                            </legend>
                            <label for="jobnotranslate">
                                <input name="jobnotranslate" type="checkbox" id="jobnotranslate"
                                       value="1" <?php 
        checked(get_site_option('backwpup_cfg_jobnotranslate'), TRUE);
        ?>
 />
								<?php 
        _e('No translation for the job, the log will be written in English', 'backwpup');
        ?>
                            </label>
                        </fieldset>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Reduce server load', 'backwpup');
        ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text"><span><?php 
        _e('Reduce server load', 'backwpup');
        ?>
</span>
                            </legend>
                            <label for="jobwaittimems">
								<select name="jobwaittimems" size="1" class="help-tip" title="<?php 
        esc_attr_e('This adds short pauses to the process. Can be used to reduce the CPU load.<br /> Disabled = off<br /> minimum = shortest sleep<br /> medium = middle between minimum and maximum<br /> maximum = longest sleep<br />', 'backwpup');
        ?>
">
									<option value="0" <?php 
        selected(get_site_option('backwpup_cfg_jobwaittimems'), 0);
        ?>
><?php 
        _e('disabled', 'backwpup');
        ?>
</option>
                                    <option value="10000" <?php 
        selected(get_site_option('backwpup_cfg_jobwaittimems'), 10000);
        ?>
><?php 
        _e('minimum', 'backwpup');
        ?>
</option>
                                    <option value="30000" <?php 
        selected(get_site_option('backwpup_cfg_jobwaittimems'), 30000);
        ?>
><?php 
        _e('medium', 'backwpup');
        ?>
</option>
                                    <option value="90000" <?php 
        selected(get_site_option('backwpup_cfg_jobwaittimems'), 90000);
        ?>
><?php 
        _e('maximum', 'backwpup');
        ?>
</option>
                                </select>
                            </label>
                        </fieldset>
                    </td>
                </tr>
            </table>

        </div>

        <div class="table ui-tabs-hide" id="backwpup-tab-net">

			<h3 class="title"><?php 
        _e('Authentication', 'backwpup');
        ?>
</h3>
            <p><?php 
        _e('Is your blog protected with HTTP basic authentication (.htaccess)? If yes, please set the username and password for authentication here.', 'backwpup');
        ?>
</p>
            <table class="form-table">
                <tr>
                    <th scope="row"><label for="httpauthuser"><?php 
        _e('Username:'******'backwpup');
        ?>
</label></th>
                    <td>
                        <input name="httpauthuser" type="text" id="httpauthuser"
                               value="<?php 
        echo get_site_option('backwpup_cfg_httpauthuser');
        ?>
"
                               class="regular-text" autocomplete="off" />
                    </td>
                </tr>
                <tr>
                    <th scope="row"><label for="httpauthpassword"><?php 
        _e('Password:'******'backwpup');
        ?>
</label></th>
                    <td>
                        <input name="httpauthpassword" type="password" id="httpauthpassword"
                               value="<?php 
        echo BackWPup_Encryption::decrypt(get_site_option('backwpup_cfg_httpauthpassword'));
        ?>
"
                               class="regular-text" autocomplete="off" />
                </tr>
            </table>

        </div>

        <div class="table ui-tabs-hide" id="backwpup-tab-apikey">

			<?php 
        do_action('backwpup_page_settings_tab_apikey');
        ?>

        </div>

        <div class="table ui-tabs-hide" id="backwpup-tab-information">
			<br />
			<?php 
        echo '<table class="wp-list-table widefat fixed" cellspacing="0" style="width: 85%;margin-left:auto;;margin-right:auto;">';
        echo '<thead><tr><th width="35%">' . __('Setting', 'backwpup') . '</th><th>' . __('Value', 'backwpup') . '</th></tr></thead>';
        echo '<tfoot><tr><th>' . __('Setting', 'backwpup') . '</th><th>' . __('Value', 'backwpup') . '</th></tr></tfoot>';
        echo '<tr title="&gt;=3.2"><td>' . __('WordPress version', 'backwpup') . '</td><td>' . BackWPup::get_plugin_data('wp_version') . '</td></tr>';
        if (!class_exists('BackWPup_Pro', FALSE)) {
            echo '<tr title=""><td>' . __('BackWPup version', 'backwpup') . '</td><td>' . BackWPup::get_plugin_data('Version') . ' <a href="' . translate(BackWPup::get_plugin_data('pluginuri'), 'backwpup') . '">' . __('Get pro.', 'backwpup') . '</a></td></tr>';
        } else {
            echo '<tr title=""><td>' . __('BackWPup Pro version', 'backwpup') . '</td><td>' . BackWPup::get_plugin_data('Version') . '</td></tr>';
        }
        echo '<tr title="&gt;=5.3.3"><td>' . __('PHP version', 'backwpup') . '</td><td>' . PHP_VERSION . '</td></tr>';
        echo '<tr title="&gt;=5.0.7"><td>' . __('MySQL version', 'backwpup') . '</td><td>' . $wpdb->get_var("SELECT VERSION() AS version") . '</td></tr>';
        if (function_exists('curl_version')) {
            $curlversion = curl_version();
            echo '<tr title=""><td>' . __('cURL version', 'backwpup') . '</td><td>' . $curlversion['version'] . '</td></tr>';
            echo '<tr title=""><td>' . __('cURL SSL version', 'backwpup') . '</td><td>' . $curlversion['ssl_version'] . '</td></tr>';
        } else {
            echo '<tr title=""><td>' . __('cURL version', 'backwpup') . '</td><td>' . __('unavailable', 'backwpup') . '</td></tr>';
        }
        echo '<tr title=""><td>' . __('WP-Cron url:', 'backwpup') . '</td><td>' . site_url('wp-cron.php') . '</td></tr>';
        //response test
        echo '<tr><td>' . __('Server self connect:', 'backwpup') . '</td><td>';
        $raw_response = BackWPup_Job::get_jobrun_url('test');
        $test_result = '';
        if (is_wp_error($raw_response)) {
            $test_result .= sprintf(__('The HTTP response test get an error "%s"', 'backwpup'), $raw_response->get_error_message());
        } elseif (200 != wp_remote_retrieve_response_code($raw_response) && 204 != wp_remote_retrieve_response_code($raw_response)) {
            $test_result .= sprintf(__('The HTTP response test get a false http status (%s)', 'backwpup'), wp_remote_retrieve_response_code($raw_response));
        }
        $headers = wp_remote_retrieve_headers($raw_response);
        if (isset($headers['x-backwpup-ver']) && $headers['x-backwpup-ver'] != BackWPup::get_plugin_data('version')) {
            $test_result .= sprintf(__('The BackWPup HTTP response header returns a false value: "%s"', 'backwpup'), $headers['x-backwpup-ver']);
        }
        if (empty($test_result)) {
            _e('Response Test O.K.', 'backwpup');
        } else {
            echo $test_result;
        }
        echo '</td></tr>';
        //folder test
        echo '<tr><td>' . __('Temp folder:', 'backwpup') . '</td><td>';
        if (!is_dir(BackWPup::get_plugin_data('TEMP'))) {
            echo sprintf(__('Temp folder %s doesn\'t exist.', 'backwpup'), BackWPup::get_plugin_data('TEMP'));
        } elseif (!is_writable(BackWPup::get_plugin_data('TEMP'))) {
            echo sprintf(__('Temporary folder %s is not writable.', 'backwpup'), BackWPup::get_plugin_data('TEMP'));
        } else {
            echo BackWPup::get_plugin_data('TEMP');
        }
        echo '</td></tr>';
        echo '<tr><td>' . __('Log folder:', 'backwpup') . '</td><td>';
        if (!is_dir(get_site_option('backwpup_cfg_logfolder'))) {
            echo sprintf(__('Logs folder %s not exist.', 'backwpup'), get_site_option('backwpup_cfg_logfolder'));
        } elseif (!is_writable(get_site_option('backwpup_cfg_logfolder'))) {
            echo sprintf(__('Log folder %s is not writable.', 'backwpup'), get_site_option('backwpup_cfg_logfolder'));
        } else {
            echo get_site_option('backwpup_cfg_logfolder');
        }
        echo '</td></tr>';
        echo '<tr title=""><td>' . __('Server', 'backwpup') . '</td><td>' . $_SERVER['SERVER_SOFTWARE'] . '</td></tr>';
        echo '<tr title=""><td>' . __('Operating System', 'backwpup') . '</td><td>' . PHP_OS . '</td></tr>';
        echo '<tr title=""><td>' . __('PHP SAPI', 'backwpup') . '</td><td>' . PHP_SAPI . '</td></tr>';
        echo '<tr title=""><td>' . __('Current PHP user', 'backwpup') . '</td><td>' . get_current_user() . '</td></tr>';
        $text = (bool) ini_get('safe_mode') ? __('On', 'backwpup') : __('Off', 'backwpup');
        echo '<tr title=""><td>' . __('Safe Mode', 'backwpup') . '</td><td>' . $text . '</td></tr>';
        echo '<tr title="&gt;=30"><td>' . __('Maximum execution time', 'backwpup') . '</td><td>' . ini_get('max_execution_time') . ' ' . __('seconds', 'backwpup') . '</td></tr>';
        if (defined('ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON) {
            echo '<tr title="ALTERNATE_WP_CRON"><td>' . __('Alternative WP Cron', 'backwpup') . '</td><td>' . __('On', 'backwpup') . '</td></tr>';
        } else {
            echo '<tr title="ALTERNATE_WP_CRON"><td>' . __('Alternative WP Cron', 'backwpup') . '</td><td>' . __('Off', 'backwpup') . '</td></tr>';
        }
        if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON) {
            echo '<tr title="DISABLE_WP_CRON"><td>' . __('Disabled WP Cron', 'backwpup') . '</td><td>' . __('On', 'backwpup') . '</td></tr>';
        } else {
            echo '<tr title="DISABLE_WP_CRON"><td>' . __('Disabled WP Cron', 'backwpup') . '</td><td>' . __('Off', 'backwpup') . '</td></tr>';
        }
        if (defined('FS_CHMOD_DIR')) {
            echo '<tr title="FS_CHMOD_DIR"><td>' . __('CHMOD Dir', 'backwpup') . '</td><td>' . FS_CHMOD_DIR . '</td></tr>';
        } else {
            echo '<tr title="FS_CHMOD_DIR"><td>' . __('CHMOD Dir', 'backwpup') . '</td><td>0755</td></tr>';
        }
        $now = localtime(time(), TRUE);
        echo '<tr title=""><td>' . __('Server Time', 'backwpup') . '</td><td>' . $now['tm_hour'] . ':' . $now['tm_min'] . '</td></tr>';
        echo '<tr title=""><td>' . __('Blog Time', 'backwpup') . '</td><td>' . date_i18n('H:i') . '</td></tr>';
        echo '<tr title=""><td>' . __('Blog Timezone', 'backwpup') . '</td><td>' . get_option('timezone_string') . '</td></tr>';
        echo '<tr title=""><td>' . __('Blog Time offset', 'backwpup') . '</td><td>' . sprintf(__('%s hours', 'backwpup'), get_option('gmt_offset')) . '</td></tr>';
        echo '<tr title="WPLANG"><td>' . __('Blog language', 'backwpup') . '</td><td>' . get_bloginfo('language') . '</td></tr>';
        echo '<tr title="utf8"><td>' . __('MySQL Client encoding', 'backwpup') . '</td><td>';
        echo defined('DB_CHARSET') ? DB_CHARSET : '';
        echo '</td></tr>';
        echo '<tr title="URF-8"><td>' . __('Blog charset', 'backwpup') . '</td><td>' . get_bloginfo('charset') . '</td></tr>';
        echo '<tr title="&gt;=128M"><td>' . __('PHP Memory limit', 'backwpup') . '</td><td>' . ini_get('memory_limit') . '</td></tr>';
        echo '<tr title="WP_MEMORY_LIMIT"><td>' . __('WP memory limit', 'backwpup') . '</td><td>' . WP_MEMORY_LIMIT . '</td></tr>';
        echo '<tr title="WP_MAX_MEMORY_LIMIT"><td>' . __('WP maximum memory limit', 'backwpup') . '</td><td>' . WP_MAX_MEMORY_LIMIT . '</td></tr>';
        echo '<tr title=""><td>' . __('Memory in use', 'backwpup') . '</td><td>' . size_format(@memory_get_usage(TRUE), 2) . '</td></tr>';
        //disabled PHP functions
        $disabled = ini_get('disable_functions');
        if (!empty($disabled)) {
            $disabledarry = explode(',', $disabled);
            echo '<tr title=""><td>' . __('Disabled PHP Functions:', 'backwpup') . '</td><td>';
            echo implode(', ', $disabledarry);
            echo '</td></tr>';
        }
        //Loaded PHP Extensions
        echo '<tr title=""><td>' . __('Loaded PHP Extensions:', 'backwpup') . '</td><td>';
        $extensions = get_loaded_extensions();
        sort($extensions);
        echo implode(', ', $extensions);
        echo '</td></tr>';
        echo '</table>';
        ?>
        </div>

		<?php 
        do_action('backwpup_page_settings_tab_content');
        ?>

        <p class="submit">
            <input type="submit" name="submit" id="submit" class="button-primary" value="<?php 
        _e('Save Changes', 'backwpup');
        ?>
" />
			&nbsp;
			<input type="submit" name="default_settings" id="default_settings" class="button-secondary" value="<?php 
        _e('Reset all settings to default', 'backwpup');
        ?>
" />
        </p>
    </form>
    </div>
	<?php 
    }
コード例 #17
0
 /**
  * @param $jobdest
  * @param $backupfile
  */
 public function file_delete($jobdest, $backupfile)
 {
     $files = get_site_transient('backwpup_' . strtolower($jobdest));
     list($jobid, $dest) = explode('_', $jobdest);
     if (BackWPup_Option::get($jobid, 'sugarrefreshtoken')) {
         try {
             $sugarsync = new BackWPup_Destination_SugarSync_API(BackWPup_Option::get($jobid, 'sugarrefreshtoken'));
             $sugarsync->delete(urldecode($backupfile));
             //update file list
             foreach ($files as $key => $file) {
                 if (is_array($file) && $file['file'] == $backupfile) {
                     unset($files[$key]);
                 }
             }
             unset($sugarsync);
         } catch (Exception $e) {
             BackWPup_Admin::message('SUGARSYNC: ' . $e->getMessage(), TRUE);
         }
     }
     set_site_transient('backwpup_' . strtolower($jobdest), $files, 60 * 60 * 24 * 7);
 }
コード例 #18
0
 /**
  * @param $jobdest
  * @param $backupfile
  */
 public function file_delete($jobdest, $backupfile)
 {
     $files = get_site_transient('backwpup_' . strtolower($jobdest));
     list($jobid, $dest) = explode('_', $jobdest);
     if (BackWPup_Option::get($jobid, 'rscusername') && BackWPup_Option::get($jobid, 'rscapikey') && BackWPup_Option::get($jobid, 'rsccontainer')) {
         try {
             $conn = new OpenCloud\Rackspace(self::get_auth_url_by_region(BackWPup_Option::get($jobid, 'rscregion')), array('username' => BackWPup_Option::get($jobid, 'rscusername'), 'apiKey' => BackWPup_Encryption::decrypt(BackWPup_Option::get($jobid, 'rscapikey'))));
             $conn->{$ostore} = $conn->objectStoreService('cloudFiles', BackWPup_Option::get($jobid, 'rscregion'), 'publicURL');
             $container = $ostore->getContainer(BackWPup_Option::get($jobid, 'rsccontainer'));
             $fileobject = $container->getObject($backupfile);
             $fileobject->delete();
             //update file list
             foreach ($files as $key => $file) {
                 if (is_array($file) && $file['file'] == $backupfile) {
                     unset($files[$key]);
                 }
             }
         } catch (Exception $e) {
             BackWPup_Admin::message('RSC: ' . $e->getMessage(), TRUE);
         }
     }
     set_site_transient('backwpup_' . strtolower($jobdest), $files, 60 * 60 * 24 * 7);
 }
コード例 #19
0
ファイル: class-job.php プロジェクト: skinnard/FTL-2
 /**
  *
  */
 public static function start_http($starttype, $jobid = 0)
 {
     //load text domain
     $log_level = get_site_option('backwpup_cfg_loglevel', 'normal_translated');
     if (strstr($log_level, 'translated')) {
         BackWPup::load_text_domain();
     } else {
         add_filter('override_load_textdomain', '__return_true');
         $GLOBALS['l10n'] = array();
     }
     if ($starttype !== 'restart') {
         //check job id exists
         if ($jobid !== BackWPup_Option::get($jobid, 'jobid')) {
             return false;
         }
         //check folders
         $log_folder = get_site_option('backwpup_cfg_logfolder');
         $folder_message_log = BackWPup_File::check_folder(BackWPup_File::get_absolute_path($log_folder));
         $folder_message_temp = BackWPup_File::check_folder(BackWPup::get_plugin_data('TEMP'), true);
         if (!empty($folder_message_log) || !empty($folder_message_temp)) {
             BackWPup_Admin::message($folder_message_log, true);
             BackWPup_Admin::message($folder_message_temp, true);
             return false;
         }
     }
     // redirect
     if ($starttype === 'runnowalt') {
         ob_start();
         wp_redirect(add_query_arg(array('page' => 'backwpupjobs'), network_admin_url('admin.php')));
         echo ' ';
         flush();
         if ($level = ob_get_level()) {
             for ($i = 0; $i < $level; $i++) {
                 ob_end_clean();
             }
         }
     }
     // Should be preventing doubled running job's on http requests
     $random = mt_rand(10, 90) * 10000;
     usleep($random);
     //check running job
     $backwpup_job_object = self::get_working_data();
     //start class
     if (!$backwpup_job_object && in_array($starttype, array('runnow', 'runnowalt', 'runext', 'cronrun'), true) && $jobid) {
         //schedule restart event
         wp_schedule_single_event(time() + 60, 'backwpup_cron', array('id' => 'restart'));
         //start job
         $backwpup_job_object = new self();
         $backwpup_job_object->create($starttype, $jobid);
     }
     if ($backwpup_job_object) {
         $backwpup_job_object->run();
     }
 }
コード例 #20
0
ファイル: class-job.php プロジェクト: Giede/backwpup
 /**
  * @param int $jobid
  */
 public static function start_wp_cron($jobid = 0)
 {
     if (!defined('DOING_CRON') || !DOING_CRON) {
         return;
     }
     //load text domain
     $log_level = get_site_option('backwpup_cfg_loglevel');
     if (strstr($log_level, 'translated')) {
         BackWPup::load_text_domain();
     }
     if (!empty($jobid)) {
         //check folders
         $log_folder = get_site_option('backwpup_cfg_logfolder');
         $folder_message_log = BackWPup_File::check_folder(BackWPup_File::get_absolute_path($log_folder));
         $folder_message_temp = BackWPup_File::check_folder(BackWPup::get_plugin_data('TEMP'), TRUE);
         if (!empty($folder_message_log) || !empty($folder_message_temp)) {
             BackWPup_Admin::message($folder_message_log, TRUE);
             BackWPup_Admin::message($folder_message_temp, TRUE);
             return;
         }
     }
     // Should be preventing doubled running job's on http requests
     $random = rand(1, 9) * 100000;
     usleep($random);
     //get running job
     $backwpup_job_object = self::get_working_data();
     //start/restart class
     if (empty($backwpup_job_object) && !empty($jobid)) {
         //schedule restart event
         wp_schedule_single_event(time() + 60, 'backwpup_cron', array('id' => 'restart'));
         //start job
         $backwpup_job_object = new self();
         $backwpup_job_object->create('cronrun', (int) $jobid);
     }
     if (is_object($backwpup_job_object) && $backwpup_job_object instanceof BackWPup_Job) {
         $backwpup_job_object->run();
     }
 }
コード例 #21
0
 /**
  * @param $jobdest
  * @param $backupfile
  */
 public function file_delete($jobdest, $backupfile)
 {
     $files = get_site_transient('backwpup_' . strtolower($jobdest), FALSE);
     list($jobid, $dest) = explode('_', $jobdest);
     if (BackWPup_Option::get($jobid, 'msazureaccname') && BackWPup_Option::get($jobid, 'msazurekey') && BackWPup_Option::get($jobid, 'msazurecontainer')) {
         try {
             set_include_path(get_include_path() . PATH_SEPARATOR . BackWPup::get_plugin_data('plugindir') . '/vendor/PEAR/');
             $blobRestProxy = WindowsAzure\Common\ServicesBuilder::getInstance()->createBlobService('DefaultEndpointsProtocol=https;AccountName=' . BackWPup_Option::get($jobid, 'msazureaccname') . ';AccountKey=' . BackWPup_Encryption::decrypt(BackWPup_Option::get($jobid, 'msazurekey')));
             $blobRestProxy->deleteBlob(BackWPup_Option::get($jobid, 'msazurecontainer'), $backupfile);
             //update file list
             foreach ($files as $key => $file) {
                 if (is_array($file) && $file['file'] == $backupfile) {
                     unset($files[$key]);
                 }
             }
         } catch (Exception $e) {
             BackWPup_Admin::message('MS AZURE: ' . $e->getMessage(), TRUE);
         }
     }
     set_site_transient('backwpup_' . strtolower($jobdest), $files, 60 * 60 * 24 * 7);
 }
コード例 #22
0
ファイル: class-page-jobs.php プロジェクト: skinnard/FTL-2
    /**
     *
     */
    public static function page()
    {
        echo '<div class="wrap" id="backwpup-page">';
        echo '<h1>' . esc_html(sprintf(__('%s &rsaquo; Jobs', 'backwpup'), BackWPup::get_plugin_data('name'))) . '&nbsp;<a href="' . wp_nonce_url(network_admin_url('admin.php') . '?page=backwpupeditjob', 'edit-job') . '" class="add-new-h2">' . esc_html__('Add new', 'backwpup') . '</a></h1>';
        BackWPup_Admin::display_messages();
        $job_object = BackWPup_Job::get_working_data();
        if (current_user_can('backwpup_jobs_start') && is_object($job_object)) {
            //read existing logfile
            $logfiledata = file_get_contents($job_object->logfile);
            preg_match('/<body[^>]*>/si', $logfiledata, $match);
            if (!empty($match[0])) {
                $startpos = strpos($logfiledata, $match[0]) + strlen($match[0]);
            } else {
                $startpos = 0;
            }
            $endpos = stripos($logfiledata, '</body>');
            if (empty($endpos)) {
                $endpos = strlen($logfiledata);
            }
            $length = strlen($logfiledata) - (strlen($logfiledata) - $endpos) - $startpos;
            ?>
			<div id="runningjob">
				<div id="runniginfos">
					<h2 id="runningtitle"><?php 
            esc_html(sprintf(__('Job currently running: %s', 'backwpup'), $job_object->job['name']));
            ?>
</h2>
					<span id="warningsid"><?php 
            esc_html_e('Warnings:', 'backwpup');
            ?>
 <span id="warnings"><?php 
            echo $job_object->warnings;
            ?>
</span></span>
					<span id="errorid"><?php 
            esc_html_e('Errors:', 'backwpup');
            ?>
 <span id="errors"><?php 
            echo $job_object->errors;
            ?>
</span></span>
					<div class="infobuttons"><a href="#TB_inline?height=440&width=630&inlineId=tb-showworking" id="showworkingbutton" class="thickbox button button-primary button-primary-bwp" title="<?php 
            esc_attr_e('Log of running job', 'backwpup');
            ?>
"><?php 
            esc_html_e('Display working log', 'backwpup');
            ?>
</a>
					<a href="<?php 
            echo wp_nonce_url(network_admin_url('admin.php') . '?page=backwpupjobs&action=abort', 'abort-job');
            ?>
" id="abortbutton" class="backwpup-fancybox button button-bwp"><?php 
            esc_html_e('Abort', 'backwpup');
            ?>
</a>
					<a href="#" id="showworkingclose" title="<?php 
            esc_html_e('Close working screen', 'backwpup');
            ?>
" class="button button-bwp" style="display:none" ><?php 
            esc_html_e('Close', 'backwpup');
            ?>
</a></div>
				</div>
				<input type="hidden" name="logpos" id="logpos" value="<?php 
            echo strlen($logfiledata);
            ?>
">
				<div id="lasterrormsg"></div>
				<div class="progressbar"><div id="progressstep" class="bwpu-progress" style="width:<?php 
            echo $job_object->step_percent;
            ?>
%;"><?php 
            echo esc_html($job_object->step_percent);
            ?>
%</div></div>
				<div id="onstep"><?php 
            echo esc_html($job_object->steps_data[$job_object->step_working]['NAME']);
            ?>
</div>
				<div class="progressbar"><div id="progresssteps" class="bwpu-progress" style="width:<?php 
            echo $job_object->substep_percent;
            ?>
%;"><?php 
            echo esc_html($job_object->substep_percent);
            ?>
%</div></div>
				<div id="lastmsg"><?php 
            echo esc_html($job_object->lastmsg);
            ?>
</div>
				<div id="tb-showworking" style="display:none;">
					<div id="showworking"><?php 
            echo substr($logfiledata, $startpos, $length);
            ?>
</div>
				</div>
			</div>
		<?php 
        }
        //display jos Table
        ?>
		<form id="posts-filter" action="" method="get">
		<input type="hidden" name="page" value="backwpupjobs" />
		<?php 
        echo wp_nonce_field('backwpup_ajax_nonce', 'backwpupajaxnonce', FALSE);
        self::$listtable->display();
        ?>
		<div id="ajax-response"></div>
		</form>
		</div>
		<?php 
        if (!empty($job_object->logfile)) {
            ?>
        <script type="text/javascript">
            //<![CDATA[
            jQuery(document).ready(function ($) {
                backwpup_show_working = function () {
	                var save_log_pos = 0;
                    $.ajax({
                        type: 'GET',
                        url: ajaxurl,
                        cache: false,
                        data:{
                            action: 'backwpup_working',
                            logpos: $('#logpos').val(),
							logfile: '<?php 
            echo basename($job_object->logfile);
            ?>
',
                            _ajax_nonce: '<?php 
            echo wp_create_nonce('backwpupworking_ajax_nonce');
            ?>
'
                        },
                        dataType: 'json',
                        success:function (rundata) {
							if ( rundata == 0 ) {
								$("#abortbutton").remove();
								$("#backwpup-adminbar-running").remove();
								$(".job-run").hide();
								$("#message").hide();
								$(".job-normal").show();
								$('#showworkingclose').show();
							}
							if (0 < rundata.log_pos) {
								$('#logpos').val(rundata.log_pos);
							}
                            if ('' != rundata.log_text) {
                                $('#showworking').append(rundata.log_text);
								$('#TB_ajaxContent').scrollTop(rundata.log_pos * 15);
                            }
                            if (0 < rundata.error_count) {
                                $('#errors').replaceWith('<span id="errors">' + rundata.error_count + '</span>');
                            }
                            if (0 < rundata.warning_count) {
                                $('#warnings').replaceWith('<span id="warnings">' + rundata.warning_count + '</span>');
                            }
                            if (0 < rundata.step_percent) {
                                $('#progressstep').replaceWith('<div id="progressstep" class="bwpu-progress">' + rundata.step_percent + '%</div>');
                                $('#progressstep').css('width', parseFloat(rundata.step_percent) + '%');
                            }
                            if (0 < rundata.sub_step_percent) {
                                $('#progresssteps').replaceWith('<div id="progresssteps" class="bwpu-progress">' + rundata.sub_step_percent + '%</div>');
                                $('#progresssteps').css('width', parseFloat(rundata.sub_step_percent) + '%');
                            }
                            if (0 < rundata.running_time) {
                                $('#runtime').replaceWith('<span id="runtime">' + rundata.running_time + '</span>');
                            }
                            if ( '' != rundata.onstep ) {
                                $('#onstep').replaceWith('<div id="onstep">' + rundata.on_step + '</div>');
                            }
                            if ( '' != rundata.last_msg ) {
                                $('#lastmsg').replaceWith('<div id="lastmsg">' + rundata.last_msg + '</div>');
                            }
							if ( '' != rundata.last_error_msg ) {
							    $('#lasterrormsg').replaceWith('<div id="lasterrormsg">' + rundata.last_error_msg + '</div>');
						    }
                            if ( rundata.job_done == 1 ) {
                                $("#abortbutton").remove();
                                $("#backwpup-adminbar-running").remove();
								$(".job-run").hide();
                                $("#message").hide();
                                $(".job-normal").show();
                                $('#showworkingclose').show();
                            } else {
								if ( rundata.restart_url !== '' ) {
	                                backwpup_trigger_cron( rundata.restart_url );
								}
                            	setTimeout('backwpup_show_working()', 750);
                            }
                        },
						error:function( ) {
							setTimeout('backwpup_show_working()', 750);
						}
                    });
                };
	            backwpup_trigger_cron = function ( cron_url ) {
		            $.ajax({
			            type: 'POST',
			            url: cron_url,
			            dataType: 'text',
			            cache: false,
			            processData: false,
			            timeout: 1
		            });
	            };
                backwpup_show_working();
                $('#showworkingclose').click( function() {
                    $("#runningjob").hide( 'slow' );
                    return false;
                });
            });
            //]]>
        </script>
		<?php 
        }
    }
コード例 #23
0
 /**
  * @param $jobdest
  * @param $backupfile
  */
 public function file_delete($jobdest, $backupfile)
 {
     $files = get_site_transient('backwpup_' . strtolower($jobdest));
     list($jobid, $dest) = explode('_', $jobdest);
     if (BackWPup_Option::get($jobid, 'dropboxtoken') && BackWPup_Option::get($jobid, 'dropboxsecret')) {
         try {
             $dropbox = new BackWPup_Destination_Dropbox_API(BackWPup_Option::get($jobid, 'dropboxroot'));
             $dropbox->setOAuthTokens(BackWPup_Option::get($jobid, 'dropboxtoken'), BackWPup_Encryption::decrypt(BackWPup_Option::get($jobid, 'dropboxsecret')));
             $dropbox->fileopsDelete($backupfile);
             //update file list
             foreach ($files as $key => $file) {
                 if (is_array($file) && $file['file'] == $backupfile) {
                     unset($files[$key]);
                 }
             }
             unset($dropbox);
         } catch (Exception $e) {
             BackWPup_Admin::message('DROPBOX: ' . $e->getMessage(), TRUE);
         }
     }
     set_site_transient('backwpup_' . strtolower($jobdest), $files, 60 * 60 * 24 * 7);
 }
コード例 #24
0
    /**
     * Print the markup.
     *
     * @return void
     */
    public static function page()
    {
        $lang = substr(get_locale(), 0, 2);
        if ($lang !== 'de') {
            $lang = 'en';
        }
        ?>
        <div class="wrap" id="backwpup-page">
			<?php 
        BackWPup_Admin::display_messages();
        ?>
            <div class="welcome">
            	<div class="welcome_inner">
                    <?php 
        if (class_exists('BackWPup_Pro', FALSE)) {
            ?>
                    <div class="welcometxt">
                        <div class="backwpup-welcome">
							<img class="backwpup-banner-img" src="<?php 
            echo BackWPup::get_plugin_data('URL');
            ?>
/assets/images/backwpupbanner.png" />
                            <h1><?php 
            esc_html_e('Welcome to BackWPup Pro', 'backwpup');
            ?>
</h1>
                            <p><?php 
            esc_html_e('BackWPup’s job wizards make planning and scheduling your backup jobs a breeze.', 'backwpup');
            echo ' ';
            _e('Use your backup archives to save your entire WordPress installation including <code>/wp-content/</code>. Push them to an external storage service if you don’t want to save the backups on the same server. With a single backup archive you are able to restore an installation. Use a tool like phpMyAdmin or a plugin like <a href="http://wordpress.org/plugins/adminer/" target="_blank">Adminer</a> to restore your database backup files.', 'backwpup');
            ?>
</p>
                            <p><?php 
            echo str_replace('\\"', '"', sprintf(__('Ready to <a href="%1$s">set up a backup job</a>? You can <a href="%2$s">use the wizards</a> or plan your backup in expert mode.', 'backwpup'), network_admin_url('admin.php') . '?page=backwpupeditjob', network_admin_url('admin.php') . '?page=backwpupwizard'));
            ?>
</p>
                        </div>
	                    <?php 
            if ('2016-06-30' > date('Y-m-d')) {
                ?>
		                    <a href="https://www.surveymonkey.com/r/BQJZSG2"><img class="backwpup-umfage" src="<?php 
                echo BackWPup::get_plugin_data('URL');
                ?>
/assets/images/banner-survey-<?php 
                echo $lang;
                ?>
.png" style="height:auto;margin: 26px auto;max-width:100%;" /></a>
	                    <?php 
            }
            ?>
                    </div>
                    <?php 
        } else {
            ?>
                    <div class="welcometxt">
                        <div class="backwpup-welcome">
							<img class="backwpup-banner-img" src="<?php 
            echo esc_attr(BackWPup::get_plugin_data('URL'));
            ?>
/assets/images/backwpupbanner.png" />
                            <h1><?php 
            esc_html_e('Welcome to BackWPup', 'backwpup');
            ?>
</h1>
                            <p><?php 
            _e('Use your backup archives to save your entire WordPress installation including <code>/wp-content/</code>. Push them to an external storage service if you don’t want to save the backups on the same server. With a single backup archive you are able to restore an installation. Use a tool like phpMyAdmin or a plugin like <a href="http://wordpress.org/plugins/adminer/" target="_blank">Adminer</a> to restore your database backup files.', 'backwpup');
            ?>
</p>
                            <p><?php 
            esc_html_e('Ready to set up a backup job? Use one of the wizards to plan what you want to save.', 'backwpup');
            ?>
</p>
                        </div>
	                    <?php 
            if ('2016-06-30' > date('Y-m-d')) {
                ?>
	                        <a href="https://www.surveymonkey.com/r/BQJZSG2"><img class="backwpup-umfage" src="<?php 
                echo BackWPup::get_plugin_data('URL');
                ?>
/assets/images/banner-survey-<?php 
                echo $lang;
                ?>
.png" style="height:auto;margin: 26px auto;max-width:100%;" /></a>
                        <?php 
            }
            ?>
                    </div>
                    <?php 
        }
        ?>
		            <div>
		            </div>
            		<div class="features">

                    	<div class="feature-box <?php 
        self::feature_class();
        ?>
">
                        	<div class="feature-image">
                                <img title="<?php 
        esc_html_e('Save your database', 'backwpup');
        ?>
" src="<?php 
        echo esc_attr(BackWPup::get_plugin_data('URL'));
        ?>
/assets/images/imagesave.png" />
                            </div>
                            <div class="feature-text">
                            	<h3><?php 
        esc_html_e('Save your database regularly', 'backwpup');
        ?>
</h3>
                                <p><?php 
        echo str_replace('\\"', '"', sprintf(__('With BackWPup you can schedule the database backup to run automatically. With a single backup file you can restore your database. You should <a href="%s">set up a backup job</a>, so you will never forget it. There is also an option to repair and optimize the database after each backup.', 'backwpup'), network_admin_url('admin.php') . '?page=backwpupeditjob'));
        ?>
</p>
                            </div>
                        </div>
                        <div class="feature-box <?php 
        self::feature_class();
        ?>
">
                            <div class="feature-text">
                            	<h3><?php 
        esc_html_e('WordPress XML Export', 'backwpup');
        ?>
</h3>
                                <p><?php 
        esc_html_e('You can choose the built-in WordPress export format in addition or exclusive to save your data. This works in automated backups too of course. The advantage is: you can import these files into a blog with the regular WordPress importer.', 'backwpup');
        ?>
</p>
                            </div>
                            <div class="feature-image">
                            	<img title="<?php 
        esc_html_e('WordPress XML Export', 'backwpup');
        ?>
" src="<?php 
        echo BackWPup::get_plugin_data('URL');
        ?>
/assets/images/imagexml.png" />
                            </div>
                        </div>
                        <div class="feature-box <?php 
        self::feature_class();
        ?>
">
                            <div class="feature-image">
                            	<img title="<?php 
        esc_html_e('Save all data from the webserver', 'backwpup');
        ?>
" src="<?php 
        echo BackWPup::get_plugin_data('URL');
        ?>
/assets/images/imagedata.png" />
                            </div>
                            <div class="feature-text">
                            	<h3><?php 
        esc_html_e('Save all files', 'backwpup');
        ?>
</h3>
                                <p><?php 
        echo str_replace('\\"', '"', sprintf(__('You can backup all your attachments, also all system files, plugins and themes in a single file. You can <a href="%s">create a job</a> to update a backup copy of your file system only when files are changed.', 'backwpup'), network_admin_url('admin.php') . '?page=backwpupeditjob'));
        ?>
</p>
                            </div>
                        </div>
                        <div class="feature-box <?php 
        self::feature_class();
        ?>
">
                            <div class="feature-text">
                            	<h3><?php 
        esc_html_e('Security!', 'backwpup');
        ?>
</h3>
                                <p><?php 
        esc_html_e('By default everything is encrypted: connections to external services, local files and access to directories.', 'backwpup');
        ?>
</p>
                            </div>
                        	<div class="feature-image">
                            	<img title="<?php 
        esc_html_e('Security!', 'backwpup');
        ?>
" src="<?php 
        echo esc_attr(BackWPup::get_plugin_data('URL'));
        ?>
/assets/images/imagesec.png" />
                            </div>
                        </div>
                        <div class="feature-box <?php 
        self::feature_class();
        ?>
">
                            <div class="feature-image">
                            	<img title="<?php 
        esc_html_e('Cloud Support', 'backwpup');
        ?>
" src="<?php 
        echo BackWPup::get_plugin_data('URL');
        ?>
/assets/images/imagecloud.png" />
                            </div>
                            <div class="feature-text">
                            	<h3><?php 
        esc_html_e('Cloud Support', 'backwpup');
        ?>
</h3>
                                <p><?php 
        esc_html_e('BackWPup supports multiple cloud services in parallel. This ensures backups are redundant.', 'backwpup');
        ?>
</p>
                            </div>
                        </div>
                    </div>
                </div>
					<div class="backwpup_comp">
						<h3><?php 
        esc_html_e('Features / differences between Free and Pro', 'backwpup');
        ?>
</h3>
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr class="even ub">
								<td><?php 
        esc_html_e('Features', 'backwpup');
        ?>
</td>
								<td class="free"><?php 
        esc_html_e('FREE', 'backwpup');
        ?>
</td>
								<td class="pro"><?php 
        esc_html_e('PRO', 'backwpup');
        ?>
</td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('Complete database backup', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('Complete file backup', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('Database check', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('Data compression', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('WordPress XML export', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('List of installed plugins', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('Backup archives management', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('Log file management', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('Start jobs per WP-Cron, URL, system, backend or WP-CLI', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('Log report via email', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('Backup to Microsoft Azure', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('Backup as email', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('Backup to S3 services (Amazon, Google Storage, Hosteurope and more)', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('Backup to Dropbox', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('Backup to Rackspace Cloud Files', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('Backup to FTP server', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('Backup to your web space', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('Backup to SugarSync', 'backwpup');
        ?>
</td>
								<td class="tick"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('Backup to Google Drive', 'backwpup');
        ?>
</td>
								<td class="error"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('Backup to Amazon Glacier', 'backwpup');
        ?>
</td>
								<td class="error"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('Custom API keys for DropBox and SugarSync', 'backwpup');
        ?>
</td>
								<td class="error"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('XML database backup as PHPMyAdmin schema', 'backwpup');
        ?>
</td>
								<td class="error"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('Database backup as mysqldump per command line', 'backwpup');
        ?>
</td>
								<td class="error"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('Database backup for additional MySQL databases', 'backwpup');
        ?>
</td>
								<td class="error"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('Import and export job settings as XML', 'backwpup');
        ?>
</td>
								<td class="error"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('Wizard for system tests', 'backwpup');
        ?>
</td>
								<td class="error"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('Wizard for scheduled backup jobs', 'backwpup');
        ?>
</td>
								<td class="error"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('Wizard to import settings and backup jobs', 'backwpup');
        ?>
</td>
								<td class="error"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('Differential backup of changed directories to Dropbox', 'backwpup');
        ?>
</td>
								<td class="error"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('Differential backup of changed directories to Rackspace Cloud Files', 'backwpup');
        ?>
</td>
								<td class="error"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        esc_html_e('Differential backup of changed directories to S3', 'backwpup');
        ?>
</td>
								<td class="error"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        esc_html_e('Differential backup of changed directories to MS Azure', 'backwpup');
        ?>
</td>
								<td class="error"></td>
								<td class="tick"></td>
							</tr>
							<tr class="odd">
								<td><?php 
        _e('<strong>Premium support</strong>', 'backwpup');
        ?>
</td>
								<td class="error"></td>
								<td class="tick"></td>
							</tr>
							<tr class="even">
								<td><?php 
        _e('<strong>Automatic updates</strong>', 'backwpup');
        ?>
</td>
								<td class="error" style="border-bottom:none;"></td>
								<td class="tick" style="border-bottom:none;"></td>
							</tr>
							<tr class="odd ubdown">
								<td></td>
								<td></td>
								<td class="pro buylink"><a href="<?php 
        esc_html_e('http://backwpup.com', 'backwpup');
        ?>
"><?php 
        _e('GET PRO', 'backwpup');
        ?>
</a></td>
							</tr>
						</table>
					</div>
            </div>
        </div>
	<?php 
    }