WordPress.org

Plugin Directory

Changeset 631412


Ignore:
Timestamp:
11/28/12 18:24:58 (17 months ago)
Author:
willmot
Message:

Release 2.4.12.

Location:
wpremote
Files:
16 edited
10 copied

Legend:

Unmodified
Added
Removed
  • wpremote/tags/2.4.12/backupwordpress/admin/actions.php

    r629045 r631412  
    4646 
    4747    if ( empty( $_POST['hmbkp_schedule_id'] ) ) 
    48         return; 
    49  
    50     // We wan't to display any fatal errors in this ajax request so we can catch them on the other side. 
     48        exit; 
     49 
     50    // We want to display any fatal errors in this ajax request so we can catch them on the other side. 
    5151    error_reporting( E_ERROR ); 
    5252    @ini_set( 'display_errors', 'On' ); 
     
    7676function hmbkp_request_download_backup() { 
    7777 
     78    global $is_apache; 
     79 
    7880    if ( empty( $_GET['hmbkp_download_backup'] ) || ! check_admin_referer( 'hmbkp-download_backup' ) || ! file_exists( base64_decode( $_GET['hmbkp_download_backup'] ) ) ) 
    7981        return; 
     
    8183    $url = str_replace( HM_Backup::conform_dir( HM_Backup::get_home_path() ), home_url(), trailingslashit( dirname( base64_decode( $_GET['hmbkp_download_backup'] ) ) ) ) . urlencode( pathinfo( base64_decode( $_GET['hmbkp_download_backup'] ), PATHINFO_BASENAME ) ); 
    8284 
    83     if ( apply_filters( 'got_rewrite', apache_mod_loaded( 'mod_rewrite', true ) ) ) { 
     85    if ( $is_apache ) { 
    8486 
    8587        // Force the .htaccess to be rebuilt 
     
    148150 
    149151    if ( empty( $_POST['hmbkp_schedule_id'] ) ) 
    150         return; 
     152        exit; 
    151153 
    152154    $schedule = new HMBKP_Scheduled_Backup( urldecode( $_POST['hmbkp_schedule_id'] ) ); 
     
    169171 
    170172    if ( empty( $_POST['hmbkp_schedule_id'] ) ) 
    171         return; 
     173        exit; 
    172174 
    173175    $schedule = new HMBKP_Scheduled_Backup( urldecode( $_POST['hmbkp_schedule_id'] ) ); 
     
    208210function hmbkp_edit_schedule_load() { 
    209211 
     212    if ( empty( $_GET['hmbkp_schedule_id'] ) ) 
     213        exit; 
     214 
    210215    $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] ); 
    211216 
     
    221226 */ 
    222227function hmbkp_edit_schedule_excludes_load() { 
     228 
     229    if ( empty( $_GET['hmbkp_schedule_id'] ) ) 
     230        exit; 
    223231 
    224232    $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] ); 
     
    254262 
    255263    if ( empty( $_GET['hmbkp_schedule_id'] ) ) 
    256         return; 
     264        exit; 
    257265 
    258266    $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] ); 
     
    326334function hmbkp_add_exclude_rule() { 
    327335 
     336    if ( empty( $_POST['hmbkp_schedule_id'] ) ) 
     337        exit; 
     338 
    328339    $schedule = new HMBKP_Scheduled_Backup( $_POST['hmbkp_schedule_id'] ); 
    329340 
     
    348359function hmbkp_delete_exclude_rule() { 
    349360 
     361    if ( empty( $_GET['hmbkp_schedule_id'] ) ) 
     362        exit; 
     363 
    350364    $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] ); 
    351365 
     
    372386function hmbkp_preview_exclude_rule() { 
    373387 
    374     if ( ! empty( $_POST['hmbkp_schedule_id'] ) ) 
    375         $schedule = new HMBKP_Scheduled_Backup( $_POST['hmbkp_schedule_id'] ); 
    376  
    377     if ( ! empty( $_POST['hmbkp_schedule_excludes'] ) ) 
    378         $excludes = explode( ',', $_POST['hmbkp_schedule_excludes'] ); 
     388    if ( empty( $_POST['hmbkp_schedule_id'] ) || empty( $_POST['hmbkp_schedule_excludes'] ) ) 
     389        exit; 
     390 
     391    $schedule = new HMBKP_Scheduled_Backup( $_POST['hmbkp_schedule_id'] ); 
     392 
     393    $excludes = explode( ',', $_POST['hmbkp_schedule_excludes'] ); 
    379394 
    380395    hmbkp_file_list( $schedule, $excludes, 'get_excluded_files' ); 
     
    382397    $schedule->set_excludes( $excludes ); 
    383398 
    384     error_log( $schedule->get_excluded_file_count() ); 
    385  
    386399    if ( $schedule->get_excluded_file_count() ) { ?> 
    387400 
     
    404417 
    405418    if ( empty( $_POST['hmbkp_error'] ) ) 
    406         return; 
     419        exit; 
    407420 
    408421    $error = str_replace( HM_Backup::get_home_path(), '', $_POST['hmbkp_error'] ); ?> 
     
    426439 
    427440    if ( empty( $_POST['hmbkp_error'] ) ) 
    428         return; 
     441        exit; 
    429442 
    430443    $error = $_POST['hmbkp_error']; 
  • wpremote/tags/2.4.12/backupwordpress/admin/schedule.php

    r628711 r631412  
    9494<div class="hmbkp-schedule-sentence<?php if ( $schedule->get_status() ) { ?> hmbkp-running<?php } ?>"> 
    9595 
    96     <?php printf( __( 'Backup my %1$s %2$s %3$s, %4$s. %5$s', 'hmbkp' ), $filesize, '<span>' . $type . '</span>', $reoccurrence, $backup_to_keep, implode( '. ', $services ) ); ?> 
     96    <?php printf( __( 'Backup my %1$s %2$s %3$s, %4$s. %5$s', 'hmbkp' ), $filesize, '<span>' . $type . '</span>', $reoccurrence, $backup_to_keep, implode( '. ', array_filter( $services ) ) ); ?> 
    9797 
    9898    <?php hmbkp_schedule_actions( $schedule ); ?> 
  • wpremote/tags/2.4.12/backupwordpress/assets/hmbkp.js

    r629045 r631412  
    217217 
    218218                // Assume success if no data passed back 
    219                 if ( ! data ) { 
     219                if ( ! data || data == 0 ) { 
    220220 
    221221                    $.fancybox.close(); 
     
    307307 
    308308                // Backup Succeeded 
    309                 if ( ! data ) { 
     309                if ( ! data || data == 0 ) { 
    310310                    location.reload( true ); 
    311311                } 
     
    321321                        function( data ) { 
    322322 
    323                             if ( ! data ) 
     323                            if ( ! data || data == 0 ) 
    324324                                return; 
    325325 
     
    376376        function( data ) { 
    377377 
    378             if ( data === 0 && redirect === true ) { 
    379                     location.reload( true ); 
     378            if ( data == 0 && redirect === true ) { 
     379                location.reload( true ); 
    380380 
    381381            } else { 
  • wpremote/tags/2.4.12/backupwordpress/classes/schedule.php

    r629088 r631412  
    307307                foreach ( $this->get_files() as $file ) { 
    308308 
    309                     if ( $file === '.' || $file === '..' || ! $file->isReadable() ) 
    310                         continue; 
     309                    // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     310                    if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     311                        continue; 
     312 
     313                    if ( ! $file->isReadable() ) 
     314                        continue; 
    311315 
    312316                    // Excludes 
  • wpremote/tags/2.4.12/backupwordpress/functions/core.php

    r629045 r631412  
    262262function hmbkp_path() { 
    263263 
     264    global $is_apache; 
     265 
    264266    $path = get_option( 'hmbkp_path' ); 
    265267 
     
    286288        file_put_contents( $index, '' ); 
    287289 
     290    $htaccess = $path . '/.htaccess'; 
     291 
    288292    // Protect the directory with a .htaccess file on Apache servers 
    289     if ( apply_filters( 'got_rewrite', apache_mod_loaded( 'mod_rewrite', true ) ) && function_exists( 'insert_with_markers' ) && ! file_exists( $htaccess ) && is_writable( $path ) ) { 
    290  
    291         $htaccess = $path . '/.htaccess'; 
     293    if ( $is_apache && function_exists( 'insert_with_markers' ) && ! file_exists( $htaccess ) && is_writable( $path ) ) { 
    292294 
    293295        $contents[] = '# ' . sprintf( __( 'This %s file ensures that other people cannot download your backup files.', 'hmbkp' ), '.htaccess' ); 
     
    328330 
    329331    // If the backups dir can't be created in WP_CONTENT_DIR then fallback to uploads 
    330     if ( ( ! is_dir( $path ) && ! is_writable( dirname( $path ) ) ) || ( is_dir( $path ) && ! is_writable( $path ) ) && strpos( $path, $upload_dir['basedir'] ) === false ) { 
     332    if ( ( ( ! is_dir( $path ) && ! is_writable( dirname( $path ) ) ) || ( is_dir( $path ) && ! is_writable( $path ) ) ) && strpos( $path, $upload_dir['basedir'] ) === false ) { 
    331333 
    332334        hmbkp_path_move( $path, $path = HM_Backup::conform_dir( trailingslashit( $upload_dir['basedir'] ) . substr( md5( time() ), 0, 10 ) . '-backups' ) ); 
  • wpremote/tags/2.4.12/backupwordpress/functions/interface.php

    r628711 r631412  
    4848              $php_user = exec( 'whoami' ); 
    4949            $php_group = reset( explode( ' ', exec( 'groups' ) ) ); 
    50             echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress is almost ready.', 'hmbkp' ) . '</strong> ' . sprintf( __( 'The backups directory can\'t be created because your %1$s directory isn\'t writable, run %2$s or %3$s or create the folder yourself.', 'hmbkp' ), '<code>wp-content</code>', '<code>chown ' . $php_user . ':' . $php_group . ' ' . WP_CONTENT_DIR . '</code>', '<code>chmod 777 ' . WP_CONTENT_DIR . '</code>' ) . '</p></div>'; 
     50            echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress is almost ready.', 'hmbkp' ) . '</strong> ' . sprintf( __( 'The backups directory can\'t be created because your %1$s directory isn\'t writable, run %2$s or %3$s or create the folder yourself.', 'hmbkp' ), '<code>wp-content</code>', '<code>chown ' . $php_user . ':' . $php_group . ' ' . dirname( hmbkp_path() ) . '</code>', '<code>chmod 777 ' . dirname( hmbkp_path() ) . '</code>' ) . '</p></div>'; 
    5151         } 
    5252         add_action( 'admin_notices', 'hmbkp_path_exists_warning' ); 
     
    175175                continue; 
    176176 
    177             // Skip directory browsing dots 
    178             if ( $file === '.' || $file === '..' ) 
     177            // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     178            if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
    179179                continue; 
    180180 
  • wpremote/tags/2.4.12/backupwordpress/hm-backup/hm-backup.php

    r629088 r631412  
    196196        $home_path = ABSPATH; 
    197197 
    198         if ( $home_url !== $site_url ) 
     198        // If site_url contains home_url and they differ then assume WordPress is installed in a sub directory 
     199        if ( $home_url !== $site_url && strpos( $site_url, $home_url ) === 0 ) 
    199200            $home_path = trailingslashit( substr( ABSPATH, 0, strrpos( ABSPATH, str_replace( $home_url, '', $site_url ) ) ) ); 
    200201 
     
    818819            foreach ( $this->get_files() as $file ) { 
    819820 
    820                 if ( $file === '.' || $file === '..' || ! $file->isReadable() ) 
    821                     continue; 
     821                // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     822                if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     823                    continue; 
     824 
     825                // Skip unreadable files 
     826                if ( ! $file->isReadable() ) 
     827                    continue; 
    822828 
    823829                // Excludes 
     
    903909            return true; 
    904910 
    905         if ( ! file_exists( $this->get_database_dump_filepath() ) ) 
     911        // mysqldump can create empty dump files on error so we need to check the filesize 
     912        if ( ! file_exists( $this->get_database_dump_filepath() ) || filesize( $this->get_database_dump_filepath() ) === 0 ) 
    906913            $this->error( $this->get_mysqldump_method(), __( 'The mysqldump file was not created', 'hmbkp' ) ); 
    907914 
     
    9971004        while ( $file = readdir( $handle ) ) : 
    9981005 
    999             // Ignore current dir and containing dir and any unreadable files or directories 
     1006            // Ignore current dir and containing dir 
    10001007            if ( $file === '.' || $file === '..' ) 
    10011008                continue; 
     
    10321039        foreach ( $this->get_files() as $file ) { 
    10331040 
    1034             if ( $file === '.' || $file === '..' || ! $file->isReadable() ) 
    1035                 continue; 
     1041            // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     1042            if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     1043                continue; 
     1044 
     1045            // Skip unreadable files 
     1046            if ( ! $file->isReadable() ) 
     1047                continue; 
    10361048 
    10371049            // Excludes 
     
    10641076        foreach ( $this->get_files() as $file ) { 
    10651077 
    1066             if ( $file === '.' || $file === '..' || ! $file->isReadable() ) 
    1067                 continue; 
     1078            // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     1079            if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     1080                continue; 
     1081 
     1082            // Skip unreadable files 
     1083            if ( ! $file->isReadable() ) 
     1084                continue; 
    10681085 
    10691086            // Excludes 
     
    10961113        foreach ( $this->get_files() as $file ) { 
    10971114 
    1098             if ( $file === '.' || $file === '..' || ! $file->isReadable() ) 
    1099                 continue; 
     1115            // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     1116            if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     1117                continue; 
     1118 
     1119            // Skip unreadable files 
     1120            if ( ! $file->isReadable() ) 
     1121                continue; 
    11001122 
    11011123            // Excludes 
     
    11261148        foreach ( $this->get_files() as $file ) { 
    11271149 
    1128             if ( $file === '.' || $file === '..' || ! $file->isReadable() ) 
    1129                 continue; 
     1150            // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     1151            if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     1152                continue; 
     1153 
     1154            // Skip unreadable files 
     1155            if ( ! $file->isReadable() ) 
     1156                continue; 
    11301157 
    11311158            // Excludes 
     
    11541181        foreach ( $this->get_files() as $file ) { 
    11551182 
    1156             if ( $file === '.' || $file === '..' ) 
    1157                 continue; 
     1183            // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     1184            if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     1185                continue; 
    11581186 
    11591187            if ( ! $file->isReadable() ) 
     
    11811209        foreach ( $this->get_files() as $file ) { 
    11821210 
    1183             if ( $file === '.' || $file === '..' ) 
    1184                 continue; 
     1211            // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     1212            if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     1213                continue; 
    11851214 
    11861215            if ( ! $file->isReadable() ) 
  • wpremote/tags/2.4.12/backupwordpress/plugin.php

    r629094 r631412  
    110110function hmbkp_init() { 
    111111 
    112     $plugin_data = get_plugin_data( __FILE__ ); 
    113  
    114112    // define the plugin version 
    115     define( 'HMBKP_VERSION', $plugin_data['Version'] ); 
     113    define( 'HMBKP_VERSION', '2.1.3' ); 
    116114 
    117115    // Load translations 
  • wpremote/tags/2.4.12/backupwordpress/readme.txt

    r629088 r631412  
    44Requires at least: 3.3.3 
    55Tested up to: 3.5 
    6 Stable tag: 2.1 
     6Stable tag: 2.1.3 
    77 
    88Simple automated back ups of your WordPress powered website. 
     
    104104== Changelog == 
    105105 
     106#### 2.1.4 
     107 
     108* Don't repeatedly try to create the backups directory in the `uploads` if `uploads` isn't writable. 
     109* Show the correct path in the warning message when the backups path can't be created. 
     110 
     111#### 2.1.3 
     112 
     113* Fix a regression in `2.1.2` that broke previewing and adding new exclude rules. 
     114 
     115#### 2.1.2 
     116 
     117* Fix an issue that could stop the settings panel from closing on save on servers which return `'0'` for ajax requests. 
     118* Fix an issue that could cause the backup root to be set to `/` on sites with `site_url` and `home` set to different domains. 
     119* The mysqldump fallback function will now be used if `mysqldump` produces an empty file. 
     120* Fix a possible PHP `NOTICE` on Apache servers. 
     121 
    106122#### 2.1.1 
    107123 
     
    109125* Don't use functions from misc.php as loading it too early can cause fatal errors. 
    110126* Don't hardcode an English string in the JS, use the translated string instead. 
     127* Properly skip dot files, should fix fatal errors on systems with `open_basedir` restrictions. 
     128* Don't call `apache_mod_loaded` as it caused wierd DNS issue on some sites, use `global $is_apache` instead. 
     129* Fix a possible double full stop at the end of the schedule sentence. 
    111130* Minor code cleanup. 
    112131 
  • wpremote/tags/2.4.12/plugin.php

    r629104 r631412  
    44Plugin Name: WP Remote 
    55Description: Manage your WordPress site with <a href="https://wpremote.com/">WP Remote</a>. <strong>Deactivate to clear your API Key.</strong> 
    6 Version: 2.4.11 
     6Version: 2.4.12 
    77Author: Human Made Limited 
    88Author URI: http://hmn.md/ 
     
    7070 
    7171        require( WPRP_PLUGIN_PATH . '/backupwordpress/plugin.php' ); 
     72 
     73        // Set the correct path for the BackUpWordPress language files. 
     74        load_plugin_textdomain( 'hmbkp', false, '/wpremote/' . HMBKP_PLUGIN_SLUG . '/languages/' ); 
    7275 
    7376        require_once( WPRP_PLUGIN_PATH . '/wprp.backups.php' ); 
  • wpremote/tags/2.4.12/readme.txt

    r629104 r631412  
    44Requires at least: 2.9 
    55Tested up to: 3.5 
    6 Stable tag: 2.4.11 
     6Stable tag: 2.4.12 
    77 
    88WP Remote is a free web app that enables you to easily manage all of your WordPress powered sites from one place. 
     
    3131 
    3232== Changelog == 
     33 
     34#### 2.4.12 
     35 
     36* Upgrade bundled BackUpWordPress to 2.1.3. 
     37* Fix an issue with Download Site on Apache servers. 
     38* Set the correct location for the BackUpWordPress language files. 
    3339 
    3440#### 2.4.10 + 2.4.11 
  • wpremote/trunk/backupwordpress/admin/actions.php

    r629045 r631412  
    4646 
    4747    if ( empty( $_POST['hmbkp_schedule_id'] ) ) 
    48         return; 
    49  
    50     // We wan't to display any fatal errors in this ajax request so we can catch them on the other side. 
     48        exit; 
     49 
     50    // We want to display any fatal errors in this ajax request so we can catch them on the other side. 
    5151    error_reporting( E_ERROR ); 
    5252    @ini_set( 'display_errors', 'On' ); 
     
    7676function hmbkp_request_download_backup() { 
    7777 
     78    global $is_apache; 
     79 
    7880    if ( empty( $_GET['hmbkp_download_backup'] ) || ! check_admin_referer( 'hmbkp-download_backup' ) || ! file_exists( base64_decode( $_GET['hmbkp_download_backup'] ) ) ) 
    7981        return; 
     
    8183    $url = str_replace( HM_Backup::conform_dir( HM_Backup::get_home_path() ), home_url(), trailingslashit( dirname( base64_decode( $_GET['hmbkp_download_backup'] ) ) ) ) . urlencode( pathinfo( base64_decode( $_GET['hmbkp_download_backup'] ), PATHINFO_BASENAME ) ); 
    8284 
    83     if ( apply_filters( 'got_rewrite', apache_mod_loaded( 'mod_rewrite', true ) ) ) { 
     85    if ( $is_apache ) { 
    8486 
    8587        // Force the .htaccess to be rebuilt 
     
    148150 
    149151    if ( empty( $_POST['hmbkp_schedule_id'] ) ) 
    150         return; 
     152        exit; 
    151153 
    152154    $schedule = new HMBKP_Scheduled_Backup( urldecode( $_POST['hmbkp_schedule_id'] ) ); 
     
    169171 
    170172    if ( empty( $_POST['hmbkp_schedule_id'] ) ) 
    171         return; 
     173        exit; 
    172174 
    173175    $schedule = new HMBKP_Scheduled_Backup( urldecode( $_POST['hmbkp_schedule_id'] ) ); 
     
    208210function hmbkp_edit_schedule_load() { 
    209211 
     212    if ( empty( $_GET['hmbkp_schedule_id'] ) ) 
     213        exit; 
     214 
    210215    $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] ); 
    211216 
     
    221226 */ 
    222227function hmbkp_edit_schedule_excludes_load() { 
     228 
     229    if ( empty( $_GET['hmbkp_schedule_id'] ) ) 
     230        exit; 
    223231 
    224232    $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] ); 
     
    254262 
    255263    if ( empty( $_GET['hmbkp_schedule_id'] ) ) 
    256         return; 
     264        exit; 
    257265 
    258266    $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] ); 
     
    326334function hmbkp_add_exclude_rule() { 
    327335 
     336    if ( empty( $_POST['hmbkp_schedule_id'] ) ) 
     337        exit; 
     338 
    328339    $schedule = new HMBKP_Scheduled_Backup( $_POST['hmbkp_schedule_id'] ); 
    329340 
     
    348359function hmbkp_delete_exclude_rule() { 
    349360 
     361    if ( empty( $_GET['hmbkp_schedule_id'] ) ) 
     362        exit; 
     363 
    350364    $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] ); 
    351365 
     
    372386function hmbkp_preview_exclude_rule() { 
    373387 
    374     if ( ! empty( $_POST['hmbkp_schedule_id'] ) ) 
    375         $schedule = new HMBKP_Scheduled_Backup( $_POST['hmbkp_schedule_id'] ); 
    376  
    377     if ( ! empty( $_POST['hmbkp_schedule_excludes'] ) ) 
    378         $excludes = explode( ',', $_POST['hmbkp_schedule_excludes'] ); 
     388    if ( empty( $_POST['hmbkp_schedule_id'] ) || empty( $_POST['hmbkp_schedule_excludes'] ) ) 
     389        exit; 
     390 
     391    $schedule = new HMBKP_Scheduled_Backup( $_POST['hmbkp_schedule_id'] ); 
     392 
     393    $excludes = explode( ',', $_POST['hmbkp_schedule_excludes'] ); 
    379394 
    380395    hmbkp_file_list( $schedule, $excludes, 'get_excluded_files' ); 
     
    382397    $schedule->set_excludes( $excludes ); 
    383398 
    384     error_log( $schedule->get_excluded_file_count() ); 
    385  
    386399    if ( $schedule->get_excluded_file_count() ) { ?> 
    387400 
     
    404417 
    405418    if ( empty( $_POST['hmbkp_error'] ) ) 
    406         return; 
     419        exit; 
    407420 
    408421    $error = str_replace( HM_Backup::get_home_path(), '', $_POST['hmbkp_error'] ); ?> 
     
    426439 
    427440    if ( empty( $_POST['hmbkp_error'] ) ) 
    428         return; 
     441        exit; 
    429442 
    430443    $error = $_POST['hmbkp_error']; 
  • wpremote/trunk/backupwordpress/admin/schedule.php

    r628711 r631412  
    9494<div class="hmbkp-schedule-sentence<?php if ( $schedule->get_status() ) { ?> hmbkp-running<?php } ?>"> 
    9595 
    96     <?php printf( __( 'Backup my %1$s %2$s %3$s, %4$s. %5$s', 'hmbkp' ), $filesize, '<span>' . $type . '</span>', $reoccurrence, $backup_to_keep, implode( '. ', $services ) ); ?> 
     96    <?php printf( __( 'Backup my %1$s %2$s %3$s, %4$s. %5$s', 'hmbkp' ), $filesize, '<span>' . $type . '</span>', $reoccurrence, $backup_to_keep, implode( '. ', array_filter( $services ) ) ); ?> 
    9797 
    9898    <?php hmbkp_schedule_actions( $schedule ); ?> 
  • wpremote/trunk/backupwordpress/assets/hmbkp.js

    r629045 r631412  
    217217 
    218218                // Assume success if no data passed back 
    219                 if ( ! data ) { 
     219                if ( ! data || data == 0 ) { 
    220220 
    221221                    $.fancybox.close(); 
     
    307307 
    308308                // Backup Succeeded 
    309                 if ( ! data ) { 
     309                if ( ! data || data == 0 ) { 
    310310                    location.reload( true ); 
    311311                } 
     
    321321                        function( data ) { 
    322322 
    323                             if ( ! data ) 
     323                            if ( ! data || data == 0 ) 
    324324                                return; 
    325325 
     
    376376        function( data ) { 
    377377 
    378             if ( data === 0 && redirect === true ) { 
    379                     location.reload( true ); 
     378            if ( data == 0 && redirect === true ) { 
     379                location.reload( true ); 
    380380 
    381381            } else { 
  • wpremote/trunk/backupwordpress/classes/schedule.php

    r629088 r631412  
    307307                foreach ( $this->get_files() as $file ) { 
    308308 
    309                     if ( $file === '.' || $file === '..' || ! $file->isReadable() ) 
    310                         continue; 
     309                    // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     310                    if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     311                        continue; 
     312 
     313                    if ( ! $file->isReadable() ) 
     314                        continue; 
    311315 
    312316                    // Excludes 
  • wpremote/trunk/backupwordpress/functions/core.php

    r629045 r631412  
    262262function hmbkp_path() { 
    263263 
     264    global $is_apache; 
     265 
    264266    $path = get_option( 'hmbkp_path' ); 
    265267 
     
    286288        file_put_contents( $index, '' ); 
    287289 
     290    $htaccess = $path . '/.htaccess'; 
     291 
    288292    // Protect the directory with a .htaccess file on Apache servers 
    289     if ( apply_filters( 'got_rewrite', apache_mod_loaded( 'mod_rewrite', true ) ) && function_exists( 'insert_with_markers' ) && ! file_exists( $htaccess ) && is_writable( $path ) ) { 
    290  
    291         $htaccess = $path . '/.htaccess'; 
     293    if ( $is_apache && function_exists( 'insert_with_markers' ) && ! file_exists( $htaccess ) && is_writable( $path ) ) { 
    292294 
    293295        $contents[] = '# ' . sprintf( __( 'This %s file ensures that other people cannot download your backup files.', 'hmbkp' ), '.htaccess' ); 
     
    328330 
    329331    // If the backups dir can't be created in WP_CONTENT_DIR then fallback to uploads 
    330     if ( ( ! is_dir( $path ) && ! is_writable( dirname( $path ) ) ) || ( is_dir( $path ) && ! is_writable( $path ) ) && strpos( $path, $upload_dir['basedir'] ) === false ) { 
     332    if ( ( ( ! is_dir( $path ) && ! is_writable( dirname( $path ) ) ) || ( is_dir( $path ) && ! is_writable( $path ) ) ) && strpos( $path, $upload_dir['basedir'] ) === false ) { 
    331333 
    332334        hmbkp_path_move( $path, $path = HM_Backup::conform_dir( trailingslashit( $upload_dir['basedir'] ) . substr( md5( time() ), 0, 10 ) . '-backups' ) ); 
  • wpremote/trunk/backupwordpress/functions/interface.php

    r628711 r631412  
    4848              $php_user = exec( 'whoami' ); 
    4949            $php_group = reset( explode( ' ', exec( 'groups' ) ) ); 
    50             echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress is almost ready.', 'hmbkp' ) . '</strong> ' . sprintf( __( 'The backups directory can\'t be created because your %1$s directory isn\'t writable, run %2$s or %3$s or create the folder yourself.', 'hmbkp' ), '<code>wp-content</code>', '<code>chown ' . $php_user . ':' . $php_group . ' ' . WP_CONTENT_DIR . '</code>', '<code>chmod 777 ' . WP_CONTENT_DIR . '</code>' ) . '</p></div>'; 
     50            echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress is almost ready.', 'hmbkp' ) . '</strong> ' . sprintf( __( 'The backups directory can\'t be created because your %1$s directory isn\'t writable, run %2$s or %3$s or create the folder yourself.', 'hmbkp' ), '<code>wp-content</code>', '<code>chown ' . $php_user . ':' . $php_group . ' ' . dirname( hmbkp_path() ) . '</code>', '<code>chmod 777 ' . dirname( hmbkp_path() ) . '</code>' ) . '</p></div>'; 
    5151         } 
    5252         add_action( 'admin_notices', 'hmbkp_path_exists_warning' ); 
     
    175175                continue; 
    176176 
    177             // Skip directory browsing dots 
    178             if ( $file === '.' || $file === '..' ) 
     177            // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     178            if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
    179179                continue; 
    180180 
  • wpremote/trunk/backupwordpress/hm-backup/hm-backup.php

    r629088 r631412  
    196196        $home_path = ABSPATH; 
    197197 
    198         if ( $home_url !== $site_url ) 
     198        // If site_url contains home_url and they differ then assume WordPress is installed in a sub directory 
     199        if ( $home_url !== $site_url && strpos( $site_url, $home_url ) === 0 ) 
    199200            $home_path = trailingslashit( substr( ABSPATH, 0, strrpos( ABSPATH, str_replace( $home_url, '', $site_url ) ) ) ); 
    200201 
     
    818819            foreach ( $this->get_files() as $file ) { 
    819820 
    820                 if ( $file === '.' || $file === '..' || ! $file->isReadable() ) 
    821                     continue; 
     821                // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     822                if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     823                    continue; 
     824 
     825                // Skip unreadable files 
     826                if ( ! $file->isReadable() ) 
     827                    continue; 
    822828 
    823829                // Excludes 
     
    903909            return true; 
    904910 
    905         if ( ! file_exists( $this->get_database_dump_filepath() ) ) 
     911        // mysqldump can create empty dump files on error so we need to check the filesize 
     912        if ( ! file_exists( $this->get_database_dump_filepath() ) || filesize( $this->get_database_dump_filepath() ) === 0 ) 
    906913            $this->error( $this->get_mysqldump_method(), __( 'The mysqldump file was not created', 'hmbkp' ) ); 
    907914 
     
    9971004        while ( $file = readdir( $handle ) ) : 
    9981005 
    999             // Ignore current dir and containing dir and any unreadable files or directories 
     1006            // Ignore current dir and containing dir 
    10001007            if ( $file === '.' || $file === '..' ) 
    10011008                continue; 
     
    10321039        foreach ( $this->get_files() as $file ) { 
    10331040 
    1034             if ( $file === '.' || $file === '..' || ! $file->isReadable() ) 
    1035                 continue; 
     1041            // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     1042            if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     1043                continue; 
     1044 
     1045            // Skip unreadable files 
     1046            if ( ! $file->isReadable() ) 
     1047                continue; 
    10361048 
    10371049            // Excludes 
     
    10641076        foreach ( $this->get_files() as $file ) { 
    10651077 
    1066             if ( $file === '.' || $file === '..' || ! $file->isReadable() ) 
    1067                 continue; 
     1078            // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     1079            if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     1080                continue; 
     1081 
     1082            // Skip unreadable files 
     1083            if ( ! $file->isReadable() ) 
     1084                continue; 
    10681085 
    10691086            // Excludes 
     
    10961113        foreach ( $this->get_files() as $file ) { 
    10971114 
    1098             if ( $file === '.' || $file === '..' || ! $file->isReadable() ) 
    1099                 continue; 
     1115            // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     1116            if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     1117                continue; 
     1118 
     1119            // Skip unreadable files 
     1120            if ( ! $file->isReadable() ) 
     1121                continue; 
    11001122 
    11011123            // Excludes 
     
    11261148        foreach ( $this->get_files() as $file ) { 
    11271149 
    1128             if ( $file === '.' || $file === '..' || ! $file->isReadable() ) 
    1129                 continue; 
     1150            // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     1151            if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     1152                continue; 
     1153 
     1154            // Skip unreadable files 
     1155            if ( ! $file->isReadable() ) 
     1156                continue; 
    11301157 
    11311158            // Excludes 
     
    11541181        foreach ( $this->get_files() as $file ) { 
    11551182 
    1156             if ( $file === '.' || $file === '..' ) 
    1157                 continue; 
     1183            // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     1184            if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     1185                continue; 
    11581186 
    11591187            if ( ! $file->isReadable() ) 
     
    11811209        foreach ( $this->get_files() as $file ) { 
    11821210 
    1183             if ( $file === '.' || $file === '..' ) 
    1184                 continue; 
     1211            // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3 
     1212            if ( method_exists( $file, 'isDot' ) && $file->isDot() ) 
     1213                continue; 
    11851214 
    11861215            if ( ! $file->isReadable() ) 
  • wpremote/trunk/backupwordpress/plugin.php

    r629094 r631412  
    110110function hmbkp_init() { 
    111111 
    112     $plugin_data = get_plugin_data( __FILE__ ); 
    113  
    114112    // define the plugin version 
    115     define( 'HMBKP_VERSION', $plugin_data['Version'] ); 
     113    define( 'HMBKP_VERSION', '2.1.3' ); 
    116114 
    117115    // Load translations 
  • wpremote/trunk/backupwordpress/readme.txt

    r629088 r631412  
    44Requires at least: 3.3.3 
    55Tested up to: 3.5 
    6 Stable tag: 2.1 
     6Stable tag: 2.1.3 
    77 
    88Simple automated back ups of your WordPress powered website. 
     
    104104== Changelog == 
    105105 
     106#### 2.1.4 
     107 
     108* Don't repeatedly try to create the backups directory in the `uploads` if `uploads` isn't writable. 
     109* Show the correct path in the warning message when the backups path can't be created. 
     110 
     111#### 2.1.3 
     112 
     113* Fix a regression in `2.1.2` that broke previewing and adding new exclude rules. 
     114 
     115#### 2.1.2 
     116 
     117* Fix an issue that could stop the settings panel from closing on save on servers which return `'0'` for ajax requests. 
     118* Fix an issue that could cause the backup root to be set to `/` on sites with `site_url` and `home` set to different domains. 
     119* The mysqldump fallback function will now be used if `mysqldump` produces an empty file. 
     120* Fix a possible PHP `NOTICE` on Apache servers. 
     121 
    106122#### 2.1.1 
    107123 
     
    109125* Don't use functions from misc.php as loading it too early can cause fatal errors. 
    110126* Don't hardcode an English string in the JS, use the translated string instead. 
     127* Properly skip dot files, should fix fatal errors on systems with `open_basedir` restrictions. 
     128* Don't call `apache_mod_loaded` as it caused wierd DNS issue on some sites, use `global $is_apache` instead. 
     129* Fix a possible double full stop at the end of the schedule sentence. 
    111130* Minor code cleanup. 
    112131 
  • wpremote/trunk/plugin.php

    r629104 r631412  
    44Plugin Name: WP Remote 
    55Description: Manage your WordPress site with <a href="https://wpremote.com/">WP Remote</a>. <strong>Deactivate to clear your API Key.</strong> 
    6 Version: 2.4.11 
     6Version: 2.4.12 
    77Author: Human Made Limited 
    88Author URI: http://hmn.md/ 
     
    7070 
    7171        require( WPRP_PLUGIN_PATH . '/backupwordpress/plugin.php' ); 
     72 
     73        // Set the correct path for the BackUpWordPress language files. 
     74        load_plugin_textdomain( 'hmbkp', false, '/wpremote/' . HMBKP_PLUGIN_SLUG . '/languages/' ); 
    7275 
    7376        require_once( WPRP_PLUGIN_PATH . '/wprp.backups.php' ); 
  • wpremote/trunk/readme.txt

    r629104 r631412  
    44Requires at least: 2.9 
    55Tested up to: 3.5 
    6 Stable tag: 2.4.11 
     6Stable tag: 2.4.12 
    77 
    88WP Remote is a free web app that enables you to easily manage all of your WordPress powered sites from one place. 
     
    3131 
    3232== Changelog == 
     33 
     34#### 2.4.12 
     35 
     36* Upgrade bundled BackUpWordPress to 2.1.3. 
     37* Fix an issue with Download Site on Apache servers. 
     38* Set the correct location for the BackUpWordPress language files. 
    3339 
    3440#### 2.4.10 + 2.4.11 
  • wpremote/trunk/wprp.admin.php

    r628711 r631412  
    6363 
    6464    <div id="wprp-message" class="updated"> 
    65         <p><strong>WP Remote API Key successfully added</strong>, close this page to go back to <a href="https://wpremote.com/app/">WP Remote</a>.</p> 
     65        <p><strong>WP Remote API Key successfully added</strong>, close this window to go back to <a href="https://wpremote.com/app/">WP Remote</a>.</p> 
    6666    </div> 
    6767 
  • wpremote/trunk/wprp.backups.php

    r628711 r631412  
    4141    public function getBackup() { 
    4242 
     43        global $is_apache; 
     44 
    4345        $schedule = $this->getManualBackupSchedule(); 
    4446 
     
    4850        $backup = reset( $schedule->get_backups() ); 
    4951 
    50         if ( file_exists( $backup ) ) 
     52        if ( file_exists( $backup ) ) { 
     53 
     54            // Append the secret key on apache servers 
     55            if ( $is_apache && defined( 'HMBKP_SECURE_KEY' ) && HMBKP_SECURE_KEY ) { 
     56 
     57                $backup = add_query_arg( 'key', HMBKP_SECURE_KEY, $backup ); 
     58 
     59                // Force the .htaccess to be rebuilt 
     60                if ( file_exists( hmbkp_path() . '/.htaccess' ) ) 
     61                    unlink( hmbkp_path() . '/.htaccess' ); 
     62 
     63                hmbkp_path(); 
     64 
     65            } 
     66 
    5167            return str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, $backup ); 
     68 
     69        } 
    5270 
    5371        return new WP_Error( 'backup-failed', 'No backup was found' ); 
     
    172190    public function action( $action ) { 
    173191 
     192        global $is_apache; 
     193 
    174194        if ( $action == 'hmbkp_backup_complete' && strpos( $this->schedule->get_id(), 'wpremote' ) !== false ) { 
    175195 
     
    178198            $api_url = WPR_API_URL . 'backups/upload'; 
    179199 
    180             if ( ( require_once( ABSPATH . '/wp-admin/includes/misc.php' ) ) && got_mod_rewrite() && defined( 'HMBKP_SECURE_KEY' ) && HMBKP_SECURE_KEY ) 
     200            if ( $is_apache && defined( 'HMBKP_SECURE_KEY' ) && HMBKP_SECURE_KEY ) { 
     201 
    181202                $file_url = add_query_arg( 'key', HMBKP_SECURE_KEY, $file_url ); 
     203 
     204                // Force the .htaccess to be rebuilt 
     205                if ( file_exists( hmbkp_path() . '/.htaccess' ) ) 
     206                    unlink( hmbkp_path() . '/.htaccess' ); 
     207 
     208                hmbkp_path(); 
     209 
     210            } 
    182211 
    183212            $args = array( 
  • wpremote/trunk/wprp.plugins.php

    r628711 r631412  
    193193    return array( 
    194194        'gravity_forms' => '_wpr_get_gravity_form_plugin_data', 
    195         'backupbuddy' => '_wpr_get_backupbuddy_plugin_data' 
     195        'backupbuddy' => '_wpr_get_backupbuddy_plugin_data', 
     196        'tribe_events_pro' => '_wpr_get_tribe_events_pro_plugin_data' 
    196197    ); 
    197198 
     
    245246 
    246247} 
     248 
     249function _wpr_get_tribe_events_pro_plugin_data() { 
     250 
     251    if ( !class_exists( 'TribeEventsPro' ) || ! class_exists( 'PluginUpdateEngineChecker' ) ) 
     252        return false; 
     253 
     254    $events = TribeEventsPro::instance(); 
     255    $updater = new PluginUpdateEngineChecker( $events->updateUrl, $events->pluginSlug, array(), plugin_basename( $events->pluginPath . 'events-calendar-pro.php' ) ); 
     256    $state = get_option( $updater->optionName ); 
     257 
     258    if ( !is_a( $state->update, 'PluginUpdateUtility' ) ) 
     259        return false; 
     260 
     261    if ( version_compare( $state->update->version, $updater->getInstalledVersion(), '<=' ) ) 
     262        return false; 
     263 
     264    $update_data = $state->update->toWpFormat(); 
     265    $update_data->plugin_location = $updater->pluginFile; // needed in _wpr_add_non_extend_plugin_support() 
     266 
     267} 
Note: See TracChangeset for help on using the changeset viewer.