VaultPress - Version 1.4.7

Version Description

  • Bugfix: Some servers have SSL configuration problems, which breaks the plugin when SSL verification is enforced.
Download this release

Release Info

Developer xknown
Plugin Icon 128x128 VaultPress
Version 1.4.7
Comparing to
See all releases

Code changes from version 1.4.6 to 1.4.7

class.vaultpress-ixr-ssl-client.php CHANGED
@@ -39,7 +39,7 @@ class VaultPress_IXR_SSL_Client extends IXR_Client {
39
  'method' => 'POST',
40
  'body' => $xml,
41
  'headers' => $this->headers,
42
- 'sslverify' => true,
43
  );
44
  if ( $this->timeout )
45
  $args['timeout'] = $this->timeout;
39
  'method' => 'POST',
40
  'body' => $xml,
41
  'headers' => $this->headers,
42
+ 'sslverify' => false,
43
  );
44
  if ( $this->timeout )
45
  $args['timeout'] = $this->timeout;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: automattic, apokalyptik, briancolinger, josephscott, shaunandrews,
3
  Tags: security, malware, virus, backups, scanning
4
  Requires at least: 2.9.2
5
  Tested up to: 3.5.2
6
- Stable tag: 1.4.6
7
  License: GPLv2
8
 
9
  VaultPress is a subscription service offering realtime backup, automated security scanning, and support from WordPress experts.
@@ -12,6 +12,8 @@ VaultPress is a subscription service offering realtime backup, automated securit
12
 
13
  [VaultPress](http://vaultpress.com/?utm_source=plugin-readme&utm_medium=description&utm_campaign=1.0) is a real-time backup and security scanning service designed and built by [Automattic](http://automattic.com/), the same company that operates 25+ million sites on WordPress.com.
14
 
 
 
15
  [wpvideo TxdSIdpO]
16
 
17
  For more information, check out [VaultPress.com](http://vaultpress.com/).
@@ -49,6 +51,9 @@ A VaultPress subscription is for a single WordPress site. You can purchase addit
49
  Yes, VaultPress supports Multisite installs. Each site will require its own subscription.
50
 
51
  == Changelog ==
 
 
 
52
  = 1.4.6 =
53
  * Bugfix: PHP 5.4 notices
54
  * Feature: Add the possibility to ignore frequent updates on some postmeta keys.
3
  Tags: security, malware, virus, backups, scanning
4
  Requires at least: 2.9.2
5
  Tested up to: 3.5.2
6
+ Stable tag: 1.4.7
7
  License: GPLv2
8
 
9
  VaultPress is a subscription service offering realtime backup, automated security scanning, and support from WordPress experts.
12
 
13
  [VaultPress](http://vaultpress.com/?utm_source=plugin-readme&utm_medium=description&utm_campaign=1.0) is a real-time backup and security scanning service designed and built by [Automattic](http://automattic.com/), the same company that operates 25+ million sites on WordPress.com.
14
 
15
+ The VaultPress plugin provides the required functionality to backup and synchronize every post, comment, media file, revision and dashboard settings on our servers. To start safeguarding your site, you need to sign up for a VaultPress subscription.
16
+
17
  [wpvideo TxdSIdpO]
18
 
19
  For more information, check out [VaultPress.com](http://vaultpress.com/).
51
  Yes, VaultPress supports Multisite installs. Each site will require its own subscription.
52
 
53
  == Changelog ==
54
+ = 1.4.7 =
55
+ * Bugfix: Some servers have SSL configuration problems, which breaks the plugin when SSL verification is enforced.
56
+
57
  = 1.4.6 =
58
  * Bugfix: PHP 5.4 notices
59
  * Feature: Add the possibility to ignore frequent updates on some postmeta keys.
vaultpress.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: VaultPress
4
  * Plugin URI: http://vaultpress.com/?utm_source=plugin-uri&utm_medium=plugin-description&utm_campaign=1.0
5
  * Description: Protect your content, themes, plugins, and settings with <strong>realtime backup</strong> and <strong>automated security scanning</strong> from <a href="http://vaultpress.com/?utm_source=wp-admin&amp;utm_medium=plugin-description&amp;utm_campaign=1.0" rel="nofollow">VaultPress</a>. Activate, enter your registration key, and never worry again. <a href="http://vaultpress.com/help/?utm_source=wp-admin&amp;utm_medium=plugin-description&amp;utm_campaign=1.0" rel="nofollow">Need some help?</a>
6
- * Version: 1.4.6
7
  * Author: Automattic
8
  * Author URI: http://vaultpress.com/?utm_source=author-uri&amp;utm_medium=plugin-description&amp;utm_campaign=1.0
9
  * License: GPL2+
@@ -18,7 +18,7 @@ if ( !defined( 'ABSPATH' ) )
18
  class VaultPress {
19
  var $option_name = 'vaultpress';
20
  var $db_version = 3;
21
- var $plugin_version = '1.4.6';
22
 
23
  function VaultPress() {
24
  $this->__construct();
@@ -905,23 +905,54 @@ class VaultPress {
905
  ) );
906
  }
907
 
908
- function update_firewall() {
909
  $args = array( 'timeout' => $this->get_option( 'timeout' ), 'sslverify' => true );
910
  $hostname = $this->get_option( 'hostname' );
911
- $data = wp_remote_get( "https://$hostname/service-ips", $args );
912
 
913
- if ( $data )
914
- $data = @unserialize( $data['body'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
915
 
 
 
916
  if ( $data ) {
917
  $newval = array( 'updated' => time(), 'data' => $data );
918
  $this->update_option( 'service_ips', $newval );
919
  }
920
 
921
- $external_data = wp_remote_get( "https://$hostname/service-ips-external", $args );
922
- if ( $external_data )
923
- $external_data = @unserialize( $external_data['body'] );
924
-
925
  if ( $external_data ) {
926
  $external_newval = array( 'updated' => time(), 'data' => $external_data );
927
  update_option( 'vaultpress_service_ips_external', $external_newval );
3
  * Plugin Name: VaultPress
4
  * Plugin URI: http://vaultpress.com/?utm_source=plugin-uri&amp;utm_medium=plugin-description&amp;utm_campaign=1.0
5
  * Description: Protect your content, themes, plugins, and settings with <strong>realtime backup</strong> and <strong>automated security scanning</strong> from <a href="http://vaultpress.com/?utm_source=wp-admin&amp;utm_medium=plugin-description&amp;utm_campaign=1.0" rel="nofollow">VaultPress</a>. Activate, enter your registration key, and never worry again. <a href="http://vaultpress.com/help/?utm_source=wp-admin&amp;utm_medium=plugin-description&amp;utm_campaign=1.0" rel="nofollow">Need some help?</a>
6
+ * Version: 1.4.7
7
  * Author: Automattic
8
  * Author URI: http://vaultpress.com/?utm_source=author-uri&amp;utm_medium=plugin-description&amp;utm_campaign=1.0
9
  * License: GPL2+
18
  class VaultPress {
19
  var $option_name = 'vaultpress';
20
  var $db_version = 3;
21
+ var $plugin_version = '1.4.7';
22
 
23
  function VaultPress() {
24
  $this->__construct();
905
  ) );
906
  }
907
 
908
+ function request_firewall_update( $external_services = false ) {
909
  $args = array( 'timeout' => $this->get_option( 'timeout' ), 'sslverify' => true );
910
  $hostname = $this->get_option( 'hostname' );
911
+ $path = $external_services ? 'service-ips-external' : 'service-ips';
912
 
913
+ $data = false;
914
+ $https_error = null;
915
+ $retry = 2;
916
+ do {
917
+ $retry--;
918
+ $protocol = 'http';
919
+ $args['sslverify'] = 'https' == $protocol ? true : false;
920
+ $r = wp_remote_get( $url=sprintf( "%s://%s/%s", $protocol, $hostname, $path ), $args );
921
+ if ( 200 == wp_remote_retrieve_response_code( $r ) ) {
922
+ if ( 99 == $this->get_option( 'connection_error_code' ) )
923
+ $this->clear_connection();
924
+ $data = @unserialize( wp_remote_retrieve_body( $r ) );
925
+ break;
926
+ }
927
+ if ( 'https' == $protocol )
928
+ $https_error = $r;
929
+ usleep( 100 );
930
+ } while( $retry > 0 );
931
+
932
+ $r_code = wp_remote_retrieve_response_code( $https_error );
933
+ if ( 0 == $retry && 200 != $r_code ) {
934
+ $error_message = sprintf( 'Unexpected HTTP response code %s', $r_code );
935
+ if ( false === $r_code )
936
+ $error_message = 'Unable to find an HTTP transport that supports SSL verification';
937
+ elseif ( is_wp_error( $https_error ) )
938
+ $error_message = $https_error->get_error_message();
939
+
940
+ $this->update_option( 'connection', time() );
941
+ $this->update_option( 'connection_error_code', 99 );
942
+ $this->update_option( 'connection_error_message', sprintf( __('Warning: The VaultPress plugin is using an insecure protocol because it cannot verify the identity of the VaultPress server. Please contact your hosting provider, and ask them to check that SSL certificate verification is correctly configured on this server. The request failed with the following error: "%s". If you&rsquo;re still having issues please <a href="%1$s">contact the VaultPress&nbsp;Safekeepers</a>.', 'vaultpress' ), esc_html( $error_message ), 'http://vaultpress.com/contact/' ) );
943
+ }
944
+
945
+ return $data;
946
+ }
947
 
948
+ function update_firewall() {
949
+ $data = $this->request_firewall_update();
950
  if ( $data ) {
951
  $newval = array( 'updated' => time(), 'data' => $data );
952
  $this->update_option( 'service_ips', $newval );
953
  }
954
 
955
+ $external_data = $this->request_firewall_update( false );
 
 
 
956
  if ( $external_data ) {
957
  $external_newval = array( 'updated' => time(), 'data' => $external_data );
958
  update_option( 'vaultpress_service_ips_external', $external_newval );