Пример #1
0
/**
 * Run HM Backup
 *
 * @return null
 */
function hmbkp_do_backup()
{
    // Make sure it's possible to do a backup
    if (!hmbkp_possible()) {
        return;
    }
    // Clean up any mess left by a previous backup
    hmbkp_cleanup();
    HM_Backup::get_instance()->backup();
    hmbkp_set_status(__('Removing old backups', 'hmbkp'));
    // Delete any old backup files
    hmbkp_delete_old_backups();
    if (file_exists(hmbkp_path() . '/.backup_running')) {
        unlink(hmbkp_path() . '/.backup_running');
    }
    if (file_exists(HM_Backup::get_instance()->archive_filepath())) {
        $file = hmbkp_path() . '/.backup_complete';
        if (!($handle = @fopen($file, 'w'))) {
            return;
        }
        fwrite($handle, HM_Backup::get_instance()->archive_filename());
        fclose($handle);
    }
    hmbkp_email_backup();
}
Пример #2
0
 /**
  * Function to run when the schedule cron fires.
  *
  * @param $schedule_id
  */
 public function schedule_hook_run($schedule_id)
 {
     if (!hmbkp_possible()) {
         return;
     }
     $schedules = Schedules::get_instance();
     $schedule = $schedules->get_schedule($schedule_id);
     if (!$schedule) {
         return;
     }
     $schedule->run();
 }
Пример #3
0
    ?>
			<a id="intercom-info" class="thickbox page-title-action" href="<?php 
    echo esc_url(wp_nonce_url(add_query_arg(array('action' => 'load_enable_support', 'width' => '600', 'height' => '420'), self_admin_url('admin-ajax.php')), 'hmbkp_nonce'));
    ?>
"><span class="dashicons dashicons-admin-users"></span>&nbsp;<?php 
    _e('Enable Support', 'backupwordpress');
    ?>
</a>
		<?php 
}
?>

	</h1>

	<?php 
if (hmbkp_possible()) {
    ?>

		<?php 
    include_once HMBKP_PLUGIN_PATH . 'admin/backups.php';
    ?>

		<p class="howto"><?php 
    printf(__('If you\'re finding BackUpWordPress useful, please %1$s rate it on the plugin directory%2$s.', 'backupwordpress'), '<a target="_blank" href="http://wordpress.org/support/view/plugin-reviews/backupwordpress">', '</a>');
    ?>
</p>

		<?php 
    include_once HMBKP_PLUGIN_PATH . 'admin/upsell.php';
    ?>
Пример #4
0
<?php

if (hmbkp_in_progress()) {
    ?>

		<a id="hmbkp_backup" class="add-new-h2 hmbkp_running" href="tools.php?page=<?php 
    echo HMBKP_PLUGIN_SLUG;
    ?>
&amp;action=hmbkp_cancel"><?php 
    echo hmbkp_get_status();
    ?>
 [cancel]</a>

<?php 
} elseif (hmbkp_possible()) {
    ?>

		<a id="hmbkp_backup" class="add-new-h2" href="tools.php?page=<?php 
    echo HMBKP_PLUGIN_SLUG;
    ?>
&amp;action=hmbkp_backup_now"><?php 
    _e('Back Up Now', 'hmbkp');
    ?>
</a>

<?php 
}