Exemple #1
0
 private static function _connect($accessToken)
 {
     try {
         self::$_dbxClient = new dbx\Client($accessToken, 'BackupBuddy v' . pb_backupbuddy::settings('version'));
     } catch (\Exception $e) {
         pb_backupbuddy::alert('Dropbox Error: ' . $e->getMessage() . '<br><br>' . pb_backupbuddy::$ui->button(pb_backupbuddy::page_url(), '&larr; go back & retry'), true);
         return false;
     }
     pb_backupbuddy::status('details', 'Connected to Dropbox.');
     return true;
 }
Exemple #2
0
<?php

pb_backupbuddy::$ui->title(__('Deploy Database', 'it-l10n-backupbuddy') . ' &nbsp;&nbsp; <a style="font-size: 0.6em;" href="#" onClick="jQuery(\'#pb_backupbuddy_status_wrap\').toggle();">Show / Hide Advanced Status Details</a>');
pb_backupbuddy::$options['deployments'] = array(array('siteurl' => 'http://backupbuddy2', 'api_key' => 'xxx'));
pb_backupbuddy::save();
if (pb_backupbuddy::_GET('deployment') == '') {
    foreach (pb_backupbuddy::$options['deployments'] as $deployment_id => $deployment) {
        echo '<a href="' . pb_backupbuddy::page_url() . '&deployment=' . $deployment_id . '">' . $deployment['siteurl'] . '</a>';
    }
    return;
}
$deployment_id = pb_backupbuddy::_GET('deployment');
?>





<script>
function pb_status_undourl( undo_url ) {
	if ( '' == undo_url ) {
		jQuery( '#pb_backupbuddy_undourl' ).parent('#message').slideUp();
		return;
	}
	jQuery( '#pb_backupbuddy_undourl' ).attr( 'href', undo_url );
	jQuery( '#pb_backupbuddy_undourl' ).text( undo_url );
	jQuery( '#pb_backupbuddy_undourl' ).parent('#message').slideDown();
}
</script>

<style>
					}
				}
			);
			
			/* Try to ping server to nudge cron along since sometimes it doesnt trigger as expected. */
			jQuery.post( '<?php 
echo admin_url('admin-ajax.php');
?>
',
				function(data) {
				}
			);

		} else {
			window.location.href = '<?php 
echo pb_backupbuddy::page_url();
?>
&custom=remoteclient&destination_id=' + destination_id;
		}
	}
	
	
	
</script>
<style>
	.backupbuddyFileTitle {
		//color: #0084CB;
		color: #000;
		font-size: 1.2em;
	}
</style>
        echo '</form>';
    }
    // end authorication code submitted.
} elseif ('edit' == $mode) {
    // EDIT mode.
    $accessToken = $destination_settings['access_token'];
    try {
        $dropboxClient = new \Dropbox\Client($accessToken, 'BackupBuddy v' . pb_backupbuddy::settings('version'));
    } catch (\Exception $e) {
        pb_backupbuddy::alert('Dropbox Error #143838: ' . $e->getMessage() . '<br><br>' . pb_backupbuddy::$ui->button(pb_backupbuddy::page_url(), '&larr; go back & retry'), true);
        return false;
    }
    try {
        $accountInfo = $dropboxClient->getAccountInfo();
    } catch (\Exception $e) {
        pb_backupbuddy::alert('Dropbox Error #132852: ' . $e->getMessage() . '<br><br>' . pb_backupbuddy::$ui->button(pb_backupbuddy::page_url(), '&larr; go back & retry'), true);
        return false;
    }
    $show_config_form = true;
    // Enable showing configuration form below.
} elseif ('save' == $mode) {
    $show_config_form = true;
} else {
    // UNKNOWN mode.
    die('Error #3283489434: Unknown destination form mode.');
}
// End checking mode.
// Display configuration form.
if (true === $show_config_form) {
    if ('save' != $mode) {
        // Account info.
<?php

// This is a half-way conversion from RH's implementation into framework and reusing libraries.
// Still a ways to go...
//STEP 1
$form_url = add_query_arg(array('action' => 'step2'), pb_backupbuddy::page_url());
global $current_site;
?>

<?php 
_e('Multisite import allows you to import a site from a BackupBuddy backup archive as a new site within this Multisite network with a new URL.  Please upload your BackupBuddy backup archive into the root of your site before proceeding or select an existing backup.', 'it-l10n-backupbuddy');
?>
 
<?php 
_e('Only FULL backups may be imported into a Multisite Network.');
?>
<br><br>

<form method="post" action="<?php 
echo esc_url($form_url);
?>
">
<?php 
wp_nonce_field('bbms-migration', 'pb_bbms_migrate');
?>
<table class="form-table">
	<tr class="form-field form-required">
		<th scope="row">Backup file to import</th>
		<td>
		<?php 
echo 'Backups in site root:<br>';
pb_backupbuddy::$ui->title('View Backup Contents');
?>



<a class="button secondary-button pb_backupbuddy_restore">Restore Selected</a>
<div style="width: 100%; height: 100%;">
	<div class="jQueryOuterTree" id="pb_backupbuddy_file_browser" style="position: relative; height: 90%; margin-top: 7px; margin-bottom: 7px;">
		<ul class="jqueryFileTree"></ul>
	</div>
	<span style="float: right;" class="description">Select directories to expand or text-based files to view contents.</span>
	<a class="button secondary-button pb_backupbuddy_restore">Restore Selected</a>
	
	<br><br><br><br style="clear: both; height: 0; overflow: hidden;">
	<?php 
echo pb_backupbuddy::$ui->button(pb_backupbuddy::page_url(), '&larr; back to backups');
?>
	<br style="clear: both; height: 0; overflow: hidden;">
	<br><br><br><br>
</div>
<br style="clear: both; height: 0; overflow: hidden;">



<style type="text/css">
	#leanModal_div {
		height: 90%;
	}
	.modal_content {
		position: absolute;
		width: 660px;
Exemple #7
0
function plugin_information( $plugin_slug, $data ) {
	$plugin_path = $data['path'];
	?>
	
	<?php pb_backupbuddy::$ui->start_metabox( 'Plugin Information', true, 'width: 70%;' ); ?>
		<textarea readonly="readonly" rows="7" cols="65" wrap="off" style="width: 100%;"><?php echo "Version History:\n\n" ; readfile( $plugin_path . '/history.txt' ); ?></textarea>
		<br /><br />
		<script type="text/javascript">
			jQuery(document).ready(function() {
				jQuery("#pluginbuddy_<?php echo $plugin_slug; ?>_debugtoggle").click(function() {
					jQuery("#pluginbuddy_<?php echo $plugin_slug; ?>_debugtoggle_div").slideToggle();
				});
			});
		</script>
		<?php
		if ( pb_backupbuddy::_POST( 'reset_defaults' ) == $plugin_slug ) {
			if ( call_user_func(  'pb_' . $plugin_slug . '::reset_options', true ) === true ) {
				pb_backupbuddy::alert( 'Plugin settings have been reset to defaults for plugin `' . $data['name'] . '`.' );
			} else {
				pb_backupbuddy::alert( 'Unable to reset plugin settings. Verify you are running the latest version.' );
			}
		}
		?>
		<form method="post" action="<?php echo pb_backupbuddy::page_url(); ?>">
			<input type="hidden" name="reset_defaults" value="<?php echo $plugin_slug; ?>" />
			<input type="submit" name="submit" value="Reset Plugin Settings to Defaults" id="reset_defaults" class="button secondary-button" onclick="if ( !confirm('WARNING: This will reset all settings associated with this plugin to their defaults. Are you sure you want to do this?') ) { return false; }" />
		</form><br>
	<?php pb_backupbuddy::$ui->end_metabox(); ?>
	
	<?php
}
     $wp_settings[] = array('Upload Base Directory', $wp_upload_dir['basedir'], 'wp_upload_dir()');
 }
 $wp_settings[] = array('Site URL', site_url(), 'site_url()');
 $wp_settings[] = array('Home URL', home_url(), 'home_url()');
 $wp_settings[] = array('WordPress Root Path', ABSPATH, 'ABSPATH');
 // Multisite extras:
 $wp_settings_multisite = array();
 if (is_multisite()) {
     $wp_settings[] = array('Network Site URL', network_site_url(), 'network_site_url()');
     $wp_settings[] = array('Network Home URL', network_home_url(), 'network_home_url()');
 }
 $wp_settings[] = array('BackupBuddy local storage', backupbuddy_core::getBackupDirectory(), 'BackupBuddy Settings');
 $wp_settings[] = array('BackupBuddy temporary files', backupbuddy_core::getTempDirectory(), 'ABSPATH + Hardcoded location');
 $wp_settings[] = array('BackupBuddy logs', backupbuddy_core::getLogDirectory(), 'Upload Base + BackupBuddy');
 // Display WP settings..
 pb_backupbuddy::$ui->list_table($wp_settings, array('action' => pb_backupbuddy::page_url(), 'columns' => array(__('URLs & Paths', 'it-l10n-backupbuddy'), __('Value', 'it-l10n-backupbuddy'), __('Obtained via', 'it-l10n-backupbuddy')), 'css' => 'width: 100%;'));
 pb_backupbuddy::$ui->end_tab();
 // This page can take a bit to run.
 // Runs AFTER server information is displayed so we can view the default limits for the server.
 pb_backupbuddy::set_greedy_script_limits();
 pb_backupbuddy::$ui->start_tab('database');
 require_once 'server_info/database.php';
 echo '<br><br><a name="database_replace"></a>';
 echo '<div class="pb_htitle">' . 'Advanced: ' . __('Database Mass Text Replacement', 'it-l10n-backupbuddy') . '</div><br>';
 pb_backupbuddy::load_view('_server_tools-database_replace');
 pb_backupbuddy::$ui->end_tab();
 pb_backupbuddy::$ui->start_tab('files');
 require_once 'server_info/site_size.php';
 pb_backupbuddy::$ui->end_tab();
 pb_backupbuddy::$ui->start_tab('cron');
 require_once 'server_info/cron.php';
Exemple #9
0
pb_backupbuddy::$ui->title('Local Destination `' . $destination['title'] . '`');
echo 'Listing backups in local directory `' . $destination['path'] . '`...<br><br>';
// Handle deletion.
if (pb_backupbuddy::_POST('bulk_action') == 'delete_backup') {
    pb_backupbuddy::verify_nonce();
    $deleted_files = array();
    foreach ((array) pb_backupbuddy::_POST('items') as $item) {
        @unlink($destination['path'] . $item);
        if (file_exists($destination['path'] . $item)) {
            pb_backupbuddy::alert('Error: Unable to delete `' . $item . '`. Verify permissions.');
        } else {
            $deleted_files[] = $item;
        }
    }
    if (count($deleted_files) > 0) {
        pb_backupbuddy::alert('Deleted ' . implode(', ', $deleted_files) . '.');
    }
}
// Find backups in directory.
$backups = glob($destination['path'] . '*.zip');
if (!is_array($backups)) {
    $backups = array();
}
// Generate array of table rows.
$backup_list = array();
foreach ($backups as $backup) {
    $backup_list[basename($backup)] = array(basename($backup), pb_backupbuddy::$format->date(pb_backupbuddy::$format->localize_time(filemtime($backup))) . '<br /><span class="description">(' . pb_backupbuddy::$format->time_ago(filemtime($backup)) . ' ago)</span>', pb_backupbuddy::$format->file_size(filesize($backup)));
}
// Render table.
pb_backupbuddy::$ui->list_table($backup_list, array('action' => pb_backupbuddy::page_url() . '&custom=remoteclient&destination_id=' . htmlentities(pb_backupbuddy::_GET('destination_id')), 'columns' => array('Backup File', 'Last Modified', 'File Size'), 'hover_action_column_key' => '0', 'bulk_actions' => array('delete_backup' => 'Delete'), 'css' => 'width: 100%;'));
    }
}
// Get profile array.
$profile = array_merge(pb_backupbuddy::settings('profile_defaults'), pb_backupbuddy::$options['profiles'][$profile_id]);
foreach ($profile as $profile_item_name => &$profile_item) {
    // replace non-overridden defaults with actual default value.
    if ('-1' == $profile_item) {
        // Set to use default so go grab default.
        if (isset(pb_backupbuddy::$options['profiles'][0][$profile_item_name])) {
            $profile_item = pb_backupbuddy::$options['profiles'][0][$profile_item_name];
            // Grab value from defaults profile and replace with it.
        }
    }
}
echo '<div style="margin-bottom: 4px;">Backup profile for calculating exclusions: ';
echo '<select id="pb_backupbuddy_databaseprofile" onChange="window.location.href = \'' . pb_backupbuddy::page_url() . '&tab=1&profile=\' + jQuery(this).val();">';
foreach (pb_backupbuddy::$options['profiles'] as $this_profile_id => $this_profile) {
    ?>
	<option value="<?php 
    echo $this_profile_id;
    ?>
" <?php 
    if ($profile_id == $this_profile_id) {
        echo 'selected';
    }
    ?>
><?php 
    echo htmlentities($this_profile['title']);
    ?>
  (<?php 
    echo $this_profile['type'];
Exemple #11
0
<?php 
pb_backupbuddy::$ui->title(__('Scheduled Backups', 'it-l10n-backupbuddy'));
/*
if ( count( pb_backupbuddy::$options['schedules'] ) == 0 ) {
	pb_backupbuddy::disalert( 'no_schedules_reminder', '<span class="pb_label">Tip</span> Create your first schedule below to keep your site backed up automatically.', 'it-l10n-backupbuddy' );
}
*/
pb_backupbuddy::disalert('schedule_limit_reminder', '<span class="pb_label">Tip</span> ' . __('Keep old backups from piling up by configuring "Local Archive Storage Limits" on the Settings page.', 'it-l10n-backupbuddy'));
pb_backupbuddy::$ui->start_metabox($mode_title . ' ' . pb_backupbuddy::video('MGiUdYb68ps', __('Scheduling', 'it-l10n-backupbuddy'), false), true, 'width: 100%;');
$schedule_form->display_settings('+ ' . $mode_title);
echo '<br><br>';
pb_backupbuddy::$ui->end_metabox();
if (count($schedules) == 0) {
    //echo '<h4>' . __( 'No schedules have been created yet.', 'it-l10n-backupbuddy' ) . '</h4>';
} else {
    pb_backupbuddy::$ui->list_table($schedules, array('action' => pb_backupbuddy::page_url(), 'columns' => array(__('Title', 'it-l10n-backupbuddy'), __('Profile', 'it-l10n-backupbuddy'), __('Interval', 'it-l10n-backupbuddy'), __('Destinations', 'it-l10n-backupbuddy'), __('Run Time', 'it-l10n-backupbuddy') . pb_backupbuddy::tip(__('First run indicates the first time thie schedule ran or will run.  Last run time is the last time that this scheduled backup started. This does not imply that the backup completed, only that it began at this time. The last run time is reset if the schedule is edited. Next run indicates when it is next scheduled to run. If there is no server activity during this time the schedule will be delayed.', 'it-l10n-backupbuddy'), '', false), __('Status', 'it-l10n-backupbuddy')), 'hover_actions' => array('edit' => 'Edit Schedule', 'run' => 'Run Now'), 'bulk_actions' => array('delete_schedule' => 'Delete'), 'css' => 'width: 100%;'));
}
echo '<br>';
?>




<br /><br />
<div class="description">
	<b>Note</b>: Due to the way schedules are triggered in WordPress your site must be accessed (frontend or admin area) for scheduled backups to occur.
	WordPress scheduled events ("crons") may be viewed or run manually for testing from the <a href="?page=pb_backupbuddy_server_info">Server Information page</a>.
	A <a href="https://www.google.com/search?q=free+website+uptime&oq=free+website+uptime" target="_new">free website uptime</a> service can be used to automatically access your site regularly to help trigger scheduled actions ("crons") in cases of low site activity, with the added perk of keeping track of your site uptime.
</div>
<br /><br />
Exemple #12
0
</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>';
if (empty($_GET['site_size'])) {
    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 href="' . pb_backupbuddy::page_url() . '&site_size=true#pb_backupbuddy_dir_size_listing" class="button secondary-button" style="margin-top: 3px;">', __('Display Directory Size Listing', 'it-l10n-backupbuddy'), '</a>';
} else {
    $exclusions = pb_backupbuddy_core::get_directory_exclusions();
    $result = pb_backupbuddy::$filesystem->dir_size_map(ABSPATH, ABSPATH, $exclusions, $dir_array);
    $total_size = pb_backupbuddy::$options['stats']['site_size'] = $result[0];
    $total_size_excluded = pb_backupbuddy::$options['stats']['site_size_excluded'] = $result[1];
    pb_backupbuddy::$options['stats']['site_size_updated'] = time();
    pb_backupbuddy::save();
    arsort($dir_array);
    ?>
	<table class="widefat">
		<thead>
			<tr class="thead">
				<?php 
    echo '<th>', __('Directory', 'it-l10n-backupbuddy'), '</th>', '<th>', __('Size with Children', 'it-l10n-backupbuddy'), '</th>', '<th>', __('Size with Exclusions', 'it-l10n-backupbuddy'), '</th>';
    ?>
Exemple #13
0
					if ( data != '1' ) {
						alert( '<?php _e('Error starting remote send of file to migrate', 'it-l10n-backupbuddy' ). ': ';?>' + data );
					} else {
						window.location.href = '<?php echo pb_backupbuddy::page_url(); ?>&destination=' + destination_id + '&destination_title=' + destination_title + '&callback_data=' + callback_data;
					}
				}
			);
			
			/* Try to ping server to nudge cron along since sometimes it doesnt trigger as expected. */
			jQuery.post( '<?php echo admin_url('admin-ajax.php'); ?>',
				function(data) {
				}
			);

		} else {
			window.location.href = '<?php echo pb_backupbuddy::page_url(); ?>&custom=remoteclient&destination_id=' + destination_id;
		}
	}
	
</script>



<style> 
	.graybutton {
		background: url(<?php echo pb_backupbuddy::plugin_url(); ?>/images/buttons/grays2.png) top repeat-x;
		min-width: 158px;
		height: 138px;
		display: block;
		float: left;
		-moz-border-radius: 6px;
Exemple #14
0
        $status .= '<a title="' . __('Backup Process Technical Details', 'it-l10n-backupbuddy') . '" href="' . pb_backupbuddy::ajax_url('backup_step_status') . '&serial=' . $backup['serial'] . '&#038;TB_iframe=1&#038;width=640&#038;height=600" class="thickbox">View Technical Details</a>';
        $status .= '</div>';
        // Calculate finish time (if finished).
        if ($backup['finish_time'] > 0) {
            $finish_time = pb_backupbuddy::$format->date(pb_backupbuddy::$format->localize_time($backup['finish_time'])) . '<br><span class="description">' . pb_backupbuddy::$format->time_ago($backup['finish_time']) . ' ago</span>';
        } else {
            // unfinished.
            $finish_time = '<i>Unfinished</i>';
        }
        // Append to list.
        $backups[$backup['serial']] = array(basename($backup['archive_file']), pb_backupbuddy::$format->date(pb_backupbuddy::$format->localize_time($backup['start_time'])) . '<br><span class="description">' . pb_backupbuddy::$format->time_ago($backup['start_time']) . ' ago</span>', $finish_time, $backup['trigger'], $status);
        $recent_backup_count++;
    }
    $columns = array(__('Backup', 'it-l10n-backupbuddy'), __('Started', 'it-l10n-backupbuddy'), __('Finished', 'it-l10n-backupbuddy'), __('Trigger', 'it-l10n-backupbuddy'), __('Status', 'it-l10n-backupbuddy'));
    $backups = array_reverse($backups);
    pb_backupbuddy::$ui->list_table($backups, array('action' => pb_backupbuddy::page_url(), 'columns' => $columns, 'css' => 'width: 100%;'));
    echo '<div class="alignright actions">';
    pb_backupbuddy::$ui->note('Hover over items above for additional options.');
    echo '</div>';
}
// end if recent backups exist.
pb_backupbuddy::$ui->end_tab();
pb_backupbuddy::$ui->end_tabs();
/********** END TABS **********/
echo '<br /><br />';
?>




Exemple #15
0
	if ( count( $messages[ 'errors' ] ) > 0 ) {
		$errors = true;
		require_once( '_step1.php' );
	}
	
} //end add site

// Upload paths, etc.
//$upload_path = $this->get_ms_option( $blog_id, 'upload_path' );
//$fileupload_url = $this->get_ms_option( $blog_id, 'fileupload_url' );

if ( count( $messages[ 'errors' ] ) <= 0 ) :
$form_url = add_query_arg( array(
	'step' => '3',
	'action' => 'step3'
) , pb_backupbuddy::page_url() );
?>
<form method="post" action="<?php echo esc_url( $form_url ); ?>">
<?php wp_nonce_field( 'bbms-migration', 'pb_bbms_migrate' ); ?>

<p><?php esc_html_e( 'Please verify that you are sure you would like to import the backed up site into the just-created blank site. This import cannot be undone.','it-l10n-backupbuddy' ); ?></p>
<p>
<?php
if ( is_subdomain_install() ) { 
	if ( domain_exists( $blog_domain, '/', $current_blog->blog_id ) ) {
		//$newdomain = $blog_domain;
		$newdomain = $domain;
		$path = $blog_domain . '/';
	} else {
		$path = $domain . '.' . preg_replace( '|^www\.|', '', $current_blog->domain );
	}
Exemple #16
0
							</td>
							<td style="white-space: nowrap;">
								<?php 
            $modified = strtotime($file['modified']);
            echo pb_backupbuddy::$format->date(pb_backupbuddy::$format->localize_time($modified));
            echo '<br /><span class="description">(' . pb_backupbuddy::$format->time_ago($modified) . ' ', __('ago', 'it-l10n-backupbuddy'), ')</span>';
            ?>
							</td>
							<td style="white-space: nowrap;">
								<?php 
            echo pb_backupbuddy::$format->file_size($file['bytes']);
            ?>
							</td>
							<td>
								<?php 
            echo '<a href="' . pb_backupbuddy::page_url() . '&custom=' . $_GET['custom'] . '&destination_id=' . $_GET['destination_id'] . '&#38;copy_file=' . $file['path'] . '">', __('Copy to local', 'it-l10n-backupbuddy'), '</a>';
            ?>
							</td>
						</tr>
						<?php 
        }
    }
}
?>
		</tbody>
	</table>
	<div class="tablenav">
		<div class="alignleft actions">
			<input type="submit" name="delete_file" value="<?php 
_e('Delete from Dropbox', 'it-l10n-backupbuddy');
?>
Exemple #17
0
        $backup_type = 'ImportBuddy Tool';
    } else {
        if (stristr($file, '/db/') !== false) {
            $backup_type = 'Database';
        } elseif (stristr($file, '/full/') !== false) {
            $backup_type = 'Full';
        } else {
            $backup_type = 'Unknown';
        }
    }
    // Generate array of table rows.
    $backup_list_temp[$last_modified] = array($file, 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]] = $backup_item;
    //str_replace( 'db/', '', str_replace( 'full/', '', $backup_item ) );
}
unset($backup_list_temp);
// Render table listing files.
if (count($backup_list) == 0) {
    echo '<b>';
    _e('You have not completed sending any backups to Amazon S3 for this site yet.', 'it-l10n-backupbuddy');
    echo '</b>';
} else {
    pb_backupbuddy::$ui->list_table($backup_list, array('action' => pb_backupbuddy::page_url() . '&custom=remoteclient&destination_id=' . htmlentities(pb_backupbuddy::_GET('destination_id')) . '&remote_path=' . htmlentities(pb_backupbuddy::_GET('remote_path')), '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('copy' => 'Copy to Local', 'download_link' => 'Get download link'), 'hover_action_column_key' => '0', 'bulk_actions' => array('delete_backup' => 'Delete'), 'css' => 'width: 100%;'));
}
// Display troubleshooting subscriber key.
echo '<br style="clear: both;">';
return;
Exemple #18
0
<?php 
pb_backupbuddy::$ui->title(__('BackupBuddy Schedules', 'it-l10n-backupbuddy'));
pb_backupbuddy::disalert('schedule_limit_reminder', '<span class="pb_label">Tip</span> ' . __('Keep old backups from piling up by configuring "Local Archive Storage Limits" on the Settings page.', 'it-l10n-backupbuddy'));
if (count($schedules) > 0 && pb_backupbuddy::_GET('edit') == '') {
    pb_backupbuddy::$ui->list_table($schedules, array('action' => pb_backupbuddy::page_url(), 'columns' => array(__('Title', 'it-l10n-backupbuddy'), __('Profile', 'it-l10n-backupbuddy'), __('Interval', 'it-l10n-backupbuddy'), __('Destinations', 'it-l10n-backupbuddy'), __('Run Time', 'it-l10n-backupbuddy') . pb_backupbuddy::tip(__('First run indicates the first time thie schedule ran or will run.  Last run time is the last time that this scheduled backup started. This does not imply that the backup completed, only that it began at this time. The last run time is reset if the schedule is edited. Next run indicates when it is next scheduled to run. If there is no server activity during this time the schedule will be delayed.', 'it-l10n-backupbuddy'), '', false), __('Status', 'it-l10n-backupbuddy')), 'hover_actions' => array('edit' => 'Edit Schedule', 'run' => 'Run Now'), 'bulk_actions' => array('delete_schedule' => 'Delete'), 'css' => 'width: 100%;'));
    echo '<br>';
}
if (pb_backupbuddy::_GET('edit') == '') {
    echo '<h3>' . __('Add New Schedule', 'it-l10n-backupbuddy') . '</h3>';
} else {
    echo '<h3>' . __('Edit Schedule', 'it-l10n-backupbuddy') . '</h3>';
}
$schedule_form->display_settings('+ ' . $mode_title);
if (pb_backupbuddy::_GET('edit') != '') {
    echo '<br><br><a href="' . pb_backupbuddy::page_url() . '&tab=1#database_replace" class="button secondary-button">&larr; ' . __('back', 'it-l10n-backupbuddy') . '</a>';
}
echo '<br><br>';
?>



<br /><br />
<div class="description">
	<b>Note</b>: Due to the way schedules are triggered in WordPress your site must be accessed (frontend or admin area) for scheduled backups to occur.
	WordPress scheduled events ("crons") may be viewed or run manually for testing from the <a href="?page=pb_backupbuddy_server_tools">Server Tools page</a>.
	A <a href="https://www.google.com/search?q=free+website+uptime&oq=free+website+uptime" target="_new">free website uptime</a> service can be used to automatically access your site regularly to help trigger scheduled actions ("crons") in cases of low site activity, with the added perk of keeping track of your site uptime.
</div>
<br /><br />

    $import_result = pb_backupbuddy::$classes['mysqlbuddy']->import($options['database_directory'] . 'db_1.sql', $options['old_prefix'], $db_continue, true);
    pb_backupbuddy::flush();
    $this->status('details', 'Actual import done.');
}
if ($import_result === true) {
    // Finished import.
    $form_url = add_query_arg(array('step' => '6', 'action' => 'step6'), pb_backupbuddy::page_url());
    $this->status('message', 'Database imported.');
} elseif ($import_result === false) {
    // Import Failed.
    $this->status('error', 'Fatal import failure. Error #3489343');
    die('Fatal import failure. Error #3489343');
} else {
    // Need to resume.
    $this->status('message', 'The database import is taking too long and must be broken up into multiple steps. Please continue to resume the import.');
    $form_url = add_query_arg(array('step' => '5', 'action' => 'step5', 'continue' => $import_result), pb_backupbuddy::page_url());
}
// ********** END IMPORT TABLES **********
echo '<script type="text/javascript">jQuery("#pb_importbuddy_working").hide();</script>';
pb_backupbuddy::flush();
if ($import_result === false) {
    echo '<p>' . __('Database import failed.', 'it-l10n-backupbuddy') . '</p>';
} else {
    global $current_site;
    $errors = false;
    $blog = $domain = $path = '';
    ?>
	
	<form method="post" action="<?php 
    echo esc_url($form_url);
    ?>
Exemple #20
0
 public function start()
 {
     $this->_started = true;
     if (pb_backupbuddy::page_url() != '') {
         $action_url = pb_backupbuddy::page_url() . '&' . $this->_additional_query_string;
     } else {
         $action_url = '?' . $this->_additional_query_string;
     }
     $return = '<form method="post" action="' . $action_url . '" class="pb_form" id="' . $this->_prefix . $this->_form_name . '_form">';
     $return .= '<input type="hidden" name="' . $this->_prefix . '" value="' . $this->_form_name . '">';
     return $return;
 }
    // 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>
Exemple #22
0
?>
&reset_disalerts=true&tab=2" class="button secondary-button"><?php 
_e('Reset Dismissed Alerts (' . count(pb_backupbuddy::$options['disalerts']) . ')', 'it-l10n-backupbuddy');
?>
</a>
	&nbsp;
</div>
<br style="clear: both;">
<span class="description"><?php 
_e('* Temporary files are normally automatically cleaned up on a regularly scheduled basis.', 'it-l10n-backupbuddy');
?>
</span>



<br><br><br>

<h3><?php 
_e('Extraneous Log', 'it-l10n-backupbuddy');
?>
</h3>

<b>Anything logged here is typically not important. Only provide to tech support if specifically requested.</b> By default only errors are logged. Enable Full Logging on the <a href="?page=pb_backupbuddy_settings&tab=1">Advanced Settings</a> tab.
<br><br>

<?php 
echo '<textarea readonly="readonly" style="width: 100%;" wrap="off" cols="65" rows="7" id="backupbuddy_logFile">';
echo '*** Loading log file. Please wait ...';
echo '</textarea>';
echo '<a href="' . pb_backupbuddy::page_url() . '&reset_log=true&tab=2" class="button secondary-button">' . __('Clear Log', 'it-l10n-backupbuddy') . '</a>';
echo '<br><br><br>';
Exemple #23
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;
    }
Exemple #24
0
 public 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(pb_backupbuddy::$options['backup_directory'] . $item)) {
                 if (@unlink(pb_backupbuddy::$options['backup_directory'] . $item) === true) {
                     $deleted_files[] = $item;
                     // Cleanup any related fileoptions files.
                     $serial = pb_backupbuddy::$classes['core']->get_serial_from_file($item);
                     $fileoptions_file = pb_backupbuddy::$options['log_directory'] . 'fileoptions/' . $serial . '.txt';
                     $fileoptions_filetree_file = pb_backupbuddy::$options['log_directory'] . 'fileoptions/' . $serial . '-filetree.txt';
                     if (file_exists($fileoptions_file)) {
                         if (false === @unlink($fileoptions_file)) {
                             pb_backupbuddy::status('error', 'Unable to delete fileoptions file `' . $fileoptions_file . '`.');
                         }
                     }
                     if (file_exists($fileoptions_file . '.lock')) {
                         if (false === @unlink($fileoptions_file . '.lock')) {
                             pb_backupbuddy::status('error', 'Unable to delete fileoptions file `' . $fileoptions_file . '.lock`.');
                         }
                     }
                     if (file_exists($fileoptions_filetree_file)) {
                         if (false === @unlink($fileoptions_filetree_file)) {
                             pb_backupbuddy::status('error', 'Unable to delete fileoptions file `' . $fileoptions_filetree_file . '`.');
                         }
                     }
                     $backup_files = glob(pb_backupbuddy::$options['backup_directory'] . '*.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 = $this->get_serial_from_file($item);
                         $fileoptions_file = pb_backupbuddy::$options['log_directory'] . '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(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.
                 }
             }
             $serial = pb_backupbuddy::$classes['core']->get_serial_from_file($file);
             // Populate integrity data structure in options.
             pb_backupbuddy::$classes['core']->backup_integrity_check($file);
             // 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');
             require_once pb_backupbuddy::plugin_path() . '/classes/fileoptions.php';
             $backup_options = new pb_backupbuddy_fileoptions(pb_backupbuddy::$options['log_directory'] . 'fileoptions/' . $serial . '.txt');
             if (true !== ($result = $backup_options->is_ok())) {
                 pb_backupbuddy::status('error', 'Error retrieving fileoptions file `' . pb_backupbuddy::$options['log_directory'] . 'fileoptions/' . $serial . '.txt' . '`. Err 4332345.');
             }
             // Verify valid fileoptions data exists.
             if (!is_array($backup_options->options)) {
                 // fileoptions data missing. try to regenerate with integrity check
                 pb_backupbuddy::status('details', 'Fileoptions data missing loading backup list. Re-scanning integrity to regenerate on file `' . $file . '`.');
                 pb_backupbuddy::$classes['core']->backup_integrity_check($file);
                 // Re-load fileoptions now.
                 $backup_options = new pb_backupbuddy_fileoptions(pb_backupbuddy::$options['log_directory'] . 'fileoptions/' . $serial . '.txt');
                 if (true !== ($result = $backup_options->is_ok())) {
                     pb_backupbuddy::status('error', 'Error retrieving fileoptions file `' . pb_backupbuddy::$options['log_directory'] . 'fileoptions/' . $serial . '.txt' . '`. Err 3278475845.');
                 }
             }
             $step_times = array();
             if (isset($backup_options->options['steps'])) {
                 foreach ($backup_options->options['steps'] as $step) {
                     if (isset($step['finish_time']) && $step['finish_time'] != 0) {
                         // Step time taken.
                         $step_times[] = $step['finish_time'] - $step['start_time'];
                     }
                 }
                 // End foreach.
             } else {
                 // End if serial in array is set.
                 $step_times[] = 'unknown';
             }
             // End if serial in array is NOT set.
             $step_times = implode(', ', $step_times);
             // Defaults...
             $detected_type = '';
             $file_size = '';
             $modified = '';
             $modified_time = 0;
             $integrity = '';
             $statistics = '';
             $write_speed = '';
             if (is_array($backup_options->options)) {
                 // Data intact... put it all together.
                 // Calculate time ago.
                 $time_ago = '';
                 if (isset($backup_options->options['integrity']) && isset($backup_options->options['integrity']['modified'])) {
                     $time_ago = '<span class="description">' . pb_backupbuddy::$format->time_ago($backup_options->options['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($backup_options->options['integrity']['comment']) && $backup_options->options['integrity']['comment'] !== false && $backup_options->options['integrity']['comment'] !== '') {
                     $main_string .= '<br><span class="description">Note: <span class="pb_backupbuddy_notetext">' . htmlentities($backup_options->options['integrity']['comment']) . '</span></span>';
                 }
                 $detected_type = pb_backupbuddy::$format->prettify($backup_options->options['integrity']['detected_type'], $pretty_type);
                 if (isset($backup_options->options['profile'])) {
                     $detected_type = $detected_type . '<br><small class="description">' . htmlentities($backup_options->options['profile']['title']) . '</small>';
                 }
                 $file_size = pb_backupbuddy::$format->file_size($backup_options->options['integrity']['size']);
                 $modified = pb_backupbuddy::$format->date(pb_backupbuddy::$format->localize_time($backup_options->options['integrity']['modified'])) . '<br>' . $time_ago;
                 $modified_time = $backup_options->options['integrity']['modified'];
                 if (isset($backup_options->options['integrity']['status'])) {
                     // Pre-v4.0.
                     $status = $backup_options->options['integrity']['status'];
                 } else {
                     // v4.0+
                     $status = $backup_options->options['integrity']['is_ok'];
                 }
                 $integrity = pb_backupbuddy::$format->prettify($status, $pretty_status) . ' <a href="' . pb_backupbuddy::page_url() . '&reset_integrity=' . $serial . '" title="Rescan integrity. Last checked ' . pb_backupbuddy::$format->date($backup_options->options['integrity']['scan_time']) . '."><img src="' . pb_backupbuddy::plugin_url() . '/images/refresh_gray.gif" style="vertical-align: -1px;"></a>' . '<div class="row-actions"><a title="' . __('Backup Details, Status, & Statistics', '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>';
             }
             // end if is_array( $backup_options ).
             $backups[basename($file)] = array(array(basename($file), $main_string), $detected_type, $file_size, $modified, $integrity);
             $backup_sort_dates[basename($file)] = $modified_time;
         }
         // 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 #25
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 #26
0
            }
            // End foreach.
            unset($item);
            unset($item_name);
        }
        // End foreach.
        unset($event);
        unset($hook_name);
    }
    // End if is_numeric.
}
// End foreach.
unset($cron_item);
unset($time);
// Display CRON table.
pb_backupbuddy::$ui->list_table($crons, array('action' => pb_backupbuddy::page_url() . '#pb_backupbuddy_getting_started_tab_tools', 'columns' => array(__('Event', 'it-l10n-backupbuddy'), __('Run Time', 'it-l10n-backupbuddy'), __('Period', 'it-l10n-backupbuddy'), __('Interval', 'it-l10n-backupbuddy'), __('Arguments', 'it-l10n-backupbuddy')), 'css' => 'width: 100%;', 'hover_actions' => array('run_cron' => 'Run cron job now'), 'bulk_actions' => array('delete_cron' => 'Delete'), 'hover_action_column_key' => '0'));
if (empty($_GET['show_cron_array'])) {
    echo '<br>';
    echo '<center>';
    echo '<a href="' . pb_backupbuddy::page_url() . '&show_cron_array=true#pb_backupbuddy_getting_started_tab_tools" style="text-decoration: none;">' . __('Display CRON Debugging Array', 'it-l10n-backupbuddy') . '</a> &middot; ' . __('Current Time', 'it-l10n-backupbuddy') . ': ' . pb_backupbuddy::$format->date(time() + get_option('gmt_offset') * 3600) . ' (' . time() . ')';
    echo '<br>';
    echo 'Additional cron control is available via the free plugin <a target="_new" href="http://wordpress.org/extend/plugins/wp-cron-control/">WP-Cron Control</a> by Automaticc.';
    echo '</center>';
} else {
    echo __('Current Time', 'it-l10n-backupbuddy') . ': ' . pb_backupbuddy::$format->date(time() + get_option('gmt_offset') * 3600) . ' (' . time() . ')';
    echo '<br><textarea readonly="readonly" style="width: 793px;" rows="13" cols="75" wrap="off">';
    print_r($cron);
    echo '</textarea>';
}
echo '<br>';
unset($cron);
    /*
    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 );
    	
    	
    }
    */
    pb_backupbuddy::$ui->list_table($backups, array('action' => pb_backupbuddy::page_url(), 'columns' => $columns, 'hover_actions' => $hover_actions, 'hover_action_column_key' => '0', 'bulk_actions' => $bulk_actions, 'css' => 'width: 100%;'));
}
Exemple #28
0
    public static function list_table($items, $settings)
    {
        $default_settings = array('columns' => array(), 'hover_actions' => array(), 'bulk_actions' => array(), 'hover_action_column_key' => '', 'action' => '', 'reorder' => '', 'after_bulk' => '', 'css' => '');
        // Merge defaults.
        $settings = array_merge($default_settings, $settings);
        // Function to iterate through bulk actions. Top and bottom set are the same.
        if (!function_exists('bulk_actions')) {
            function bulk_actions($settings, $hover_note = false)
            {
                if (count($settings['bulk_actions']) > 0) {
                    echo '<div style="padding-bottom: 3px; padding-top: 3px;">';
                    if (count($settings['bulk_actions']) == 1) {
                        foreach ($settings['bulk_actions'] as $action_slug => $action_title) {
                            echo '<input type="hidden" name="bulk_action" value="' . $action_slug . '">';
                            echo '<input type="submit" name="do_bulk_action" value="' . $action_title . '" class="button secondary-button">';
                        }
                    } else {
                        echo '<select name="bulk_action" class="actions">';
                        foreach ($settings['bulk_actions'] as $action_slug => $action_title) {
                            echo '<option>Bulk Actions</option>';
                            echo '<option value="' . $action_slug . '">' . $action_title . '</option>';
                        }
                        echo '</select> &nbsp;';
                        //echo self::button( '#', 'Apply' );
                        echo '<input type="submit" name="do_bulk_action" value="Apply" class="button secondary-button">';
                    }
                    echo '&nbsp;&nbsp;';
                    echo $settings['after_bulk'];
                    echo '<div class="alignright actions">';
                    if ($hover_note === true) {
                        echo pb_backupbuddy::$ui->note('Hover over items above for additional options.');
                    }
                    if ($settings['reorder'] != '') {
                        echo '	<input type="submit" name="save_order" id="save_order" value="Save Order" class="button-secondary" />';
                    }
                    echo '</div>';
                    echo '</div>';
                }
            }
            // End subfunction bulk_actions().
        }
        // End if function does not exist.
        if ($settings['action'] != '') {
            echo '<form method="post" action="' . $settings['action'] . '">';
            pb_backupbuddy::nonce();
            if ($settings['reorder'] != '') {
                echo '<input type="hidden" name="order" value="" id="pb_order">';
            }
        }
        echo '<div style="width: 70%; min-width: 720px; ' . $settings['css'] . '">';
        // Display bulk actions (top).
        bulk_actions($settings);
        echo '<table class="widefat"';
        echo ' id="test">';
        echo '		<thead>
					<tr class="thead">';
        if (count($settings['bulk_actions']) > 0) {
            echo '		<th scope="col" class="check-column"><input type="checkbox" class="check-all-entries" /></th>';
        }
        foreach ($settings['columns'] as $column) {
            echo '<th>' . $column . '</th>';
        }
        echo '		</tr>
				</thead>
			<tfoot>
				<tr class="thead">';
        if (count($settings['bulk_actions']) > 0) {
            echo '	<th scope="col" class="check-column"><input type="checkbox" class="check-all-entries" /></th>';
        }
        foreach ($settings['columns'] as $column) {
            echo '<th>' . $column . '</th>';
        }
        echo '	</tr>
			</tfoot>
			<tbody';
        if ($settings['reorder'] != '') {
            echo ' class="pb_reorder"';
        }
        echo '>';
        // LOOP THROUGH EACH ROW.
        foreach ((array) $items as $item_id => $item) {
            echo '	<tr class="entry-row alternate" id="pb_rowitem-' . $item_id . '">';
            if (count($settings['bulk_actions']) > 0) {
                echo '	<th scope="row" class="check-column"><input type="checkbox" name="items[]" class="entries" value="' . $item_id . '"></th>';
            }
            echo '		<td>';
            if (is_array($item['0'])) {
                if ($item['0'][1] == '') {
                    echo '&nbsp;';
                } else {
                    echo $item['0'][1];
                }
            } else {
                if ($item['0'] == '') {
                    echo '&nbsp;';
                } else {
                    echo $item['0'];
                }
            }
            echo '			<div class="row-actions">';
            //  style="margin:0; padding:0;"
            $i = 0;
            foreach ($settings['hover_actions'] as $action_slug => $action_title) {
                // Display all hover actions.
                $i++;
                if ($settings['hover_action_column_key'] != '') {
                    if (is_array($item[$settings['hover_action_column_key']])) {
                        $hover_action_column_value = $item[$settings['hover_action_column_key']][0];
                    } else {
                        $hover_action_column_value = $item[$settings['hover_action_column_key']];
                    }
                } else {
                    $hover_action_column_value = '';
                }
                if (strstr($action_slug, 'http') === false) {
                    // Word hover action slug.
                    $hover_link = pb_backupbuddy::page_url() . '&' . $action_slug . '=' . $item_id . '&value=' . $hover_action_column_value;
                } else {
                    // URL hover action slug so just append value to URL.
                    $hover_link = $action_slug . $hover_action_column_value;
                }
                echo '<a href="' . $hover_link . '" class="pb_' . pb_backupbuddy::settings('slug') . '_hoveraction_' . $action_slug . '" rel="' . $hover_action_column_value . '">' . $action_title . '</a>';
                if ($i < count($settings['hover_actions'])) {
                    echo ' | ';
                }
            }
            echo '			</div>
						</td>';
            if ($settings['reorder'] != '') {
                $count = count($item) + 1;
                // Extra row for reordering.
            } else {
                $count = count($item);
            }
            // LOOP THROUGH COLUMNS FOR THIS ROW.
            for ($i = 1; $i < $count; $i++) {
                echo '<td';
                if ($settings['reorder'] != '') {
                    if ($i == $settings['reorder']) {
                        echo ' class="pb_draghandle" align="center"';
                    }
                }
                echo '>';
                if ($settings['reorder'] != '' && $i == $settings['reorder']) {
                    echo '<img src="' . pb_backupbuddy::plugin_url() . '/pluginbuddy/images/draghandle.png" alt="Click and drag to reorder">';
                } else {
                    if ($item[$i] == '') {
                        echo '&nbsp;';
                    } else {
                        echo $item[$i];
                    }
                }
                echo '</td>';
            }
            echo '	</tr>';
        }
        echo '	</tbody>';
        echo '</table>';
        // Display bulk actions (bottom).
        bulk_actions($settings, true);
        echo '</div>';
        if ($settings['action'] != '') {
            echo '</form>';
        }
    }
            }
            // End foreach.
            unset($item);
            unset($item_name);
        }
        // End foreach.
        unset($event);
        unset($hook_name);
    }
    // End if is_numeric.
}
// End foreach.
unset($cron_item);
unset($time);
// Display CRON table.
pb_backupbuddy::$ui->list_table($crons, array('action' => pb_backupbuddy::page_url() . '#pb_backupbuddy_getting_started_tab_tools', 'columns' => array(__('Event', 'it-l10n-backupbuddy'), __('Run Time', 'it-l10n-backupbuddy'), __('Period', 'it-l10n-backupbuddy'), __('Interval', 'it-l10n-backupbuddy'), __('Arguments', 'it-l10n-backupbuddy')), 'css' => 'width: 100%;', 'hover_actions' => array('run_cron' => 'Run cron job now'), 'bulk_actions' => array('delete_cron' => 'Delete'), 'hover_action_column_key' => '0'));
if (empty($_GET['show_cron_array'])) {
    echo '<br>';
    echo '<center>';
    echo __('Current Time', 'it-l10n-backupbuddy') . ': ' . pb_backupbuddy::$format->date(time() + get_option('gmt_offset') * 3600) . ' (' . time() . '). ';
    echo 'Additional cron control is available via the free plugin <a target="_new" href="http://wordpress.org/extend/plugins/wp-cron-control/">WP-Cron Control</a> by Automaticc. ';
    echo '<a href="' . pb_backupbuddy::page_url() . '&tab=3&show_cron_array=true#pb_backupbuddy_getting_started_tab_tools" style="text-decoration: none;">' . __('Display CRON Debugging Array', 'it-l10n-backupbuddy') . '</a>';
    echo '</center>';
} else {
    echo __('Current Time', 'it-l10n-backupbuddy') . ': ' . pb_backupbuddy::$format->date(time() + get_option('gmt_offset') * 3600) . ' (' . time() . ')';
    echo '<br><textarea readonly="readonly" style="width: 793px;" rows="13" cols="75" wrap="off">';
    print_r($cron);
    echo '</textarea>';
}
echo '<br>';
unset($cron);
Exemple #30
0
        echo $backup;
        ?>
" /></th>
						<td>
							<?php 
        echo $backup;
        ?>
						</td>
						<td style="white-space: nowrap;">
							<?php 
        echo pb_backupbuddy::$format->file_size($size);
        ?>
						</td>
						<td>
							<?php 
        echo '<a href="' . pb_backupbuddy::page_url() . '&custom=' . $_GET['custom'] . '&destination_id=' . $_GET['destination_id'] . '&#38;copy_file=' . $backup . '">Copy to local</a>';
        ?>
						</td>
					</tr>
					<?php 
    }
}
?>
		</tbody>
	</table>
	<div class="tablenav">
		<div class="alignleft actions">
			<input type="submit" name="delete_file" value="<?php 
_e('Delete from FTP', 'it-l10n-backupbuddy');
?>
" class="button-secondary delete" />