Version Description
- fixed warning in send mail
- bug fixes
Download this release
Release Info
Developer | danielhuesken |
Plugin | BackWPup – WordPress Backup Plugin |
Version | 1.3.4 |
Comparing to | |
See all releases |
Code changes from version 1.3.3 to 1.3.4
- app/backwpup_dojob.php +31 -33
- app/functions.php +22 -24
- app/list-tables.php +2 -2
- app/options-edit-job.php +3 -0
- app/options-runnow-iframe.php +1 -1
- backwpup.php +4 -4
- readme.txt +5 -1
app/backwpup_dojob.php
CHANGED
@@ -49,7 +49,7 @@ function backwpup_joberrorhandler($errno, $errstr, $errfile, $errline) {
|
|
49 |
|
50 |
if (!empty($massage)) {
|
51 |
//wirte log file
|
52 |
-
$fd=@fopen($backwpup_logfile,
|
53 |
@fputs($fd,$massage."<br />\n");
|
54 |
@fclose($fd);
|
55 |
|
@@ -62,7 +62,7 @@ function backwpup_joberrorhandler($errno, $errstr, $errfile, $errline) {
|
|
62 |
|
63 |
//write new log header
|
64 |
if (isset($errors) or isset($warnings)) {
|
65 |
-
$fd=@fopen($backwpup_logfile,
|
66 |
while (!feof($fd)) {
|
67 |
$line=@fgets($fd);
|
68 |
if (stripos($line,"<meta name=\"backwpup_errors\"") !== false and isset($errors)) {
|
@@ -81,7 +81,7 @@ function backwpup_joberrorhandler($errno, $errstr, $errfile, $errline) {
|
|
81 |
}
|
82 |
|
83 |
if ($errno==E_ERROR or $errno==E_CORE_ERROR or $errno==E_COMPILE_ERROR) {//Die on fatal php errors.
|
84 |
-
$fd
|
85 |
fputs($fd,"</body>\n</html>\n");
|
86 |
fclose($fd);
|
87 |
die();
|
@@ -137,8 +137,8 @@ class backwpup_dojob {
|
|
137 |
$this->logfile='backwpup_log_'.date_i18n('Y-m-d_H-i-s').'.html';
|
138 |
//set global for error handling
|
139 |
$backwpup_logfile=$this->logdir.$this->logfile;
|
|
|
140 |
//Create log file header
|
141 |
-
$fd=@fopen($this->logdir.$this->logfile,"a+");
|
142 |
@fputs($fd,"<html>\n<head>\n");
|
143 |
@fputs($fd,"<meta name=\"backwpup_version\" content=\"".BACKWPUP_VERSION."\" />\n");
|
144 |
@fputs($fd,"<meta name=\"php_version\" content=\"".phpversion()."\" />\n");
|
@@ -163,17 +163,16 @@ class backwpup_dojob {
|
|
163 |
if ($jobs[$this->jobid]['starttime']+600<current_time('timestamp')) { //Abort old jo if work longer as 10 min. because websever has 300 sec timeout
|
164 |
trigger_error(__('Working Job will closed!!! And a new started!!!','backwpup'),E_USER_WARNING);
|
165 |
//old logfile end
|
166 |
-
$fd=fopen($jobs[$this->jobid]['logfile'],
|
167 |
fputs($fd,"<span style=\"background-color:c3c3c3;\" title=\"[Line: ".__LINE__."|File: ".basename(__FILE__)."\">".date_i18n('Y-m-d H:i.s').":</span> <span style=\"background-color:red;\">".__('[ERROR]','backwpup')." ".__('Backup Aborted working to long!!!','backwpup')."</span><br />\n");
|
168 |
fputs($fd,"</body>\n</html>\n");
|
169 |
fclose($fd);
|
170 |
$logheader=backwpup_read_logheader($jobs[$this->jobid]['logfile']); //read waring count from log header
|
171 |
$logheader['errors']++;
|
172 |
//write new log header
|
173 |
-
$fd=@fopen($jobs[$this->jobid]['logfile'],
|
174 |
while (!feof($fd)) {
|
175 |
-
|
176 |
-
if (stripos($line,"<meta name=\"backwpup_errors\"") !== false and isset($errors)) {
|
177 |
@fseek($fd,$filepos);
|
178 |
@fputs($fd,str_pad("<meta name=\"backwpup_errors\" content=\"".$logheader['errors']."\" />",100)."\n");
|
179 |
break;
|
@@ -558,7 +557,7 @@ class backwpup_dojob {
|
|
558 |
|
559 |
|
560 |
//add database file to backupfiles
|
561 |
-
if (
|
562 |
trigger_error(__('Add Database Dump to Backup:','backwpup').' '.DB_NAME.'.sql '.backwpup_formatBytes(filesize($this->tempdir.DB_NAME.'.sql')),E_USER_NOTICE);
|
563 |
$this->allfilesize+=filesize($this->tempdir.DB_NAME.'.sql');
|
564 |
$this->filelist[]=array(79001=>$this->tempdir.DB_NAME.'.sql',79003=>DB_NAME.'.sql');
|
@@ -583,25 +582,24 @@ class backwpup_dojob {
|
|
583 |
$fd=fopen($this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml',"w+");
|
584 |
fwrite($fd,$return);
|
585 |
fclose($fd);
|
586 |
-
trigger_error(__('Add XML Export to Backup:','backwpup').' wordpress.' . date( 'Y-m-d' ) . '.xml '.backwpup_formatBytes(filesize($this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml')),E_USER_NOTICE);
|
587 |
-
$this->allfilesize+=filesize($this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml');
|
588 |
-
$this->filelist[]=array(79001=>$this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml',79003=>'wordpress.' . date( 'Y-m-d' ) . '.xml');
|
589 |
}
|
590 |
curl_close($ch);
|
591 |
} elseif (ini_get('allow_url_fopen')==true or ini_get('allow_url_fopen')==1 or strtolower(ini_get('allow_url_fopen'))=="on") {
|
592 |
trigger_error(__('Run Wordpress Export to XML file...','backwpup'),E_USER_NOTICE);
|
593 |
if (copy(plugins_url('wp_xml_export.php',__FILE__).'?wpabs='.trailingslashit(ABSPATH).'&_nonce='.substr(md5(md5(SECURE_AUTH_KEY)),10,10),$this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml')) {
|
594 |
trigger_error(__('Export to XML done!','backwpup'),E_USER_NOTICE);
|
595 |
-
//add database file to backupfiles
|
596 |
-
trigger_error(__('Add XML Export to Backup:','backwpup').' wordpress.' . date( 'Y-m-d' ) . '.xml '.backwpup_formatBytes(filesize($this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml')),E_USER_NOTICE);
|
597 |
-
$this->allfilesize+=filesize($this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml');
|
598 |
-
$this->filelist[]=array(79001=>$this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml',79003=>'wordpress.' . date( 'Y-m-d' ) . '.xml');
|
599 |
} else {
|
600 |
trigger_error(__('Can not Export to XML!','backwpup'),E_USER_ERROR);
|
601 |
}
|
602 |
} else {
|
603 |
trigger_error(__('Can not Export to XML! no cURL or allow_url_fopen Support!','backwpup'),E_USER_WARNING);
|
604 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
605 |
}
|
606 |
|
607 |
private function optimize_db() {
|
@@ -651,16 +649,16 @@ class backwpup_dojob {
|
|
651 |
if (false !== stripos($folder.$file,$exclusion) and !empty($exclusion) and $exclusion!='/')
|
652 |
continue 2;
|
653 |
}
|
654 |
-
if (
|
|
|
|
|
|
|
|
|
655 |
if (!in_array(trailingslashit($folder.$file),$excludedirs))
|
656 |
$this->_file_list_folder( trailingslashit($folder.$file), $levels - 1, $excludes);
|
657 |
-
} elseif (is_file( $folder.$file )) {
|
658 |
-
|
659 |
-
|
660 |
-
$this->allfilesize=$this->allfilesize+filesize($folder.$file);
|
661 |
-
} else {
|
662 |
-
trigger_error(__('Can not read file:','backwpup').' '.$folder.$file,E_USER_WARNING);
|
663 |
-
}
|
664 |
} else {
|
665 |
trigger_error(__('Is not a file or directory:','backwpup').' '.$folder.$file,E_USER_WARNING);
|
666 |
}
|
@@ -749,7 +747,7 @@ class backwpup_dojob {
|
|
749 |
} else { //use PclZip
|
750 |
define( 'PCLZIP_TEMPORARY_DIR', $this->tempdir );
|
751 |
if (!class_exists('PclZip'))
|
752 |
-
|
753 |
|
754 |
//Create Zip File
|
755 |
if (is_array($this->filelist[0])) {
|
@@ -791,7 +789,7 @@ class backwpup_dojob {
|
|
791 |
trigger_error(__('Add File to Backup Archive:','backwpup').' '.$files[79001].' '.backwpup_formatBytes(filesize($files[79001])),E_USER_NOTICE);
|
792 |
|
793 |
//check file exists
|
794 |
-
if (!
|
795 |
continue;
|
796 |
|
797 |
// Get file information
|
@@ -1004,8 +1002,8 @@ class backwpup_dojob {
|
|
1004 |
trigger_error(__('Prepare Sending backup file with mail...','backwpup'),E_USER_NOTICE);
|
1005 |
|
1006 |
//Crate PHP Mailer
|
1007 |
-
|
1008 |
-
|
1009 |
$phpmailer = new PHPMailer();
|
1010 |
//Setting den methode
|
1011 |
if ($this->cfg['mailmethod']=="SMTP") {
|
@@ -1073,7 +1071,7 @@ class backwpup_dojob {
|
|
1073 |
}
|
1074 |
|
1075 |
if (!class_exists('S3'))
|
1076 |
-
|
1077 |
|
1078 |
$s3 = new S3($this->job['awsAccessKey'], $this->job['awsSecretKey'], $this->job['awsSSL']);
|
1079 |
|
@@ -1125,7 +1123,7 @@ class backwpup_dojob {
|
|
1125 |
}
|
1126 |
|
1127 |
if (!class_exists('CF_Authentication'))
|
1128 |
-
|
1129 |
|
1130 |
|
1131 |
$auth = new CF_Authentication($this->job['rscUsername'], $this->job['rscAPIKey']);
|
@@ -1285,7 +1283,7 @@ class backwpup_dojob {
|
|
1285 |
}
|
1286 |
|
1287 |
//write heder info
|
1288 |
-
$fd=@fopen($this->logdir.$this->logfile,
|
1289 |
$found=0;
|
1290 |
while (!feof($fd)) {
|
1291 |
$line=@fgets($fd);
|
@@ -1305,7 +1303,7 @@ class backwpup_dojob {
|
|
1305 |
}
|
1306 |
@fclose($fd);
|
1307 |
//logfile end
|
1308 |
-
$fd=fopen($this->logdir.$this->logfile,
|
1309 |
fputs($fd,"</body>\n</html>\n");
|
1310 |
fclose($fd);
|
1311 |
restore_error_handler();
|
@@ -1323,7 +1321,7 @@ class backwpup_dojob {
|
|
1323 |
$mailbody.=__("Errors:","backwpup")." ".$logdata['errors']."\n";
|
1324 |
if (!empty($logdata['warnings']))
|
1325 |
$mailbody.=__("Warnings:","backwpup")." ".$logdata['warnings']."\n";
|
1326 |
-
wp_mail($this->job['mailaddresslog'],__('BackWPup Log File from','backwpup').' '.date_i18n('Y-m-d H:i',$this->job['
|
1327 |
}
|
1328 |
}
|
1329 |
}
|
49 |
|
50 |
if (!empty($massage)) {
|
51 |
//wirte log file
|
52 |
+
$fd=@fopen($backwpup_logfile,'a+');
|
53 |
@fputs($fd,$massage."<br />\n");
|
54 |
@fclose($fd);
|
55 |
|
62 |
|
63 |
//write new log header
|
64 |
if (isset($errors) or isset($warnings)) {
|
65 |
+
$fd=@fopen($backwpup_logfile,'r+');
|
66 |
while (!feof($fd)) {
|
67 |
$line=@fgets($fd);
|
68 |
if (stripos($line,"<meta name=\"backwpup_errors\"") !== false and isset($errors)) {
|
81 |
}
|
82 |
|
83 |
if ($errno==E_ERROR or $errno==E_CORE_ERROR or $errno==E_COMPILE_ERROR) {//Die on fatal php errors.
|
84 |
+
$fd=@fopen($backwpup_logfile,'a+');
|
85 |
fputs($fd,"</body>\n</html>\n");
|
86 |
fclose($fd);
|
87 |
die();
|
137 |
$this->logfile='backwpup_log_'.date_i18n('Y-m-d_H-i-s').'.html';
|
138 |
//set global for error handling
|
139 |
$backwpup_logfile=$this->logdir.$this->logfile;
|
140 |
+
$fd=fopen($this->logdir.$this->logfile,'w+');
|
141 |
//Create log file header
|
|
|
142 |
@fputs($fd,"<html>\n<head>\n");
|
143 |
@fputs($fd,"<meta name=\"backwpup_version\" content=\"".BACKWPUP_VERSION."\" />\n");
|
144 |
@fputs($fd,"<meta name=\"php_version\" content=\"".phpversion()."\" />\n");
|
163 |
if ($jobs[$this->jobid]['starttime']+600<current_time('timestamp')) { //Abort old jo if work longer as 10 min. because websever has 300 sec timeout
|
164 |
trigger_error(__('Working Job will closed!!! And a new started!!!','backwpup'),E_USER_WARNING);
|
165 |
//old logfile end
|
166 |
+
$fd=fopen($jobs[$this->jobid]['logfile'],'a+');
|
167 |
fputs($fd,"<span style=\"background-color:c3c3c3;\" title=\"[Line: ".__LINE__."|File: ".basename(__FILE__)."\">".date_i18n('Y-m-d H:i.s').":</span> <span style=\"background-color:red;\">".__('[ERROR]','backwpup')." ".__('Backup Aborted working to long!!!','backwpup')."</span><br />\n");
|
168 |
fputs($fd,"</body>\n</html>\n");
|
169 |
fclose($fd);
|
170 |
$logheader=backwpup_read_logheader($jobs[$this->jobid]['logfile']); //read waring count from log header
|
171 |
$logheader['errors']++;
|
172 |
//write new log header
|
173 |
+
$fd=@fopen($jobs[$this->jobid]['logfile'],'r+');
|
174 |
while (!feof($fd)) {
|
175 |
+
if (stripos(@fgets($fd),"<meta name=\"backwpup_errors\"") !== false) {
|
|
|
176 |
@fseek($fd,$filepos);
|
177 |
@fputs($fd,str_pad("<meta name=\"backwpup_errors\" content=\"".$logheader['errors']."\" />",100)."\n");
|
178 |
break;
|
557 |
|
558 |
|
559 |
//add database file to backupfiles
|
560 |
+
if (is_readable($this->tempdir.DB_NAME.'.sql')) {
|
561 |
trigger_error(__('Add Database Dump to Backup:','backwpup').' '.DB_NAME.'.sql '.backwpup_formatBytes(filesize($this->tempdir.DB_NAME.'.sql')),E_USER_NOTICE);
|
562 |
$this->allfilesize+=filesize($this->tempdir.DB_NAME.'.sql');
|
563 |
$this->filelist[]=array(79001=>$this->tempdir.DB_NAME.'.sql',79003=>DB_NAME.'.sql');
|
582 |
$fd=fopen($this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml',"w+");
|
583 |
fwrite($fd,$return);
|
584 |
fclose($fd);
|
|
|
|
|
|
|
585 |
}
|
586 |
curl_close($ch);
|
587 |
} elseif (ini_get('allow_url_fopen')==true or ini_get('allow_url_fopen')==1 or strtolower(ini_get('allow_url_fopen'))=="on") {
|
588 |
trigger_error(__('Run Wordpress Export to XML file...','backwpup'),E_USER_NOTICE);
|
589 |
if (copy(plugins_url('wp_xml_export.php',__FILE__).'?wpabs='.trailingslashit(ABSPATH).'&_nonce='.substr(md5(md5(SECURE_AUTH_KEY)),10,10),$this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml')) {
|
590 |
trigger_error(__('Export to XML done!','backwpup'),E_USER_NOTICE);
|
|
|
|
|
|
|
|
|
591 |
} else {
|
592 |
trigger_error(__('Can not Export to XML!','backwpup'),E_USER_ERROR);
|
593 |
}
|
594 |
} else {
|
595 |
trigger_error(__('Can not Export to XML! no cURL or allow_url_fopen Support!','backwpup'),E_USER_WARNING);
|
596 |
}
|
597 |
+
if (is_readable($this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml')) {
|
598 |
+
//add database file to backupfiles
|
599 |
+
trigger_error(__('Add XML Export to Backup:','backwpup').' wordpress.' . date( 'Y-m-d' ) . '.xml '.backwpup_formatBytes(filesize($this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml')),E_USER_NOTICE);
|
600 |
+
$this->allfilesize+=filesize($this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml');
|
601 |
+
$this->filelist[]=array(79001=>$this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml',79003=>'wordpress.' . date( 'Y-m-d' ) . '.xml');
|
602 |
+
}
|
603 |
}
|
604 |
|
605 |
private function optimize_db() {
|
649 |
if (false !== stripos($folder.$file,$exclusion) and !empty($exclusion) and $exclusion!='/')
|
650 |
continue 2;
|
651 |
}
|
652 |
+
if ( !is_readable($folder.$file) ) {
|
653 |
+
trigger_error(__('File or Folder is not readable:','backwpup').' '.$folder.$file,E_USER_WARNING);
|
654 |
+
} elseif ( is_link($folder.$file) ) {
|
655 |
+
trigger_error(__('Link not followed:','backwpup').' '.$folder.$file,E_USER_WARNING);
|
656 |
+
} elseif ( is_dir( $folder.$file )) {
|
657 |
if (!in_array(trailingslashit($folder.$file),$excludedirs))
|
658 |
$this->_file_list_folder( trailingslashit($folder.$file), $levels - 1, $excludes);
|
659 |
+
} elseif ( is_file( $folder.$file ) or is_executable($folder.$file) ) { //add file to filelist
|
660 |
+
$this->tempfilelist[]=$folder.$file;
|
661 |
+
$this->allfilesize=$this->allfilesize+filesize($folder.$file);
|
|
|
|
|
|
|
|
|
662 |
} else {
|
663 |
trigger_error(__('Is not a file or directory:','backwpup').' '.$folder.$file,E_USER_WARNING);
|
664 |
}
|
747 |
} else { //use PclZip
|
748 |
define( 'PCLZIP_TEMPORARY_DIR', $this->tempdir );
|
749 |
if (!class_exists('PclZip'))
|
750 |
+
include_once('libs/pclzip.lib.php');
|
751 |
|
752 |
//Create Zip File
|
753 |
if (is_array($this->filelist[0])) {
|
789 |
trigger_error(__('Add File to Backup Archive:','backwpup').' '.$files[79001].' '.backwpup_formatBytes(filesize($files[79001])),E_USER_NOTICE);
|
790 |
|
791 |
//check file exists
|
792 |
+
if (!is_readable($files[79001]))
|
793 |
continue;
|
794 |
|
795 |
// Get file information
|
1002 |
trigger_error(__('Prepare Sending backup file with mail...','backwpup'),E_USER_NOTICE);
|
1003 |
|
1004 |
//Crate PHP Mailer
|
1005 |
+
include_once(ABSPATH.WPINC.'/class-phpmailer.php');
|
1006 |
+
include_once(ABSPATH.WPINC.'/class-smtp.php');
|
1007 |
$phpmailer = new PHPMailer();
|
1008 |
//Setting den methode
|
1009 |
if ($this->cfg['mailmethod']=="SMTP") {
|
1071 |
}
|
1072 |
|
1073 |
if (!class_exists('S3'))
|
1074 |
+
include_once('libs/S3.php');
|
1075 |
|
1076 |
$s3 = new S3($this->job['awsAccessKey'], $this->job['awsSecretKey'], $this->job['awsSSL']);
|
1077 |
|
1123 |
}
|
1124 |
|
1125 |
if (!class_exists('CF_Authentication'))
|
1126 |
+
include_once('libs/rackspace/cloudfiles.php');
|
1127 |
|
1128 |
|
1129 |
$auth = new CF_Authentication($this->job['rscUsername'], $this->job['rscAPIKey']);
|
1283 |
}
|
1284 |
|
1285 |
//write heder info
|
1286 |
+
$fd=@fopen($this->logdir.$this->logfile,'r+');
|
1287 |
$found=0;
|
1288 |
while (!feof($fd)) {
|
1289 |
$line=@fgets($fd);
|
1303 |
}
|
1304 |
@fclose($fd);
|
1305 |
//logfile end
|
1306 |
+
$fd=fopen($this->logdir.$this->logfile,'a+');
|
1307 |
fputs($fd,"</body>\n</html>\n");
|
1308 |
fclose($fd);
|
1309 |
restore_error_handler();
|
1321 |
$mailbody.=__("Errors:","backwpup")." ".$logdata['errors']."\n";
|
1322 |
if (!empty($logdata['warnings']))
|
1323 |
$mailbody.=__("Warnings:","backwpup")." ".$logdata['warnings']."\n";
|
1324 |
+
wp_mail($this->job['mailaddresslog'],__('BackWPup Log File from','backwpup').' '.date_i18n('Y-m-d H:i',$this->job['lastrun']).': '.$this->job['name'] ,$mailbody,'',array($this->logdir.$this->logfile));
|
1325 |
}
|
1326 |
}
|
1327 |
}
|
app/functions.php
CHANGED
@@ -4,7 +4,7 @@ if ( !defined('ABSPATH') )
|
|
4 |
die('-1');
|
5 |
|
6 |
//Thems Option menu entry
|
7 |
-
function
|
8 |
$hook = add_management_page(__('BackWPup','backwpup'), __('BackWPup','backwpup'), '10', 'BackWPup','backwpup_options_page') ;
|
9 |
add_action('load-'.$hook, 'backwpup_options_load');
|
10 |
}
|
@@ -13,12 +13,12 @@ if ( !defined('ABSPATH') )
|
|
13 |
function backwpup_options_page() {
|
14 |
global $table,$backwpup_message,$page_hook;
|
15 |
if (!current_user_can(10))
|
16 |
-
wp_die('
|
17 |
if(!empty($backwpup_message))
|
18 |
echo '<div id="message" class="updated fade"><p><strong>'.$backwpup_message.'</strong></p></div>';
|
19 |
switch($_REQUEST['subpage']) {
|
20 |
case 'edit':
|
21 |
-
|
22 |
break;
|
23 |
case 'logs':
|
24 |
echo "<div class=\"wrap\">";
|
@@ -34,10 +34,10 @@ if ( !defined('ABSPATH') )
|
|
34 |
echo "</div>";
|
35 |
break;
|
36 |
case 'settings':
|
37 |
-
|
38 |
break;
|
39 |
case 'tools':
|
40 |
-
|
41 |
break;
|
42 |
case 'backups':
|
43 |
echo "<div class=\"wrap\">";
|
@@ -97,7 +97,7 @@ if ( !defined('ABSPATH') )
|
|
97 |
global $current_screen,$table,$backwpup_message;
|
98 |
|
99 |
if (!current_user_can(10))
|
100 |
-
wp_die('
|
101 |
//Css for Admin Section
|
102 |
wp_enqueue_style('BackWpup',plugins_url('css/options.css',__FILE__),'',BACKWPUP_VERSION,'screen');
|
103 |
wp_enqueue_script('BackWpupOptions',plugins_url('js/options.js',__FILE__),'',BACKWPUP_VERSION,true);
|
@@ -125,7 +125,7 @@ if ( !defined('ABSPATH') )
|
|
125 |
switch($_REQUEST['subpage']) {
|
126 |
case 'logs':
|
127 |
if (!empty($_REQUEST['action'])) {
|
128 |
-
|
129 |
backwpup_log_operations($_REQUEST['action']);
|
130 |
}
|
131 |
$table = new BackWPup_Logs_Table;
|
@@ -134,13 +134,13 @@ if ( !defined('ABSPATH') )
|
|
134 |
break;
|
135 |
case 'edit':
|
136 |
if (!empty($_POST['submit'])) {
|
137 |
-
|
138 |
$backwpup_message=backwpup_save_job();
|
139 |
}
|
140 |
break;
|
141 |
case 'settings':
|
142 |
if (!empty($_POST['submit'])) {
|
143 |
-
|
144 |
$backwpup_message=backwpup_save_settings();
|
145 |
}
|
146 |
break;
|
@@ -148,7 +148,7 @@ if ( !defined('ABSPATH') )
|
|
148 |
break;
|
149 |
case 'backups':
|
150 |
if (!empty($_REQUEST['action'])) {
|
151 |
-
|
152 |
backwpup_backups_operations($_REQUEST['action']);
|
153 |
}
|
154 |
$table = new BackWPup_Backups_Table;
|
@@ -161,7 +161,7 @@ if ( !defined('ABSPATH') )
|
|
161 |
break;
|
162 |
default:
|
163 |
if (!empty($_REQUEST['action'])) {
|
164 |
-
|
165 |
backwpup_job_operations($_REQUEST['action']);
|
166 |
}
|
167 |
$table = new BackWPup_Jobs_Table;
|
@@ -514,7 +514,7 @@ if ( !defined('ABSPATH') )
|
|
514 |
global $backwpup_logfile;
|
515 |
if (empty($jobid))
|
516 |
return false;
|
517 |
-
|
518 |
$backwpup_dojob= new backwpup_dojob($jobid);
|
519 |
unset($backwpup_dojob);
|
520 |
return $backwpup_logfile;
|
@@ -750,11 +750,9 @@ if ( !defined('ABSPATH') )
|
|
750 |
if ( @is_dir( $folder.$file )) {
|
751 |
if (!in_array(trailingslashit($folder.$file),$excludedirs))
|
752 |
_backwpup_calc_file_size_file_list_folder( trailingslashit($folder.$file), $levels - 1, $excludes);
|
753 |
-
} elseif (@is_file( $folder.$file )) {
|
754 |
-
|
755 |
-
|
756 |
-
$backwpup_temp_files['size']=$backwpup_temp_files['size']+filesize($folder.$file);
|
757 |
-
}
|
758 |
}
|
759 |
}
|
760 |
@closedir( $dir );
|
@@ -804,9 +802,9 @@ if ( !defined('ABSPATH') )
|
|
804 |
$donefolders=array();
|
805 |
if (extension_loaded('curl') or @dl(PHP_SHLIB_SUFFIX == 'so' ? 'curl.so' : 'php_curl.dll')) {
|
806 |
if (!class_exists('S3'))
|
807 |
-
|
808 |
if (!class_exists('CF_Authentication'))
|
809 |
-
|
810 |
}
|
811 |
|
812 |
foreach ($jobs as $jobid => $jobvalue) { //go job by job
|
@@ -955,7 +953,7 @@ if ( !defined('ABSPATH') )
|
|
955 |
$ajax=true;
|
956 |
}
|
957 |
if (!class_exists('S3'))
|
958 |
-
|
959 |
if (empty($awsAccessKey)) {
|
960 |
echo '<span id="awsBucket" style="color:red;">'.__('Missing Access Key ID!','backwpup').'</span>';
|
961 |
if ($ajax)
|
@@ -1002,7 +1000,7 @@ if ( !defined('ABSPATH') )
|
|
1002 |
$ajax=true;
|
1003 |
}
|
1004 |
if (!class_exists('CF_Authentication'))
|
1005 |
-
|
1006 |
|
1007 |
if (empty($rscUsername)) {
|
1008 |
echo '<span id="rscContainer" style="color:red;">'.__('Missing Username!','backwpup').'</span>';
|
@@ -1221,7 +1219,7 @@ if ( !defined('ABSPATH') )
|
|
1221 |
}
|
1222 |
|
1223 |
// add all action and so on only if plugin loaded.
|
1224 |
-
function
|
1225 |
if (!backwpup_env_checks())
|
1226 |
return;
|
1227 |
//Disabele WP_Corn
|
@@ -1229,7 +1227,7 @@ if ( !defined('ABSPATH') )
|
|
1229 |
if ($cfg['disablewpcron'])
|
1230 |
define('DISABLE_WP_CRON',true);
|
1231 |
//add Menu
|
1232 |
-
add_action('admin_menu', '
|
1233 |
//Additional links on the plugin page
|
1234 |
if (current_user_can(10))
|
1235 |
add_filter('plugin_action_links_'.BACKWPUP_PLUGIN_BASEDIR.'/backwpup.php', 'backwpup_plugin_options_link');
|
@@ -1249,7 +1247,7 @@ if ( !defined('ABSPATH') )
|
|
1249 |
add_action('wp_ajax_backwpup_get_aws_buckets', 'backwpup_get_aws_buckets');
|
1250 |
add_action('wp_ajax_backwpup_get_rsc_container', 'backwpup_get_rsc_container');
|
1251 |
//load tables Classes
|
1252 |
-
|
1253 |
}
|
1254 |
|
1255 |
?>
|
4 |
die('-1');
|
5 |
|
6 |
//Thems Option menu entry
|
7 |
+
function backwpup_admin_menu() {
|
8 |
$hook = add_management_page(__('BackWPup','backwpup'), __('BackWPup','backwpup'), '10', 'BackWPup','backwpup_options_page') ;
|
9 |
add_action('load-'.$hook, 'backwpup_options_load');
|
10 |
}
|
13 |
function backwpup_options_page() {
|
14 |
global $table,$backwpup_message,$page_hook;
|
15 |
if (!current_user_can(10))
|
16 |
+
wp_die('You do not have sufficient permissions to access this page.');
|
17 |
if(!empty($backwpup_message))
|
18 |
echo '<div id="message" class="updated fade"><p><strong>'.$backwpup_message.'</strong></p></div>';
|
19 |
switch($_REQUEST['subpage']) {
|
20 |
case 'edit':
|
21 |
+
include_once('options-edit-job.php');
|
22 |
break;
|
23 |
case 'logs':
|
24 |
echo "<div class=\"wrap\">";
|
34 |
echo "</div>";
|
35 |
break;
|
36 |
case 'settings':
|
37 |
+
include_once('options-settings.php');
|
38 |
break;
|
39 |
case 'tools':
|
40 |
+
include_once('options-tools.php');
|
41 |
break;
|
42 |
case 'backups':
|
43 |
echo "<div class=\"wrap\">";
|
97 |
global $current_screen,$table,$backwpup_message;
|
98 |
|
99 |
if (!current_user_can(10))
|
100 |
+
wp_die('You do not have sufficient permissions to access this page.');
|
101 |
//Css for Admin Section
|
102 |
wp_enqueue_style('BackWpup',plugins_url('css/options.css',__FILE__),'',BACKWPUP_VERSION,'screen');
|
103 |
wp_enqueue_script('BackWpupOptions',plugins_url('js/options.js',__FILE__),'',BACKWPUP_VERSION,true);
|
125 |
switch($_REQUEST['subpage']) {
|
126 |
case 'logs':
|
127 |
if (!empty($_REQUEST['action'])) {
|
128 |
+
include_once('options-save.php');
|
129 |
backwpup_log_operations($_REQUEST['action']);
|
130 |
}
|
131 |
$table = new BackWPup_Logs_Table;
|
134 |
break;
|
135 |
case 'edit':
|
136 |
if (!empty($_POST['submit'])) {
|
137 |
+
include_once('options-save.php');
|
138 |
$backwpup_message=backwpup_save_job();
|
139 |
}
|
140 |
break;
|
141 |
case 'settings':
|
142 |
if (!empty($_POST['submit'])) {
|
143 |
+
include_once('options-save.php');
|
144 |
$backwpup_message=backwpup_save_settings();
|
145 |
}
|
146 |
break;
|
148 |
break;
|
149 |
case 'backups':
|
150 |
if (!empty($_REQUEST['action'])) {
|
151 |
+
include_once('options-save.php');
|
152 |
backwpup_backups_operations($_REQUEST['action']);
|
153 |
}
|
154 |
$table = new BackWPup_Backups_Table;
|
161 |
break;
|
162 |
default:
|
163 |
if (!empty($_REQUEST['action'])) {
|
164 |
+
include_once('options-save.php');
|
165 |
backwpup_job_operations($_REQUEST['action']);
|
166 |
}
|
167 |
$table = new BackWPup_Jobs_Table;
|
514 |
global $backwpup_logfile;
|
515 |
if (empty($jobid))
|
516 |
return false;
|
517 |
+
include_once('backwpup_dojob.php');
|
518 |
$backwpup_dojob= new backwpup_dojob($jobid);
|
519 |
unset($backwpup_dojob);
|
520 |
return $backwpup_logfile;
|
750 |
if ( @is_dir( $folder.$file )) {
|
751 |
if (!in_array(trailingslashit($folder.$file),$excludedirs))
|
752 |
_backwpup_calc_file_size_file_list_folder( trailingslashit($folder.$file), $levels - 1, $excludes);
|
753 |
+
} elseif ((@is_file( $folder.$file ) or @is_executable($folder.$file)) and @is_readable($folder.$file)) {
|
754 |
+
$backwpup_temp_files['num']++;
|
755 |
+
$backwpup_temp_files['size']=$backwpup_temp_files['size']+filesize($folder.$file);
|
|
|
|
|
756 |
}
|
757 |
}
|
758 |
@closedir( $dir );
|
802 |
$donefolders=array();
|
803 |
if (extension_loaded('curl') or @dl(PHP_SHLIB_SUFFIX == 'so' ? 'curl.so' : 'php_curl.dll')) {
|
804 |
if (!class_exists('S3'))
|
805 |
+
include_once('libs/S3.php');
|
806 |
if (!class_exists('CF_Authentication'))
|
807 |
+
include_once('libs/rackspace/cloudfiles.php');
|
808 |
}
|
809 |
|
810 |
foreach ($jobs as $jobid => $jobvalue) { //go job by job
|
953 |
$ajax=true;
|
954 |
}
|
955 |
if (!class_exists('S3'))
|
956 |
+
include_once('libs/S3.php');
|
957 |
if (empty($awsAccessKey)) {
|
958 |
echo '<span id="awsBucket" style="color:red;">'.__('Missing Access Key ID!','backwpup').'</span>';
|
959 |
if ($ajax)
|
1000 |
$ajax=true;
|
1001 |
}
|
1002 |
if (!class_exists('CF_Authentication'))
|
1003 |
+
include_once('libs/rackspace/cloudfiles.php');
|
1004 |
|
1005 |
if (empty($rscUsername)) {
|
1006 |
echo '<span id="rscContainer" style="color:red;">'.__('Missing Username!','backwpup').'</span>';
|
1219 |
}
|
1220 |
|
1221 |
// add all action and so on only if plugin loaded.
|
1222 |
+
function backwpup_plugins_loaded() {
|
1223 |
if (!backwpup_env_checks())
|
1224 |
return;
|
1225 |
//Disabele WP_Corn
|
1227 |
if ($cfg['disablewpcron'])
|
1228 |
define('DISABLE_WP_CRON',true);
|
1229 |
//add Menu
|
1230 |
+
add_action('admin_menu', 'backwpup_admin_menu');
|
1231 |
//Additional links on the plugin page
|
1232 |
if (current_user_can(10))
|
1233 |
add_filter('plugin_action_links_'.BACKWPUP_PLUGIN_BASEDIR.'/backwpup.php', 'backwpup_plugin_options_link');
|
1247 |
add_action('wp_ajax_backwpup_get_aws_buckets', 'backwpup_get_aws_buckets');
|
1248 |
add_action('wp_ajax_backwpup_get_rsc_container', 'backwpup_get_rsc_container');
|
1249 |
//load tables Classes
|
1250 |
+
include_once('list-tables.php');
|
1251 |
}
|
1252 |
|
1253 |
?>
|
app/list-tables.php
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
//backwarts copatibility lower than wp 3.1
|
3 |
if (!class_exists('WP_List_Table')) {
|
4 |
if (is_file(trailingslashit(ABSPATH).'wp-admin/includes/list-table.php'))
|
5 |
-
|
6 |
else
|
7 |
-
|
8 |
}
|
9 |
|
10 |
class BackWPup_Jobs_Table extends WP_List_Table {
|
2 |
//backwarts copatibility lower than wp 3.1
|
3 |
if (!class_exists('WP_List_Table')) {
|
4 |
if (is_file(trailingslashit(ABSPATH).'wp-admin/includes/list-table.php'))
|
5 |
+
include_once( trailingslashit(ABSPATH).'wp-admin/includes/list-table.php' );
|
6 |
else
|
7 |
+
include_once('compatibility/list-table.php');
|
8 |
}
|
9 |
|
10 |
class BackWPup_Jobs_Table extends WP_List_Table {
|
app/options-edit-job.php
CHANGED
@@ -11,6 +11,9 @@ $jobid = (int) $_REQUEST['jobid'];
|
|
11 |
<div id="icon-tools" class="icon32"><br /></div>
|
12 |
<h2><?php _e('BackWPup Job Settings', 'backwpup'); ?></h2>
|
13 |
|
|
|
|
|
|
|
14 |
<form method="post" action="">
|
15 |
<input type="hidden" name="subpage" value="edit" />
|
16 |
<input type="hidden" name="jobid" value="<?PHP echo $jobid;?>" />
|
11 |
<div id="icon-tools" class="icon32"><br /></div>
|
12 |
<h2><?php _e('BackWPup Job Settings', 'backwpup'); ?></h2>
|
13 |
|
14 |
+
<?PHP backwpup_option_submenues(); ?>
|
15 |
+
<div class="clear"></div>
|
16 |
+
|
17 |
<form method="post" action="">
|
18 |
<input type="hidden" name="subpage" value="edit" />
|
19 |
<input type="hidden" name="jobid" value="<?PHP echo $jobid;?>" />
|
app/options-runnow-iframe.php
CHANGED
@@ -9,7 +9,7 @@ if (file_exists($_GET['wpabs'].'wp-load.php') and is_numeric(trim($_GET['jobid']
|
|
9 |
?>
|
10 |
<html>
|
11 |
<head>
|
12 |
-
<?PHP
|
13 |
<title><?PHP _e('Do Job','backwpup'); ?></title>
|
14 |
</head>
|
15 |
<body style="font-family:monospace;font-size:12px;white-space:nowrap;">
|
9 |
?>
|
10 |
<html>
|
11 |
<head>
|
12 |
+
<?PHP backwpup_meta_no_cache(); ?>
|
13 |
<title><?PHP _e('Do Job','backwpup'); ?></title>
|
14 |
</head>
|
15 |
<body style="font-family:monospace;font-size:12px;white-space:nowrap;">
|
backwpup.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: BackWPup
|
|
4 |
Plugin URI: http://danielhuesken.de/portfolio/backwpup/
|
5 |
Description: Backup and more of your WordPress Blog Database and Files.
|
6 |
Author: Daniel Hüsken
|
7 |
-
Version: 1.3.
|
8 |
Author URI: http://danielhuesken.de
|
9 |
Text Domain: backwpup
|
10 |
Domain Path: /lang/
|
@@ -34,17 +34,17 @@ if ( !defined('ABSPATH') )
|
|
34 |
//Set plugin dirname
|
35 |
define('BACKWPUP_PLUGIN_BASEDIR', dirname(plugin_basename(__FILE__)));
|
36 |
//Set Plugin Version
|
37 |
-
define('BACKWPUP_VERSION', '1.3.
|
38 |
//load Text Domain
|
39 |
load_plugin_textdomain('backwpup', false, BACKWPUP_PLUGIN_BASEDIR.'/lang');
|
40 |
//Load functions file
|
41 |
-
|
42 |
//Plugin activate
|
43 |
register_activation_hook(__FILE__, 'backwpup_plugin_activate');
|
44 |
//Plugin deactivate
|
45 |
register_deactivation_hook(__FILE__, 'backwpup_plugin_deactivate');
|
46 |
//Plugin init
|
47 |
-
add_action('plugins_loaded', '
|
48 |
//Admin message
|
49 |
add_action('admin_notices', 'backwpup_admin_notice');
|
50 |
?>
|
4 |
Plugin URI: http://danielhuesken.de/portfolio/backwpup/
|
5 |
Description: Backup and more of your WordPress Blog Database and Files.
|
6 |
Author: Daniel Hüsken
|
7 |
+
Version: 1.3.4
|
8 |
Author URI: http://danielhuesken.de
|
9 |
Text Domain: backwpup
|
10 |
Domain Path: /lang/
|
34 |
//Set plugin dirname
|
35 |
define('BACKWPUP_PLUGIN_BASEDIR', dirname(plugin_basename(__FILE__)));
|
36 |
//Set Plugin Version
|
37 |
+
define('BACKWPUP_VERSION', '1.3.4');
|
38 |
//load Text Domain
|
39 |
load_plugin_textdomain('backwpup', false, BACKWPUP_PLUGIN_BASEDIR.'/lang');
|
40 |
//Load functions file
|
41 |
+
include_once('app/functions.php');
|
42 |
//Plugin activate
|
43 |
register_activation_hook(__FILE__, 'backwpup_plugin_activate');
|
44 |
//Plugin deactivate
|
45 |
register_deactivation_hook(__FILE__, 'backwpup_plugin_deactivate');
|
46 |
//Plugin init
|
47 |
+
add_action('plugins_loaded', 'backwpup_plugins_loaded');
|
48 |
//Admin message
|
49 |
add_action('admin_notices', 'backwpup_admin_notice');
|
50 |
?>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=danie
|
|
4 |
Tags: backup, admin, file, Database, mysql, cron, ftp, S3, export, xml, Rackspase, cloud, webdav
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 3.1.0
|
7 |
-
Stable tag: 1.3.
|
8 |
|
9 |
Backup and more of your WordPress Blog Database and Files
|
10 |
|
@@ -82,6 +82,10 @@ Place mail only little archives
|
|
82 |
1. Job Page
|
83 |
|
84 |
== Changelog ==
|
|
|
|
|
|
|
|
|
85 |
= 1.3.3 =
|
86 |
* fixed bug with clear only displayed
|
87 |
* fiex bug with Parse Error for some php versions
|
4 |
Tags: backup, admin, file, Database, mysql, cron, ftp, S3, export, xml, Rackspase, cloud, webdav
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 3.1.0
|
7 |
+
Stable tag: 1.3.4
|
8 |
|
9 |
Backup and more of your WordPress Blog Database and Files
|
10 |
|
82 |
1. Job Page
|
83 |
|
84 |
== Changelog ==
|
85 |
+
= 1.3.4 =
|
86 |
+
* fixed warning in send mail
|
87 |
+
* bug fixes
|
88 |
+
|
89 |
= 1.3.3 =
|
90 |
* fixed bug with clear only displayed
|
91 |
* fiex bug with Parse Error for some php versions
|