/** * 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(); }
/** * 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(); }
?> <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> <?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'; ?>
<?php if (hmbkp_in_progress()) { ?> <a id="hmbkp_backup" class="add-new-h2 hmbkp_running" href="tools.php?page=<?php echo HMBKP_PLUGIN_SLUG; ?> &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; ?> &action=hmbkp_backup_now"><?php _e('Back Up Now', 'hmbkp'); ?> </a> <?php }