function backup_guard_admin_menu() { add_menu_page('Backups', 'Backup Guard', 'manage_options', 'backup_guard_backups', 'backup_guard_backups_page', 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0NjIuOSA1MDEuNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgNDYyLjkgNTAxLjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGZpbGw9IiNhMGE1YWEiIGQ9Ik00MjYuOSwxOTkuNmgtMTk4bDAuNCwzNEgyNDZoMTYyLjdjLTAuNSwzLjMtMS4xLDYuNi0xLjcsOS45Yy02LjEsMzMtMTUuMyw2Mi4yLTI3LjcsODcuNkg3OS40Yy0xMi4zLTI1LjQtMjEuNi01NC42LTI3LjctODcuNkMzOS4zLDE3Ni4xLDQ0LDExMS41LDQ3LjIsODMuN0M2Ny43LDkwLjUsODguMyw5NCwxMDguNiw5NGM2MC43LDAsMTAzLjMtMzAuMiwxMjAuOC00NS4xQzI0Ni43LDYzLjgsMjg5LjQsOTQsMzUwLjEsOTRoMGMyMC4zLDAsNDAuOS0zLjUsNjEuNC0xMC4zYzEuNiwxMy45LDMuNSwzNy4xLDMuNiw2NS4xaDIzLjdjMC00Ny40LTUuNS04MS4xLTUuOC04My4zbC0yLjQtMTQuNmwtMTMuNyw1LjZjLTIyLjQsOS4yLTQ0LjgsMTMuOC02Ni43LDEzLjhjMCwwLDAsMCwwLDBjLTY4LjMsMC0xMTEuNy00NS4zLTExMi4xLTQ1LjdsLTguNi05LjJsLTguNyw5LjJjLTAuNCwwLjUtNDMuOCw0NS43LTExMi4xLDQ1LjdjLTIxLjksMC00NC40LTQuNi02Ni43LTEzLjhsLTEzLjctNS42bC0yLjQsMTQuNmMtMC42LDMuNi0xNC40LDg4LjcsMi42LDE4MS42QzM4LjUsMzAyLjQsNTcuNSwzNDguOCw4NC44LDM4NWMzNC42LDQ1LjgsODIuNCw3NS4zLDE0Mi4xLDg3LjdsMi40LDAuNWwyLjQtMC41YzU5LjctMTIuMywxMDcuNS00MS44LDE0Mi4xLTg3LjdjMjcuNC0zNi4zLDQ2LjQtODIuNyw1Ni41LTEzNy45YzMtMTYuMiw1LTMyLjIsNi4zLTQ3LjVMNDI2LjksMTk5LjZMNDI2LjksMTk5LjZ6Ii8+PC9zdmc+', 71); add_submenu_page('backup_guard_backups', 'Backups', 'Backups', 'manage_options', 'backup_guard_backups', 'backup_guard_backups_page'); if (SGBoot::isFeatureAvailable('STORAGE')) { add_submenu_page('backup_guard_backups', 'Cloud', 'Cloud', 'manage_options', 'backup_guard_cloud', 'backup_guard_cloud_page'); } if (SGBoot::isFeatureAvailable('SCHEDULE')) { add_submenu_page('backup_guard_backups', 'Schedule', 'Schedule', 'manage_options', 'backup_guard_schedule', 'backup_guard_schedule_page'); } if (SGBoot::isFeatureAvailable('NOTIFICATIONS')) { add_submenu_page('backup_guard_backups', 'Settings', 'Settings', 'manage_options', 'backup_guard_settings', 'backup_guard_settings_page'); } }
public static function init() { //get current execution time limit self::$executionTimeLimit = ini_get('max_execution_time'); //remove execution time limit @set_time_limit(0); //set default exception handler SGExceptionHandler::init(); //load all config variables from database SGConfig::getAll(); try { //check minimum requirements self::checkMinimumRequirements(); //prepare directory for backups self::prepare(); } catch (SGException $exception) { die($exception); } }
private function addFileToArchive($path) { if ($this->shouldExcludeFile($path)) { return; } //check if it is a directory if (is_dir($path)) { $this->backupDirectory($path); return; } //it is a file, try to add it to archive if (is_readable($path)) { $file = substr($path, strlen($this->rootDirectory)); $file = str_replace('\\', '/', $file); $this->sgbp->addFileFromPath($file, $path); } else { $this->warn('Could not read file (skipping): ' . $path); } //update progress and check cancellation $this->currentBackupFileCount++; if ($this->updateProgress()) { if ($this->delegate && $this->delegate->isCancelled()) { return; } } if (SGBoot::isFeatureAvailable('BACKGROUND_MODE') && $this->delegate->isBackgroundMode()) { SGBackgroundMode::next(); } }
public function didExportRow() { $this->currentRowCount++; if ($this->updateProgress()) { if ($this->delegate && $this->delegate->isCancelled()) { $this->cancelled = true; return; } } if (SGBoot::isFeatureAvailable('BACKGROUND_MODE') && $this->delegate->isBackgroundMode()) { SGBackgroundMode::next(); } }
private function didFinishRestore() { $action = $this->didFindWarnings() ? SG_ACTION_STATUS_FINISHED_WARNINGS : SG_ACTION_STATUS_FINISHED; self::changeActionStatus($this->actionId, $action); SGBackupLog::writeAction('restore', SG_BACKUP_LOG_POS_END); if (SGBoot::isFeatureAvailable('NOTIFICATIONS')) { SGBackupMailNotification::sendRestoreNotification(true); } SGBackupLog::write('Total duration: ' . formattedDuration($this->actionStartTs, time())); $this->cleanUp(); }
?> > <?php _t('Google Drive'); ?> </label> </div> </div> <div class="clearfix"></div> </div> <?php } ?> <!-- Background mode --> <?php if (SGBoot::isFeatureAvailable('BACKGROUND_MODE')) { ?> <div class="checkbox"> <label for="background-chbx"> <input type="checkbox" name="backgroundMode" id="background-chbx"> <?php _t('Background mode'); ?> </label> </div> <?php } ?> </div> </div> </div>
if (SGBoot::isFeatureAvailable('NOTIFICATIONS')) { ?> <li class="<?php echo strpos($page, 'settings') ? 'active' : ''; ?> "><a href="<?php echo network_admin_url('admin.php?page=backup_guard_settings'); ?> "><span class="glyphicon glyphicon-cog" aria-hidden="true"></span>Settings</a></li> <?php } ?> </ul> </nav> <?php if (!SGBoot::isFeatureAvailable('SCHEDULE')) { ?> <div class="sg-alert-pro"> <p><?php _t('Backup to cloud, automatization, mail notifications, and more in our PRO package!'); ?> </p> <p><a class="btn btn-primary" target="_blank" href="<?php echo SG_BACKUP_SITE_URL; ?> "><?php _t('Buy now!'); ?> </a></p> </div> <?php
<?php require_once dirname(__FILE__) . '/config/config.wordpress.free.php'; require_once dirname(__FILE__) . '/config/config.wordpress.php'; require_once SG_CORE_PATH . 'SGBoot.php'; SGBoot::init();
private function addFileToArchive($file, $stateData) { $path = $this->rootDirectory . $file; if ($this->shouldExcludeFile($path)) { return true; } //check if it is a directory if (is_dir($path)) { $this->sgbp->addFile($file, ''); //create empty directory return true; } //it is a file, try to add it to archive if (is_readable($path)) { $this->sgbp->addFileFromPath($file, $path, $stateData); } else { $this->warn('Could not read file (skipping): ' . $path); } //update progress and check cancellation $this->currentBackupFileCount++; if ($this->updateProgress()) { if ($this->delegate && $this->delegate->isCancelled()) { return false; } } if (SGBoot::isFeatureAvailable('BACKGROUND_MODE') && $this->delegate->isBackgroundMode()) { SGBackgroundMode::next(); } return true; }
$intervalSelectElement = array('1000' => '1 second', '2000' => '2 seconds', '3000' => '3 seconds', '5000' => '5 seconds', '7000' => '7 seconds', '10000' => '10 seconds'); $selectedInterval = SGConfig::get('SG_AJAX_REQUEST_FREQUENCY') ? SGConfig::get('SG_AJAX_REQUEST_FREQUENCY') : SG_AJAX_DEFAULT_REQUEST_FREQUENCY; require_once SG_PUBLIC_INCLUDE_PATH . 'sidebar.php'; ?> <div id="sg-content-wrapper"> <div class="container-fluid"> <div class="row sg-settings-container"> <div class="col-md-12"> <form class="form-horizontal" method="post" data-sgform="ajax" data-type="sgsettings"> <fieldset> <legend><?php echo _t('General settings'); ?> </legend> <?php if (SGBoot::isFeatureAvailable('NOTIFICATIONS')) { ?> <div class="form-group"> <label class="col-md-8 sg-control-label sg-user-info"> <?php echo _t('Email notifications'); if (!empty($userEmail)) { ?> <br/><span class="text-muted sg-user-email sg-helper-block"><?php echo $userEmail; ?> </span> <?php } ?> </label>