Ticket #1934 (closed defect (bug): fixed)

Opened 6 years ago

Last modified 5 years ago

wp-db-backup patch

Reported by: skippy Owned by: anonymous
Priority: normal Milestone:
Component: Administration Version: 1.6
Severity: normal Keywords: bg|has-patch wp-db-backup
Cc:

Description

  • wp-db-backup requires that /wp-content/ be writable, in order to create a backup destination directory that is not easily guessed. I strongly discourage /wp-content/ from being writable. Specific directories underneath can (and should) be writable.
  • the error message supplied when /wp-content/ is not writable is not helpful:
    WARNING: Your wp-content directory is NOT writable! We can not create the backup directory.
    /home/skippy/public_html/wp
    

The display of ABSPATH is actively misleading. This is a more helpful message:

WARNING: Your /wp-content/backup/ directory is NOT writable! We cannot create the backup directory:
/home/skippy/public_html/wp/wp-content/backup/FOO
  • The error message is repeated, which is less than useful.

The attached patch:

  • revised WP_BACKUP_DIR to use /wp-content/backup/XXX
  • displays the whole path in the error message
  • and dies outright if the backup directory cannot be created so as to suppress multiple error messages.

Attachments

wp-db-backup.diff Download (1.7 KB) - added by skippy 6 years ago.

Change History

skippy6 years ago

  • Keywords bg|has-patch wp-db-backup added

comment:2   matt6 years ago

We have always encouraged wp-content to be writable, unless you can give a compelling argument otherwise I don't see any reason to include the directory part of this patch.

The wiki page you refer to in your weblog post is misleading and should probably be updated.

 http://codex.wordpress.org/Hardening_WordPress#File_permissions

The error messages could still bear being more helpful, I'll see if I can roll in that part.

comment:3   matt6 years ago

  • Status changed from new to closed
  • Resolution set to fixed

(In [3212]) Better error, fixes #1934

  • Milestone 2.0 deleted

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.