<div id="hmbkp_included_files"> <?php hmbkp_file_list($schedule, null, 'get_included_files'); ?> </div> <?php if ($schedule->get_unreadable_file_count()) { ?> <div id="hmbkp_unreadable_files"> <?php hmbkp_file_list($schedule, null, 'get_unreadable_files'); ?> <p class="description"><?php _e('Unreadable files can\'t be backed up', 'hmbkp'); ?> </p> </div> <?php } ?> <p><?php printf(__('Your site is %s. Backups will be compressed and so will be smaller.', 'hmbkp'), '<code>' . esc_html($schedule->get_formatted_file_size(false)) . '</code>');
/** * Ajax action for previewing an exclude rule. * * @access public * @return void */ function hmbkp_preview_exclude_rule() { check_ajax_referer('hmbkp_nonce', 'nonce'); if (empty($_POST['hmbkp_schedule_id']) || empty($_POST['hmbkp_schedule_excludes'])) { die; } $schedule = new HMBKP_Scheduled_Backup(sanitize_text_field($_POST['hmbkp_schedule_id'])); $excludes = explode(',', sanitize_text_field($_POST['hmbkp_schedule_excludes'])); hmbkp_file_list($schedule, $excludes, 'get_excluded_files'); $schedule->set_excludes($excludes); if ($schedule->get_excluded_file_count()) { ?> <p><?php printf(_n('%s matches 1 file.', '%1$s matches %2$d files.', $schedule->get_excluded_file_count(), 'hmbkp'), '<code>' . implode('</code>, <code>', array_map('esc_html', $excludes)) . '</code>', $schedule->get_excluded_file_count()); ?> </p> <?php } else { ?> <p><?php printf(__('%s didn\'t match any files.', 'hmbkp'), '<code>' . implode('</code>, <code>', array_map('esc_html', $excludes)) . '</code>'); ?> </p> <?php } ?> <p> <button type="button" class="button-primary hmbkp_save_exclude_rule"><?php _e('Exclude', 'hmbkp'); ?> </button> <button type="button" class="button-secondary hmbkp_cancel_save_exclude_rule"><?php _e('Cancel', 'hmbkp'); ?> </button> </p> <?php die; }