Exemple #1
0
/**
 * Deletes old backup files
 *
 * @return null
 */
function hmbkp_delete_old_backups()
{
    $files = hmbkp_get_backups();
    if (count($files) <= hmbkp_max_backups()) {
        return;
    }
    foreach (array_slice($files, hmbkp_max_backups()) as $file) {
        hmbkp_delete_backup(base64_encode($file));
    }
}
Exemple #2
0
<div id="hmbkp-settings" <?php 
if (!hmbkp_get_backups() || !empty($_POST['hmbkp_settings_submit'])) {
    echo ' class="show_form"';
}
?>
>

    <h3><?php 
_e('Settings', 'hmbkp');
?>
</h3>

	<p><?php 
printf(__('You can define %s in your %s to control some settings. A full list of %s can be found in the <a href="#contextual-help-wrap" class="hmbkp-show-help-tab">help</a> panel. Defined settings will not be editable below.', 'hmbkp'), '<code>Constants</code>', '<code>wp-config.php</code>', '<code>Constants</code>');
?>
</p>

	<form method="post">
		
		<?php 
wp_nonce_field('hmbkp_settings', 'hmbkp_settings_nonce');
?>
		
		<table class="form-table">
			<tbody>

				<tr align="top">
			
					<th scope="row"><?php 
_e('Automatic Backups', 'hmbkp');
?>