| 729 | | |
|---|
| 730 | | if (! is_dir(ABSPATH . $this->backup_dir)) { |
|---|
| 731 | | echo '<div class="updated error"><p align="center">' . __('WARNING: Your backup directory does not exist!', 'wp-db-backup') . '<br />' . ABSPATH . $this->backup_dir . "</p></div>"; |
|---|
| | 733 | |
|---|
| | 734 | // Give the new dirs the same perms as wp-content. |
|---|
| | 735 | $stat = stat( ABSPATH . 'wp-content' ); |
|---|
| | 736 | $dir_perms = $stat['mode'] & 0000777; // Get the permission bits. |
|---|
| | 737 | |
|---|
| | 738 | if ( !file_exists( ABSPATH . $this->backup_dir) ) { |
|---|
| | 739 | if ( @ mkdir( ABSPATH . $this->backup_dir) ) { |
|---|
| | 740 | @ chmod( ABSPATH . $this->backup_dir, $dir_perms); |
|---|
| | 741 | } else { |
|---|
| | 742 | echo '<div class="updated error"><p align="center">' . __('WARNING: Your wp-content directory is <strong>NOT</strong> writable! We can not create the backup directory.', 'wp-db-backup') . '<br />' . ABSPATH . "</p></div>"; |
|---|
| 733 | | }elseif (! is_writable(ABSPATH . $this->backup_dir)) { |
|---|
| 734 | | echo '<div class="updated error"><p align="center">' . __('WARNING: Your backup directory is <strong>NOT</strong> writable!', 'wp-db-backup') . '<br />' . ABSPATH . $this->backup_dir . "</p></div>"; |
|---|
| 735 | | $WHOOPS = TRUE; |
|---|
| 736 | | } |
|---|
| | 744 | } |
|---|
| | 745 | } |
|---|
| | 746 | |
|---|
| | 747 | if ( !is_writable( ABSPATH . $this->backup_dir) ) { |
|---|
| | 748 | echo '<div class="updated error"><p align="center">' . __('WARNING: Your backup directory is <strong>NOT</strong> writable! We can not create the backup directory.', 'wp-db-backup') . '<br />' . ABSPATH . "</p></div>"; |
|---|
| | 749 | } |
|---|
| | 750 | |
|---|
| | 751 | if ( !file_exists( ABSPATH . $this->backup_dir . 'index.php') ) { |
|---|
| | 752 | @ touch( ABSPATH . $this->backup_dir . "index.php"); |
|---|
| | 753 | } |
|---|
| | 754 | |
|---|