Plugin Directory

Changeset 876572


Ignore:
Timestamp:
03/17/2014 01:13:32 PM (12 years ago)
Author:
willmot
Message:

BackUpWordPress 2.6

Location:
backupwordpress/trunk
Files:
20 edited

Legend:

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

    r859574 r876572  
    1515
    1616    if ( is_wp_error( $deleted ) )
    17         echo $deleted->get_error_message();
     17        wp_die( $deleted->get_error_message() );
    1818
    1919    wp_safe_redirect( remove_query_arg( array( 'hmbkp_delete_backup', '_wpnonce' ) ), 303 );
     
    6868    check_ajax_referer( 'hmbkp_nonce', 'nonce' );
    6969
    70     // Fixes an issue on servers which only allow a single session per client 
     70    // Fixes an issue on servers which only allow a single session per client
    7171    session_write_close();
    7272
     
    159159        unlink( trailingslashit( hmbkp_path() ) . $schedule->get_running_backup_filename() );
    160160
     161    if ( $schedule->get_schedule_running_path() && file_exists( $schedule->get_schedule_running_path() ) )
     162        unlink( $schedule->get_schedule_running_path() );
     163
    161164    hmbkp_cleanup();
    162165
     
    251254    if ( is_wp_error( $response ) ) {
    252255
    253         echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has detected a problem.', 'hmbkp' ) . '</strong> ' . sprintf( __( '%1$s is returning a %2$s response which could mean cron jobs aren\'t getting fired properly. BackUpWordPress relies on wp-cron to run scheduled back ups. See the %3$s for more details.', 'hmbkp' ), '<code>wp-cron.php</code>', '<code>' . $response->get_error_message() . '</code>', '<a href="http://wordpress.org/extend/plugins/backupwordpress/faq/">FAQ</a>' ) . '</p></div>';
     256        echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has detected a problem.', 'hmbkp' ) . '</strong> ' . sprintf( __( '%1$s is returning a %2$s response which could mean cron jobs aren\'t getting fired properly. BackUpWordPress relies on wp-cron to run scheduled backups. See the %3$s for more details.', 'hmbkp' ), '<code>wp-cron.php</code>', '<code>' . $response->get_error_message() . '</code>', '<a href="http://wordpress.org/extend/plugins/backupwordpress/faq/">FAQ</a>' ) . '</p></div>';
    254257
    255258        update_option( 'hmbkp_wp_cron_test_failed', true );
     
    257260    } elseif ( wp_remote_retrieve_response_code( $response ) != 200 ) {
    258261
    259         echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has detected a problem.', 'hmbkp' ) . '</strong> ' . sprintf( __( '%1$s is returning a %2$s response which could mean cron jobs aren\'t getting fired properly. BackUpWordPress relies on wp-cron to run scheduled back ups. See the %3$s for more details.', 'hmbkp' ), '<code>wp-cron.php</code>', '<code>' . esc_html( wp_remote_retrieve_response_code( $response ) ) . ' ' . esc_html( get_status_header_desc( wp_remote_retrieve_response_code( $response ) ) ) . '</code>', '<a href="http://wordpress.org/extend/plugins/backupwordpress/faq/">FAQ</a>' ) . '</p></div>';
     262        echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has detected a problem.', 'hmbkp' ) . '</strong> ' . sprintf( __( '%1$s is returning a %2$s response which could mean cron jobs aren\'t getting fired properly. BackUpWordPress relies on wp-cron to run scheduled backups. See the %3$s for more details.', 'hmbkp' ), '<code>wp-cron.php</code>', '<code>' . esc_html( wp_remote_retrieve_response_code( $response ) ) . ' ' . esc_html( get_status_header_desc( wp_remote_retrieve_response_code( $response ) ) ) . '</code>', '<a href="http://wordpress.org/extend/plugins/backupwordpress/faq/">FAQ</a>' ) . '</p></div>';
    260263
    261264        update_option( 'hmbkp_wp_cron_test_failed', true );
     
    328331 * Validate and either return errors or update the schedule
    329332 */
    330 function hmnkp_edit_schedule_submit() {
     333function hmbkp_edit_schedule_submit() {
    331334
    332335    if ( empty( $_GET['hmbkp_schedule_id'] ) )
     
    337340    $errors = array();
    338341
    339 
    340     if ( isset( $_GET['hmbkp_schedule_type'] ) ) {
    341 
    342         $schedule_type = sanitize_text_field( $_GET['hmbkp_schedule_type'] );
    343 
    344         if ( ! trim( $schedule_type ) )
    345             $errors['hmbkp_schedule_type'] = __( 'Backup type cannot be empty', 'hmbkp' );
    346 
    347         elseif ( ! in_array( $schedule_type, array( 'complete', 'file', 'database' ) ) )
    348             $errors['hmbkp_schedule_type'] = __( 'Invalid backup type', 'hmbkp' );
    349 
     342    // called from an extension
     343    if ( isset( $_GET['is_destination_form'] ) ) {
     344
     345        // Save the service options
     346        foreach ( HMBKP_Services::get_services( $schedule ) as $service )
     347            $errors = array_merge( $errors, $service->save() );
     348
     349        $schedule->save();
     350
     351        if ( empty( $errors ) )
     352            wp_send_json_success();
    350353        else
     354            wp_send_json_error( $errors );
     355
     356    } else {
     357
     358        $schedule_settings = array();
     359
     360        if ( isset( $_GET['hmbkp_schedule_recurrence'] ) ) {
     361
     362            $hmbkp_schedule_recurrence = $_GET['hmbkp_schedule_recurrence'];
     363
     364            if ( isset( $_GET['hmbkp_schedule_type'] ) ) {
     365
     366                $schedule_type = sanitize_text_field( $_GET['hmbkp_schedule_type'] );
     367
     368                if ( ! trim( $schedule_type ) )
     369                    $errors['hmbkp_schedule_type'] = __( 'Backup type cannot be empty', 'hmbkp' );
     370
     371                elseif ( ! in_array( $schedule_type, array( 'complete', 'file', 'database' ) ) )
     372                    $errors['hmbkp_schedule_type'] = __( 'Invalid backup type', 'hmbkp' );
     373
     374                else
     375                    $schedule_settings['schedule_type'] = $schedule_type;
     376
     377            }
     378
     379            if ( isset( $_GET['hmbkp_schedule_recurrence']['hmbkp_type'] ) ) {
     380                $hmbkp_schedule_recurrence_type = sanitize_text_field( $_GET['hmbkp_schedule_recurrence']['hmbkp_type'] );
     381
     382                if ( empty( $hmbkp_schedule_recurrence_type ) )
     383                    $errors['hmbkp_schedule_recurrence']['hmbkp_type'] = __( 'Schedule cannot be empty', 'hmbkp' );
     384
     385                elseif ( ! in_array( $hmbkp_schedule_recurrence_type, array_keys( hmbkp_get_cron_schedules() ) ) && $hmbkp_schedule_recurrence_type !== 'manually' )
     386                    $errors['hmbkp_schedule_recurrence']['hmbkp_type'] = __( 'Invalid schedule', 'hmbkp' );
     387
     388            }
     389
     390            if ( 'manually' !== $hmbkp_schedule_recurrence_type ) {
     391
     392                if ( isset( $_GET['hmbkp_schedule_recurrence']['hmbkp_schedule_start_day_of_week'] ) ) {
     393
     394                    $hmbkp_schedule_time['day_of_week'] = sanitize_text_field( $_GET['hmbkp_schedule_recurrence']['hmbkp_schedule_start_day_of_week'] );
     395
     396                    if ( ! in_array( $hmbkp_schedule_time['day_of_week'], array( 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday' ) ) )
     397                        $errors['hmbkp_schedule_start_day_of_week'] = __( 'Day of week must be an integer between 1 and 7', 'backupwordpress' );
     398
     399                }
     400
     401                if ( isset( $_GET['hmbkp_schedule_recurrence']['hmbkp_schedule_start_day_of_month'] ) ) {
     402
     403                    $hmbkp_schedule_time['day_of_month'] = absint( $_GET['hmbkp_schedule_recurrence']['hmbkp_schedule_start_day_of_month'] );
     404
     405                    $options = array(
     406                        'min_range' => 1,
     407                        'max_range' => 31
     408                    );
     409
     410                    if ( false === filter_var( $hmbkp_schedule_time['day_of_month'], FILTER_VALIDATE_INT, array( 'options' => $options ) ) )
     411                        $errors['hmbkp_schedule_start_day_of_month'] = __( 'Day of month must be between 1 and 31', 'backupwordpress' );
     412
     413                }
     414
     415                if ( isset( $_GET['hmbkp_schedule_recurrence']['hmbkp_schedule_start_hours'] ) ) {
     416
     417                    $hmbkp_schedule_time['hours'] = absint( $_GET['hmbkp_schedule_recurrence']['hmbkp_schedule_start_hours'] );
     418
     419                    $options = array(
     420                        'min_range' => 1,
     421                        'max_range' => 23
     422                    );
     423
     424                    if ( false === filter_var( $hmbkp_schedule_time['hours'], FILTER_VALIDATE_INT, array( 'options' => $options ) ) )
     425                        $errors['hmbkp_schedule_start_hours'] = __( 'Hours must be between 1 and 23', 'backupwordpress' );
     426
     427                }
     428
     429                if ( isset( $_GET['hmbkp_schedule_recurrence']['hmbkp_schedule_start_minutes'] ) ) {
     430
     431                    $hmbkp_schedule_time['minutes'] = absint( $_GET['hmbkp_schedule_recurrence']['hmbkp_schedule_start_minutes'] );
     432
     433                    $options = array(
     434                        'min_range' => 0,
     435                        'max_range' => 59
     436                    );
     437
     438                    if ( false === filter_var( $hmbkp_schedule_time['minutes'], FILTER_VALIDATE_INT, array( 'options' => $options ) ) )
     439                        $errors['hmbkp_schedule_start_minutes'] = __( 'Minutes must be between 0 and 59', 'backupwordpress' );
     440
     441                }
     442
     443            }
     444        }
     445
     446        if ( isset( $_GET['hmbkp_schedule_max_backups'] ) ) {
     447
     448            $schedule_max_backups = sanitize_text_field( $_GET['hmbkp_schedule_max_backups'] );
     449
     450            if ( empty( $schedule_max_backups ) )
     451                $errors['hmbkp_schedule_max_backups'] = __( 'Max backups can\'t be empty', 'hmbkp' );
     452
     453            elseif ( ! is_numeric( $schedule_max_backups ) )
     454                $errors['hmbkp_schedule_max_backups'] = __( 'Max backups must be a number', 'hmbkp' );
     455
     456            elseif ( ! ( $schedule_max_backups >= 1 ) )
     457                $errors['hmbkp_schedule_max_backups'] = __( 'Max backups must be greater than 0', 'hmbkp' );
     458
     459            else
     460                $schedule_settings['schedule_max_backups'] = absint( $schedule_max_backups );
     461
     462        }
     463
     464        // Save the service options
     465        foreach ( HMBKP_Services::get_services( $schedule ) as $service ) {
     466            $errors = array_merge( $errors, $service->save() );
     467        }
     468
     469        if ( $errors ) {
     470            wp_send_json_error( $errors );
     471
     472        } else {
     473
     474            if ( isset( $hmbkp_schedule_time ) )
     475                $schedule->set_schedule_start_time( hmbkp_determine_start_time( $hmbkp_schedule_recurrence_type, $hmbkp_schedule_time ) );
     476
     477            $schedule->set_reoccurrence( $hmbkp_schedule_recurrence_type );
    351478            $schedule->set_type( $schedule_type );
     479            $schedule->set_max_backups( $schedule_settings['schedule_max_backups'] );
     480
     481            $schedule->save();
     482
     483            // Remove any old backups in-case max backups was reduced
     484            $schedule->delete_old_backups();
     485
     486            wp_send_json_success();
     487
     488        }
    352489
    353490    }
    354491
    355     if ( isset( $_GET['hmbkp_schedule_reoccurrence'] ) ) {
    356 
    357         $schedule_reoccurrence = sanitize_text_field( $_GET['hmbkp_schedule_reoccurrence'] );
    358 
    359         if ( empty( $schedule_reoccurrence ) )
    360             $errors['hmbkp_schedule_reoccurrence'] = __( 'Schedule cannot be empty', 'hmbkp' );
    361 
    362         elseif ( ! in_array( $schedule_reoccurrence, array_keys( $schedule->get_cron_schedules() ) ) && $schedule_reoccurrence !== 'manually' )
    363             $errors['hmbkp_schedule_reoccurrence'] = __( 'Invalid schedule', 'hmbkp' );
    364 
    365         else
    366             $schedule->set_reoccurrence( $schedule_reoccurrence );
    367 
    368     }
    369 
    370     if ( isset( $_GET['hmbkp_schedule_max_backups'] ) ) {
    371 
    372         $schedule_max_backups = sanitize_text_field( $_GET['hmbkp_schedule_max_backups'] );
    373 
    374         if ( empty( $schedule_max_backups ) )
    375             $errors['hmbkp_schedule_max_backups'] = __( 'Max backups can\'t be empty', 'hmbkp' );
    376 
    377         elseif ( ! is_numeric( $schedule_max_backups ) )
    378             $errors['hmbkp_schedule_max_backups'] = __( 'Max backups must be a number', 'hmbkp' );
    379 
    380         elseif ( ! ( $schedule_max_backups >= 1 ) )
    381             $errors['hmbkp_schedule_max_backups'] = __( 'Max backups must be greater than 0', 'hmbkp' );
    382 
    383         else
    384             $schedule->set_max_backups( (int) $schedule_max_backups );
    385 
    386         // Remove any old backups in-case max backups was reduced
    387         $schedule->delete_old_backups();
    388 
    389     }
    390 
    391     // Save the service options
    392     foreach ( HMBKP_Services::get_services( $schedule ) as $service )
    393         $errors = array_merge( $errors, $service->save() );
    394 
    395     $schedule->save();
    396 
    397     if ( $errors )
    398         echo json_encode( $errors );
    399 
    400     die;
    401 
    402 }
    403 add_action( 'wp_ajax_hmnkp_edit_schedule_submit', 'hmnkp_edit_schedule_submit' );
     492    die();
     493
     494}
     495add_action( 'wp_ajax_hmbkp_edit_schedule_submit', 'hmbkp_edit_schedule_submit' );
    404496
    405497/**
     
    553645 * @return void
    554646 */
    555 function hmbkp_load_enable_support () {
     647function hmbkp_load_enable_support() {
    556648
    557649    check_ajax_referer( 'hmbkp_nonce', '_wpnonce' );
  • backupwordpress/trunk/admin/backups.php

    r848987 r876572  
    3838    <?php endforeach; ?>
    3939
    40         <li><a class="colorbox" href="<?php esc_attr_e( esc_url( add_query_arg( array( 'action' => 'hmbkp_add_schedule_load' ), is_multisite() ? admin_url( 'admin-ajax.php' ) : network_admin_url( 'admin-ajax.php' ) ) ) ); ?>"> + <?php _e( 'add schedule', 'hmbkp' ); ?></a></li>
     40        <li><a class="colorbox" href="<?php esc_attr_e( esc_url( add_query_arg( array( 'action' => 'hmbkp_add_schedule_load' ), is_multisite() ? network_admin_url( 'admin-ajax.php' ) : admin_url( 'admin-ajax.php' ) ) ) ); ?>"> + <?php _e( 'add schedule', 'hmbkp' ); ?></a></li>
    4141
    4242    </ul>
  • backupwordpress/trunk/admin/constants.php

    r838473 r876572  
    11<div id="hmbkp-constants">
    22
    3     <p><?php printf( __( 'You can %1$s any of the following %2$s in your %3$s to control advanced settings. %4$s. Defined %5$s will be highlighted.', 'hmbkp' ), '<code>define</code>', '<code>' . __( 'Constants', 'hmbkp' ) . '</code>', '<code>wp-config.php</code>', '<a href="http://codex.wordpress.org/Editing_wp-config.php">' . __( 'The Codex can help', 'hmbkp' ) . '</a>', '<code>' . __( 'Constants', 'hmbkp' ) . '</code>' ); ?></p>
     3    <p><?php printf( __( 'You can %1$s any of the following %2$s in your %3$s to control advanced settings. %4$s. Defined %5$s will be highlighted.', 'hmbkp' ), '<code>define</code>', '<code>' . __( 'Constants', 'hmbkp' ) . '</code>', '<code>wp-config.php</code>', '<a href="http://codex.wordpress.org/Editing_wp-config.php">' . __( 'The Codex can help', 'hmbkp' ) . '</a>', '<code>' . __( 'Constants', 'hmbkp' ) . '</code>' ); ?></p>
    44
    5     <dl>
     5    <table class="widefat">
    66
    7         <dt<?php if ( defined( 'HMBKP_PATH' ) ) { ?> class="hmbkp_active"<?php } ?>><code>HMBKP_PATH</code></dt>
    8         <dd><p><?php printf( __( 'The path to folder you would like to store your backup files in, defaults to %s.', 'hmbkp' ), '<code>' . esc_html( hmbkp_path_default() ) . '</code>' ); ?></p><p class="example"><?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_PATH', '/home/willmot/backups' );</code></p></dd>
     7        <tr<?php if ( defined( 'HMBKP_PATH' ) ) { ?> class="hmbkp_active"<?php } ?>>
    98
    10         <dt<?php if ( defined( 'HMBKP_MYSQLDUMP_PATH' ) ) { ?> class="hmbkp_active"<?php } ?>><code>HMBKP_MYSQLDUMP_PATH</code></dt>
    11         <dd><p><?php printf( __( 'The path to your %1$s executable. Will be used for the %2$s part of the back up if available.', 'hmbkp' ), '<code>mysqldump</code>', '<code>' . __( 'database', 'hmbkp' ) . '</code>' ); ?></p><p class="example"><?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_MYSQLDUMP_PATH', '/opt/local/bin/mysqldump' );</code></p></dd>
     9            <td><code>HMBKP_PATH</code></td>
    1210
    13         <dt<?php if ( defined( 'HMBKP_ZIP_PATH' ) ) { ?> class="hmbkp_active"<?php } ?>><code>HMBKP_ZIP_PATH</code></dt>
    14         <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>
     11            <td>
    1512
    16         <dt<?php if ( defined( 'HMBKP_EXCLUDE' ) ) { ?> class="hmbkp_active"<?php } ?>><code>HMBKP_EXCLUDE</code></dt>
    17         <dd><p><?php _e( 'Comma separated list of files or directories to exclude, the backups directory is automatically excluded.', 'hmbkp' ); ?><p class="example"><?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_EXCLUDE', '/wp-content/uploads/, /stats/, .svn/, *.txt' );</code></p></dd>
     13                <?php if ( defined( 'HMBKP_PATH' ) ) { ?>
     14                    <p><?php printf( __( 'You\'ve set it to: %s', 'hmbkp' ), '<code>' . HMBKP_PATH . '</code>' ); ?></p>
     15                <?php } ?>
    1816
    19         <dt<?php if ( defined( 'HMBKP_CAPABILITY' ) ) { ?> class="hmbkp_active"<?php } ?>><code>HMBKP_CAPABILITY</code></dt>
    20         <dd><p><?php printf( __( 'The capability to use when calling %1$s. Defaults to %2$s.', 'hmbkp' ), '<code>add_menu_page</code>', '<code>manage_options</code>' ); ?><p class="example"><?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_CAPABILITY', 'edit_posts' );</code></p></dd>
     17                <p><?php printf( __( 'The path to folder you would like to store your backup files in, defaults to %s.', 'hmbkp' ), '<code>' . esc_html( hmbkp_path_default() ) . '</code>' ); ?> <?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_PATH', '/home/willmot/backups' );</code></p>
    2118
    22         <dt<?php if ( defined( 'HMBKP_ROOT' ) ) { ?> class="hmbkp_active"<?php } ?>><code>HMBKP_ROOT</code></dt>
    23         <dd><p><?php printf( __( 'The root directory that is backed up. Defaults to %s.', 'hmbkp' ), '<code>' . HM_Backup::get_home_path() . '</code>' ); ?><p class="example"><?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_ROOT', ABSPATH . 'wp/' );</code></p></dd>
     19            </td>
    2420
    25         <dt<?php if ( defined( 'HMBKP_SCHEDULE_TIME' ) && HMBKP_SCHEDULE_TIME !== '11pm' ) { ?> class="hmbkp_active"<?php } ?>><code>HMBKP_SCHEDULE_TIME</code></dt>
    26         <dd><p><?php printf( __( 'The time that your schedules should run. Defaults to %s.', 'hmbkp' ), '<code>23:00</code>' ); ?><p class="example"><?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_SCHEDULE_TIME', '07:30' );</code></p></dd>
     21        </tr>
    2722
    28         <?php
     23        <tr<?php if ( defined( 'HMBKP_MYSQLDUMP_PATH' ) ) { ?> class="hmbkp_active"<?php } ?>>
    2924
    30                 foreach ( HMBKP_Services::get_services() as $file => $service )
    31                     echo wp_kses_post( call_user_func( array( $service, 'constant' ) ) ); ?>
     25            <td><code>HMBKP_MYSQLDUMP_PATH</code></td>
    3226
    33     </dl>
     27            <td>
     28
     29                <?php if ( defined( 'HMBKP_MYSQLDUMP_PATH' ) ) { ?>
     30                    <p><?php printf( __( 'You\'ve set it to: %s', 'hmbkp' ), '<code>' . HMBKP_MYSQLDUMP_PATH . '</code>' ); ?></p>
     31                <?php } ?>
     32
     33                <p><?php printf( __( 'The path to your %1$s executable. Will be used for the %2$s part of the back up if available.', 'hmbkp' ), '<code>mysqldump</code>', '<code>' . __( 'database', 'hmbkp' ) . '</code>' ); ?> <?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_MYSQLDUMP_PATH', '/opt/local/bin/mysqldump' );</code></p>
     34
     35            </td>
     36
     37        </tr>
     38
     39        <tr<?php if ( defined( 'HMBKP_ZIP_PATH' ) ) { ?> class="hmbkp_active"<?php } ?>>
     40
     41            <td><code>HMBKP_ZIP_PATH</code></td>
     42
     43            <td>
     44
     45                <?php if ( defined( 'HMBKP_ZIP_PATH' ) ) { ?>
     46                    <p><?php printf( __( 'You\'ve set it to: %s', 'hmbkp' ), '<code>' . HMBKP_ZIP_PATH . '</code>' ); ?></p>
     47                <?php } ?>
     48
     49                <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>' ); ?> <?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_ZIP_PATH', '/opt/local/bin/zip' );</code></p>
     50
     51            </td>
     52
     53        </tr>
     54
     55        <tr<?php if ( defined( 'HMBKP_EXCLUDE' ) ) { ?> class="hmbkp_active"<?php } ?>>
     56
     57            <td><code>HMBKP_EXCLUDE</code></td>
     58
     59            <td>
     60
     61                <?php if ( defined( 'HMBKP_EXCLUDE' ) ) { ?>
     62                    <p><?php printf( __( 'You\'ve set it to: %s', 'hmbkp' ), '<code>' . HMBKP_EXCLUDE . '</code>' ); ?></p>
     63                <?php } ?>
     64
     65                <p><?php _e( 'Comma separated list of files or directories to exclude, the backups directory is automatically excluded.', 'hmbkp' ); ?> <?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_EXCLUDE', '/wp-content/uploads/, /stats/, .svn/, *.txt' );</code></p>
     66
     67            </td>
     68
     69        </tr>
     70
     71        <tr<?php if ( defined( 'HMBKP_CAPABILITY' ) ) { ?> class="hmbkp_active"<?php } ?>>
     72
     73            <td><code>HMBKP_CAPABILITY</code></td>
     74
     75            <td>
     76
     77                <?php if ( defined( 'HMBKP_CAPABILITY' ) ) { ?>
     78                    <p><?php printf( __( 'You\'ve set it to: %s', 'hmbkp' ), '<code>' . HMBKP_CAPABILITY . '</code>' ); ?></p>
     79                <?php } ?>
     80
     81                <p><?php printf( __( 'The capability to use when calling %1$s. Defaults to %2$s.', 'hmbkp' ), '<code>add_menu_page</code>', '<code>manage_options</code>' ); ?> <?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_CAPABILITY', 'edit_posts' );</code></p>
     82
     83            </td>
     84
     85        </tr>
     86
     87        <tr<?php if ( defined( 'HMBKP_ROOT' ) ) { ?> class="hmbkp_active"<?php } ?>>
     88
     89            <td><code>HMBKP_ROOT</code></td>
     90
     91            <td>
     92
     93                <?php if ( defined( 'HMBKP_ROOT' ) ) { ?>
     94                    <p><?php printf( __( 'You\'ve set it to: %s', 'hmbkp' ), '<code>' . HMBKP_ROOT . '</code>' ); ?></p>
     95                <?php } ?>
     96
     97                <p><?php printf( __( 'The root directory that is backed up. Defaults to %s.', 'hmbkp' ), '<code>' . HM_Backup::get_home_path() . '</code>' ); ?> <?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_ROOT', ABSPATH . 'wp/' );</code></p>
     98
     99            </td>
     100
     101        </tr>
     102
     103        <tr<?php if ( defined( 'HMBKP_SCHEDULE_TIME' ) && HMBKP_SCHEDULE_TIME !== '11pm' ) { ?> class="hmbkp_active"<?php } ?>>
     104
     105            <td><code>HMBKP_SCHEDULE_TIME</code></td>
     106
     107            <td>
     108
     109                <?php if ( defined( 'HMBKP_SCHEDULE_TIME' ) && HMBKP_SCHEDULE_TIME !== '11pm' ) { ?>
     110                    <p><?php printf( __( 'You\'ve set it to: %s', 'hmbkp' ), '<code>' . HMBKP_SCHEDULE_TIME . '</code>' ); ?></p>
     111                <?php } ?>
     112
     113                <p><?php printf( __( 'The time that your schedules should run. Defaults to %s.', 'hmbkp' ), '<code>23:00</code>' ); ?> <?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_SCHEDULE_TIME', '07:30' );</code></p>
     114
     115            </td>
     116
     117        </tr>
     118
     119        <?php foreach ( HMBKP_Services::get_services() as $file => $service )
     120            echo wp_kses_post( call_user_func( array( $service, 'constant' ) ) ); ?>
     121
     122    </table>
    34123
    35124</div>
  • backupwordpress/trunk/admin/page.php

    r859574 r876572  
    11<div class="wrap">
    2 
    3     <?php screen_icon( HMBKP_PLUGIN_SLUG ); ?>
    42
    53    <h2>
     
    1210        <?php } else { ?>
    1311
    14         <a id="intercom-info" class="colorbox add-new-h2" href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'load_enable_support' ), is_multisite() ? admin_url( 'admin-ajax.php' ) : network_admin_url( 'admin-ajax.php' ) ), 'hmbkp_nonce' ); ?>">Enable Support</a>
     12        <a id="intercom-info" class="colorbox add-new-h2" href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'load_enable_support' ), is_multisite() ? admin_url( 'admin-ajax.php' ) : network_admin_url( 'admin-ajax.php' ) ), 'hmbkp_nonce' ); ?>"><?php _e( 'Enable Support', 'hmbkp' ); ?></a>
    1513
    1614        <?php } ?>
     
    2321    <?php include_once( HMBKP_PLUGIN_PATH . '/admin/backups.php' ); ?>
    2422
    25 <?php else : ?>
    26 
    27     <p><strong><?php _e( 'You need to fix the issues detailed above before BackUpWordPress can start.', 'hmbkp' ); ?></strong></p>
    28 
    29 <?php endif; ?>
    30 
    3123    <p class="howto"><?php printf( __( 'If you\'re finding BackUpWordPress useful, please %1$s rate it on the plugin directory. %2$s', 'hmbkp' ), '<a href="http://wordpress.org/support/view/plugin-reviews/backupwordpress">', '</a>' ); ?></p>
    3224
    3325    <p class="howto"><?php _e( 'If you need help getting things working then check the FAQ by clicking on help in the top right hand corner of this page.', 'hmbkp' ); ?></p>
    3426
    35     <p class="howto"><strong><?php printf( __( 'Wish you could store your backups in a safer place? Our %1$spremium extensions%2$s enable automatic backups to Dropbox, FTP, Google Drive and more.', 'hmbkp' ), '<a href="http://bwp.hmn.md/?utm_source=wordpress-org&utm_medium=wp-admin&utm_campaign=freeplugin">', '</a>' ); ?></strong></p>
     27    <p class="howto"><strong><?php printf( __( 'Wish you could store your backups in a safer place? Our %1$spremium extensions%2$s enable automatic backups to Dropbox, FTP, Google Drive and more.', 'hmbkp' ), '<a href="https://bwp.hmn.md/?utm_source=wordpress-org&utm_medium=wp-admin&utm_campaign=freeplugin">', '</a>' ); ?></strong></p>
     28
     29<?php endif; ?>
    3630
    3731</div>
  • backupwordpress/trunk/admin/schedule-form.php

    r838473 r876572  
    77        <legend><?php _e( 'Schedule Settings', 'hmbkp' ); ?></legend>
    88
    9         <label>
     9        <div>
    1010
    11             <?php _e( 'Backup', 'hmbkp' ); ?>
     11            <label for="hmbkp_schedule_type"><?php _e( 'Backup', 'hmbkp' ); ?></label>
    1212
    13             <select name="hmbkp_schedule_type" id="hmbkp_schedule_type">
    14                 <option<?php selected( $schedule->get_type(), 'complete' ); ?> value="complete"><?php _e( 'Both Database &amp; files', 'hmbkp' ); ?></option>
    15                 <option<?php selected( $schedule->get_type(), 'file' ); ?> value="file"><?php _e( 'Files only', 'hmbkp' ); ?></option>
    16                 <option<?php selected( $schedule->get_type(), 'database' ); ?> value="database"><?php _e( 'Database only', 'hmbkp' ); ?></option>
    17             </select>
     13                <select name="hmbkp_schedule_type" id="hmbkp_schedule_type">
    1814
    19         </label>
     15                <option<?php selected( $schedule->get_type(), 'complete' ); ?> value="complete"><?php _e( 'Both Database &amp; files', 'hmbkp' ); ?></option>
    2016
    21         <label>
     17                <option<?php selected( $schedule->get_type(), 'file' ); ?> value="file"><?php _e( 'Files only', 'hmbkp' ); ?></option>
    2218
    23             <?php _e( 'Schedule', 'hmbkp' ); ?>
     19                <option<?php selected( $schedule->get_type(), 'database' ); ?> value="database"><?php _e( 'Database only', 'hmbkp' ); ?></option>
    2420
    25             <select name="hmbkp_schedule_reoccurrence" id="hmbkp_schedule_reoccurrence">
     21            </select>
    2622
    27                 <option value="manually"><?php _e( 'Manual Only', 'hmbkp' ); ?></option>
     23        </div>
    2824
    29           <?php foreach ( $schedule->get_cron_schedules() as $cron_schedule => $cron_details ) : ?>
     25        <div>
    3026
    31                 <option <?php selected( $schedule->get_reoccurrence(), $cron_schedule ); ?> value="<?php echo esc_attr( $cron_schedule ); ?>">
     27            <label for="hmbkp_schedule_recurrence_type"><?php _e( 'Schedule', 'hmbkp' ); ?></label>
    3228
    33                             <?php esc_html_e( $cron_details['display'], 'hmbkp' ); ?>
     29            <select name="hmbkp_schedule_recurrence[hmbkp_type]" id="hmbkp_schedule_recurrence_type">
    3430
    35                         </option>
     31                <option value="manually"><?php _e( 'Manual Only', 'hmbkp' ); ?></option>
    3632
    37           <?php endforeach; ?>
     33          <?php foreach ( $schedule->get_cron_schedules() as $cron_schedule => $cron_details ) : ?>
    3834
    39             </select>
     35                <option <?php selected( $schedule->get_reoccurrence(), $cron_schedule ); ?> value="<?php echo esc_attr( $cron_schedule ); ?>">
    4036
    41         </label>
     37                    <?php esc_html_e( $cron_details['display'], 'hmbkp' ); ?>
    4238
    43         <label>
     39                </option>
    4440
    45             <?php _e( 'Number of backups to store on this server', 'hmbkp' ); ?>
     41          <?php endforeach; ?>
    4642
    47             <input type="number" name="hmbkp_schedule_max_backups" min="1" step="1" value="<?php echo esc_attr( $schedule->get_max_backups() ); ?>" />
     43            </select>
    4844
    49             <p class="description"><?php printf( __( 'Past this limit older backups will be deleted automatically. This schedule will store a maximum of %s of backups', 'hmbkp' ), '<code>' . size_format( $schedule->get_filesize() * $schedule->get_max_backups() ) . '</code>' ); ?></p>
     45        </div>
    5046
    51         </label>
     47        <?php if ( ! $start_time = $schedule->get_schedule_start_time() )
     48            $start_time = time(); ?>
    5249
    53         <?php
     50        <div id="start-day" class="recurring-setting">
    5451
    55                 foreach ( HMBKP_Services::get_services( $schedule ) as $service )
    56                     $service->field();
     52            <label for="hmbkp_schedule_start_day_of_week"><?php _e( 'Start Day', 'hmbkp' ); ?></label>
    5753
    58                 ?>
     54            <select id="hmbkp_schedule_start_day_of_week" name="hmbkp_schedule_recurrence[hmbkp_schedule_start_day_of_week]">
    5955
    60         <p class="submit">
     56                <?php $weekdays = array(
     57                    'monday' => __( 'Monday', 'hmbkp' ),
     58                    'tuesday' => __( 'Tuesday', 'hmbkp' ),
     59                    'wednesday' => __( 'Wednesday', 'hmbkp' ),
     60                    'thursday' => __( 'Thursday', 'hmbkp' ),
     61                    'friday' => __( 'Friday', 'hmbkp' ),
     62                    'saturday' => __( 'Saturday', 'hmbkp' ),
     63                    'sunday' => __( 'Sunday', 'hmbkp' )
     64                );
    6165
    62             <button type="submit" class="button-primary"><?php _e( 'Update', 'hmbkp' ); ?></button>
     66                foreach ( $weekdays as $key => $day ) : ?>
     67
     68                    <option value="<?php echo esc_attr( $key ) ?>" <?php selected( strtolower( date( 'l', $start_time ) ), $key ); ?>><?php echo esc_html( $day ); ?></option>
     69
     70                <?php endforeach; ?>
     71
     72            </select>
     73
     74        </div>
     75
     76        <div id="start-date" class="recurring-setting">
     77
     78            <label for="hmbkp_schedule_start_day_of_month"><?php _e( 'Start Day of Month', 'hmbkp' ); ?></label>
     79
     80            <input type="number" min="0" max="31" step="1" id="hmbkp_schedule_start_day_of_month" name="hmbkp_schedule_recurrence[hmbkp_schedule_start_day_of_month]" value="<?php echo esc_attr( date( 'j', $start_time ) ); ?>">
     81
     82        </div>
     83
     84        <div id="schedule-start" class="recurring-setting">
     85
     86            <label for="hmbkp_schedule_start_hours"><?php _e( 'Start time', 'hmbkp' ); ?></label>
     87
     88            <span class="field-group">
     89
     90                <label for="hmbkp_schedule_start_hours"><input type="number" min="0" max="23" step="1" name="hmbkp_schedule_recurrence[hmbkp_schedule_start_hours]" id="hmbkp_schedule_start_hours" value="<?php echo esc_attr( date( 'G', $start_time ) ); ?>">
     91
     92                <?php _e( 'Hours', 'hmbkp' ); ?></label>
     93
     94                <label for="hmbkp_schedule_start_minutes"><input type="number" min="0" max="59" step="1" name="hmbkp_schedule_recurrence[hmbkp_schedule_start_minutes]" id="hmbkp_schedule_start_minutes" value="<?php echo esc_attr( (float) date( 'i', $start_time ) ); ?>">
     95
     96                <?php _e( 'Minutes', 'hmbkp' ); ?></label>
     97
     98            </span>
     99
     100            <p class="twice-js description"><?php _e( 'The second backup will run 12 hours after the first', 'hmbkp' ); ?></p>
     101
     102        </div>
     103
     104        <div>
     105
     106            <label for="hmbkp_schedule_max_backups"><?php _e( 'Number of backups to store on this server', 'hmbkp' ); ?></label>
     107
     108            <input type="number" id="hmbkp_schedule_max_backups" name="hmbkp_schedule_max_backups" min="1" step="1" value="<?php echo esc_attr( $schedule->get_max_backups() ); ?>" />
     109
     110            <p class="description">
     111
     112                <?php printf( __( 'Past this limit older backups will be deleted automatically.', 'hmbkp' ) ); ?>
     113
     114                <?php if ( $schedule->is_filesize_cached() ) {
     115                    printf( __( 'This schedule will store a maximum of %s of backups', 'hmbkp' ), '<code>' . size_format( $schedule->get_filesize() * $schedule->get_max_backups() ) . '</code>' );
     116                } ?>
     117
     118            </p>
     119
     120        </div>
     121
     122        <?php foreach ( HMBKP_Services::get_services( $schedule ) as $service )
     123            $service->field(); ?>
     124
     125        <p class="submit">
     126
     127            <button type="submit" class="button-primary"><?php _e( 'Update', 'hmbkp' ); ?></button>
    63128
    64129        </p>
  • backupwordpress/trunk/admin/schedule.php

    r838473 r876572  
    1616
    1717    case 'hmbkp_hourly' :
    18 
    19         $reoccurrence = date_i18n( 'i', $schedule->get_next_occurrence( false ) ) === '00' ? '<span ' . $next_backup . '>' . __( 'hourly on the hour', 'hmbkp' ) . '</span>' : sprintf( __( 'hourly at %s minutes past the hour', 'hmbkp' ), '<span ' . $next_backup . '>' . str_replace( '0', '', date_i18n( 'i', $schedule->get_next_occurrence( false ) ) ) ) . '</span>';
     18        $reoccurrence = date_i18n( 'i', $schedule->get_next_occurrence( false ) ) === '00' ? '<span ' . $next_backup . '>' . __( 'hourly on the hour', 'hmbkp' ) . '</span>' : sprintf( __( 'hourly at %s minutes past the hour', 'hmbkp' ), '<span ' . $next_backup . '>' . intval( date_i18n( 'i', $schedule->get_next_occurrence( false ) ) ) ) . '</span>';
    2019
    2120    break;
  • backupwordpress/trunk/admin/server-info.php

    r859574 r876572  
    99        <?php foreach ( HMBKP_Requirements::get_requirements( $group ) as $requirement ) : ?>
    1010
     11            <?php if ( ( is_string( $requirement->raw_result() ) && strlen( $requirement->result() ) < 20 ) || is_bool( $requirement->raw_result() ) ) { ?>
     12
    1113            <tr>
    12                 <td><?php echo $requirement->name(); ?></td>
    13                 <td><pre><?php echo $requirement->result(); ?></pre></td>
     14
     15                <td><?php echo esc_html( $requirement->name() ); ?></td>
     16
     17                <td>
     18                    <code><?php echo esc_html( $requirement->result() ); ?></code>
     19                </td>
     20
    1421            </tr>
     22
     23            <?php } else { ?>
     24
     25            <tr>
     26
     27                <td colspan="2">
     28                    <?php echo esc_html( $requirement->name() ); ?>
     29                    <pre><?php echo esc_html( $requirement->result() ); ?></pre>
     30                </td>
     31
     32            </tr>
     33
     34            <?php } ?>
    1535
    1636        <?php endforeach; ?>
  • backupwordpress/trunk/assets/hmbkp.css

    r859574 r876572  
    11#icon-backupwordpress.icon32 { background: url(icon_backupwordpress_32x32.png); }
    22
    3 tfoot p { margin: 0; font-weight: normal; }
    4 #hmbkp-constants dl { overflow: hidden; margin: 20px 0; }
    5 #hmbkp-constants dt { float: left; min-width: 250px; clear: both; padding: 6px; margin: 1px 0; cursor: pointer; }
    6 #hmbkp-constants dd { color: #666; padding: 7px 0 7px 250px; border-top: 1px solid #DFDFDF; margin: 0; cursor: pointer; min-height: 40px; }
    7 #hmbkp-constants dd:last-child { border-bottom: 1px solid #DFDFDF; }
    8 #hmbkp-constants dt:not(.hmbkp_active) + dd { background: #F9F9F9; }
    9 #hmbkp-constants dd .example { white-space: nowrap; display: none; }
    10 #hmbkp-constants dd p { margin: 0; }
    11 #hmbkp-constants dt:not(.hmbkp_active):hover + dd, #hmbkp-constants dt:not(.hmbkp_active) + dd:hover { background-color: #FFF; }
    12 #hmbkp-constants dd:hover p, #hmbkp-constants dt:hover + dd p { display: none; }
    13 #hmbkp-constants dd:hover .example, #hmbkp-constants dt:hover + dd .example { display: inline; }
     3tfoot p { margin: 0; font-weight: normal; }#hmbkp-constants dl { overflow: hidden; margin: 20px 0; }
    144
    155.completed th, .completed td { background-color: #FFFFE0; }
    16 .hmbkp_active:before { content: "\00a0 \2713 "; font-size: 11px; }
    17 .hmbkp_active, .hmbkp_active code, #hmbkp-constants .hmbkp_active + dd { background: #E5F7E8; }
     6.hmbkp_active td:first-child > code:before { content: "\00a0 \2713 "; font-size: 11px; }
     7.hmbkp_active { background: #E5F7E8; }
    188.contextual-help-tabs-wrap .updated { margin: 15px 0 0; }
    199
     
    2515.hmbkp_schedule { clear: both; overflow: hidden; }
    2616
    27 
    2817#cboxLoadedContent { margin-bottom: 0; }
    2918
     19.hmbkp-form { overflow: hidden; }
    3020.hmbkp-form fieldset { float: left; }
    3121.js .hmbkp-form fieldset + fieldset { display: none; margin-right: -100%; }
     22form.hmbkp-form div.recurring-setting { display: none; }
    3223
    33 .hmbkp-form label { display: block; line-height: 25px; padding-bottom: 20px; border-bottom: 1px dotted #CCC; margin-bottom: 20px; width: 320px; position: relative; }
     24form.hmbkp-form div { display: block; line-height: 25px; padding-bottom: 20px; border-bottom: 1px dotted #CCC; margin-bottom: 20px; width: 320px; position: relative; }
    3425
    3526.hmbkp-form legend { padding: 0 0 20px; font-size: 1.17em; font-weight: bold; }
    36 .hmbkp-form label > * { float: right; }
     27.hmbkp-form div > select, .hmbkp-form div > input, .hmbkp-form div > span.field-group, .button-right { float: right; }
    3728.hmbkp-form label.hidden { display: none; }
    38 .hmbkp-form label > input[type="text"], .hmbkp-form label > select, .hmbkp-form label > input[type="password"] { min-width: 200px; }
    39 .hmbkp-form label > input[type="checkbox"] { margin-top: 6px; }
    40 .hmbkp-form label .description { line-height: 16px; margin-top: 10px; float: none; }
    41 .hmbkp-form p.submit { margin:0; padding:0; }
     29.hmbkp-form div > input[type="text"], .hmbkp-form div > select, .hmbkp-form div > input[type="password"] { min-width: 200px; }
     30.hmbkp-form div > input[type="checkbox"] { margin-top: 6px; }
     31.hmbkp-form div .description { line-height: 16px; margin-top: 10px; float: none; }
     32.hmbkp-form p.submit { margin: 20px 0 0; padding: 0; }
    4233.hmbkp-form .button-primary { float: right; }
    4334.hmbkp-form [type="number"] { min-width: 50px; width: 50px; }
    44 .hmbkp-error span { position: absolute; top: -14px; right: 1px; color: #FFF; background-color: red; white-space: nowrap; line-height: 16px; font-size: 11px; padding: 0 3px; border-radius: 3px 3px 0 0; }
     35.hmbkp-error span, span.hmbkp-error { position: absolute; top: -14px; right: 1px; color: #FFF; background-color: red; white-space: nowrap; line-height: 16px; font-size: 11px; padding: 0 3px; border-radius: 3px 3px 0 0; }
    4536.hmbkp-error input[type], .hmbkp-error select { border-color: red; border-top-right-radius: 0; }
    46 .hmbkp-edit-schedule-excludes-form .code{word-break: break-word;}
    4737
    4838.hmbkp-form ul { width: 320px; overflow: hidden; }
    49 .hmbkp-form ul.hmbkp_file_list { background-color: #FFF; display: block; border-radius: 4px; box-sizing: border-box; clear: both; box-shadow: inset 0px 0px 2px #CCC; font-size: 11px; }
     39.hmbkp-form ul.hmbkp_file_list { background-color: #FFF; max-height: 200px; overflow-y: scroll; display: block; border-radius: 4px; box-sizing: border-box; clear: both; box-shadow: inset 0px 0px 2px #CCC; font-size: 11px; }
    5040.hmbkp_file_list li { margin: 0; padding: 5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 16px; }
    5141.hmbkp_file_list li + li { border-top: 1px dotted #CCC; }
     
    6656.hmbkp-schedule-actions { font-size: 12px; font-weight: normal; margin: 0 0 0 26px; }
    6757
    68 .hmbkp-ajax-loading, button.hmbkp-ajax-loading { padding-left: 20px; }
    69 .hmbkp-ajax-loading:before {width: 16px;height: 16px; margin-right: 10px; content: ""; background: transparent url('spinner-2x.gif') no-repeat 0 0; background-size: 16px 16px; vertical-align: middle; display: inline-block; }
     58.hmbkp-ajax-loading, button.hmbkp-ajax-loading { padding-left: 20px; position: relative; }
     59.hmbkp-ajax-loading::before { content: ""; width: 16px; height: 16px; background-image: url('spinner-2x.gif'); background-size: 16px 16px; background-repeat: no-repeat; background-position: 0 0; position: absolute; left: -30px; top: 5px; }
    7060
    7161button { height: 14px; }
     
    8373.hmbkp-exclude-preview-open table, .hmbkp-exclude-preview-open .hmbkp-tabs, .hmbkp-exclude-preview-open p.submit { display: none; }
    8474.hmbkp-exclude-preview-open .hmbkp_add_exclude_rule { margin: 0; }
    85 .ui-tabs-panel { clear: both;}
     75.hmbkp-tabs > div { display: none; }
     76.ui-tabs-panel { clear: both; }
    8677.ui-tabs-panel form { padding-top: 10px; }
    8778
    88 table.widefat tbody td { padding: 8px 7px; }
     79table.widefat tbody tr:nth-child(odd) { background-color: #f9f9f9 }
    8980.hmbkp-edit-schedule-excludes-form td a, .hmbkp-edit-schedule-excludes-form td span.reason { float: right; }
     81.hmbkp-edit-schedule-excludes-form td span.code { float: left; width: 255px; }
    9082.hmbkp-edit-schedule-excludes-form td span.reason { color: #CCC; }
    9183input[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

    r852089 r876572  
    66    // Remove the loading class when ajax requests complete
    77    $( document ).ajaxComplete( function() {
    8         $( '.hmbkp-ajax-loading' ).removeClass( 'hmbkp-ajax-loading' );
     8        $( '.hmbkp-ajax-loading' ).removeClass( 'hmbkp-ajax-loading' ).removeAttr( 'disabled' );
    99    } );
    1010
     
    1919    if ( ! $( '.subsubsub a.current' ).size() )
    2020        $( '.subsubsub li:first a').addClass( 'current' );
    21 
    22     // Carries the same resize options we want
    23     // to use to all other .resize()
    24     var resize_options = {
    25         height: '85%'
    26     };
    2721
    2822    // Initialize colorbox
     
    3125        'initialHeight' : '100px',
    3226        'transition'    : 'elastic',
    33         'scrolling'     : true,
    34         'innerWidth'    : "320px",
    35         'maxHeight'     : resize_options.height, //85% Takes into account the WP Admin bar.
     27        'scrolling'     : false,
     28        'innerWidth'    : '320px',
     29        'maxHeight'     : '85%', // 85% Takes into account the WP Admin bar.
    3630        'escKey'        : false,
    3731        'overlayClose'  : false,
     
    4337            $( '.hmbkp-tabs' ).tabs();
    4438
    45             if ( $( ".hmbkp-form p.submit:contains('" + hmbkp.update + "')" ).size() )
     39            if ( $( ".hmbkp-form p.submit:contains('" + hmbkp.update + "')" ).size() ) {
    4640                $( '<button type="button" class="button-secondary hmbkp-colorbox-close">' + hmbkp.cancel + '</button>' ).appendTo( '.hmbkp-form p.submit' );
     41            }
     42
     43
     44            $( '.recurring-setting' ).hide();
     45
     46            hmbkpToggleScheduleFields( $('select#hmbkp_schedule_recurrence_type').val() );
     47
     48            $( document ).on( 'change', 'select#hmbkp_schedule_recurrence_type', function() {
     49                hmbkpToggleScheduleFields( $( this ).val() );
     50            } );
     51
     52            $.colorbox.resize();
     53
    4754        }
    4855
     
    5158    // Resize the colorbox when switching tabs
    5259    $( document).on( 'click', '.ui-tabs-anchor', function( e ) {
    53         $.colorbox.resize(resize_options);
     60        $.colorbox.resize();
    5461    } );
    5562
     
    8794        }
    8895
    89         $( this ).addClass( 'hmbkp-ajax-loading' );
     96        $( this ).addClass( 'hmbkp-ajax-loading' ).attr( 'disabled', 'disabled' );
    9097
    9198        $.post(
     
    105112                $( '.hmbkp-edit-schedule-excludes-form' ).addClass( 'hmbkp-exclude-preview-open' );
    106113
    107                 $.colorbox.resize(resize_options);
     114                $.colorbox.resize();
    108115
    109116            }
     
    137144         $( '.hmbkp-edit-schedule-excludes-form' ).removeClass( 'hmbkp-exclude-preview-open' );
    138145
     146         $.colorbox.resize();
     147
    139148    } );
    140149
     
    142151    $( document ).on( 'click', '.hmbkp_save_exclude_rule', function() {
    143152
    144         $( this ).addClass( 'hmbkp-ajax-loading' );
     153        $( this ).addClass( 'hmbkp-ajax-loading' ).attr( 'disabled', 'disabled' );
    145154
    146155        $.post(
     
    151160                $( '.hmbkp-edit-schedule-excludes-form' ).show();
    152161                $( '.hmbkp-tabs' ).tabs();
    153                 $.colorbox.resize(resize_options);
     162                $.colorbox.resize();
    154163            }
    155164        );
     
    160169    $( document ).on( 'click', '.hmbkp-edit-schedule-excludes-form td a', function( e ) {
    161170
    162         $( this ).addClass( 'hmbkp-ajax-loading' ).text( '' );
    163 
    164         $.colorbox.resize(resize_options);
     171        $( this ).addClass( 'hmbkp-ajax-loading' ).text( '' ).attr( 'disabled', 'disabled' );
     172
     173        $.colorbox.resize( resize_options );
    165174
    166175        e.preventDefault();
     
    173182                $( '.hmbkp-edit-schedule-excludes-form' ).show();
    174183                $( '.hmbkp-tabs' ).tabs();
    175                 $.colorbox.resize(resize_options);
     184                $.colorbox.resize();
    176185            }
    177186        );
     
    184193        var $isDestinationSettingsForm = $( this ).find( 'button[type="submit"]' ).hasClass( "dest-settings-save" );
    185194
    186         isNewSchedule = $( this ).closest( 'form' ).attr( 'data-schedule-action' ) == 'add' ? true : false;
    187         scheduleId    = $( this ).closest( 'form' ).find( '[name="hmbkp_schedule_id"]' ).val();
     195        var isNewSchedule = $( this ).closest( 'form' ).attr( 'data-schedule-action' ) == 'add' ? true : false;
     196        var scheduleId    = $( this ).closest( 'form' ).find( '[name="hmbkp_schedule_id"]' ).val();
    188197
    189198        // Only continue if we have a schedule id
     
    195204            return false;
    196205
    197         $( this ).find( 'button[type="submit"]' ).addClass( 'hmbkp-ajax-loading' );
     206        $( this ).find( 'button[type="submit"]' ).addClass( 'hmbkp-ajax-loading' ).attr( 'disabled', 'disabled' );
    198207
    199208        $( '.hmbkp-error span' ).remove();
     
    204213        $.get(
    205214            ajaxurl + '?' + $( this ).serialize(),
    206             { 'action'  : 'hmnkp_edit_schedule_submit' },
    207             function( data ) {
    208 
    209                 // Assume success if no data passed back
    210                 if ( ( ! data || data == 0 ) && ( $isDestinationSettingsForm === false ) ) {
     215            { 'action'  : 'hmbkp_edit_schedule_submit' },
     216            function( data ) {
     217
     218                if ( ( data.success === true ) && ( $isDestinationSettingsForm === false ) ) {
    211219
    212220                    $.colorbox.close();
     
    219227                        location.reload();
    220228
    221                 } else if( ! data || data == 0 ) {
     229                } else if( data.success === true ) {
    222230                    // nothing for now
    223231                } else {
    224232
    225233                    // Get the errors json string
    226                     var errors = JSON.parse( data );
     234                    var errors = data.data;
    227235
    228236                    // Loop through the errors
    229237                    $.each( errors, function( key, value ) {
    230238
     239                        var selector = key.replace(/(:|\.|\[|\])/g,'\\$1');
     240
    231241                        // Focus the first field that errored
    232242                        if ( typeof( hmbkp_focused ) == 'undefined' ) {
    233243
    234                             $( '[name="' + key + '"]' ).focus();
     244                            $( '#' + selector ).focus();
    235245
    236246                            hmbkp_focused = true;
     
    239249
    240250                        // Add an error class to all fields with errors
    241                         $( '[name="' + key + '"]' ).closest( 'label' ).addClass( 'hmbkp-error' );
     251                        $( 'label[for=' + selector + ']' ).addClass( 'hmbkp-error' );
     252
     253                        $( '#' + selector ).next( 'span' ).remove();
    242254
    243255                        // Add the error message
    244                         $( '[name="' + key + '"]' ).after( '<span>' + value + '</span>' );
     256                        $( '#' + selector ).after( '<span class="hmbkp-error">' + value + '</span>' );
     257
    245258
    246259                    } );
     
    286299        hmbkpRedirectOnBackupComplete( $( '[data-hmbkp-schedule-id]' ).attr( 'data-hmbkp-schedule-id' ), true );
    287300
     301    // Run a backup
    288302    $( document ).on( 'click', '.hmbkp-run', function( e ) {
    289303
     
    299313        ).done( function( data ) {
    300314
    301             catchResponseAndOfferToEmail( data );
     315            hmbkpCatchResponseAndOfferToEmail( data );
    302316
    303317        // Redirect back on error
    304318        } ).fail( function( jqXHR, textStatus ) {
    305319
    306             catchResponseAndOfferToEmail( jqXHR.responseText );
     320                    hmbkpCatchResponseAndOfferToEmail( jqXHR.responseText );
    307321
    308322        } );
     
    318332} );
    319333
    320 function catchResponseAndOfferToEmail( data ) {
    321 
    322     // Carries the same resize options we want
    323     // to use to all other .resize()
    324     var resize_options = {
    325         height: '85%'
    326     };
     334function hmbkpToggleScheduleFields( recurrence  ){
     335
     336    recurrence = typeof recurrence !== 'undefined' ? recurrence : 'manually';
     337
     338    var settingFields         = jQuery( '.recurring-setting');
     339    var scheduleSettingFields = jQuery( '#schedule-start');
     340    var twiceDailyNote        = jQuery( 'p.twice-js' );
     341
     342    switch( recurrence ) {
     343
     344        case 'manually':
     345            settingFields.hide();
     346            break;
     347
     348        case 'hmbkp_hourly' : // fall through
     349        case 'hmbkp_daily' :
     350            settingFields.hide();
     351            scheduleSettingFields.show();
     352            twiceDailyNote.hide();
     353            break;
     354
     355        case 'hmbkp_twicedaily' :
     356            settingFields.hide();
     357            scheduleSettingFields.show();
     358            twiceDailyNote.show();
     359            break;
     360
     361        case 'hmbkp_weekly' : // fall through
     362        case 'hmbkp_fortnightly' :
     363            settingFields.hide();
     364            jQuery( '#start-day' ).show();
     365            scheduleSettingFields.show();
     366            twiceDailyNote.hide();
     367            break;
     368
     369        case 'hmbkp_monthly' :
     370            settingFields.hide();
     371            scheduleSettingFields.show();
     372            jQuery( '#start-date' ).show();
     373            twiceDailyNote.hide();
     374            break;
     375
     376    }
     377
     378    jQuery.colorbox.resize();
     379
     380}
     381
     382function hmbkpCatchResponseAndOfferToEmail( data ) {
    327383
    328384    // Backup Succeeded
     
    345401                jQuery.colorbox( {
    346402                    'innerWidth'    : "320px",
    347                     'maxHeight'     : "85%",
     403                    'maxHeight'     : "100%",
    348404                    'html'          : data,
    349405                    'overlayClose'  : false,
     
    351407                    'onLoad'        : function() {
    352408                        jQuery( '#cboxClose' ).remove();
    353                         jQuery.colorbox.resize(resize_options);
     409                        jQuery.colorbox.resize();
    354410                    }
    355411                } );
     
    364420        e.preventDefault();
    365421
    366         jQuery( this ).addClass( 'hmbkp-ajax-loading' );
     422        jQuery( this ).addClass( 'hmbkp-ajax-loading' ).attr( 'disabled', 'disabled' );
    367423
    368424        jQuery.post(
  • backupwordpress/trunk/backupwordpress.php

    r859574 r876572  
    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.5
     8Version: 2.6
    99Author URI: http://hmn.md/
    1010*/
     
    6262if ( ! defined( 'WP_MAX_MEMORY_LIMIT' ) )
    6363    define( 'WP_MAX_MEMORY_LIMIT', '256M' );
    64 
    65 if ( ! defined( 'HMBKP_SCHEDULE_TIME' ) )
    66     define( 'HMBKP_SCHEDULE_TIME', '11pm' );
    6764
    6865if ( ! defined( 'HMBKP_ADMIN_PAGE' ) ) {
  • backupwordpress/trunk/classes/class-email.php

    r859574 r876572  
    2727    public function field() { ?>
    2828
    29     <label>
    30 
    31             <?php _e( 'Email notification', 'hmbkp' ); ?>
    32 
    33             <input type="email" name="<?php echo esc_attr( $this->get_field_name( 'email' ) ); ?>" value="<?php echo esc_attr( $this->get_field_value( 'email' ) ); ?>" />
    34 
    35             <p class="description"><?php printf( __( 'Receive a notification email when a backup completes, if the backup is small enough (&lt; %s) then it will be attached to the email. Separate multiple email address\'s with a comma.', 'hmbkp' ), '<code>' . size_format( hmbkp_get_max_attachment_size() ) . '</code>' ); ?></p>
    36 
    37         </label>
     29        <div>
     30
     31            <label for="<?php echo esc_attr( $this->get_field_name( 'email' ) ); ?>"><?php _e( 'Email notification', 'hmbkp' ); ?></label>
     32
     33            <input type="email" id="<?php echo esc_attr( $this->get_field_name( 'email' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'email' ) ); ?>" value="<?php echo esc_attr( $this->get_field_value( 'email' ) ); ?>" />
     34
     35       <p class="description"><?php printf( __( 'Receive a notification email when a backup completes, if the backup is small enough (&lt; %s) then it will be attached to the email. Separate multiple email address\'s with a comma.', 'hmbkp' ), '<code>' . size_format( hmbkp_get_max_attachment_size() ) . '</code>' ); ?></p>
     36
     37        </div>
    3838
    3939    <?php }
     
    5151    public static function constant() { ?>
    5252
    53         <dt<?php if ( defined( 'HMBKP_ATTACHMENT_MAX_FILESIZE' ) ) { ?> class="hmbkp_active"<?php } ?>><code>HMBKP_ATTACHMENT_MAX_FILESIZE</code></dt>
    54         <dd><p><?php printf( __( 'The maximum filesize of your backup that will be attached to your notification emails . Defaults to %s.', 'hmbkp' ), '<code>10MB</code>' ); ?><p class="example"><?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_ATTACHMENT_MAX_FILESIZE', '25MB' );</code></p></dd>
     53        <tr<?php if ( defined( 'HMBKP_ATTACHMENT_MAX_FILESIZE' ) ) { ?> class="hmbkp_active"<?php } ?>>
     54
     55            <td><code>HMBKP_ATTACHMENT_MAX_FILESIZE</code></td>
     56
     57            <td>
     58
     59                <?php if ( defined( 'HMBKP_ATTACHMENT_MAX_FILESIZE' ) ) { ?>
     60                <p><?php printf( __( 'You\'ve set it to: %s', 'hmbkp' ), '<code>' . HMBKP_ATTACHMENT_MAX_FILESIZE . '</code>' ); ?></p>
     61                <?php } ?>
     62
     63                <p><?php printf( __( 'The maximum filesize of your backup that will be attached to your notification emails . Defaults to %s.', 'hmbkp' ), '<code>10MB</code>' ); ?> <?php _e( 'e.g.', 'hmbkp' ); ?> <code>define( 'HMBKP_ATTACHMENT_MAX_FILESIZE', '25MB' );</code></p>
     64
     65            </td>
     66
     67        </tr>
    5568
    5669    <?php }
     
    7487
    7588    }
    76    
     89
    7790    /**
    7891     * Used to determine if the service is in use or not
     
    95108        if ( isset( $new_data['email'] ) ) {
    96109
    97             if ( ! empty( $new_data['email'] ) )
    98                 foreach ( explode( ',', $new_data['email'] ) as $email )
    99                     if ( ! is_email( $email ) )
     110            if ( ! empty( $new_data['email'] ) ) {
     111
     112                foreach ( explode( ',', $new_data['email'] ) as $email ) {
     113
     114                    $email = trim( $email );
     115
     116                    if ( ! is_email( $email ) ) {
    100117                        $errors['email'] = sprintf( __( '%s isn\'t a valid email',  'hmbkp' ), $email );
    101 
    102             if ( ! empty( $errors['email'] ) )
    103                 $new_data['email'] = '';
     118                    }
     119
     120                    if ( ! empty( $errors['email'] ) ) {
     121                        $new_data['email'] = '';
     122                    }
     123
     124                }
     125
     126            }
     127
     128            return $errors;
    104129
    105130        }
    106 
    107         return $errors;
    108131
    109132    }
  • backupwordpress/trunk/classes/class-requirements.php

    r859574 r876572  
    564564    protected function test() {
    565565
     566        $backup_sizes = array();
     567
    566568        $schedules = HMBKP_Schedules::get_instance();
    567569
  • backupwordpress/trunk/classes/class-schedule.php

    r848987 r876572  
    3333
    3434    /**
    35      * The schedule start time
    36      *
    37      * (default value: current_time( 'timestamp' ))
    38      *
    39      * @var mixed
    40      * @access private
    41      */
    42     private $schedule_start_time = 0;
    43 
    44     /**
    4535     * Setup the schedule object
    4636     * Loads the options from the database and populates properties
     
    8676            $this->set_zip_command_path( false );
    8777
     78        if ( defined( 'HMBKP_SCHEDULE_START_TIME' ) && strtotime( 'HMBKP_SCHEDULE_START_TIME' ) )
     79            $this->set_schedule_start_time( strtotime( 'HMBKP_SCHEDULE_START_TIME' ) );
     80
    8881        // Set the path - TODO remove external function dependancy
    8982        $this->set_path( hmbkp_path() );
    90 
    91         $hmbkp_schedules = $this->get_cron_schedules();
    9283
    9384        // Set the archive filename to site name + schedule slug + date
     
    9687
    9788        // Setup the schedule if it isn't set
    98         if ( ( ! $this->get_next_occurrence() && in_array( $this->get_reoccurrence(), array_keys( $hmbkp_schedules ) ) ) || ( date( get_option( 'time_format' ), strtotime( HMBKP_SCHEDULE_TIME ) - ( get_option( 'gmt_offset' ) * 3600 ) ) !== date( get_option( 'time_format' ), $this->get_next_occurrence() ) ) )
     89        if ( ( ! $this->is_cron_scheduled() && $this->get_reoccurrence() !== 'manually' ) ) {
    9990            $this->schedule();
     91        }
    10092
    10193    }
     
    133125    public function get_name() {
    134126
    135         $reoccurence = ( 'manually' === $this->get_reoccurrence() ) ? $this->get_reoccurrence() : substr( $this->get_reoccurrence(), 6 );
    136 
    137         return ucwords( $this->get_type() ) . ' ' . $reoccurence;
     127        $recurrence = ( 'manually' === $this->get_reoccurrence() ) ? $this->get_reoccurrence() : substr( $this->get_reoccurrence(), 6 );
     128
     129        return ucwords( $this->get_type() ) . ' ' . $recurrence;
    138130
    139131    }
     
    235227
    236228        if ( empty( $max ) || ! is_int( $max ) )
    237             return new WP_Error( 'hmbkp_invalid_type_error', sprintf( __( 'Argument 1 for %s must be a valid integer', 'hmbkp' ) ), __METHOD__ );
     229            return new WP_Error( 'hmbkp_invalid_type_error', sprintf( __( 'Argument 1 for %s must be a valid integer', 'hmbkp' ), __METHOD__ ) );
    238230
    239231        $this->options['max_backups'] = $max;
     
    427419            return 0;
    428420
    429         if ( empty( $this->schedule_start_time ) ) {
    430 
    431             if ( defined( 'HMBKP_SCHEDULE_TIME' ) && HMBKP_SCHEDULE_TIME )
    432                 $date = strtotime( HMBKP_SCHEDULE_TIME );
    433 
    434             else
    435                 $date = strtotime( '11pm' );
    436 
    437             // Convert to UTC
    438             $date -= get_option( 'gmt_offset' ) * 3600;
    439 
    440             // if the scheduled time already passed today then start at the next interval instead
    441             if ( $date <= strtotime( 'now' ) )
    442                 $date += $this->get_interval();
    443 
    444             $this->set_schedule_start_time( $date );
    445         }
    446 
    447         return $this->schedule_start_time;
     421        if ( ! empty( $this->options['schedule_start_time'] ) )
     422            return $this->options['schedule_start_time'];
     423
     424        $this->set_schedule_start_time( time() );
     425
     426        return time();
    448427
    449428    }
     
    452431     * Set the schedule start time.
    453432     *
    454      * @access public
    455      * @param int $timestamp in UTC
    456      * @return void
    457      */
    458     public function set_schedule_start_time( $timestamp ) {
    459         $this->schedule_start_time = $timestamp;
     433     * @param array $args
     434     */
     435    public function set_schedule_start_time( $time ) {
     436
     437        // Don't allow setting the start time in the past
     438        if ( (int) $time <= time() ) {
     439            return new WP_Error( 'hmbkp_invalid_argument_error', sprintf( __( 'Argument 1 for %s must be a valid future timestamp', 'hmbkp' ), __METHOD__ ) );
     440        }
     441
     442        $this->options['schedule_start_time'] = $time;
     443
     444        $this->schedule();
     445
    460446    }
    461447
     
    468454
    469455        // Default to no reoccurrence
    470         if ( empty( $this->options['reoccurrence'] ) )
     456        if ( empty( $this->options['reoccurrence'] ) ) {
    471457            $this->set_reoccurrence( 'manually' );
     458        }
    472459
    473460        return $this->options['reoccurrence'];
     
    487474        // Check it's valid
    488475        if ( ! is_string( $reoccurrence ) || ! trim( $reoccurrence ) || ( ! in_array( $reoccurrence, array_keys( $hmbkp_schedules ) ) ) && $reoccurrence !== 'manually' )
    489             return new WP_Error( 'hmbkp_invalid_argument_error', sprintf( __( 'Argument 1 for %s must be a valid cron reoccurrence or "manually"', 'hmbkp' ) ), __METHOD__ );
    490 
    491         if ( isset( $this->options['reoccurrence'] ) && $this->options['reoccurrence'] === $reoccurrence )
     476            return new WP_Error( 'hmbkp_invalid_argument_error', sprintf( __( 'Argument 1 for %s must be a valid cron reoccurrence or "manually"', 'hmbkp' ), __METHOD__ ) );
     477
     478        // If the recurrence is already set to the same thing then there's no need to continue
     479        if ( isset( $this->options['reoccurrence'] ) && $this->options['reoccurrence'] === $reoccurrence && $this->is_cron_scheduled() )
    492480            return;
    493481
    494482        $this->options['reoccurrence'] = $reoccurrence;
    495483
    496         if ( $reoccurrence === 'manually' )
     484        if ( $reoccurrence === 'manually' ) {
    497485            $this->unschedule();
    498 
    499         else
     486        }
     487
     488        else {
    500489            $this->schedule();
     490        }
    501491
    502492        return true;
     493
    503494    }
    504495
     
    525516     * @return array
    526517     */
    527     public function get_cron_schedules() {
     518    public static function get_cron_schedules() {
    528519
    529520        $schedules = wp_get_schedules();
     
    557548    }
    558549
     550    public function is_cron_scheduled() {
     551        return (bool) $this->get_next_occurrence();
     552    }
     553
    559554
    560555    /**
    561556     * Get the path to the backup running file that stores the running backup status
    562557     *
    563      * @access private
     558     * @access public
    564559     * @return string
    565560     */
    566     private function get_schedule_running_path() {
     561    public function get_schedule_running_path() {
    567562        return $this->get_path() . '/.schedule-' . $this->get_id() . '-running';
    568563    }
     
    578573        $this->unschedule();
    579574
    580         wp_schedule_event( $this->get_schedule_start_time(), $this->get_reoccurrence(), 'hmbkp_schedule_hook', array( 'id' => $this->get_id() ) );
     575        $schedule_timestamp = $this->get_schedule_start_time();
     576
     577        wp_schedule_event( $schedule_timestamp, $this->get_reoccurrence(), 'hmbkp_schedule_hook', array( 'id' => $this->get_id() ) );
    581578
    582579    }
     
    622619
    623620    /**
    624      * Get the status of the running backup.
     621     * Get the filename that the running status is stored in.
    625622     *
    626623     * @access public
    627624     * @return string
    628625     */
    629     public function get_status() {
     626    public function get_running_backup_filename() {
    630627
    631628        if ( ! file_exists( $this->get_schedule_running_path() ) )
    632629            return '';
    633630
    634         $status = explode( '::', file_get_contents( $this->get_schedule_running_path() ) );
    635 
    636         return end( $status );
    637 
    638     }
    639 
    640     /**
    641      * Get the filename that the running status is stored in.
     631        $status = json_decode( file_get_contents( $this->get_schedule_running_path() ) );
     632
     633        if ( ! empty( $status->filename ) )
     634            return $status->filename;
     635
     636        return '';
     637
     638    }
     639
     640    /**
     641     * Get the status of the running backup.
    642642     *
    643643     * @access public
    644644     * @return string
    645645     */
    646     public function get_running_backup_filename() {
     646    public function get_status() {
    647647
    648648        if ( ! file_exists( $this->get_schedule_running_path() ) )
    649649            return '';
    650650
    651         $backup_running_file = explode( '::', file_get_contents( $this->get_schedule_running_path() ) );
    652 
    653         return reset( $backup_running_file );
     651        $status = json_decode( file_get_contents( $this->get_schedule_running_path() ) );
     652
     653        if ( ! empty( $status->status ) )
     654            return $status->status;
     655
     656        return '';
     657
    654658    }
    655659
     
    666670            return;
    667671
    668         fwrite( $handle, $this->get_archive_filename() . '::' . $message );
     672        $status = json_encode( (object) array(
     673            'filename' => $this->get_archive_filename(),
     674            'started'  => $this->get_schedule_running_start_time(),
     675            'status'   => $message
     676        ) );
     677
     678        fwrite( $handle, $status );
    669679
    670680        fclose( $handle );
     681
     682    }
     683
     684    /**
     685     * Set the time that the current running backup was started
     686     *
     687     * @access public
     688     * @return int $timestamp
     689     */
     690    public function get_schedule_running_start_time() {
     691
     692        if ( ! file_exists( $this->get_schedule_running_path() ) )
     693            return 0;
     694
     695        $status = json_decode( file_get_contents( $this->get_schedule_running_path() ) );
     696
     697        if ( ! empty( $status->started ) && (int) (string) $status->started === $status->started )
     698            return $status->started;
     699
     700        return time();
    671701
    672702    }
     
    677707     */
    678708    protected function do_action( $action ) {
    679 
    680         switch ( $action ) :
    681 
    682             case 'hmbkp_mysqldump_started' :
    683 
    684                 $this->set_status( sprintf( __( 'Dumping Database %s', 'hmbkp' ), '(<code>' . $this->get_mysqldump_method() . '</code>)' ) );
    685                 break;
    686 
    687             case 'hmbkp_mysqldump_verify_started' :
    688 
    689                 $this->set_status( sprintf( __( 'Verifying Database Dump %s', 'hmbkp' ), '(<code>' . $this->get_mysqldump_method() . '</code>)' ) );
    690                 break;
    691 
    692             case 'hmbkp_archive_started' :
    693 
    694                 $this->set_status( sprintf( __( 'Creating zip archive %s', 'hmbkp' ), '(<code>' . $this->get_archive_method() . '</code>)' ) );
    695                 break;
    696 
    697             case 'hmbkp_archive_verify_started' :
    698 
    699                 $this->set_status( sprintf( __( 'Verifying Zip Archive %s', 'hmbkp' ), '(<code>' . $this->get_archive_method() . '</code>)' ) );
    700                 break;
    701 
    702             case 'hmbkp_backup_complete' :
    703 
    704                 $this->set_status( __( 'Finishing Backup', 'hmbkp' ) );
    705                 break;
    706 
    707             case 'hmbkp_error' :
    708 
    709                 if ( $this->get_errors() ) {
    710 
    711                     $file = $this->get_path() . '/.backup_errors';
    712 
    713                     if ( file_exists( $file ) )
    714                         @unlink( $file );
    715 
    716                     if ( ! $handle = @fopen( $file, 'w' ) )
    717                         return;
    718 
    719                     fwrite( $handle, json_encode( $this->get_errors() ) );
    720 
    721                     fclose( $handle );
    722 
    723                 }
    724 
    725                 break;
    726 
    727             case 'hmbkp_warning' :
    728 
    729                 if ( $this->get_warnings() ) {
    730 
    731                     $file = $this->get_path() . '/.backup_warnings';
    732 
    733                     if ( file_exists( $file ) )
    734                         @unlink( $file );
    735 
    736                     if ( ! $handle = @fopen( $file, 'w' ) )
    737                         return;
    738 
    739                     fwrite( $handle, json_encode( $this->get_warnings() ) );
    740 
    741                     fclose( $handle );
    742 
    743                 }
    744 
    745                 break;
    746 
    747         endswitch;
    748709
    749710        // Pass the actions to all the services
     
    755716        parent::do_action( $action );
    756717
     718        switch ( $action ) :
     719
     720            case 'hmbkp_mysqldump_started' :
     721
     722                $this->set_status( sprintf( __( 'Dumping Database %s', 'hmbkp' ), '(<code>' . $this->get_mysqldump_method() . '</code>)' ) );
     723                break;
     724
     725            case 'hmbkp_mysqldump_verify_started' :
     726
     727                $this->set_status( sprintf( __( 'Verifying Database Dump %s', 'hmbkp' ), '(<code>' . $this->get_mysqldump_method() . '</code>)' ) );
     728                break;
     729
     730            case 'hmbkp_archive_started' :
     731
     732                $this->set_status( sprintf( __( 'Creating zip archive %s', 'hmbkp' ), '(<code>' . $this->get_archive_method() . '</code>)' ) );
     733                break;
     734
     735            case 'hmbkp_archive_verify_started' :
     736
     737                $this->set_status( sprintf( __( 'Verifying Zip Archive %s', 'hmbkp' ), '(<code>' . $this->get_archive_method() . '</code>)' ) );
     738                break;
     739
     740            case 'hmbkp_backup_complete' :
     741
     742                $this->set_status( __( 'Finishing Backup', 'hmbkp' ) );
     743                break;
     744
     745            case 'hmbkp_error' :
     746
     747                if ( $this->get_errors() ) {
     748
     749                    $file = $this->get_path() . '/.backup_errors';
     750
     751                    if ( file_exists( $file ) )
     752                        @unlink( $file );
     753
     754                    if ( ! $handle = @fopen( $file, 'w' ) )
     755                        return;
     756
     757                    fwrite( $handle, json_encode( $this->get_errors() ) );
     758
     759                    fclose( $handle );
     760
     761                }
     762
     763                break;
     764
     765            case 'hmbkp_warning' :
     766
     767                if ( $this->get_warnings() ) {
     768
     769                    $file = $this->get_path() . '/.backup_warnings';
     770
     771                    if ( file_exists( $file ) )
     772                        @unlink( $file );
     773
     774                    if ( ! $handle = @fopen( $file, 'w' ) )
     775                        return;
     776
     777                    fwrite( $handle, json_encode( $this->get_warnings() ) );
     778
     779                    fclose( $handle );
     780
     781                }
     782
     783                break;
     784
     785        endswitch;
     786
    757787    }
    758788
     
    807837        // Check that it's a valid filepath
    808838        if ( empty( $filepath ) || ! is_string( $filepath ) )
    809             return new WP_Error( 'hmbkp_empty_string_error', sprintf( __( 'Argument 1 for %s must be a non empty string', 'hmbkp' ) ), __METHOD__ );
     839            return new WP_Error( 'hmbkp_empty_string_error', sprintf( __( 'Argument 1 for %s must be a non empty string', 'hmbkp' ), __METHOD__ ) );
    810840
    811841        // Make sure it exists
    812842        if ( ! file_exists( $filepath ) )
    813             return new WP_Error( 'hmbkp_file_error', sprintf( __( '%s dpesn\'t exist', 'hmbkp' ) ), $filepath );
     843            return new WP_Error( 'hmbkp_file_error', sprintf( __( '%s doesn\'t exist', 'hmbkp' ), $filepath ) );
    814844
    815845        // Make sure it was created by this schedule
    816846        if ( strpos( $filepath, $this->get_id() ) === false )
    817             return new WP_Error( 'hmbkp_backup_error', sprintf( __( 'That backup wasn\'t created by this schedule', 'hmbkp' ) ) );
     847            return new WP_Error( 'hmbkp_backup_error', __( 'That backup wasn\'t created by this schedule', 'hmbkp' ) );
    818848
    819849        unlink( $filepath );
    820850
    821851        return true;
     852
    822853    }
    823854
  • backupwordpress/trunk/classes/class-schedules.php

    r838473 r876572  
    3030     */
    3131    private function __construct() {
     32        $this->refresh_schedules();
     33    }
     34
     35    public function refresh_schedules() {
    3236
    3337        global $wpdb;
  • backupwordpress/trunk/classes/wp-cli.php

    r838473 r876572  
    1010class BackUpCommand extends WP_CLI_Command {
    1111
    12     public function __construct( $args, $assoc_args ) {
     12    /**
     13     * Generate some posts.
     14     *
     15     * ## OPTIONS
     16     *
     17     * [--files_only]
     18     * : Backup files only, default to off
     19     *
     20     * [--database_only]
     21     * : Backup database only, defaults to off
     22     *
     23     * [--path]
     24     * : dir that the backup should be save in, defaults to wp-content/backups/
     25     *
     26     * [--root]
     27     * : dir that should be backed up, defaults to site root.
     28     *
     29     * [--zip_command_path]
     30     * : path to your zip binary, standard locations are automatically used
     31     *
     32     * [--mysqldump_command_path]
     33     * : path to your mysqldump binary, standard locations are automatically used
     34     *
     35     * ## Usage
     36     *
     37     *     wp backupwordpress backup [--files_only] [--database_only] [--path<dir>] [--root<dir>] [--zip_command_path=<path>] [--mysqldump_command_path=<path>]
     38     */
     39    public function backup( $args, $assoc_args ) {
    1340
    1441        // Make sure it's possible to do a backup
     
    73100    }
    74101
    75     static function help() {
    76 
    77         WP_CLI::line( <<<EOB
    78 usage: wp backup [--files_only] [--database_only] [--path<dir>] [--root<dir>] [--zip_command_path=<path>] [--mysqldump_command_path=<path>]
    79 
    80      --files_only                   Backup files only, default to off
    81      --database_only                Backup database only, defaults to off
    82      --path                         dir that the backup should be save in, defaults to wp-content/backups/
    83      --root                         dir that should be backed up, defaults to site root.
    84      --zip_command_path             path to your zip binary, standard locations are automatically used
    85      --mysqldump_command_path       path to your mysqldump binary, standard locations are automatically used
    86 
    87 EOB
    88         );
    89 
    90     }
    91 
    92102}
    93 WP_CLI::add_command( 'backup', 'BackUpCommand' );
     103WP_CLI::add_command( 'backupwordpress', 'BackUpCommand' );
  • backupwordpress/trunk/functions/core.php

    r859574 r876572  
    212212    $database_daily = new HMBKP_Scheduled_Backup( 'default-1' );
    213213    $database_daily->set_type( 'database' );
     214    $database_daily->set_schedule_start_time( hmbkp_determine_start_time( 'hmbkp_daily', array( 'hours' => '23', 'minutes' => '0' ) ) );
    214215    $database_daily->set_reoccurrence( 'hmbkp_daily' );
    215216    $database_daily->set_max_backups( 14 );
     
    222223    $complete_weekly = new HMBKP_Scheduled_Backup( 'default-2' );
    223224    $complete_weekly->set_type( 'complete' );
     225    $complete_weekly->set_schedule_start_time( hmbkp_determine_start_time( 'hmbkp_weekly', array( 'day_of_week' => 'sunday', 'hours' => '3', 'minutes' => '0' ) ) );
    224226    $complete_weekly->set_reoccurrence( 'hmbkp_weekly' );
    225227    $complete_weekly->set_max_backups( 12 );
    226228    $complete_weekly->save();
     229
     230    $schedules->refresh_schedules();
    227231
    228232    function hmbkp_default_schedules_setup_warning() {
     
    272276        @unlink( $dir );
    273277
    274     if ( ! is_dir( $dir ) )
     278    if ( ! is_dir( $dir ) || ! is_readable( $dir ) )
    275279        return false;
    276280
     
    446450        return false;
    447451
     452    $test_backup = new HMBKP_Scheduled_Backup( 'test_backup' );
     453
     454    if ( ! is_readable( $test_backup->get_root() ) )
     455        return false;
     456
    448457    return true;
    449458}
     
    467476
    468477        while ( false !== ( $file = readdir( $handle ) ) ) {
    469             if ( ! in_array( $file, array( '.', '..', 'index.html' ) ) && pathinfo( $file, PATHINFO_EXTENSION ) !== 'zip' )
     478            if ( ! in_array( $file, array( '.', '..', 'index.html' ) ) && pathinfo( $file, PATHINFO_EXTENSION ) !== 'zip' && strpos( $file, '-running' ) === false )
    470479                hmbkp_rmdirtree( trailingslashit( $hmbkp_path ) . $file );
    471480        }
     
    525534    return true;
    526535}
     536
     537/**
     538 * List of schedules
     539 *
     540 * @return array
     541 */
     542function hmbkp_get_cron_schedules() {
     543
     544    $schedules = wp_get_schedules();
     545
     546    // remove any schedule whose key is not prefixed with 'hmbkp_'
     547    foreach ( $schedules as $key => $arr ) {
     548        if ( ! preg_match( '/^hmbkp_/', $key ) )
     549            unset( $schedules[$key] );
     550    }
     551
     552    return $schedules;
     553}
     554
     555/**
     556 * @param string $type the type of the schedule
     557 * @param array $times {
     558 *     An array of time arguments. Optional.
     559 *
     560 *     @type int $minutes          The minute to start the schedule on. Defaults to current time + 10 minutes. Accepts
     561 *                                 any valid `date( 'i' )` output.
     562 *     @type int $hours            The hour to start the schedule on. Defaults to current time + 10 minutes. Accepts
     563 *                                 any valid `date( 'G' )` output.
     564 *     @type string $day_of_week   The day of the week to start the schedule on. Defaults to current time + 10 minutes. Accepts
     565 *                                 any valid `date( 'l' )` output.
     566 *     @type int $day_of_month     The day of the month to start the schedule on. Defaults to current time + 10 minutes. Accepts
     567 *                                 any valid `date( 'j' )` output.
     568 *     @type int $now              The current time. Defaults to `time()`. Accepts any valid timestamp.
     569 *
     570 * }
     571 * @return int $timestamp Returns the resulting timestamp on success and Int 0 on failure
     572 */
     573function hmbkp_determine_start_time( $type, $times = array() ) {
     574
     575    // Default to in 10 minutes
     576    if ( ! empty( $times['now'] ) ) {
     577        $default_timestamp = $times['now'] + 600;
     578
     579    } else {
     580        $default_timestamp = time() + 600;
     581    }
     582
     583    $default_times = array(
     584        'minutes'      => date( 'i', $default_timestamp ),
     585        'hours'        => date( 'G', $default_timestamp ),
     586        'day_of_week'  => date( 'l', $default_timestamp ),
     587        'day_of_month' => date( 'j', $default_timestamp ),
     588        'now'          => time()
     589    );
     590
     591    $args = wp_parse_args( $times, $default_times );
     592
     593    $schedule_start = '';
     594
     595    $intervals = HMBKP_Scheduled_Backup::get_cron_schedules();
     596
     597    // Allow the hours and minutes to be overwritten by a constant
     598    if ( defined( 'HMBKP_SCHEDULE_TIME' ) && HMBKP_SCHEDULE_TIME ) {
     599        $hm = HMBKP_SCHEDULE_TIME;
     600    }
     601
     602    // The hour and minute that the schedule should start on
     603    else {
     604        $hm = $args['hours'] . ':' . $args['minutes'] . ':00';
     605    }
     606
     607    switch ( $type ) {
     608
     609        case 'hmbkp_hourly' :
     610        case 'hmbkp_daily' :
     611        case 'hmbkp_twicedaily':
     612
     613            // The next occurance of the specified time
     614            $schedule_start = $hm;
     615            break;
     616
     617        case 'hmbkp_weekly' :
     618        case 'hmbkp_fortnightly' :
     619
     620            // The next day of the week at the specified time
     621            $schedule_start = $args['day_of_week'] . ' ' . $hm;
     622            break;
     623
     624        case 'hmbkp_monthly' :
     625
     626            // The occurance of the time on the specified day of the month
     627            $schedule_start = date( 'F', $args['now'] ) . ' ' . $args['day_of_month'] . ' ' . $hm;
     628
     629            // If we've already gone past that day this month then we'll need to start next month
     630            if ( strtotime( $schedule_start, $args['now'] ) <= $args['now'] )
     631                $schedule_start = date( 'F', strtotime( '+ 1 month', $args['now'] ) )  . ' ' . $args['day_of_month'] . ' ' . $hm;
     632
     633            // If that's still in the past then we'll need to jump to next year
     634            if ( strtotime( $schedule_start, $args['now'] ) <= $args['now'] )
     635                $schedule_start = date( 'F', strtotime( '+ 1 month', $args['now'] ) )  . ' ' . $args['day_of_month'] . ' ' . date( 'Y', strtotime( '+ 1 year', $args['now'] ) ) . ' ' . $hm;
     636
     637            break;
     638        default :
     639
     640            return 0;
     641
     642            break;
     643
     644    }
     645
     646    $timestamp = strtotime( $schedule_start, $args['now'] );
     647
     648    // Convert to UTC
     649    $timestamp -= get_option( 'gmt_offset' ) * 3600;
     650
     651    // If the scheduled time already passed then keep adding the interval until we get to a future date
     652    while ( $timestamp <= $args['now'] ) {
     653        $timestamp += $intervals[ $type ]['interval'];
     654    }
     655
     656    return $timestamp;
     657
     658}
  • backupwordpress/trunk/functions/interface.php

    r859574 r876572  
    125125    endif;
    126126
     127    $test_backup = new HMBKP_Scheduled_Backup( 'test_backup' );
     128
     129    if ( ! is_readable( $test_backup->get_root() ) ) :
     130
     131        function hmbkp_backup_root_unreadable_notice() {
     132            $test_backup = new HMBKP_Scheduled_Backup( 'test_backup' );
     133            echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has detected a problem.', 'hmbkp' ) . '</strong>' . sprintf( __( 'Your backup root path %s isn\'t readable.', 'hmbkp' ), '<code>' . $test_backup->get_root() . '</code>' ) . '</p></div>';
     134        }
     135
     136        add_action( 'admin_notices', 'hmbkp_backup_root_unreadable_notice' );
     137
     138    endif;
     139
    127140}
    128141
     
    278291    ob_start(); ?>
    279292
    280     <span class="hmbkp-status"><?php echo $schedule->get_status() ? wp_kses_data( $schedule->get_status() ) : __( 'Starting Backup', 'hmbkp' ); ?> <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'hmbkp_cancel', 'hmbkp_schedule_id' => $schedule->get_id() ), $settings_url ) ); ?>"><?php _e( 'cancel', 'hmbkp' ); ?></a></span>
     293    <span class="hmbkp-status"<?php if ( $schedule->get_status() ) { ?> title="<?php printf( __( 'Started %s ago', 'hmbkp' ), human_time_diff( $schedule->get_schedule_running_start_time() ) ); ?>"<?php } ?>>
     294        <?php echo $schedule->get_status() ? wp_kses_data( $schedule->get_status() ) : __( 'Starting Backup', 'hmbkp' ); ?>
     295        <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'hmbkp_cancel', 'hmbkp_schedule_id' => $schedule->get_id() ), $settings_url ) ); ?>"><?php _e( 'cancel', 'hmbkp' ); ?></a>
     296    </span>
    281297
    282298    <div class="hmbkp-schedule-actions row-actions">
  • backupwordpress/trunk/hm-backup/hm-backup.php

    r838473 r876572  
    182182        if ( array_intersect( array( 'shell_exec', 'escapeshellarg', 'escapeshellcmd' ), array_map( 'trim', explode( ',', @ini_get( 'disable_functions' ) ) ) ) )
    183183            return false;
    184        
     184
    185185        // Functions can also be disabled via suhosin
    186186        if ( array_intersect( array( 'shell_exec', 'escapeshellarg', 'escapeshellcmd' ), array_map( 'trim', explode( ',', @ini_get( 'suhosin.executor.func.blacklist' ) ) ) ) )
     
    208208
    209209        $home_path = ABSPATH;
     210
     211        // Attempt to guess the home path based on the location of wp-config.php
     212        if ( ! file_exists( ABSPATH . 'wp-config.php' ) ) {
     213            $home_path = trailingslashit( dirname( ABSPATH ) );
     214        }
    210215
    211216        // If site_url contains home_url and they differ then assume WordPress is installed in a sub directory
     
    510515        );
    511516
    512         // Find the one which works
     517        // Find the first one which works
    513518        foreach ( $mysqldump_locations as $location ) {
    514             if ( @is_executable( self::conform_dir( $location ) ) )
     519            if ( @is_executable( self::conform_dir( $location ) ) ) {
    515520                $this->set_mysqldump_command_path( $location );
     521                break;  // Found one
     522            }
    516523        }
    517524
     
    571578        );
    572579
    573         // Find the one which works
     580        // Find the first one which works
    574581        foreach ( $zip_locations as $location ) {
    575             if ( @is_executable( self::conform_dir( $location ) ) )
     582            if ( @is_executable( self::conform_dir( $location ) ) ) {
    576583                $this->set_zip_command_path( $location );
     584                break;  // Found one
     585            }
    577586        }
    578587
  • backupwordpress/trunk/readme.txt

    r859576 r876572  
    33Tags: back up, backup, backups, database, zip, db, files, archive, wp-cli, humanmade
    44Requires at least: 3.7.1
    5 Tested up to: 3.8.1
    6 Stable tag: 2.5
    7 
    8 Simple automated back ups of your WordPress powered website.
     5Tested up to: 3.9
     6Stable tag: 2.6
     7
     8Simple automated backups of your WordPress powered website.
    99
    1010== Description ==
    1111
    12 [BackUpWordPress](http://bwp.hmn.md/?utm_source=wordpress-org&utm_medium=plugin-page&utm_campaign=freeplugin) will back up your entire site including your database and all your files on a schedule that suits you. Try it now to see how easy it is!
     12[BackUpWordPress](https://bwp.hmn.md/?utm_source=wordpress-org&utm_medium=plugin-page&utm_campaign=freeplugin) will back up your entire site including your database and all your files on a schedule that suits you. Try it now to see how easy it is!
    1313
    1414= Features =
     
    1818* Manage multiple schedules.
    1919* Option to have each backup file emailed to you.
    20 * Uses `zip` and `mysqldump` for faster back ups if they are available.
     20* Uses `zip` and `mysqldump` for faster backups if they are available.
    2121* Works on Linux & Windows Server.
    22 * Exclude files and folders from your back ups.
     22* Exclude files and folders from your backups.
    2323* Good support should you need help.
    2424* Translations for Spanish, German, Chinese, Romanian, Russian, Serbian, Lithuanian, Italian, Czech, Dutch, French, Basque.
     
    5050**What if I want I want to back up my site to another destination?**
    5151
    52 BackUpWordPress Pro supports Dropbox, Google Drive, Amazon S3, Rackspace, Azure, DreamObjects and FTP/SFTP. Check it out here: [http://bwp.hmn.md](http://bwp.hmn.md/?utm_source=wordpress-org&utm_medium=plugin-page&utm_campaign=freeplugin)
     52BackUpWordPress Pro supports Dropbox, Google Drive, Amazon S3, Rackspace, Azure, DreamObjects and FTP/SFTP. Check it out here: [https://bwp.hmn.md](http://bwp.hmn.md/?utm_source=wordpress-org&utm_medium=plugin-page&utm_campaign=freeplugin)
    5353
    5454**How do I restore my site from a backup?**
     
    107107
    108108== Changelog ==
     109
     110#### 2.6
     111
     112* It's now possible to choose the time and day that your schedule will run on.
     113* Introduces several new unit tests around schedule timings.
     114* Fixes a bug that could cause the hourly schedule to run constantly.
     115* Improved the layout of the Constants help panel.
     116* If the backup root directory is unreadable then the plugin will no longer function.
     117* Update the backups table match the standard WordPress table styles.
     118* Improved styling for the settings dialogue.
     119* Improved styling for the Server Info help tab.
     120* /s/back ups/backups.
     121* Remove Deprecated call to `screen_icon`.
     122* Updated French translation.
     123* Update the `WP CLI` command to use the new method for registering command.
     124* Reload the schedules when re-setting up the default schedules so they show up straight away.
     125* s/dpesnt't/doesn't.
     126* Only show the estimated total schedule size when editing an existing schedule.
     127* Stop stripping 0 from the minutes on hourly backups so that backups at 10 (& 20, etc.) past the hour correctly show.
     128* Disable buttons whilst ajax requests are running.
     129* Move spinners outside the buttons as they didn't look very good inside.
     130* Improve the detection of the home path on multisite installs which have WordPress in a subdirectory.
     131* Track the time that the running backup is started and display how long a backup has been running for.
     132* Fix an issue that meant it wasn't possible to run multiple manual backups at the same time.
     133* Many other minor improvements.
    109134
    110135#### 2.5
  • backupwordpress/trunk/uninstall.php

    r838473 r876572  
    33if ( ! defined( 'HMBKP_PLUGIN_PATH' ) )
    44    define( 'HMBKP_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
    5 
    6 if ( ! defined( 'HMBKP_SCHEDULE_TIME' ) )
    7     define( 'HMBKP_SCHEDULE_TIME', '11pm' );
    85
    96// Load the schedules
Note: See TracChangeset for help on using the changeset viewer.