Version Description
Download this release
Release Info
Developer | willmot |
Plugin | BackUpWordPress |
Version | 1.1.3 |
Comparing to | |
See all releases |
Code changes from version 1.1.2 to 1.1.3
- functions/backup.files.fallback.functions.php +1 -1
- functions/mysql-ping.php +78 -0
- plugin.php +2 -1
- readme.txt +6 -1
functions/backup.files.fallback.functions.php
CHANGED
@@ -16,6 +16,6 @@ function hmbkp_archive_files_fallback( $backup_tmp_dir, $backup_filepath ) {
|
|
16 |
require_once( ABSPATH . 'wp-admin/includes/class-pclzip.php' );
|
17 |
|
18 |
$archive = new PclZip( $backup_filepath );
|
19 |
-
$
|
20 |
|
21 |
}
|
16 |
require_once( ABSPATH . 'wp-admin/includes/class-pclzip.php' );
|
17 |
|
18 |
$archive = new PclZip( $backup_filepath );
|
19 |
+
$archive->create( $backup_tmp_dir, PCLZIP_OPT_REMOVE_PATH, $backup_tmp_dir );
|
20 |
|
21 |
}
|
functions/mysql-ping.php
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* "MySQL Ping" Keeps mysql connections alive
|
5 |
+
*
|
6 |
+
* Extend the default {@link wpdb} class by
|
7 |
+
* adding {@link mysql_ping()} capabilities
|
8 |
+
*
|
9 |
+
* @author Kaloyan K. Tsvetkov <kaloyan@kaloyan.info>
|
10 |
+
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
11 |
+
*/
|
12 |
+
Class wpdb2 Extends wpdb {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Attemp to ping the MySQL server
|
16 |
+
*/
|
17 |
+
function _ping() {
|
18 |
+
|
19 |
+
$retry = 5;
|
20 |
+
$failed = 1;
|
21 |
+
|
22 |
+
// probe w\ a ping
|
23 |
+
$ping = mysql_ping( $this->dbh ) ;
|
24 |
+
|
25 |
+
while( !$ping && $failed < $retry ) :
|
26 |
+
|
27 |
+
// Reconnect
|
28 |
+
$this->dbh = mysql_connect( DB_HOST, DB_USER, DB_PASSWORD, 1 );
|
29 |
+
$this->select( DB_NAME );
|
30 |
+
|
31 |
+
if ( !DB_CHARSET && version_compare( mysql_get_server_info( $this->dbh ), '4.1.0', '>=' ) )
|
32 |
+
$this->query( "SET NAMES '" . DB_CHARSET . "'" );
|
33 |
+
|
34 |
+
// Ping again to check the result
|
35 |
+
$ping = mysql_ping( $this->dbh ) ;
|
36 |
+
|
37 |
+
if ( !$ping ) {
|
38 |
+
sleep(2);
|
39 |
+
$failed+=1;
|
40 |
+
}
|
41 |
+
|
42 |
+
endwhile;
|
43 |
+
|
44 |
+
// Ping failed
|
45 |
+
if ( !$ping ) {
|
46 |
+
|
47 |
+
$this->print_error( 'Attempted to connect for ' . $retry . ' but failed...' );
|
48 |
+
}
|
49 |
+
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Override the original {@link wpdb::query()} method in
|
54 |
+
* order to ping the server before executing every query
|
55 |
+
*
|
56 |
+
* @param string $query
|
57 |
+
* @return mixed
|
58 |
+
*/
|
59 |
+
function query( $query ) {
|
60 |
+
|
61 |
+
$this->_ping();
|
62 |
+
|
63 |
+
return parent::query( $query );
|
64 |
+
|
65 |
+
}
|
66 |
+
|
67 |
+
}
|
68 |
+
|
69 |
+
// Setup the wpdb2 class
|
70 |
+
$wpdb2 = new wpdb2( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );
|
71 |
+
|
72 |
+
// Copy over the $wpdb vars
|
73 |
+
global $wpdb;
|
74 |
+
foreach( get_object_vars( $wpdb ) as $k => $v )
|
75 |
+
if ( is_scalar( $v ) )
|
76 |
+
$wpdb2->$k = $v;
|
77 |
+
|
78 |
+
$wpdb =& $wpdb2;
|
plugin.php
CHANGED
@@ -5,7 +5,7 @@ Plugin Name: BackUpWordPress
|
|
5 |
Plugin URI: http://humanmade.co.uk/
|
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.1.
|
9 |
Author URI: http://humanmade.co.uk/
|
10 |
*/
|
11 |
|
@@ -92,6 +92,7 @@ require_once( HMBKP_PLUGIN_PATH . '/functions/backup.mysql.functions.php' );
|
|
92 |
require_once( HMBKP_PLUGIN_PATH . '/functions/backup.files.functions.php' );
|
93 |
require_once( HMBKP_PLUGIN_PATH . '/functions/backup.mysql.fallback.functions.php' );
|
94 |
require_once( HMBKP_PLUGIN_PATH . '/functions/backup.files.fallback.functions.php' );
|
|
|
95 |
|
96 |
// Plugin activation and deactivation
|
97 |
add_action( 'activate_' . HMBKP_PLUGIN_SLUG . '/plugin.php', 'hmbkp_activate' );
|
5 |
Plugin URI: http://humanmade.co.uk/
|
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.1.3
|
9 |
Author URI: http://humanmade.co.uk/
|
10 |
*/
|
11 |
|
92 |
require_once( HMBKP_PLUGIN_PATH . '/functions/backup.files.functions.php' );
|
93 |
require_once( HMBKP_PLUGIN_PATH . '/functions/backup.mysql.fallback.functions.php' );
|
94 |
require_once( HMBKP_PLUGIN_PATH . '/functions/backup.files.fallback.functions.php' );
|
95 |
+
require_once( HMBKP_PLUGIN_PATH . '/functions/mysql-ping.php' );
|
96 |
|
97 |
// Plugin activation and deactivation
|
98 |
add_action( 'activate_' . HMBKP_PLUGIN_SLUG . '/plugin.php', 'hmbkp_activate' );
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: willmot, humanmade
|
|
3 |
Tags: back up, backup, backups
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.1
|
6 |
-
Stable tag: 1.1.
|
7 |
|
8 |
Simple automated backups of your WordPress powered website.
|
9 |
|
@@ -27,6 +27,11 @@ Contact support@humanmade.co.uk for help/support.
|
|
27 |
|
28 |
== Changelog ==
|
29 |
|
|
|
|
|
|
|
|
|
|
|
30 |
#### 1.1.2
|
31 |
|
32 |
* Fix a bug that stopped `HMBKP_DISABLE_AUTOMATIC_BACKUP` from working.
|
3 |
Tags: back up, backup, backups
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.1
|
6 |
+
Stable tag: 1.1.3
|
7 |
|
8 |
Simple automated backups of your WordPress powered website.
|
9 |
|
27 |
|
28 |
== Changelog ==
|
29 |
|
30 |
+
#### 1.1.3
|
31 |
+
|
32 |
+
* Attempt to re-connect if database connection hits a timeout while a backup is running, should fix issues with the "Back Up Now" button continuing to spin even though the backup is completed.
|
33 |
+
* When using `PCLZIP` as the zip fallback don't store the files with absolute paths. Should fix issues unzipping the file archives using "Compressed (zipped) Folders" on Windows XP.
|
34 |
+
|
35 |
#### 1.1.2
|
36 |
|
37 |
* Fix a bug that stopped `HMBKP_DISABLE_AUTOMATIC_BACKUP` from working.
|