BackWPup – WordPress Backup Plugin - Version 1.2.1

Version Description

  • fixed "Wrong parameter count for array_unique()" for old php version
  • added php version to log header
  • added mysql version to log header
Download this release

Release Info

Developer danielhuesken
Plugin Icon 128x128 BackWPup – WordPress Backup Plugin
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2.0 to 1.2.1

Files changed (4) hide show
  1. app/backwpup_dojob.php +11 -9
  2. app/functions.php +5 -3
  3. backwpup.php +2 -2
  4. readme.txt +6 -1
app/backwpup_dojob.php CHANGED
@@ -184,7 +184,7 @@ class backwpup_dojob {
184
  private $job=array();
185
 
186
  public function __construct($jobid) {
187
- global $backwpup_logfile,$backwpup_dojob;
188
  @ini_get('safe_mode','Off'); //disable safe mode
189
  //Set no user abort
190
  @ini_set('ignore_user_abort','Off'); //Set PHP ini setting
@@ -228,6 +228,8 @@ class backwpup_dojob {
228
  $fd=@fopen($backwpup_logfile,"a+");
229
  @fputs($fd,"<html>\n<head>\n");
230
  @fputs($fd,"<meta name=\"backwpup_version\" content=\"".BACKWPUP_VERSION."\" />\n");
 
 
231
  @fputs($fd,"<meta name=\"backwpup_logtime\" content=\"".current_time('timestamp')."\" />\n");
232
  @fputs($fd,str_pad("<meta name=\"backwpup_errors\" content=\"0\" />",100)."\n");
233
  @fputs($fd,str_pad("<meta name=\"backwpup_warnings\" content=\"0\" />",100)."\n");
@@ -652,7 +654,7 @@ class backwpup_dojob {
652
  }
653
  }
654
 
655
- private function _file_list_folder( $folder = '', $levels = 100, $excludes,$excludedirs=array()) {
656
  if( empty($folder) )
657
  return false;
658
  if( ! $levels )
@@ -694,7 +696,7 @@ class backwpup_dojob {
694
  //Exclude Temp Files
695
  $backwpup_exclude[]=$this->tempdir.DB_NAME.'.sql';
696
  $backwpup_exclude[]=$this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml';
697
- $backwpup_exclude=array_unique($backwpup_exclude,SORT_STRING);
698
 
699
  //File list for blog folders
700
  if ($this->job['backuproot'])
@@ -709,17 +711,17 @@ class backwpup_dojob {
709
  $this->_file_list_folder(untrailingslashit(backwpup_get_upload_dir()),100,$backwpup_exclude,array_merge($this->job['backupuploadsexcludedirs'],backwpup_get_exclude_wp_dirs(backwpup_get_upload_dir())));
710
 
711
  //include dirs
712
- $dirinclude=explode(',',$this->job['dirinclude']);
713
- $dirinclude=array_unique($dirinclude,SORT_STRING);
714
- //Crate file list
715
- if (is_array($dirinclude)) {
716
  foreach($dirinclude as $dirincludevalue) {
717
  if (is_dir($dirincludevalue))
718
  $this->_file_list_folder(untrailingslashit(str_replace('\\','/',$dirincludevalue)),100,$backwpup_exclude);
719
  }
720
  }
721
-
722
- $this->tempfilelist=array_unique($this->tempfilelist,SORT_STRING); //all files only one time in list
723
  sort($this->tempfilelist);
724
  foreach ($this->tempfilelist as $files) {
725
  $this->filelist[]=array(79001=>$files,79003=>str_replace(str_replace('\\','/',trailingslashit(ABSPATH)),'',$files));
184
  private $job=array();
185
 
186
  public function __construct($jobid) {
187
+ global $backwpup_logfile,$wpdb;
188
  @ini_get('safe_mode','Off'); //disable safe mode
189
  //Set no user abort
190
  @ini_set('ignore_user_abort','Off'); //Set PHP ini setting
228
  $fd=@fopen($backwpup_logfile,"a+");
229
  @fputs($fd,"<html>\n<head>\n");
230
  @fputs($fd,"<meta name=\"backwpup_version\" content=\"".BACKWPUP_VERSION."\" />\n");
231
+ @fputs($fd,"<meta name=\"php_version\" content=\"".phpversion()."\" />\n");
232
+ @fputs($fd,"<meta name=\"mysql_version\" content=\"".$wpdb->get_var("SELECT VERSION() AS version")."\" />\n");
233
  @fputs($fd,"<meta name=\"backwpup_logtime\" content=\"".current_time('timestamp')."\" />\n");
234
  @fputs($fd,str_pad("<meta name=\"backwpup_errors\" content=\"0\" />",100)."\n");
235
  @fputs($fd,str_pad("<meta name=\"backwpup_warnings\" content=\"0\" />",100)."\n");
654
  }
655
  }
656
 
657
+ private function _file_list_folder( $folder = '', $levels = 100, $excludes=array(),$excludedirs=array()) {
658
  if( empty($folder) )
659
  return false;
660
  if( ! $levels )
696
  //Exclude Temp Files
697
  $backwpup_exclude[]=$this->tempdir.DB_NAME.'.sql';
698
  $backwpup_exclude[]=$this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml';
699
+ $backwpup_exclude=array_unique($backwpup_exclude);
700
 
701
  //File list for blog folders
702
  if ($this->job['backuproot'])
711
  $this->_file_list_folder(untrailingslashit(backwpup_get_upload_dir()),100,$backwpup_exclude,array_merge($this->job['backupuploadsexcludedirs'],backwpup_get_exclude_wp_dirs(backwpup_get_upload_dir())));
712
 
713
  //include dirs
714
+ if (!empty($this->job['dirinclude'])) {
715
+ $dirinclude=explode(',',$this->job['dirinclude']);
716
+ $dirinclude=array_unique($dirinclude);
717
+ //Crate file list for includes
718
  foreach($dirinclude as $dirincludevalue) {
719
  if (is_dir($dirincludevalue))
720
  $this->_file_list_folder(untrailingslashit(str_replace('\\','/',$dirincludevalue)),100,$backwpup_exclude);
721
  }
722
  }
723
+
724
+ $this->tempfilelist=array_unique($this->tempfilelist); //all files only one time in list
725
  sort($this->tempfilelist);
726
  foreach ($this->tempfilelist as $files) {
727
  $this->filelist[]=array(79001=>$files,79003=>str_replace(str_replace('\\','/',trailingslashit(ABSPATH)),'',$files));
app/functions.php CHANGED
@@ -603,9 +603,11 @@ if ( !defined('ABSPATH') )
603
  $excludedir[]=backwpup_get_upload_dir();
604
  //Exclude Backup dirs
605
  $jobs=get_option('backwpup_jobs');
606
- foreach((array)$jobs as $jobsvale) {
607
- if (!empty($jobsvale['backupdir']) and $jobsvale['backupdir']!='/')
608
- $excludedir[]=trailingslashit(str_replace('\\','/',$jobsvale['backupdir']));
 
 
609
  }
610
  return $excludedir;
611
  }
603
  $excludedir[]=backwpup_get_upload_dir();
604
  //Exclude Backup dirs
605
  $jobs=get_option('backwpup_jobs');
606
+ if (is_array($jobs)) {
607
+ foreach($jobs as $jobsvale) {
608
+ if (!empty($jobsvale['backupdir']) and $jobsvale['backupdir']!='/')
609
+ $excludedir[]=trailingslashit(str_replace('\\','/',$jobsvale['backupdir']));
610
+ }
611
  }
612
  return $excludedir;
613
  }
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&uuml;sken
7
- Version: 1.2.0
8
  Author URI: http://danielhuesken.de
9
  Text Domain: backwpup
10
  Domain Path: /lang/
@@ -35,7 +35,7 @@ if ( !defined('ABSPATH') )
35
  //Set plugin dirname
36
  define('BACKWPUP_PLUGIN_BASEDIR', dirname(plugin_basename(__FILE__)));
37
  //Set Plugin Version
38
- define('BACKWPUP_VERSION', '1.2.0');
39
  //load Text Domain
40
  load_plugin_textdomain('backwpup', false, BACKWPUP_PLUGIN_BASEDIR.'/lang');
41
  //Load functions file
4
  Plugin URI: http://danielhuesken.de/portfolio/backwpup/
5
  Description: Backup and more of your WordPress Blog Database and Files.
6
  Author: Daniel H&uuml;sken
7
+ Version: 1.2.1
8
  Author URI: http://danielhuesken.de
9
  Text Domain: backwpup
10
  Domain Path: /lang/
35
  //Set plugin dirname
36
  define('BACKWPUP_PLUGIN_BASEDIR', dirname(plugin_basename(__FILE__)));
37
  //Set Plugin Version
38
+ define('BACKWPUP_VERSION', '1.2.1');
39
  //load Text Domain
40
  load_plugin_textdomain('backwpup', false, BACKWPUP_PLUGIN_BASEDIR.'/lang');
41
  //Load functions file
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
5
  Requires at least: 2.8
6
  Tested up to: 3.0.0
7
- Stable tag: 1.2.0
8
 
9
  Backup and more of your WordPress Blog Database and Files
10
 
@@ -81,6 +81,11 @@ Place mail only little archives
81
  1. Job Page
82
 
83
  == Changelog ==
 
 
 
 
 
84
  = 1.2.0 =
85
  * Backup file size now in log file
86
  * Paged Logs Table
4
  Tags: backup, admin, file, Database, mysql, cron, ftp, S3, export
5
  Requires at least: 2.8
6
  Tested up to: 3.0.0
7
+ Stable tag: 1.2.1
8
 
9
  Backup and more of your WordPress Blog Database and Files
10
 
81
  1. Job Page
82
 
83
  == Changelog ==
84
+ = 1.2.1 =
85
+ * fixed "Wrong parameter count for array_unique()" for old php version
86
+ * added php version to log header
87
+ * added mysql version to log header
88
+
89
  = 1.2.0 =
90
  * Backup file size now in log file
91
  * Paged Logs Table