diff --git a/wp-db-backup.php b/wp-db-backup.php index 525db09..33af520 100755 --- a/wp-db-backup.php +++ b/wp-db-backup.php @@ -120,7 +120,7 @@ function __construct() { if ( isset( $_GET['wp_db_temp_dir'] ) ) { $requested_dir = sanitize_text_field( $_GET['wp_db_temp_dir'] ); - if ( is_writeable( $requested_dir ) ) { + if ( wp_is_writable ( $requested_dir ) ) { $tmp_dir = $requested_dir; } } @@ -421,7 +421,7 @@ function backup_fragment( $table, $segment, $filename ) { } } - if ( is_writable( $this->backup_dir ) ) { + if ( wp_is_writable( $this->backup_dir ) ) { $this->fp = $this->open( $this->backup_dir . $filename, 'a' ); if ( ! $this->fp ) { $this->error( __( 'Could not open the backup file for writing!', 'wp-db-backup' ) ); @@ -957,7 +957,7 @@ function backup_table( $table, $segment = 'none' ) { function db_backup( $core_tables, $other_tables ) { global $table_prefix, $wpdb; - if ( is_writable( $this->backup_dir ) ) { + if ( wp_is_writable( $this->backup_dir ) ) { $this->fp = $this->open( $this->backup_dir . $this->backup_filename ); if ( ! $this->fp ) { $this->error( __( 'Could not open the backup file for writing!', 'wp-db-backup' ) ); @@ -1219,7 +1219,7 @@ function backup_menu() { backup_dir ) && ! @chmod( $this->backup_dir, $dir_perms ) ) { + } elseif ( ! wp_is_writable( $this->backup_dir ) && ! @chmod( $this->backup_dir, $dir_perms ) ) { ?>
NOT writable! We cannot create the backup files.', 'wp-db-backup' ); ?>