Version Description
- FEATURE:Add job data to cleanup routine
- FIX: Add wp-cron task on schedule check to fix issue with sheduled backups not running.
- FIX: Write response file before status update.
- UPDATE: Cancel all scheduled jobs on plugin activation & deactivation.
- UPDATE: Add additional logging to job scheduler.
- UPDATE: Add additional logging to manifest creation.
- UPDATE: Add additional logging to add files to backup.
Download this release
Release Info
Developer | cssimmon |
Plugin | Backup and Restore WordPress – WPBackItUp Backup Plugin |
Version | 1.10.6 |
Comparing to | |
See all releases |
Code changes from version 1.10.5 to 1.10.6
- lib/includes/class-backup.php +10 -3
- lib/includes/class-job.php +64 -68
- lib/includes/class-wpbackitup-admin.php +37 -5
- lib/includes/class-zip.php +1 -1
- lib/includes/job_backup.php +8 -1
- lib/includes/job_cleanup.php +8 -1
- readme.txt +10 -1
- wp-backitup.php +9 -2
lib/includes/class-backup.php
CHANGED
@@ -411,9 +411,10 @@ class WPBackItUp_Backup {
|
|
411 |
|
412 |
$file_system = new WPBackItUp_FileSystem($this->logger);
|
413 |
$plugins_file_list = $file_system->get_recursive_file_list(WPBACKITUP__PLUGINS_ROOT_PATH. '/*' );
|
|
|
414 |
$this->logger->log_info( __METHOD__, 'Plugin File Count: ' .count($plugins_file_list));
|
415 |
|
416 |
-
return
|
417 |
}
|
418 |
|
419 |
public function get_themes_file_list() {
|
@@ -422,6 +423,7 @@ class WPBackItUp_Backup {
|
|
422 |
$file_system = new WPBackItUp_FileSystem($this->logger);
|
423 |
$themes_root_path = WPBACKITUP__THEMES_ROOT_PATH;
|
424 |
$themes_file_list = $file_system->get_recursive_file_list($themes_root_path. '/*' );
|
|
|
425 |
$this->logger->log_info( __METHOD__, 'Themes File Count: ' .count($themes_file_list));
|
426 |
|
427 |
return $themes_file_list;
|
@@ -449,6 +451,7 @@ class WPBackItUp_Backup {
|
|
449 |
}
|
450 |
}
|
451 |
}
|
|
|
452 |
|
453 |
//Need to grab the files in the root also
|
454 |
$files_only = array_filter(glob($uploads_root_path. '/*'), 'is_file');
|
@@ -489,6 +492,7 @@ class WPBackItUp_Backup {
|
|
489 |
}
|
490 |
}
|
491 |
}
|
|
|
492 |
|
493 |
//Need to grab the files in the root also
|
494 |
$files_only = array_filter(glob($wpcontent_path. '/*'), 'is_file');
|
@@ -668,6 +672,7 @@ class WPBackItUp_Backup {
|
|
668 |
|
669 |
//get a list of all the zips
|
670 |
$backup_files_path = array_filter(glob($this->backup_project_path. '*.zip'), 'is_file');
|
|
|
671 |
if (is_array($backup_files_path) && count($backup_files_path)>0){
|
672 |
//get rid of the path.
|
673 |
$backup_files = str_replace($this->backup_project_path,'',$backup_files_path);
|
@@ -682,12 +687,14 @@ class WPBackItUp_Backup {
|
|
682 |
$zip_file_path = $backup_files_path[$main_zip_index];
|
683 |
$zip = new WPBackItUp_Zip($this->logger,$zip_file_path);
|
684 |
$target_item_path = str_replace(rtrim($this->backup_project_path, '/'),rtrim('site-data','/'),$manifest_file);
|
685 |
-
if (
|
686 |
$zip->close();//close the zip
|
687 |
$this->logger->log_info(__METHOD__,'End - Manifest created.');
|
688 |
return true;
|
689 |
}
|
690 |
-
}
|
|
|
|
|
691 |
}
|
692 |
|
693 |
$this->logger->log_error(__METHOD__,'End - Manifest not created.');
|
411 |
|
412 |
$file_system = new WPBackItUp_FileSystem($this->logger);
|
413 |
$plugins_file_list = $file_system->get_recursive_file_list(WPBACKITUP__PLUGINS_ROOT_PATH. '/*' );
|
414 |
+
$file_system=null;//release resources.
|
415 |
$this->logger->log_info( __METHOD__, 'Plugin File Count: ' .count($plugins_file_list));
|
416 |
|
417 |
+
return $plugins_file_list;
|
418 |
}
|
419 |
|
420 |
public function get_themes_file_list() {
|
423 |
$file_system = new WPBackItUp_FileSystem($this->logger);
|
424 |
$themes_root_path = WPBACKITUP__THEMES_ROOT_PATH;
|
425 |
$themes_file_list = $file_system->get_recursive_file_list($themes_root_path. '/*' );
|
426 |
+
$file_system=null;//release resources.
|
427 |
$this->logger->log_info( __METHOD__, 'Themes File Count: ' .count($themes_file_list));
|
428 |
|
429 |
return $themes_file_list;
|
451 |
}
|
452 |
}
|
453 |
}
|
454 |
+
$file_system=null;//release resources.
|
455 |
|
456 |
//Need to grab the files in the root also
|
457 |
$files_only = array_filter(glob($uploads_root_path. '/*'), 'is_file');
|
492 |
}
|
493 |
}
|
494 |
}
|
495 |
+
$file_system=null;//release resources.
|
496 |
|
497 |
//Need to grab the files in the root also
|
498 |
$files_only = array_filter(glob($wpcontent_path. '/*'), 'is_file');
|
672 |
|
673 |
//get a list of all the zips
|
674 |
$backup_files_path = array_filter(glob($this->backup_project_path. '*.zip'), 'is_file');
|
675 |
+
$this->logger->log_error(__METHOD__,'Zip files found:'. var_export($backup_files_path,true));
|
676 |
if (is_array($backup_files_path) && count($backup_files_path)>0){
|
677 |
//get rid of the path.
|
678 |
$backup_files = str_replace($this->backup_project_path,'',$backup_files_path);
|
687 |
$zip_file_path = $backup_files_path[$main_zip_index];
|
688 |
$zip = new WPBackItUp_Zip($this->logger,$zip_file_path);
|
689 |
$target_item_path = str_replace(rtrim($this->backup_project_path, '/'),rtrim('site-data','/'),$manifest_file);
|
690 |
+
if ($zip->add_file($manifest_file,$target_item_path)) {
|
691 |
$zip->close();//close the zip
|
692 |
$this->logger->log_info(__METHOD__,'End - Manifest created.');
|
693 |
return true;
|
694 |
}
|
695 |
+
}else{
|
696 |
+
$this->logger->log_error(__METHOD__,'Main zip not found.');
|
697 |
+
}
|
698 |
}
|
699 |
|
700 |
$this->logger->log_error(__METHOD__,'End - Manifest not created.');
|
lib/includes/class-job.php
CHANGED
@@ -531,6 +531,47 @@ class WPBackItUp_Job {
|
|
531 |
return false;
|
532 |
}
|
533 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
534 |
/**
|
535 |
* Cancel all queued or active jobs
|
536 |
*
|
@@ -560,6 +601,29 @@ class WPBackItUp_Job {
|
|
560 |
$logger->log_info(__METHOD__,'End - All jobs cancelled');
|
561 |
}
|
562 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
563 |
/**
|
564 |
* Gets the queued or active job on top of the stack
|
565 |
*
|
@@ -720,74 +784,6 @@ class WPBackItUp_Job {
|
|
720 |
|
721 |
}
|
722 |
|
723 |
-
// /**
|
724 |
-
// * Create all the tasks for a job
|
725 |
-
// * @param $job_id
|
726 |
-
// *
|
727 |
-
// * @return bool
|
728 |
-
// */
|
729 |
-
// private static function create_backup_tasks($job_id){
|
730 |
-
// $logger = new WPBackItUp_Logger(false,null,'debug_job');
|
731 |
-
// $logger->log_info(__METHOD__,'Begin');
|
732 |
-
//
|
733 |
-
// //Create the job tasks
|
734 |
-
// $last_updated_time=time();
|
735 |
-
// foreach (self::$backup_tasks as $key => $value){
|
736 |
-
// $task_name = $value;
|
737 |
-
// $task_data = array(
|
738 |
-
// 'task_id' => $task_name,
|
739 |
-
// 'task_status' => 'queued',
|
740 |
-
// 'task_allocated_id'=>'',
|
741 |
-
// 'task_last_updated'=>$last_updated_time
|
742 |
-
// );
|
743 |
-
// $task_created = update_post_meta( $job_id, $task_name, $task_data );
|
744 |
-
//
|
745 |
-
// if (false===$task_created){
|
746 |
-
// $logger->log_error( __METHOD__, 'Tasks NOT created');
|
747 |
-
// return false;
|
748 |
-
// }
|
749 |
-
// $logger->log_info( __METHOD__, 'task created:' . $task_created .':'. $task_name);
|
750 |
-
// }
|
751 |
-
//
|
752 |
-
// $logger->log_info(__METHOD__,'End');
|
753 |
-
// return true;
|
754 |
-
//
|
755 |
-
// }
|
756 |
-
|
757 |
-
// /**
|
758 |
-
// * Create all the tasks for a job
|
759 |
-
// * @param $job_id
|
760 |
-
// *
|
761 |
-
// * @return bool
|
762 |
-
// */
|
763 |
-
// private static function create_cleanup_tasks($job_id){
|
764 |
-
// $logger = new WPBackItUp_Logger(false,null,'debug_job');
|
765 |
-
// $logger->log_info(__METHOD__,'Begin');
|
766 |
-
//
|
767 |
-
// //Create the job tasks
|
768 |
-
// $last_updated_time=time();
|
769 |
-
// foreach (self::$cleanup_tasks as $key => $value){
|
770 |
-
// $task_name = $value;
|
771 |
-
// $task_data = array(
|
772 |
-
// 'task_id' => $task_name,
|
773 |
-
// 'task_status' => 'queued',
|
774 |
-
// 'task_allocated_id'=>'',
|
775 |
-
// 'task_last_updated'=>$last_updated_time
|
776 |
-
// );
|
777 |
-
// $task_created = update_post_meta( $job_id, $task_name, $task_data );
|
778 |
-
//
|
779 |
-
// if (false===$task_created){
|
780 |
-
// $logger->log_error( __METHOD__, 'Tasks NOT created');
|
781 |
-
// return false;
|
782 |
-
// }
|
783 |
-
// $logger->log_info( __METHOD__, 'task created:' . $task_created );
|
784 |
-
// }
|
785 |
-
//
|
786 |
-
// $logger->log_info(__METHOD__,'End');
|
787 |
-
// return true;
|
788 |
-
//
|
789 |
-
// }
|
790 |
-
|
791 |
/**
|
792 |
* @return mixed
|
793 |
*/
|
531 |
return false;
|
532 |
}
|
533 |
|
534 |
+
/**
|
535 |
+
* get completed jobs
|
536 |
+
* - complete, cancelled, error
|
537 |
+
*
|
538 |
+
* @param $job_name
|
539 |
+
* @param int $count
|
540 |
+
*
|
541 |
+
* @return bool
|
542 |
+
*/
|
543 |
+
public static function get_completed_jobs($job_name,$count=25) {
|
544 |
+
$logger = new WPBackItUp_Logger(false,null,'debug_job');
|
545 |
+
$logger->log_info(__METHOD__,'Begin');
|
546 |
+
|
547 |
+
$save_last = 10;
|
548 |
+
$count+=$save_last; //always leave the last n
|
549 |
+
|
550 |
+
$args = array(
|
551 |
+
'posts_per_page' => $count,
|
552 |
+
'post_type' => $job_name,
|
553 |
+
'post_status' => array('complete','cancelled','error'),
|
554 |
+
'orderby' => 'post_date',
|
555 |
+
'order' => 'ASC',
|
556 |
+
'suppress_filters' => true
|
557 |
+
);
|
558 |
+
$jobs = get_posts( $args );
|
559 |
+
|
560 |
+
if (is_array($jobs) && count($jobs)>$save_last) {
|
561 |
+
$logger->log_info(__METHOD__,'Jobs found:' . count($jobs));
|
562 |
+
|
563 |
+
$diff=count($jobs)-$save_last;
|
564 |
+
|
565 |
+
//pull off the last N
|
566 |
+
$rtn_val = array_slice($jobs,0,$diff);
|
567 |
+
return $rtn_val;
|
568 |
+
}
|
569 |
+
|
570 |
+
$logger->log_info(__METHOD__,'No jobs found:' . $job_name);
|
571 |
+
$logger->log_info(__METHOD__,'End');
|
572 |
+
return false;
|
573 |
+
}
|
574 |
+
|
575 |
/**
|
576 |
* Cancel all queued or active jobs
|
577 |
*
|
601 |
$logger->log_info(__METHOD__,'End - All jobs cancelled');
|
602 |
}
|
603 |
|
604 |
+
/**
|
605 |
+
* purge old jobs
|
606 |
+
*
|
607 |
+
* @param $job_name *
|
608 |
+
* @param int $count
|
609 |
+
*
|
610 |
+
* @return bool
|
611 |
+
*/
|
612 |
+
public static function purge_old_jobs($job_name,$count=25) {
|
613 |
+
$logger = new WPBackItUp_Logger(false,null,'debug_job');
|
614 |
+
$logger->log_info(__METHOD__,'Begin - Purge Jobs.');
|
615 |
+
|
616 |
+
$jobs = self::get_completed_jobs($job_name,$count);
|
617 |
+
$purge_count=0;
|
618 |
+
foreach($jobs as $job){
|
619 |
+
$logger->log_info(__METHOD__,'Delete Job:'.$job->ID .':' .$job->post_type .":" .$job->post_title .':' .$job->post_date);
|
620 |
+
wp_delete_post( $job->ID, true );
|
621 |
+
$purge_count+=1;
|
622 |
+
}
|
623 |
+
$logger->log_info(__METHOD__,'End - job purge complete');
|
624 |
+
return $purge_count;
|
625 |
+
}
|
626 |
+
|
627 |
/**
|
628 |
* Gets the queued or active job on top of the stack
|
629 |
*
|
784 |
|
785 |
}
|
786 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
787 |
/**
|
788 |
* @return mixed
|
789 |
*/
|
lib/includes/class-wpbackitup-admin.php
CHANGED
@@ -331,6 +331,9 @@ class WPBackitup_Admin {
|
|
331 |
|
332 |
public function wpbackitup_queue_scheduled_jobs(){
|
333 |
|
|
|
|
|
|
|
334 |
// Check permissions
|
335 |
if (! self::is_authorized()) exit('Access denied.');
|
336 |
|
@@ -346,12 +349,34 @@ class WPBackitup_Admin {
|
|
346 |
|
347 |
|
348 |
//If any jobs are queued or active then just exit
|
349 |
-
if (WPBackItUp_Job::is_job_queued('backup')
|
350 |
-
|
351 |
-
|
|
|
|
|
|
|
|
|
352 |
exit;
|
353 |
}
|
354 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
|
356 |
//Is it time for a backup?
|
357 |
//Check scheduler and queue tasks that need to be run
|
@@ -361,8 +386,11 @@ class WPBackitup_Admin {
|
|
361 |
$backup_job = WPBackItUp_Job::queue_job( 'backup' );
|
362 |
|
363 |
//Setup the job run event
|
364 |
-
|
|
|
|
|
365 |
|
|
|
366 |
exit( 0 ); //success - don't schedule anything else
|
367 |
}
|
368 |
|
@@ -373,12 +401,16 @@ class WPBackitup_Admin {
|
|
373 |
$cleanup_job = WPBackItUp_Job::queue_job( 'cleanup' );
|
374 |
|
375 |
//Setup the job run event
|
376 |
-
|
|
|
|
|
377 |
|
|
|
378 |
exit( 0 ); //success - don't schedule anything else
|
379 |
}
|
380 |
|
381 |
|
|
|
382 |
exit(0); //success nothing to schedule
|
383 |
}
|
384 |
|
331 |
|
332 |
public function wpbackitup_queue_scheduled_jobs(){
|
333 |
|
334 |
+
$logger = new WPBackItUp_Logger(false,null,'debug_scheduled_jobs');
|
335 |
+
$logger->log_info(__METHOD__,'Begin');
|
336 |
+
|
337 |
// Check permissions
|
338 |
if (! self::is_authorized()) exit('Access denied.');
|
339 |
|
349 |
|
350 |
|
351 |
//If any jobs are queued or active then just exit
|
352 |
+
if (WPBackItUp_Job::is_job_queued('backup')) {
|
353 |
+
|
354 |
+
if(!wp_next_scheduled( 'wpbackitup_run_backup_tasks' ) ) {
|
355 |
+
wp_schedule_single_event( time(), 'wpbackitup_run_backup_tasks' );
|
356 |
+
}
|
357 |
+
|
358 |
+
$logger->log_info(__METHOD__,'Backup Job already Queued');
|
359 |
exit;
|
360 |
}
|
361 |
|
362 |
+
//Check cleanup jobs
|
363 |
+
if (WPBackItUp_Job::is_job_queued('cleanup')) {
|
364 |
+
|
365 |
+
if(!wp_next_scheduled( 'wpbackitup_run_cleanup_tasks' ) ) {
|
366 |
+
wp_schedule_single_event( time(), 'wpbackitup_run_cleanup_tasks' );
|
367 |
+
}
|
368 |
+
|
369 |
+
$logger->log_info(__METHOD__,'Cleanup job already Queued');
|
370 |
+
exit;
|
371 |
+
}
|
372 |
+
|
373 |
+
//If any jobs are queued or active then just exit
|
374 |
+
if (WPBackItUp_Job::is_job_queued('restore')) {
|
375 |
+
$logger->log_info(__METHOD__,'Restore Job already Queued');
|
376 |
+
exit;
|
377 |
+
}
|
378 |
+
|
379 |
+
$logger->log_info(__METHOD__,'No jobs already queued.');
|
380 |
|
381 |
//Is it time for a backup?
|
382 |
//Check scheduler and queue tasks that need to be run
|
386 |
$backup_job = WPBackItUp_Job::queue_job( 'backup' );
|
387 |
|
388 |
//Setup the job run event
|
389 |
+
if(!wp_next_scheduled( 'wpbackitup_run_backup_tasks' ) ) {
|
390 |
+
wp_schedule_single_event( time(), 'wpbackitup_run_backup_tasks' );
|
391 |
+
}
|
392 |
|
393 |
+
$logger->log_info(__METHOD__,'Backup job queued to run.');
|
394 |
exit( 0 ); //success - don't schedule anything else
|
395 |
}
|
396 |
|
401 |
$cleanup_job = WPBackItUp_Job::queue_job( 'cleanup' );
|
402 |
|
403 |
//Setup the job run event
|
404 |
+
if(!wp_next_scheduled( 'wpbackitup_run_cleanup_tasks' ) ) {
|
405 |
+
wp_schedule_single_event( time(), 'wpbackitup_run_cleanup_tasks' );
|
406 |
+
}
|
407 |
|
408 |
+
$logger->log_info(__METHOD__,'Cleanup job queued to run.');
|
409 |
exit( 0 ); //success - don't schedule anything else
|
410 |
}
|
411 |
|
412 |
|
413 |
+
$logger->log_info(__METHOD__,'No jobs scheduled to run.');
|
414 |
exit(0); //success nothing to schedule
|
415 |
}
|
416 |
|
lib/includes/class-zip.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php if (!defined ('ABSPATH')) die('No direct access allowed');
|
2 |
* WP BackItUp - Zip Class
|
3 |
*
|
4 |
* @package WP BackItUp
|
5 |
* @author Chris Simmons <chris.simmons@wpbackitup.com>
|
6 |
* @link http://www.wpbackitup.com
|
7 |
*
|
8 |
*/
|
9 |
private $zip_file_count;
|
10 |
$this->zip_file_count=0;
|
11 |
}
|
|
|
12 |
* WP BackItUp - Zip Class
|
13 |
*
|
14 |
* @package WP BackItUp
|
15 |
* @author Chris Simmons <chris.simmons@wpbackitup.com>
|
16 |
* @link http://www.wpbackitup.com
|
17 |
*
|
18 |
*/
|
19 |
private $zip_file_count;
|
20 |
$this->zip_file_count=0;
|
21 |
}
|
|
|
1 |
* WP BackItUp - Zip Class
|
2 |
*
|
3 |
* @package WP BackItUp
|
4 |
* @author Chris Simmons <chris.simmons@wpbackitup.com>
|
5 |
* @link http://www.wpbackitup.com
|
6 |
*
|
7 |
*/
|
8 |
private $zip_file_count;
|
9 |
$this->zip_file_count=0;
|
10 |
}
|
11 |
+
<?php if (!defined ('ABSPATH')) die('No direct access allowed');
|
12 |
* WP BackItUp - Zip Class
|
13 |
*
|
14 |
* @package WP BackItUp
|
15 |
* @author Chris Simmons <chris.simmons@wpbackitup.com>
|
16 |
* @link http://www.wpbackitup.com
|
17 |
*
|
18 |
*/
|
19 |
private $zip_file_count;
|
20 |
$this->zip_file_count=0;
|
21 |
}
|
lib/includes/job_backup.php
CHANGED
@@ -293,20 +293,24 @@ if ('task_preparing'==$current_task) {
|
|
293 |
$plugins_file_list = $wp_backup->get_plugins_file_list();
|
294 |
$backup_job->update_job_meta('backup_plugins_filelist',$plugins_file_list);
|
295 |
$backup_job->update_job_meta('backup_plugins_filelist_remaining',$plugins_file_list);
|
|
|
296 |
|
297 |
$themes_file_list = $wp_backup->get_themes_file_list();
|
298 |
$backup_job->update_job_meta('backup_themes_filelist',$themes_file_list);
|
299 |
$backup_job->update_job_meta('backup_themes_filelist_remaining',$themes_file_list);
|
|
|
300 |
|
301 |
//some folders excluded
|
302 |
$uploads_file_list = $wp_backup->get_uploads_file_list();
|
303 |
$backup_job->update_job_meta('backup_uploads_filelist',$uploads_file_list);
|
304 |
$backup_job->update_job_meta('backup_uploads_filelist_remaining',$uploads_file_list);
|
|
|
305 |
|
306 |
//some folders excluded
|
307 |
$others_file_list = $wp_backup->get_other_file_list();
|
308 |
$backup_job->update_job_meta('backup_others_filelist',$others_file_list);
|
309 |
$backup_job->update_job_meta('backup_others_filelist_remaining',$others_file_list);
|
|
|
310 |
|
311 |
|
312 |
set_status('preparing',$complete,false);
|
@@ -657,8 +661,11 @@ $wp_backup->set_final_backup_path();
|
|
657 |
|
658 |
if ($backup_job->get_job_status()=='complete') {
|
659 |
//SUCCESS- End Job!
|
660 |
-
|
|
|
661 |
write_response_file_success();
|
|
|
|
|
662 |
$WPBackitup->increment_successful_backup_count();
|
663 |
end_backup( null, true );
|
664 |
}
|
293 |
$plugins_file_list = $wp_backup->get_plugins_file_list();
|
294 |
$backup_job->update_job_meta('backup_plugins_filelist',$plugins_file_list);
|
295 |
$backup_job->update_job_meta('backup_plugins_filelist_remaining',$plugins_file_list);
|
296 |
+
$plugins_file_list=null;
|
297 |
|
298 |
$themes_file_list = $wp_backup->get_themes_file_list();
|
299 |
$backup_job->update_job_meta('backup_themes_filelist',$themes_file_list);
|
300 |
$backup_job->update_job_meta('backup_themes_filelist_remaining',$themes_file_list);
|
301 |
+
$themes_file_list=null;
|
302 |
|
303 |
//some folders excluded
|
304 |
$uploads_file_list = $wp_backup->get_uploads_file_list();
|
305 |
$backup_job->update_job_meta('backup_uploads_filelist',$uploads_file_list);
|
306 |
$backup_job->update_job_meta('backup_uploads_filelist_remaining',$uploads_file_list);
|
307 |
+
$uploads_file_list=null;
|
308 |
|
309 |
//some folders excluded
|
310 |
$others_file_list = $wp_backup->get_other_file_list();
|
311 |
$backup_job->update_job_meta('backup_others_filelist',$others_file_list);
|
312 |
$backup_job->update_job_meta('backup_others_filelist_remaining',$others_file_list);
|
313 |
+
$others_file_list=null;
|
314 |
|
315 |
|
316 |
set_status('preparing',$complete,false);
|
661 |
|
662 |
if ($backup_job->get_job_status()=='complete') {
|
663 |
//SUCCESS- End Job!
|
664 |
+
|
665 |
+
//write response file first to make sure it is there
|
666 |
write_response_file_success();
|
667 |
+
set_status_success();
|
668 |
+
|
669 |
$WPBackitup->increment_successful_backup_count();
|
670 |
end_backup( null, true );
|
671 |
}
|
lib/includes/job_cleanup.php
CHANGED
@@ -192,8 +192,15 @@ if ('task_scheduled_cleanup'==$current_task) {
|
|
192 |
$file_system->secure_folder( $logs_dir);
|
193 |
$logger->log( '**END SECURE FOLDERS**' );
|
194 |
|
195 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
|
|
|
197 |
}
|
198 |
|
199 |
end_job(null,true);
|
192 |
$file_system->secure_folder( $logs_dir);
|
193 |
$logger->log( '**END SECURE FOLDERS**' );
|
194 |
|
195 |
+
$logger->log( '**CLEANUP OLD JOBS**' );
|
196 |
+
$backup_job_purge_count = WPBackItUp_Job::purge_old_jobs('backup',25);
|
197 |
+
$logger->log( 'Backup job records purged:' .$backup_job_purge_count );
|
198 |
+
|
199 |
+
$cleanup_job_purge_count = WPBackItUp_Job::purge_old_jobs('cleanup',25);
|
200 |
+
$logger->log( 'Cleanup job records purged:' .$cleanup_job_purge_count );
|
201 |
+
$logger->log( '**END CLEANUP OLD JOBS**' );
|
202 |
|
203 |
+
$cleanup_job->set_task_complete();
|
204 |
}
|
205 |
|
206 |
end_job(null,true);
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.wpbackitup.com
|
|
4 |
Tags: backup, back up, backups, backup wordpress, backup database, backup plugin, backup and restore, database, database backup, database restore, db, db backup, db restore, download database, full backup, mysql backup, restore, restore database,restore wordpress, restore wordpress backup,restoring wordpress, website backup, wordpress backup, wordpress restore, plugin, backup buddy
|
5 |
Requires at least: 3.8.0
|
6 |
Tested up to: 4.1.1
|
7 |
-
Stable tag: 1.10.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -151,6 +151,15 @@ Our online documentation and full list of FAQs can be found at [www.wpbackitup.c
|
|
151 |
|
152 |
|
153 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
= 1.10.5 =
|
155 |
* UPDATE: Change support request to forward to new support email address.
|
156 |
* UPDATE: Leave copy of log in logs folder so when included when support logs are sent
|
4 |
Tags: backup, back up, backups, backup wordpress, backup database, backup plugin, backup and restore, database, database backup, database restore, db, db backup, db restore, download database, full backup, mysql backup, restore, restore database,restore wordpress, restore wordpress backup,restoring wordpress, website backup, wordpress backup, wordpress restore, plugin, backup buddy
|
5 |
Requires at least: 3.8.0
|
6 |
Tested up to: 4.1.1
|
7 |
+
Stable tag: 1.10.5
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
151 |
|
152 |
|
153 |
== Changelog ==
|
154 |
+
= 1.10.6 =
|
155 |
+
* FEATURE:Add job data to cleanup routine
|
156 |
+
* FIX: Add wp-cron task on schedule check to fix issue with sheduled backups not running.
|
157 |
+
* FIX: Write response file before status update.
|
158 |
+
* UPDATE: Cancel all scheduled jobs on plugin activation & deactivation.
|
159 |
+
* UPDATE: Add additional logging to job scheduler.
|
160 |
+
* UPDATE: Add additional logging to manifest creation.
|
161 |
+
* UPDATE: Add additional logging to add files to backup.
|
162 |
+
|
163 |
= 1.10.5 =
|
164 |
* UPDATE: Change support request to forward to new support email address.
|
165 |
* UPDATE: Leave copy of log in logs folder so when included when support logs are sent
|
wp-backitup.php
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
Plugin Name: WP Backitup
|
14 |
Plugin URI: http://www.wpbackitup.com
|
15 |
Description: Backup your content, settings, themes, plugins and media in just a few simple clicks.
|
16 |
-
Version: 1.10.
|
17 |
Author: Chris Simmons
|
18 |
Author URI: http://www.wpbackitup.com
|
19 |
License: GPL3
|
@@ -35,7 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
35 |
*/
|
36 |
|
37 |
define( 'WPBACKITUP__NAMESPACE', 'wp-backitup' );
|
38 |
-
define( 'WPBACKITUP__VERSION', '1.10.
|
39 |
define( 'WPBACKITUP__DEBUG', false );
|
40 |
define( 'WPBACKITUP__MINIMUM_WP_VERSION', '3.0' );
|
41 |
define( 'WPBACKITUP__ITEM_NAME', 'WP Backitup' );
|
@@ -121,6 +121,13 @@ function wpbackitup_custom_post_status(){
|
|
121 |
'show_in_admin_status_list' => true,
|
122 |
));
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
}
|
125 |
add_action( 'init', 'wpbackitup_custom_post_status' );
|
126 |
|
13 |
Plugin Name: WP Backitup
|
14 |
Plugin URI: http://www.wpbackitup.com
|
15 |
Description: Backup your content, settings, themes, plugins and media in just a few simple clicks.
|
16 |
+
Version: 1.10.6
|
17 |
Author: Chris Simmons
|
18 |
Author URI: http://www.wpbackitup.com
|
19 |
License: GPL3
|
35 |
*/
|
36 |
|
37 |
define( 'WPBACKITUP__NAMESPACE', 'wp-backitup' );
|
38 |
+
define( 'WPBACKITUP__VERSION', '1.10.6');
|
39 |
define( 'WPBACKITUP__DEBUG', false );
|
40 |
define( 'WPBACKITUP__MINIMUM_WP_VERSION', '3.0' );
|
41 |
define( 'WPBACKITUP__ITEM_NAME', 'WP Backitup' );
|
121 |
'show_in_admin_status_list' => true,
|
122 |
));
|
123 |
|
124 |
+
register_post_status( 'cancelled', array(
|
125 |
+
'public' => false,
|
126 |
+
'exclude_from_search' => false,
|
127 |
+
'show_in_admin_all_list' => false,
|
128 |
+
'show_in_admin_status_list' => true,
|
129 |
+
));
|
130 |
+
|
131 |
}
|
132 |
add_action( 'init', 'wpbackitup_custom_post_status' );
|
133 |
|