WordPress.org

Plugin Directory

Changeset 602026


Ignore:
Timestamp:
09/21/12 17:52:06 (19 months ago)
Author:
willmot
Message:

2.0 RC 1

Location:
backupwordpress
Files:
4 added
2 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • backupwordpress/trunk/admin/actions.php

    r600034 r602026  
    77function hmbkp_request_delete_backup() { 
    88 
    9     if ( empty( $_GET['hmbkp_delete_backup'] ) ) 
     9    if ( empty( $_GET['hmbkp_delete_backup'] ) || ! check_admin_referer( 'hmbkp-delete_backup' ) ) 
    1010        return; 
    1111 
     
    1313    $schedule->delete_backup( base64_decode( urldecode( $_GET['hmbkp_delete_backup'] ) ) ); 
    1414 
    15     wp_redirect( remove_query_arg( 'hmbkp_delete_backup' ), 303 ); 
     15    wp_redirect( remove_query_arg( array( 'hmbkp_delete_backup', '_wpnonce' ) ), 303 ); 
    1616 
    1717    exit; 
     
    2626function hmbkp_request_delete_schedule() { 
    2727 
    28     if ( empty( $_GET['action'] ) || $_GET['action'] !== 'hmbkp_delete_schedule' ) 
     28    if ( empty( $_GET['action'] ) || $_GET['action'] !== 'hmbkp_delete_schedule' || ! check_admin_referer( 'hmbkp-delete_schedule' ) ) 
    2929        return; 
    3030 
     
    3232    $schedule->cancel( true ); 
    3333 
    34     wp_redirect( remove_query_arg( array( 'hmbkp_schedule_id', 'action' ) ), 303 ); 
     34    wp_redirect( remove_query_arg( array( 'hmbkp_schedule_id', 'action', '_wpnonce' ) ), 303 ); 
    3535 
    3636    exit; 
     
    4848 
    4949    ignore_user_abort( true ); 
     50 
     51    hmbkp_cleanup(); 
    5052 
    5153    $schedule = new HMBKP_Scheduled_Backup( urldecode( $_GET['hmbkp_schedule_id'] ) ); 
     
    6668function hmbkp_request_download_backup() { 
    6769 
    68     if ( empty( $_GET['hmbkp_download_backup'] ) ) 
    69         return; 
    70  
    71     // Force the .htaccess to be rebuilt 
    72     if ( file_exists( hmbkp_path() . '/.htaccess' ) ) 
    73         unlink( hmbkp_path() . '/.htaccess' ); 
    74  
    75     // Force the .htacces to be rewritten incase the HMBKP_SECURE_KEY has changed 
    76     hmbkp_path(); 
    77  
    78     wp_redirect( add_query_arg( 'key', md5( HMBKP_SECURE_KEY ), str_replace( realpath( HM_Backup::conform_dir( HM_Backup::get_home_path() ) ), home_url(), base64_decode( $_GET['hmbkp_download_backup'] ) ) ), 303 ); 
     70    if ( empty( $_GET['hmbkp_download_backup'] ) || ! check_admin_referer( 'hmbkp-download_backup' ) ) 
     71        return; 
     72 
     73    wp_redirect( str_replace( realpath( HM_Backup::conform_dir( HM_Backup::get_home_path() ) ), home_url(), base64_decode( $_GET['hmbkp_download_backup'] ) ), 303 ); 
    7974 
    8075    exit; 
     
    10095    hmbkp_cleanup(); 
    10196 
    102     wp_redirect( remove_query_arg( 'action' ), 303 ); 
     97    wp_redirect( remove_query_arg( array( 'action' ) ), 303 ); 
    10398 
    10499    exit; 
     
    297292add_action( 'wp_ajax_hmnkp_edit_schedule_submit', 'hmnkp_edit_schedule_submit' ); 
    298293 
     294 
     295/** 
     296 * Add an exclude rule 
     297 * 
     298 * @access public 
     299 * @return void 
     300 */ 
    299301function hmbkp_add_exclude_rule() { 
    300302 
     
    312314add_action( 'wp_ajax_hmbkp_add_exclude_rule', 'hmbkp_add_exclude_rule' ); 
    313315 
     316 
     317/** 
     318 * Delete an exclude rule 
     319 * 
     320 * @access public 
     321 * @return void 
     322 */ 
    314323function hmbkp_delete_exclude_rule() { 
    315324 
     
    329338add_action( 'wp_ajax_hmbkp_delete_exclude_rule', 'hmbkp_delete_exclude_rule' ); 
    330339 
     340 
     341/** 
     342 * Ajax action for previewing an exclude rule. 
     343 * 
     344 * @access public 
     345 * @return void 
     346 */ 
    331347function hmbkp_preview_exclude_rule() { 
    332348 
     
    348364    if ( ! empty( $excluded_files) ) { ?> 
    349365 
    350     <p><?php printf( _n( '%s matches 1 file.', '%s matches %d files', count( $excluded_files ), 'hmbkp' ), '<code>' . implode( '</code>, <code>', $excludes ) . '</code>', count( $excluded_files ) ); ?></p> 
     366    <p><?php printf( _n( '%s matches 1 file.', '%1$s matches %2$d files.', count( $excluded_files ), 'hmbkp' ), '<code>' . implode( '</code>, <code>', $excludes ) . '</code>', count( $excluded_files ) ); ?></p> 
    351367 
    352368    <?php } else { ?> 
     
    356372    <?php } ?> 
    357373 
    358     <p><button type="button" class="button-primary hmbkp_save_exclude_rule">Exclude</button> <button type="button" class="button-secondary hmbkp_cancel_save_exclude_rule">Cancel</button></p> 
     374    <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> 
    359375 
    360376    <?php exit; 
     
    367383 * that users can define to control advanced 
    368384 * settings 
    369  * 
    370  * @return null 
    371385 */ 
    372386function hmbkp_constant_changes() { 
    373387 
    374388    // If a custom backup path has been set or changed 
    375     if ( defined( 'HMBKP_PATH' ) && HMBKP_PATH && HM_Backup::conform_dir( HMBKP_PATH ) != ( $from = HM_Backup::conform_dir( get_option( 'hmbkp_path' ) ) ) ) 
     389    if ( defined( 'HMBKP_PATH' ) && HMBKP_PATH && HM_Backup::conform_dir( HMBKP_PATH ) !== ( $from = HM_Backup::conform_dir( get_option( 'hmbkp_path' ) ) ) ) 
    376390        hmbkp_path_move( $from, HMBKP_PATH ); 
    377391 
  • backupwordpress/trunk/admin/backups.php

    r600034 r602026  
    77    <?php foreach ( $schedules->get_schedules() as $schedule ) : ?> 
    88 
    9         <li><a<?php if ( ! empty ( $_GET['hmbkp_schedule_id'] ) && $schedule->get_id() == $_GET['hmbkp_schedule_id'] ) { ?> class="current"<?php } ?> href="<?php echo add_query_arg( 'hmbkp_schedule_id', $schedule->get_id(), HMBKP_ADMIN_URL ); ?> "><?php echo $schedule->get_name(); ?> <span class="count">(<?php echo count( $schedule->get_backups() ); ?>)</span></a></li> 
     9        <li><a<?php if ( ! empty ( $_GET['hmbkp_schedule_id'] ) && $schedule->get_id() == $_GET['hmbkp_schedule_id'] ) { ?> class="current"<?php } ?> href="<?php echo esc_url( add_query_arg( 'hmbkp_schedule_id', $schedule->get_id(), HMBKP_ADMIN_URL ) ); ?> "><?php echo esc_attr( $schedule->get_name() ); ?> <span class="count">(<?php echo count( $schedule->get_backups() ); ?>)</span></a></li> 
    1010 
    1111    <?php endforeach; ?> 
    1212 
    13         <li><a class="fancybox" href="<?php echo add_query_arg( array( 'action' => 'hmbkp_add_schedule_load' ), HMBKP_ADMIN_URL ); ?>"> + <?php _e( 'add schedule', 'hmbkp' ); ?></a></li> 
     13        <li><a class="fancybox" href="<?php echo esc_url( add_query_arg( array( 'action' => 'hmbkp_add_schedule_load' ), admin_url( 'admin-ajax.php' ) ) ); ?>"> + <?php _e( 'add schedule', 'hmbkp' ); ?></a></li> 
    1414 
    1515    </ul> 
     
    2424        return; ?> 
    2525 
    26     <div data-hmbkp-schedule-id="<?php echo $schedule->get_id(); ?>" class="hmbkp_schedule"> 
     26    <div data-hmbkp-schedule-id="<?php echo esc_attr( $schedule->get_id() ); ?>" class="hmbkp_schedule"> 
    2727 
    2828        <?php require( HMBKP_PLUGIN_PATH . '/admin/schedule.php' ); ?> 
  • backupwordpress/trunk/admin/constants.php

    r588863 r602026  
    1313        <dt<?php if ( defined( 'HMBKP_ZIP_PATH' ) ) { ?> class="hmbkp_active"<?php } ?>><code>HMBKP_ZIP_PATH</code></dt> 
    1414        <dd><p><?php printf( __( 'The path to your %1$s executable. Will be used to zip up your %2$s and %3$s if available.', 'hmbkp' ), '<code>zip</code>', '<code>' . __( 'files', 'hmbkp' ) . '</code>', '<code>' . __( 'database', 'hmbkp' ) . '</code>' ); ?><p class="example"><?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_ZIP_PATH', '/opt/local/bin/zip' );</code></p></dd> 
    15  
    16         <dt<?php if ( defined( 'HMBKP_DISABLE_AUTOMATIC_BACKUP' ) ) { ?> class="hmbkp_active"<?php } ?>><code>HMBKP_DISABLE_AUTOMATIC_BACKUP</code></dt> 
    17         <dd><p><?php printf( __( 'Completely disables the automatic back up. You can still back up using the "Back Up Now" button. Defaults to %s.', 'hmbkp' ), '<code>(bool) false</code>' ); ?><p class="example"><?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_DISABLE_AUTOMATIC_BACKUP', true );</code></p></dd> 
    18  
    19         <dt<?php if ( defined( 'HMBKP_MAX_BACKUPS' ) ) { ?> class="hmbkp_active"<?php } ?>><code>HMBKP_MAX_BACKUPS</code></dt> 
    20         <dd><p><?php printf( __( 'Number of backups to keep, older backups will be deleted automatically when a new backup is completed. Defaults to %s.', 'hmbkp' ), '<code>(int) 10</code>' ); ?><p class="example"><?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_MAX_BACKUPS', 5 );</code></p></dd> 
    21  
    22         <dt<?php if ( defined( 'HMBKP_FILES_ONLY' ) ) { ?> class="hmbkp_active"<?php } ?>><code>HMBKP_FILES_ONLY</code></dt> 
    23         <dd><p><?php printf( __( 'Backup %1$s only, your %2$s won\'t be backed up. Defaults to %3$s.', 'hmbkp' ), '<code>' . __( 'files', 'hmbkp' ) . '</code>', '<code>' . __( 'database', 'hmbkp' ) . '</code>', '<code>(bool) false</code>' ); ?><p class="example"><?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_FILES_ONLY', true );</code></p></dd> 
    24  
    25         <dt<?php if ( defined( 'HMBKP_DATABASE_ONLY' ) ) { ?> class="hmbkp_active"<?php } ?>><code>HMBKP_DATABASE_ONLY</code></dt> 
    26         <dd><p><?php printf( __( 'Backup %1$s only, your %2$s won\'t be backed up. Defaults to %3$s.', 'hmbkp' ), '<code>' . __( 'database', 'hmbkp' ) . '</code>', '<code>' . __( 'files', 'hmbkp' ) . '</code>', '<code>(bool) false</code>' ); ?><p class="example"><?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_DATABASE_ONLY', true );</code></p></dd> 
    27  
    28         <dt<?php if ( defined( 'HMBKP_DAILY_SCHEDULE_TIME' ) ) { ?> class="hmbkp_active"<?php } ?>><code>HMBKP_DAILY_SCHEDULE_TIME</code></dt> 
    29         <dd><p><?php printf( __( 'The time that the daily back up should run. Defaults to %s.', 'hmbkp' ), '<code>23:00</code>' ); ?><p class="example"><?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_DAILY_SCHEDULE_TIME', '07:30' );</code></p></dd> 
    3015 
    3116        <dt<?php if ( defined( 'HMBKP_EMAIL' ) ) { ?> class="hmbkp_active"<?php } ?>><code>HMBKP_EMAIL</code></dt> 
  • backupwordpress/trunk/admin/menu.php

    r588863 r602026  
    3232 
    3333    if ( strpos( $file, HMBKP_PLUGIN_SLUG ) !== false ) 
    34         array_push( $links, '<a href="tools.php?page=' . HMBKP_PLUGIN_SLUG . '">' . __( 'Backups', 'hmbkp' ) . '</a>' ); 
     34        array_push( $links, '<a href="tools.php?page=' . esc_attr( HMBKP_PLUGIN_SLUG ) . '">' . __( 'Backups', 'hmbkp' ) . '</a>' ); 
    3535 
    3636    return $links; 
    3737 
    3838} 
    39 add_filter('plugin_action_links', 'hmbkp_plugin_action_link', 10, 2 ); 
     39add_filter( 'plugin_action_links', 'hmbkp_plugin_action_link', 10, 2 ); 
    4040 
    4141/** 
     
    6767    // Check if help is for the right version. 
    6868    if ( ! empty( $plugin->version ) && version_compare( HMBKP_VERSION, $plugin->version, '!=' ) ) 
    69         $warning = sprintf( '<div id="message" class="updated inline"><p><strong>' . __( 'You are not using the latest stable version of BackUpWordPress', 'hmbkp' ) . '</strong> &mdash; ' . __( 'The information below is for version %1$s. View the %2$s file for help specific to version %3$s.', 'hmbkp' ) . '</p></div>', '<code>' . $plugin->version . '</code>', '<code>readme.txt</code>', '<code>' . HMBKP_VERSION . '</code>' ); 
     69        $warning = sprintf( '<div id="message" class="updated inline"><p><strong>' . __( 'You are not using the latest stable version of BackUpWordPress', 'hmbkp' ) . '</strong> &mdash; ' . __( 'The information below is for version %1$s. View the %2$s file for help specific to version %3$s.', 'hmbkp' ) . '</p></div>', '<code>' . esc_attr( $plugin->version ) . '</code>', '<code>readme.txt</code>', '<code>' . esc_attr( HMBKP_VERSION ) . '</code>' ); 
    7070 
    7171    ob_start(); 
  • backupwordpress/trunk/admin/schedule-form-excludes.php

    r600034 r602026  
    11<form method="post" class="hmbkp-form"> 
    22 
    3     <input type="hidden" name="hmbkp_schedule_id" value="<?php echo $schedule->get_id(); ?>" /> 
     3    <input type="hidden" name="hmbkp_schedule_id" value="<?php echo esc_attr( $schedule->get_id() ); ?>" /> 
    44 
    55    <fieldset class="hmbkp-edit-schedule-excludes-form"> 
    66 
    7         <legend><?php _e( 'Manage Exclude', 'hmbkp' ); ?></legend> 
     7        <legend><?php _e( 'Manage Excludes', 'hmbkp' ); ?></legend> 
    88 
    99        <div class="hmbkp_add_exclude_rule"> 
     
    3434 
    3535                <tr> 
    36                     <td data-hmbkp-exclude-rule="<?php echo $exclude; ?>"> 
     36                    <td data-hmbkp-exclude-rule="<?php echo esc_attr( $exclude ); ?>"> 
    3737 
    38                         <span class="code"><?php echo str_ireplace( untrailingslashit( $schedule->get_root() ), '', $exclude ); ?></span> 
     38                        <span class="code"><?php echo esc_attr( str_ireplace( untrailingslashit( $schedule->get_root() ), '', $exclude ) ); ?></span> 
    3939 
    40         <?php if ( strpos( $schedule->get_path(), $exclude ) === false && ( ! defined( 'HMBKP_EXCLUDE' ) || ( defined( 'HMBKP_EXCLUDE' ) && strpos( HMBKP_EXCLUDE, $exclude ) === false ) ) ) { ?> 
     40        <?php if ( strpos( $schedule->get_path(), untrailingslashit( $exclude ) ) !== false ) : ?> 
     41 
     42                        <span class="reason"><?php _e( 'default', 'hmbkp' ); ?></span> 
     43 
     44        <?php elseif ( defined( 'HMBKP_EXCLUDE' ) && strpos( HMBKP_EXCLUDE, $exclude ) !== false ) : ?> 
     45 
     46                        <span class="reason"><?php _e( 'defined', 'hmbkp' ); ?></span> 
     47 
     48        <?php else : ?> 
    4149 
    4250                        <a href="#" class="delete-action"><?php _e( 'Remove', 'hmbkp' ); ?></a> 
    4351 
    44         <?php } ?> 
     52        <?php endif; ?> 
    4553 
    4654                    </td> 
  • backupwordpress/trunk/admin/schedule-form.php

    r598091 r602026  
    11<form method="post" class="hmbkp-form" novalidate data-schedule-action="<?php if ( isset( $is_new_schedule ) ) { ?>add<?php } else { ?>edit<?php } ?>"> 
    22 
    3     <input type="hidden" name="hmbkp_schedule_id" value="<?php echo $schedule->get_id(); ?>" /> 
     3    <input type="hidden" name="hmbkp_schedule_id" value="<?php echo esc_attr( $schedule->get_id() ); ?>" /> 
    44 
    55    <fieldset class="hmbkp-edit-schedule-form"> 
     
    2525            <select name="hmbkp_schedule_reoccurrence" id="hmbkp_schedule_reoccurrence"> 
    2626 
    27                 <option value="manually">Manual Only</option> 
     27                <option value="manually"><?php _e( 'Manual Only', 'hmbkp' ); ?></option> 
    2828 
    2929<?php foreach( wp_get_schedules() as $cron_schedule => $cron_details ) : ?> 
    3030 
    31                 <option<?php selected( $schedule->get_reoccurrence(), $cron_schedule ); ?> value="<?php echo $cron_schedule; ?>"><?php echo $cron_details['display']; ?></option> 
     31                <option<?php selected( $schedule->get_reoccurrence(), $cron_schedule ); ?> value="<?php echo esc_attr( $cron_schedule ); ?>"><?php echo esc_attr( $cron_details['display'] ); ?></option> 
    3232 
    3333<?php endforeach; ?> 
     
    4141            <?php _e( 'Number of backups to store on this server', 'hmbkp' ); ?> 
    4242 
    43             <input type="number" name="hmbkp_schedule_max_backups" min="1" step="1" value="<?php echo $schedule->get_max_backups(); ?>" /> 
     43            <input type="number" name="hmbkp_schedule_max_backups" min="1" step="1" value="<?php echo esc_attr( $schedule->get_max_backups() ); ?>" /> 
    4444 
    45             <p class="description"><?php _e( 'The number of previous backups to store on the server. past this limit the oldest backups will be deleted automatically.', 'hmbkp' ); ?></p> 
     45            <p class="description"><?php _e( 'The number of previous backups to store on the server. past this limit older backups will be deleted automatically.', 'hmbkp' ); ?></p> 
    4646 
    4747        </label> 
  • backupwordpress/trunk/admin/schedule.php

    r600034 r602026  
    22 
    33// Calculated filesize 
    4 $filesize = $schedule->is_filesize_cached() || isset( $recalculate_filesize ) ? '<code title="' . __( 'Backups will be compressed and should be smaller than this.', 'hmbkp' ) . '">' . $schedule->get_filesize() . '</code>' : '<code class="calculating" title="' . __( 'this shouldn\'t take long&hellip;', 'hmbkp' ) . '">calculating the size of your site&hellip;</code>'; 
     4$filesize = $schedule->is_filesize_cached() || isset( $recalculate_filesize ) ? '<code title="' . __( 'Backups will be compressed and should be smaller than this.', 'hmbkp' ) . '">' . esc_attr( $schedule->get_filesize() ) . '</code>' : '<code class="calculating" title="' . __( 'this shouldn\'t take long&hellip;', 'hmbkp' ) . '">' . __( 'calculating the size of your site&hellip;', 'hmbkp' ) . '</code>'; 
    55 
    66// Backup Type 
     
    1010$day = date_i18n( 'l', $schedule->get_next_occurrence() ); 
    1111 
    12 $next_backup = 'title="The next backup will be on ' . date_i18n( get_option( 'date_format' ), $schedule->get_next_occurrence() ) . ' at ' . date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence() ) . '"'; 
     12$next_backup = 'title="' . sprintf( __( 'The next backup will be on %1$s at %2$s', 'hmbkp' ), date_i18n( get_option( 'date_format' ), $schedule->get_next_occurrence() ), date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence() ) ) . '"'; 
    1313 
    1414// Backup Re-occurrence 
     
    1717    case 'hourly' : 
    1818 
    19         $reoccurrence = date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence() ) == '00' ? sprintf( __( 'hourly on the hour', 'hmbkp' ) ) : sprintf( __( 'hourly at %s minutes past the hour', 'hmbkp' ), '<span ' . $next_backup . '>' . str_replace( '0', '', date_i18n( 'i', $schedule->get_next_occurrence() ) ) ) . '</span>'; 
     19        $reoccurrence = date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence() ) === '00' ? sprintf( __( 'hourly on the hour', 'hmbkp' ) ) : sprintf( __( 'hourly at %s minutes past the hour', 'hmbkp' ), '<span ' . $next_backup . '>' . str_replace( '0', '', date_i18n( 'i', $schedule->get_next_occurrence() ) ) ) . '</span>'; 
    2020 
    2121    break; 
     
    5454    case 'monthly' : 
    5555 
    56         $reoccurrence = sprintf( __( 'on the %s of each month at %1$s', 'hmbkp' ), '<span ' . $next_backup . '>' . date_i18n( 'jS', $schedule->get_next_occurrence() ) . '</span>', '<span>' . date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence() ) . '</span>' ); 
     56        $reoccurrence = sprintf( __( 'on the %1$s of each month at %2$s', 'hmbkp' ), '<span ' . $next_backup . '>' . date_i18n( 'jS', $schedule->get_next_occurrence() ) . '</span>', '<span>' . date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence() ) . '</span>' ); 
    5757 
    5858    break; 
     
    6666endswitch; 
    6767 
    68 $server = '<span title="' . hmbkp_path() . '">' . __( 'server', 'hmbkp' ) . '</span>'; 
     68$server = '<span title="' . esc_attr( hmbkp_path() ) . '">' . __( 'this server', 'hmbkp' ) . '</span>'; 
    6969 
    7070// Backup to keep 
     
    7373    case 1 : 
    7474 
    75         $backup_to_keep = sprintf( __( 'store the only the last backup %s', 'hmbkp' ), $server ); 
     75        $backup_to_keep = sprintf( __( 'store the only the last backup on %s', 'hmbkp' ), $server ); 
    7676 
    7777    break; 
     
    7979    case 0 : 
    8080 
    81         $backup_to_keep = sprintf( __( 'don\'t store any backups %s', 'hmbkp' ), $server ); 
     81        $backup_to_keep = sprintf( __( 'don\'t store any backups on %s', 'hmbkp' ), $server ); 
    8282 
    8383    break; 
     
    8585    default : 
    8686 
    87         $backup_to_keep = sprintf( __( 'store only the last %1$s backups %2$s', 'hmbkp' ), $schedule->get_max_backups(), $server ); 
     87        $backup_to_keep = sprintf( __( 'store only the last %1$s backups on %2$s', 'hmbkp' ), esc_attr( $schedule->get_max_backups() ), $server ); 
    8888 
    8989endswitch; 
  • backupwordpress/trunk/assets/hmbkp.css

    r600034 r602026  
    7777 
    7878table.widefat tbody td { padding: 8px 7px; } 
    79 .hmbkp-edit-schedule-excludes-form td a { float: right; } 
     79.hmbkp-edit-schedule-excludes-form td a, .hmbkp-edit-schedule-excludes-form td span.reason { float: right; } 
     80.hmbkp-edit-schedule-excludes-form td span.reason { color: #CCC; } 
    8081input[type="datetime-local"] { border-radius: 3px; border-width: 1px; border-style: solid; box-sizing: border-box; border-color: #DFDFDF; background-color: white; } 
  • backupwordpress/trunk/assets/hmbkp.js

    r600034 r602026  
    294294    } 
    295295 
    296     if ( $( '.hmbkp-running' ).size() ) { 
     296    if ( $( '.hmbkp-running' ).size() ) 
    297297        hmbkpRedirectOnBackupComplete(); 
    298     } 
    299298 
    300299    $( '.hmbkp-run' ).live( 'click', function( e ) { 
     
    321320        $( this ).closest( '.hmbkp-schedule-sentence' ).addClass( 'hmbkp-running' ); 
    322321 
    323         setTimeout( 'hmbkpRedirectOnBackupComplete', 1000 ); 
     322        hmbkpRedirectOnBackupComplete(); 
    324323 
    325324        e.preventDefault(); 
     
    342341            } else { 
    343342 
    344                 setTimeout( 'hmbkpRedirectOnBackupComplete();', 1000 ); 
     343                setTimeout( 'hmbkpRedirectOnBackupComplete();', 500 ); 
    345344 
    346345                jQuery( '.hmbkp-schedule-actions' ).replaceWith( data ); 
  • backupwordpress/trunk/classes/email.php

    r588863 r602026  
    2121            <input type="email" name="<?php echo $this->get_field_name( 'email' ); ?>" value="<?php echo $this->get_field_value( 'email' ); ?>" /> 
    2222 
    23             <p class="description">Receive a notification email when a backup completes, if the backup is small enough (&lt; 10mb) then it will be attached to the email. Separate multiple email address's with a comma.</p> 
     23            <p class="description"><?php _e( 'Receive a notification email when a backup completes, if the backup is small enough (&lt; 10mb) then it will be attached to the email. Separate multiple email address\'s with a comma.', 'hmbkp' ); ?></p> 
    2424 
    2525        </label> 
     
    127127                $subject = sprintf( __( 'Backup of %s Failed', 'hmbkp' ), $domain ); 
    128128 
    129                 $message = sprintf( __( "BackUpWordPress was unable to backup your site %1$s.\n\nHere are the errors that we're encountered\n\n%2$s\n\nIf the errors above look like Martian, forward this email to %3$s and we'll take a look\n\nKind Regards,\nThe Apologetic BackUpWordPress Backup Emailing Robot", 'hmbkp' ), home_url(), $error_message, 'support@hmn.md' ); 
     129                $message = sprintf( __( 'BackUpWordPress was unable to backup your site %1$s.', 'hmbkp' ) . "\n\n" . __( 'Here are the errors that we\'re encountered:', 'hmbkp' ) . "\n\n" . '%2$s' . "\n\n" . __( 'If the errors above look like Martian, forward this email to %3$s and we\'ll take a look', 'hmbkp' ) . "\n\n" . __( "Kind Regards,\nThe Apologetic BackUpWordPress Backup Emailing Robot", 'hmbkp' ), home_url(), $error_message, 'support@hmn.md' ); 
    130130 
    131131                $sent = wp_mail( $this->get_email_address_array(), $subject, $message, $headers ); 
     
    140140            if ( filesize( $file ) < 1000 * 1000 * 10 ) { 
    141141 
    142                 $message = sprintf( __( "BackUpWordPress has completed a backup of your site %1$s.\n\nThe backup file should be attached to this email.\n\nYou can also download the backup file by clicking the link below:\n\n%2$s\n\nKind Regards,\nThe Happy BackUpWordPress Backup Emailing Robot", 'hmbkp' ), home_url(), $download ); 
     142                $message = sprintf( __( 'BackUpWordPress has completed a backup of your site %1$s.', 'hmbkp' ) . "\n\n" . __( 'The backup file should be attached to this email.', 'hmbkp' ) . "\n\n" . __( 'You can download the backup file by clicking the link below:', 'hmbkp' ) . "\n\n" . '%2$s' . "\n\n" . __( "Kind Regards,\nThe Happy BackUpWordPress Backup Emailing Robot", 'hmbkp' ), home_url(), $download ); 
    143143 
    144144                $sent = wp_mail( $this->get_email_address_array(), $subject, $message, $headers, $file ); 
     
    149149            if ( ! $sent ) { 
    150150 
    151                 $message = sprintf( __( "BackUpWordPress has completed a backup of your site %1$s.\n\nUnfortunately the backup file was too large to attach to this email.\n\nYou can download the backup file by clicking the link below:\n\n%2$s\n\nKind Regards,\nThe Happy BackUpWordPress Backup Emailing Robot", 'hmbkp' ), home_url(), $download ); 
     151                $message = sprintf( __( 'BackUpWordPress has completed a backup of your site %1$s.', 'hmbkp' ) . "\n\n" . __( 'Unfortunately the backup file was too large to attach to this email.', 'hmbkp' ) . "\n\n" . __( 'You can download the backup file by clicking the link below:', 'hmbkp' ) . "\n\n" . '%2$s' . "\n\n" . __( "Kind Regards,\nThe Happy BackUpWordPress Backup Emailing Robot", 'hmbkp' ), home_url(), $download ); 
    152152 
    153153                $sent = wp_mail( $this->get_email_address_array(), $subject, $message, $headers ); 
  • backupwordpress/trunk/classes/schedule.php

    r600034 r602026  
    136136 
    137137        if ( defined( 'HMBKP_EXCLUDE' ) && HMBKP_EXCLUDE ) 
    138             $this->set_excludes( HMBKP_EXCLUDE, true ); 
     138            parent::set_excludes( HMBKP_EXCLUDE, true ); 
    139139 
    140140        if ( defined( 'HMBKP_MYSQLDUMP_PATH' ) ) 
     
    146146        if ( defined( 'HMBKP_ZIP_PATH' ) && HMBKP_ZIP_PATH === 'PclZip' && $this->skip_zip_archive = true ) 
    147147            $this->set_zip_command_path( false ); 
    148  
    149         // Pass type and excludes up to HM Backup 
    150         parent::set_type( $this->get_type() ); 
    151         parent::set_excludes( $this->get_excludes() ); 
    152148 
    153149        // Set the path - TODO remove external function dependancy 
     
    206202            $this->set_type( 'complete' ); 
    207203 
    208         return esc_attr( $this->options['type'] ); 
     204        return $this->options['type']; 
    209205 
    210206    } 
     
    218214    public function set_type( $type ) { 
    219215 
    220         if ( parent::set_type( $type ) !== false ) { 
    221  
    222             $this->options['type'] = $type; 
    223  
    224             $this->clear_filesize_cache(); 
    225  
    226         } 
     216        parent::set_type( $type ); 
     217 
     218        $this->options['type'] = $type; 
     219 
     220        $this->clear_filesize_cache(); 
    227221 
    228222    } 
     
    253247    public function set_excludes( $excludes, $append = false ) { 
    254248 
     249        // Use the validation from HM_Backup::set_excludes 
    255250        parent::set_excludes( $excludes, $append ); 
    256251 
    257         if ( ! parent::get_excludes() ) { 
    258  
    259             $this->options['excludes'] = parent::get_excludes(); 
     252        // If these are valid excludes and they are different save them 
     253        if ( parent::get_excludes() && ( empty( $this->options['excludes'] ) || $this->options['excludes'] !== parent::get_excludes() ) ) { 
     254 
     255            $this->options['excludes'] = $append && ! empty( $this->options['excludes'] ) ? array_merge( (array) $this->options['excludes'], parent::get_excludes() ) : parent::get_excludes();; 
     256 
     257            parent::set_excludes( $this->options['excludes'] ); 
    260258 
    261259            $this->clear_filesize_cache(); 
  • backupwordpress/trunk/classes/wp-cli.php

    r598091 r602026  
    1414        // Make sure it's possible to do a backup 
    1515        if ( HM_Backup::is_safe_mode_active() ) { 
    16             WP_CLI::error( 'Backup not possible when php is running safe_mode on' ); 
     16            WP_CLI::error( __( 'Backup not possible when php is running safe_mode on', 'hmbkp' ) ); 
    1717            return false; 
    1818        } 
    1919 
    2020        add_action( 'hmbkp_mysqldump_started', function() { 
    21             WP_CLI::line( 'Backup: Dumping database...' ); 
     21            WP_CLI::line( __( 'Backup: Dumping database...', 'hmbkp' ) ); 
    2222        } ); 
    2323 
    2424        add_action( 'hmbkp_archive_started', function() { 
    25             WP_CLI::line( 'Backup: Zipping everything up...' ); 
     25            WP_CLI::line( __( 'Backup: Zipping everything up...', 'hmbkp' ) ); 
    2626        } ); 
    2727 
     
    3838 
    3939        if ( ( ! is_dir( $hm_backup->get_path() ) && ( ! is_writable( dirname( $hm_backup->get_path() ) ) || ! mkdir( $hm_backup->get_path() ) ) ) || ! is_writable( $hm_backup->get_path() ) ) { 
    40             WP_CLI::error( 'Invalid backup path' ); 
     40            WP_CLI::error( __( 'Invalid backup path', 'hmbkp' ) ); 
    4141            return false; 
    4242        } 
    4343 
    4444        if ( ! is_dir( $hm_backup->get_root() ) || ! is_readable( $hm_backup->get_root() ) ) { 
    45             WP_CLI::error( 'Invalid root path' ); 
     45            WP_CLI::error( __( 'Invalid root path', 'hmbkp' ) ); 
    4646            return false; 
    4747        } 
     
    6464        $hm_backup->backup(); 
    6565 
    66         WP_CLI::line( 'Backup: Deleting old backups...' ); 
    67  
    6866        // Delete any old backup files 
    6967        //hmbkp_delete_old_backups(); 
    7068 
    7169        if ( file_exists( $hm_backup->get_archive_filepath() ) ) 
    72             WP_CLI::success( 'Backup Complete: ' . $hm_backup->get_archive_filepath() ); 
     70            WP_CLI::success( __( 'Backup Complete: ', 'hmbkp' ) . $hm_backup->get_archive_filepath() ); 
    7371 
    7472        else 
    75             WP_CLI::error( 'Backup Failed' ); 
     73            WP_CLI::error( __( 'Backup Failed', 'hmbkp' ) ); 
    7674 
    7775    } 
  • backupwordpress/trunk/functions/core.php

    r600034 r602026  
    9595        $legacy_schedule = new HMBKP_Scheduled_Backup( 'backup' ); 
    9696 
    97         // Automatic backups disabled? 
    98  
    9997        // Backup type 
    10098        if ( ( defined( 'HMBKP_FILES_ONLY' ) && HMBKP_FILES_ONLY ) || get_option( 'hmbkp_files_only' ) ) 
    101             $legacy_schedule->set_type( 'files' ); 
     99            $legacy_schedule->set_type( 'file' ); 
    102100 
    103101        elseif ( ( defined( 'HMBKP_DATABASE_ONLY' ) && HMBKP_DATABASE_ONLY ) || get_option( 'hmbkp_database_only' ) ) 
     
    107105            $legacy_schedule->set_type( 'complete' ); 
    108106 
     107        // Daily schedule time 
     108        if ( defined( 'HMBKP_DAILY_SCHEDULE_TIME' ) && HMBKP_DAILY_SCHEDULE_TIME ) 
     109            $legacy_schedule->set_schedule_start_time( strtotime( HMBKP_DAILY_SCHEDULE_TIME ) ); 
     110 
    109111        // Backup schedule 
    110112        $legacy_schedule->set_reoccurrence( str_replace( 'hmbkp_', '', get_option( 'hmbkp_schedule_frequency', 'daily' ) ) ); 
     113 
     114        // Automatic backups disabled? 
     115        if ( ( defined( 'HMBKP_DISABLE_AUTOMATIC_BACKUP' ) && HMBKP_DISABLE_AUTOMATIC_BACKUP ) || get_option( 'hmbkp_disable_automatic_backup' ) ) 
     116            $legacy_schedule->set_reoccurrence( 'manually' ); 
    111117 
    112118        // Max backups 
     
    134140 
    135141        // Remove the legacy options 
    136         foreach ( array( 'hmbkp_email', 'hmbkp_database_only', 'hmbkp_files_only', 'hmbkp_max_backups', 'hmbkp_email_address', 'hmbkp_email', 'hmbkp_schedule_frequency' ) as $option_name ) 
     142        foreach ( array( 'hmbkp_email', 'hmbkp_database_only', 'hmbkp_files_only', 'hmbkp_max_backups', 'hmbkp_email_address', 'hmbkp_email', 'hmbkp_schedule_frequency', 'hmbkp_disable_automatic_backup' ) as $option_name ) 
    137143            delete_option( $option_name ); 
    138144 
     
    188194 
    189195    function hmbkp_default_schedules_setup_warning() { 
    190         echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has setup your default schedules.', 'hmbkp' ) . '</strong> ' . __( 'By default BackUpWordPress performs a daily backup of your database and a weekly backup of your database &amp; files. You can modify these schedules below.', 'hmbkp' ) . '</p></div>'; 
     196        echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has setup your default schedules.', 'hmbkp' ) . '</strong> ' . __( 'By default BackUpWordPress performs a daily backup of your database and a weekly backup of your database &amp; files. You can modify these schedules.', 'hmbkp' ) . '</p></div>'; 
    191197    } 
    192198    add_action( 'admin_notices', 'hmbkp_default_schedules_setup_warning' ); 
     
    203209 
    204210    return array_merge( $reccurrences, array( 
    205         'weekly' => array( 'interval' => 604800, 'display' => 'Once Weekly' ), 
    206         'fortnightly' => array( 'interval' => 1209600, 'display' => 'Once Fortnightly' ), 
    207         'monthly' => array( 'interval' => 2629743.83 , 'display' => 'Once Monthly' ) 
     211        'weekly'        => array( 'interval' => 604800, 'display' => 'Once Weekly' ), 
     212        'fortnightly'   => array( 'interval' => 1209600, 'display' => 'Once Fortnightly' ), 
     213        'monthly'       => array( 'interval' => 2629743.83 , 'display' => 'Once Monthly' ) 
    208214    ) ); 
    209215} 
     
    219225 
    220226    if ( is_file( $dir ) ) 
    221         unlink( $dir ); 
     227        @unlink( $dir ); 
    222228 
    223229    if ( ! is_dir( $dir ) ) 
     
    256262 
    257263    // If the dir doesn't exist or isn't writable then use wp-content/backups instead 
    258     if ( ( ! $path || ! is_writable( $path ) ) && HM_Backup::conform_dir( $path ) != hmbkp_path_default() ) 
     264    if ( ( ! $path || ! is_writable( $path ) ) && HM_Backup::conform_dir( $path ) !== hmbkp_path_default() ) 
    259265        $path = hmbkp_path_default(); 
    260266 
     
    263269        mkdir( $path, 0755 ); 
    264270 
    265     if ( get_option( 'hmbkp_path' ) != $path ) 
     271    if ( get_option( 'hmbkp_path' ) !== $path ) 
    266272        update_option( 'hmbkp_path', $path ); 
    267273 
    268     // Secure the directory with a .htaccess file 
    269     $htaccess = $path . '/.htaccess'; 
    270  
    271     $contents[] = '# ' . sprintf( __( 'This %s file ensures that other people cannot download your backup files.', 'hmbkp' ), '.htaccess' ); 
    272     $contents[] = ''; 
    273     $contents[] = '<IfModule mod_rewrite.c>'; 
    274     $contents[] = 'RewriteEngine On'; 
    275     $contents[] = 'RewriteCond %{QUERY_STRING} !key=' . md5( HMBKP_SECURE_KEY ); 
    276     $contents[] = 'RewriteRule (.*) - [F]'; 
    277     $contents[] = '</IfModule>'; 
    278     $contents[] = ''; 
    279  
    280     if ( ! file_exists( $htaccess ) && is_writable( $path ) && require_once( ABSPATH . '/wp-admin/includes/misc.php' ) ) 
    281         insert_with_markers( $htaccess, 'BackUpWordPress', $contents ); 
     274    // Protect against directory browsing by including a index.html file 
     275    $index = $path . '/index.html'; 
     276 
     277    if ( ! file_exists( $index ) && is_writable( $path ) ) 
     278        file_put_contents( $index, '' ); 
    282279 
    283280    return HM_Backup::conform_dir( $path ); 
     281 
    284282} 
    285283 
     
    315313 
    316314        while ( false !== ( $file = readdir( $handle ) ) ) 
    317             if ( $file != '.' && $file != '..' ) 
     315            if ( $file !== '.' && $file !== '..' ) 
    318316                rename( trailingslashit( $from ) . $file, trailingslashit( $to ) . $file ); 
    319317 
     
    337335        return false; 
    338336 
    339     if ( defined( 'HMBKP_FILES_ONLY' ) && HMBKP_FILES_ONLY && defined( 'HMBKP_DATABASE_ONLY' ) && HMBKP_DATABASE_ONLY ) 
    340         return false; 
    341  
    342337    return true; 
    343338} 
     
    349344 */ 
    350345function hmbkp_cleanup() { 
    351  
    352     delete_option( 'hmbkp_email_error' ); 
    353346 
    354347    $hmbkp_path = hmbkp_path(); 
     
    360353 
    361354        while ( false !== ( $file = readdir( $handle ) ) ) 
    362             if ( ! in_array( $file, array( '.', '..', '.htaccess' ) ) && pathinfo( $file, PATHINFO_EXTENSION ) !== 'zip' ) 
     355            if ( ! in_array( $file, array( '.', '..', 'index.html' ) ) && pathinfo( $file, PATHINFO_EXTENSION ) !== 'zip' ) 
    363356                hmbkp_rmdirtree( trailingslashit( $hmbkp_path ) . $file ); 
    364357 
  • backupwordpress/trunk/functions/interface.php

    r600034 r602026  
    1414 
    1515        <th scope="row"> 
    16             <?php echo date_i18n( get_option( 'date_format' ) . ' - ' . get_option( 'time_format' ), @filemtime( $file ) + $offset ); ?> 
     16            <?php echo esc_attr( date_i18n( get_option( 'date_format' ) . ' - ' . get_option( 'time_format' ), @filemtime( $file ) + $offset ) ); ?> 
    1717        </th> 
    1818 
    1919        <td class="code"> 
    20             <?php echo HMBKP_Scheduled_Backup::human_filesize( @filesize( $file ) ); ?> 
     20            <?php echo esc_attr( HMBKP_Scheduled_Backup::human_filesize( @filesize( $file ) ) ); ?> 
    2121        </td> 
    2222 
    23         <td><?php echo hmbkp_human_get_type( $file, $schedule ); ?></td> 
     23        <td><?php echo esc_attr( hmbkp_human_get_type( $file, $schedule ) ); ?></td> 
    2424 
    2525        <td> 
    2626 
    27             <a href="tools.php?page=<?php echo HMBKP_PLUGIN_SLUG; ?>&amp;hmbkp_download_backup=<?php echo $encoded_file; ?>&amp;hmbkp_schedule_id=<?php echo $schedule->get_id(); ?>"><?php _e( 'Download', 'hmbkp' ); ?></a> | 
    28             <a href="tools.php?page=<?php echo HMBKP_PLUGIN_SLUG; ?>&amp;hmbkp_delete_backup=<?php echo $encoded_file ?>&amp;hmbkp_schedule_id=<?php echo $schedule->get_id(); ?>" class="delete-action"><?php _e( 'Delete', 'hmbkp' ); ?></a> 
     27            <a href="<?php echo wp_nonce_url( admin_url( 'tools.php?page=' . HMBKP_PLUGIN_SLUG . '&amp;hmbkp_download_backup=' . $encoded_file . '&amp;hmbkp_schedule_id=' . $schedule->get_id() ), 'hmbkp-download_backup' ); ?>"><?php _e( 'Download', 'hmbkp' ); ?></a> | 
     28            <a href="<?php echo wp_nonce_url( admin_url( 'tools.php?page=' . HMBKP_PLUGIN_SLUG . '&amp;hmbkp_delete_backup=' . $encoded_file . '&amp;hmbkp_schedule_id=' . $schedule->get_id() ), 'hmbkp-delete_backup' ); ?>" class="delete-action"><?php _e( 'Delete', 'hmbkp' ); ?></a> 
    2929 
    3030        </td> 
     
    6060            $php_user = exec( 'whoami' ); 
    6161            $php_group = reset( explode( ' ', exec( 'groups' ) ) ); 
    62             echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress is almost ready.', 'hmbkp' ) . '</strong> ' . sprintf( __( 'Your backups directory isn\'t writable, run %1$s or %2$s or set the permissions yourself.', 'hmbkp' ), '<code>chown -R ' . $php_user . ':' . $php_group . ' ' . hmbkp_path() . '</code>', '<code>chmod -R 777 ' . hmbkp_path() . '</code>' ) . '</p></div>'; 
     62            echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress is almost ready.', 'hmbkp' ) . '</strong> ' . sprintf( __( 'Your backups directory isn\'t writable, run %1$s or %2$s or set the permissions yourself.', 'hmbkp' ), '<code>chown -R ' . esc_attr( $php_user ) . ':' . esc_attr( $php_group ) . ' ' . esc_attr( hmbkp_path() ) . '</code>', '<code>chmod -R 777 ' . esc_attr( hmbkp_path() ) . '</code>' ) . '</p></div>'; 
    6363        } 
    6464        add_action( 'admin_notices', 'hmbkp_writable_path_warning' ); 
     
    8080 
    8181        function hmbkp_custom_path_exists_warning() { 
    82             echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has detected a problem.', 'hmbkp' ) . '</strong> ' . sprintf( __( 'Your custom backups directory %1$s doesn\'t exist and can\'t be created, your backups will be saved to %2$s instead.', 'hmbkp' ), '<code>' . HMBKP_PATH . '</code>', '<code>' . hmbkp_path() . '</code>' ) . '</p></div>'; 
     82            echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has detected a problem.', 'hmbkp' ) . '</strong> ' . sprintf( __( 'Your custom backups directory %1$s doesn\'t exist and can\'t be created, your backups will be saved to %2$s instead.', 'hmbkp' ), '<code>' . esc_attr( HMBKP_PATH ) . '</code>', '<code>' . esc_attr( hmbkp_path() ) . '</code>' ) . '</p></div>'; 
    8383        } 
    8484        add_action( 'admin_notices', 'hmbkp_custom_path_exists_warning' ); 
     
    9090 
    9191        function hmbkp_custom_path_writable_notice() { 
    92             echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has detected a problem.', 'hmbkp' ) . '</strong> ' . sprintf( __( 'Your custom backups directory %1$s isn\'t writable, new backups will be saved to %2$s instead.', 'hmbkp' ), '<code>' . HMBKP_PATH . '</code>', '<code>' . hmbkp_path() . '</code>' ) . '</p></div>'; 
     92            echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has detected a problem.', 'hmbkp' ) . '</strong> ' . sprintf( __( 'Your custom backups directory %1$s isn\'t writable, new backups will be saved to %2$s instead.', 'hmbkp' ), '<code>' . esc_attr( HMBKP_PATH ) . '</code>', '<code>' . esc_attr( hmbkp_path() ) . '</code>' ) . '</p></div>'; 
    9393        } 
    9494        add_action( 'admin_notices', 'hmbkp_custom_path_writable_notice' ); 
     
    152152 
    153153} 
     154 
     155/** 
     156 * Display a html list of files 
     157 * 
     158 * @param HMBKP_Scheduled_Backup $schedule 
     159 * @param mixed $excludes (default: null) 
     160 * @param string $file_method (default: 'get_included_files') 
     161 * @return void 
     162 */ 
    154163function hmbkp_file_list( HMBKP_Scheduled_Backup $schedule, $excludes = null, $file_method = 'get_included_files' ) { 
    155164 
     
    170179            <?php if ( $file->isDir() ) { ?> 
    171180 
    172         <li title="<?php echo trailingslashit( $file->getPathName() ); ?>"><?php echo trailingslashit( str_ireplace( trailingslashit( $schedule->get_root() ), '', $file->getPathName() ) ); ?></li> 
     181        <li title="<?php echo esc_attr( $schedule::conform_dir( trailingslashit( $file->getPathName() ) ) ); ?>"><?php echo trailingslashit( str_ireplace( $schedule::conform_dir( trailingslashit( $schedule->get_root() ) ), '', $schedule::conform_dir( $file->getPathName() ) ) ); ?></li> 
    173182 
    174183            <?php } else { ?> 
    175184 
    176         <li title="<?php echo $file->getPathName(); ?>"><?php echo str_ireplace( trailingslashit( $schedule->get_root() ), '', $file->getPathName() ); ?></li> 
     185        <li title="<?php echo esc_attr( $schedule::conform_dir( $file->getPathName() ) ); ?>"><?php echo str_ireplace( $schedule::conform_dir( trailingslashit( $schedule->get_root() ) ), '', $schedule::conform_dir( $file->getPathName() ) ); ?></li> 
    177186 
    178187            <?php } 
     
    186195} 
    187196 
     197 
     198/** 
     199 * Get the human readable backup type in. 
     200 * 
     201 * @access public 
     202 * @param string $type 
     203 * @param HMBKP_Scheduled_Backup $schedule (default: null) 
     204 * @return string 
     205 */ 
    188206function hmbkp_human_get_type( $type, HMBKP_Scheduled_Backup $schedule = null ) { 
    189207 
     
    200218        return hmbkp_human_get_type( $schedule->get_type() ); 
    201219 
    202     return __( 'Unknown', 'hmbkp' ); 
    203  
    204 } 
    205  
     220    return __( 'Legacy', 'hmbkp' ); 
     221 
     222} 
     223 
     224 
     225/** 
     226 * Display the row of actions for a schedule 
     227 * 
     228 * @access public 
     229 * @param HMBKP_Scheduled_Backup $schedule 
     230 * @return void 
     231 */ 
    206232function hmbkp_schedule_actions( HMBKP_Scheduled_Backup $schedule ) { 
    207233 
     
    222248        <a class="hmbkp-run" href="<?php echo add_query_arg( array( 'action' => 'hmbkp_run_schedule', 'hmbkp_schedule_id' => $schedule->get_id() ), admin_url( 'admin-ajax.php' ) ); ?>"><?php _e( 'Run now', 'hmbkp' ); ?></a>  | 
    223249 
    224         <a class="delete-action" href="<?php echo add_query_arg( array( 'action' => 'hmbkp_delete_schedule', 'hmbkp_schedule_id' => $schedule->get_id() ), admin_url( 'admin-ajax.php' ) ); ?>"><?php _e( 'Delete', 'hmbkp' ); ?></a> 
     250        <a class="delete-action" href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'hmbkp_delete_schedule', 'hmbkp_schedule_id' => $schedule->get_id() ), HMBKP_ADMIN_URL ), 'hmbkp-delete_schedule' ); ?>"><?php _e( 'Delete', 'hmbkp' ); ?></a> 
    225251 
    226252    </div> 
     
    229255 
    230256} 
     257 
     258/** 
     259 * Load the backup errors file 
     260 * 
     261 * @return string 
     262 */ 
     263function hmbkp_backup_errors() { 
     264 
     265    if ( ! file_exists( hmbkp_path() . '/.backup_errors' ) ) 
     266        return ''; 
     267 
     268    return file_get_contents( hmbkp_path() . '/.backup_errors' ); 
     269 
     270} 
     271 
     272/** 
     273 * Load the backup warnings file 
     274 * 
     275 * @return string 
     276 */ 
     277function hmbkp_backup_warnings() { 
     278 
     279    if ( ! file_exists( hmbkp_path() . '/.backup_warnings' ) ) 
     280        return ''; 
     281 
     282    return file_get_contents( hmbkp_path() . '/.backup_warnings' ); 
     283 
     284} 
  • backupwordpress/trunk/hm-backup/hm-backup.php

    r600034 r602026  
    44 * Generic file and database backup class 
    55 * 
    6  * @version 2.0 Beta 5 
     6 * @version 2.0 RC1 
    77 */ 
    88class HM_Backup { 
  • backupwordpress/trunk/plugin.php

    r600034 r602026  
    66Description: Simple automated backups of your WordPress powered website. Once activated you'll find me under <strong>Tools &rarr; Backups</strong>. 
    77Author: Human Made Limited 
    8 Version: 2.0 Beta 5 
     8Version: 2.0 RC 1 
    99Author URI: http://hmn.md/ 
    1010*/ 
     
    7272function hmbkp_init() { 
    7373 
    74     hmbkp_setup_default_schedules(); 
    75  
    7674    $plugin_data = get_plugin_data( __FILE__ ); 
    7775 
     
    9593            'update'                => __( 'Update', 'hmbkp' ), 
    9694            'cancel'                => __( 'Cancel', 'hmbkp' ), 
    97             'delete_schedule'       => __( "Are you sure you want to delete this schedule? All of it's backups will also be deleted.\n\n'Cancel' to go back, 'OK' to delete.\n", 'hmbkp' ), 
    98             'delete_backup'         => __( "Are you sure you want to delete this backup?\n\n'Cancel' to go back, 'OK' to delete.\n", 'hmbkp' ), 
    99             'remove_exclude_rule'   => __( "Are you sure you want to remove this exclude rule?\n\n'Cancel' to go back, 'OK' to delete.\n", 'hmbkp' ), 
    100             'remove_old_backups'    => __( "Reducing the number of backups that are stored on this server will cause some of your existing backups to be deleted, are you sure that's what you want?\n\n'Cancel' to go back, 'OK' to delete.\n", 'hmbkp' ) 
     95            'delete_schedule'       => __( 'Are you sure you want to delete this schedule? All of it\'s backups will also be deleted.' ) . "\n\n" . __( '\'Cancel\' to go back, \'OK\' to delete.', 'hmbkp' ) . "\n", 
     96            'delete_backup'         => __( 'Are you sure you want to delete this backup?', 'hmbkp' ) . "\n\n" . __( '\'Cancel\' to go back, \'OK\' to delete.', 'hmbkp' ) . "\n", 
     97            'remove_exclude_rule'   => __( 'Are you sure you want to remove this exclude rule?', 'hmbkp' ) . "\n\n" . __( '\'Cancel\' to go back, \'OK\' to delete.', 'hmbkp' ) . "\n", 
     98            'remove_old_backups'    => __( 'Reducing the number of backups that are stored on this server will cause some of your existing backups to be deleted, are you sure that\'s what you want?', 'hmbkp' ) . "\n\n" . __( '\'Cancel\' to go back, \'OK\' to delete.', 'hmbkp' ) . "\n" 
    10199        ) ); 
    102100 
     
    105103 
    106104    } 
     105 
     106    hmbkp_setup_default_schedules(); 
    107107 
    108108    // Handle any advanced option changes 
     
    128128require_once( HMBKP_PLUGIN_PATH . '/functions/core.php' ); 
    129129require_once( HMBKP_PLUGIN_PATH . '/functions/interface.php' ); 
    130 require_once( HMBKP_PLUGIN_PATH . '/functions/backup.php' ); 
    131130 
    132131// Load Services 
  • backupwordpress/trunk/readme.txt

    r598091 r602026  
    11=== BackUpWordPress === 
    2 Contributors: humanmade, joehoyle, mattheu, tcrsavage, willmot 
     2Contributors: humanmade, joehoyle, mattheu, tcrsavage, willmot, cuvelier 
    33Tags: back up, backup, backups, database, zip, db, files, archive, wp-cli, humanmade 
    44Requires at least: 3.3.3 
    5 Tested up to: 3.5-alpha-21684 
    6 Stable tag: 1.6.9 
     5Tested up to: 3.4.2 
     6Stable tag: 2.0 
    77 
    88Simple automated back ups of your WordPress powered website. 
     
    1010== Description == 
    1111 
    12 BackUpWordPress will back up your entire site including your database and all your files once every day. 
     12BackUpWordPress will back up your entire site including your database and all your files on a schedule that suits you. 
    1313 
    1414= Features = 
    1515 
     16* Manage multiple schedules. 
    1617* Super simple to use, no setup required. 
    1718* Uses `zip` and `mysqldump` for faster back ups if they are available. 
     
    2021* Works on Linux & Windows Server. 
    2122* Exclude files and folders from your back ups. 
    22 * Control advanced settings by defining any of the optional `Constants`. 
    2323* Good support should you need help. 
    24 * (Partial) Spanish & Russian translations. 
     24* Translations for Spanish, German, Chinese, Romanian, Russian, Serbian, Lithuanian, Italian, Czech, Dutch, French, Basque. 
    2525 
    2626= Help develop this plugin = 
    2727 
    28 The BackUpWordPress plugin is hosted github, if you want to help out with development or testing then head over to https://github.com/humanmade/backupwordpress/. 
     28The BackUpWordPress plugin is hosted GitHub, if you want to help out with development or testing then head over to https://github.com/humanmade/backupwordpress/. 
    2929 
    3030= Translations = 
     
    9898== Screenshots == 
    9999 
    100 1. Simple Automated Backups 
     1001. Manage multiple schedules. 
     1012. Choose your schedule, backup type, number of backups to keep and whether to recieve a notification email. 
     1023. Easily manage exclude rules and see exactly which files are included and excluded from your backup. 
    101103 
    102104== Changelog == 
     105 
     106#### 2.0 
     107 
     108* Ability to have multiple schedules with separate settings & excludes per schedule. 
     109* Ability to manage exclude rules and see exactly which files are included and excluded. 
     110* Fix an issue with sites with an `open_basedir` restriction. 
     111* Backups should now be much more reliable in low memory environments. 
     112* Lots of other minor improvements and bug fixes. 
    103113 
    104114#### 1.6.9 
Note: See TracChangeset for help on using the changeset viewer.