Version Description
Release date: Feb 14th, 2019
- New feature: Added WP-CLI support for backup schedule.
- Update: Change thickbox background color to inform user something is loading.
- Update: Misc updates required for next version of BoldGrid Backup Premium.
Download this release
Release Info
Developer | boldgrid |
Plugin | Total Upkeep – WordPress Backup Plugin plus Restore & Migrate by BoldGrid |
Version | 1.8.0 |
Comparing to | |
See all releases |
Code changes from version 1.7.2 to 1.8.0
- admin/class-boldgrid-backup-admin-archive.php +28 -0
- admin/class-boldgrid-backup-admin-core.php +3 -1
- admin/class-boldgrid-backup-admin-settings.php +28 -10
- admin/class-boldgrid-backup-admin-wpcli.php +247 -0
- admin/css/boldgrid-backup-admin.css +5 -0
- admin/partials/archive-details/remote-storage.php +1 -1
- admin/partials/settings/storage-location.php +8 -1
- admin/partials/settings/time-of-day.php +1 -1
- boldgrid-backup.php +1 -1
- includes/class-boldgrid-backup.php +10 -1
- readme.txt +9 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +7 -7
- vendor/composer/autoload_static.php +4 -4
admin/class-boldgrid-backup-admin-archive.php
CHANGED
@@ -83,6 +83,16 @@ class Boldgrid_Backup_Admin_Archive {
|
|
83 |
*/
|
84 |
public $log_filepath = null;
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
/**
|
87 |
* URL to the details page of this backup.
|
88 |
*
|
@@ -224,6 +234,8 @@ class Boldgrid_Backup_Admin_Archive {
|
|
224 |
|
225 |
if ( $have_log ) {
|
226 |
$this->log = $this->core->archive_log->get_by_zip( $this->filepath );
|
|
|
|
|
227 |
}
|
228 |
|
229 |
/*
|
@@ -237,6 +249,22 @@ class Boldgrid_Backup_Admin_Archive {
|
|
237 |
$this->view_details_url = admin_url( 'admin.php?page=boldgrid-backup-archive-details&filename=' . $this->filename );
|
238 |
}
|
239 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
/**
|
241 |
* Determine if a zip file is in our archive.
|
242 |
*
|
83 |
*/
|
84 |
public $log_filepath = null;
|
85 |
|
86 |
+
/**
|
87 |
+
* The unix timestamp of the backup file.
|
88 |
+
*
|
89 |
+
* Not the date the backup was created (though it should be), just the date created timestamp.
|
90 |
+
*
|
91 |
+
* @since 1.7.3
|
92 |
+
* @var string
|
93 |
+
*/
|
94 |
+
public $timestamp = 0;
|
95 |
+
|
96 |
/**
|
97 |
* URL to the details page of this backup.
|
98 |
*
|
234 |
|
235 |
if ( $have_log ) {
|
236 |
$this->log = $this->core->archive_log->get_by_zip( $this->filepath );
|
237 |
+
|
238 |
+
$this->timestamp = empty( $this->log['lastmodunix'] ) ? 0 : $this->log['lastmodunix'];
|
239 |
}
|
240 |
|
241 |
/*
|
249 |
$this->view_details_url = admin_url( 'admin.php?page=boldgrid-backup-archive-details&filename=' . $this->filename );
|
250 |
}
|
251 |
|
252 |
+
/**
|
253 |
+
* Init an archive based on filename.
|
254 |
+
*
|
255 |
+
* This method's init() function requires a full filepath. This method is a helper function that
|
256 |
+
* inits based on filename instead.
|
257 |
+
*
|
258 |
+
* @since 1.7.3
|
259 |
+
*
|
260 |
+
* @param string $filename
|
261 |
+
*/
|
262 |
+
public function init_by_filename( $filename ) {
|
263 |
+
$filepath = $this->core->backup_dir->get_path_to( $filename );
|
264 |
+
|
265 |
+
$this->init( $filepath );
|
266 |
+
}
|
267 |
+
|
268 |
/**
|
269 |
* Determine if a zip file is in our archive.
|
270 |
*
|
admin/class-boldgrid-backup-admin-core.php
CHANGED
@@ -1802,7 +1802,7 @@ class Boldgrid_Backup_Admin_Core {
|
|
1802 |
// Stop timer.
|
1803 |
$time_stop = microtime( true );
|
1804 |
|
1805 |
-
// Calculate duration.
|
1806 |
$info['duration'] = number_format( ( $time_stop - $time_start ), 2, '.', '' );
|
1807 |
$info['db_duration'] = number_format( ( $db_time_stop - $time_start ), 2, '.', '' );
|
1808 |
|
@@ -1857,6 +1857,8 @@ class Boldgrid_Backup_Admin_Core {
|
|
1857 |
|
1858 |
$this->archive_log->write( $info );
|
1859 |
|
|
|
|
|
1860 |
// Enforce retention setting.
|
1861 |
$this->enforce_retention();
|
1862 |
|
1802 |
// Stop timer.
|
1803 |
$time_stop = microtime( true );
|
1804 |
|
1805 |
+
// Calculate duration and MD5.
|
1806 |
$info['duration'] = number_format( ( $time_stop - $time_start ), 2, '.', '' );
|
1807 |
$info['db_duration'] = number_format( ( $db_time_stop - $time_start ), 2, '.', '' );
|
1808 |
|
1857 |
|
1858 |
$this->archive_log->write( $info );
|
1859 |
|
1860 |
+
$info['file_md5'] = md5_file( $info['filepath'] );
|
1861 |
+
|
1862 |
// Enforce retention setting.
|
1863 |
$this->enforce_retention();
|
1864 |
|
admin/class-boldgrid-backup-admin-settings.php
CHANGED
@@ -456,16 +456,10 @@ class Boldgrid_Backup_Admin_Settings {
|
|
456 |
*
|
457 |
* @since 1.5.1
|
458 |
*/
|
459 |
-
$
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
$crons_added = $this->core->cron->add_all_crons( $settings );
|
464 |
-
$settings['crontab_version'] = $this->core->cron->crontab_version;
|
465 |
-
$settings['cron_secret'] = $this->core->cron->get_cron_secret();
|
466 |
-
}
|
467 |
-
// Take action if we tried and failed to add crons.
|
468 |
-
if ( isset( $crons_added ) && ! $crons_added ) {
|
469 |
$update_error = true;
|
470 |
$update_errors[] = esc_html__( 'An error occurred when modifying cron jobs. Please try again.', 'boldgrid-backup' );
|
471 |
}
|
@@ -729,4 +723,28 @@ class Boldgrid_Backup_Admin_Settings {
|
|
729 |
public function save( $settings ) {
|
730 |
return update_site_option( 'boldgrid_backup_settings', $settings );
|
731 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
732 |
}
|
456 |
*
|
457 |
* @since 1.5.1
|
458 |
*/
|
459 |
+
$settings = $this->update_cron( $settings );
|
460 |
+
|
461 |
+
// Add a notice if we tried and failed to add crons.
|
462 |
+
if ( ! $settings['crons_added'] ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
463 |
$update_error = true;
|
464 |
$update_errors[] = esc_html__( 'An error occurred when modifying cron jobs. Please try again.', 'boldgrid-backup' );
|
465 |
}
|
723 |
public function save( $settings ) {
|
724 |
return update_site_option( 'boldgrid_backup_settings', $settings );
|
725 |
}
|
726 |
+
|
727 |
+
/**
|
728 |
+
* Update CRON jobs.
|
729 |
+
*
|
730 |
+
* @since 1.8.0
|
731 |
+
*
|
732 |
+
* @param array $settings BoldGrid Backup settings.
|
733 |
+
* @return array
|
734 |
+
*/
|
735 |
+
public function update_cron( array $settings ) {
|
736 |
+
$settings['crons_added'] = false;
|
737 |
+
|
738 |
+
$scheduler = ! empty( $settings['scheduler'] ) ? $settings['scheduler'] : null;
|
739 |
+
|
740 |
+
if ( 'wp-cron' === $scheduler ) {
|
741 |
+
$settings['crons_added'] = $this->core->wp_cron->add_all_crons( $settings );
|
742 |
+
} elseif ( 'cron' === $scheduler ) {
|
743 |
+
$settings['crons_added'] = $this->core->cron->add_all_crons( $settings );
|
744 |
+
$settings['crontab_version'] = $this->core->cron->crontab_version;
|
745 |
+
$settings['cron_secret'] = $this->core->cron->get_cron_secret();
|
746 |
+
}
|
747 |
+
|
748 |
+
return $settings;
|
749 |
+
}
|
750 |
}
|
admin/class-boldgrid-backup-admin-wpcli.php
ADDED
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-boldgrid-backup-admin-wpcli.php
|
4 |
+
*
|
5 |
+
* @link https://www.boldgrid.com
|
6 |
+
* @since 1.8.0
|
7 |
+
*
|
8 |
+
* @package Boldgrid_Backup
|
9 |
+
* @subpackage Boldgrid_Backup/admin
|
10 |
+
* @copyright BoldGrid
|
11 |
+
* @version $Id$
|
12 |
+
* @author BoldGrid <support@boldgrid.com>
|
13 |
+
*/
|
14 |
+
|
15 |
+
// phpcs:disable WordPress.XSS.EscapeOutput.OutputNotEscaped
|
16 |
+
|
17 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
18 |
+
die();
|
19 |
+
}
|
20 |
+
|
21 |
+
if ( ! defined( 'WP_CLI' ) ) {
|
22 |
+
return;
|
23 |
+
}
|
24 |
+
|
25 |
+
WP_CLI::add_command( 'bgbkup', 'Boldgrid_Backup_Admin_Wpcli' );
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Perform actions for BoldGrid Backup.
|
29 |
+
*
|
30 |
+
* ## EXAMPLES
|
31 |
+
*
|
32 |
+
* # Show the configured backup schedule
|
33 |
+
* $ wp bgbkup schedule show
|
34 |
+
* Backup schedule: Sunday, Wednesday at 3:11 AM (WordPress timezone: America/New_York / UTC -5)
|
35 |
+
* Success: Schedule listed.
|
36 |
+
*
|
37 |
+
* # Clear the backup schedule
|
38 |
+
* $ wp bgbkup schedule clear
|
39 |
+
* Success: Schedule cleared.
|
40 |
+
*
|
41 |
+
* # Set the backup schedule
|
42 |
+
* $ wp bgbkup schedule set --days=0,3 --time=0311
|
43 |
+
* Success: Schedule set.
|
44 |
+
*
|
45 |
+
* @since 1.8.0
|
46 |
+
*/
|
47 |
+
class Boldgrid_Backup_Admin_Wpcli {
|
48 |
+
/**
|
49 |
+
* Boldgrid_Backup_Admin_Core object.
|
50 |
+
*
|
51 |
+
* @since 1.8.0
|
52 |
+
*
|
53 |
+
* @var Boldgrid_Backup_Admin_Core
|
54 |
+
* @staticvar
|
55 |
+
*/
|
56 |
+
public static $core;
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Print the backup schedule.
|
60 |
+
*
|
61 |
+
* ## OPTIONS
|
62 |
+
*
|
63 |
+
* clear: Clear the backup schedule.
|
64 |
+
* list: Print the backup schedule. (default command)
|
65 |
+
* set: Set the backup schedule. Day numbers (0-6: Sunday-Saturday, comma-delimited) and time of day (uses the timezone set in WordPress). PHP strtotime() is used when setting the time value.
|
66 |
+
* show: Alias for `list`.
|
67 |
+
*
|
68 |
+
* ## EXAMPLES
|
69 |
+
*
|
70 |
+
* # Show the configured backup schedule
|
71 |
+
* $ wp bgbkup schedule show
|
72 |
+
* Backup schedule: Sunday, Wednesday at 3:11 AM (WordPress timezone: America/New_York / UTC -5)
|
73 |
+
* Success: Schedule listed.
|
74 |
+
*
|
75 |
+
* # Clear the backup schedule
|
76 |
+
* $ wp bgbkup schedule clear
|
77 |
+
* Success: Schedule cleared.
|
78 |
+
*
|
79 |
+
* # Set the backup schedule
|
80 |
+
* $ wp bgbkup schedule set --days=0,3 --time=0311
|
81 |
+
* Success: Schedule set.
|
82 |
+
*
|
83 |
+
* @param array $args Array of arguments.
|
84 |
+
* @param array $assoc_args Associative array of arguments.
|
85 |
+
*/
|
86 |
+
public function schedule( array $args = [], array $assoc_args = [] ) {
|
87 |
+
$cmd = isset( $args[0] ) ? $args[0] : null;
|
88 |
+
|
89 |
+
switch ( $cmd ) {
|
90 |
+
case 'clear':
|
91 |
+
$this->schedule_clear();
|
92 |
+
WP_CLI::success( __( 'Schedule cleared.', 'boldgrid-backup' ) );
|
93 |
+
break;
|
94 |
+
case 'show':
|
95 |
+
$this->schedule_list();
|
96 |
+
WP_CLI::success( __( 'Schedule listed.', 'boldgrid-backup' ) );
|
97 |
+
break;
|
98 |
+
case 'list':
|
99 |
+
$this->schedule_list();
|
100 |
+
WP_CLI::success( __( 'Schedule listed.', 'boldgrid-backup' ) );
|
101 |
+
break;
|
102 |
+
case 'set':
|
103 |
+
if ( $this->schedule_set( $assoc_args ) ) {
|
104 |
+
WP_CLI::success( __( 'Schedule set.', 'boldgrid-backup' ) );
|
105 |
+
} else {
|
106 |
+
WP_CLI::error( __( 'Could not set schedule. Check syntax.', 'boldgrid-backup' ) );
|
107 |
+
}
|
108 |
+
break;
|
109 |
+
case null:
|
110 |
+
WP_CLI::runcommand( 'help bgbkup schedule' );
|
111 |
+
break;
|
112 |
+
default:
|
113 |
+
// Translators: 1: WP-CLI command.
|
114 |
+
WP_CLI::error( sprintf( __( '"%s" is not a valid command.', 'boldgrid-backup' ), $cmd ) );
|
115 |
+
break;
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Clear the backup schedule.
|
121 |
+
*
|
122 |
+
* @since 1.8.0
|
123 |
+
* @access protected
|
124 |
+
*
|
125 |
+
* @subcommand clear
|
126 |
+
*/
|
127 |
+
protected function schedule_clear() {
|
128 |
+
$settings = self::$core->settings->get_settings();
|
129 |
+
|
130 |
+
$settings['schedule'] = null;
|
131 |
+
|
132 |
+
self::$core->scheduler->clear_all_schedules();
|
133 |
+
self::$core->settings->save( $settings );
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Print the backup schedule.
|
138 |
+
*
|
139 |
+
* @since 1.8.0
|
140 |
+
* @access protected
|
141 |
+
*
|
142 |
+
* @subcommand list
|
143 |
+
* @subcommand show
|
144 |
+
*/
|
145 |
+
protected function schedule_list() {
|
146 |
+
$backup_days = [];
|
147 |
+
$settings = self::$core->settings->get_settings();
|
148 |
+
|
149 |
+
if ( $settings['schedule']['dow_sunday'] ) {
|
150 |
+
$backup_days[] = __( 'Sunday', 'boldgrid-backup' );
|
151 |
+
}
|
152 |
+
if ( $settings['schedule']['dow_monday'] ) {
|
153 |
+
$backup_days[] = __( 'Monday', 'boldgrid-backup' );
|
154 |
+
}
|
155 |
+
if ( $settings['schedule']['dow_tuesday'] ) {
|
156 |
+
$backup_days[] = __( 'Tuesday', 'boldgrid-backup' );
|
157 |
+
}
|
158 |
+
if ( $settings['schedule']['dow_wednesday'] ) {
|
159 |
+
$backup_days[] = __( 'Wednesday', 'boldgrid-backup' );
|
160 |
+
}
|
161 |
+
if ( $settings['schedule']['dow_thursday'] ) {
|
162 |
+
$backup_days[] = __( 'Thursday', 'boldgrid-backup' );
|
163 |
+
}
|
164 |
+
if ( $settings['schedule']['dow_friday'] ) {
|
165 |
+
$backup_days[] = __( 'Friday', 'boldgrid-backup' );
|
166 |
+
}
|
167 |
+
if ( $settings['schedule']['dow_saturday'] ) {
|
168 |
+
$backup_days[] = __( 'Saturday', 'boldgrid-backup' );
|
169 |
+
}
|
170 |
+
|
171 |
+
$backup_days = implode( ', ', $backup_days );
|
172 |
+
$backup_days = $backup_days ? $backup_days : 'None';
|
173 |
+
|
174 |
+
echo 'Backup schedule: ' . $backup_days;
|
175 |
+
|
176 |
+
if ( 'None' !== $backup_days ) {
|
177 |
+
$has_tod = isset(
|
178 |
+
$settings['schedule']['tod_h'],
|
179 |
+
$settings['schedule']['tod_m'],
|
180 |
+
$settings['schedule']['tod_a']
|
181 |
+
);
|
182 |
+
|
183 |
+
if ( $has_tod ) {
|
184 |
+
echo __( ' at ', 'boldgrid-backup' ) . $settings['schedule']['tod_h'] . ':' .
|
185 |
+
$settings['schedule']['tod_m'] . ' ' . $settings['schedule']['tod_a'] .
|
186 |
+
__( ' (WordPress timezone: ', 'boldgrid-backup' ) .
|
187 |
+
get_option( 'timezone_string' ) . ' / UTC ' . get_option( 'gmt_offset' ) . ')';
|
188 |
+
} else {
|
189 |
+
esc_html_e( ' at unknown time', 'boldgrid-backup' );
|
190 |
+
}
|
191 |
+
}
|
192 |
+
|
193 |
+
echo PHP_EOL;
|
194 |
+
}
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Set the backup schedule.
|
198 |
+
*
|
199 |
+
* @since 1.8.0
|
200 |
+
* @access protected
|
201 |
+
*
|
202 |
+
* @subsommand set
|
203 |
+
*
|
204 |
+
* @param array $assoc_args Associative array of arguments.
|
205 |
+
* @return bool
|
206 |
+
*/
|
207 |
+
protected function schedule_set( array $assoc_args ) {
|
208 |
+
if ( ! isset( $assoc_args['days'], $assoc_args['time'] ) ) {
|
209 |
+
return false;
|
210 |
+
}
|
211 |
+
|
212 |
+
$days = explode( ',', $assoc_args['days'] );
|
213 |
+
$time = strtotime( $assoc_args['time'] );
|
214 |
+
|
215 |
+
if ( ! $time ) {
|
216 |
+
return false;
|
217 |
+
}
|
218 |
+
|
219 |
+
// Ensure that all of the day numbers are valid.
|
220 |
+
foreach ( $days as $day ) {
|
221 |
+
if ( ! preg_match( '/^[0-6]$/', $day ) ) {
|
222 |
+
return false;
|
223 |
+
}
|
224 |
+
}
|
225 |
+
|
226 |
+
$settings = self::$core->settings->get_settings();
|
227 |
+
|
228 |
+
$settings['schedule'] = [
|
229 |
+
'dow_sunday' => in_array( '0', $days, true ) ? 1 : 0,
|
230 |
+
'dow_monday' => in_array( '1', $days, true ) ? 1 : 0,
|
231 |
+
'dow_tuesday' => in_array( '2', $days, true ) ? 1 : 0,
|
232 |
+
'dow_wednesday' => in_array( '3', $days, true ) ? 1 : 0,
|
233 |
+
'dow_thursday' => in_array( '4', $days, true ) ? 1 : 0,
|
234 |
+
'dow_friday' => in_array( '5', $days, true ) ? 1 : 0,
|
235 |
+
'dow_saturday' => in_array( '6', $days, true ) ? 1 : 0,
|
236 |
+
'tod_h' => (int) date( 'g', $time ),
|
237 |
+
'tod_m' => date( 'i', $time ),
|
238 |
+
'tod_a' => date( 'A', $time ),
|
239 |
+
];
|
240 |
+
|
241 |
+
$settings = self::$core->settings->update_cron( $settings );
|
242 |
+
|
243 |
+
self::$core->settings->save( $settings );
|
244 |
+
|
245 |
+
return $settings['crons_added'];
|
246 |
+
}
|
247 |
+
}
|
admin/css/boldgrid-backup-admin.css
CHANGED
@@ -34,6 +34,11 @@ th .help[data-id] {
|
|
34 |
display: inline-block;
|
35 |
}
|
36 |
|
|
|
|
|
|
|
|
|
|
|
37 |
/* Prevent clicks on disabled links. */
|
38 |
a[disabled] {
|
39 |
pointer-events: none;
|
34 |
display: inline-block;
|
35 |
}
|
36 |
|
37 |
+
/* While thickbox is loading, show something rather than nothing. */
|
38 |
+
#TB_iframeContent {
|
39 |
+
background: #f1f1f1;
|
40 |
+
}
|
41 |
+
|
42 |
/* Prevent clicks on disabled links. */
|
43 |
a[disabled] {
|
44 |
pointer-events: none;
|
admin/partials/archive-details/remote-storage.php
CHANGED
@@ -68,7 +68,7 @@ foreach ( $this->remote_storage_li as $provider ) {
|
|
68 |
'Please go to your %1$ssettings page%2$s to configure %3$s.',
|
69 |
'boldgrid-backup'
|
70 |
),
|
71 |
-
'<a target="_parent" href="admin.php?page=boldgrid-backup-settings">',
|
72 |
'</a>',
|
73 |
$provider['title']
|
74 |
);
|
68 |
'Please go to your %1$ssettings page%2$s to configure %3$s.',
|
69 |
'boldgrid-backup'
|
70 |
),
|
71 |
+
'<a target="_parent" href="admin.php?page=boldgrid-backup-settings§ion=section_storage">',
|
72 |
'</a>',
|
73 |
$provider['title']
|
74 |
);
|
admin/partials/settings/storage-location.php
CHANGED
@@ -32,10 +32,17 @@ defined( 'WPINC' ) || die;
|
|
32 |
|
33 |
$configure = '';
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
$configure_link = '<a href="%1$s&TB_iframe=true&width=600&height=550" class="thickbox">%2$s</a>';
|
36 |
|
37 |
if ( $location['is_setup'] && ! empty( $location['configure'] ) ) {
|
38 |
-
$configure
|
39 |
$configure .= ' (' . sprintf( $configure_link, $location['configure'], __( 'update', 'boldgrid-backup' ) ) . ')';
|
40 |
} elseif ( ! empty( $location['configure'] ) ) {
|
41 |
$configure .= sprintf( $configure_link, $location['configure'], __( 'Configure', 'boldgrid-backup' ) );
|
32 |
|
33 |
$configure = '';
|
34 |
|
35 |
+
// Some storage locations need to be authorized, such as Google Drive.
|
36 |
+
if ( ! empty( $location['authorized'] ) ) {
|
37 |
+
$configure = sprintf( '✓ %1$s | ', __( 'Authorized', 'boldgrid-backup' ) );
|
38 |
+
} elseif ( ! empty( $location['authorize'] ) ) {
|
39 |
+
$configure .= '<a href="' . esc_url( $location['authorize'] ) . '">' . __( 'Authorize', 'boldgrid-backup' ) . '</a> | ';
|
40 |
+
}
|
41 |
+
|
42 |
$configure_link = '<a href="%1$s&TB_iframe=true&width=600&height=550" class="thickbox">%2$s</a>';
|
43 |
|
44 |
if ( $location['is_setup'] && ! empty( $location['configure'] ) ) {
|
45 |
+
$configure .= sprintf( '✓ %1$s', __( 'Configured', 'boldgrid-backup' ) );
|
46 |
$configure .= ' (' . sprintf( $configure_link, $location['configure'], __( 'update', 'boldgrid-backup' ) ) . ')';
|
47 |
} elseif ( ! empty( $location['configure'] ) ) {
|
48 |
$configure .= sprintf( $configure_link, $location['configure'], __( 'Configure', 'boldgrid-backup' ) );
|
admin/partials/settings/time-of-day.php
CHANGED
@@ -30,7 +30,7 @@ ob_start();
|
|
30 |
?>
|
31 |
<option value='<?php echo esc_attr( $x ); ?>'
|
32 |
<?php
|
33 |
-
if ( ! empty( $settings['schedule']['tod_h'] ) && $x
|
34 |
echo ' selected';
|
35 |
}
|
36 |
?>
|
30 |
?>
|
31 |
<option value='<?php echo esc_attr( $x ); ?>'
|
32 |
<?php
|
33 |
+
if ( ! empty( $settings['schedule']['tod_h'] ) && $x == $settings['schedule']['tod_h'] ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
|
34 |
echo ' selected';
|
35 |
}
|
36 |
?>
|
boldgrid-backup.php
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
* Plugin Name: BoldGrid Backup
|
17 |
* Plugin URI: https://www.boldgrid.com/boldgrid-backup/
|
18 |
* Description: BoldGrid Backup provides WordPress backup and restoration with update protection.
|
19 |
-
* Version: 1.
|
20 |
* Author: BoldGrid
|
21 |
* Author URI: https://www.boldgrid.com/
|
22 |
* License: GPL-2.0+
|
16 |
* Plugin Name: BoldGrid Backup
|
17 |
* Plugin URI: https://www.boldgrid.com/boldgrid-backup/
|
18 |
* Description: BoldGrid Backup provides WordPress backup and restoration with update protection.
|
19 |
+
* Version: 1.8.0
|
20 |
* Author: BoldGrid
|
21 |
* Author URI: https://www.boldgrid.com/
|
22 |
* License: GPL-2.0+
|
includes/class-boldgrid-backup.php
CHANGED
@@ -89,7 +89,6 @@ class Boldgrid_Backup {
|
|
89 |
* @access private
|
90 |
*/
|
91 |
private function load_dependencies() {
|
92 |
-
|
93 |
require_once BOLDGRID_BACKUP_PATH . '/vendor/autoload.php';
|
94 |
|
95 |
/**
|
@@ -224,6 +223,11 @@ class Boldgrid_Backup {
|
|
224 |
require_once BOLDGRID_BACKUP_PATH . '/includes/class-boldgrid-backup-download.php';
|
225 |
require_once BOLDGRID_BACKUP_PATH . '/includes/class-boldgrid-backup-file.php';
|
226 |
|
|
|
|
|
|
|
|
|
|
|
227 |
$this->loader = new Boldgrid_Backup_Loader();
|
228 |
}
|
229 |
|
@@ -257,6 +261,11 @@ class Boldgrid_Backup {
|
|
257 |
// Instantiate the admin core.
|
258 |
$plugin_admin_core = new Boldgrid_Backup_Admin_Core();
|
259 |
|
|
|
|
|
|
|
|
|
|
|
260 |
// Add nav menu items.
|
261 |
$this->loader->add_action(
|
262 |
'admin_menu', $plugin_admin_core,
|
89 |
* @access private
|
90 |
*/
|
91 |
private function load_dependencies() {
|
|
|
92 |
require_once BOLDGRID_BACKUP_PATH . '/vendor/autoload.php';
|
93 |
|
94 |
/**
|
223 |
require_once BOLDGRID_BACKUP_PATH . '/includes/class-boldgrid-backup-download.php';
|
224 |
require_once BOLDGRID_BACKUP_PATH . '/includes/class-boldgrid-backup-file.php';
|
225 |
|
226 |
+
// WP-CLI support.
|
227 |
+
if ( defined( 'WP_CLI' ) && WP_CLI ) {
|
228 |
+
require_once BOLDGRID_BACKUP_PATH . '/admin/class-boldgrid-backup-admin-wpcli.php';
|
229 |
+
}
|
230 |
+
|
231 |
$this->loader = new Boldgrid_Backup_Loader();
|
232 |
}
|
233 |
|
261 |
// Instantiate the admin core.
|
262 |
$plugin_admin_core = new Boldgrid_Backup_Admin_Core();
|
263 |
|
264 |
+
// WP-CLI support.
|
265 |
+
if ( defined( 'WP_CLI' ) && WP_CLI ) {
|
266 |
+
Boldgrid_Backup_Admin_Wpcli::$core = $plugin_admin_core;
|
267 |
+
}
|
268 |
+
|
269 |
// Add nav menu items.
|
270 |
$this->loader->add_action(
|
271 |
'admin_menu', $plugin_admin_core,
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: boldgrid, backup, restore, migrate, migration
|
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 5.1
|
6 |
Requires PHP: 5.4
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -76,6 +76,14 @@ The following features are available, of which you can find additional info for
|
|
76 |
|
77 |
== Changelog ==
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
= 1.7.2 =
|
80 |
|
81 |
Release date: Jan 15th, 2019
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 5.1
|
6 |
Requires PHP: 5.4
|
7 |
+
Stable tag: 1.8.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
76 |
|
77 |
== Changelog ==
|
78 |
|
79 |
+
= 1.8.0 =
|
80 |
+
|
81 |
+
Release date: Feb 14th, 2019
|
82 |
+
|
83 |
+
* New feature: Added WP-CLI support for backup schedule.
|
84 |
+
* Update: Change thickbox background color to inform user something is loading.
|
85 |
+
* Update: Misc updates required for next version of BoldGrid Backup Premium.
|
86 |
+
|
87 |
= 1.7.2 =
|
88 |
|
89 |
Release date: Jan 15th, 2019
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit3e2646554819dff6ecfaba76bda8b9e7::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit3179cc8cf55bc33a7a6470fb79d3732a
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit3179cc8cf55bc33a7a6470fb79d3732a
|
|
48 |
$loader->register(true);
|
49 |
|
50 |
if ($useStaticLoader) {
|
51 |
-
$includeFiles = Composer\Autoload\
|
52 |
} else {
|
53 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
}
|
55 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
-
|
57 |
}
|
58 |
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
|
63 |
-
function
|
64 |
{
|
65 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit3e2646554819dff6ecfaba76bda8b9e7
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit3e2646554819dff6ecfaba76bda8b9e7', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit3e2646554819dff6ecfaba76bda8b9e7', 'loadClassLoader'));
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit3e2646554819dff6ecfaba76bda8b9e7::getInitializer($loader));
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
48 |
$loader->register(true);
|
49 |
|
50 |
if ($useStaticLoader) {
|
51 |
+
$includeFiles = Composer\Autoload\ComposerStaticInit3e2646554819dff6ecfaba76bda8b9e7::$files;
|
52 |
} else {
|
53 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
}
|
55 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
+
composerRequire3e2646554819dff6ecfaba76bda8b9e7($fileIdentifier, $file);
|
57 |
}
|
58 |
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
|
63 |
+
function composerRequire3e2646554819dff6ecfaba76bda8b9e7($fileIdentifier, $file)
|
64 |
{
|
65 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
require $file;
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'f15d016d70663d5e96ccd2b863511eb8' => __DIR__ . '/..' . '/cbschuld/browser.php/lib/Browser.php',
|
@@ -91,9 +91,9 @@ class ComposerStaticInit3179cc8cf55bc33a7a6470fb79d3732a
|
|
91 |
public static function getInitializer(ClassLoader $loader)
|
92 |
{
|
93 |
return \Closure::bind(function () use ($loader) {
|
94 |
-
$loader->prefixLengthsPsr4 =
|
95 |
-
$loader->prefixDirsPsr4 =
|
96 |
-
$loader->classMap =
|
97 |
|
98 |
}, null, ClassLoader::class);
|
99 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit3e2646554819dff6ecfaba76bda8b9e7
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'f15d016d70663d5e96ccd2b863511eb8' => __DIR__ . '/..' . '/cbschuld/browser.php/lib/Browser.php',
|
91 |
public static function getInitializer(ClassLoader $loader)
|
92 |
{
|
93 |
return \Closure::bind(function () use ($loader) {
|
94 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit3e2646554819dff6ecfaba76bda8b9e7::$prefixLengthsPsr4;
|
95 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit3e2646554819dff6ecfaba76bda8b9e7::$prefixDirsPsr4;
|
96 |
+
$loader->classMap = ComposerStaticInit3e2646554819dff6ecfaba76bda8b9e7::$classMap;
|
97 |
|
98 |
}, null, ClassLoader::class);
|
99 |
}
|