function enqueue_dashboard_stylesheet($hook)
{
    if ('index.php' != $hook) {
        return;
    }
    wp_enqueue_style('bub_dashboard_widget', pb_backupbuddy::plugin_url() . '/css/dashboard_widget.css');
}
Exemple #2
0
 function upgrader_instantiate($plugin_slug)
 {
     $args = array('parent' => $this, 'remote_url' => 'http://updater2.ithemes.com/index.php', 'version' => pb_backupbuddy::settings('version'), 'plugin_slug' => pb_backupbuddy::settings('slug'), 'plugin_path' => plugin_basename(pb_backupbuddy::plugin_path() . '/' . pb_backupbuddy::settings('init')), 'plugin_url' => pb_backupbuddy::plugin_url(), 'product' => pb_backupbuddy::settings('slug'), 'time' => 43200, 'return_format' => 'json', 'method' => 'POST', 'upgrade_action' => 'check');
     // Instantiate object of latest updater (by namespace) and apply to this plugin's pluginbuddy class (in this namespace).
     //$class_name = $plugin_namespace . "\\updater";
     $target_plugin_class_name = 'pb_' . $plugin_slug . '_updater';
     $this_plugin_class_name = 'pb_' . $this->_slug;
     //$this_plugin_class_name::$_updater = new $target_plugin_class_name( $args );
     pb_backupbuddy::$_updater = new $target_plugin_class_name($args);
 }
Exemple #3
0
/**
 *	upload()
 *
 *	Processes uploaded backup file.
 *
 *	@return		array		True on upload success; false otherwise.
 */
function upload()
{
    if (isset($_POST['upload']) && $_POST['upload'] == 'local') {
        if (pb_backupbuddy::$options['password'] != '#PASSWORD#') {
            $path_parts = pathinfo($_FILES['file']['name']);
            if (strtolower(substr($_FILES['file']['name'], 0, 6)) == 'backup' && strtolower($path_parts['extension']) == 'zip') {
                if (move_uploaded_file($_FILES['file']['tmp_name'], basename($_FILES['file']['name']))) {
                    pb_backupbuddy::alert('File Uploaded. Your backup was successfully uploaded.');
                    return true;
                } else {
                    pb_backupbuddy::alert('Sorry, there was a problem uploading your file.', true);
                    return false;
                }
            } else {
                pb_backupbuddy::alert('Only properly named BackupBuddy zip archives with a zip extension may be uploaded.', true);
                return false;
            }
        } else {
            pb_backupbuddy::alert('Upload Access Denied. To prevent unauthorized file uploads an importbuddy password must be configured and properly entered to use this feature.');
            return false;
        }
    }
    // DOWNLOAD FILE FROM STASH TO LOCAL.
    if (pb_backupbuddy::_POST('upload') == 'stash') {
        pb_backupbuddy::set_greedy_script_limits(true);
        /*
        echo '<pre>';
        print_r( $_POST );
        echo '</pre>';
        */
        $requestcore_file = dirname(dirname(dirname(__FILE__))) . '/lib/requestcore/requestcore.class.php';
        require_once $requestcore_file;
        $link = pb_backupbuddy::_POST('link');
        $destination_file = dirname(dirname(dirname(dirname(__FILE__)))) . '/' . basename(pb_backupbuddy::_POST('link'));
        $destination_file = substr($destination_file, 0, stripos($destination_file, '.zip') + 4);
        $_GET['file'] = basename($destination_file);
        $request = new RequestCore($link);
        $request->set_write_file($destination_file);
        echo '<div id="pb_importbuddy_working" style="padding: 20px;">Downloading backup from Stash to `' . $destination_file . '`...<br><br><img src="' . pb_backupbuddy::plugin_url() . '/images/loading_large.gif" title="Working... Please wait as this may take a moment..."><br><br></div>';
        flush();
        $response = $request->send_request(false);
        if ($response !== true) {
            pb_backupbuddy::alert('Error #8548459598. Unable to download file from Stash. You may manually download it and upload to the server via FTP.');
        } else {
            // No error.
            if (!file_exists($destination_file)) {
                pb_backupbuddy::alert('Error #34845745878. Stash returned a success but the backup file was not found locally. Check this server\'s directory write permissions. You may manually download it and upload to the server via FTP.');
            }
        }
        echo '<script type="text/javascript">jQuery("#pb_importbuddy_working").hide();</script>';
    }
}
function bb_build_remote_destinations($destinations_list)
{
    $remote_destinations = explode('|', $destinations_list);
    $remote_destinations_html = '';
    foreach ($remote_destinations as $destination) {
        if (isset($destination) && $destination != '') {
            $remote_destinations_html .= '<li id="pb_remotedestination_' . $destination . '">';
            if (!isset(pb_backupbuddy::$options['remote_destinations'][$destination])) {
                $remote_destinations_html .= '{destination no longer exists}';
            } else {
                $remote_destinations_html .= pb_backupbuddy::$options['remote_destinations'][$destination]['title'];
                $remote_destinations_html .= ' (' . backupbuddy_core::pretty_destination_type(pb_backupbuddy::$options['remote_destinations'][$destination]['type']) . ') ';
            }
            $remote_destinations_html .= '<img class="pb_remotedestionation_delete" src="' . pb_backupbuddy::plugin_url() . '/images/redminus.png" style="vertical-align: -3px; cursor: pointer;" title="' . __('Remove remote destination from this schedule.', 'it-l10n-backupbuddy') . '" />';
            $remote_destinations_html .= '</li>';
        }
    }
    $remote_destinations = '<ul id="pb_backupbuddy_remotedestinations_list">' . $remote_destinations_html . '</ul>';
    return $remote_destinations;
}
		if( jQuery( '#' + target_id ).length == 0 ) { // No status box yet so suppress.
			return;
		}
		jQuery( '#' + target_id ).append( "\n" + message );
		textareaelem = document.getElementById( target_id );
		textareaelem.scrollTop = textareaelem.scrollHeight;
	}
	
	function backupbuddy_hourpad(n) { return ("0" + n).slice(-2); }
</script>
<?php 
$success = false;
global $pb_backupbuddy_js_status;
$pb_backupbuddy_js_status = true;
echo pb_backupbuddy::status_box('Restoring . . .');
echo '<div id="pb_backupbuddy_working" style="width: 100px;"><br><center><img src="' . pb_backupbuddy::plugin_url() . '/images/working.gif" title="Working... Please wait as this may take a moment..."></center></div>';
pb_backupbuddy::set_status_serial('restore');
global $wp_version;
pb_backupbuddy::status('details', 'BackupBuddy v' . pb_backupbuddy::settings('version') . ' using WordPress v' . $wp_version . ' on ' . PHP_OS . '.');
$archive_file = pb_backupbuddy::_GET('archive');
// archive to extract from.
require pb_backupbuddy::plugin_path() . '/classes/_restoreFiles.php';
$result = backupbuddy_restore_files::restore(backupbuddy_core::getBackupDirectory() . $archive_file, $files, $finalPath = ABSPATH);
echo '<script type="text/javascript">jQuery("#pb_backupbuddy_working").hide();</script>';
pb_backupbuddy::flush();
if (false === $result) {
} else {
}
pb_backupbuddy::$ui->ajax_footer();
pb_backupbuddy::$ui->ajax_footer();
die;
Exemple #6
0
		jQuery(document).on( 'click', '.pb_backupbuddy_filetree_exclude', function(){
			text = jQuery(this).parent().parent().find( 'a' ).attr( 'rel' );
			if ( ( text == 'wp-config.php' ) || ( text == '/wp-content/' ) || ( text == '/wp-content/uploads/' ) || ( text == '<?php 
echo pb_backupbuddy::$options['backup_directory'];
?>
' ) || ( text == '/wp-content/uploads/backupbuddy_temp/' ) ) {
				alert( '<?php 
_e('You cannot exclude /wp-content/, /wp-content/uploads/, or BackupBuddy directories.  However, you may exclude subdirectories within these. BackupBuddy directories such as backupbuddy_backups are automatically excluded and cannot be added to exclusion list.', 'it-l10n-backupbuddy');
?>
' );
			} else {
				jQuery('#pb_backupbuddy_excludes').val( text + "\n" + jQuery('#pb_backupbuddy_excludes').val() );
			}
			return false;
		});
	});
</script>



<?php 
if ($profile_array['type'] == 'defaults') {
    $before_text = __('Excluded files & directories (relative to WordPress root)', 'it-l10n-backupbuddy');
} else {
    $before_text = __('Excluded files & directories for this profile (Global defaults do not apply; relative to WordPress root)', 'it-l10n-backupbuddy');
}
if ($profile_array['type'] != 'defaults') {
    $settings_form->add_setting(array('type' => 'checkbox', 'name' => 'profiles#' . $profile_id . '#profile_globalexcludes', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => 'Use global defaults for files to backup?', 'after' => ' Use global defaults', 'css' => ''));
}
$settings_form->add_setting(array('type' => 'textarea', 'name' => 'profiles#' . $profile_id . '#excludes', 'title' => 'Click directories to navigate or click <img src="' . pb_backupbuddy::plugin_url() . '/images/redminus.png" style="vertical-align: -3px;"> to exclude.' . ' ' . pb_backupbuddy::tip(__('Click on a directory name to navigate directories. Click the red minus sign to the right of a directory to place it in the exclusion list. /wp-content/, /wp-content/uploads/, and BackupBuddy backup & temporary directories cannot be excluded. BackupBuddy directories are automatically excluded.', 'it-l10n-backupbuddy'), '', false) . '<br><div id="exlude_dirs" class="jQueryOuterTree"></div>', 'rules' => 'string[0-9000]', 'css' => 'width: 100%; height: 135px;', 'before' => $before_text . pb_backupbuddy::tip(__('List paths relative to the WordPress installation directory to be excluded from backups.  You may use the directory selector to the left to easily exclude directories by ctrl+clicking them.  Paths are relative to root, for example: /wp-content/uploads/junk/', 'it-l10n-backupbuddy'), '', false) . '<br>', 'after' => '<span class="description">' . __('One file or directory exclusion per line. This may be manually edited.', 'it-l10n-backupbuddy') . '</span>'));
Exemple #7
0
 public function backups_list($type = 'default', $subsite_mode = false)
 {
     if (pb_backupbuddy::_POST('bulk_action') == 'delete_backup') {
         $needs_save = false;
         pb_backupbuddy::verify_nonce(pb_backupbuddy::_POST('_wpnonce'));
         // Security check to prevent unauthorized deletions by posting from a remote place.
         $deleted_files = array();
         foreach (pb_backupbuddy::_POST('items') as $item) {
             if (file_exists(pb_backupbuddy::$options['backup_directory'] . $item)) {
                 if (@unlink(pb_backupbuddy::$options['backup_directory'] . $item) === true) {
                     $deleted_files[] = $item;
                     if (count(pb_backupbuddy::$options['backups']) > 3) {
                         // Keep a minimum number of backups in array for stats.
                         $this_serial = $this->get_serial_from_file($item);
                         unset(pb_backupbuddy::$options['backups'][$this_serial]);
                         $needs_save = true;
                     }
                 } else {
                     pb_backupbuddy::alert('Error: Unable to delete backup file `' . $item . '`. Please verify permissions.', true);
                 }
             }
             // End if file exists.
         }
         // End foreach.
         if ($needs_save === true) {
             pb_backupbuddy::save();
         }
         pb_backupbuddy::alert(__('Deleted backup(s):', 'it-l10n-backupbuddy') . ' ' . implode(', ', $deleted_files));
     }
     // End if deleting backup(s).
     $backups = array();
     $backup_sort_dates = array();
     $files = glob(pb_backupbuddy::$options['backup_directory'] . 'backup*.zip');
     if (is_array($files) && !empty($files)) {
         // For robustness. Without open_basedir the glob() function returns an empty array for no match. With open_basedir in effect the glob() function returns a boolean false for no match.
         $backup_prefix = $this->backup_prefix();
         // Backup prefix for this site. Used for MS checking that this user can see this backup.
         foreach ($files as $file_id => $file) {
             if ($subsite_mode === true && is_multisite()) {
                 // If a Network and NOT the superadmin must make sure they can only see the specific subsite backups for security purposes.
                 // Only allow viewing of their own backups.
                 if (!strstr($file, $backup_prefix)) {
                     unset($files[$file_id]);
                     // Remove this backup from the list. This user does not have access to it.
                     continue;
                     // Skip processing to next file.
                     echo 'bob';
                 }
             }
             $serial = pb_backupbuddy::$classes['core']->get_serial_from_file($file);
             // Populate integrity data structure in options.
             pb_backupbuddy::$classes['core']->backup_integrity_check($file);
             $pretty_status = array('pass' => 'Good', 'fail' => '<font color="red">Bad</font>');
             $pretty_type = array('full' => 'Full', 'db' => 'Database');
             //echo '<pre>' . print_r( pb_backupbuddy::$options['backups'][$serial], true ) . '</pre>';
             // Calculate time for each step.
             $step_times = array();
             $step_time_details = array();
             $zip_time = 0;
             if (isset(pb_backupbuddy::$options['backups'][$serial]['steps'])) {
                 foreach (pb_backupbuddy::$options['backups'][$serial]['steps'] as $step) {
                     if (!isset($step['finish_time']) || $step['finish_time'] == 0) {
                         $step_times[] = '<span class="description">Unknown</span>';
                     } else {
                         $step_time = $step['finish_time'] - $step['start_time'];
                         $step_times[] = $step_time;
                         // Pretty step name:
                         if ($step['function'] == 'backup_create_database_dump') {
                             $step_name = 'Database dump';
                         } elseif ($step['function'] == 'backup_zip_files') {
                             $step_name = 'Zip archive creation';
                         } elseif ($step['function'] == 'post_backup') {
                             $step_name = 'Post-backup cleanup';
                         } else {
                             $step_name = $step['function'];
                         }
                         $step_time_details[] = '<b>' . $step_name . '</b><br>&nbsp;&nbsp;&nbsp;' . $step_time . ' seconds in ' . $step['attempts'] . ' attempts.';
                         if ($step['function'] == 'backup_zip_files') {
                             $zip_time = $step_time;
                         }
                     }
                 }
                 // End foreach.
             } else {
                 // End if serial in array is set.
                 $step_times[] = '<span class="description">Unknown</span>';
             }
             // End if serial in array is NOT set.
             $step_times = implode(', ', $step_times);
             //echo '<pre>' . print_r( pb_backupbuddy::$options['backups'][$serial], true ) . '</pre>';
             // Calculate start and finish.
             if (isset(pb_backupbuddy::$options['backups'][$serial]['start_time']) && isset(pb_backupbuddy::$options['backups'][$serial]['finish_time']) && pb_backupbuddy::$options['backups'][$serial]['start_time'] > 0 && pb_backupbuddy::$options['backups'][$serial]['finish_time'] > 0) {
                 $start_time = pb_backupbuddy::$options['backups'][$serial]['start_time'];
                 $finish_time = pb_backupbuddy::$options['backups'][$serial]['finish_time'];
                 $total_time = $finish_time - $start_time;
             } else {
                 $total_time = '<span class="description">Unknown</span>';
             }
             // Calculate write speed in MB/sec for this backup.
             if ($zip_time == '0') {
                 // Took approx 0 seconds to backup so report this speed.
                 if (!isset($finish_time) || $finish_time == '0') {
                     $write_speed = '<span class="description">Unknown</span>';
                 } else {
                     $write_speed = '> ' . pb_backupbuddy::$format->file_size(pb_backupbuddy::$options['backups'][$serial]['integrity']['size']);
                 }
             } else {
                 $write_speed = pb_backupbuddy::$format->file_size(pb_backupbuddy::$options['backups'][$serial]['integrity']['size'] / $zip_time);
             }
             // Figure out trigger.
             if (isset(pb_backupbuddy::$options['backups'][$serial]['trigger'])) {
                 $trigger = pb_backupbuddy::$options['backups'][$serial]['trigger'];
             } else {
                 $trigger = __('Unknown', 'it-l10n-backupbuddy');
             }
             // HTML output for stats.
             $statistics = "\n\t\t\t\t\t<span style='width: 80px; display: inline-block;'>Total time:</span>{$total_time} secs<br>\n\t\t\t\t\t<span style='width: 80px; display: inline-block;'>Step times:</span>{$step_times}<br>\n\t\t\t\t\t<span style='width: 80px; display: inline-block;'>Write speed:</span>{$write_speed}/sec\n\t\t\t\t";
             // HTML output for stats details (for tooltip).
             $statistic_details = '<br><br>' . implode('<br>', $step_time_details) . '<br><br><i>Trigger: ' . $trigger . '</i>';
             // Calculate time ago.
             $time_ago = '<span class="description">' . pb_backupbuddy::$format->time_ago(pb_backupbuddy::$options['backups'][$serial]['integrity']['modified']) . ' ago</span>';
             // Calculate main row string.
             if ($type == 'default') {
                 // Default backup listing.
                 $main_string = '<a href="' . pb_backupbuddy::ajax_url('download_archive') . '&backupbuddy_backup=' . basename($file) . '">' . basename($file) . '</a>';
             } elseif ($type == 'migrate') {
                 // Migration backup listing.
                 $main_string = '<a class="pb_backupbuddy_hoveraction_migrate" rel="' . basename($file) . '" href="' . pb_backupbuddy::page_url() . '&migrate=' . basename($file) . '&value=' . basename($file) . '">' . basename($file) . '</a>';
             } else {
                 $main_string = '{Unknown type.}';
             }
             // Add comment to main row string if applicable.
             if (isset(pb_backupbuddy::$options['backups'][$serial]['integrity']['comment']) && pb_backupbuddy::$options['backups'][$serial]['integrity']['comment'] !== false && pb_backupbuddy::$options['backups'][$serial]['integrity']['comment'] !== '') {
                 $main_string .= '<br><span class="description">Note: <span class="pb_backupbuddy_notetext">' . pb_backupbuddy::$options['backups'][$serial]['integrity']['comment'] . '</span></span>';
             }
             $backups[basename($file)] = array(array(basename($file), $main_string), pb_backupbuddy::$format->date(pb_backupbuddy::$options['backups'][$serial]['integrity']['modified']) . '<br>' . $time_ago, pb_backupbuddy::$format->file_size(pb_backupbuddy::$options['backups'][$serial]['integrity']['size']), pb_backupbuddy::$format->prettify(pb_backupbuddy::$options['backups'][$serial]['integrity']['status'], $pretty_status) . ' ' . pb_backupbuddy::tip(pb_backupbuddy::$options['backups'][$serial]['integrity']['status_details'] . '<br><br>Checked ' . pb_backupbuddy::$format->date(pb_backupbuddy::$options['backups'][$serial]['integrity']['scan_time']) . $statistic_details, '', false) . ' <a href="' . pb_backupbuddy::page_url() . '&reset_integrity=' . $serial . '" title="' . __('Refresh backup integrity status for this file', 'it-l10n-backupbuddy') . '"><img src="' . pb_backupbuddy::plugin_url() . '/images/refresh_gray.gif" style="vertical-align: -1px;"></a>', pb_backupbuddy::$format->prettify(pb_backupbuddy::$options['backups'][$serial]['integrity']['detected_type'], $pretty_type), $statistics);
             $backup_sort_dates[basename($file)] = pb_backupbuddy::$options['backups'][$serial]['integrity']['modified'];
         }
         // End foreach().
     }
     // End if.
     // Sort backup sizes.
     arsort($backup_sort_dates);
     // Re-arrange backups based on sort dates.
     $sorted_backups = array();
     foreach ($backup_sort_dates as $backup_file => $backup_sort_date) {
         $sorted_backups[$backup_file] = $backups[$backup_file];
         unset($backups[$backup_file]);
     }
     unset($backups);
     return $sorted_backups;
 }
Exemple #8
0
					<?php 
pb_backupbuddy::tip('The password you would like to assign to the database user created.', '', true);
?>
				</label>
				<span style="text-align: right; width: 300px; display: inline-block;">
					<input type="text" name="cpanel_dbpass" id="cpanel_dbpass" style="width: 175px;" value="<?php 
echo substr(md5(microtime()), rand(0, 13), 16);
?>
">
				</span>
				<br>
				
				<br>
				<center>
					<input type="submit" name="submit" value="Create Database" class="button button-primary cpanel_createdb_create">
					<span style="display: inline-block; width: 20px;">
						<span class="cpanel_createdb_loading" style="display: none; margin-left: 10px;"><img src="<?php 
echo pb_backupbuddy::plugin_url();
?>
/images/loading.gif" alt="' . __('Loading...', 'it-l10n-backupbuddy' ) . '" title="' . __('Loading...', 'it-l10n-backupbuddy' ) . '" width="16" height="16" style="vertical-align: -3px;" /></span>
					</span>
				</center>
				
			</form>
		</div>
	</div>
</div>


<?php 
require_once '_footer.php';
 function wp_update_backup_reminder_dump($text = '')
 {
     return str_replace('<h2>WordPress Updates</h2>', '<h2>' . __('WordPress Updates', 'it-l10n-backupbuddy') . '</h2><div id="message" class="updated fade"><p><img src="' . pb_backupbuddy::plugin_url() . '/images/pluginbuddy.png" style="vertical-align: -3px;" /> <a href="admin.php?page=pb_backupbuddy_backup" target="_new" style="text-decoration: none;">' . __('Remember to back up your site with BackupBuddy before upgrading!', 'it-l10n-backupbuddy') . '</a></p></div>', $text);
 }
            if (file_exists(str_replace('//', '/', $root . $file))) {
                if (is_dir(str_replace('//', '/', $root . $file))) {
                    // Directory.
                    echo '<li class="directory collapsed">';
                    $return = '';
                    $return .= '<div class="pb_backupbuddy_treeselect_control">';
                    $return .= '<img src="' . pb_backupbuddy::plugin_url() . '/images/redminus.png" style="vertical-align: -3px;" title="Add to exclusions..." class="pb_backupbuddy_filetree_exclude">';
                    $return .= '</div>';
                    echo '<a href="#" rel="' . htmlentities(str_replace(ABSPATH, '', $root) . $file) . '/" title="Toggle expand...">' . htmlentities($file) . $return . '</a>';
                    echo '</li>';
                } else {
                    // File.
                    echo '<li class="file collapsed">';
                    $return = '';
                    $return .= '<div class="pb_backupbuddy_treeselect_control">';
                    $return .= '<img src="' . pb_backupbuddy::plugin_url() . '/images/redminus.png" style="vertical-align: -3px;" title="Add to exclusions..." class="pb_backupbuddy_filetree_exclude">';
                    $return .= '</div>';
                    echo '<a href="#" rel="' . htmlentities(str_replace(ABSPATH, '', $root) . $file) . '">' . htmlentities($file) . $return . '</a>';
                    echo '</li>';
                }
            }
        }
        echo '</ul>';
    } else {
        echo '<ul class="jqueryFileTree" style="display: none;">';
        echo '<li><a href="#" rel="' . htmlentities(pb_backupbuddy::_POST('dir') . 'NONE') . '"><i>Empty Directory ...</i></a></li>';
        echo '</ul>';
    }
} else {
    echo 'Error #1127555. Unable to read site root.';
}
            if (in_array($ext, $view_ext)) {
                $viewable = true;
            }
            echo '<li class="file collapsed ext_' . $ext;
            if (true === $viewable) {
                echo ' viewable';
            }
            echo '"><input type="checkbox">';
            if (true === $viewable) {
                echo '<a onclick="modal_live(\'restore_file_view\',jQuery(this));" class="hoverable" rel="' . htmlentities($root . $file[0]) . '">';
            } else {
                echo '<a href="#" rel="' . htmlentities($root . $file[0]) . '">';
            }
            echo htmlentities($file[0]);
            if (true === $viewable) {
                echo '<span class="viewlink_place"><img src="' . pb_backupbuddy::plugin_url() . '/images/eyecon.png"></span>';
                echo '<span class="viewlink"><img src="' . pb_backupbuddy::plugin_url() . '/images/eyecon.png"> View</span>';
            }
            echo '<span class="pb_backupbuddy_fileinfo">';
            echo '	<span class="pb_backupbuddy_col1">' . pb_backupbuddy::$format->file_size($file[1]) . '</span>';
            echo '	<span class="pb_backupbuddy_col2">' . pb_backupbuddy::$format->date(pb_backupbuddy::$format->localize_time($file[3])) . ' <span class="description">(' . pb_backupbuddy::$format->time_ago($file[3]) . ' ago)</span></span>';
            echo '</span>';
            echo '</a></li>';
        }
    }
    echo '</ul>';
} else {
    echo '<ul class="jqueryFileTree" style="display: none;">';
    echo '<li><a href="#" rel="' . htmlentities(pb_backupbuddy::_POST('dir') . 'NONE') . '"><i>Empty Directory ...</i></a></li>';
    echo '</ul>';
}
Exemple #12
0
		</div>
	</div>
	<table class="widefat">
		<thead>
			<tr class="thead">
				<th scope="col" class="check-column"><input type="checkbox" class="check-all-entries" /></th>
				<?php 
echo '<th>', __('Backup File', 'it-l10n-backupbuddy'), ' <img src="', pb_backupbuddy::plugin_url(), '/images/sort_down.png" style="vertical-align: 0px;" title="', __('Sorted by filename', 'it-l10n-backupbuddy'), '" /></th>', '<th>', __('Last Modified', 'it-l10n-backupbuddy'), '</th>', '<th>', __('File Size', 'it-l10n-backupbuddy'), '</th>', '<th>', __('Actions', 'it-l10n-backupbuddy'), '</th>';
?>
			</tr>
		</thead>
		<tfoot>
			<tr class="thead">
				<th scope="col" class="check-column"><input type="checkbox" class="check-all-entries" /></th>
				<?php 
echo '<th>', __('Backup File', 'it-l10n-backupbuddy'), ' <img src="', pb_backupbuddy::plugin_url(), '/images/sort_down.png" style="vertical-align: 0px;" title="', __('Sorted by filename', 'it-l10n-backupbuddy'), '" /></th>', '<th>', __('Last Modified', 'it-l10n-backupbuddy'), '</th>', '<th>', __('File Size', 'it-l10n-backupbuddy'), '</th>', '<th>', __('Actions', 'it-l10n-backupbuddy'), '</th>';
?>
			</tr>
		</tfoot>
		<tbody>
			<?php 
// List dropbox backups
if (empty($meta_data['contents'])) {
    echo '<tr><td colspan="5" style="text-align: center;"><i>', __('You have not created any dropbox backups yet.', 'it-l10n-backupbuddy'), ' </i></td></tr>';
} else {
    $file_count = 0;
    foreach ((array) $meta_data['contents'] as $file) {
        // check if file is backup
        if (strstr($file['path'], 'backup-')) {
            $file_count++;
            ?>
Exemple #13
0
		<option>all</option>
		<option>1</option>
		<option>2</option>
		<option selected="selected">3</option>
		<option>4</option>
		<option>5</option>
	</select>

	<a id="update" class="theme button white"><?php 
_e('Go Up', 'it-l10n-backupbuddy');
?>
</a>
</div>



<?php 
$dir_array = array();
$icicle_array = array();
$time_start = microtime(true);
//echo '<pre>' . $this->build_icicle( ABSPATH, ABSPATH, '' ) . '</pre>';
echo '<br>';
echo '<div class="pb_htitle">' . __('Directory Size Listing', 'it-l10n-backupbuddy') . '</div><br>';
echo '<a name="pb_backupbuddy_dir_size_listing">&nbsp;</a>';
echo '<div id="pb_backupbuddy_site_size_listing_intro">';
echo __('This option displays a comprehensive listing of directories and the corresponding size of all contents within, including subdirectories.  This is useful for finding where space is being used. Note that this is a CPU intensive process and may take a while to load and even time out on some servers.', 'it-l10n-backupbuddy');
echo '<br /><br /><a class="pb_backupbuddy_site_size_listing_button button secondary-button" style="margin-top: 3px;">', __('Display Directory Size Listing', 'it-l10n-backupbuddy'), '</a> ';
echo '<span class="pb_backupbuddy_loading" style="display: none; margin-left: 10px;"><img src="' . pb_backupbuddy::plugin_url() . '/images/loading.gif" alt="' . __('Loading...', 'it-l10n-backupbuddy') . '" title="' . __('Loading...', 'it-l10n-backupbuddy') . '" width="16" height="16" style="vertical-align: -3px;" /></span>';
echo '</div>';
echo '<div id="pb_backupbuddy_site_size_listing_content" style="display: none;"></div>';
echo '<br>';
Exemple #14
0
 /**
  *	pb_backupbuddy::video()
  *
  *	Displays a YouTube video to the user when they hover over the question video mark.
  *	HTML is supposed within tooltips.
  *
  *	@param		string		$video_key		YouTube video key from the URL ?v=VIDEO_KEY_HERE  -- To jump to a certain timestamp add #SECONDS to the end of the key, where SECONDS is the number of seconds into the video to start at. Example to start 65 seconds into a video: 9ZHWGjBr84s#65. This must be in seconds format.
  *	@param		string		$title			Title of message to show to user. This is displayed at top of tip in bigger letters. Default is blank. (optional)
  *	@param		boolean		$echo_tip		Whether to echo the tip (default; true), or return the tip (false). (optional)
  *	@return		string/null					If not echoing tip then the string will be returned. When echoing there is no return.
  */
 public function video($video_key, $title = '', $echo_tip = true)
 {
     if (!defined('PB_IMPORTBUDDY')) {
         global $wp_scripts;
         if (is_object($wp_scripts)) {
             if (!in_array('thickbox', $wp_scripts->done)) {
                 wp_enqueue_script('thickbox');
                 wp_print_scripts('thickbox');
                 wp_print_styles('thickbox');
             }
         }
     }
     if (strstr($video_key, '#')) {
         $video = explode('#', $video_key);
         $video[1] = '&start=' . $video[1];
     } else {
         $video[0] = $video_key;
         $video[1] = '';
     }
     $tip = '<a target="_new" href="http://www.youtube.com/embed/' . urlencode($video[0]) . '?autoplay=1' . $video[1] . '&TB_iframe=1&width=600&height=400" class="thickbox pluginbuddy_tip" title="Video Tutorial - ' . $title . '"><img src="' . pb_backupbuddy::plugin_url() . '/pluginbuddy/images/pluginbuddy_play.png" alt="(video)" /></a>';
     if ($echo_tip === true) {
         echo $tip;
     } else {
         return $tip;
     }
 }
Exemple #15
0
pb_backupbuddy::flush();
$result = migrate_database();
verify_database();
// Remove any temporary .maintenance file created by ImportBuddy.
scrub_maintenance_file();
// Remove any temporary index.htm file created by ImportBuddy.
scrub_index_file();
echo '<script type="text/javascript">jQuery("#pb_importbuddy_working").hide();</script>';
if (true === $result) {
    $wpconfig_result = migrate_wp_config();
    if ($wpconfig_result !== true) {
        pb_backupbuddy::alert('Error: Unable to update wp-config.php file. Verify write permissions for the wp-config.php file then refresh this page. You may manually update your wp-config.php file by changing it to the following:<textarea readonly="readonly" style="width: 80%;">' . $wpconfig_result . '</textarea>');
    }
    pb_backupbuddy::status('message', 'Import complete!');
    echo '<h3>Imported Site: <a href="' . pb_backupbuddy::$options['home'] . '" target="_new">' . pb_backupbuddy::$options['home'] . '</a></h3>';
    echo '<img src="' . pb_backupbuddy::plugin_url() . '/images/bullet_error.png" style="float: left;"><div style="margin-left: 20px;"><b>Verify site functionality then proceed to the next step below</b> to cleanup the backup ZIP file, importbuddy.php, and other temporary files. You may view your entire import log for providing to support by clicking the "View Import Log" button below.</div>';
    echo '<form action="?step=6" method=post>';
    echo '<input type="hidden" name="pass_hash" id="pass_hash" value="' . htmlspecialchars(pb_backupbuddy::_POST('pass_hash')) . '">';
    echo '<input type="hidden" name="options" value="' . htmlspecialchars(serialize(pb_backupbuddy::$options)) . '" />';
    // Scan for 'trouble' such as a remaining .maintenance file, index.htm, index.html, missing wp-config.php, missing .htaccess, etc etc.
    $trouble = trouble_scan();
    if (count($trouble) > 0) {
        echo '<br>';
        $trouble_text = '';
        foreach ($trouble as $this_trouble) {
            $trouble_text .= '<li>' . $this_trouble . '</li>';
        }
        $trouble_text = '<ul>' . $trouble_text . '</ul>';
        pb_backupbuddy::alert('Warning: One or more potential issues may have been detected and <i>may</i> require your attention.' . $trouble_text);
    } else {
        echo '<br>';
    } else {
        if ($pb_hide_test !== true) {
            $test_button = '<a href="#" class="button secondary-button pb_backupbuddy_destpicker_test" href="#" title="Test destination settings.">Test Settings<img class="pb_backupbuddy_destpicker_testload" src="' . pb_backupbuddy::plugin_url() . '/images/loading.gif" title="Testing... This may take several seconds..."></a>';
        } else {
            $test_button = '';
        }
        /*
        if ( $pb_hide_save !== true ) {
        	$save_and_delete_button = '<img class="pb_backupbuddy_destpicker_saveload" src="' . pb_backupbuddy::plugin_url() . '/images/loading.gif" title="Saving... This may take a few seconds...">';
        } else {
        	$save_and_delete_button = '';
        }
        */
        $save_and_delete_button = '';
        $save_and_delete_button .= '<a href="#" class="button secondary-button pb_backupbuddy_destpicker_delete" href="javascript:void(0)" title="Delete this Destination">Delete Destination</a>';
        echo $settings->display_settings('Save Settings', $save_and_delete_button . '&nbsp;&nbsp;' . $test_button . '&nbsp;&nbsp;', $afterText = ' <img class="pb_backupbuddy_destpicker_saveload" src="' . pb_backupbuddy::plugin_url() . '/images/loading.gif" title="Saving... This may take a few seconds...">', 'pb_backupbuddy_destpicker_save');
        // title, before, after, class
    }
    echo '</div>';
    $url = pb_backupbuddy::ajax_url('remoteClient') . '&destination_id=' . $destination_id;
    echo '<iframe id="pb_backupbuddy_iframe-dest-' . $destination_id . '" src="' . $url . '" width="100%" height="3000" frameBorder="0">Error #4584594579. Browser not compatible with iframes.</iframe>';
    echo '</div>';
    pb_backupbuddy::$ui->end_tab();
}
pb_backupbuddy::$ui->start_tab('add_new');
$destination_type = pb_backupbuddy::_GET('add');
require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
?>
	<div class="bb_destinations" style="display: block; margin: 0;">
		<div class="bb_destinations-group bb_destinations-new" style="display: block;">
			<h3>What kind of destination do you want to add?</h3>
    }
    // Generate array of table rows.
    $backup_files[$filename] = array($filename, $last_modified, pb_backupbuddy::$format->file_size($size), $backup_type, 'file_timestamp' => $last_modified);
}
// For sorting by array item value.
function pb_backupbuddy_aasort(&$array, $key)
{
    $sorter = array();
    $ret = array();
    reset($array);
    foreach ($array as $ii => $va) {
        $sorter[$ii] = $va[$key];
    }
    asort($sorter);
    foreach ($sorter as $ii => $va) {
        $ret[$ii] = $array[$ii];
    }
    $array = $ret;
}
pb_backupbuddy_aasort($backup_files, 'file_timestamp');
// Sort by multidimensional array with key start_timestamp.
$backup_files = array_reverse($backup_files);
// Reverse array order to show newest first.
$urlPrefix = pb_backupbuddy::ajax_url('remoteClient') . '&destination_id=' . htmlentities(pb_backupbuddy::_GET('destination_id'));
// Render table listing files.
if (count($backup_files) == 0) {
    echo '<b>' . __('You have not completed sending any backups to this destination yet.', 'it-l10n-backupbuddy') . '</b>';
} else {
    pb_backupbuddy::$ui->list_table($backup_files, array('action' => $urlPrefix, 'columns' => array('Backup File', 'Uploaded <img src="' . pb_backupbuddy::plugin_url() . '/images/sort_down.png" style="vertical-align: 0px;" title="Sorted most recent first">', 'File Size', 'Type'), 'hover_actions' => array($urlPrefix . '&cpy=' => 'Copy to Local'), 'hover_action_column_key' => '0', 'bulk_actions' => array('delete_backup' => 'Delete'), 'css' => 'width: 100%;'));
}
return;
Exemple #18
0
    public static function get_quota_bar($account_info, $settings = array(), $additionalOptions = false)
    {
        $settings = self::_init($settings);
        //echo '<pre>' . print_r( $account_info, true ) . '</pre>';
        $return = '<div class="backupbuddy-stash2-quotawrap">';
        $return .= '
		<style>
			.outer_progress {
				-moz-border-radius: 4px;
				-webkit-border-radius: 4px;
				-khtml-border-radius: 4px;
				border-radius: 4px;
				
				border: 1px solid #DDD;
				background: #EEE;
				
				max-width: 700px;
				
				margin-left: auto;
				margin-right: auto;
				
				height: 30px;
			}
			
			.inner_progress {
				border-right: 1px solid #85bb3c;
				background: #8cc63f url("' . pb_backupbuddy::plugin_url() . '/destinations/stash2/progress.png") 50% 50% repeat-x;
				
				height: 100%;
			}
			
			.progress_table {
				color: #5E7078;
				font-family: "Open Sans", Arial, Helvetica, Sans-Serif;
				font-size: 14px;
				line-height: 20px;
				text-align: center;
				
				margin-left: auto;
				margin-right: auto;
				margin-bottom: 20px;
				max-width: 700px;
			}
		</style>';
        if (isset($account_info['quota_warning']) && $account_info['quota_warning'] != '') {
            //echo '<div style="color: red; max-width: 700px; margin-left: auto; margin-right: auto;"><b>Warning</b>: ' . $account_info['quota_warning'] . '</div><br>';
        }
        $return .= '
		<div class="outer_progress">
			<div class="inner_progress" style="width: ' . $account_info['quota_used_percent'] . '%"></div>
		</div>
		
		<table align="center" class="progress_table">
			<tbody><tr align="center">
			    <td style="width: 10%; font-weight: bold; text-align: center">Free Tier</td>
			    <td style="width: 10%; font-weight: bold; text-align: center">Paid Tier</td>        
			    <td style="width: 10%"></td>
			    <td style="width: 10%; font-weight: bold; text-align: center">Total</td>
			    <td style="width: 10%; font-weight: bold; text-align: center">Used</td>
			    <td style="width: 10%; font-weight: bold; text-align: center">Available</td>        
			</tr>

			<tr align="center">
			    <td style="text-align: center">' . $account_info['quota_free_nice'] . '</td>
			    <td style="text-align: center">';
        if ($account_info['quota_paid'] == '0') {
            $return .= 'none';
        } else {
            $return .= $account_info['quota_paid_nice'];
        }
        $return .= '</td>
			    <td></td>
			    <td style="text-align: center">' . $account_info['quota_total_nice'] . '</td>
			    <td style="text-align: center">' . $account_info['quota_used_nice'] . ' (' . $account_info['quota_used_percent'] . '%)</td>
			    <td style="text-align: center">' . $account_info['quota_available_nice'] . '</td>
			</tr>
			';
        $return .= '
		</tbody></table>';
        $return .= '<div style="text-align: center;">';
        $return .= '
		<b>' . __('Upgrade storage', 'it-l10n-backupbuddy') . ':</b> &nbsp;
		<a href="https://ithemes.com/member/cart.php?action=add&id=290" target="_blank" style="text-decoration: none;">+ 5GB</a>, &nbsp;
		<a href="https://ithemes.com/member/cart.php?action=add&id=291" target="_blank" style="text-decoration: none;">+ 10GB</a>, &nbsp;
		<a href="https://ithemes.com/member/cart.php?action=add&id=292" target="_blank" style="text-decoration: none;">+ 25GB</a>
		
		&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="https://sync.ithemes.com/stash/" target="_blank" style="text-decoration: none;"><b>Manage Files & Account</b></a>';
        // Welcome text.
        $up_path = '/';
        if (count($settings) > 0 && true === $additionalOptions) {
            if ($settings['manage_all_files'] == '1') {
                if ('true' != pb_backupbuddy::_GET('listAll')) {
                    $manage_all_link = '<a href="' . pb_backupbuddy::ajax_url('remoteClient') . '&destination_id=' . htmlentities(pb_backupbuddy::_GET('destination_id')) . '&listAll=true" style="text-decoration: none;" title="By default, Stash will display files in the Stash directory for this particular site. Clicking this will display files for all your sites in Stash.">List all site\'s files</a>';
                } else {
                    $manage_all_link = '<a href="' . pb_backupbuddy::ajax_url('remoteClient') . '&destination_id=' . htmlentities(pb_backupbuddy::_GET('destination_id')) . '&listAll=false" style="text-decoration: none;" title="By default, Stash will display files in the Stash directory for this particular site. Clicking this will only show this site\'s files in Stash.">Only list this site\'s files</a>';
                }
            } else {
                $manage_all_link = '<!-- manage all disabled based on settings -->';
                if ($remote_path == '/') {
                    die('Access denied. Possible hacking attempt has been logged. Error #329773.');
                }
            }
            //$reauth_link = '<a href="' . pb_backupbuddy::ajax_url( 'remoteClient' ) . '&destination_id=' . htmlentities( pb_backupbuddy::_GET( 'destination_id' ) ) . '&force_stash_reauth=1" style="text-decoration: none;" title="Re-authenticate to Stash or change the Stash account this Stash destination uses.">Re-authenticate</a>';
            $return .= '&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;' . $manage_all_link;
        }
        $return .= '<br><br></div>';
        $return .= '</div>';
        return $return;
    }
Exemple #19
0
 function exclude_tree()
 {
     $root = ABSPATH . urldecode(pb_backupbuddy::_POST('dir'));
     if (file_exists($root)) {
         $files = scandir($root);
         natcasesort($files);
         // Sort with directories first.
         $sorted_files = array();
         // Temporary holder for sorting files.
         $sorted_directories = array();
         // Temporary holder for sorting directories.
         foreach ($files as $file) {
             if ($file == '.' || $file == '..') {
                 continue;
             }
             if (is_file(str_replace('//', '/', $root . $file))) {
                 array_push($sorted_files, $file);
             } else {
                 array_unshift($sorted_directories, $file);
             }
         }
         $files = array_merge(array_reverse($sorted_directories), $sorted_files);
         unset($sorted_files);
         unset($sorted_directories);
         unset($file);
         if (count($files) > 2) {
             /* The 2 accounts for . and .. */
             echo '<ul class="jqueryFileTree" style="display: none;">';
             foreach ($files as $file) {
                 if (file_exists(str_replace('//', '/', $root . $file))) {
                     if (is_dir(str_replace('//', '/', $root . $file))) {
                         echo '<li class="directory collapsed"><a href="#" rel="' . htmlentities(str_replace(ABSPATH, '', $root) . $file) . '/">' . htmlentities($file) . ' <img src="' . pb_backupbuddy::plugin_url() . '/images/bullet_delete.png" style="vertical-align: -3px;" /></a></li>';
                     } else {
                         echo '<li class="file collapsed"><a href="#" rel="' . htmlentities(str_replace(ABSPATH, '', $root) . $file) . '">' . htmlentities($file) . ' <img src="' . pb_backupbuddy::plugin_url() . '/images/bullet_delete.png" style="vertical-align: -3px;" /></a></li>';
                     }
                 }
             }
             echo '</ul>';
         } else {
             echo '<ul class="jqueryFileTree" style="display: none;">';
             echo '<li><a href="#" rel="' . htmlentities(pb_backupbuddy::_POST('dir') . 'NONE') . '"><i>Empty Directory ...</i></a></li>';
             echo '</ul>';
         }
     } else {
         echo 'Error #1127555. Unable to read site root.';
     }
     die;
 }
Exemple #20
0
 array_push($tests, $parent_class_test);
 // Site objects WITH EXCLUSIONS accounted for.
 if (isset(pb_backupbuddy::$options['stats']['site_objects_excluded']) && pb_backupbuddy::$options['stats']['site_objects_excluded'] > 0) {
     $site_objects_excluded = pb_backupbuddy::$options['stats']['site_objects_excluded'];
 } else {
     $site_objects_excluded = '<i>Unknown</i>';
 }
 $parent_class_test = array('title' => 'Site number of files (Default Exclusions applied)', 'suggestion' => 'n/a', 'value' => '<span id="pb_stats_refresh_objects_excluded">' . $site_objects_excluded . '</span> <a class="pb_backupbuddy_refresh_stats" rel="refresh_objects_excluded" alt="' . pb_backupbuddy::ajax_url('refresh_site_objects_excluded') . '" title="' . __('Refresh', 'it-l10n-backupbuddy') . '"><img src="' . pb_backupbuddy::plugin_url() . '/images/refresh_gray.gif" style="vertical-align: -1px;"> <span class="pb_backupbuddy_loading" style="display: none; margin-left: 10px;"><img src="' . pb_backupbuddy::plugin_url() . '/images/loading.gif" alt="' . __('Loading...', 'it-l10n-backupbuddy') . '" title="' . __('Loading...', 'it-l10n-backupbuddy') . '" width="16" height="16" style="vertical-align: -3px;" /></span></a>', 'tip' => __('Total number of files/folders site (starting in your WordPress main directory) EXCLUDING any directories / files you have marked for exclusion.', 'it-l10n-backupbuddy'));
 $parent_class_test['status'] = __('OK', 'it-l10n-backupbuddy');
 array_push($tests, $parent_class_test);
 // Database Size
 $parent_class_test = array('title' => 'Database Size', 'suggestion' => 'n/a', 'value' => '<span id="pb_stats_refresh_database_size">' . pb_backupbuddy::$format->file_size(pb_backupbuddy::$options['stats']['db_size']) . '</span> <a class="pb_backupbuddy_refresh_stats" rel="refresh_database_size" alt="' . pb_backupbuddy::ajax_url('refresh_database_size') . '" title="' . __('Refresh', 'it-l10n-backupbuddy') . '"><img src="' . pb_backupbuddy::plugin_url() . '/images/refresh_gray.gif" style="vertical-align: -1px;"> <span class="pb_backupbuddy_loading" style="display: none; margin-left: 10px;"><img src="' . pb_backupbuddy::plugin_url() . '/images/loading.gif" alt="' . __('Loading...', 'it-l10n-backupbuddy') . '" title="' . __('Loading...', 'it-l10n-backupbuddy') . '" width="16" height="16" style="vertical-align: -3px;" /></span></a>', 'tip' => __('Total size of your database INCLUDING any excluded tables.', 'it-l10n-backupbuddy'));
 $parent_class_test['status'] = __('OK', 'it-l10n-backupbuddy');
 array_push($tests, $parent_class_test);
 // Database size WITH EXCLUSIONS accounted for.
 $parent_class_test = array('title' => 'Database Size (Default Exclusions applied)', 'suggestion' => 'n/a', 'value' => '<span id="pb_stats_refresh_database_size_excluded">' . pb_backupbuddy::$format->file_size(pb_backupbuddy::$options['stats']['db_size_excluded']) . '</span> <a class="pb_backupbuddy_refresh_stats" rel="refresh_database_size_excluded" alt="' . pb_backupbuddy::ajax_url('refresh_database_size_excluded') . '" title="' . __('Refresh', 'it-l10n-backupbuddy') . '"><img src="' . pb_backupbuddy::plugin_url() . '/images/refresh_gray.gif" style="vertical-align: -1px;"> <span class="pb_backupbuddy_loading" style="display: none; margin-left: 10px;"><img src="' . pb_backupbuddy::plugin_url() . '/images/loading.gif" alt="' . __('Loading...', 'it-l10n-backupbuddy') . '" title="' . __('Loading...', 'it-l10n-backupbuddy') . '" width="16" height="16" style="vertical-align: -3px;" /></span></a>', 'tip' => __('Total size of your database EXCLUDING any tables you have marked for exclusion.', 'it-l10n-backupbuddy'));
 $parent_class_test['status'] = __('OK', 'it-l10n-backupbuddy');
 array_push($tests, $parent_class_test);
 /***** BEGIN AVERAGE WRITE SPEED *****/
 require_once pb_backupbuddy::plugin_path() . '/classes/fileoptions.php';
 $write_speed_samples = 0;
 $write_speed_sum = 0;
 $backups = glob(backupbuddy_core::getBackupDirectory() . '*.zip');
 if (!is_array($backups)) {
     $backups = array();
 }
 foreach ($backups as $backup) {
     $serial = backupbuddy_core::get_serial_from_file($backup);
     pb_backupbuddy::status('details', 'Fileoptions instance #22.');
     $backup_options = new pb_backupbuddy_fileoptions(backupbuddy_core::getLogDirectory() . 'fileoptions/' . $serial . '.txt', $read_only = true);
     if (true !== ($result = $backup_options->is_ok())) {
            $backup_type = 'Full';
        } else {
            $backup_type = 'Unknown';
        }
    }
    // Make list without directory in name.
    $removePrefixDirs = array('full/', 'db/');
    $filesNoDir = str_replace($removePrefixDirs, '', $file);
    // Generate array of table rows.
    $backup_list_temp[$last_modified] = array(array($file, $filesNoDir), pb_backupbuddy::$format->date(pb_backupbuddy::$format->localize_time($last_modified)) . '<br /><span class="description">(' . pb_backupbuddy::$format->time_ago($last_modified) . ' ago)</span>', pb_backupbuddy::$format->file_size($size), $backup_type);
}
krsort($backup_list_temp);
$backup_list = array();
foreach ($backup_list_temp as $backup_item) {
    $backup_list[$backup_item[0][0]] = $backup_item;
    //str_replace( 'db/', '', str_replace( 'full/', '', $backup_item ) );
}
unset($backup_list_temp);
$urlPrefix = pb_backupbuddy::ajax_url('remoteClient') . '&destination_id=' . htmlentities(pb_backupbuddy::_GET('destination_id'));
// Render table listing files.
if (count($backup_list) == 0) {
    echo '<b>';
    _e('You have not completed sending any backups to BackupBuddy Stash for this site yet.', 'it-l10n-backupbuddy');
    echo '</b>';
} else {
    pb_backupbuddy::$ui->list_table($backup_list, array('action' => pb_backupbuddy::ajax_url('remoteClient') . '&function=remoteClient&destination_id=' . htmlentities(pb_backupbuddy::_GET('destination_id')) . '&remote_path=' . htmlentities(pb_backupbuddy::_GET('remote_path') . '&stashhash=' . $stash_hash), 'columns' => array('Backup File', 'Uploaded <img src="' . pb_backupbuddy::plugin_url() . '/images/sort_down.png" style="vertical-align: 0px;" title="Sorted most recent first">', 'File Size', 'Type'), 'hover_actions' => array($urlPrefix . '&cpy_file=' => 'Copy to Local', $urlPrefix . '&downloadlink_file=' => 'Get download link'), 'hover_action_column_key' => '0', 'bulk_actions' => array('delete_backup' => 'Delete'), 'css' => 'width: 100%;'));
}
// Display troubleshooting subscriber key.
echo '<span class="description" style="margin-top: -20px; float: right;">Subscriber key: ' . $subscriber_prefix . '</span>';
echo '<br style="clear: both;">';
return;
Exemple #22
0
    public function rollback()
    {
        pb_backupbuddy::$ui->ajax_header();
        pb_backupbuddy::load_script('jquery');
        echo '<div id="pb_backupbuddy_working" style="width: 100px; margin-bottom: 30px;"><br><center><img src="' . pb_backupbuddy::plugin_url() . '/images/working.gif" title="Working... Please wait as this may take a moment..."></center></div>';
        ?>
		
		
		<script>
		function pb_status_append( status_string ) {
			var win = window.dialogArguments || opener || parent || top;
			win.pb_status_append( status_string );
		}
		function pb_status_undourl( undo_url ) {
			var win = window.dialogArguments || opener || parent || top;
			win.pb_status_undourl( undo_url );
		}
		
		var win = window.dialogArguments || opener || parent || top;
		win.window.scrollTo(0,0);
		</script>
		
		
		<?php 
        global $pb_backupbuddy_js_status;
        $pb_backupbuddy_js_status = true;
        pb_backupbuddy::set_status_serial('restore');
        $step = strip_tags(pb_backupbuddy::_GET('step'));
        if ('' == $step || !is_numeric($step)) {
            $step = 0;
        }
        $backupFile = strip_tags(pb_backupbuddy::_GET('archive'));
        if ('' == $backupFile) {
            pb_backupbuddy::alert('The backup file to restore from must be specified.');
            die;
        }
        $stepFile = pb_backupbuddy::plugin_path() . '/controllers/pages/rollback/_step' . $step . '.php';
        if (!file_exists($stepFile)) {
            pb_backupbuddy::alert('Error #849743. Invalid roll back step `' . htmlentities(pb_backupbuddy::_GET('step')) . '` (' . $step . ').');
            die;
        }
        require $stepFile;
        echo '<br><br><br>';
        echo '<script type="text/javascript">jQuery("#pb_backupbuddy_working").hide();</script>';
        pb_backupbuddy::$ui->ajax_footer();
        pb_backupbuddy::flush();
        die;
    }
Exemple #23
0
<?php

$page_title = 'Unzipping Backup File';
require_once '_header.php';
echo '<div class="wrap">';
echo pb_backupbuddy::$classes['import']->status_box('Extracting backup ZIP file with ImportBuddy v' . pb_backupbuddy::$options['bb_version'] . '... Powered by BackupBuddy.');
echo '<div id="pb_importbuddy_working"><img src="' . pb_backupbuddy::plugin_url() . '/images/loading_large.gif" title="Working... Please wait as this may take a moment..."></div>';
flush();
$results = extract_files();
echo '<script type="text/javascript">jQuery("#pb_importbuddy_working").hide();</script>';
if (true === $results) {
    // Move on to next step.
    echo '<br><br><p style="text-align: center;">Files successfully extracted.</p>';
    echo '<form action="?step=3" method=post>';
    echo '<input type="hidden" name="options" value="' . htmlspecialchars(serialize(pb_backupbuddy::$options)) . '" />';
    echo '</div><!-- /wrap -->';
    echo '<div class="main_box_foot"><input type="submit" name="submit" value="Next Step &rarr;" class="button" /></div>';
    echo '</form>';
} else {
    pb_backupbuddy::alert('File extraction process did not complete successfully. Unable to continue to next step. Manually extract the backup ZIP file and choose to "Skip File Extraction" from the advanced options on Step 1.', true, '9005');
    echo '<p style="text-align: center;"><a href="http://pluginbuddy.com/tutorials/unzip-backup-zip-file-in-cpanel/">Click here for instructions on manual ZIP extraction as a work-around.</a></p>';
    echo '</div><!-- /wrap -->';
}
rename_htaccess_temp();
// Rename .htaccess to .htaccess.bb_temp until end of migration.
get_dat_from_backup();
require_once '_footer.php';
Exemple #24
0
	pb_backupbuddy::$ui->start_metabox( 'Things to do . . .', true, true );
		echo '<ul class="pluginbuddy-nodecor" style="margin-left: 10px;">';
		echo '	<li type="disc"><a href="http://twitter.com/home?status=' . urlencode('Check out this awesome plugin, ' . pb_backupbuddy::settings( 'name' ) . '! http://pluginbuddy.com @pluginbuddy') . '" title="Share on Twitter" onClick="window.open(jQuery(this).attr(\'href\'),\'ithemes_popup\',\'toolbar=0,status=0,width=820,height=500,scrollbars=1\'); return false;">Tweet about this plugin.</a></li>';
		echo '	<li type="disc"><a href="http://pluginbuddy.com/purchase/">Check out PluginBuddy plugins.</a></li>';
		echo '	<li type="disc"><a href="http://ithemes.com/purchase/">Check out iThemes themes.</a></li>';
		echo '</ul>';
	pb_backupbuddy::$ui->end_metabox();
	
	pb_backupbuddy::$ui->start_metabox( 'PluginBuddy News', true, true );
		echo '<p style="font-weight: bold;">PluginBuddy.com</p>';
		echo pb_backupbuddy::$ui->get_feed( 'http://pluginbuddy.com/feed/', 5 );
		echo '<p style="font-weight: bold;">Twitter @pluginbuddy</p>';
		$twit_append = '<li>&nbsp;</li>';
		$twit_append .= '<li><img src="' . pb_backupbuddy::plugin_url() . '/pluginbuddy/images/twitter.png" style="vertical-align: -3px;" /> <a href="http://twitter.com/pluginbuddy/">Follow @pluginbuddy on Twitter.</a></li>';
		$twit_append .= '<li><img src="' . pb_backupbuddy::plugin_url() . '/pluginbuddy/images/feed.png" style="vertical-align: -3px;" /> <a href="http://pluginbuddy.com/feed/">Subscribe to RSS news feed.</a></li>';
		$twit_append .= '<li><img src="' . pb_backupbuddy::plugin_url() . '/pluginbuddy/images/email.png" style="vertical-align: -3px;" /> <a href="http://pluginbuddy.com/subscribe/">Subscribe to Email Newsletter.</a></li>';
		echo pb_backupbuddy::$ui->get_feed( 'http://twitter.com/statuses/user_timeline/108700480.rss', 5, $twit_append, 'pluginbuddy: ' );
	pb_backupbuddy::$ui->end_metabox();
	
	pb_backupbuddy::$ui->start_metabox( 'Help & Support', true, true );
		echo '<p>See our <a href="http://ithemes.com/codex/page/PluginBuddy">Knowledge Base</a>, <a href="http://pluginbuddy.com/tutorials/">tutorials & videos</a> or visit our <a href="http://pluginbuddy.com/support/">support forum</a> for additional information and help.</p>';
	pb_backupbuddy::$ui->end_metabox();
echo '</div>';



if ( pb_backupbuddy::settings( 'series' ) != '' ) { // SERIES
	pb_backupbuddy::$ui->title( 'Getting Started with ' . pb_backupbuddy::settings( 'series' ) );
	?>
	<div id="pluginbuddy-tabs" style="width: 70%;">
		<ul>
    $hover_actions['migrate'] = __('Migrate', 'it-l10n-backupbuddy');
    $hover_actions['note'] = __('Note', 'it-l10n-backupbuddy');
    $bulk_actions = array();
    /*
    foreach( $backups as $backup_id => $backup ) {
    	if ( $backup[1] == 'Database' ) {
    		unset( $backups[$backup_id] );
    	}
    }
    */
}
if (count($backups) == 0) {
    _e('No backups have been created yet.', 'it-l10n-backupbuddy');
    echo '<br>';
} else {
    $columns = array(__('Backups', 'it-l10n-backupbuddy') . ' <img src="' . pb_backupbuddy::plugin_url() . '/images/sort_down.png" style="vertical-align: 0px;" title="Sorted most recent first">', __('Type', 'it-l10n-backupbuddy') . ' | ' . __('Profile', 'it-l10n-backupbuddy'), __('File Size', 'it-l10n-backupbuddy'), __('Status', 'it-l10n-backupbuddy') . pb_backupbuddy::tip(__('Backups are checked to verify that they are valid BackupBuddy backups and contain all of the key backup components needed to restore. Backups may display as invalid until they are completed. Click the refresh icon to re-verify the archive.', 'it-l10n-backupbuddy'), '', false));
    // Remove some columns for migration mode.
    /*
    if ( $listing_mode != 'default' ) {
    	
    	foreach( $backups as &$backup ) {
    		unset( $backup[1] ); // Remove backup type (only full shows for migration).
    		$backup = array_values( $backup );
    	}
    	$backups = array_values( $backups );
    	
    	unset( $columns[1] );
    	$columns = array_values( $columns );
    	
    	
    }
    // Determine destination.
    if (isset(pb_backupbuddy::$options['remote_destinations'][$remote_send['destination']])) {
        // Valid destination.
        $destination = pb_backupbuddy::$options['remote_destinations'][$remote_send['destination']]['title'] . ' (' . pb_backupbuddy::$options['remote_destinations'][$remote_send['destination']]['type'] . ')';
    } else {
        // Invalid destination (been deleted since send?).
        $destination = '<span class="description">Unknown</span>';
    }
    $write_speed = '';
    if (isset($remote_send['write_speed']) && '' != $remote_send['write_speed']) {
        $write_speed = 'Transfer Speed: ' . pb_backupbuddy::$format->file_size($remote_send['write_speed']) . '/sec<br>';
    }
    $trigger = ucfirst($remote_send['trigger']);
    $base_file = basename($remote_send['file']);
    if ('remote-send-test.php' == $base_file) {
        $base_file = __('Remote destination test', 'it-l10n-backupbuddy') . '<br><span class="description" style="margin-left: 10px;">(Send & delete test file remote-send-test.php)</span>';
        $file_size = '';
        $trigger = __('Manual settings test', 'it-l10n-backupbuddy');
        $destination = '<span class="description">Test settings</span>';
    }
    // Push into array.
    $sends[] = array($base_file . $file_size . $send_importbuddy, $destination, $trigger, $write_speed . 'Start: ' . pb_backupbuddy::$format->date(pb_backupbuddy::$format->localize_time($remote_send['start_time'])) . '<br>' . 'Finish: ' . $finish_time . '<br>' . '<span class="description">' . $time_ago . $duration . '</span>', $status);
}
// End foreach.
if (count($sends) == 0) {
    echo '<br>' . __('There have been no recent file transfers.', 'it-l10n-backupbuddy') . '<br>';
} else {
    pb_backupbuddy::$ui->list_table($sends, array('action' => pb_backupbuddy::page_url(), 'columns' => array(__('Backup File', 'it-l10n-backupbuddy'), __('Destination', 'it-l10n-backupbuddy'), __('Trigger', 'it-l10n-backupbuddy'), __('Transfer Information', 'it-l10n-backupbuddy') . ' <img src="' . pb_backupbuddy::plugin_url() . '/images/sort_down.png" style="vertical-align: 0px;" title="Sorted most recent started first">', __('Status', 'it-l10n-backupbuddy')), 'css' => 'width: 100%;'));
}
?>
<br>
			
		});
	</script>
	<?php 
}
$default_name = NULL;
if ('add' == $mode) {
    $default_name = 'My FTP';
}
$settings_form->add_setting(array('type' => 'text', 'name' => 'title', 'title' => __('Destination name', 'it-l10n-backupbuddy'), 'tip' => __('Name of the new destination to create. This is for your convenience only.', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-45]', 'default' => $default_name));
$settings_form->add_setting(array('type' => 'text', 'name' => 'address', 'title' => __('Server address', 'it-l10n-backupbuddy'), 'tip' => __('[Example: ftp.foo.com] - FTP server address.  Do not include http:// or ftp:// or any other prefixes. You may specify an alternate port in the format of ftp_address:ip_address such as yourftp.com:21', 'it-l10n-backupbuddy'), 'rules' => 'required|string[0-500]'));
$settings_form->add_setting(array('type' => 'text', 'name' => 'username', 'title' => __('Username', 'it-l10n-backupbuddy'), 'tip' => __('[Example: foo] - Username to use when connecting to the FTP server.', 'it-l10n-backupbuddy'), 'rules' => 'required|string[0-250]'));
$settings_form->add_setting(array('type' => 'password', 'name' => 'password', 'title' => __('Password', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 1234xyz] - Password to use when connecting to the FTP server.', 'it-l10n-backupbuddy'), 'rules' => 'required|string[0-250]'));
$settings_form->add_setting(array('type' => 'text', 'name' => 'path', 'title' => __('Remote path (optional)', 'it-l10n-backupbuddy'), 'tip' => __('[Example: /public_html/backups] - Remote path to place uploaded files into on the destination FTP server. Make sure this path is correct; if it does not exist BackupBuddy will attempt to create it. No trailing slash is needed.', 'it-l10n-backupbuddy'), 'rules' => 'string[0-500]', 'after' => ' <span class="pb_backupbuddy_ftpdestination_pathpicker">
							<a href="#" class="button secondary-button" title="Browse FTP Folders">Browse & Select FTP Path</a>
							<img class="pb_backupbuddy_ftppicker_load" style="vertical-align: -3px; margin-left: 5px; display: none;" src="' . pb_backupbuddy::plugin_url() . '/images/loading.gif" title="Loading... This may take a few seconds...">
						</span>
						<div class="pb_backupbuddy_ftpdestination_pathpickerbox" style="margin-top: 10px; display: none;">Loading...</div>'));
if (pb_backupbuddy::_GET('add') != '') {
    // set default only when adding.
    $default_url = rtrim(site_url(), '/\\') . '/';
} else {
    $default_url = '';
}
$settings_form->add_setting(array('type' => 'text', 'name' => 'url', 'title' => __('Migration URL', 'it-l10n-backupbuddy') . '<br><span class="description">Optional, for migrations</span>', 'tip' => __('Enter the URL corresponding to the FTP destination path. This URL must lead to the location where files uploaded to this remote destination would end up. If the destination is in a subdirectory make sure to match it in the corresponding URL.', 'it-l10n-backupbuddy'), 'css' => 'width: 50%; max-width: 700px;', 'default' => $default_url, 'rules' => 'string[0-500]'));
$settings_form->add_setting(array('type' => 'text', 'name' => 'archive_limit', 'title' => __('Archive limit', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 5] - Enter 0 for no limit. This is the maximum number of archives to be stored in this specific destination. If this limit is met the oldest backups will be deleted.', 'it-l10n-backupbuddy'), 'rules' => 'required|int[0-9999999]', 'css' => 'width: 50px;', 'after' => ' backups'));
$settings_form->add_setting(array('type' => 'title', 'name' => 'advanced_begin', 'title' => '<span class="dashicons dashicons-arrow-right"></span> ' . __('Advanced Options', 'it-l10n-backupbuddy'), 'row_class' => 'advanced-toggle-title'));
$settings_form->add_setting(array('type' => 'select', 'name' => 'active_mode', 'title' => __('Transfer mode', 'it-l10n-backupbuddy'), 'options' => array('1' => __('Active', 'it-l10n-backupbuddy'), '0' => __('Passive (default)', 'it-l10n-backupbuddy')), 'tip' => __('[Default: Passive] - Determines whether the FTP file transfer happens in FTP active or passive mode.  Some servers or those behind a firewall may need to use PASV, or passive mode as a workaround.', 'it-l10n-backupbuddy'), 'rules' => 'required', 'row_class' => 'advanced-toggle'));
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'ftps', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Use FTPs encryption', 'it-l10n-backupbuddy'), 'tip' => __('[Default: disabled] - Select whether this connection is for FTP or FTPs (enabled; FTP over SSL). Note that FTPs is NOT the same as sFTP (FTP over SSH) and is not compatible or equal.', 'it-l10n-backupbuddy'), 'css' => '', 'after' => '<span class="description"> ' . __('Not supported by most servers', 'it-l10n-backupbuddy') . '</span>', 'rules' => 'required', 'row_class' => 'advanced-toggle'));
if ($mode !== 'edit') {
    $settings_form->add_setting(array('type' => 'checkbox', 'name' => 'disable_file_management', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Disable file management', 'it-l10n-backupbuddy'), 'tip' => __('[Default: unchecked] - When checked, selecting this destination disables browsing or accessing files stored at this destination from within BackupBuddy.', 'it-l10n-backupbuddy'), 'css' => '', 'rules' => '', 'row_class' => 'advanced-toggle'));
Exemple #28
0
- <a href="http://ithemes.tv/category/backupbuddy/" target="_new" style="text-decoration: none;">Getting Started Videos</a><br>
- <a href="http://ithemes.com/codex/" target="_new" style="text-decoration: none;">Knowledge Base Codex</a><br>
- <a href="http://ithemes.com/support/" target="_new" style="text-decoration: none;">Support Forum</a>
<?php 
pb_backupbuddy::$ui->end_metabox();
pb_backupbuddy::$ui->start_metabox('iThemes', true, true);
echo '<p style="font-weight: bold; left: -10px;"><a href="http://ithemes.com/" style="text-decoration: none;"><img src="' . pb_backupbuddy::plugin_url() . '/images/pluginbuddy.png" style="vertical-align: -3px;"> Things to do . . .</a></p>';
echo '<ol class="pluginbuddy-nodecor" style="margin-left: 10px;">';
echo '	<li style="list-style-type: none;"><a href="http://twitter.com/home?status=' . urlencode('Check out this awesome plugin, ' . pb_backupbuddy::settings('name') . '! http://getbackupbuddy.com @backup_buddy') . '" title="Share on Twitter" onClick="window.open(jQuery(this).attr(\'href\'),\'ithemes_popup\',\'toolbar=0,status=0,width=820,height=500,scrollbars=1\'); return false;">Tweet about this plugin</a></li>';
echo '	<li style="list-style-type: none;"><a href="http://ithemes.com/find/plugins/" target="_new">Plugins by iThemes</a></li>';
echo '	<li style="list-style-type: none;"><a href="http://ithemes.com/find/themes/" target="_new">Themes by iThemes</a></li>';
echo '	<li style="list-style-type: none;"><a href="http://pluginbuddy.com/subscribe/" style="text-decoration: none;">Subscribe to Email Newsletter</a></li>';
echo '</ol>';
echo '<p style="font-weight: bold; left: -10px;"><a href="http://twitter.com/ithemes/" style="text-decoration: none;"><img src="' . pb_backupbuddy::plugin_url() . '/pluginbuddy/images/twitter.png" style="vertical-align: -3px;"> @ithemes</a></p>';
echo pb_backupbuddy::$ui->get_feed('http://ithemes.com/feed/', 3);
echo '<p style="font-weight: bold; left: -10px;"><a href="http://twitter.com/backup_buddy/" style="text-decoration: none;"><img src="' . pb_backupbuddy::plugin_url() . '/pluginbuddy/images/twitter.png" style="vertical-align: -3px;"> @backup_buddy</a></p>';
echo pb_backupbuddy::$ui->get_feed('https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=backup_buddy', 3, '', 'Backup_Buddy: ');
pb_backupbuddy::$ui->end_metabox();
echo '</td></tr></table>';
function plugin_information($plugin_slug, $data)
{
    $plugin_path = $data['path'];
    ?>
	
	<?php 
    pb_backupbuddy::$ui->start_metabox('Version History', true, 'width: 100%;');
    ?>
		<textarea readonly="readonly" rows="7" cols="65" wrap="off" style="width: 100%;"><?php 
    //echo "Version History:\n\n";
    readfile($plugin_path . '/history.txt');
    ?>
Exemple #29
0
    public static function get_quota_bar($account_info)
    {
        //echo '<pre>' . print_r( $account_info, true ) . '</pre>';
        $return = '';
        $return .= '
		<style>
			.outer_progress {
				-moz-border-radius: 4px;
				-webkit-border-radius: 4px;
				-khtml-border-radius: 4px;
				border-radius: 4px;
				
				border: 1px solid #DDD;
				background: #EEE;
				
				max-width: 700px;
				
				margin-left: auto;
				margin-right: auto;
				
				height: 30px;
			}
			
			.inner_progress {
				border-right: 1px solid #85bb3c;
				background: #8cc63f url("' . pb_backupbuddy::plugin_url() . '/destinations/stash/progress.png") 50% 50% repeat-x;
				
				height: 100%;
			}
			
			.progress_table {
				color: #5E7078;
				font-family: "Open Sans", Arial, Helvetica, Sans-Serif;
				font-size: 14px;
				line-height: 20px;
				text-align: center;
				
				margin-left: auto;
				margin-right: auto;
				margin-bottom: 20px;
			}
		</style>';
        if (isset($account_info['quota_warning']) && $account_info['quota_warning'] != '') {
            //echo '<div style="color: red; max-width: 700px; margin-left: auto; margin-right: auto;"><b>Warning</b>: ' . $account_info['quota_warning'] . '</div><br>';
        }
        $return .= '
		<div class="outer_progress">
			<div class="inner_progress" style="width: ' . $account_info['quota_used_percent'] . '%"></div>
		</div>
		
		<table align="center" class="progress_table">
			<tbody><tr align="center">
			    <td style="width: 10%; font-weight: bold; text-align: center">Free Tier</td>
			    <td style="width: 10%; font-weight: bold; text-align: center">Paid Tier</td>        
			    <td style="width: 10%"></td>
			    <td style="width: 10%; font-weight: bold; text-align: center">Total</td>
			    <td style="width: 10%; font-weight: bold; text-align: center">Used</td>
			    <td style="width: 10%; font-weight: bold; text-align: center">Available</td>        
			</tr>

			<tr align="center">
			    <td style="text-align: center">' . $account_info['quota_free_nice'] . '</td>
			    <td style="text-align: center">';
        if ($account_info['quota_paid'] == '0') {
            $return .= 'none';
        } else {
            $return .= $account_info['quota_paid_nice'];
        }
        $return .= '</td>
			    <td></td>
			    <td style="text-align: center">' . $account_info['quota_total_nice'] . '</td>
			    <td style="text-align: center">' . $account_info['quota_used_nice'] . '</td>
			    <td style="text-align: center">' . $account_info['quota_available_nice'] . '</td>
			</tr>
			';
        $return .= '
		</tbody></table>';
        return $return;
    }
Exemple #30
0
    public static function backups_list($type = 'default', $subsite_mode = false)
    {
        if (pb_backupbuddy::_POST('bulk_action') == 'delete_backup' && is_array(pb_backupbuddy::_POST('items'))) {
            $needs_save = false;
            pb_backupbuddy::verify_nonce(pb_backupbuddy::_POST('_wpnonce'));
            // Security check to prevent unauthorized deletions by posting from a remote place.
            $deleted_files = array();
            foreach (pb_backupbuddy::_POST('items') as $item) {
                if (file_exists(backupbuddy_core::getBackupDirectory() . $item)) {
                    if (@unlink(backupbuddy_core::getBackupDirectory() . $item) === true) {
                        $deleted_files[] = $item;
                        // Cleanup any related fileoptions files.
                        $serial = backupbuddy_core::get_serial_from_file($item);
                        $backup_files = glob(backupbuddy_core::getBackupDirectory() . '*.zip');
                        if (!is_array($backup_files)) {
                            $backup_files = array();
                        }
                        if (count($backup_files) > 5) {
                            // Keep a minimum number of backups in array for stats.
                            $this_serial = self::get_serial_from_file($item);
                            $fileoptions_file = backupbuddy_core::getLogDirectory() . 'fileoptions/' . $this_serial . '.txt';
                            if (file_exists($fileoptions_file)) {
                                @unlink($fileoptions_file);
                            }
                            if (file_exists($fileoptions_file . '.lock')) {
                                @unlink($fileoptions_file . '.lock');
                            }
                            $needs_save = true;
                        }
                    } else {
                        pb_backupbuddy::alert('Error: Unable to delete backup file `' . $item . '`. Please verify permissions.', true);
                    }
                }
                // End if file exists.
            }
            // End foreach.
            if ($needs_save === true) {
                pb_backupbuddy::save();
            }
            pb_backupbuddy::alert(__('Deleted:', 'it-l10n-backupbuddy') . ' ' . implode(', ', $deleted_files));
        }
        // End if deleting backup(s).
        $backups = array();
        $backup_sort_dates = array();
        $files = glob(backupbuddy_core::getBackupDirectory() . 'backup*.zip');
        if (is_array($files) && !empty($files)) {
            // For robustness. Without open_basedir the glob() function returns an empty array for no match. With open_basedir in effect the glob() function returns a boolean false for no match.
            $backup_prefix = self::backup_prefix();
            // Backup prefix for this site. Used for MS checking that this user can see this backup.
            foreach ($files as $file_id => $file) {
                if ($subsite_mode === true && is_multisite()) {
                    // If a Network and NOT the superadmin must make sure they can only see the specific subsite backups for security purposes.
                    // Only allow viewing of their own backups.
                    if (!strstr($file, $backup_prefix)) {
                        unset($files[$file_id]);
                        // Remove this backup from the list. This user does not have access to it.
                        continue;
                        // Skip processing to next file.
                    }
                }
                $serial = backupbuddy_core::get_serial_from_file($file);
                $options = array();
                if (file_exists(backupbuddy_core::getLogDirectory() . 'fileoptions/' . $serial . '.txt')) {
                    require_once pb_backupbuddy::plugin_path() . '/classes/fileoptions.php';
                    pb_backupbuddy::status('details', 'Fileoptions instance #33.');
                    $backup_options = new pb_backupbuddy_fileoptions(backupbuddy_core::getLogDirectory() . 'fileoptions/' . $serial . '.txt', $read_only = false, $ignore_lock = false, $create_file = true);
                    // Will create file to hold integrity data if nothing exists.
                } else {
                    $backup_options = '';
                }
                $backup_integrity = backupbuddy_core::backup_integrity_check($file, $backup_options, $options);
                // Backup status.
                $pretty_status = array(true => '<span class="pb_label pb_label-success">Good</span>', 'pass' => '<span class="pb_label pb_label-success">Good</span>', false => '<span class="pb_label pb_label-important">Bad</span>', 'fail' => '<span class="pb_label pb_label-important">Bad</span>');
                // Backup type.
                $pretty_type = array('full' => 'Full', 'db' => 'Database', 'files' => 'Files');
                // Defaults...
                $detected_type = '';
                $file_size = '';
                $modified = '';
                $modified_time = 0;
                $integrity = '';
                $main_string = 'Warn#284.';
                if (is_array($backup_integrity)) {
                    // Data intact... put it all together.
                    // Calculate time ago.
                    $time_ago = '';
                    if (isset($backup_integrity['modified'])) {
                        $time_ago = pb_backupbuddy::$format->time_ago($backup_integrity['modified']) . ' ago';
                    }
                    $detected_type = pb_backupbuddy::$format->prettify($backup_integrity['detected_type'], $pretty_type);
                    if ($detected_type == '') {
                        $detected_type = 'Unknown';
                    } else {
                        if (isset($backup_options->options['profile'])) {
                            $detected_type = '
							<div>
								<span style="color: #AAA; float: left;">' . $detected_type . '</span>
								<span style="display: inline-block; float: left; height: 15px; border-right: 1px solid #EBEBEB; margin-left: 6px; margin-right: 6px;"></span>
								' . htmlentities($backup_options->options['profile']['title']) . '
							</div>
							';
                        }
                    }
                    $file_size = pb_backupbuddy::$format->file_size($backup_integrity['size']);
                    $modified = pb_backupbuddy::$format->date(pb_backupbuddy::$format->localize_time($backup_integrity['modified']), 'l, F j, Y - g:i:s a');
                    $modified_time = $backup_integrity['modified'];
                    if (isset($backup_integrity['status'])) {
                        // Pre-v4.0.
                        $status = $backup_integrity['status'];
                    } else {
                        // v4.0+
                        $status = $backup_integrity['is_ok'];
                    }
                    // Calculate main row string.
                    if ($type == 'default') {
                        // Default backup listing.
                        $main_string = '<a href="' . pb_backupbuddy::ajax_url('download_archive') . '&backupbuddy_backup=' . basename($file) . '" class="backupbuddyFileTitle" title="' . basename($file) . '">' . $modified . ' (' . $time_ago . ')</a>';
                    } elseif ($type == 'migrate') {
                        // Migration backup listing.
                        $main_string = '<a class="pb_backupbuddy_hoveraction_migrate backupbuddyFileTitle" rel="' . basename($file) . '" href="' . pb_backupbuddy::page_url() . '&migrate=' . basename($file) . '&value=' . basename($file) . '" title="' . basename($file) . '">' . $modified . ' (' . $time_ago . ')</a>';
                    } else {
                        $main_string = '{Unknown type.}';
                    }
                    // Add comment to main row string if applicable.
                    if (isset($backup_integrity['comment']) && $backup_integrity['comment'] !== false && $backup_integrity['comment'] !== '') {
                        $main_string .= '<br><span class="description">Note: <span class="pb_backupbuddy_notetext">' . htmlentities($backup_integrity['comment']) . '</span></span>';
                    }
                    $integrity = pb_backupbuddy::$format->prettify($status, $pretty_status) . ' ';
                    if (isset($backup_integrity['scan_notes']) && count((array) $backup_integrity['scan_notes']) > 0) {
                        foreach ((array) $backup_integrity['scan_notes'] as $scan_note) {
                            $integrity .= $scan_note . ' ';
                        }
                    }
                    $integrity .= '<a href="' . pb_backupbuddy::page_url() . '&reset_integrity=' . $serial . '" title="Rescan integrity. Last checked ' . pb_backupbuddy::$format->date($backup_integrity['scan_time']) . '."><img src="' . pb_backupbuddy::plugin_url() . '/images/refresh_gray.gif" style="vertical-align: -1px;"></a>';
                    $integrity .= '<div class="row-actions"><a title="' . __('Backup Status', 'it-l10n-backupbuddy') . '" href="' . pb_backupbuddy::ajax_url('integrity_status') . '&serial=' . $serial . '&#038;TB_iframe=1&#038;width=640&#038;height=600" class="thickbox">' . __('View Details', 'it-l10n-backupbuddy') . '</a></div>';
                    $sumLogFile = backupbuddy_core::getLogDirectory() . 'status-' . $serial . '_sum_' . pb_backupbuddy::$options['log_serial'] . '.txt';
                    if (file_exists($sumLogFile)) {
                        $integrity .= '<div class="row-actions"><a title="' . __('View Backup Log', 'it-l10n-backupbuddy') . '" href="' . pb_backupbuddy::ajax_url('view_log') . '&serial=' . $serial . '&#038;TB_iframe=1&#038;width=640&#038;height=600" class="thickbox">' . __('View Log', 'it-l10n-backupbuddy') . '</a></div>';
                    }
                }
                // end if is_array( $backup_options ).
                $backups[basename($file)] = array(array(basename($file), $main_string . '<br><span class="description" style="color: #AAA; display: inline-block; margin-top: 5px;">' . basename($file) . '</span>'), $detected_type, $file_size, $integrity);
                $backup_sort_dates[basename($file)] = $modified_time;
            }
            // End foreach().
        }
        // End if.
        // Sort backup by date.
        arsort($backup_sort_dates);
        // Re-arrange backups based on sort dates.
        $sorted_backups = array();
        foreach ($backup_sort_dates as $backup_file => $backup_sort_date) {
            $sorted_backups[$backup_file] = $backups[$backup_file];
            unset($backups[$backup_file]);
        }
        unset($backups);
        return $sorted_backups;
    }