Version Description
*Release Date - March 1, 2018
- FIX: Fix array initialization issue for php 7.1 in task and job meta setters
- UPDATE: Updates to remove api log messages
Download this release
Release Info
Developer | cssimmon |
Plugin | Backup and Restore WordPress – WPBackItUp Backup Plugin |
Version | 1.15.6 |
Comparing to | |
See all releases |
Code changes from version 1.15.5 to 1.15.6
- lib/includes/class-api.php +29 -26
- lib/includes/class-database.php +31 -0
- lib/includes/class-job-task.php +6 -1
- lib/includes/class-job.php +3 -1
- lib/includes/job_backup.php +12 -1
- readme.txt +8 -2
- wp-backitup.php +2 -2
lib/includes/class-api.php
CHANGED
@@ -40,33 +40,36 @@ class WPBackItUp_API {
|
|
40 |
), $backup_list_size );
|
41 |
|
42 |
$available_backups = array();
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
-
|
55 |
-
// Random status value
|
56 |
-
// $cloud_status = array('uploading', 'uploaded', 'error', false);
|
57 |
-
|
58 |
-
$available_backups[] = array(
|
59 |
-
'backup_job_id' => $backup_job->getJobId(),
|
60 |
-
'backup_job_name' => $backup_job->getJobName(),
|
61 |
-
'backup_job_date' => $backup_job->getJobDate(),
|
62 |
-
'backup_job_type' => $backup_job->getJobType(),
|
63 |
-
'backup_job_run_type' => $backup_job->getJobRunType(),
|
64 |
-
'backup_job_start_time' => $backup_job->getJobStartTime(),
|
65 |
-
'backup_job_end_time' => $backup_job->getJobEndTime(),
|
66 |
-
'backup_job_status' => $status,
|
67 |
-
'backup_job_cloud_status' => $backup_job->getCloudStatus(), // pick a random $cloud_status[array_rand($cloud_status, 1)],
|
68 |
-
'backup_job_zip_files' => $backup_job->getJobMetaValue( 'backup_zip_files' ),
|
69 |
-
);
|
70 |
}
|
71 |
|
72 |
wp_send_json_success( $available_backups ); //Send JSON Response
|
40 |
), $backup_list_size );
|
41 |
|
42 |
$available_backups = array();
|
43 |
+
if (is_array($backup_jobs)) {
|
44 |
+
foreach ( $backup_jobs as $backup_job ) {
|
45 |
+
switch ( $backup_job->getJobStatus() ) {
|
46 |
+
case WPBackItUp_Job::COMPLETE:
|
47 |
+
$status = __( "Success", 'wp-backitup' );
|
48 |
+
break;
|
49 |
+
case WPBackItUp_Job::ACTIVE:
|
50 |
+
$status = __( "Active", 'wp-backitup' );
|
51 |
+
break;
|
52 |
+
default:
|
53 |
+
$status = __( "Error", 'wp-backitup' );
|
54 |
+
}
|
55 |
+
|
56 |
+
// Random status value
|
57 |
+
// $cloud_status = array('uploading', 'uploaded', 'error', false);
|
58 |
+
|
59 |
+
$available_backups[] = array(
|
60 |
+
'backup_job_id' => $backup_job->getJobId(),
|
61 |
+
'backup_job_name' => $backup_job->getJobName(),
|
62 |
+
'backup_job_date' => $backup_job->getJobDate(),
|
63 |
+
'backup_job_type' => $backup_job->getJobType(),
|
64 |
+
'backup_job_run_type' => $backup_job->getJobRunType(),
|
65 |
+
'backup_job_start_time' => $backup_job->getJobStartTime(),
|
66 |
+
'backup_job_end_time' => $backup_job->getJobEndTime(),
|
67 |
+
'backup_job_status' => $status,
|
68 |
+
'backup_job_cloud_status' => $backup_job->getCloudStatus(),
|
69 |
+
// pick a random $cloud_status[array_rand($cloud_status, 1)],
|
70 |
+
'backup_job_zip_files' => $backup_job->getJobMetaValue( 'backup_zip_files' ),
|
71 |
+
);
|
72 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
74 |
|
75 |
wp_send_json_success( $available_backups ); //Send JSON Response
|
lib/includes/class-database.php
CHANGED
@@ -542,6 +542,37 @@ class WPBackItUp_DataAccess {
|
|
542 |
else return true;
|
543 |
}
|
544 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
545 |
|
546 |
/**
|
547 |
* Fetch a distinct list of job_ids from the job_item table
|
542 |
else return true;
|
543 |
}
|
544 |
|
545 |
+
// public function update_task_functional($meta, $retry_count, $task_start, $task_end, $task_status, $task_err, $task_id ) {
|
546 |
+
// WPBackItUp_Logger::log_info($this->log_name,__METHOD__,'Begin');
|
547 |
+
// global $wpdb;
|
548 |
+
//
|
549 |
+
// $sql = $wpdb->prepare(
|
550 |
+
// "UPDATE $wpdb->wpbackitup_job_task
|
551 |
+
// SET
|
552 |
+
// task_meta=%s,
|
553 |
+
// retry_count=%d,
|
554 |
+
// task_start = %s,
|
555 |
+
// task_end = %s,
|
556 |
+
// update_date =%s,
|
557 |
+
// task_status=%s,
|
558 |
+
// error=%d
|
559 |
+
// WHERE task_id=%d
|
560 |
+
// ",
|
561 |
+
// maybe_serialize($meta),
|
562 |
+
// $retry_count,
|
563 |
+
// $task_start,
|
564 |
+
// $task_end,
|
565 |
+
// current_time('mysql'),
|
566 |
+
// $task_status,
|
567 |
+
// $task_err,
|
568 |
+
// $task_id
|
569 |
+
// );
|
570 |
+
//
|
571 |
+
// $sql_rtn = $this->query($sql);
|
572 |
+
// if (false=== $sql_rtn) return false;
|
573 |
+
// else return true;
|
574 |
+
// }
|
575 |
+
|
576 |
|
577 |
/**
|
578 |
* Fetch a distinct list of job_ids from the job_item table
|
lib/includes/class-job-task.php
CHANGED
@@ -62,7 +62,10 @@ class WPBackItUp_Job_Task {
|
|
62 |
$this->task_id = $db_task->task_id;
|
63 |
$this->job_id = $db_task->job_id;
|
64 |
$this->task_name = $db_task->task_name;
|
65 |
-
|
|
|
|
|
|
|
66 |
|
67 |
//leave set to null default
|
68 |
if (! empty($db_task->task_start) && '0000-00-00 00:00:00'!= $db_task->task_start) {
|
@@ -243,6 +246,8 @@ class WPBackItUp_Job_Task {
|
|
243 |
public function setTaskMetaValue($meta_name,$meta_value){
|
244 |
|
245 |
$this->task_meta[$meta_name]=$meta_value;
|
|
|
|
|
246 |
return $this->save();
|
247 |
}
|
248 |
|
62 |
$this->task_id = $db_task->task_id;
|
63 |
$this->job_id = $db_task->job_id;
|
64 |
$this->task_name = $db_task->task_name;
|
65 |
+
|
66 |
+
//initialize task meta as array php 7.1
|
67 |
+
$this->task_meta=array();
|
68 |
+
if (null!=$db_task->task_meta) $this->task_meta = maybe_unserialize($db_task->task_meta);
|
69 |
|
70 |
//leave set to null default
|
71 |
if (! empty($db_task->task_start) && '0000-00-00 00:00:00'!= $db_task->task_start) {
|
246 |
public function setTaskMetaValue($meta_name,$meta_value){
|
247 |
|
248 |
$this->task_meta[$meta_name]=$meta_value;
|
249 |
+
WPBackItUp_Logger::log_info($this->log_name,__METHOD__,'Task Meta: '. var_export($this->task_meta, true));
|
250 |
+
|
251 |
return $this->save();
|
252 |
}
|
253 |
|
lib/includes/class-job.php
CHANGED
@@ -156,7 +156,9 @@ class WPBackItUp_Job {
|
|
156 |
$this->instance_id=current_time('timestamp');
|
157 |
$this->job_status=$db_job->job_status;
|
158 |
|
159 |
-
|
|
|
|
|
160 |
|
161 |
//leave set to null default
|
162 |
if (! empty($db_job->job_start) && '0000-00-00 00:00:00'!= $db_job->job_start) {
|
156 |
$this->instance_id=current_time('timestamp');
|
157 |
$this->job_status=$db_job->job_status;
|
158 |
|
159 |
+
//initialize task meta as array php 7.1
|
160 |
+
$this->job_meta=array();
|
161 |
+
if (null!=$db_job->job_meta) $this->job_meta = maybe_unserialize($db_job->job_meta);
|
162 |
|
163 |
//leave set to null default
|
164 |
if (! empty($db_job->job_start) && '0000-00-00 00:00:00'!= $db_job->job_start) {
|
lib/includes/job_backup.php
CHANGED
@@ -858,9 +858,16 @@ if ('task_validate_backup'==$current_task->getTaskName()) {
|
|
858 |
$db = new WPBackItUp_DataAccess();
|
859 |
|
860 |
$plugin_validation_meta = $current_task->getTaskMetaValue('task_multistep_validate_plugins');
|
|
|
|
|
861 |
$theme_validation_meta = $current_task->getTaskMetaValue('task_multistep_validate_themes');
|
|
|
|
|
862 |
$upload_validation_meta = $current_task->getTaskMetaValue('task_multistep_validate_uploads');
|
|
|
|
|
863 |
$other_validation_meta = $current_task->getTaskMetaValue('task_multistep_validate_others');
|
|
|
864 |
|
865 |
|
866 |
$validation_meta=false;
|
@@ -882,6 +889,7 @@ if ('task_validate_backup'==$current_task->getTaskName()) {
|
|
882 |
}
|
883 |
|
884 |
|
|
|
885 |
if( $validation_meta !==false ) {
|
886 |
$meta_task = sprintf( 'task_multistep_validate_%s', $validation_task );
|
887 |
$batch_ids = $db->get_item_batch_ids( $current_job->getJobId(), $validation_task );
|
@@ -904,10 +912,13 @@ if ('task_validate_backup'==$current_task->getTaskName()) {
|
|
904 |
$set_validate_backup_error = true;
|
905 |
} else {
|
906 |
$updated_meta = $current_task->setTaskMetaValue( $meta_task, $array_index );
|
907 |
-
|
|
|
|
|
908 |
WPBackItUp_Logger::log_error( $backup_logname, $log_function, sprintf('Meta %s update failed', $meta_task));
|
909 |
}
|
910 |
WPBackItUp_Logger::log_info( $backup_logname, $log_function, sprintf('%s Content, Batch ID: %s Validated Successfully!',$validation_task,$batch_id ));
|
|
|
911 |
}
|
912 |
} else {
|
913 |
//task is done
|
858 |
$db = new WPBackItUp_DataAccess();
|
859 |
|
860 |
$plugin_validation_meta = $current_task->getTaskMetaValue('task_multistep_validate_plugins');
|
861 |
+
WPBackItUp_Logger::log_info( $backup_logname, $log_function, sprintf('plugin validation meta: %s',var_export( $plugin_validation_meta, true )));
|
862 |
+
|
863 |
$theme_validation_meta = $current_task->getTaskMetaValue('task_multistep_validate_themes');
|
864 |
+
WPBackItUp_Logger::log_info( $backup_logname, $log_function, sprintf('theme validation meta: %s',var_export( $theme_validation_meta, true )));
|
865 |
+
|
866 |
$upload_validation_meta = $current_task->getTaskMetaValue('task_multistep_validate_uploads');
|
867 |
+
WPBackItUp_Logger::log_info( $backup_logname, $log_function, sprintf('upload validation meta: %s',var_export( $upload_validation_meta, true )));
|
868 |
+
|
869 |
$other_validation_meta = $current_task->getTaskMetaValue('task_multistep_validate_others');
|
870 |
+
WPBackItUp_Logger::log_info( $backup_logname, $log_function, sprintf('other validation meta: %s',var_export( $other_validation_meta, true )));
|
871 |
|
872 |
|
873 |
$validation_meta=false;
|
889 |
}
|
890 |
|
891 |
|
892 |
+
WPBackItUp_Logger::log_info( $backup_logname, $log_function, sprintf('%s validation meta: %s',$validation_task,var_export( $validation_meta, true )));
|
893 |
if( $validation_meta !==false ) {
|
894 |
$meta_task = sprintf( 'task_multistep_validate_%s', $validation_task );
|
895 |
$batch_ids = $db->get_item_batch_ids( $current_job->getJobId(), $validation_task );
|
912 |
$set_validate_backup_error = true;
|
913 |
} else {
|
914 |
$updated_meta = $current_task->setTaskMetaValue( $meta_task, $array_index );
|
915 |
+
|
916 |
+
WPBackItUp_Logger::log_info( $backup_logname, $log_function, sprintf('Meta %s', $meta_task));
|
917 |
+
if($updated_meta === false){
|
918 |
WPBackItUp_Logger::log_error( $backup_logname, $log_function, sprintf('Meta %s update failed', $meta_task));
|
919 |
}
|
920 |
WPBackItUp_Logger::log_info( $backup_logname, $log_function, sprintf('%s Content, Batch ID: %s Validated Successfully!',$validation_task,$batch_id ));
|
921 |
+
|
922 |
}
|
923 |
} else {
|
924 |
//task is done
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: backup, backups, back up, backup plugin, database backup, multisite backup
|
|
4 |
Requires at least: 3.8.0
|
5 |
Requires PHP: 5.2.4
|
6 |
Tested up to: 4.9
|
7 |
-
Stable tag: 1.15.
|
8 |
Author URI: https://www.wpbackitup.com
|
9 |
Donate link: https://www.wpbackitup.com
|
10 |
License: GPLv2 or later
|
@@ -214,8 +214,14 @@ Our online documentation and full list of FAQs can be found at [support.wpbackit
|
|
214 |
|
215 |
|
216 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
= 1.15.5 =
|
218 |
-
*Release Date - February, 9,
|
219 |
|
220 |
* UPDATE: Updates to support WPBackItUp Safe Beta Launch
|
221 |
* UPDATE: Updates to WordPress 4.9.4
|
4 |
Requires at least: 3.8.0
|
5 |
Requires PHP: 5.2.4
|
6 |
Tested up to: 4.9
|
7 |
+
Stable tag: 1.15.5
|
8 |
Author URI: https://www.wpbackitup.com
|
9 |
Donate link: https://www.wpbackitup.com
|
10 |
License: GPLv2 or later
|
214 |
|
215 |
|
216 |
== Changelog ==
|
217 |
+
= 1.15.6 =
|
218 |
+
*Release Date - March 1, 2018
|
219 |
+
|
220 |
+
* FIX: Fix array initialization issue for php 7.1 in task and job meta setters
|
221 |
+
* UPDATE: Updates to remove api log messages
|
222 |
+
|
223 |
= 1.15.5 =
|
224 |
+
*Release Date - February, 9, 2018
|
225 |
|
226 |
* UPDATE: Updates to support WPBackItUp Safe Beta Launch
|
227 |
* UPDATE: Updates to WordPress 4.9.4
|
wp-backitup.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
* Description: Backup your content, settings, themes, plugins and media in just a few simple clicks.
|
7 |
* Author: WPBackItUp
|
8 |
* Author URI: https://www.wpbackitup.com
|
9 |
-
* Version: 1.15.
|
10 |
* Text Domain: wp-backitup
|
11 |
*
|
12 |
* License: GPL3
|
@@ -33,7 +33,7 @@ define( 'WPBACKITUP__CLASSNAMESPACE', 'WPBackItUp' );
|
|
33 |
|
34 |
define( 'WPBACKITUP__MAJOR_VERSION', 1);
|
35 |
define( 'WPBACKITUP__MINOR_VERSION', 15);
|
36 |
-
define( 'WPBACKITUP__MAINTENANCE_VERSION',
|
37 |
define( 'WPBACKITUP__BUILD_VERSION', 0); //Used for hotfix releases
|
38 |
|
39 |
define( 'WPBACKITUP__VERSION',sprintf("%d.%d.%d.%d", WPBACKITUP__MAJOR_VERSION, WPBACKITUP__MINOR_VERSION,WPBACKITUP__MAINTENANCE_VERSION,WPBACKITUP__BUILD_VERSION));
|
6 |
* Description: Backup your content, settings, themes, plugins and media in just a few simple clicks.
|
7 |
* Author: WPBackItUp
|
8 |
* Author URI: https://www.wpbackitup.com
|
9 |
+
* Version: 1.15.6
|
10 |
* Text Domain: wp-backitup
|
11 |
*
|
12 |
* License: GPL3
|
33 |
|
34 |
define( 'WPBACKITUP__MAJOR_VERSION', 1);
|
35 |
define( 'WPBACKITUP__MINOR_VERSION', 15);
|
36 |
+
define( 'WPBACKITUP__MAINTENANCE_VERSION', 6); //Dont forget to update version in header on WP release
|
37 |
define( 'WPBACKITUP__BUILD_VERSION', 0); //Used for hotfix releases
|
38 |
|
39 |
define( 'WPBACKITUP__VERSION',sprintf("%d.%d.%d.%d", WPBACKITUP__MAJOR_VERSION, WPBACKITUP__MINOR_VERSION,WPBACKITUP__MAINTENANCE_VERSION,WPBACKITUP__BUILD_VERSION));
|