WordPress.org

Plugin Directory

Changeset 614508


Ignore:
Timestamp:
10/19/12 13:00:05 (18 months ago)
Author:
willmot
Message:

2.0.3 bug fix release

Location:
backupwordpress
Files:
13 edited
6 copied

Legend:

Unmodified
Added
Removed
  • backupwordpress/tags/2.0.3/admin/actions.php

    r611550 r614508  
    167167    $response = wp_remote_get( site_url( 'wp-cron.php' ) ); 
    168168 
    169     if ( is_wp_error( $response ) || $response['response']['code'] !== 200 ) 
     169    if ( is_wp_error( $response ) ) 
     170        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>'; 
     171 
     172    else if ( $response['response']['code'] != 200 ) 
    170173        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['response']['code'] . '</code>', '<a href="http://wordpress.org/extend/plugins/backupwordpress/faq/">FAQ</a>' ) . '</p></div>'; 
    171174 
  • backupwordpress/tags/2.0.3/classes/schedule.php

    r602026 r614508  
    3333 
    3434    /** 
    35      * The unique hook name for this schedule 
    36      * 
    37      * @var string 
    38      * @access private 
    39      */ 
    40     private $schedule_hook = ''; 
    41  
    42     /** 
    4335     * The filepath for the .running file which 
    4436     * is used to track whether a backup is currently in 
     
    125117        $this->options = array_filter( (array) get_option( 'hmbkp_schedule_' . $this->get_id() ) ); 
    126118 
    127         // Setup the schedule hook 
    128         $this->schedule_hook = 'hmbkp_schedule_' . $this->get_id() . '_hook'; 
    129  
    130119        // Some properties can be overridden with defines 
    131120        if ( defined( 'HMBKP_ROOT' ) && HMBKP_ROOT ) 
     
    413402            return 0; 
    414403 
    415         if ( ! $this->schedule_start_time ) 
    416             $this->set_schedule_start_time( current_time( 'timestamp' ) ); 
    417  
     404        if ( ! $this->schedule_start_time ) { 
     405 
     406            if ( strtotime( '11pm' ) < strtotime( 'now' ) ) 
     407                $date = strtotime( 'tomorrow 11pm' ); 
     408            else 
     409                $date = strtotime( '11pm' ); 
     410 
     411            $date -= ( get_option( 'gmt_offset' ) * 3600 ); 
     412             
     413            $this->set_schedule_start_time( $date ); 
     414        } 
    418415        return $this->schedule_start_time; 
    419416 
     
    500497    public function get_next_occurrence() { 
    501498 
    502         return wp_next_scheduled( $this->schedule_hook ); 
     499        return wp_next_scheduled( 'hmbkp_schedule_hook', array( 'id' => $this->get_id() ) ); 
    503500 
    504501    } 
     
    518515        $this->unschedule(); 
    519516 
    520         wp_schedule_event( $this->get_schedule_start_time() + $this->get_interval(), $this->get_reoccurrence(), $this->schedule_hook ); 
    521  
    522         // Hook the backu into the schedule hook 
    523         add_action( $this->schedule_hook, array( $this, 'run' ) ); 
    524  
     517        wp_schedule_event( $this->get_schedule_start_time(), $this->get_reoccurrence(), 'hmbkp_schedule_hook', array( 'id' => $this->get_id() ) ); 
    525518    } 
    526519 
    527520    public function unschedule() { 
    528         wp_clear_scheduled_hook( $this->schedule_hook ); 
     521        wp_clear_scheduled_hook( 'hmbkp_schedule_hook', array( 'id' => $this->get_id() ) ); 
    529522    } 
    530523 
     
    669662     * @todo look into using recursiveDirectoryIterator and recursiveRegexIterator 
    670663     * @access public 
     664     * @return string[] - file paths of the backups 
    671665     */ 
    672666    public function get_backups() { 
  • backupwordpress/tags/2.0.3/classes/schedules.php

    r588863 r614508  
    4242 
    4343    /** 
     44     * Get a schedule by ID 
     45     *  
     46     * @return HMBKP_Scheduled_Backup 
     47     */ 
     48    public function get_schedule( $id ) { 
     49 
     50        foreach ( $this->schedules as $schedule ) 
     51            if ( $schedule->get_id() == $id ) 
     52                return $schedule; 
     53 
     54        return null; 
     55    } 
     56 
     57    /** 
    4458     * Instantiate the individual scheduled backup objects 
    4559     * 
  • backupwordpress/tags/2.0.3/classes/services.php

    r598091 r614508  
    9191        $errors = $this->update( $new_data, $old_data ); 
    9292 
    93         if ( $errors = array_flip( $errors ) ) { 
     93        if ( $errors && $errors = array_flip( $errors ) ) { 
    9494 
    9595            foreach( $errors as $error => &$field ) 
  • backupwordpress/tags/2.0.3/functions/core.php

    r602026 r614508  
    199199 
    200200} 
     201add_action( 'admin_init', 'hmbkp_setup_default_schedules' ); 
    201202 
    202203/** 
  • backupwordpress/tags/2.0.3/hm-backup/hm-backup.php

    r602026 r614508  
    44 * Generic file and database backup class 
    55 * 
    6  * @version 2.0 RC1 
     6 * @version 2.0 
    77 */ 
    88class HM_Backup { 
  • backupwordpress/tags/2.0.3/plugin.php

    r611550 r614508  
    66Description: Simple automated backups of your WordPress powered website. Once activated you'll find me under <strong>Tools &rarr; Backups</strong>. 
    77Author: Human Made Limited 
    8 Version: 2.0.2 
     8Version: 2.0.3 
    99Author URI: http://hmn.md/ 
    1010*/ 
     
    2727*/ 
    2828 
    29 define( 'HMBKP_PLUGIN_SLUG', 'backupwordpress' ); 
    30 define( 'HMBKP_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); 
    31 define( 'HMBKP_PLUGIN_URL', plugins_url( HMBKP_PLUGIN_SLUG ) ); 
     29if ( ! defined( 'HMBKP_PLUGIN_SLUG' ) ) 
     30    define( 'HMBKP_PLUGIN_SLUG', 'backupwordpress' ); 
     31 
     32if ( ! defined( 'HMBKP_PLUGIN_PATH' ) ) 
     33    define( 'HMBKP_PLUGIN_PATH', dirname( __FILE__ ) ); 
     34 
     35if ( ! defined( 'HMBKP_PLUGIN_URL' ) ) 
     36    define( 'HMBKP_PLUGIN_URL', str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, HMBKP_PLUGIN_PATH ) ); 
     37 
     38if ( ! defined( 'HMBKP_ADMIN_URL' ) ) 
     39    define( 'HMBKP_ADMIN_URL', add_query_arg( 'page', HMBKP_PLUGIN_SLUG, admin_url( 'tools.php' ) ) ); 
    3240 
    3341if ( ! defined( 'HMBKP_REQUIRED_WP_VERSION' ) ) 
    34     define( 'HMBKP_REQUIRED_WP_VERSION', '3.3.2' ); 
    35  
    36 define( 'HMBKP_ADMIN_URL', add_query_arg( 'page', HMBKP_PLUGIN_SLUG, admin_url( 'tools.php' ) ) ); 
    37  
    38 if ( ! defined( 'HMBKP_SECURE_KEY' ) ) 
    39     define( 'HMBKP_SECURE_KEY', md5( ABSPATH . time() ) ); 
     42    define( 'HMBKP_REQUIRED_WP_VERSION', '3.3.3' ); 
    4043 
    4144// Max memory limit isn't defined in old versions of WordPress 
     
    6467 
    6568} 
     69 
     70// Load the admin menu 
     71require_once( HMBKP_PLUGIN_PATH . '/admin/menu.php' ); 
     72require_once( HMBKP_PLUGIN_PATH . '/admin/actions.php' ); 
     73 
     74// Load hm-backup 
     75if ( ! class_exists( 'HM_Backup' ) ) 
     76    require_once( HMBKP_PLUGIN_PATH . '/hm-backup/hm-backup.php' ); 
     77 
     78// Load the schedules 
     79require_once( HMBKP_PLUGIN_PATH . '/classes/schedule.php' ); 
     80require_once( HMBKP_PLUGIN_PATH . '/classes/schedules.php' ); 
     81 
     82// Load the core functions 
     83require_once( HMBKP_PLUGIN_PATH . '/functions/core.php' ); 
     84require_once( HMBKP_PLUGIN_PATH . '/functions/interface.php' ); 
     85 
     86// Load Services 
     87require_once( HMBKP_PLUGIN_PATH . '/classes/services.php' ); 
     88 
     89// Load the email service 
     90require_once( HMBKP_PLUGIN_PATH . '/classes/email.php' ); 
     91 
     92// Load the wp cli command 
     93if ( defined( 'WP_CLI' ) && WP_CLI ) 
     94    include( HMBKP_PLUGIN_PATH . '/classes/wp-cli.php' ); 
     95 
     96// Set the tmp directory to the backup path 
     97if ( ! defined( 'PCLZIP_TEMPORARY_DIR' ) ) 
     98    define( 'PCLZIP_TEMPORARY_DIR', trailingslashit( hmbkp_path() ) ); 
     99 
     100// Hook in the activation and deactivation actions 
     101add_action( 'activate_' . HMBKP_PLUGIN_SLUG . '/plugin.php', 'hmbkp_activate' ); 
     102add_action( 'deactivate_' . HMBKP_PLUGIN_SLUG . '/plugin.php', 'hmbkp_deactivate' ); 
     103 
     104if ( ! function_exists( 'hmbkp_init' ) ) : 
    66105 
    67106/** 
     
    104143    } 
    105144 
    106     hmbkp_setup_default_schedules(); 
    107  
    108145    // Handle any advanced option changes 
    109     // TODO 
    110146    hmbkp_constant_changes(); 
    111147 
     
    113149add_action( 'admin_init', 'hmbkp_init' ); 
    114150 
    115 // Load the admin menu 
    116 require_once( HMBKP_PLUGIN_PATH . '/admin/menu.php' ); 
    117 require_once( HMBKP_PLUGIN_PATH . '/admin/actions.php' ); 
     151/** 
     152 * Function to run when the schedule cron fires 
     153 * @param  array $args 
     154 */ 
     155function hmbkp_schedule_hook_run( $schedule_id ) { 
    118156 
    119 // Load hm-backup 
    120 if ( ! class_exists( 'HM_Backup' ) ) 
    121     require_once( HMBKP_PLUGIN_PATH . '/hm-backup/hm-backup.php' ); 
     157    $schedules = new HMBKP_Schedules(); 
     158    $schedule = $schedules->get_schedule( $schedule_id ); 
    122159 
    123 // Load the schedules 
    124 require_once( HMBKP_PLUGIN_PATH . '/classes/schedule.php' ); 
    125 require_once( HMBKP_PLUGIN_PATH . '/classes/schedules.php' ); 
     160    if ( ! $schedule ) 
     161        return; 
    126162 
    127 // Load the core functions 
    128 require_once( HMBKP_PLUGIN_PATH . '/functions/core.php' ); 
    129 require_once( HMBKP_PLUGIN_PATH . '/functions/interface.php' ); 
     163    $schedule->run(); 
    130164 
    131 // Load Services 
    132 require_once( HMBKP_PLUGIN_PATH . '/classes/services.php' ); 
     165} 
     166add_action( 'hmbkp_schedule_hook', 'hmbkp_schedule_hook_run' ); 
    133167 
    134 // Load the email service 
    135 require_once( HMBKP_PLUGIN_PATH . '/classes/email.php' ); 
    136  
    137 // Load the wp cli command 
    138 if ( defined( 'WP_CLI' ) && WP_CLI ) 
    139     include( HMBKP_PLUGIN_PATH . '/classes/wp-cli.php' ); 
    140  
    141 // Set the tmp directory to the backup path 
    142 if ( ! defined( 'PCLZIP_TEMPORARY_DIR' ) ) 
    143     define( 'PCLZIP_TEMPORARY_DIR', trailingslashit( hmbkp_path() ) ); 
    144  
    145 // Hook in the activation and deactivation actions 
    146 add_action( 'activate_' . HMBKP_PLUGIN_SLUG . '/plugin.php', 'hmbkp_activate' ); 
    147 add_action( 'deactivate_' . HMBKP_PLUGIN_SLUG . '/plugin.php', 'hmbkp_deactivate' ); 
     168endif; 
  • backupwordpress/tags/2.0.3/readme.txt

    r611550 r614508  
    44Requires at least: 3.3.3 
    55Tested up to: 3.5 
    6 Stable tag: 2.0.2 
     6Stable tag: 2.0.3 
    77 
    88Simple automated back ups of your WordPress powered website. 
     
    103103 
    104104== Changelog == 
     105 
     106#### 2.0.3 
     107 
     108* Fix issues with scheduled backups not firing in some cases. 
     109* Better compatibility when the WP Remote plugin is active alongside BackUpWordPress. 
     110* Catch and display more WP Cron errors. 
     111* BackUpWordPress now fails to activate on WordPress 3.3.2 and below. 
     112* Other minor fixes and improvements. 
    105113 
    106114#### 2.0.2 
  • backupwordpress/trunk/admin/actions.php

    r611550 r614508  
    167167    $response = wp_remote_get( site_url( 'wp-cron.php' ) ); 
    168168 
    169     if ( is_wp_error( $response ) || $response['response']['code'] !== 200 ) 
     169    if ( is_wp_error( $response ) ) 
     170        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>'; 
     171 
     172    else if ( $response['response']['code'] != 200 ) 
    170173        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['response']['code'] . '</code>', '<a href="http://wordpress.org/extend/plugins/backupwordpress/faq/">FAQ</a>' ) . '</p></div>'; 
    171174 
  • backupwordpress/trunk/classes/schedule.php

    r602026 r614508  
    3333 
    3434    /** 
    35      * The unique hook name for this schedule 
    36      * 
    37      * @var string 
    38      * @access private 
    39      */ 
    40     private $schedule_hook = ''; 
    41  
    42     /** 
    4335     * The filepath for the .running file which 
    4436     * is used to track whether a backup is currently in 
     
    125117        $this->options = array_filter( (array) get_option( 'hmbkp_schedule_' . $this->get_id() ) ); 
    126118 
    127         // Setup the schedule hook 
    128         $this->schedule_hook = 'hmbkp_schedule_' . $this->get_id() . '_hook'; 
    129  
    130119        // Some properties can be overridden with defines 
    131120        if ( defined( 'HMBKP_ROOT' ) && HMBKP_ROOT ) 
     
    413402            return 0; 
    414403 
    415         if ( ! $this->schedule_start_time ) 
    416             $this->set_schedule_start_time( current_time( 'timestamp' ) ); 
    417  
     404        if ( ! $this->schedule_start_time ) { 
     405 
     406            if ( strtotime( '11pm' ) < strtotime( 'now' ) ) 
     407                $date = strtotime( 'tomorrow 11pm' ); 
     408            else 
     409                $date = strtotime( '11pm' ); 
     410 
     411            $date -= ( get_option( 'gmt_offset' ) * 3600 ); 
     412             
     413            $this->set_schedule_start_time( $date ); 
     414        } 
    418415        return $this->schedule_start_time; 
    419416 
     
    500497    public function get_next_occurrence() { 
    501498 
    502         return wp_next_scheduled( $this->schedule_hook ); 
     499        return wp_next_scheduled( 'hmbkp_schedule_hook', array( 'id' => $this->get_id() ) ); 
    503500 
    504501    } 
     
    518515        $this->unschedule(); 
    519516 
    520         wp_schedule_event( $this->get_schedule_start_time() + $this->get_interval(), $this->get_reoccurrence(), $this->schedule_hook ); 
    521  
    522         // Hook the backu into the schedule hook 
    523         add_action( $this->schedule_hook, array( $this, 'run' ) ); 
    524  
     517        wp_schedule_event( $this->get_schedule_start_time(), $this->get_reoccurrence(), 'hmbkp_schedule_hook', array( 'id' => $this->get_id() ) ); 
    525518    } 
    526519 
    527520    public function unschedule() { 
    528         wp_clear_scheduled_hook( $this->schedule_hook ); 
     521        wp_clear_scheduled_hook( 'hmbkp_schedule_hook', array( 'id' => $this->get_id() ) ); 
    529522    } 
    530523 
     
    669662     * @todo look into using recursiveDirectoryIterator and recursiveRegexIterator 
    670663     * @access public 
     664     * @return string[] - file paths of the backups 
    671665     */ 
    672666    public function get_backups() { 
  • backupwordpress/trunk/classes/schedules.php

    r588863 r614508  
    4242 
    4343    /** 
     44     * Get a schedule by ID 
     45     *  
     46     * @return HMBKP_Scheduled_Backup 
     47     */ 
     48    public function get_schedule( $id ) { 
     49 
     50        foreach ( $this->schedules as $schedule ) 
     51            if ( $schedule->get_id() == $id ) 
     52                return $schedule; 
     53 
     54        return null; 
     55    } 
     56 
     57    /** 
    4458     * Instantiate the individual scheduled backup objects 
    4559     * 
  • backupwordpress/trunk/classes/services.php

    r598091 r614508  
    9191        $errors = $this->update( $new_data, $old_data ); 
    9292 
    93         if ( $errors = array_flip( $errors ) ) { 
     93        if ( $errors && $errors = array_flip( $errors ) ) { 
    9494 
    9595            foreach( $errors as $error => &$field ) 
  • backupwordpress/trunk/functions/core.php

    r602026 r614508  
    199199 
    200200} 
     201add_action( 'admin_init', 'hmbkp_setup_default_schedules' ); 
    201202 
    202203/** 
  • backupwordpress/trunk/hm-backup/hm-backup.php

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

    r611550 r614508  
    66Description: Simple automated backups of your WordPress powered website. Once activated you'll find me under <strong>Tools &rarr; Backups</strong>. 
    77Author: Human Made Limited 
    8 Version: 2.0.2 
     8Version: 2.0.3 
    99Author URI: http://hmn.md/ 
    1010*/ 
     
    2727*/ 
    2828 
    29 define( 'HMBKP_PLUGIN_SLUG', 'backupwordpress' ); 
    30 define( 'HMBKP_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); 
    31 define( 'HMBKP_PLUGIN_URL', plugins_url( HMBKP_PLUGIN_SLUG ) ); 
     29if ( ! defined( 'HMBKP_PLUGIN_SLUG' ) ) 
     30    define( 'HMBKP_PLUGIN_SLUG', 'backupwordpress' ); 
     31 
     32if ( ! defined( 'HMBKP_PLUGIN_PATH' ) ) 
     33    define( 'HMBKP_PLUGIN_PATH', dirname( __FILE__ ) ); 
     34 
     35if ( ! defined( 'HMBKP_PLUGIN_URL' ) ) 
     36    define( 'HMBKP_PLUGIN_URL', str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, HMBKP_PLUGIN_PATH ) ); 
     37 
     38if ( ! defined( 'HMBKP_ADMIN_URL' ) ) 
     39    define( 'HMBKP_ADMIN_URL', add_query_arg( 'page', HMBKP_PLUGIN_SLUG, admin_url( 'tools.php' ) ) ); 
    3240 
    3341if ( ! defined( 'HMBKP_REQUIRED_WP_VERSION' ) ) 
    34     define( 'HMBKP_REQUIRED_WP_VERSION', '3.3.2' ); 
    35  
    36 define( 'HMBKP_ADMIN_URL', add_query_arg( 'page', HMBKP_PLUGIN_SLUG, admin_url( 'tools.php' ) ) ); 
    37  
    38 if ( ! defined( 'HMBKP_SECURE_KEY' ) ) 
    39     define( 'HMBKP_SECURE_KEY', md5( ABSPATH . time() ) ); 
     42    define( 'HMBKP_REQUIRED_WP_VERSION', '3.3.3' ); 
    4043 
    4144// Max memory limit isn't defined in old versions of WordPress 
     
    6467 
    6568} 
     69 
     70// Load the admin menu 
     71require_once( HMBKP_PLUGIN_PATH . '/admin/menu.php' ); 
     72require_once( HMBKP_PLUGIN_PATH . '/admin/actions.php' ); 
     73 
     74// Load hm-backup 
     75if ( ! class_exists( 'HM_Backup' ) ) 
     76    require_once( HMBKP_PLUGIN_PATH . '/hm-backup/hm-backup.php' ); 
     77 
     78// Load the schedules 
     79require_once( HMBKP_PLUGIN_PATH . '/classes/schedule.php' ); 
     80require_once( HMBKP_PLUGIN_PATH . '/classes/schedules.php' ); 
     81 
     82// Load the core functions 
     83require_once( HMBKP_PLUGIN_PATH . '/functions/core.php' ); 
     84require_once( HMBKP_PLUGIN_PATH . '/functions/interface.php' ); 
     85 
     86// Load Services 
     87require_once( HMBKP_PLUGIN_PATH . '/classes/services.php' ); 
     88 
     89// Load the email service 
     90require_once( HMBKP_PLUGIN_PATH . '/classes/email.php' ); 
     91 
     92// Load the wp cli command 
     93if ( defined( 'WP_CLI' ) && WP_CLI ) 
     94    include( HMBKP_PLUGIN_PATH . '/classes/wp-cli.php' ); 
     95 
     96// Set the tmp directory to the backup path 
     97if ( ! defined( 'PCLZIP_TEMPORARY_DIR' ) ) 
     98    define( 'PCLZIP_TEMPORARY_DIR', trailingslashit( hmbkp_path() ) ); 
     99 
     100// Hook in the activation and deactivation actions 
     101add_action( 'activate_' . HMBKP_PLUGIN_SLUG . '/plugin.php', 'hmbkp_activate' ); 
     102add_action( 'deactivate_' . HMBKP_PLUGIN_SLUG . '/plugin.php', 'hmbkp_deactivate' ); 
     103 
     104if ( ! function_exists( 'hmbkp_init' ) ) : 
    66105 
    67106/** 
     
    104143    } 
    105144 
    106     hmbkp_setup_default_schedules(); 
    107  
    108145    // Handle any advanced option changes 
    109     // TODO 
    110146    hmbkp_constant_changes(); 
    111147 
     
    113149add_action( 'admin_init', 'hmbkp_init' ); 
    114150 
    115 // Load the admin menu 
    116 require_once( HMBKP_PLUGIN_PATH . '/admin/menu.php' ); 
    117 require_once( HMBKP_PLUGIN_PATH . '/admin/actions.php' ); 
     151/** 
     152 * Function to run when the schedule cron fires 
     153 * @param  array $args 
     154 */ 
     155function hmbkp_schedule_hook_run( $schedule_id ) { 
    118156 
    119 // Load hm-backup 
    120 if ( ! class_exists( 'HM_Backup' ) ) 
    121     require_once( HMBKP_PLUGIN_PATH . '/hm-backup/hm-backup.php' ); 
     157    $schedules = new HMBKP_Schedules(); 
     158    $schedule = $schedules->get_schedule( $schedule_id ); 
    122159 
    123 // Load the schedules 
    124 require_once( HMBKP_PLUGIN_PATH . '/classes/schedule.php' ); 
    125 require_once( HMBKP_PLUGIN_PATH . '/classes/schedules.php' ); 
     160    if ( ! $schedule ) 
     161        return; 
    126162 
    127 // Load the core functions 
    128 require_once( HMBKP_PLUGIN_PATH . '/functions/core.php' ); 
    129 require_once( HMBKP_PLUGIN_PATH . '/functions/interface.php' ); 
     163    $schedule->run(); 
    130164 
    131 // Load Services 
    132 require_once( HMBKP_PLUGIN_PATH . '/classes/services.php' ); 
     165} 
     166add_action( 'hmbkp_schedule_hook', 'hmbkp_schedule_hook_run' ); 
    133167 
    134 // Load the email service 
    135 require_once( HMBKP_PLUGIN_PATH . '/classes/email.php' ); 
    136  
    137 // Load the wp cli command 
    138 if ( defined( 'WP_CLI' ) && WP_CLI ) 
    139     include( HMBKP_PLUGIN_PATH . '/classes/wp-cli.php' ); 
    140  
    141 // Set the tmp directory to the backup path 
    142 if ( ! defined( 'PCLZIP_TEMPORARY_DIR' ) ) 
    143     define( 'PCLZIP_TEMPORARY_DIR', trailingslashit( hmbkp_path() ) ); 
    144  
    145 // Hook in the activation and deactivation actions 
    146 add_action( 'activate_' . HMBKP_PLUGIN_SLUG . '/plugin.php', 'hmbkp_activate' ); 
    147 add_action( 'deactivate_' . HMBKP_PLUGIN_SLUG . '/plugin.php', 'hmbkp_deactivate' ); 
     168endif; 
  • backupwordpress/trunk/readme.txt

    r611550 r614508  
    44Requires at least: 3.3.3 
    55Tested up to: 3.5 
    6 Stable tag: 2.0.2 
     6Stable tag: 2.0.3 
    77 
    88Simple automated back ups of your WordPress powered website. 
     
    103103 
    104104== Changelog == 
     105 
     106#### 2.0.3 
     107 
     108* Fix issues with scheduled backups not firing in some cases. 
     109* Better compatibility when the WP Remote plugin is active alongside BackUpWordPress. 
     110* Catch and display more WP Cron errors. 
     111* BackUpWordPress now fails to activate on WordPress 3.3.2 and below. 
     112* Other minor fixes and improvements. 
    105113 
    106114#### 2.0.2 
Note: See TracChangeset for help on using the changeset viewer.