BackWPup – WordPress Backup Plugin - Version 3.4.4

Version Description

Download this release

Release Info

Developer vanvox
Plugin Icon 128x128 BackWPup – WordPress Backup Plugin
Version 3.4.4
Comparing to
See all releases

Code changes from version 3.4.3 to 3.4.4

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.4.3
9
  * Text Domain: backwpup
10
  * Domain Path: /languages/
11
  * Network: true
@@ -71,7 +71,9 @@ if ( ! class_exists( 'BackWPup' ) ) {
71
  spl_autoload_register( array( $this, 'autoloader' ) );
72
 
73
  //start upgrade if needed
74
- if ( get_site_option( 'backwpup_version' ) !== self::get_plugin_data( 'Version' ) || ! wp_next_scheduled( 'backwpup_check_cleanup' ) ) {
 
 
75
  BackWPup_Install::activate();
76
  }
77
  //load pro features
@@ -89,6 +91,7 @@ if ( ! class_exists( 'BackWPup' ) ) {
89
  //add cron actions
90
  add_action( 'backwpup_cron', array( 'BackWPup_Cron', 'run' ) );
91
  add_action( 'backwpup_check_cleanup', array( 'BackWPup_Cron', 'check_cleanup' ) );
 
92
  }
93
  //if in cron the rest is not needed
94
  return;
@@ -111,24 +114,8 @@ if ( ! class_exists( 'BackWPup' ) ) {
111
  // Notices and messages in admin
112
  if ( is_admin() && current_user_can( 'backwpup' ) ) {
113
 
114
- // Work for Inpsyde widget
115
- /*
116
- $inpsyder_widget = new BackWPup_Become_Inpsyder_Widget();
117
- add_action( 'wp_dashboard_setup', array( $inpsyder_widget, 'setup_widget' ) );
118
- add_action( 'backwpup_admin_messages', array( $inpsyder_widget, 'print_plugin_widget_markup' ), 0 );
119
- BackWPup_Dismissible_Notice_Option::setup_actions(
120
- false,
121
- BackWPup_Become_Inpsyder_Widget::NOTICE_ID,
122
- 'backwpup'
123
- );
124
- */
125
-
126
- $rate_us = new BackWPup_Admin_Notice(
127
- 'rate_us',
128
- esc_html__( 'Make Us Happy and Give Your Rating', 'backwpup' ),
129
- esc_html__( 'https://wordpress.org/support/plugin/backwpup/reviews/', 'backwpup' )
130
- );
131
- $rate_us->initiate();
132
 
133
  }
134
 
5
  * Description: WordPress Backup Plugin
6
  * Author: Inpsyde GmbH
7
  * Author URI: http://inpsyde.com
8
+ * Version: 3.4.4
9
  * Text Domain: backwpup
10
  * Domain Path: /languages/
11
  * Network: true
71
  spl_autoload_register( array( $this, 'autoloader' ) );
72
 
73
  //start upgrade if needed
74
+ if ( get_site_option( 'backwpup_version' ) !== self::get_plugin_data( 'Version' )
75
+ || ! wp_next_scheduled( 'backwpup_check_cleanup' )
76
+ || ! wp_next_scheduled( 'backwpup_update_message' ) ) {
77
  BackWPup_Install::activate();
78
  }
79
  //load pro features
91
  //add cron actions
92
  add_action( 'backwpup_cron', array( 'BackWPup_Cron', 'run' ) );
93
  add_action( 'backwpup_check_cleanup', array( 'BackWPup_Cron', 'check_cleanup' ) );
94
+ add_action( 'backwpup_update_message', array( 'BackWPup_Cron', 'update_message' ) );
95
  }
96
  //if in cron the rest is not needed
97
  return;
114
  // Notices and messages in admin
115
  if ( is_admin() && current_user_can( 'backwpup' ) ) {
116
 
117
+ $admin_notice = new BackWPup_Admin_Notice();
118
+ $admin_notice->initiate();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
 
120
  }
121
 
inc/class-admin-notice.php CHANGED
@@ -23,18 +23,25 @@ class BackWPup_Admin_Notice {
23
 
24
  private $id;
25
 
 
 
26
  private $button_text;
27
 
28
  private $button_url;
29
 
30
- private $priority;
31
-
32
- public function __construct( $id, $button_text, $button_url, $priority = 20 ) {
33
  $this->has_displayed = false;
34
- $this->id = $id;
35
- $this->button_text = $button_text;
36
- $this->button_url = $button_url;
37
- $this->priority = $priority;
 
 
 
 
 
 
 
38
  }
39
 
40
  public function initiate() {
@@ -97,10 +104,7 @@ class BackWPup_Admin_Notice {
97
  );
98
 
99
  ob_start();
100
- ?><div><?php
101
- require dirname( dirname( __FILE__ ) ) . '/assets/templates/admin-notices/' .
102
- sanitize_file_name( str_replace( '_', '-', $this->id ) . '.php' );
103
- ?>
104
  <p>
105
  <a
106
  style="background: #9FC65D; border-color: #7ba617 #719c0d #719c0d; -webkit-box-shadow: 0 1px 0 #719c0d; box-shadow: 0 1px 0 #719c0d; text-shadow: 0 -1px 1px #719c0d, 1px 0 1px #719c0d, 0 1px 1px #719c0d, -1px 0 1px #719c0d;"
23
 
24
  private $id;
25
 
26
+ private $content;
27
+
28
  private $button_text;
29
 
30
  private $button_url;
31
 
32
+ public function __construct() {
 
 
33
  $this->has_displayed = false;
34
+ $language = substr( get_locale(), 0, 2 );
35
+
36
+ // Check if message exists in given language
37
+ if ( ! get_site_option( "backwpup_message_id_$language" ) ) {
38
+ // Default to English
39
+ $language = 'en';
40
+ }
41
+ $this->id = get_site_option( "backwpup_message_id_$language" );
42
+ $this->content = get_site_option( "backwpup_message_content_$language" );
43
+ $this->button_text = get_site_option( "backwpup_message_button_text_$language" );
44
+ $this->button_url = get_site_option( "backwpup_message_url_$language" );
45
  }
46
 
47
  public function initiate() {
104
  );
105
 
106
  ob_start();
107
+ ?><div><p><?php echo esc_html( $this->content ) ?></p>
 
 
 
108
  <p>
109
  <a
110
  style="background: #9FC65D; border-color: #7ba617 #719c0d #719c0d; -webkit-box-shadow: 0 1px 0 #719c0d; box-shadow: 0 1px 0 #719c0d; text-shadow: 0 -1px 1px #719c0d, 1px 0 1px #719c0d, 0 1px 1px #719c0d, -1px 0 1px #719c0d;"
inc/class-cron.php CHANGED
@@ -1,4 +1,7 @@
1
  <?php
 
 
 
2
  /**
3
  * Class for BackWPup cron methods
4
  */
@@ -122,6 +125,41 @@ class BackWPup_Cron {
122
  }
123
 
124
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
 
126
 
127
  /**
1
  <?php
2
+
3
+ use Base32\Base32;
4
+
5
  /**
6
  * Class for BackWPup cron methods
7
  */
125
  }
126
 
127
  }
128
+
129
+ /**
130
+ * Update the backend message.
131
+ */
132
+ public static function update_message() {
133
+ // Fetch message from API
134
+ $api_request = esc_url( 'http://backwpup.com/wp-json/inpsyde-messages/v1/message/' );
135
+ $api_response = wp_remote_get( $api_request );
136
+ $api_data = json_decode( wp_remote_retrieve_body( $api_response ), true );
137
+
138
+ // Add messages to options
139
+ foreach ( $api_data as $lang => $value ) {
140
+ $content = $value['content'];
141
+ $button = $value['button-text'];
142
+ $url = $value['url'];
143
+
144
+ // Calculate ID based on button text and URL
145
+ $id = "$button|$url";
146
+ // Padd to nearest 5 bytes for base32
147
+ $pad = strlen($id);
148
+ if ( $pad % 5 > 0 ) {
149
+ $pad += 5 - ($pad % 5);
150
+ $id = str_pad( $id, $pad, '|' );
151
+ }
152
+
153
+ // Encode $id so it will be unique
154
+ $id = Base32::encode( $id );
155
+
156
+ // Save in site options
157
+ update_site_option( "backwpup_message_id_$lang", $id );
158
+ update_site_option( "backwpup_message_content_$lang", $content );
159
+ update_site_option( "backwpup_message_button_text_$lang", $button );
160
+ update_site_option( "backwpup_message_url_$lang", $url );
161
+ }
162
+ }
163
 
164
 
165
  /**
inc/class-encryption.php CHANGED
@@ -126,7 +126,7 @@ class BackWPup_Encryption {
126
  /** @var BackWPup_Encryption_OpenSSL|BackWPup_Encryption_Mcrypt|BackWPup_Encryption_Fallback $cypher */
127
  $cypher = new $cypher_class( $key, $key_type );
128
 
129
- return trim( $cypher->decrypt( $string ), "\0" );
130
  }
131
 
132
  /**
126
  /** @var BackWPup_Encryption_OpenSSL|BackWPup_Encryption_Mcrypt|BackWPup_Encryption_Fallback $cypher */
127
  $cypher = new $cypher_class( $key, $key_type );
128
 
129
+ return trim( stripslashes( $cypher->decrypt( $string ) ), "\0" );
130
  }
131
 
132
  /**
inc/class-install.php CHANGED
@@ -64,6 +64,11 @@ class BackWPup_Install {
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' );
@@ -317,6 +322,7 @@ class BackWPup_Install {
317
  }
318
  }
319
  wp_clear_scheduled_hook( 'backwpup_check_cleanup' );
 
320
 
321
  $activejobs = BackWPup_Option::get_job_ids( 'activetype', 'easycron' );
322
  if ( ! empty( $activejobs ) ) {
64
  if ( ! wp_next_scheduled( 'backwpup_check_cleanup' ) ) {
65
  wp_schedule_event( time(), 'twicedaily', 'backwpup_check_cleanup' );
66
  }
67
+
68
+ // Add schedule to update backend message
69
+ if ( ! wp_next_scheduled( 'backwpup_update_message' ) ) {
70
+ wp_schedule_event( time(), 'twicedaily', 'backwpup_update_message' );
71
+ }
72
 
73
  //add capabilities to administrator role
74
  $role = get_role( 'administrator' );
322
  }
323
  }
324
  wp_clear_scheduled_hook( 'backwpup_check_cleanup' );
325
+ wp_clear_scheduled_hook( 'backwpup_update_message' );
326
 
327
  $activejobs = BackWPup_Option::get_job_ids( 'activetype', 'easycron' );
328
  if ( ! empty( $activejobs ) ) {
inc/class-job.php CHANGED
@@ -1312,12 +1312,12 @@ final class BackWPup_Job {
1312
  $wp_admin_user = get_users( array( 'role' => 'backwpup_admin', 'number' => 1 ) );
1313
  }
1314
  if ( ! empty( $wp_admin_user[0]->ID ) ) {
1315
- $expiration = time() + ( 356 * DAY_IN_SECONDS );
1316
  $manager = WP_Session_Tokens::get_instance( $wp_admin_user[0]->ID );
1317
  $token = $manager->create( $expiration );
1318
  $cookies[ LOGGED_IN_COOKIE ] = wp_generate_auth_cookie( $wp_admin_user[0]->ID, $expiration, 'logged_in', $token );
1319
  }
1320
- set_site_transient( 'backwpup_cookies', $cookies, HOUR_IN_SECONDS - 30 );
1321
  }
1322
  } else {
1323
  $cookies = '';
1312
  $wp_admin_user = get_users( array( 'role' => 'backwpup_admin', 'number' => 1 ) );
1313
  }
1314
  if ( ! empty( $wp_admin_user[0]->ID ) ) {
1315
+ $expiration = time() + ( 2 * DAY_IN_SECONDS );
1316
  $manager = WP_Session_Tokens::get_instance( $wp_admin_user[0]->ID );
1317
  $token = $manager->create( $expiration );
1318
  $cookies[ LOGGED_IN_COOKIE ] = wp_generate_auth_cookie( $wp_admin_user[0]->ID, $expiration, 'logged_in', $token );
1319
  }
1320
+ set_site_transient( 'backwpup_cookies', $cookies, 2 * DAY_IN_SECONDS );
1321
  }
1322
  } else {
1323
  $cookies = '';
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: inpsyde, cocreation, 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.9
5
- Tested up to: 4.8.2
6
  Requires PHP: 5.3
7
- Stable tag: 3.4.3
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -14,8 +14,6 @@ Schedule complete automatic backups of your WordPress installation. Decide which
14
 
15
  The **backup plugin** **[BackWPup](https://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](https://backwpup.com). With our premium version you get first class support and more features.
16
 
17
- Already seen? **You downloaded BackWPup more than 5 million times!** We want to celebrate that! With a **50% discount** on all our BackWPup PRO licences! Until October 31st, you get all BackWPup PRO licences with further functionalities at half price. [More information](https://backwpup.com/?utm_source=wordpress.org&utm_campaign=5MillDownloads&utm_medium=Link#buy).
18
-
19
  * Database Backup *(needs mysqli)*
20
  * WordPress XML Export
21
  * Generate a file with installed plugins
@@ -159,6 +157,10 @@ Yes. You need to have writing access to the wp-config.php file (usually residing
159
  [You can find a detailed tutorial in the BackWPup documentation.](http://docs.backwpup.com/article/118-install-backwpup)
160
 
161
  == Changelog ==
 
 
 
 
162
  = Version 3.4.3 =
163
  * Fixed: No longer show hashes on job edit page.
164
  * Fixed: Compatibility with Sunrise.
2
  Contributors: inpsyde, cocreation, 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.9
5
+ Tested up to: 4.9.1
6
  Requires PHP: 5.3
7
+ Stable tag: 3.4.4
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
14
 
15
  The **backup plugin** **[BackWPup](https://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](https://backwpup.com). With our premium version you get first class support and more features.
16
 
 
 
17
  * Database Backup *(needs mysqli)*
18
  * WordPress XML Export
19
  * Generate a file with installed plugins
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.4.4 =
161
+ * Fixed: Security issue that created too many sessions.
162
+ * Fixed: Correct decryption of passwords when escaped.
163
+
164
  = Version 3.4.3 =
165
  * Fixed: No longer show hashes on job edit page.
166
  * Fixed: Compatibility with Sunrise.
uninstall.php CHANGED
@@ -15,4 +15,18 @@ if ( ! class_exists( 'BackWPup' ) ) {
15
  $wpdb->query( "DELETE FROM " . $wpdb->sitemeta . " WHERE meta_key LIKE '%backwpup_%' " );
16
  else
17
  $wpdb->query( "DELETE FROM " . $wpdb->options . " WHERE option_name LIKE '%backwpup_%' " );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  }
15
  $wpdb->query( "DELETE FROM " . $wpdb->sitemeta . " WHERE meta_key LIKE '%backwpup_%' " );
16
  else
17
  $wpdb->query( "DELETE FROM " . $wpdb->options . " WHERE option_name LIKE '%backwpup_%' " );
18
+
19
+ //delete Backwpup user roles
20
+ $backWPUpRoles = array(
21
+ "backwpup_admin",
22
+ "backwpup_check",
23
+ "backwpup_helper"
24
+ );
25
+
26
+ foreach ( $backWPUpRoles as $backWPUpRole ) {
27
+ if ( get_role( $backWPUpRole ) ) {
28
+ remove_role( $backWPUpRole );
29
+ }
30
+ }
31
+
32
  }