BackWPup – WordPress Backup Plugin - Version 3.3.2

Version Description

Download this release

Release Info

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

Code changes from version 3.3.1 to 3.3.2

assets/images/backwpupbanner-free.png DELETED
Binary file
assets/images/backwpupbanner-pro.png DELETED
Binary file
assets/images/backwpupbanner.png ADDED
Binary file
assets/images/banner-de.jpg ADDED
Binary file
assets/images/banner-en.jpg ADDED
Binary file
assets/images/banner-survey-de.png ADDED
Binary file
assets/images/banner-survey-en.png ADDED
Binary file
assets/images/erroreven.png CHANGED
Binary file
assets/images/hgbtgreen.png CHANGED
Binary file
assets/images/hgbtred.png CHANGED
Binary file
assets/images/hgtopgreen.png CHANGED
Binary file
assets/images/imagecloud.png CHANGED
Binary file
assets/images/imagedata.png CHANGED
Binary file
assets/images/imagerepair.png DELETED
Binary file
assets/images/imagesave.png CHANGED
Binary file
assets/images/imagesec.png CHANGED
Binary file
assets/images/imagexml.png CHANGED
Binary file
assets/images/odd.png CHANGED
Binary file
assets/images/tickeven.png CHANGED
Binary file
backwpup.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: WordPress Backup Plugin
6
  * Author: Inpsyde GmbH
7
  * Author URI: http://inpsyde.com
8
- * Version: 3.3.1
9
  * Text Domain: backwpup
10
  * Domain Path: /languages/
11
  * Network: true
@@ -33,7 +33,7 @@
33
 
34
  if ( ! class_exists( 'BackWPup' ) ) {
35
 
36
- // Don't activate on anything less than PHP 5.2.7 or WordPress 3.1
37
  if ( version_compare( PHP_VERSION, '5.2.7', '<' ) || version_compare( get_bloginfo( 'version' ), '3.8', '<' ) || ! function_exists( 'spl_autoload_register' ) ) {
38
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
39
  deactivate_plugins( __FILE__ );
@@ -70,13 +70,9 @@ if ( ! class_exists( 'BackWPup' ) ) {
70
  //auto loader
71
  spl_autoload_register( array( $this, 'autoloader' ) );
72
  //start upgrade if needed
73
- if ( get_site_option( 'backwpup_version' ) != self::get_plugin_data( 'Version' ) ) {
74
  BackWPup_Install::activate();
75
  }
76
- //load pro features
77
- if ( class_exists( 'BackWPup_Pro' ) ) {
78
- BackWPup_Pro::get_instance();
79
- }
80
  //WP-Cron
81
  if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
82
  if ( ! empty( $_GET[ 'backwpup_run' ] ) && class_exists( 'BackWPup_Job' ) ) {
@@ -95,7 +91,7 @@ if ( ! class_exists( 'BackWPup' ) ) {
95
  //deactivation hook
96
  register_deactivation_hook( __FILE__, array( 'BackWPup_Install', 'deactivate' ) );
97
  //Admin bar
98
- if ( get_site_option( 'backwpup_cfg_showadminbar', FALSE ) ) {
99
  add_action( 'init', array( 'BackWPup_Adminbar', 'get_instance' ) );
100
  }
101
  //only in backend
5
  * Description: WordPress Backup Plugin
6
  * Author: Inpsyde GmbH
7
  * Author URI: http://inpsyde.com
8
+ * Version: 3.3.2
9
  * Text Domain: backwpup
10
  * Domain Path: /languages/
11
  * Network: true
33
 
34
  if ( ! class_exists( 'BackWPup' ) ) {
35
 
36
+ // Don't activate on anything less than PHP 5.2.7 or WordPress 3.8
37
  if ( version_compare( PHP_VERSION, '5.2.7', '<' ) || version_compare( get_bloginfo( 'version' ), '3.8', '<' ) || ! function_exists( 'spl_autoload_register' ) ) {
38
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
39
  deactivate_plugins( __FILE__ );
70
  //auto loader
71
  spl_autoload_register( array( $this, 'autoloader' ) );
72
  //start upgrade if needed
73
+ if ( get_site_option( 'backwpup_version' ) !== self::get_plugin_data( 'Version' ) || ! wp_next_scheduled( 'backwpup_check_cleanup' ) ) {
74
  BackWPup_Install::activate();
75
  }
 
 
 
 
76
  //WP-Cron
77
  if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
78
  if ( ! empty( $_GET[ 'backwpup_run' ] ) && class_exists( 'BackWPup_Job' ) ) {
91
  //deactivation hook
92
  register_deactivation_hook( __FILE__, array( 'BackWPup_Install', 'deactivate' ) );
93
  //Admin bar
94
+ if ( get_site_option( 'backwpup_cfg_showadminbar' ) ) {
95
  add_action( 'init', array( 'BackWPup_Adminbar', 'get_instance' ) );
96
  }
97
  //only in backend
inc/class-admin.php CHANGED
@@ -49,6 +49,26 @@ final class BackWPup_Admin {
49
  add_action( 'profile_update', array( $this, 'save_profile_update' ) );
50
 
51
  new BackWPup_EasyCron();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
 
54
  /**
@@ -63,7 +83,109 @@ final class BackWPup_Admin {
63
  return self::$instance;
64
  }
65
 
66
- private function __clone() {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
  /**
69
  * Admin init function
@@ -92,25 +214,6 @@ final class BackWPup_Admin {
92
  }
93
  }
94
 
95
- //display about page after Update
96
- if ( ! defined( 'DOING_AJAX' ) && ! get_site_option( 'backwpup_about_page', FALSE ) && ! isset( $_GET['activate-multi'] ) ) {
97
- update_site_option( 'backwpup_about_page', TRUE );
98
- wp_redirect( network_admin_url( 'admin.php' ) . '?page=backwpupabout' );
99
- exit();
100
- }
101
- }
102
-
103
- /**
104
- * Admin init function
105
- */
106
- public static function admin_css() {
107
-
108
- //register js and css for BackWPup
109
- if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
110
- wp_enqueue_style( 'backwpup', BackWPup::get_plugin_data( 'URL' ) . '/assets/css/backwpup.css', array(), time(), 'screen' );
111
- } else {
112
- wp_enqueue_style( 'backwpup', BackWPup::get_plugin_data( 'URL' ) . '/assets/css/backwpup.min.css', array(), BackWPup::get_plugin_data( 'Version' ), 'screen' );
113
- }
114
  }
115
 
116
  /**
@@ -146,7 +249,6 @@ final class BackWPup_Admin {
146
 
147
  }
148
 
149
-
150
  /**
151
  * @param $page_hooks
152
  * @return mixed
@@ -234,26 +336,6 @@ final class BackWPup_Admin {
234
  return $page_hooks;
235
  }
236
 
237
-
238
- /**
239
- * Load for all BackWPup pages
240
- */
241
- public static function init_general() {
242
-
243
- add_thickbox();
244
-
245
- //register js and css for BackWPup
246
- if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
247
- wp_register_script( 'backwpupgeneral', BackWPup::get_plugin_data( 'URL' ) . '/assets/js/general.js', array( 'jquery' ), time(), false );
248
- } else {
249
- wp_register_script( 'backwpupgeneral', BackWPup::get_plugin_data( 'URL' ) . '/assets/js/general.min.js', array( 'jquery' ), BackWPup::get_plugin_data( 'Version' ), false );
250
- }
251
-
252
- //add Help
253
- BackWPup_Help::help();
254
- }
255
-
256
-
257
  /**
258
  * Called on save form. Only POST allowed.
259
  */
@@ -298,79 +380,6 @@ final class BackWPup_Admin {
298
  exit;
299
  }
300
 
301
- /**
302
- * Add Message (across site loadings)
303
- *
304
- * @param $message string Message test
305
- * @param $error bool ist it a error message
306
- */
307
- public static function message( $message, $error = FALSE ) {
308
-
309
- if ( empty( $message ) ) {
310
- return;
311
- }
312
-
313
- $saved_message = self::get_messages();
314
-
315
- if ( $error )
316
- $saved_message[ 'error' ][] = $message;
317
- else
318
- $saved_message[ 'updated' ][] = $message;
319
-
320
- update_site_option( 'backwpup_messages', $saved_message );
321
- }
322
-
323
- /**
324
- * Get all Message that not displayed
325
- *
326
- * @return array
327
- */
328
- public static function get_messages() {
329
-
330
- return get_site_option( 'backwpup_messages', array() );
331
- }
332
-
333
- /**
334
- * Display Messages
335
- *
336
- * @param bool $echo
337
- * @return string
338
- */
339
- public static function display_messages( $echo = TRUE ) {
340
-
341
- $message_updated= '';
342
- $message_error = '';
343
- $saved_message = self::get_messages();
344
- $message_id = ' id="message"';
345
-
346
- if( empty( $saved_message ) )
347
- return '';
348
-
349
- if ( ! empty( $saved_message[ 'updated' ] ) ) {
350
- foreach( $saved_message[ 'updated' ] as $msg )
351
- $message_updated .= '<p>' . $msg . '</p>';
352
- }
353
- if ( ! empty( $saved_message[ 'error' ] ) ) {
354
- foreach( $saved_message[ 'error' ] as $msg )
355
- $message_error .= '<p>' . $msg . '</p>';
356
- }
357
-
358
- update_site_option( 'backwpup_messages', array() );
359
-
360
- if ( ! empty( $message_updated ) ) {
361
- $message_updated = '<div' . $message_id . ' class="updated">' . $message_updated . '</div>';
362
- $message_id = '';
363
- }
364
- if ( ! empty( $message_error ) ) {
365
- $message_error = '<div' . $message_id . ' class="error">' . $message_error . '</div>';
366
- }
367
-
368
- if ( $echo )
369
- echo $message_updated . $message_error;
370
-
371
- return $message_updated . $message_error;
372
- }
373
-
374
  /**
375
  * Overrides WordPress text in Footer
376
  *
@@ -412,7 +421,6 @@ final class BackWPup_Admin {
412
  return $update_footer_text;
413
  }
414
 
415
-
416
  /**
417
  * Add filed for selecting user role in user section
418
  *
@@ -524,4 +532,6 @@ final class BackWPup_Admin {
524
  return;
525
  }
526
 
 
 
527
  }
49
  add_action( 'profile_update', array( $this, 'save_profile_update' ) );
50
 
51
  new BackWPup_EasyCron();
52
+
53
+ if ( ! class_exists( 'backwpup_pro' ) ) {
54
+ $lang = substr( get_locale(), 0 ,2 );
55
+ if ( $lang !== 'de' ) {
56
+ $lang = 'en';
57
+ }
58
+ $message_box = new BackWPup_Message_Box( 'campaign_2016_06' );
59
+ $message_box->set_campaign_to_date( '2016-06-20' );
60
+ $message_box->set_box_html(
61
+ '<a href="' . __( 'http://backwpup.com', 'backwpup' ) . '" style="display:block;height:60px;"><img src="' . BackWPup::get_plugin_data( 'url' ) . '/assets/images/banner-' . $lang . '.jpg" /></a>'
62
+ );
63
+ $message_box->init_hooks();
64
+ }
65
+
66
+ $message_box = new BackWPup_Message_Box( 'restore_beta_survey' );
67
+ $message_box->set_campaign_to_date( '2016-06-30' );
68
+ $message_box->set_box_html(
69
+ '<a href="' . __( 'https://www.surveymonkey.com/r/BQJZSG2', 'backwpup' ) . '" style="padding:10px;display: block;"><strong>' . __( 'BackWPup Restore function is coming! Participate in our survey and with a little bit of luck you win a BackWPup Pro licence!', 'backwpup' ) . '</strong></a>'
70
+ );
71
+ $message_box->init_hooks();
72
  }
73
 
74
  /**
83
  return self::$instance;
84
  }
85
 
86
+ /**
87
+ * Admin init function
88
+ */
89
+ public static function admin_css() {
90
+
91
+ //register js and css for BackWPup
92
+ if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
93
+ wp_enqueue_style( 'backwpup', BackWPup::get_plugin_data( 'URL' ) . '/assets/css/backwpup.css', array(), time(), 'screen' );
94
+ } else {
95
+ wp_enqueue_style( 'backwpup', BackWPup::get_plugin_data( 'URL' ) . '/assets/css/backwpup.min.css', array(), BackWPup::get_plugin_data( 'Version' ), 'screen' );
96
+ }
97
+ }
98
+
99
+ /**
100
+ * Load for all BackWPup pages
101
+ */
102
+ public static function init_general() {
103
+
104
+ add_thickbox();
105
+
106
+ //register js and css for BackWPup
107
+ if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
108
+ wp_register_script( 'backwpupgeneral', BackWPup::get_plugin_data( 'URL' ) . '/assets/js/general.js', array( 'jquery' ), time(), false );
109
+ } else {
110
+ wp_register_script( 'backwpupgeneral', BackWPup::get_plugin_data( 'URL' ) . '/assets/js/general.min.js', array( 'jquery' ), BackWPup::get_plugin_data( 'Version' ), false );
111
+ }
112
+
113
+ //add Help
114
+ BackWPup_Help::help();
115
+ }
116
+
117
+ /**
118
+ * Add Message (across site loadings)
119
+ *
120
+ * @param $message string Message test
121
+ * @param $error bool ist it a error message
122
+ */
123
+ public static function message( $message, $error = FALSE ) {
124
+
125
+ if ( empty( $message ) ) {
126
+ return;
127
+ }
128
+
129
+ $saved_message = self::get_messages();
130
+
131
+ if ( $error )
132
+ $saved_message[ 'error' ][] = $message;
133
+ else
134
+ $saved_message[ 'updated' ][] = $message;
135
+
136
+ update_site_option( 'backwpup_messages', $saved_message );
137
+ }
138
+
139
+ /**
140
+ * Get all Message that not displayed
141
+ *
142
+ * @return array
143
+ */
144
+ public static function get_messages() {
145
+
146
+ return get_site_option( 'backwpup_messages', array() );
147
+ }
148
+
149
+ /**
150
+ * Display Messages
151
+ *
152
+ * @param bool $echo
153
+ * @return string
154
+ */
155
+ public static function display_messages( $echo = TRUE ) {
156
+
157
+ $message_updated= '';
158
+ $message_error = '';
159
+ $saved_message = self::get_messages();
160
+ $message_id = ' id="message"';
161
+
162
+ if( empty( $saved_message ) )
163
+ return '';
164
+
165
+ if ( ! empty( $saved_message[ 'updated' ] ) ) {
166
+ foreach( $saved_message[ 'updated' ] as $msg )
167
+ $message_updated .= '<p>' . $msg . '</p>';
168
+ }
169
+ if ( ! empty( $saved_message[ 'error' ] ) ) {
170
+ foreach( $saved_message[ 'error' ] as $msg )
171
+ $message_error .= '<p>' . $msg . '</p>';
172
+ }
173
+
174
+ update_site_option( 'backwpup_messages', array() );
175
+
176
+ if ( ! empty( $message_updated ) ) {
177
+ $message_updated = '<div' . $message_id . ' class="updated">' . $message_updated . '</div>';
178
+ $message_id = '';
179
+ }
180
+ if ( ! empty( $message_error ) ) {
181
+ $message_error = '<div' . $message_id . ' class="error">' . $message_error . '</div>';
182
+ }
183
+
184
+ if ( $echo )
185
+ echo $message_updated . $message_error;
186
+
187
+ return $message_updated . $message_error;
188
+ }
189
 
190
  /**
191
  * Admin init function
214
  }
215
  }
216
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  }
218
 
219
  /**
249
 
250
  }
251
 
 
252
  /**
253
  * @param $page_hooks
254
  * @return mixed
336
  return $page_hooks;
337
  }
338
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  /**
340
  * Called on save form. Only POST allowed.
341
  */
380
  exit;
381
  }
382
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
383
  /**
384
  * Overrides WordPress text in Footer
385
  *
421
  return $update_footer_text;
422
  }
423
 
 
424
  /**
425
  * Add filed for selecting user role in user section
426
  *
532
  return;
533
  }
534
 
535
+ private function __clone() {}
536
+
537
  }
inc/class-adminbar.php CHANGED
@@ -38,10 +38,6 @@ class BackWPup_Adminbar {
38
  return self::$instance;
39
  }
40
 
41
-
42
- private function __clone() {}
43
-
44
-
45
  /**
46
  * @global $wp_admin_bar WP_Admin_Bar
47
  */
@@ -49,7 +45,7 @@ class BackWPup_Adminbar {
49
  global $wp_admin_bar;
50
  /* @var WP_Admin_Bar $wp_admin_bar */
51
 
52
- $menu_title = '<span class="ab-icon"></span><span class="ab-label">' . BackWPup::get_plugin_data( 'name' ) . '</span>';
53
  $menu_herf = network_admin_url( 'admin.php?page=backwpup' );
54
  if ( file_exists( BackWPup::get_plugin_data( 'running_file' ) ) && current_user_can( 'backwpup_jobs_start' ) ) {
55
  $menu_title = '<span class="ab-icon"></span><span class="ab-label">' . esc_html( BackWPup::get_plugin_data( 'name' ) ) . ' <span id="backwpup-adminbar-running">' . esc_html__( 'running', 'backwpup' ) . '</span></span>';
@@ -135,4 +131,6 @@ class BackWPup_Adminbar {
135
  }
136
  }
137
  }
 
 
138
  }
38
  return self::$instance;
39
  }
40
 
 
 
 
 
41
  /**
42
  * @global $wp_admin_bar WP_Admin_Bar
43
  */
45
  global $wp_admin_bar;
46
  /* @var WP_Admin_Bar $wp_admin_bar */
47
 
48
+ $menu_title = '<span class="ab-icon"></span>';
49
  $menu_herf = network_admin_url( 'admin.php?page=backwpup' );
50
  if ( file_exists( BackWPup::get_plugin_data( 'running_file' ) ) && current_user_can( 'backwpup_jobs_start' ) ) {
51
  $menu_title = '<span class="ab-icon"></span><span class="ab-label">' . esc_html( BackWPup::get_plugin_data( 'name' ) ) . ' <span id="backwpup-adminbar-running">' . esc_html__( 'running', 'backwpup' ) . '</span></span>';
131
  }
132
  }
133
  }
134
+
135
+ private function __clone() {}
136
  }
inc/class-destination-s3.php CHANGED
@@ -49,7 +49,7 @@ class BackWPup_Destination_S3 extends BackWPup_Destinations {
49
  case 'google-storage-asia':
50
  return 'https://storage.googleapis.com';
51
  case 'dreamhost':
52
- return 'https://objects.dreamhost.com';
53
  case 'greenqloud':
54
  return 'http://s.greenqloud.com';
55
  default:
49
  case 'google-storage-asia':
50
  return 'https://storage.googleapis.com';
51
  case 'dreamhost':
52
+ return 'https://objects-us-west-1.dream.io';
53
  case 'greenqloud':
54
  return 'http://s.greenqloud.com';
55
  default:
inc/class-install.php CHANGED
@@ -9,17 +9,15 @@ class BackWPup_Install {
9
  */
10
  public static function activate() {
11
 
12
- //convert inactive version to active
13
- if ( $incative_version = get_site_option( 'backwpup_version' ) ) {
14
- update_site_option( 'backwpup_version', str_replace( '-inactive', '', $incative_version ) );
15
- }
16
 
17
  //changes for version before 3.0.0
18
- if ( ! get_site_option( 'backwpup_version' ) && get_option( 'backwpup' ) && get_option( 'backwpup_jobs' ) )
19
  self::upgrade_from_version_two();
 
20
 
21
  //changes for version before 3.0.14
22
- if ( version_compare( '3.0.13', get_site_option( 'backwpup_version' ), '>' ) && version_compare( '3.0', get_site_option( 'backwpup_version' ), '<' ) ) {
23
  $upload_dir = wp_upload_dir( null, false, true );
24
  $logfolder = get_site_option( 'backwpup_cfg_logfolder' );
25
  if ( empty( $logfolder ) ) {
@@ -62,9 +60,10 @@ class BackWPup_Install {
62
  }
63
  }
64
 
65
- //add check Cleanup schedule
66
- wp_clear_scheduled_hook( 'backwpup_check_cleanup' );
67
- wp_schedule_event( time(), 'twicedaily', 'backwpup_check_cleanup' );
 
68
 
69
  //add capabilities to administrator role
70
  $role = get_role( 'administrator' );
@@ -129,57 +128,13 @@ class BackWPup_Install {
129
 
130
  //update version
131
  update_site_option( 'backwpup_version', BackWPup::get_plugin_data( 'Version' ) );
132
- }
133
-
134
- /**
135
- *
136
- * Cleanup on Plugin deactivation
137
- *
138
- * @return void
139
- */
140
- public static function deactivate() {
141
-
142
- wp_clear_scheduled_hook( 'backwpup_cron' );
143
- $activejobs = BackWPup_Option::get_job_ids( 'activetype', 'wpcron' );
144
- if ( ! empty( $activejobs ) ) {
145
- foreach ( $activejobs as $id ) {
146
- wp_clear_scheduled_hook( 'backwpup_cron', array( 'id' => $id ) );
147
- }
148
- }
149
- wp_clear_scheduled_hook( 'backwpup_check_cleanup' );
150
-
151
- $activejobs = BackWPup_Option::get_job_ids( 'activetype', 'easycron' );
152
- if ( ! empty( $activejobs ) ) {
153
- foreach ( $activejobs as $id ) {
154
- BackWPup_EasyCron::delete( $id );
155
- }
156
- }
157
-
158
- //remove roles
159
- remove_role( 'backwpup_admin' );
160
- remove_role( 'backwpup_helper' );
161
- remove_role( 'backwpup_check' );
162
 
163
- //remove capabilities to administrator role
164
- $role = get_role( 'administrator' );
165
- if ( is_object( $role ) && method_exists( $role, 'remove_cap' ) ) {
166
- $role->remove_cap( 'backwpup' );
167
- $role->remove_cap( 'backwpup_jobs' );
168
- $role->remove_cap( 'backwpup_jobs_edit' );
169
- $role->remove_cap( 'backwpup_jobs_start' );
170
- $role->remove_cap( 'backwpup_backups' );
171
- $role->remove_cap( 'backwpup_backups_download' );
172
- $role->remove_cap( 'backwpup_backups_delete' );
173
- $role->remove_cap( 'backwpup_logs' );
174
- $role->remove_cap( 'backwpup_logs_delete' );
175
- $role->remove_cap( 'backwpup_settings' );
176
  }
177
-
178
- //to reschedule on activation and so on
179
- update_site_option( 'backwpup_version', get_site_option( 'backwpup_version' ) .'-inactive' );
180
  }
181
 
182
-
183
  private static function upgrade_from_version_two() {
184
 
185
  //load options
@@ -345,4 +300,50 @@ class BackWPup_Install {
345
  }
346
 
347
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
  }
9
  */
10
  public static function activate() {
11
 
12
+ $version_db = get_site_option( 'backwpup_version' );
 
 
 
13
 
14
  //changes for version before 3.0.0
15
+ if ( ! $version_db && get_option( 'backwpup' ) && get_option( 'backwpup_jobs' ) ) {
16
  self::upgrade_from_version_two();
17
+ }
18
 
19
  //changes for version before 3.0.14
20
+ if ( version_compare( '3.0.13', $version_db, '>' ) && version_compare( '3.0', $version_db, '<' ) ) {
21
  $upload_dir = wp_upload_dir( null, false, true );
22
  $logfolder = get_site_option( 'backwpup_cfg_logfolder' );
23
  if ( empty( $logfolder ) ) {
60
  }
61
  }
62
 
63
+ //add Cleanup schedule
64
+ if ( ! wp_next_scheduled( 'backwpup_check_cleanup' ) ) {
65
+ wp_schedule_event( time(), 'twicedaily', 'backwpup_check_cleanup' );
66
+ }
67
 
68
  //add capabilities to administrator role
69
  $role = get_role( 'administrator' );
128
 
129
  //update version
130
  update_site_option( 'backwpup_version', BackWPup::get_plugin_data( 'Version' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
 
132
+ if ( ! $version_db ) {
133
+ wp_redirect( network_admin_url( 'admin.php' ) . '?page=backwpupabout' );
134
+ die();
 
 
 
 
 
 
 
 
 
 
135
  }
 
 
 
136
  }
137
 
 
138
  private static function upgrade_from_version_two() {
139
 
140
  //load options
300
  }
301
 
302
  }
303
+
304
+ /**
305
+ *
306
+ * Cleanup on Plugin deactivation
307
+ *
308
+ * @return void
309
+ */
310
+ public static function deactivate() {
311
+
312
+ wp_clear_scheduled_hook( 'backwpup_cron' );
313
+ $activejobs = BackWPup_Option::get_job_ids( 'activetype', 'wpcron' );
314
+ if ( ! empty( $activejobs ) ) {
315
+ foreach ( $activejobs as $id ) {
316
+ wp_clear_scheduled_hook( 'backwpup_cron', array( 'id' => $id ) );
317
+ }
318
+ }
319
+ wp_clear_scheduled_hook( 'backwpup_check_cleanup' );
320
+
321
+ $activejobs = BackWPup_Option::get_job_ids( 'activetype', 'easycron' );
322
+ if ( ! empty( $activejobs ) ) {
323
+ foreach ( $activejobs as $id ) {
324
+ BackWPup_EasyCron::delete( $id );
325
+ }
326
+ }
327
+
328
+ //remove roles
329
+ remove_role( 'backwpup_admin' );
330
+ remove_role( 'backwpup_helper' );
331
+ remove_role( 'backwpup_check' );
332
+
333
+ //remove capabilities to administrator role
334
+ $role = get_role( 'administrator' );
335
+ if ( is_object( $role ) && method_exists( $role, 'remove_cap' ) ) {
336
+ $role->remove_cap( 'backwpup' );
337
+ $role->remove_cap( 'backwpup_jobs' );
338
+ $role->remove_cap( 'backwpup_jobs_edit' );
339
+ $role->remove_cap( 'backwpup_jobs_start' );
340
+ $role->remove_cap( 'backwpup_backups' );
341
+ $role->remove_cap( 'backwpup_backups_download' );
342
+ $role->remove_cap( 'backwpup_backups_delete' );
343
+ $role->remove_cap( 'backwpup_logs' );
344
+ $role->remove_cap( 'backwpup_logs_delete' );
345
+ $role->remove_cap( 'backwpup_settings' );
346
+ }
347
+
348
+ }
349
  }
inc/class-job.php CHANGED
@@ -309,9 +309,7 @@ final class BackWPup_Job {
309
  $head .= '</head>' . PHP_EOL;
310
  $head .= '<body style="margin:0;padding:3px;font-family:monospace;font-size:12px;line-height:15px;background-color:black;color:#c0c0c0;white-space:nowrap;">' . PHP_EOL;
311
  $info .= sprintf( _x( '[INFO] %1$s %2$s; A project of Inpsyde GmbH', 'Plugin name; Plugin Version; plugin url', 'backwpup' ), BackWPup::get_plugin_data( 'name' ), BackWPup::get_plugin_data( 'Version' ), __( 'http://backwpup.com', 'backwpup' ) ) . '<br />' . PHP_EOL;
312
- if ( $this->is_debug() ) {
313
- $info .= sprintf( _x( '[INFO] WordPress %1$s on %2$s', 'WordPress Version; Blog url', 'backwpup' ), BackWPup::get_plugin_data( 'wp_version' ), esc_attr( site_url( '/' ) ) ) . '<br />' . PHP_EOL;
314
- }
315
  $level = __( 'Normal', 'backwpup' );
316
  $translated = '';
317
  if ( $this->is_debug() ) {
@@ -587,6 +585,9 @@ final class BackWPup_Job {
587
  $log_level = get_site_option( 'backwpup_cfg_loglevel', 'normal_translated' );
588
  if ( strstr( $log_level, 'translated' ) ) {
589
  BackWPup::load_text_domain();
 
 
 
590
  }
591
 
592
  if ( $starttype !== 'restart' ) {
@@ -657,6 +658,9 @@ final class BackWPup_Job {
657
  $log_level = get_site_option( 'backwpup_cfg_loglevel', 'normal_translated' );
658
  if ( strstr( $log_level, 'translated' ) ) {
659
  BackWPup::load_text_domain();
 
 
 
660
  }
661
 
662
  $jobid = absint( $jobid );
@@ -758,8 +762,6 @@ final class BackWPup_Job {
758
  @ini_set( 'report_memleaks', '1' );
759
  @ini_set( 'zlib.output_compression', '0' );
760
  @ini_set( 'implicit_flush', '0' );
761
- //increase MySQL timeout
762
- @ini_set( 'mysql.connect_timeout', '360' );
763
  //set temp folder
764
  $can_set_temp_env = true;
765
  $protected_env_vars = explode( ',', ini_get( 'safe_mode_protected_env_vars' ) ); //removed in php 5.4.0
@@ -785,11 +787,6 @@ final class BackWPup_Job {
785
  }
786
  }
787
  set_exception_handler( array( $this, 'exception_handler' ) );
788
- //not loading Textdomains and unload loaded
789
- if ( ! strstr( $this->log_level, 'translated' ) ) {
790
- add_filter( 'override_load_textdomain', create_function( '', 'return TRUE;' ) );
791
- $GLOBALS['l10n'] = array();
792
- }
793
  // execute function on job shutdown register_shutdown_function( array( $this, 'shutdown' ) );
794
  add_action( 'shutdown', array( $this, 'shutdown' ) );
795
 
@@ -825,7 +822,7 @@ final class BackWPup_Job {
825
  //'SIGWINCH', //Ign
826
  //'SIGIO', //Term
827
  'SIGPWR', //Term
828
- 'SIGSYS', //Core
829
  );
830
  $signals = apply_filters( 'backwpup_job_signals_to_handel', $signals );
831
  declare( ticks = 1 );
@@ -913,7 +910,7 @@ final class BackWPup_Job {
913
  }
914
 
915
  //no restart if in end step
916
- if ( $this->step_working == 'END' || ( count( $this->steps_done ) + 1 ) >= count( $this->steps_todo ) ) {
917
  return;
918
  }
919
 
@@ -970,7 +967,7 @@ final class BackWPup_Job {
970
  */
971
  public function do_restart_time( $do_restart_now = false ) {
972
 
973
- //do restart after signel is send
974
  if ( $this->signal !== 0 ) {
975
  $this->steps_data[ $this->step_working ]['SAVE_STEP_TRY'] = $this->steps_data[ $this->step_working ]['STEP_TRY'];
976
  $this->steps_data[ $this->step_working ]['STEP_TRY'] -= 1;
@@ -1111,84 +1108,78 @@ final class BackWPup_Job {
1111
  $signals = array(
1112
  'SIGHUP' => array(
1113
  'description' => _x( 'Hangup detected on controlling terminal or death of controlling process', 'SIGHUP: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1114
- 'error' => true
1115
  ),
1116
  'SIGINT' => array(
1117
  'description' => _x( 'Interrupt from keyboard', 'SIGINT: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1118
- 'error' => true
1119
  ),
1120
  'SIGQUIT' => array(
1121
  'description' => _x( 'Quit from keyboard', 'SIGQUIT: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1122
- 'error' => true
1123
  ),
1124
  'SIGILL' => array(
1125
  'description' => _x( 'Illegal Instruction', 'SIGILL: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1126
- 'error' => true
1127
  ),
1128
  'SIGABRT' => array(
1129
  'description' => _x( 'Abort signal from abort(3)', 'SIGABRT: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1130
- 'error' => false
1131
  ),
1132
  'SIGBUS' => array(
1133
  'description' => _x( 'Bus error (bad memory access)', 'SIGBUS: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1134
- 'error' => true
1135
  ),
1136
  'SIGFPE' => array(
1137
  'description' => _x( 'Floating point exception', 'SIGFPE: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1138
- 'error' => true
1139
  ),
1140
  'SIGSEGV' => array(
1141
  'description' => _x( 'Invalid memory reference', 'SIGSEGV: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1142
- 'error' => true
1143
  ),
1144
  'SIGTERM' => array(
1145
  'description' => _x( 'Termination signal', 'SIGTERM: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1146
- 'error' => false
1147
  ),
1148
  'SIGSTKFLT' => array(
1149
  'description' => _x( 'Stack fault on coprocessor', 'SIGSTKFLT: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1150
- 'error' => true
1151
  ),
1152
  'SIGUSR1' => array(
1153
  'description' => _x( 'User-defined signal 1', 'SIGUSR1: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1154
- 'error' => false
1155
  ),
1156
  'SIGUSR2' => array(
1157
  'description' => _x( 'User-defined signal 2', 'SIGUSR2: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1158
- 'error' => false
1159
  ),
1160
  'SIGURG' => array(
1161
  'description' => _x( 'Urgent condition on socket', 'SIGURG: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1162
- 'error' => false
1163
  ),
1164
  'SIGXCPU' => array(
1165
  'description' => _x( 'CPU time limit exceeded', 'SIGXCPU: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1166
- 'error' => true
1167
  ),
1168
  'SIGXFSZ' => array(
1169
  'description' => _x( 'File size limit exceeded', 'SIGXFSZ: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1170
- 'error' => true
1171
  ),
1172
  'SIGPWR' => array(
1173
  'description' => _x( 'Power failure', 'SIGPWR: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1174
- 'error' => false
1175
  ),
1176
  'SIGSYS' => array(
1177
  'description' => _x( 'Bad argument to routine', 'SIGSYS: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1178
- 'error' => true
1179
  ),
1180
  );
1181
 
1182
  foreach ( $signals as $signal => $config ) {
1183
  if ( defined( $signal ) && $signal_send === constant( $signal ) ) {
1184
- if ( $config['error'] || php_sapi_name() == 'cli' ) {
1185
- $this->log( sprintf( __( 'Signal "%1$s" (%2$s) is sent to script!', 'backwpup' ), $signal, $config['description'] ), E_USER_ERROR );
1186
- $this->signal = $signal_send;
1187
- $this->do_restart( true );
1188
- } else {
1189
- $this->log( sprintf( __( 'Signal "%1$s" (%2$s) is sent to script!', 'backwpup' ), $signal, $config['description'] ) );
1190
- $this->signal = $signal_send;
1191
- }
1192
  break;
1193
  }
1194
  }
@@ -1377,11 +1368,11 @@ final class BackWPup_Job {
1377
 
1378
  //set last Message
1379
  if ( $error ) {
1380
- $output_message = '<span style="background-color:red;color:#c0c0c0;">' . esc_html( $message ) . '</span>';
1381
  $this->lasterrormsg = $output_message;
1382
  }
1383
  elseif ( $warning ) {
1384
- $output_message = '<span style="background-color:#ffc000;color:#c0c0c0;">' . esc_html( $message ) . '</span>';
1385
  $this->lasterrormsg = $output_message;
1386
  }
1387
  else {
@@ -1459,12 +1450,6 @@ final class BackWPup_Job {
1459
  //set execution time again for 5 min
1460
  @set_time_limit( 300 );
1461
 
1462
- //check MySQL connection to WordPress Database and reconnect if needed
1463
- $res = $wpdb->query( 'SELECT ' . time() );
1464
- if ( $res === false ) {
1465
- $wpdb->db_connect();
1466
- }
1467
-
1468
  //calc sub step percent
1469
  if ( $this->substeps_todo > 0 && $this->substeps_done > 0 ) {
1470
  $this->substep_percent = round( $this->substeps_done / $this->substeps_todo * 100 );
@@ -1481,6 +1466,10 @@ final class BackWPup_Job {
1481
  $this->timestamp_last_update = microtime( true ); //last update of working file
1482
  $this->write_running_file();
1483
  }
 
 
 
 
1484
  }
1485
 
1486
  private function write_running_file() {
309
  $head .= '</head>' . PHP_EOL;
310
  $head .= '<body style="margin:0;padding:3px;font-family:monospace;font-size:12px;line-height:15px;background-color:black;color:#c0c0c0;white-space:nowrap;">' . PHP_EOL;
311
  $info .= sprintf( _x( '[INFO] %1$s %2$s; A project of Inpsyde GmbH', 'Plugin name; Plugin Version; plugin url', 'backwpup' ), BackWPup::get_plugin_data( 'name' ), BackWPup::get_plugin_data( 'Version' ), __( 'http://backwpup.com', 'backwpup' ) ) . '<br />' . PHP_EOL;
312
+ $info .= sprintf( _x( '[INFO] WordPress %1$s on %2$s', 'WordPress Version; Blog url', 'backwpup' ), BackWPup::get_plugin_data( 'wp_version' ), esc_attr( site_url( '/' ) ) ) . '<br />' . PHP_EOL;
 
 
313
  $level = __( 'Normal', 'backwpup' );
314
  $translated = '';
315
  if ( $this->is_debug() ) {
585
  $log_level = get_site_option( 'backwpup_cfg_loglevel', 'normal_translated' );
586
  if ( strstr( $log_level, 'translated' ) ) {
587
  BackWPup::load_text_domain();
588
+ } else {
589
+ add_filter( 'override_load_textdomain', '__return_true' );
590
+ $GLOBALS['l10n'] = array();
591
  }
592
 
593
  if ( $starttype !== 'restart' ) {
658
  $log_level = get_site_option( 'backwpup_cfg_loglevel', 'normal_translated' );
659
  if ( strstr( $log_level, 'translated' ) ) {
660
  BackWPup::load_text_domain();
661
+ } else {
662
+ add_filter( 'override_load_textdomain', '__return_true' );
663
+ $GLOBALS['l10n'] = array();
664
  }
665
 
666
  $jobid = absint( $jobid );
762
  @ini_set( 'report_memleaks', '1' );
763
  @ini_set( 'zlib.output_compression', '0' );
764
  @ini_set( 'implicit_flush', '0' );
 
 
765
  //set temp folder
766
  $can_set_temp_env = true;
767
  $protected_env_vars = explode( ',', ini_get( 'safe_mode_protected_env_vars' ) ); //removed in php 5.4.0
787
  }
788
  }
789
  set_exception_handler( array( $this, 'exception_handler' ) );
 
 
 
 
 
790
  // execute function on job shutdown register_shutdown_function( array( $this, 'shutdown' ) );
791
  add_action( 'shutdown', array( $this, 'shutdown' ) );
792
 
822
  //'SIGWINCH', //Ign
823
  //'SIGIO', //Term
824
  'SIGPWR', //Term
825
+ 'SIGSYS' //Core
826
  );
827
  $signals = apply_filters( 'backwpup_job_signals_to_handel', $signals );
828
  declare( ticks = 1 );
910
  }
911
 
912
  //no restart if in end step
913
+ if ( $this->step_working === 'END' || ( count( $this->steps_done ) + 1 ) >= count( $this->steps_todo ) ) {
914
  return;
915
  }
916
 
967
  */
968
  public function do_restart_time( $do_restart_now = false ) {
969
 
970
+ //do restart after signal is send
971
  if ( $this->signal !== 0 ) {
972
  $this->steps_data[ $this->step_working ]['SAVE_STEP_TRY'] = $this->steps_data[ $this->step_working ]['STEP_TRY'];
973
  $this->steps_data[ $this->step_working ]['STEP_TRY'] -= 1;
1108
  $signals = array(
1109
  'SIGHUP' => array(
1110
  'description' => _x( 'Hangup detected on controlling terminal or death of controlling process', 'SIGHUP: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1111
+ 'error' => E_USER_ERROR
1112
  ),
1113
  'SIGINT' => array(
1114
  'description' => _x( 'Interrupt from keyboard', 'SIGINT: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1115
+ 'error' => E_USER_ERROR
1116
  ),
1117
  'SIGQUIT' => array(
1118
  'description' => _x( 'Quit from keyboard', 'SIGQUIT: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1119
+ 'error' => E_USER_ERROR
1120
  ),
1121
  'SIGILL' => array(
1122
  'description' => _x( 'Illegal Instruction', 'SIGILL: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1123
+ 'error' => E_USER_ERROR
1124
  ),
1125
  'SIGABRT' => array(
1126
  'description' => _x( 'Abort signal from abort(3)', 'SIGABRT: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1127
+ 'error' => E_USER_NOTICE
1128
  ),
1129
  'SIGBUS' => array(
1130
  'description' => _x( 'Bus error (bad memory access)', 'SIGBUS: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1131
+ 'error' => E_USER_ERROR
1132
  ),
1133
  'SIGFPE' => array(
1134
  'description' => _x( 'Floating point exception', 'SIGFPE: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1135
+ 'error' => E_USER_ERROR
1136
  ),
1137
  'SIGSEGV' => array(
1138
  'description' => _x( 'Invalid memory reference', 'SIGSEGV: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1139
+ 'error' => E_USER_ERROR
1140
  ),
1141
  'SIGTERM' => array(
1142
  'description' => _x( 'Termination signal', 'SIGTERM: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1143
+ 'error' => E_USER_WARNING
1144
  ),
1145
  'SIGSTKFLT' => array(
1146
  'description' => _x( 'Stack fault on coprocessor', 'SIGSTKFLT: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1147
+ 'error' => E_USER_ERROR
1148
  ),
1149
  'SIGUSR1' => array(
1150
  'description' => _x( 'User-defined signal 1', 'SIGUSR1: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1151
+ 'error' => E_USER_NOTICE
1152
  ),
1153
  'SIGUSR2' => array(
1154
  'description' => _x( 'User-defined signal 2', 'SIGUSR2: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1155
+ 'error' => E_USER_NOTICE
1156
  ),
1157
  'SIGURG' => array(
1158
  'description' => _x( 'Urgent condition on socket', 'SIGURG: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1159
+ 'error' => E_USER_NOTICE
1160
  ),
1161
  'SIGXCPU' => array(
1162
  'description' => _x( 'CPU time limit exceeded', 'SIGXCPU: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1163
+ 'error' => E_USER_ERROR
1164
  ),
1165
  'SIGXFSZ' => array(
1166
  'description' => _x( 'File size limit exceeded', 'SIGXFSZ: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1167
+ 'error' => E_USER_ERROR
1168
  ),
1169
  'SIGPWR' => array(
1170
  'description' => _x( 'Power failure', 'SIGPWR: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1171
+ 'error' => E_USER_ERROR
1172
  ),
1173
  'SIGSYS' => array(
1174
  'description' => _x( 'Bad argument to routine', 'SIGSYS: Please see http://man7.org/linux/man-pages/man7/signal.7.html for details', 'backwpup' ),
1175
+ 'error' => E_USER_ERROR
1176
  ),
1177
  );
1178
 
1179
  foreach ( $signals as $signal => $config ) {
1180
  if ( defined( $signal ) && $signal_send === constant( $signal ) ) {
1181
+ $this->log( sprintf( __( 'Signal "%1$s" (%2$s) is sent to script!', 'backwpup' ), $signal, $config['description'] ), $config['error'] );
1182
+ $this->signal = $signal_send;
 
 
 
 
 
 
1183
  break;
1184
  }
1185
  }
1368
 
1369
  //set last Message
1370
  if ( $error ) {
1371
+ $output_message = '<span style="background-color:#ff6766;color:black;padding:0 2px;">' . esc_html( $message ) . '</span>';
1372
  $this->lasterrormsg = $output_message;
1373
  }
1374
  elseif ( $warning ) {
1375
+ $output_message = '<span style="background-color:#ffc766;color:black;padding:0 2px;">' . esc_html( $message ) . '</span>';
1376
  $this->lasterrormsg = $output_message;
1377
  }
1378
  else {
1450
  //set execution time again for 5 min
1451
  @set_time_limit( 300 );
1452
 
 
 
 
 
 
 
1453
  //calc sub step percent
1454
  if ( $this->substeps_todo > 0 && $this->substeps_done > 0 ) {
1455
  $this->substep_percent = round( $this->substeps_done / $this->substeps_todo * 100 );
1466
  $this->timestamp_last_update = microtime( true ); //last update of working file
1467
  $this->write_running_file();
1468
  }
1469
+
1470
+ if ( $this->signal !== 0 ) {
1471
+ $this->do_restart();
1472
+ }
1473
  }
1474
 
1475
  private function write_running_file() {
inc/class-message-box.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class BackWPup_Message_Box
5
+ *
6
+ * $message_box = new BackWPup_Message_Box( 'restore_beta_survey' );
7
+ * $message_box->set_box_html(
8
+ * 'test'
9
+ * );
10
+ * $message_box->init_hooks();
11
+ */
12
+ class BackWPup_Message_Box {
13
+
14
+ /**
15
+ * ID of this message box
16
+ * @var string
17
+ */
18
+ private $box_id = '';
19
+
20
+ /**
21
+ * HTML of this message box
22
+ * @var string
23
+ */
24
+ private $box_html = '';
25
+
26
+ /**
27
+ * @var string Date to a campaign should be displayed
28
+ */
29
+ private $campaign_to_date = '0000-00-00';
30
+
31
+ /**
32
+ * BackWPup_Message_Box constructor.
33
+ *
34
+ * @param string $box_id Name for box to have more than one or future one
35
+ */
36
+ public function __construct( $box_id ) {
37
+
38
+ if ( ! $box_id || ! is_string( $box_id ) ) {
39
+ return null;
40
+ }
41
+
42
+ $this->box_id = sanitize_title_with_dashes( $box_id );
43
+ }
44
+
45
+ /**
46
+ * Init hooks to displaying message box
47
+ */
48
+ public function init_hooks() {
49
+
50
+ if ( ! current_user_can( 'backwpup' ) ) {
51
+ return;
52
+ }
53
+
54
+ $boxes_display = get_user_meta( get_current_user_id(), 'backwpup_message_boxes_not_display', true );
55
+ if ( ! $boxes_display ) {
56
+ $boxes_display = array();
57
+ }
58
+
59
+ if ( ! empty( $boxes_display[ $this->box_id ] ) ) {
60
+ return;
61
+ }
62
+
63
+ if ( isset( $_GET['page'] ) && $_GET['page'] === 'backwpupabout' ) {
64
+ return;
65
+ }
66
+
67
+
68
+ if ( $this->campaign_to_date !== '0000-00-00' ) {
69
+ $this_day = date( 'Y-m-d' );
70
+ if ( $this_day > $this->campaign_to_date ) {
71
+ return;
72
+ }
73
+ }
74
+
75
+ add_action( 'admin_notices', array( $this, 'output_box_html' ) );
76
+ add_action( 'admin_init', array( $this, 'save_not_display' ) );
77
+ }
78
+
79
+ /**
80
+ * Output the message box
81
+ */
82
+ public function output_box_html() {
83
+
84
+ $url = add_query_arg( array( 'backwpup_msg_' . $this->box_id => 1 ), '//' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] );
85
+
86
+ ?>
87
+ <div id="backwpup-message-<?php echo $this->box_id; ?>" class="notice" style="padding:0;border:0;position:relative;">
88
+ <?php echo $this->box_html; ?>
89
+ <a href="<?php echo $url; ?>" class="dismiss" style="text-decoration:none;position:absolute;top:5px;right:5px;" title="<?php echo __( 'Dismiss', 'backwpup' ); ?>"><span class="dashicons dashicons-dismiss"></span></a>
90
+ </div>
91
+ <?php
92
+
93
+ }
94
+
95
+ /**
96
+ * Add box html for output with this box
97
+ *
98
+ * @param $html
99
+ */
100
+ public function set_box_html( $html ) {
101
+
102
+ if ( ! $html || ! is_string( $html ) ) {
103
+ return;
104
+ }
105
+
106
+ $this->box_html = $html;
107
+ }
108
+
109
+ /**
110
+ * Save user meta for boxes that should not be displayed
111
+ */
112
+ public function save_not_display() {
113
+
114
+ if ( ! empty( $_GET[ 'backwpup_msg_' . $this->box_id ] ) ) {
115
+ $boxes_display = get_user_meta( get_current_user_id(), 'backwpup_message_boxes_not_display', true );
116
+ if ( ! $boxes_display ) {
117
+ $boxes_display = array();
118
+ }
119
+ $boxes_display[ $this->box_id ] = true;
120
+ update_user_meta( get_current_user_id(), 'backwpup_message_boxes_not_display', $boxes_display );
121
+ remove_action( 'admin_notices', array( $this, 'output_box_html' ) );
122
+ }
123
+ }
124
+
125
+ /**
126
+ * Date to a campaign should be displayed
127
+ *
128
+ * @since 3.3.2
129
+ *
130
+ * @param string $campaign_to_date
131
+ */
132
+ public function set_campaign_to_date( $campaign_to_date = '0000-00-00' ) {
133
+
134
+ $this->campaign_to_date = $campaign_to_date;
135
+ }
136
+ }
inc/class-option.php CHANGED
@@ -17,9 +17,9 @@ final class BackWPup_Option {
17
  //job default
18
  add_site_option( 'backwpup_jobs', array() );
19
  //general
20
- add_site_option( 'backwpup_cfg_showadminbar', 1 );
21
- add_site_option( 'backwpup_cfg_showfoldersize', 0 );
22
- add_site_option( 'backwpup_cfg_protectfolders', 1 );
23
  //job
24
  add_site_option( 'backwpup_cfg_jobmaxexecutiontime', 30 );
25
  add_site_option( 'backwpup_cfg_jobstepretry', 3 );
@@ -41,6 +41,31 @@ final class BackWPup_Option {
41
 
42
  }
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
  /**
46
  *
@@ -85,6 +110,35 @@ final class BackWPup_Option {
85
  return update_site_option( 'backwpup_jobs', $options );
86
  }
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
 
89
  /**
90
  *
@@ -139,63 +193,6 @@ final class BackWPup_Option {
139
  }
140
  }
141
 
142
- /**
143
- *
144
- * Update a BackWPup option
145
- *
146
- * @param int $jobid the job id
147
- * @param string $option Option key
148
- * @param mixed $value the value to store
149
- *
150
- * @return bool if option save or not
151
- */
152
- public static function update( $jobid, $option, $value ) {
153
-
154
- $jobid = (int) $jobid;
155
- $option = sanitize_key( trim( $option ) );
156
-
157
- if ( empty( $jobid ) || empty( $option ) ) {
158
- return false;
159
- }
160
-
161
- //Update option
162
- $jobs_options = self::jobs_options( false );
163
- $jobs_options[ $jobid ][ $option ] = $value;
164
-
165
- return self::update_jobs_options( $jobs_options );
166
- }
167
-
168
-
169
- /**
170
- *
171
- * Get a BackWPup Option
172
- *
173
- * @param int $jobid Option the job id
174
- * @param string $option Option key
175
- * @param mixed $default returned if no value, if null the the default BackWPup option will get
176
- * @param bool $use_cache USe the cache
177
- *
178
- * @return bool|mixed false if nothing can get else the option value
179
- */
180
- public static function get( $jobid, $option, $default = null, $use_cache = true ) {
181
-
182
- $jobid = (int) $jobid;
183
- $option = sanitize_key( trim( $option ) );
184
-
185
- if ( empty( $jobid ) || empty( $option ) ) {
186
- return false;
187
- }
188
-
189
- $jobs_options = self::jobs_options( $use_cache );
190
- if ( ! isset( $jobs_options[ $jobid ][ $option ] ) && isset( $default ) ) {
191
- return $default;
192
- } elseif ( ! isset( $jobs_options[ $jobid ][ $option ] ) ) {
193
- return self::defaults_job( $option );
194
- } else {
195
- return $jobs_options[ $jobid ][ $option ];
196
- }
197
- }
198
-
199
  /**
200
  *
201
  * BackWPup Job Options
17
  //job default
18
  add_site_option( 'backwpup_jobs', array() );
19
  //general
20
+ add_site_option( 'backwpup_cfg_showadminbar', false );
21
+ add_site_option( 'backwpup_cfg_showfoldersize', false );
22
+ add_site_option( 'backwpup_cfg_protectfolders', true );
23
  //job
24
  add_site_option( 'backwpup_cfg_jobmaxexecutiontime', 30 );
25
  add_site_option( 'backwpup_cfg_jobstepretry', 3 );
41
 
42
  }
43
 
44
+ /**
45
+ *
46
+ * Update a BackWPup option
47
+ *
48
+ * @param int $jobid the job id
49
+ * @param string $option Option key
50
+ * @param mixed $value the value to store
51
+ *
52
+ * @return bool if option save or not
53
+ */
54
+ public static function update( $jobid, $option, $value ) {
55
+
56
+ $jobid = (int) $jobid;
57
+ $option = sanitize_key( trim( $option ) );
58
+
59
+ if ( empty( $jobid ) || empty( $option ) ) {
60
+ return false;
61
+ }
62
+
63
+ //Update option
64
+ $jobs_options = self::jobs_options( false );
65
+ $jobs_options[ $jobid ][ $option ] = $value;
66
+
67
+ return self::update_jobs_options( $jobs_options );
68
+ }
69
 
70
  /**
71
  *
110
  return update_site_option( 'backwpup_jobs', $options );
111
  }
112
 
113
+ /**
114
+ *
115
+ * Get a BackWPup Option
116
+ *
117
+ * @param int $jobid Option the job id
118
+ * @param string $option Option key
119
+ * @param mixed $default returned if no value, if null the the default BackWPup option will get
120
+ * @param bool $use_cache USe the cache
121
+ *
122
+ * @return bool|mixed false if nothing can get else the option value
123
+ */
124
+ public static function get( $jobid, $option, $default = null, $use_cache = true ) {
125
+
126
+ $jobid = (int) $jobid;
127
+ $option = sanitize_key( trim( $option ) );
128
+
129
+ if ( empty( $jobid ) || empty( $option ) ) {
130
+ return false;
131
+ }
132
+
133
+ $jobs_options = self::jobs_options( $use_cache );
134
+ if ( ! isset( $jobs_options[ $jobid ][ $option ] ) && isset( $default ) ) {
135
+ return $default;
136
+ } elseif ( ! isset( $jobs_options[ $jobid ][ $option ] ) ) {
137
+ return self::defaults_job( $option );
138
+ } else {
139
+ return $jobs_options[ $jobid ][ $option ];
140
+ }
141
+ }
142
 
143
  /**
144
  *
193
  }
194
  }
195
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  /**
197
  *
198
  * BackWPup Job Options
inc/class-page-about.php CHANGED
@@ -352,6 +352,11 @@ class BackWPup_Page_About {
352
  */
353
  public static function page() {
354
 
 
 
 
 
 
355
  ?>
356
  <div class="wrap" id="backwpup-page">
357
  <?php BackWPup_Admin::display_messages(); ?>
@@ -360,24 +365,32 @@ class BackWPup_Page_About {
360
  <?php if ( class_exists( 'BackWPup_Pro', FALSE ) ) { ?>
361
  <div class="welcometxt">
362
  <div class="backwpup-welcome">
363
- <img class="backwpup-banner-img" src="<?php echo BackWPup::get_plugin_data( 'URL' );?>/assets/images/backwpupbanner-pro.png" />
364
  <h1><?php esc_html_e( 'Welcome to BackWPup Pro', 'backwpup' ); ?></h1>
365
  <p><?php esc_html_e( 'BackWPup’s job wizards make planning and scheduling your backup jobs a breeze.', 'backwpup' ); echo ' ';
366
  _e( 'Use your backup archives to save your entire WordPress installation including <code>/wp-content/</code>. Push them to an external storage service if you don’t want to save the backups on the same server. With a single backup archive you are able to restore an installation. Use a tool like phpMyAdmin or a plugin like <a href="http://wordpress.org/plugins/adminer/" target="_blank">Adminer</a> to restore your database backup files.', 'backwpup' ); ?></p>
367
  <p><?php echo str_replace( '\"','"', sprintf( __( 'Ready to <a href="%1$s">set up a backup job</a>? You can <a href="%2$s">use the wizards</a> or plan your backup in expert mode.', 'backwpup' ), network_admin_url( 'admin.php').'?page=backwpupeditjob' , network_admin_url( 'admin.php').'?page=backwpupwizard' ) ); ?></p>
368
  </div>
 
 
 
369
  </div>
370
  <?php } else {?>
371
  <div class="welcometxt">
372
  <div class="backwpup-welcome">
373
- <img class="backwpup-banner-img" src="<?php echo esc_attr( BackWPup::get_plugin_data( 'URL' ));?>/assets/images/backwpupbanner-free.png" />
374
  <h1><?php esc_html_e( 'Welcome to BackWPup', 'backwpup' ); ?></h1>
375
  <p><?php
376
  _e( 'Use your backup archives to save your entire WordPress installation including <code>/wp-content/</code>. Push them to an external storage service if you don’t want to save the backups on the same server. With a single backup archive you are able to restore an installation. Use a tool like phpMyAdmin or a plugin like <a href="http://wordpress.org/plugins/adminer/" target="_blank">Adminer</a> to restore your database backup files.', 'backwpup' ); ?></p>
377
  <p><?php esc_html_e( 'Ready to set up a backup job? Use one of the wizards to plan what you want to save.', 'backwpup' ); ?></p>
378
  </div>
 
 
 
379
  </div>
380
  <?php } ?>
 
 
381
  <?php
382
  if ( class_exists( 'BackWPup_Pro', FALSE ) ) :
383
  $autoupdate = BackWPup_Pro_MarketPress_Autoupdate::get_instance();
@@ -515,7 +528,7 @@ _e( 'Use your backup archives to save your entire WordPress installation includi
515
  <td class="tick"></td>
516
  </tr>
517
  <tr class="odd">
518
- <td><?php esc_html_e( 'Backup to S3 services <small>(Amazon, Google Storage, Hosteurope and more)</small>', 'backwpup' ); ?></td>
519
  <td class="tick"></td>
520
  <td class="tick"></td>
521
  </tr>
@@ -620,7 +633,7 @@ _e( 'Use your backup archives to save your entire WordPress installation includi
620
  <td class="tick"></td>
621
  </tr>
622
  <tr class="even">
623
- <td><?php _e( '<strong>Automatic update from MarketPress</strong>', 'backwpup' ); ?></td>
624
  <td class="error" style="border-bottom:none;"></td>
625
  <td class="tick" style="border-bottom:none;"></td>
626
  </tr>
352
  */
353
  public static function page() {
354
 
355
+ $lang = substr( get_locale(), 0 ,2 );
356
+ if ( $lang !== 'de' ) {
357
+ $lang = 'en';
358
+ }
359
+
360
  ?>
361
  <div class="wrap" id="backwpup-page">
362
  <?php BackWPup_Admin::display_messages(); ?>
365
  <?php if ( class_exists( 'BackWPup_Pro', FALSE ) ) { ?>
366
  <div class="welcometxt">
367
  <div class="backwpup-welcome">
368
+ <img class="backwpup-banner-img" src="<?php echo BackWPup::get_plugin_data( 'URL' );?>/assets/images/backwpupbanner.png" />
369
  <h1><?php esc_html_e( 'Welcome to BackWPup Pro', 'backwpup' ); ?></h1>
370
  <p><?php esc_html_e( 'BackWPup’s job wizards make planning and scheduling your backup jobs a breeze.', 'backwpup' ); echo ' ';
371
  _e( 'Use your backup archives to save your entire WordPress installation including <code>/wp-content/</code>. Push them to an external storage service if you don’t want to save the backups on the same server. With a single backup archive you are able to restore an installation. Use a tool like phpMyAdmin or a plugin like <a href="http://wordpress.org/plugins/adminer/" target="_blank">Adminer</a> to restore your database backup files.', 'backwpup' ); ?></p>
372
  <p><?php echo str_replace( '\"','"', sprintf( __( 'Ready to <a href="%1$s">set up a backup job</a>? You can <a href="%2$s">use the wizards</a> or plan your backup in expert mode.', 'backwpup' ), network_admin_url( 'admin.php').'?page=backwpupeditjob' , network_admin_url( 'admin.php').'?page=backwpupwizard' ) ); ?></p>
373
  </div>
374
+ <?php if ( '2016-06-30' > date( 'Y-m-d' ) ) { ?>
375
+ <a href="https://www.surveymonkey.com/r/BQJZSG2"><img class="backwpup-umfage" src="<?php echo BackWPup::get_plugin_data( 'URL' );?>/assets/images/banner-survey-<?php echo $lang ?>.png" style="height:auto;margin: 26px auto;max-width:100%;" /></a>
376
+ <?php } ?>
377
  </div>
378
  <?php } else {?>
379
  <div class="welcometxt">
380
  <div class="backwpup-welcome">
381
+ <img class="backwpup-banner-img" src="<?php echo esc_attr( BackWPup::get_plugin_data( 'URL' ));?>/assets/images/backwpupbanner.png" />
382
  <h1><?php esc_html_e( 'Welcome to BackWPup', 'backwpup' ); ?></h1>
383
  <p><?php
384
  _e( 'Use your backup archives to save your entire WordPress installation including <code>/wp-content/</code>. Push them to an external storage service if you don’t want to save the backups on the same server. With a single backup archive you are able to restore an installation. Use a tool like phpMyAdmin or a plugin like <a href="http://wordpress.org/plugins/adminer/" target="_blank">Adminer</a> to restore your database backup files.', 'backwpup' ); ?></p>
385
  <p><?php esc_html_e( 'Ready to set up a backup job? Use one of the wizards to plan what you want to save.', 'backwpup' ); ?></p>
386
  </div>
387
+ <?php if ( '2016-06-30' > date( 'Y-m-d' ) ) { ?>
388
+ <a href="https://www.surveymonkey.com/r/BQJZSG2"><img class="backwpup-umfage" src="<?php echo BackWPup::get_plugin_data( 'URL' );?>/assets/images/banner-survey-<?php echo $lang ?>.png" style="height:auto;margin: 26px auto;max-width:100%;" /></a>
389
+ <?php } ?>
390
  </div>
391
  <?php } ?>
392
+ <div>
393
+ </div>
394
  <?php
395
  if ( class_exists( 'BackWPup_Pro', FALSE ) ) :
396
  $autoupdate = BackWPup_Pro_MarketPress_Autoupdate::get_instance();
528
  <td class="tick"></td>
529
  </tr>
530
  <tr class="odd">
531
+ <td><?php esc_html_e( 'Backup to S3 services (Amazon, Google Storage, Hosteurope and more)', 'backwpup' ); ?></td>
532
  <td class="tick"></td>
533
  <td class="tick"></td>
534
  </tr>
633
  <td class="tick"></td>
634
  </tr>
635
  <tr class="even">
636
+ <td><?php _e( '<strong>Automatic updates</strong>', 'backwpup' ); ?></td>
637
  <td class="error" style="border-bottom:none;"></td>
638
  <td class="tick" style="border-bottom:none;"></td>
639
  </tr>
inc/class-page-backwpup.php CHANGED
@@ -124,7 +124,7 @@ class BackWPup_Page_BackWPup {
124
  <div class="inside">
125
  <?php
126
 
127
- $rss = fetch_feed( _x( 'http://marketpress.com/news/tag/backwpup/feed/', 'BackWPup News RSS Feed URL', 'backwpup' ) );
128
 
129
  if ( is_wp_error( $rss ) ) {
130
  echo '<p>' . sprintf( __('<strong>RSS Error</strong>: %s', 'backwpup' ), $rss->get_error_message() ) . '</p>';
@@ -251,7 +251,7 @@ class BackWPup_Page_BackWPup {
251
  <div id="backwpup-thank-you" class="metabox-holder postbox backwpup-cleared-postbox backwpup-max-width">
252
  <h3 class="hndle"><span><?php _ex( 'Thank you for using BackWPup!', 'Pro teaser box', 'backwpup' ); ?></span></h3>
253
  <div class="inside">
254
- <p><img class="backwpup-banner-img" src="<?php echo BackWPup::get_plugin_data( 'URL' ) . '/assets/images/backwpupbanner-pro.png'; ?>" alt="BackWPup Banner" /></p>
255
  <h3 class="backwpup-text-center"><?php _ex( 'Get access to:', 'Pro teaser box', 'backwpup' ); ?></h3>
256
  <ul class="backwpup-text-center">
257
  <li><?php _ex( 'First-class <strong>dedicated support</strong> at MarketPress Helpdesk.', 'Pro teaser box', 'backwpup' ); ?></li>
@@ -268,6 +268,71 @@ class BackWPup_Page_BackWPup {
268
  <?php
269
  }
270
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  /**
272
  * Displaying last logs
273
  */
@@ -335,69 +400,4 @@ class BackWPup_Page_BackWPup {
335
  <?php
336
  }
337
 
338
- /**
339
- * Displaying next jobs
340
- */
341
- private static function mb_next_jobs() {
342
-
343
- if ( ! current_user_can( 'backwpup_jobs' ) )
344
- return;
345
- ?>
346
- <table class="wp-list-table widefat" cellspacing="0">
347
- <caption><?php _e( 'Next scheduled jobs', 'backwpup' ); ?></caption>
348
- <thead>
349
- <tr>
350
- <th style="width: 30%"><?php esc_html_e( 'Time', 'backwpup' ); ?></th>
351
- <th style="width: 70%"><?php esc_html_e( 'Job', 'backwpup' ); ?></th>
352
- </tr>
353
- </thead>
354
- <?php
355
- //get next jobs
356
- $mainsactive = BackWPup_Option::get_job_ids( 'activetype', 'wpcron' );
357
- sort( $mainsactive );
358
- $alternate = TRUE;
359
- // add working job if it not in active jobs
360
- $job_object = BackWPup_Job::get_working_data();
361
- if ( ! empty( $job_object ) && ! empty( $job_object->job[ 'jobid' ] ) && ! in_array($job_object->job[ 'jobid' ], $mainsactive, true ) )
362
- $mainsactive[ ] = $job_object->job[ 'jobid' ];
363
- foreach ( $mainsactive as $jobid ) {
364
- $name = BackWPup_Option::get( $jobid, 'name' );
365
- if ( ! empty( $job_object ) && $job_object->job[ 'jobid' ] == $jobid ) {
366
- $runtime = current_time( 'timestamp' ) - $job_object->job[ 'lastrun' ];
367
- if ( ! $alternate ) {
368
- echo '<tr>';
369
- $alternate = TRUE;
370
- } else {
371
- echo '<tr class="alternate">';
372
- $alternate = FALSE;
373
- }
374
- echo '<td>' . sprintf( '<span style="color:#e66f00;">' . esc_html__( 'working since %d seconds', 'backwpup' ) . '</span>', $runtime ) . '</td>';
375
- echo '<td><span style="font-weight:bold;">' . esc_html ( $job_object->job[ 'name' ] ) . '</span><br />';
376
- echo "<a style=\"color:red;\" href=\"" . wp_nonce_url( network_admin_url( 'admin.php?page=backwpupjobs&action=abort'), 'abort-job' ) . "\">" . esc_html__( 'Abort', 'backwpup' ) . "</a>";
377
- echo "</td></tr>";
378
- }
379
- else {
380
- if ( ! $alternate ) {
381
- echo '<tr>';
382
- $alternate = TRUE;
383
- } else {
384
- echo '<tr class="alternate">';
385
- $alternate = FALSE;
386
- }
387
- if ( $nextrun = wp_next_scheduled( 'backwpup_cron', array( 'id' => $jobid ) ) + ( get_option( 'gmt_offset' ) * 3600 ) )
388
- echo '<td>' . sprintf( __( '%1$s at %2$s', 'backwpup' ), date_i18n( get_option( 'date_format' ), $nextrun, TRUE ), date_i18n( get_option( 'time_format' ), $nextrun, TRUE ) ) . '</td>';
389
- else
390
- echo '<td><em>' . esc_html__( 'Not scheduled!', 'backwpup' ) . '</em></td>';
391
-
392
- echo '<td><a href="' . wp_nonce_url( network_admin_url( 'admin.php' ) . '?page=backwpupeditjob&jobid=' . $jobid, 'edit-job' ) . '" title="' . esc_attr( __( 'Edit Job', 'backwpup' ) ) . '">' . esc_html($name) . '</a></td></tr>';
393
- }
394
- }
395
- if ( empty( $mainsactive ) and ! empty( $job_object ) ) {
396
- echo '<tr><td colspan="2"><i>' . esc_html__( 'none', 'backwpup' ) . '</i></td></tr>';
397
- }
398
- ?>
399
- </table>
400
- <?php
401
- }
402
-
403
  }
124
  <div class="inside">
125
  <?php
126
 
127
+ $rss = fetch_feed( _x( 'https://backwpup.com/feed/', 'BackWPup News RSS Feed URL', 'backwpup' ) );
128
 
129
  if ( is_wp_error( $rss ) ) {
130
  echo '<p>' . sprintf( __('<strong>RSS Error</strong>: %s', 'backwpup' ), $rss->get_error_message() ) . '</p>';
251
  <div id="backwpup-thank-you" class="metabox-holder postbox backwpup-cleared-postbox backwpup-max-width">
252
  <h3 class="hndle"><span><?php _ex( 'Thank you for using BackWPup!', 'Pro teaser box', 'backwpup' ); ?></span></h3>
253
  <div class="inside">
254
+ <p><img class="backwpup-banner-img" src="<?php echo BackWPup::get_plugin_data( 'URL' ) . '/assets/images/backwpupbanner.png'; ?>" alt="BackWPup Banner" /></p>
255
  <h3 class="backwpup-text-center"><?php _ex( 'Get access to:', 'Pro teaser box', 'backwpup' ); ?></h3>
256
  <ul class="backwpup-text-center">
257
  <li><?php _ex( 'First-class <strong>dedicated support</strong> at MarketPress Helpdesk.', 'Pro teaser box', 'backwpup' ); ?></li>
268
  <?php
269
  }
270
 
271
+ /**
272
+ * Displaying next jobs
273
+ */
274
+ private static function mb_next_jobs() {
275
+
276
+ if ( ! current_user_can( 'backwpup_jobs' ) )
277
+ return;
278
+ ?>
279
+ <table class="wp-list-table widefat" cellspacing="0">
280
+ <caption><?php _e( 'Next scheduled jobs', 'backwpup' ); ?></caption>
281
+ <thead>
282
+ <tr>
283
+ <th style="width: 30%"><?php esc_html_e( 'Time', 'backwpup' ); ?></th>
284
+ <th style="width: 70%"><?php esc_html_e( 'Job', 'backwpup' ); ?></th>
285
+ </tr>
286
+ </thead>
287
+ <?php
288
+ //get next jobs
289
+ $mainsactive = BackWPup_Option::get_job_ids( 'activetype', 'wpcron' );
290
+ sort( $mainsactive );
291
+ $alternate = TRUE;
292
+ // add working job if it not in active jobs
293
+ $job_object = BackWPup_Job::get_working_data();
294
+ if ( ! empty( $job_object ) && ! empty( $job_object->job[ 'jobid' ] ) && ! in_array($job_object->job[ 'jobid' ], $mainsactive, true ) )
295
+ $mainsactive[ ] = $job_object->job[ 'jobid' ];
296
+ foreach ( $mainsactive as $jobid ) {
297
+ $name = BackWPup_Option::get( $jobid, 'name' );
298
+ if ( ! empty( $job_object ) && $job_object->job[ 'jobid' ] == $jobid ) {
299
+ $runtime = current_time( 'timestamp' ) - $job_object->job[ 'lastrun' ];
300
+ if ( ! $alternate ) {
301
+ echo '<tr>';
302
+ $alternate = TRUE;
303
+ } else {
304
+ echo '<tr class="alternate">';
305
+ $alternate = FALSE;
306
+ }
307
+ echo '<td>' . sprintf( '<span style="color:#e66f00;">' . esc_html__( 'working since %d seconds', 'backwpup' ) . '</span>', $runtime ) . '</td>';
308
+ echo '<td><span style="font-weight:bold;">' . esc_html ( $job_object->job[ 'name' ] ) . '</span><br />';
309
+ echo "<a style=\"color:red;\" href=\"" . wp_nonce_url( network_admin_url( 'admin.php?page=backwpupjobs&action=abort'), 'abort-job' ) . "\">" . esc_html__( 'Abort', 'backwpup' ) . "</a>";
310
+ echo "</td></tr>";
311
+ }
312
+ else {
313
+ if ( ! $alternate ) {
314
+ echo '<tr>';
315
+ $alternate = TRUE;
316
+ } else {
317
+ echo '<tr class="alternate">';
318
+ $alternate = FALSE;
319
+ }
320
+ if ( $nextrun = wp_next_scheduled( 'backwpup_cron', array( 'id' => $jobid ) ) + ( get_option( 'gmt_offset' ) * 3600 ) )
321
+ echo '<td>' . sprintf( __( '%1$s at %2$s', 'backwpup' ), date_i18n( get_option( 'date_format' ), $nextrun, TRUE ), date_i18n( get_option( 'time_format' ), $nextrun, TRUE ) ) . '</td>';
322
+ else
323
+ echo '<td><em>' . esc_html__( 'Not scheduled!', 'backwpup' ) . '</em></td>';
324
+
325
+ echo '<td><a href="' . wp_nonce_url( network_admin_url( 'admin.php' ) . '?page=backwpupeditjob&jobid=' . $jobid, 'edit-job' ) . '" title="' . esc_attr( __( 'Edit Job', 'backwpup' ) ) . '">' . esc_html($name) . '</a></td></tr>';
326
+ }
327
+ }
328
+ if ( empty( $mainsactive ) and ! empty( $job_object ) ) {
329
+ echo '<tr><td colspan="2"><i>' . esc_html__( 'none', 'backwpup' ) . '</i></td></tr>';
330
+ }
331
+ ?>
332
+ </table>
333
+ <?php
334
+ }
335
+
336
  /**
337
  * Displaying last logs
338
  */
400
  <?php
401
  }
402
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
403
  }
inc/class-page-jobs.php CHANGED
@@ -742,6 +742,10 @@ class BackWPup_Page_Jobs extends WP_List_Table {
742
 
743
  check_ajax_referer( 'backwpupworking_ajax_nonce' );
744
 
 
 
 
 
745
  $log_folder = get_site_option( 'backwpup_cfg_logfolder' );
746
  $log_folder = BackWPup_File::get_absolute_path( $log_folder );
747
  $logfile = isset( $_GET[ 'logfile' ] ) ? $log_folder . basename( trim( $_GET[ 'logfile' ] ) ) : NULL;
742
 
743
  check_ajax_referer( 'backwpupworking_ajax_nonce' );
744
 
745
+ if ( ! current_user_can( 'backwpup_jobs_start' ) ) {
746
+ die( '-1' );
747
+ }
748
+
749
  $log_folder = get_site_option( 'backwpup_cfg_logfolder' );
750
  $log_folder = BackWPup_File::get_absolute_path( $log_folder );
751
  $logfile = isset( $_GET[ 'logfile' ] ) ? $log_folder . basename( trim( $_GET[ 'logfile' ] ) ) : NULL;
inc/class-page-settings.php CHANGED
@@ -61,7 +61,7 @@ class BackWPup_Page_Settings {
61
  return;
62
  }
63
 
64
- update_site_option( 'backwpup_cfg_showadminbar', ! empty( $_POST[ 'showadminbar' ] ) );
65
  update_site_option( 'backwpup_cfg_showfoldersize', ! empty( $_POST[ 'showfoldersize' ] ) );
66
  if ( empty( $_POST[ 'jobstepretry' ] ) || 100 < $_POST[ 'jobstepretry' ] || 1 > $_POST[ 'jobstepretry' ] ) {
67
  $_POST[ 'jobstepretry' ] = 3;
@@ -138,8 +138,8 @@ class BackWPup_Page_Settings {
138
  <td>
139
  <fieldset>
140
  <legend class="screen-reader-text"><span><?php _e( 'Admin Bar', 'backwpup' ); ?></span></legend>
141
- <label for="showadminbar">
142
- <input name="showadminbar" type="checkbox" id="showadminbar" value="1" <?php checked( get_site_option( 'backwpup_cfg_showadminbar' ), TRUE ); ?> />
143
  <?php _e( 'Show BackWPup links in admin bar.', 'backwpup' ); ?>
144
  </label>
145
  </fieldset>
61
  return;
62
  }
63
 
64
+ update_site_option( 'backwpup_cfg_showadminbar', ! empty( $_POST[ 'showadminbarmenu' ] ) );
65
  update_site_option( 'backwpup_cfg_showfoldersize', ! empty( $_POST[ 'showfoldersize' ] ) );
66
  if ( empty( $_POST[ 'jobstepretry' ] ) || 100 < $_POST[ 'jobstepretry' ] || 1 > $_POST[ 'jobstepretry' ] ) {
67
  $_POST[ 'jobstepretry' ] = 3;
138
  <td>
139
  <fieldset>
140
  <legend class="screen-reader-text"><span><?php _e( 'Admin Bar', 'backwpup' ); ?></span></legend>
141
+ <label for="showadminbarmenu">
142
+ <input name="showadminbarmenu" type="checkbox" id="showadminbarmenu" value="1" <?php checked( get_site_option( 'backwpup_cfg_showadminbar' ), TRUE ); ?> />
143
  <?php _e( 'Show BackWPup links in admin bar.', 'backwpup' ); ?>
144
  </label>
145
  </fieldset>
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: inpsyde, danielhuesken, Bueltge, nullbyte
3
  Tags: Amazon, Amazon S3, back up, backup, chinese, cloud, cloud files, database, db backup, dropbox, dump, file, french, ftp, ftps, german, migrate, multisite, russian, schedule, sftp, storage, S3, time, upload, xml
4
  Requires at least: 3.8
5
- Tested up to: 4.5.1
6
- Stable tag: 3.3.1
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -13,6 +13,7 @@ Schedule complete automatic backups of your WordPress installation. Decide which
13
 
14
  The **backup plugin** **[BackWPup](http://backwpup.com/)** can be used to save your complete installation including /wp-content/ and push them to an external Backup Service, like **Dropbox**, **S3**, **FTP** and many more, see list below. With a single backup .zip file you are able to easily restore an installation. Please understand: this free version will not be supported as good as the [BackWPup Pro version](http://backwpup.com). With our premium version you get first class support and more features.
15
 
 
16
  * Database Backup *(needs mysqli)*
17
  * WordPress XML Export
18
  * Generate a file with installed plugins
@@ -150,23 +151,22 @@ Yes. You need to have writing access to the wp-config.php file (usually residing
150
  5. Dashboard
151
 
152
  == Upgrade Notice ==
153
- = After an upgrade from version 2 =
154
-
155
- Please check all settings after the update:
156
-
157
- * Dropbox authentication must be done again
158
- * SugarSync authentication must be done again
159
- * S3 Settings
160
- * Google Storage is now in S3
161
- * Check all your passwords
162
 
163
  == Installation ==
164
 
165
- 1. Download the BackWPup plugin.
166
- 2. Decompress the ZIP file and upload the contents of the archive into `/wp-content/plugins/`.
167
- 3. Activate the plugin through the 'Plugins' menu in WordPress
168
 
169
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
170
  = Version 3.3.1 =
171
  * Fixed: Security exploit in getting working data
172
  * Fixed: Bug in log mail sending
@@ -176,7 +176,7 @@ Please check all settings after the update:
176
  * Changed: URLs to MarketPress and Documentation
177
  * Changed: Save file list cache for one year
178
  * Changed: Use WordPress ca-bundle.crt
179
- * Removed: Server callback check on job start no it is only in Settings > Tab: Information
180
 
181
  = Version 3.3 =
182
  * Improved: Texts removed or rewritten
2
  Contributors: inpsyde, danielhuesken, Bueltge, nullbyte
3
  Tags: Amazon, Amazon S3, back up, backup, chinese, cloud, cloud files, database, db backup, dropbox, dump, file, french, ftp, ftps, german, migrate, multisite, russian, schedule, sftp, storage, S3, time, upload, xml
4
  Requires at least: 3.8
5
+ Tested up to: 4.5.2
6
+ Stable tag: 3.3.2
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
13
 
14
  The **backup plugin** **[BackWPup](http://backwpup.com/)** can be used to save your complete installation including /wp-content/ and push them to an external Backup Service, like **Dropbox**, **S3**, **FTP** and many more, see list below. With a single backup .zip file you are able to easily restore an installation. Please understand: this free version will not be supported as good as the [BackWPup Pro version](http://backwpup.com). With our premium version you get first class support and more features.
15
 
16
+
17
  * Database Backup *(needs mysqli)*
18
  * WordPress XML Export
19
  * Generate a file with installed plugins
151
  5. Dashboard
152
 
153
  == Upgrade Notice ==
 
 
 
 
 
 
 
 
 
154
 
155
  == Installation ==
156
 
157
+ [You can find a detailed tutorial in the BackWPup documentation.](http://docs.backwpup.com/article/118-install-backwpup)
 
 
158
 
159
  == Changelog ==
160
+ = Version 3.3.2 =
161
+ * Notice: For MSAzure requires PHP 5.5 in next BackWPup Version
162
+ * Changed: Colors of Warning and Error messages
163
+ * Changed: Display Blog url in log again
164
+ * Changed: Dreamhost url in S3 destination
165
+ * Changed: Adminbar menu disabled by default
166
+ * Removed: Adminbar plugin name for smaller size
167
+ * Improved: Signal handling more again
168
+ * Fixed: English log with WP 4.6
169
+
170
  = Version 3.3.1 =
171
  * Fixed: Security exploit in getting working data
172
  * Fixed: Bug in log mail sending
176
  * Changed: URLs to MarketPress and Documentation
177
  * Changed: Save file list cache for one year
178
  * Changed: Use WordPress ca-bundle.crt
179
+ * Removed: Server callback check on job start now it is only in Settings > Tab: Information
180
 
181
  = Version 3.3 =
182
  * Improved: Texts removed or rewritten