Version Description
Download this release
Release Info
| Developer | willmot |
| Plugin | |
| Version | 1.6.3 |
| Comparing to | |
| See all releases | |
Code changes from version 1.6.2 to 1.6.3
- admin.actions.php +1 -1
- functions/backup.functions.php +2 -9
- functions/core.functions.php +1 -1
- functions/interface.functions.php +2 -2
- hm-backup/hm-backup.php +43 -37
- plugin.php +5 -5
- readme.txt +13 -1
admin.actions.php
CHANGED
|
@@ -163,7 +163,7 @@ function hmbkp_request_download_backup() {
|
|
| 163 |
|
| 164 |
hmbkp_path();
|
| 165 |
|
| 166 |
-
wp_redirect( add_query_arg( 'key', md5(
|
| 167 |
|
| 168 |
exit;
|
| 169 |
|
| 163 |
|
| 164 |
hmbkp_path();
|
| 165 |
|
| 166 |
+
wp_redirect( add_query_arg( 'key', md5( HMBKP_SECURE_KEY ), str_replace( hmbkp_conform_dir( ABSPATH ), site_url(), base64_decode( $_GET['hmbkp_download'] ) ) ), 303 );
|
| 167 |
|
| 168 |
exit;
|
| 169 |
|
functions/backup.functions.php
CHANGED
|
@@ -16,9 +16,6 @@ function hmbkp_do_backup() {
|
|
| 16 |
|
| 17 |
HM_Backup::get_instance()->backup();
|
| 18 |
|
| 19 |
-
// Email Backup
|
| 20 |
-
hmbkp_email_backup();
|
| 21 |
-
|
| 22 |
hmbkp_set_status( __( 'Removing old backups', 'hmbkp' ) );
|
| 23 |
|
| 24 |
// Delete any old backup files
|
|
@@ -125,12 +122,7 @@ function hmbkp_delete_backup( $file ) {
|
|
| 125 |
*/
|
| 126 |
function hmbkp_email_backup() {
|
| 127 |
|
| 128 |
-
if ( ! hmbkp_get_email_address() )
|
| 129 |
-
return false;
|
| 130 |
-
|
| 131 |
-
$file = HM_Backup::get_instance()->archive_filepath();
|
| 132 |
-
|
| 133 |
-
if ( ! file_exists( $file ) )
|
| 134 |
return;
|
| 135 |
|
| 136 |
// Raise the memory and time limit
|
|
@@ -168,6 +160,7 @@ function hmbkp_email_backup() {
|
|
| 168 |
return true;
|
| 169 |
|
| 170 |
}
|
|
|
|
| 171 |
|
| 172 |
/**
|
| 173 |
* Set the status of the running backup
|
| 16 |
|
| 17 |
HM_Backup::get_instance()->backup();
|
| 18 |
|
|
|
|
|
|
|
|
|
|
| 19 |
hmbkp_set_status( __( 'Removing old backups', 'hmbkp' ) );
|
| 20 |
|
| 21 |
// Delete any old backup files
|
| 122 |
*/
|
| 123 |
function hmbkp_email_backup() {
|
| 124 |
|
| 125 |
+
if ( ! hmbkp_get_email_address() || ! file_exists( HM_Backup::get_instance()->archive_filepath() ) )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
return;
|
| 127 |
|
| 128 |
// Raise the memory and time limit
|
| 160 |
return true;
|
| 161 |
|
| 162 |
}
|
| 163 |
+
add_action( 'hmbkp_backup_complete', 'hmbkp_email_backup', 11 );
|
| 164 |
|
| 165 |
/**
|
| 166 |
* Set the status of the running backup
|
functions/core.functions.php
CHANGED
|
@@ -332,7 +332,7 @@ function hmbkp_path() {
|
|
| 332 |
$contents[] = '# ' . __( 'This .htaccess file ensures that other people cannot download your backup files.', 'hmbkp' );
|
| 333 |
$contents[] = '';
|
| 334 |
$contents[] = 'RewriteEngine On';
|
| 335 |
-
$contents[] = 'RewriteCond %{QUERY_STRING} !key=' . md5(
|
| 336 |
$contents[] = 'RewriteRule (.*) - [F]';
|
| 337 |
$contents[] = '';
|
| 338 |
|
| 332 |
$contents[] = '# ' . __( 'This .htaccess file ensures that other people cannot download your backup files.', 'hmbkp' );
|
| 333 |
$contents[] = '';
|
| 334 |
$contents[] = 'RewriteEngine On';
|
| 335 |
+
$contents[] = 'RewriteCond %{QUERY_STRING} !key=' . md5( HMBKP_SECURE_KEY );
|
| 336 |
$contents[] = 'RewriteRule (.*) - [F]';
|
| 337 |
$contents[] = '';
|
| 338 |
|
functions/interface.functions.php
CHANGED
|
@@ -156,7 +156,7 @@ function hmbkp_admin_notices() {
|
|
| 156 |
if ( hmbkp_backup_errors_message() ) :
|
| 157 |
|
| 158 |
function hmbkp_backup_errors_notice() {
|
| 159 |
-
echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress detected
|
| 160 |
}
|
| 161 |
add_action( 'admin_notices', 'hmbkp_backup_errors_notice' );
|
| 162 |
|
|
@@ -166,7 +166,7 @@ function hmbkp_admin_notices() {
|
|
| 166 |
if ( hmbkp_backup_warnings_message() ) :
|
| 167 |
|
| 168 |
function hmbkp_backup_warnings_notice() {
|
| 169 |
-
echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress detected
|
| 170 |
}
|
| 171 |
add_action( 'admin_notices', 'hmbkp_backup_warnings_notice' );
|
| 172 |
|
| 156 |
if ( hmbkp_backup_errors_message() ) :
|
| 157 |
|
| 158 |
function hmbkp_backup_errors_notice() {
|
| 159 |
+
echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress detected issues with your last backup.', 'hmbkp' ) . '</strong><a href="' . add_query_arg( 'action', 'hmbkp_dismiss_error' ) . '" style="float: right;" class="button">Dismiss</a></p>' . hmbkp_backup_errors_message() . '</div>';
|
| 160 |
}
|
| 161 |
add_action( 'admin_notices', 'hmbkp_backup_errors_notice' );
|
| 162 |
|
| 166 |
if ( hmbkp_backup_warnings_message() ) :
|
| 167 |
|
| 168 |
function hmbkp_backup_warnings_notice() {
|
| 169 |
+
echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress detected issues with your last backup.', 'hmbkp' ) . '</strong><a href="' . add_query_arg( 'action', 'hmbkp_dismiss_error' ) . '" style="float: right;" class="button">Dismiss</a></p>' . hmbkp_backup_warnings_message() . '</div>';
|
| 170 |
}
|
| 171 |
add_action( 'admin_notices', 'hmbkp_backup_warnings_notice' );
|
| 172 |
|
hm-backup/hm-backup.php
CHANGED
|
@@ -301,9 +301,9 @@ class HM_Backup {
|
|
| 301 |
$cmd .= ' ' . escapeshellarg( DB_NAME );
|
| 302 |
|
| 303 |
// Send stdout to null
|
| 304 |
-
$cmd .= ' 2
|
| 305 |
|
| 306 |
-
shell_exec( $cmd );
|
| 307 |
|
| 308 |
}
|
| 309 |
|
|
@@ -374,11 +374,11 @@ class HM_Backup {
|
|
| 374 |
$this->zip();
|
| 375 |
|
| 376 |
// If not or if the shell zip failed then use ZipArchive
|
| 377 |
-
if (
|
| 378 |
$this->zip_archive();
|
| 379 |
|
| 380 |
// If ZipArchive is unavailable or one of the above failed
|
| 381 |
-
if (
|
| 382 |
$this->pcl_zip();
|
| 383 |
|
| 384 |
// Delete the database dump file
|
|
@@ -401,16 +401,16 @@ class HM_Backup {
|
|
| 401 |
|
| 402 |
// Zip up $this->root with excludes
|
| 403 |
if ( ! $this->database_only && $this->exclude_string( 'zip' ) )
|
| 404 |
-
$this->
|
| 405 |
-
|
| 406 |
// Zip up $this->root without excludes
|
| 407 |
elseif ( ! $this->database_only )
|
| 408 |
-
$this->
|
| 409 |
-
|
| 410 |
// Add the database dump to the archive
|
| 411 |
if ( ! $this->files_only )
|
| 412 |
-
$this->
|
| 413 |
-
|
| 414 |
$this->check_archive();
|
| 415 |
|
| 416 |
}
|
|
@@ -456,10 +456,10 @@ class HM_Backup {
|
|
| 456 |
$zip->addFile( $this->database_dump_filepath(), $this->database_dump_filename() );
|
| 457 |
|
| 458 |
if ( $zip->status )
|
| 459 |
-
$this->
|
| 460 |
|
| 461 |
if ( $zip->statusSys )
|
| 462 |
-
$this->
|
| 463 |
|
| 464 |
$zip->close();
|
| 465 |
|
|
@@ -491,12 +491,12 @@ class HM_Backup {
|
|
| 491 |
// Zip up everything
|
| 492 |
if ( ! $this->database_only )
|
| 493 |
if ( ! $archive->add( $this->root(), PCLZIP_OPT_REMOVE_PATH, $this->root(), PCLZIP_CB_PRE_ADD, 'hmbkp_pclzip_callback' ) )
|
| 494 |
-
$this->
|
| 495 |
|
| 496 |
// Add the database
|
| 497 |
if ( ! $this->files_only )
|
| 498 |
if ( ! $archive->add( $this->database_dump_filepath(), PCLZIP_OPT_REMOVE_PATH, $this->path() ) )
|
| 499 |
-
$this->
|
| 500 |
|
| 501 |
unset( $GLOBALS['_hmbkp_exclude_string'] );
|
| 502 |
|
|
@@ -520,7 +520,7 @@ class HM_Backup {
|
|
| 520 |
$this->error( $this->archive_method(), __( 'The backup file was not created', 'hmbkp' ) );
|
| 521 |
|
| 522 |
// Verify using the zip command if possible
|
| 523 |
-
if ( ! $this->errors() && $this->zip_command_path ) {
|
| 524 |
|
| 525 |
$verify = shell_exec( escapeshellarg( $this->zip_command_path ) . ' -T ' . escapeshellarg( $this->archive_filepath() ) . ' 2> /dev/null' );
|
| 526 |
|
|
@@ -528,9 +528,9 @@ class HM_Backup {
|
|
| 528 |
$this->error( $this->archive_method(), $verify );
|
| 529 |
|
| 530 |
}
|
| 531 |
-
|
| 532 |
/* Comment out for now as causes memory issues on large sites */
|
| 533 |
-
|
| 534 |
//if ( ! $this->errors() ) {
|
| 535 |
//
|
| 536 |
// // If it's a file backup, get an array of all the files that should have been backed up
|
|
@@ -556,10 +556,10 @@ class HM_Backup {
|
|
| 556 |
//}
|
| 557 |
|
| 558 |
// If there are errors delete the backup file.
|
| 559 |
-
if ( $this->errors() && file_exists( $this->archive_filepath() ) )
|
| 560 |
unlink( $this->archive_filepath() );
|
| 561 |
|
| 562 |
-
if ( $this->errors() )
|
| 563 |
return false;
|
| 564 |
|
| 565 |
return $this->archive_verified = true;
|
|
@@ -670,7 +670,7 @@ class HM_Backup {
|
|
| 670 |
|
| 671 |
// Load PclZip
|
| 672 |
if ( ! defined( 'PCLZIP_TEMPORARY_DIR' ) )
|
| 673 |
-
define( 'PCLZIP_TEMPORARY_DIR', $this->path() );
|
| 674 |
|
| 675 |
require_once( ABSPATH . 'wp-admin/includes/class-pclzip.php' );
|
| 676 |
|
|
@@ -689,7 +689,6 @@ class HM_Backup {
|
|
| 689 |
|
| 690 |
// List of possible mysqldump locations
|
| 691 |
$mysqldump_locations = array(
|
| 692 |
-
'mysqldump',
|
| 693 |
'/usr/local/bin/mysqldump',
|
| 694 |
'/usr/local/mysql/bin/mysqldump',
|
| 695 |
'/usr/mysql/bin/mysqldump',
|
|
@@ -697,19 +696,22 @@ class HM_Backup {
|
|
| 697 |
'/opt/local/lib/mysql6/bin/mysqldump',
|
| 698 |
'/opt/local/lib/mysql5/bin/mysqldump',
|
| 699 |
'/opt/local/lib/mysql4/bin/mysqldump',
|
| 700 |
-
'
|
| 701 |
-
'
|
| 702 |
-
'
|
| 703 |
-
'
|
| 704 |
-
'
|
| 705 |
-
'
|
| 706 |
-
'
|
| 707 |
-
'
|
| 708 |
);
|
| 709 |
|
|
|
|
|
|
|
|
|
|
| 710 |
// Find the one which works
|
| 711 |
foreach ( $mysqldump_locations as $location )
|
| 712 |
-
if (
|
| 713 |
return $location;
|
| 714 |
|
| 715 |
return '';
|
|
@@ -730,10 +732,12 @@ class HM_Backup {
|
|
| 730 |
|
| 731 |
// List of possible zip locations
|
| 732 |
$zip_locations = array(
|
| 733 |
-
'zip',
|
| 734 |
'/usr/bin/zip'
|
| 735 |
);
|
| 736 |
|
|
|
|
|
|
|
|
|
|
| 737 |
// Find the one which works
|
| 738 |
foreach ( $zip_locations as $location )
|
| 739 |
if ( ! shell_exec( 'hash ' . $location . ' 2>&1' ) )
|
|
@@ -1124,7 +1128,10 @@ class HM_Backup {
|
|
| 1124 |
* @access public
|
| 1125 |
* @return null
|
| 1126 |
*/
|
| 1127 |
-
public function errors() {
|
|
|
|
|
|
|
|
|
|
| 1128 |
|
| 1129 |
return $this->errors;
|
| 1130 |
|
|
@@ -1144,10 +1151,6 @@ class HM_Backup {
|
|
| 1144 |
if ( empty( $context ) || empty( $error ) )
|
| 1145 |
return;
|
| 1146 |
|
| 1147 |
-
if ( $context == 'zip' && strpos( $error, 'zip warning' ) !== false )
|
| 1148 |
-
return $this->warning( $context, $error );
|
| 1149 |
-
|
| 1150 |
-
|
| 1151 |
$this->errors[$context][$_key = md5( implode( ':' , (array) $error ) )] = $error;
|
| 1152 |
|
| 1153 |
}
|
|
@@ -1158,7 +1161,10 @@ class HM_Backup {
|
|
| 1158 |
* @access public
|
| 1159 |
* @return null
|
| 1160 |
*/
|
| 1161 |
-
public function warnings() {
|
|
|
|
|
|
|
|
|
|
| 1162 |
|
| 1163 |
return $this->warnings;
|
| 1164 |
|
| 301 |
$cmd .= ' ' . escapeshellarg( DB_NAME );
|
| 302 |
|
| 303 |
// Send stdout to null
|
| 304 |
+
$cmd .= ' 2>&1';
|
| 305 |
|
| 306 |
+
$this->warning( 'mysqldump', shell_exec( $cmd ) );
|
| 307 |
|
| 308 |
}
|
| 309 |
|
| 374 |
$this->zip();
|
| 375 |
|
| 376 |
// If not or if the shell zip failed then use ZipArchive
|
| 377 |
+
if ( empty( $this->archive_verified ) && class_exists( 'ZipArchive' ) && empty( $this->skip_zip_archive ) )
|
| 378 |
$this->zip_archive();
|
| 379 |
|
| 380 |
// If ZipArchive is unavailable or one of the above failed
|
| 381 |
+
if ( empty( $this->archive_verified ) )
|
| 382 |
$this->pcl_zip();
|
| 383 |
|
| 384 |
// Delete the database dump file
|
| 401 |
|
| 402 |
// Zip up $this->root with excludes
|
| 403 |
if ( ! $this->database_only && $this->exclude_string( 'zip' ) )
|
| 404 |
+
$this->warning( 'zip', shell_exec( 'cd ' . escapeshellarg( $this->root() ) . ' && ' . escapeshellarg( $this->zip_command_path ) . ' -rq ' . escapeshellarg( $this->archive_filepath() ) . ' ./' . ' -x ' . $this->exclude_string( 'zip' ) . ' 2>&1' ) );
|
| 405 |
+
|
| 406 |
// Zip up $this->root without excludes
|
| 407 |
elseif ( ! $this->database_only )
|
| 408 |
+
$this->warning( 'zip', shell_exec( 'cd ' . escapeshellarg( $this->root() ) . ' && ' . escapeshellarg( $this->zip_command_path ) . ' -rq ' . escapeshellarg( $this->archive_filepath() ) . ' ./' . ' 2>&1' ) );
|
| 409 |
+
|
| 410 |
// Add the database dump to the archive
|
| 411 |
if ( ! $this->files_only )
|
| 412 |
+
$this->warning( 'zip', shell_exec( 'cd ' . escapeshellarg( $this->path() ) . ' && ' . escapeshellarg( $this->zip_command_path ) . ' -uq ' . escapeshellarg( $this->archive_filepath() ) . ' ' . escapeshellarg( $this->database_dump_filename() ) . ' 2>&1' ) );
|
| 413 |
+
|
| 414 |
$this->check_archive();
|
| 415 |
|
| 416 |
}
|
| 456 |
$zip->addFile( $this->database_dump_filepath(), $this->database_dump_filename() );
|
| 457 |
|
| 458 |
if ( $zip->status )
|
| 459 |
+
$this->warning( 'ziparchive', $zip->status );
|
| 460 |
|
| 461 |
if ( $zip->statusSys )
|
| 462 |
+
$this->warning( 'ziparchive', $zip->statusSys );
|
| 463 |
|
| 464 |
$zip->close();
|
| 465 |
|
| 491 |
// Zip up everything
|
| 492 |
if ( ! $this->database_only )
|
| 493 |
if ( ! $archive->add( $this->root(), PCLZIP_OPT_REMOVE_PATH, $this->root(), PCLZIP_CB_PRE_ADD, 'hmbkp_pclzip_callback' ) )
|
| 494 |
+
$this->warning( 'pclzip', $archive->errorInfo( true ) );
|
| 495 |
|
| 496 |
// Add the database
|
| 497 |
if ( ! $this->files_only )
|
| 498 |
if ( ! $archive->add( $this->database_dump_filepath(), PCLZIP_OPT_REMOVE_PATH, $this->path() ) )
|
| 499 |
+
$this->warning( 'pclzip', $archive->errorInfo( true ) );
|
| 500 |
|
| 501 |
unset( $GLOBALS['_hmbkp_exclude_string'] );
|
| 502 |
|
| 520 |
$this->error( $this->archive_method(), __( 'The backup file was not created', 'hmbkp' ) );
|
| 521 |
|
| 522 |
// Verify using the zip command if possible
|
| 523 |
+
if ( ! $this->errors( 'zip' ) && $this->zip_command_path ) {
|
| 524 |
|
| 525 |
$verify = shell_exec( escapeshellarg( $this->zip_command_path ) . ' -T ' . escapeshellarg( $this->archive_filepath() ) . ' 2> /dev/null' );
|
| 526 |
|
| 528 |
$this->error( $this->archive_method(), $verify );
|
| 529 |
|
| 530 |
}
|
| 531 |
+
|
| 532 |
/* Comment out for now as causes memory issues on large sites */
|
| 533 |
+
|
| 534 |
//if ( ! $this->errors() ) {
|
| 535 |
//
|
| 536 |
// // If it's a file backup, get an array of all the files that should have been backed up
|
| 556 |
//}
|
| 557 |
|
| 558 |
// If there are errors delete the backup file.
|
| 559 |
+
if ( $this->errors( $this->archive_method() ) && file_exists( $this->archive_filepath() ) )
|
| 560 |
unlink( $this->archive_filepath() );
|
| 561 |
|
| 562 |
+
if ( $this->errors( $this->archive_method() ) )
|
| 563 |
return false;
|
| 564 |
|
| 565 |
return $this->archive_verified = true;
|
| 670 |
|
| 671 |
// Load PclZip
|
| 672 |
if ( ! defined( 'PCLZIP_TEMPORARY_DIR' ) )
|
| 673 |
+
define( 'PCLZIP_TEMPORARY_DIR', trailingslashit( $this->path() ) );
|
| 674 |
|
| 675 |
require_once( ABSPATH . 'wp-admin/includes/class-pclzip.php' );
|
| 676 |
|
| 689 |
|
| 690 |
// List of possible mysqldump locations
|
| 691 |
$mysqldump_locations = array(
|
|
|
|
| 692 |
'/usr/local/bin/mysqldump',
|
| 693 |
'/usr/local/mysql/bin/mysqldump',
|
| 694 |
'/usr/mysql/bin/mysqldump',
|
| 696 |
'/opt/local/lib/mysql6/bin/mysqldump',
|
| 697 |
'/opt/local/lib/mysql5/bin/mysqldump',
|
| 698 |
'/opt/local/lib/mysql4/bin/mysqldump',
|
| 699 |
+
'/xampp/mysql/bin/mysqldump',
|
| 700 |
+
'/Program Files/xampp/mysql/bin/mysqldump',
|
| 701 |
+
'/Program Files/MySQL/MySQL Server 6.0/bin/mysqldump',
|
| 702 |
+
'/Program Files/MySQL/MySQL Server 5.5/bin/mysqldump',
|
| 703 |
+
'/Program Files/MySQL/MySQL Server 5.4/bin/mysqldump',
|
| 704 |
+
'/Program Files/MySQL/MySQL Server 5.1/bin/mysqldump',
|
| 705 |
+
'/Program Files/MySQL/MySQL Server 5.0/bin/mysqldump',
|
| 706 |
+
'/Program Files/MySQL/MySQL Server 4.1/bin/mysqldump'
|
| 707 |
);
|
| 708 |
|
| 709 |
+
if ( is_null( shell_exec( 'hash mysqldump 2>&1' ) ) )
|
| 710 |
+
return 'mysqldump';
|
| 711 |
+
|
| 712 |
// Find the one which works
|
| 713 |
foreach ( $mysqldump_locations as $location )
|
| 714 |
+
if ( file_exists( $this->conform_dir( $location ) ) )
|
| 715 |
return $location;
|
| 716 |
|
| 717 |
return '';
|
| 732 |
|
| 733 |
// List of possible zip locations
|
| 734 |
$zip_locations = array(
|
|
|
|
| 735 |
'/usr/bin/zip'
|
| 736 |
);
|
| 737 |
|
| 738 |
+
if ( is_null( shell_exec( 'hash zip 2>&1' ) ) )
|
| 739 |
+
return 'zip';
|
| 740 |
+
|
| 741 |
// Find the one which works
|
| 742 |
foreach ( $zip_locations as $location )
|
| 743 |
if ( ! shell_exec( 'hash ' . $location . ' 2>&1' ) )
|
| 1128 |
* @access public
|
| 1129 |
* @return null
|
| 1130 |
*/
|
| 1131 |
+
public function errors( $context = null ) {
|
| 1132 |
+
|
| 1133 |
+
if ( ! empty( $context ) )
|
| 1134 |
+
return isset( $this->errors[$context] ) ? $this->errors[$context] : array();
|
| 1135 |
|
| 1136 |
return $this->errors;
|
| 1137 |
|
| 1151 |
if ( empty( $context ) || empty( $error ) )
|
| 1152 |
return;
|
| 1153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1154 |
$this->errors[$context][$_key = md5( implode( ':' , (array) $error ) )] = $error;
|
| 1155 |
|
| 1156 |
}
|
| 1161 |
* @access public
|
| 1162 |
* @return null
|
| 1163 |
*/
|
| 1164 |
+
public function warnings( $context = null ) {
|
| 1165 |
+
|
| 1166 |
+
if ( ! empty( $context ) )
|
| 1167 |
+
return isset( $this->warnings[$context] ) ? $this->warnings[$context] : array();
|
| 1168 |
|
| 1169 |
return $this->warnings;
|
| 1170 |
|
plugin.php
CHANGED
|
@@ -5,7 +5,7 @@ Plugin Name: BackUpWordPress
|
|
| 5 |
Plugin URI: http://hmn.md/backupwordpress/
|
| 6 |
Description: Simple automated backups of your WordPress powered website. Once activated you'll find me under <strong>Tools → Backups</strong>.
|
| 7 |
Author: Human Made Limited
|
| 8 |
-
Version: 1.6.
|
| 9 |
Author URI: http://hmn.md/
|
| 10 |
*/
|
| 11 |
|
|
@@ -30,6 +30,7 @@ define( 'HMBKP_PLUGIN_SLUG', 'backupwordpress' );
|
|
| 30 |
define( 'HMBKP_PLUGIN_PATH', WP_PLUGIN_DIR . '/' . HMBKP_PLUGIN_SLUG );
|
| 31 |
define( 'HMBKP_PLUGIN_URL', WP_PLUGIN_URL . '/' . HMBKP_PLUGIN_SLUG );
|
| 32 |
define( 'HMBKP_REQUIRED_WP_VERSION', '3.1' );
|
|
|
|
| 33 |
|
| 34 |
if ( ! defined( 'WP_MAX_MEMORY_LIMIT' ) )
|
| 35 |
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
|
|
@@ -106,10 +107,6 @@ function hmbkp_setup_hm_backup() {
|
|
| 106 |
|
| 107 |
$hm_backup->excludes = hmbkp_valid_custom_excludes();
|
| 108 |
|
| 109 |
-
// If the backup path is inside ABSPATH then exclude it by default
|
| 110 |
-
if ( strpos( hmbkp_path(), hmbkp_conform_dir( ABSPATH ) ) === 0 )
|
| 111 |
-
$hm_backup->excludes[] = trailingslashit( str_replace( untrailingslashit( ABSPATH ), '', hmbkp_path() ) );
|
| 112 |
-
|
| 113 |
}
|
| 114 |
add_action( 'init', 'hmbkp_setup_hm_backup' );
|
| 115 |
|
|
@@ -129,6 +126,9 @@ require_once( HMBKP_PLUGIN_PATH . '/functions/backup.functions.php' );
|
|
| 129 |
// Load the wp cli command
|
| 130 |
if ( defined( 'WP_CLI' ) && WP_CLI )
|
| 131 |
include( HMBKP_PLUGIN_PATH . '/functions/wp-cli.php' );
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
// Plugin activation and deactivation
|
| 134 |
add_action( 'activate_' . HMBKP_PLUGIN_SLUG . '/plugin.php', 'hmbkp_activate' );
|
| 5 |
Plugin URI: http://hmn.md/backupwordpress/
|
| 6 |
Description: Simple automated backups of your WordPress powered website. Once activated you'll find me under <strong>Tools → Backups</strong>.
|
| 7 |
Author: Human Made Limited
|
| 8 |
+
Version: 1.6.3
|
| 9 |
Author URI: http://hmn.md/
|
| 10 |
*/
|
| 11 |
|
| 30 |
define( 'HMBKP_PLUGIN_PATH', WP_PLUGIN_DIR . '/' . HMBKP_PLUGIN_SLUG );
|
| 31 |
define( 'HMBKP_PLUGIN_URL', WP_PLUGIN_URL . '/' . HMBKP_PLUGIN_SLUG );
|
| 32 |
define( 'HMBKP_REQUIRED_WP_VERSION', '3.1' );
|
| 33 |
+
define( 'HMBKP_SECURE_KEY', md5( ABSPATH . time() ) );
|
| 34 |
|
| 35 |
if ( ! defined( 'WP_MAX_MEMORY_LIMIT' ) )
|
| 36 |
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
|
| 107 |
|
| 108 |
$hm_backup->excludes = hmbkp_valid_custom_excludes();
|
| 109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
}
|
| 111 |
add_action( 'init', 'hmbkp_setup_hm_backup' );
|
| 112 |
|
| 126 |
// Load the wp cli command
|
| 127 |
if ( defined( 'WP_CLI' ) && WP_CLI )
|
| 128 |
include( HMBKP_PLUGIN_PATH . '/functions/wp-cli.php' );
|
| 129 |
+
|
| 130 |
+
if ( ! defined( 'PCLZIP_TEMPORARY_DIR' ) )
|
| 131 |
+
define( 'PCLZIP_TEMPORARY_DIR', trailingslashit( hmbkp_path() ) );
|
| 132 |
|
| 133 |
// Plugin activation and deactivation
|
| 134 |
add_action( 'activate_' . HMBKP_PLUGIN_SLUG . '/plugin.php', 'hmbkp_activate' );
|
readme.txt
CHANGED
|
@@ -3,7 +3,7 @@ Contributors: humanmade, joehoyle, mattheu, tcrsavage, willmot
|
|
| 3 |
Tags: back up, backup, backups, database, zip, db, files, archive, wp-cli, humanmade
|
| 4 |
Requires at least: 3.1
|
| 5 |
Tested up to: 3.3
|
| 6 |
-
Stable tag: 1.6.
|
| 7 |
|
| 8 |
Simple automated back ups of your WordPress powered website.
|
| 9 |
|
|
@@ -93,6 +93,18 @@ You can also tweet <a href="http://twitter.com/humanmadeltd">@humanmadeltd</a> o
|
|
| 93 |
|
| 94 |
== Changelog ==
|
| 95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
#### 1.6.2
|
| 97 |
|
| 98 |
* Track PHP errors as backup warnings not errors.
|
| 3 |
Tags: back up, backup, backups, database, zip, db, files, archive, wp-cli, humanmade
|
| 4 |
Requires at least: 3.1
|
| 5 |
Tested up to: 3.3
|
| 6 |
+
Stable tag: 1.6.3
|
| 7 |
|
| 8 |
Simple automated back ups of your WordPress powered website.
|
| 9 |
|
| 93 |
|
| 94 |
== Changelog ==
|
| 95 |
|
| 96 |
+
#### 1.6.3
|
| 97 |
+
|
| 98 |
+
* Don't fail archive verification for errors in previous archive methods.
|
| 99 |
+
* Improved detection of zip and mysqldump command.
|
| 100 |
+
* Fix issues when `ABSPATH` is `/`.
|
| 101 |
+
* Remove relience on `SECURE_AUTH_KEY` as it's often not defined.
|
| 102 |
+
* Use `warning()` not `error()` for issues reported by `zip`, `ZipArchive` or PclZip`.
|
| 103 |
+
* Fix download zip on Windows when `ABSPATH` contains a trailing forward slash.
|
| 104 |
+
* Send backup email after backup completes so that fatal errors in email code don't stop the backup from completing.
|
| 105 |
+
* Add missing / to `PCLZIP_TEMPORARY_DIR` define.
|
| 106 |
+
* Catch and display errors during `mysqldump`.
|
| 107 |
+
|
| 108 |
#### 1.6.2
|
| 109 |
|
| 110 |
* Track PHP errors as backup warnings not errors.
|
