Exemplo n.º 1
0
 function __construct($form_name, $save_point = '', $additional_query_string = '')
 {
     $this->_form_name = $form_name;
     $this->_save_point = $save_point;
     $this->_additional_query_string = $additional_query_string;
     $this->_prefix = 'pb_' . pb_backupbuddy::settings('slug') . '_';
 }
Exemplo n.º 2
0
 function api()
 {
     die('0');
     // TODO: Internal security lockout.
     if (!isset(pb_backupbuddy::$options['api_key_test']) || pb_backupbuddy::$options['api_key_test'] == '') {
         die('0');
     }
     if (pb_backupbuddy::$options['api_key_test'] != 'dsnfilasbfisybfdjybfjalybsfaklsbfa') {
         die('0');
     }
     $run = pb_backupbuddy::_POST('run');
     // TODO: TESTING temp allow GET method:
     if ('' == $run) {
         $run = pb_backupbuddy::_GET('run');
     }
     if ('' == $run) {
         die(json_encode(array('success' => false, 'error' => 'Error #489384: Missing run command.')));
     } else {
         if (false === ($return = call_user_func('backupbuddy_api::' . $run))) {
             die(json_encode(array('success' => false, 'error' => 'Error #328983: Command failed.')));
         } else {
             die(json_encode(array('success' => true, 'version' => pb_backupbuddy::settings('version'), 'data' => $return)));
         }
     }
     die;
 }
Exemplo n.º 3
0
 public function backup_step_status()
 {
     $serial = pb_backupbuddy::_GET('serial');
     pb_backupbuddy::load();
     pb_backupbuddy::$ui->ajax_header();
     echo '<h3>Backup Process Technical Details</h3>';
     echo '<b>Step Details:</b><br>';
     echo '<textarea style="width: 100%; height: 120px;" wrap="off">';
     foreach (pb_backupbuddy::$options['backups'][$serial]['steps'] as $step) {
         if ($step['function'] == 'send_remote_destination') {
             foreach ($step['args'] as $destination) {
                 echo "Remote destinations for this backup:\n`" . pb_backupbuddy::$options['remote_destinations'][$destination]['title'] . "` of type `" . pb_backupbuddy::$options['remote_destinations'][$destination]['type'] . "` with ID `{$destination}`.\n\n";
             }
         }
     }
     echo "Step details:\n";
     print_r(pb_backupbuddy::$options['backups'][$serial]);
     echo '</textarea><br><br>';
     // Output status log if it exists.
     $log_directory = WP_CONTENT_DIR . '/uploads/pb_' . pb_backupbuddy::settings('slug') . '/';
     $serial_file = $log_directory . 'status-' . $serial . '_' . pb_backupbuddy::$options['log_serial'] . '.txt';
     if (file_exists($serial_file)) {
         echo '<b>Log Details:</b><br>';
         echo '<textarea style="width: 100%; height: 120px;" wrap="off">';
         echo file_get_contents($serial_file);
         echo '</textarea><br><br>';
     }
     echo 'This information is primarily used for troubleshooting when working with support. If you are encountering problems providing this information to support may assist in troubleshooting.';
     pb_backupbuddy::$ui->ajax_footer();
     die;
 }
Exemplo n.º 4
0
 function __construct($form_name, $save_point_or_custom_mode, $additional_query_string = '', $custom_title_width = '')
 {
     $this->_form_name = $form_name;
     $this->_prefix = 'pb_' . pb_backupbuddy::settings('slug') . '_';
     $this->_savepoint = $save_point_or_custom_mode;
     $this->_custom_title_width = $custom_title_width;
     // TODO: no need to pass savepoint here? below:
     $this->_form = new pb_backupbuddy_form($form_name, $save_point_or_custom_mode, $additional_query_string);
 }
Exemplo n.º 5
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);
 }
Exemplo n.º 6
0
Arquivo: init.php Projeto: russtx/tac
 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;
 }
Exemplo n.º 7
0
 public static function run_periodic($backup_age_limit = 172800, $die_on_fail = true)
 {
     if (is_multisite()) {
         // For Multisite only run on main Network site.
         if (!is_main_site()) {
             return;
         }
     }
     pb_backupbuddy::status('message', 'Starting periodic housekeeeping procedure for BackupBuddy v' . pb_backupbuddy::settings('version') . '.');
     require_once pb_backupbuddy::plugin_path() . '/classes/core.php';
     require_once pb_backupbuddy::plugin_path() . '/classes/fileoptions.php';
     if (!isset(pb_backupbuddy::$options)) {
         pb_backupbuddy::load();
     }
     // Top priority. Security related or otherwise crucial to run first.
     self::no_recent_backup_reminder();
     backupbuddy_core::verify_directories($skipTempGeneration = true);
     // Verify directory existance and anti-directory browsing is in place everywhere.
     self::check_high_security_mode($die_on_fail);
     self::remove_importbuddy_file();
     self::remove_importbuddy_dir();
     self::remove_rollback_files();
     // Potential large file/dir cleanup. May bog down site.
     self::cleanup_temp_dir($backup_age_limit);
     self::remove_temp_zip_dirs($backup_age_limit);
     // Robustness -- handle re-processing timeouts, verifying schedules, etc.
     self::process_timed_out_backups();
     self::process_timed_out_sends();
     self::validate_bb_schedules_in_wp();
     // More minor cleanup.
     self::remove_temp_tables();
     self::remove_wp_schedules_with_no_bb_schedule();
     self::trim_old_notifications();
     self::trim_remote_send_stats();
     self::s3_cancel_multipart_pieces();
     self::s32_cancel_multipart_pieces();
     self::cleanup_local_destination_temp();
     self::purge_logs();
     self::purge_large_logs();
     self::clear_cron_send();
     // PHP tests.
     self::schedule_php_runtime_tests();
     self::schedule_php_memory_tests();
     @clearstatcache();
     // Clears file info stat cache.
     pb_backupbuddy::status('message', 'Finished periodic housekeeping cleanup procedure.');
 }
Exemplo n.º 8
0
 public function remoteAPI($endpoint)
 {
     $response = wp_remote_post($this->_state['apiURL'], array('method' => 'POST', 'timeout' => 10, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'headers' => array(), 'body' => array('backupbuddyVersion' => pb_backupbuddy::settings('version'), 'run' => $endpoint), 'cookies' => array()));
     if (is_wp_error($response)) {
         return $this->_error($response->get_error_message());
     } else {
         if (null === ($return = json_decode($response['body'], true))) {
             return $this->_error('Error #45434: Unable to decode json response `' . $response['body'] . '`.');
         } else {
             if (true !== $return['success']) {
                 return $this->_error('Error #3289379: API did not report success.');
             } else {
                 return $return['data'];
             }
         }
     }
 }
Exemplo n.º 9
0
 public function remoteAPI($endpoint)
 {
     $response = wp_remote_post($this->_state['apiURL'], array('method' => 'POST', 'timeout' => 10, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'headers' => array(), 'body' => array('backupbuddy_api' => 'true', 'api_key' => 'xxx', 'backupbuddy_version' => pb_backupbuddy::settings('version'), 'verb' => $endpoint), 'cookies' => array()));
     if (is_wp_error($response)) {
         return $this->_error($response->get_error_message());
     } else {
         if (null === ($return = json_decode($response['body'], true))) {
             return $this->_error('Error #4543664: Unable to decode json response. Verify remote site API URL, API key, and that the remote site has the API enabled. Return data: `' . htmlentities($response['body']) . '`.');
         } else {
             if (true !== $return['success']) {
                 return $this->_error('Error #3289379: API did not report success.');
             } else {
                 return $return['data'];
             }
         }
     }
 }
Exemplo n.º 10
0
    /**
     *	\WP_Widget::form() Override
     *
     *	Displays the widget form on the widget selection page for setting widget settings.
     *	Widget defaults are pre-merged into $instance right before this function is called.
     *	Use $widget->get_field_id() and $widget->get_field_name() to get field IDs and names for form elements.
     *	Anything to display should be echo'd out.
     *	@see WP_Widget class
     *
     *	@param		$instance	array		Associative array containing the options set previously in this form and/or the widget defaults (merged already).
     *	@return		null
     */
    function form($instance)
    {
        $instance = array_merge((array) pb_backupbuddy::settings('widget_defaults'), (array) $instance);
        if (empty(pb_backupbuddy::$options['groups'])) {
            echo 'You must create a PluginBuddy Carousel group to place this widget. Please do so within the plugin\'s page.';
        } else {
            ?>
			<label for="<?php 
            echo $this->get_field_id('group');
            ?>
">
				Carousel Group:
				<select class="widefat" id="<?php 
            echo $this->get_field_id('group');
            ?>
" name="<?php 
            echo $this->get_field_name('group');
            ?>
">
					<?php 
            foreach ((array) pb_backupbuddy::$options['groups'] as $id => $group) {
                if ($instance['group'] == $id) {
                    $select = ' selected ';
                } else {
                    $select = '';
                }
                echo '<option value="' . $id . '"' . $select . '>' . stripslashes($group['title']) . ' (' . count($group['images']) . ' images)</option>';
            }
            ?>
				</select>
			</label>
			
			<input type="hidden" id="<?php 
            echo $this->get_field_id('submit');
            ?>
" name="<?php 
            echo $this->get_field_name('submit');
            ?>
" value="1" />
			<?php 
        }
    }
Exemplo n.º 11
0
 public function backup_step_status()
 {
     $serial = pb_backupbuddy::_GET('serial');
     pb_backupbuddy::load();
     pb_backupbuddy::$ui->ajax_header();
     echo '<h3>Backup Process Technical Details</h3>';
     echo '<b>Step Details:</b><br>';
     echo '<textarea style="width: 100%; height: 120px;" wrap="off">';
     print_r(pb_backupbuddy::$options['backups'][$serial]);
     echo '</textarea><br><br>';
     // Output status log if it exists.
     $log_directory = WP_CONTENT_DIR . '/uploads/pb_' . pb_backupbuddy::settings('slug') . '/';
     $serial_file = $log_directory . 'status-' . $serial . '_' . pb_backupbuddy::$options['log_serial'] . '.txt';
     if (file_exists($serial_file)) {
         echo '<b>Log Details:</b><br>';
         echo '<textarea style="width: 100%; height: 120px;" wrap="off">';
         echo file_get_contents($serial_file);
         echo '</textarea><br><br>';
     }
     echo 'This information is primarily used for troubleshooting when working with support. If you are encountering problems providing this information to support may assist in troubleshooting.';
     pb_backupbuddy::$ui->ajax_footer();
     die;
 }
Exemplo n.º 12
0
    }
    array_push($tests, $parent_class_test);
    // Set up ZipBuddy when within BackupBuddy
    require_once pb_backupbuddy::plugin_path() . '/lib/zipbuddy/zipbuddy.php';
    pb_backupbuddy::$classes['zipbuddy'] = new pluginbuddy_zipbuddy(backupbuddy_core::getBackupDirectory());
    require_once pb_backupbuddy::plugin_path() . '/lib/mysqlbuddy/mysqlbuddy.php';
    global $wpdb;
    pb_backupbuddy::$classes['mysqlbuddy'] = new pb_backupbuddy_mysqlbuddy(DB_HOST, DB_NAME, DB_USER, DB_PASSWORD, $wpdb->prefix);
    // $database_host, $database_name, $database_user, $database_pass, $old_prefix, $force_method = array()
}
// PHP VERSION
if (!defined('pluginbuddy_importbuddy')) {
    $php_minimum = pb_backupbuddy::settings('php_minimum');
} else {
    // importbuddy value.
    $php_minimum = pb_backupbuddy::settings('php_minimum');
}
$parent_class_test = array('title' => 'PHP Version', 'suggestion' => '>= ' . $php_minimum . ' (5.2.16+ best)', 'value' => phpversion(), 'tip' => __('Version of PHP currently running on this site.', 'it-l10n-backupbuddy'));
if (version_compare(PHP_VERSION, $php_minimum, '<=')) {
    $parent_class_test['status'] = __('FAIL', 'it-l10n-backupbuddy');
} else {
    $parent_class_test['status'] = __('OK', 'it-l10n-backupbuddy');
}
array_push($tests, $parent_class_test);
// PHP max_execution_time
$parent_class_test = array('title' => 'PHP max_execution_time (server-reported)', 'suggestion' => '>= ' . '30 seconds (30+ best)', 'value' => ini_get('max_execution_time'), 'tip' => __('Maximum amount of time that PHP allows scripts to run. After this limit is reached the script is killed. The more time available the better. 30 seconds is most common though 60 seconds is ideal.', 'it-l10n-backupbuddy'));
if (str_ireplace('s', '', ini_get('max_execution_time')) < 30) {
    $parent_class_test['status'] = __('WARNING', 'it-l10n-backupbuddy');
} else {
    $parent_class_test['status'] = __('OK', 'it-l10n-backupbuddy');
}
<?php

if (!is_admin()) {
    die('Access denied.');
}
// Display site size listing in table.
/* site_size_listing()
 *
 * Display site site listing on Server Info page.
 *
 */
$profile_id = 0;
if (is_numeric(pb_backupbuddy::_GET('profile'))) {
    if (isset(pb_backupbuddy::$options['profiles'][pb_backupbuddy::_GET('profile')])) {
        $profile_id = pb_backupbuddy::_GET('profile');
        pb_backupbuddy::$options['profiles'][pb_backupbuddy::_GET('profile')] = array_merge(pb_backupbuddy::settings('profile_defaults'), pb_backupbuddy::$options['profiles'][pb_backupbuddy::_GET('profile')]);
        // Set defaults if not set.
    } else {
        pb_backupbuddy::alert('Error #45849458b: Invalid profile ID number `' . htmlentities(pb_backupbuddy::_GET('profile')) . '`. Displaying with default profile.', true);
    }
}
echo '<!-- profile: ' . $profile_id . ' -->';
$exclusions = backupbuddy_core::get_directory_exclusions(pb_backupbuddy::$options['profiles'][$profile_id]);
$result = pb_backupbuddy::$filesystem->dir_size_map(ABSPATH, ABSPATH, $exclusions, $dir_array);
if (0 == $result) {
    pb_backupbuddy::alert('Error #5656653. Unable to access directory map listing for directory `' . ABSPATH . '`.');
    die;
}
$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();
Exemplo n.º 14
0
 public static function addNotification($slug, $title, $message, $data = array(), $urgent = false, $time = '')
 {
     if ('' == $time) {
         $time = time();
     }
     // Create this new notification data.
     $notification = array('slug' => $slug, 'time' => $time, 'title' => $title, 'message' => $message, 'data' => $data, 'urgent' => false);
     $notification = array_merge(pb_backupbuddy::settings('notification_defaults'), $notification);
     // Apply defaults.
     // Load current notifications.
     $notificationArray = self::getNotifications();
     // Add to current notifications.
     $notificationArray[] = $notification;
     // Save.
     self::replaceNotifications($notificationArray);
 }
 public static function remoteCall($remoteAPI, $verb, $moreParams = array(), $timeout, $file = '', $fileData = '', $seekTo = '', $isFileTest = '', $isFileDone = false, $fileSize = '', $filePath = '', $returnRaw = false)
 {
     pb_backupbuddy::status('details', 'Preparing remote API call verb `' . $verb . '`.');
     $now = time();
     $body = array('backupbuddy_api_key' => $remoteAPI['key_public'], 'backupbuddy_version' => pb_backupbuddy::settings('version'), 'verb' => $verb, 'now' => $now);
     if (!is_numeric($timeout)) {
         $timeout = backupbuddy_constants::DEPLOYMENT_REMOTE_API_DEFAULT_TIMEOUT;
     }
     pb_backupbuddy::status('details', 'remoteCall() HTTP wait timeout: `' . $timeout . '` seconds.');
     $filecrc = '';
     if ('' != $file) {
         pb_backupbuddy::status('details', 'Remote API sending file `' . $file . '`.');
         $fileData = base64_encode($fileData);
         // Sadly we cannot safely transmit binary data over curl without using an actual file. base64 encoding adds 37% size overhead.
         $filecrc = sprintf("%u", crc32($fileData));
         $body['filename'] = basename($file);
         if ('' != $filePath) {
             $body['filepath'] = $filePath;
         }
         $body['filedata'] = $fileData;
         $body['filedatalen'] = strlen($fileData);
         $body['filecrc'] = $filecrc;
         if (true === $isFileTest) {
             $body['filetest'] = '1';
         } else {
             $body['filetest'] = '0';
         }
         if (true === $isFileDone) {
             $body['filedone'] = '1';
         } else {
             $body['filedone'] = '0';
         }
         $body['seekto'] = $seekTo;
         // Location to seek to before writing this part.
         if ('' != $fileSize) {
             $body['filetotalsize'] = $fileSize;
         }
     }
     if (!is_array($moreParams)) {
         error_log('BackupBuddy Error #4893783447 remote_api.php; $moreParams must be passed as array.');
     }
     $body = array_merge($body, $moreParams);
     //print_r( $apiKey );
     $body['signature'] = md5($now . $verb . $remoteAPI['key_public'] . $remoteAPI['key_secret'] . $filecrc);
     if (defined('BACKUPBUDDY_DEV') && true === BACKUPBUDDY_DEV) {
         error_log('BACKUPBUDDY_DEV-remote api http body SEND- ' . print_r($body, true));
     }
     $response = wp_remote_post($remoteAPI['siteurl'], array('method' => 'POST', 'timeout' => $timeout - 2, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'headers' => array('Referer' => $remoteAPI['siteurl']), 'body' => $body, 'cookies' => array()));
     if (is_wp_error($response)) {
         return self::_error('Error #9037: Unable to connect to remote server or unexpected response. Details: `' . $response->get_error_message() . '` - URL: `' . $remoteAPI['siteurl'] . '`.');
     } else {
         if (true === $returnRaw) {
             return $response['body'];
         }
         //error_log( '3333Response: ' . $response['body'] );
         if (null === ($return = json_decode($response['body'], true))) {
             return self::_error('Error #8001: Unable to decode json response. Verify remote site API URL `' . $remoteAPI['siteurl'] . '`, API key, and that the remote site has the API enabled in its wp-config.php by adding <i>define( \'BACKUPBUDDY_API_ENABLE\', true );</i> somewhere ABOVE the line "That\'s all, stop editing!". Return data: `' . htmlentities(stripslashes_deep($response['body'])) . '`.');
         } else {
             if (!isset($return['success']) || true !== $return['success']) {
                 // Fail.
                 $error = '';
                 if (isset($return['error'])) {
                     $error = $return['error'];
                 } else {
                     $error = 'Error #838438734: No error given. Full response: "' . $return . '".';
                 }
                 return self::_error('Error #3289379: API did not report success. Error details: `' . $error . '`.');
             } else {
                 // Success.
                 if (isset($return['message'])) {
                     pb_backupbuddy::status('details', 'Response message from API: ' . $return['message'] . '".');
                 }
                 return $return;
             }
         }
     }
 }
Exemplo n.º 16
0
    /**
     *	\WP_Widget::form() Override
     *
     *	Displays the widget form on the widget selection page for setting widget settings.
     *	Widget defaults are pre-merged into $instance right before this function is called.
     *	Use $widget->get_field_id() and $widget->get_field_name() to get field IDs and names for form elements.
     *	Anything to display should be echo'd out.
     *	@see WP_Widget class
     *
     *	@param		$instance	array		Associative array containing the options set previously in this form and/or the widget defaults (merged already).
     *	@return		null
     */
    function form($instance)
    {
        $instance = array_merge((array) pb_backupbuddy::settings('widget_defaults'), (array) $instance);
        ?>
		<label for="<?php 
        echo $this->get_field_id('title');
        ?>
">Title:
			<input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo $instance['title'];
        ?>
" />
		</label>
		<label for="<?php 
        echo $this->get_field_id('posts');
        ?>
">Number of posts to display in list:
			<input class="widefat" id="<?php 
        echo $this->get_field_id('posts');
        ?>
" name="<?php 
        echo $this->get_field_name('posts');
        ?>
" type="text" value="<?php 
        echo $instance['posts'];
        ?>
" />
		</label>
		<label for="<?php 
        echo $this->get_field_id('width');
        ?>
">Max width of widget (in percent) <?php 
        pb_backupbuddy::tip('Maximum width in percent to allow this to use. If you want to limit the width or correct for padding issues, reduce this number to a lower percent. Valid values are 1 to 100.');
        ?>
 :
			<input class="widefat" id="<?php 
        echo $this->get_field_id('width');
        ?>
" name="<?php 
        echo $this->get_field_name('width');
        ?>
" type="text" value="<?php 
        echo $instance['width'];
        ?>
" />
		</label>
		<label for="<?php 
        echo $this->get_field_id('truncate');
        ?>
">Max characters in post title <?php 
        pb_backupbuddy::tip('Maximum number of characters to display from a post title before truncating and adding an elipses (...). This must be a number. Default: 60');
        ?>
 :
			<input class="widefat" id="<?php 
        echo $this->get_field_id('truncate');
        ?>
" name="<?php 
        echo $this->get_field_name('truncate');
        ?>
" type="text" value="<?php 
        echo $instance['truncate'];
        ?>
" />
		</label>
					
		<input type="hidden" id="<?php 
        echo $this->get_field_id('submit');
        ?>
" name="<?php 
        echo $this->get_field_name('submit');
        ?>
" value="1" />
		<?php 
    }
Exemplo n.º 17
0
    $_POST['pb_backupbuddy_importbuddy_pass_hash_confirm'] = '';
    $importbuddy_pass_match_fail = true;
}
/* END VERIFYING PASSWORD CONFIRMATIONS MATCH */
/* BEGIN REPLACING IMPORTBUDDY/REPAIRBUDDY_PASS_HASH WITH VALUE OF ACTUAL HASH */
// ImportBuddy hash replace.
if (str_replace(')', '', pb_backupbuddy::_POST('pb_backupbuddy_importbuddy_pass_hash')) != '' && md5(pb_backupbuddy::_POST('pb_backupbuddy_importbuddy_pass_hash')) != pb_backupbuddy::$options['importbuddy_pass_hash']) {
    //echo 'posted value: ' . pb_backupbuddy::_POST( 'pb_backupbuddy_importbuddy_pass_hash' ) . '<br>';
    //echo 'hash: ' . md5( pb_backupbuddy::_POST( 'pb_backupbuddy_importbuddy_pass_hash' ) ) . '<br>';
    pb_backupbuddy::$options['importbuddy_pass_length'] = strlen(pb_backupbuddy::_POST('pb_backupbuddy_importbuddy_pass_hash'));
    $_POST['pb_backupbuddy_importbuddy_pass_hash'] = md5(pb_backupbuddy::_POST('pb_backupbuddy_importbuddy_pass_hash'));
} else {
    // Keep the same.
    if ($importbuddy_pass_match_fail !== true) {
        // keep the same
        $_POST['pb_backupbuddy_importbuddy_pass_hash'] = pb_backupbuddy::$options['importbuddy_pass_hash'];
    }
}
// Set importbuddy dummy text to display in form box. Equal length to the provided password.
$data['importbuddy_pass_dummy_text'] = str_pad('', pb_backupbuddy::$options['importbuddy_pass_length'], ')');
/* BEGIN SAVE MULTISITE SPECIFIC SETTINGS IN SET OPTIONS SO THEY ARE AVAILABLE GLOBALLY */
if (is_multisite()) {
    // Save multisite export option to the global site/network options for global retrieval.
    $options = get_site_option('pb_' . pb_backupbuddy::settings('slug'));
    $options['multisite_export'] = pb_backupbuddy::_POST('pb_backupbuddy_multisite_export');
    update_site_option('pb_' . pb_backupbuddy::settings('slug'), $options);
    unset($options);
}
/* END SAVE MULTISITE SPECIFIC SETTINGS IN SET OPTIONS SO THEY ARE AVAILABLE GLOBALLY */
// Load settings view.
pb_backupbuddy::load_view('settings', $data);
Exemplo n.º 18
0
		$multisite_export = $options[ 'multisite_export' ];
		unset( $options );

		if ( $multisite_export == '1' ) { // Settings enable admins to export. Set capability to admin and higher only.
			$capability = 'administrator';
			$export_title = '<span title="Note: Enabled for both subsite Admins and Network Superadmins based on BackupBuddy settings">Export Site</span>';
		} else { // Settings do NOT allow admins to export; set capability for superadmins only.
			$capability = 'manage_network';
			$export_title = '<span title="Note: Enabled for Network Superadmins only based on BackupBuddy settings">Export Site (SA)</span>';
		}
				
		//pb_backupbuddy::add_page( '', 'getting_started', array( pb_backupbuddy::settings( 'name' ), 'Getting Started' . $export_note ), $capability );
		pb_backupbuddy::add_page( '', 'multisite_export', $export_title, $capability );
	}
} else { // Standalone site.
	pb_backupbuddy::add_page( '', 'getting_started', array( pb_backupbuddy::settings( 'name' ), 'Getting Started' ) );
	pb_backupbuddy::add_page( 'getting_started', 'backup', __( 'Backup', 'it-l10n-backupbuddy' ), 'administrator' );
	pb_backupbuddy::add_page( 'getting_started', 'migrate_restore', __( 'Migrate, Restore', 'it-l10n-backupbuddy' ), 'administrator' );
	pb_backupbuddy::add_page( 'getting_started', 'malware_scan', __( 'Malware Scan', 'it-l10n-backupbuddy' ), 'administrator' );
	pb_backupbuddy::add_page( 'getting_started', 'server_info', __( 'Server Information', 'it-l10n-backupbuddy' ), 'administrator' );
	//pb_backupbuddy::add_page( 'getting_started', 'server_tools', __( 'Server Tools', 'it-l10n-backupbuddy' ), 'administrator' );
	pb_backupbuddy::add_page( 'getting_started', 'scheduling', __( 'Scheduling', 'it-l10n-backupbuddy' ), 'administrator' );
	pb_backupbuddy::add_page( 'getting_started', 'settings', __( 'Settings', 'it-l10n-backupbuddy' ), 'administrator' );
}



/********** LIBRARIES & CLASSES (admin) **********/


Exemplo n.º 19
0
            } else {
                // Settings do NOT allow admins to export; set capability for superadmins only.
                $capability = 'manage_network';
                $export_title = '<span title="Note: Enabled for Network Superadmins only based on BackupBuddy settings">' . __('MS Export SA (experimental)', 'it-l10n-backupbuddy') . '</span>';
            }
            //pb_backupbuddy::add_page( '', 'getting_started', array( pb_backupbuddy::settings( 'name' ), 'Getting Started' . $export_note ), $capability );
            pb_backupbuddy::add_page('', 'multisite_export', $export_title, $capability, $icon);
            pb_backupbuddy::add_page('multisite_export', 'malware_scan', __('Malware Scan', 'it-l10n-backupbuddy'), $capability);
        }
    } else {
        // PB_BACKUPBUDDY_MULTISITE_EXPERIMENT not in wp-config / set to TRUE.
        pb_backupbuddy::status('error', 'Multisite detected but PB_BACKUPBUDDY_MULTISITE_EXPERIMENT definition not found in wp-config.php / not defined to boolean TRUE.');
    }
} else {
    // Standalone site.
    pb_backupbuddy::add_page('', 'backup', array(pb_backupbuddy::settings('name'), __('Backup', 'it-l10n-backupbuddy')), pb_backupbuddy::$options['role_access'], $icon);
    pb_backupbuddy::add_page('backup', 'migrate_restore', __('Restore / Migrate', 'it-l10n-backupbuddy'), pb_backupbuddy::$options['role_access']);
    pb_backupbuddy::add_page('backup', 'destinations', __('Remote Destinations', 'it-l10n-backupbuddy'), pb_backupbuddy::$options['role_access']);
    //pb_backupbuddy::add_page( 'backup', 'deploy', __( 'Deployments', 'it-l10n-backupbuddy' ), pb_backupbuddy::$options['role_access'] );
    pb_backupbuddy::add_page('backup', 'server_tools', __('Server Tools', 'it-l10n-backupbuddy'), pb_backupbuddy::$options['role_access']);
    pb_backupbuddy::add_page('backup', 'malware_scan', __('Malware Scan', 'it-l10n-backupbuddy'), pb_backupbuddy::$options['role_access']);
    pb_backupbuddy::add_page('backup', 'scheduling', __('Schedules', 'it-l10n-backupbuddy'), pb_backupbuddy::$options['role_access']);
    pb_backupbuddy::add_page('backup', 'settings', __('Settings', 'it-l10n-backupbuddy'), pb_backupbuddy::$options['role_access']);
}
/********** LIBRARIES & CLASSES (admin) **********/
/********** OTHER (admin) **********/
add_filter('contextual_help', 'pb_backupbuddy_contextual_help', 10, 3);
function pb_backupbuddy_contextual_help($contextual_help, $screen_id, $screen)
{
    // Loads help from file in controllers/help/:PAGENAME:.php
    // WordPress pre-v3.3 so no contextual help.
Exemplo n.º 20
0
		</div>
		<br style="clear: both;">
		<div id="pluginbuddy_debugtoggle_div" style="display: none;">
			<?php 
pb_backupbuddy::$ui->start_metabox(__('Raw Settings (debugging)', 'it-l10n-backupbuddy'), true, 'width: 100%;');
?>
			<h4><?php 
_e('Raw Settings for Debugging', 'it-l10n-backupbuddy');
?>
</h4>
			<?php 
$temp_options = pb_backupbuddy::$options;
$temp_options['importbuddy_pass_hash'] = '*hidden*';
$temp_options['repairbuddy_pass_hash'] = '*hidden*';
echo '<textarea rows="7" cols="65" style="width: 100%;" wrap="off" readonly="readonly">';
echo 'Plugin Version = ' . pb_backupbuddy::settings('name') . ' ' . pb_backupbuddy::settings('version') . ' (' . pb_backupbuddy::settings('slug') . ')' . "\n";
echo 'WordPress Version = ' . get_bloginfo("version") . "\n";
echo 'PHP Version = ' . phpversion() . "\n";
global $wpdb;
echo 'DB Version = ' . $wpdb->db_version() . "\n";
echo "\n" . print_r($temp_options);
echo '</textarea>';
pb_backupbuddy::$ui->end_metabox();
?>
		</div>
		
		<br><br><br>
		
		
		<?php 
pb_backupbuddy::$ui->end_tab();
Exemplo n.º 21
0
 function periodic_cleanup($backup_age_limit = 43200, $die_on_fail = true)
 {
     if (!isset(pb_backupbuddy::$options)) {
         $this->load();
     }
     // TODO: Check for orphaned .gz files in root from PCLZip.
     // TODO: Cleanup any orphaned temp ZIP creation directories under the backups directory. wp-content/uploads/backupbuddy_backups/temp_zip_XXSERIALXX/
     // Cleanup backup itegrity portion of array.
     $this->trim_backups_integrity_stats();
     // Cleanup logs in pb_backupbuddy dirctory.
     $log_directory = WP_CONTENT_DIR . '/uploads/pb_' . pb_backupbuddy::settings('slug') . '/';
     $files = glob($log_directory . '*.txt');
     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.
         foreach ($files as $file) {
             $file_stats = stat($file);
             if (time() - $file_stats['mtime'] > $backup_age_limit) {
                 // If older than 12 hours, delete the log.
                 @unlink($file);
             }
         }
     }
     // Cleanup excess backup stats.
     if (count(pb_backupbuddy::$options['backups']) > 3) {
         // Keep a minimum number of backups in array for stats.
         $number_backups = count(pb_backupbuddy::$options['backups']);
         $kept_loop_count = 0;
         $needs_save = false;
         foreach (pb_backupbuddy::$options['backups'] as $backup_serial => $backup) {
             if ($number_backups - $kept_loop_count > 3) {
                 if (isset($backup['archive_file']) && !file_exists($backup['archive_file'])) {
                     unset(pb_backupbuddy::$options['backups'][$backup_serial]);
                     $needs_save = true;
                 } else {
                     $kept_loop_count++;
                 }
             }
         }
         if ($needs_save === true) {
             //echo 'saved';
             pb_backupbuddy::save();
         }
     }
     // Cleanup any temporary local destinations.
     foreach (pb_backupbuddy::$options['remote_destinations'] as $destination_id => $destination) {
         if ($destination['type'] == 'local' && $destination['temporary'] === true) {
             // If local and temporary.
             if (time() - $destination['created'] > $backup_age_limit) {
                 // Older than 12 hours; clear out!
                 pb_backupbuddy::status('details', 'Cleaned up stale local destination `' . $destination_id . '`.');
                 unset(pb_backupbuddy::$options['remote_destinations'][$destination_id]);
                 pb_backupbuddy::save();
             }
         }
     }
     // Cleanup excess remote sending stats.
     $this->trim_remote_send_stats();
     // Check for orphaned backups in the data structure that havent been updates in 12+ hours & cleanup after them.
     foreach ((array) pb_backupbuddy::$options['backups'] as $backup_serial => $backup) {
         if (isset($backup['updated_time'])) {
             if (time() - $backup['updated_time'] > $backup_age_limit) {
                 // If more than 12 hours has passed...
                 pb_backupbuddy::status('details', 'Cleaned up stale backup `' . $backup_serial . '`.');
                 $this->final_cleanup($backup_serial);
             }
         }
     }
     // Verify existance of anti-directory browsing files in backup directory.
     pb_backupbuddy::anti_directory_browsing(pb_backupbuddy::$options['backup_directory'], $die_on_fail);
     // Verify existance of anti-directory browsing files in status log directory.
     $status_directory = WP_CONTENT_DIR . '/uploads/pb_' . pb_backupbuddy::settings('slug') . '/';
     pb_backupbuddy::anti_directory_browsing($status_directory, $die_on_fail);
     // Handle high security mode archives directory .htaccess system. If high security backup directory mode: Make sure backup archives are NOT downloadable by default publicly. This is only lifted for ~8 seconds during a backup download for security. Overwrites any existing .htaccess in this location.
     if (pb_backupbuddy::$options['lock_archives_directory'] == '0') {
         // Normal security mode. Put normal .htaccess.
         pb_backupbuddy::status('details', 'Removing .htaccess high security mode for backups directory. Normal mode .htaccess to be added next.');
         // Remove high security .htaccess.
         if (file_exists(pb_backupbuddy::$options['backup_directory'] . '.htaccess')) {
             $unlink_status = @unlink(pb_backupbuddy::$options['backup_directory'] . '.htaccess');
             if ($unlink_status === false) {
                 pb_backupbuddy::alert('Error #844594. Unable to temporarily remove .htaccess security protection on archives directory to allow downloading. Please verify permissions of the BackupBuddy archives directory or manually download via FTP.');
             }
         }
         // Place normal .htaccess.
         pb_backupbuddy::anti_directory_browsing(pb_backupbuddy::$options['backup_directory'], $die_on_fail);
     } else {
         // High security mode. Make sure high security .htaccess in place.
         pb_backupbuddy::status('details', 'Adding .htaccess high security mode for backups directory.');
         $htaccess_creation_status = @file_put_contents(pb_backupbuddy::$options['backup_directory'] . '.htaccess', 'deny from all');
         if ($htaccess_creation_status === false) {
             pb_backupbuddy::alert('Error #344894545. Security Warning! Unable to create security file (.htaccess) in backups archive directory. This file prevents unauthorized downloading of backups should someone be able to guess the backup location and filenames. This is unlikely but for best security should be in place. Please verify permissions on the backups directory.');
         }
     }
     // Verify existance of anti-directory browsing files in temporary directory.
     pb_backupbuddy::anti_directory_browsing(pb_backupbuddy::$options['temp_directory'], $die_on_fail);
     // Remove any copy of importbuddy.php in root.
     if (file_exists(ABSPATH . 'importbuddy.php')) {
         pb_backupbuddy::status('details', 'Unlinked importbuddy.php in root of site.');
         unlink(ABSPATH . 'importbuddy.php');
     }
     // Remove any copy of importbuddy directory in root.
     if (file_exists(ABSPATH . 'importbuddy/')) {
         pb_backupbuddy::status('details', 'Unlinked importbuddy directory recursively in root of site.');
         pb_backupbuddy::$filesystem->unlink_recursive(ABSPATH . 'importbuddy/');
     }
 }
Exemplo n.º 22
0
 public static function settings($type)
 {
     //if ( !self::blank( @self::$_settings[$type] ) ) { // Return value if it already exists.
     if (isset(self::$_settings[$type])) {
         return self::$_settings[$type];
     }
     // The variable does not exist so check to see if it can be extracted from the plugin's header.
     //if ( self::blank( @self::$_settings['name'] ) ) {
     if (!isset(self::$_settings['name']) || self::$_settings['name'] == '') {
         if (!function_exists('get_plugin_data')) {
             require_once ABSPATH . 'wp-admin/includes/plugin.php';
         }
         $info = array_change_key_case(get_plugin_data(self::$_plugin_path . '/' . pb_backupbuddy::settings('init'), false, false), CASE_LOWER);
         $info['url'] = $info['pluginuri'];
         unset($info['pluginuri']);
         self::$_settings = array_merge(self::$_settings, $info);
     }
     // Try to return setting otherwise throw an error.
     if (isset(self::$_settings[$type])) {
         return self::$_settings[$type];
     } else {
         return '{Unknown settings() variable `' . $type . '`}';
     }
 }
Exemplo n.º 23
0
        }
        echo '<form method="post" action="' . pb_backupbuddy::ajax_url('destination_picker') . '&add=dropbox2&callback_data=' . pb_backupbuddy::_GET('callback_data') . '">';
        echo '<br><b>Adding a Dropbox destination</b><ol>';
        echo '<li> <a href="' . $authorizeUrl . '" class="button-primary pb_dropbox_authorize" target="_new">' . __('Connect to Dropbox.com & Authorize (opens new window)', 'it-l10n-backupbuddy') . '</a></li>';
        echo '<li>Click <b>Allow</b> in the new window (you may need to login to Dropbox.com first).</li>';
        echo '<li>Enter the provided <b>Authorization Code</b>: <input type="text" name="dropbox_authorization_code" size="45"></li>';
        echo '<li><input type="submit" class="button-primary" value="' . __("Yes, I've Authorized BackupBuddy with Dropbox & Entered the Code above", 'it-l10n-backupbuddy') . '"></li>';
        echo '</ol>';
        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 {
Exemplo n.º 24
0
    public function restore_file_restore()
    {
        $files = pb_backupbuddy::_GET('files');
        // file to extract.
        $files_array = explode(',', $files);
        $files = array();
        foreach ($files_array as $file) {
            if (substr($file, -1) == '/') {
                // If directory then add wildcard.
                $file = $file . '*';
            }
            $files[$file] = $file;
        }
        unset($files_array);
        pb_backupbuddy::$ui->ajax_header(true, false);
        // js, no padding
        ?>
		
		<script type="text/javascript">
			function pb_status_append( status_string ) {
				target_id = 'pb_backupbuddy_status'; // importbuddy_status or pb_backupbuddy_status
				if( jQuery( '#' + target_id ).length == 0 ) { // No status box yet so suppress.
					return;
				}
				jQuery( '#' + target_id ).append( "\n" + status_string );
				textareaelem = document.getElementById( target_id );
				textareaelem.scrollTop = textareaelem.scrollHeight;
			}
		</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;
    }
Exemplo n.º 25
0
<?php

// LOADED FROM: core.php, periodic_cleanup().
// INCOMING VARIABLES: $backup_age_limit = 172800, $die_on_fail = true
$max_site_log_size = pb_backupbuddy::$options['max_site_log_size'] * 1024 * 1024;
// in bytes.
pb_backupbuddy::status('message', 'Starting cleanup procedure for BackupBuddy v' . pb_backupbuddy::settings('version') . '.');
if (!isset(pb_backupbuddy::$options)) {
    pb_backupbuddy::load();
}
// Validate that all internal schedules are properly registered in the WordPress cron
backupbuddy_core::validateSchedules();
// Clean up any old rollback undo files hanging around.
$files = (array) glob(ABSPATH . 'backupbuddy_rollback*');
foreach ($files as $file) {
    $file_stats = stat($file);
    if (time() - $file_stats['mtime'] > backupbuddy_constants::CLEANUP_MAX_STATUS_LOG_AGE) {
        @unlink($file);
    }
}
// If temp directory exists (should only be transient but just in case it is hanging around) make sure it's secured. BB will try to delete this directory but if it can't it will at least be checked to be secure.
if (file_exists(backupbuddy_core::getTempDirectory())) {
    pb_backupbuddy::anti_directory_browsing(backupbuddy_core::getTempDirectory(), $die = false);
}
// Clean up any old cron file transfer locks.
$files = (array) glob(backupbuddy_core::getLogDirectory() . 'cronSend-*');
foreach ($files as $file) {
    $file_stats = stat($file);
    if (time() - $file_stats['mtime'] > backupbuddy_constants::CLEANUP_MAX_STATUS_LOG_AGE) {
        @unlink($file);
    }
Exemplo n.º 26
0
				plugin_information( $slug, $data );
			}
			?>
		</div>
	</div>
	<?php
} else { // STANDALONE
	pb_backupbuddy::$ui->title( 'Getting Started with ' . pb_backupbuddy::settings( 'name' ) . ' v' . pb_backupbuddy::settings( 'version' ) );
	
	if ( file_exists( pb_backupbuddy::plugin_path() . '/views/getting_started.php' ) ) {
		pb_backupbuddy::load_view( 'getting_started' );
	} else {
		echo '{views/getting_started.php not found.}';
	}
	
	plugin_information( pb_backupbuddy::settings( 'slug' ), array( 'name' => pb_backupbuddy::settings( 'name' ), 'path' => pb_backupbuddy::plugin_path() ) );
}



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();
Exemplo n.º 27
0
<?php

/*
IMPORTANT INCOMING VARIABLES (expected to be set before this file is loaded):
$profile	Index number of profile.
*/
if (isset(pb_backupbuddy::$options['profiles'][$profile])) {
    $profile_id = $profile;
    $profile_array =& pb_backupbuddy::$options['profiles'][$profile];
    $profile_array = array_merge(pb_backupbuddy::settings('profile_defaults'), $profile_array);
} else {
    die('Error #565676756. Invalid profile ID index.');
}
if (!is_admin()) {
    die('Access Denied.');
}
?>
<script type="text/javascript">
	jQuery(document).ready(function() {
		
		jQuery( '.pb_backupbuddy_filetree_exclude' ).click( function() { alert( 'wut!' ); } );
		
		/* Begin Directory / File Selector */
		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');
Exemplo n.º 28
0
 public static function _test_versions()
 {
     global $wp_version;
     self::$_results['bb_version'] = pb_backupbuddy::settings('version');
     self::$_results['wp_version'] = $wp_version;
 }
		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;
Exemplo n.º 30
0
    //plugin_information( pb_backupbuddy::settings( 'slug' ), array( 'name' => pb_backupbuddy::settings( 'name' ), 'path' => pb_backupbuddy::plugin_path() ) );
}
echo '</td><td>&nbsp;&nbsp;</td><td valign="top" style="padding-top: 40px;">';
pb_backupbuddy::$ui->start_metabox('Tutorials & Support', true, true);
?>
- <a href="http://ithemes.com/publishing/getting-started-with-backupbuddy/" target="_new" style="text-decoration: none;">Getting Started eBook</a><br>
- <a href="http://ithemes.com/backupbuddy-training/" target="_new" style="text-decoration: none;">Tutorial & Walkthrough Videos</a><br>
- <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'];
    ?>