WordPress Backup and Migrate Plugin – Backup Guard - Version 1.5.6

Version Description

  • Fixed bug related to connection timeout and blocking requests
Download this release

Release Info

Developer BackupGuard
Plugin Icon 128x128 WordPress Backup and Migrate Plugin – Backup Guard
Version 1.5.6
Comparing to
See all releases

Code changes from version 1.5.5 to 1.5.6

README.txt CHANGED
@@ -6,7 +6,7 @@ Donate link: https://backup-guard.com/products/backup-wordpress
6
  Tags: backup, wordpress backup plugin, backup plugin, database backup, migrate, back up
7
  Requires at least: 3.8
8
  Tested up to: 5.6
9
- Stable tag: 1.5.5
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -167,6 +167,8 @@ When you are facing an issue of any kind with any of our products, the first thi
167
  6. Site backup customization
168
 
169
  == Changelog ==
 
 
170
 
171
  = 1.5.5 =
172
  * Banner improvement
6
  Tags: backup, wordpress backup plugin, backup plugin, database backup, migrate, back up
7
  Requires at least: 3.8
8
  Tested up to: 5.6
9
+ Stable tag: 1.5.6
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
167
  6. Site backup customization
168
 
169
  == Changelog ==
170
+ = 1.5.6 =
171
+ * Fixed bug related to connection timeout and blocking requests
172
 
173
  = 1.5.5 =
174
  * Banner improvement
backup.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Backup
5
  * Plugin URI: https://backup-guard.com/products/backup-wordpress
6
  * Description: Backup Guard is the most complete site backup and restore plugin. We offer the easiest way to backup, restore or migrate your site. You can backup your files, database or both.
7
- * Version: 1.5.5
8
  * Author: BackupGuard
9
  * Author URI: https://backup-guard.com/products/backup-wordpress
10
  * License: GPL-2.0+
4
  * Plugin Name: Backup
5
  * Plugin URI: https://backup-guard.com/products/backup-wordpress
6
  * Description: Backup Guard is the most complete site backup and restore plugin. We offer the easiest way to backup, restore or migrate your site. You can backup your files, database or both.
7
+ * Version: 1.5.6
8
  * Author: BackupGuard
9
  * Author URI: https://backup-guard.com/products/backup-wordpress
10
  * License: GPL-2.0+
com/lib/Request/SGRequestAdapterWordpress.php CHANGED
@@ -73,7 +73,7 @@ class SGRequestAdapterWordpress implements SGIRequestAdapter
73
  // $body = http_build_query($this->params, '', '&');
74
  $body = $this->params;
75
  }
76
-
77
  $args = $this->getRequestArgs();
78
  $args['body'] = $body;
79
 
@@ -85,7 +85,7 @@ class SGRequestAdapterWordpress implements SGIRequestAdapter
85
  $this->body = wp_remote_retrieve_body($response);
86
  }
87
  $this->httpCode = wp_remote_retrieve_response_code($response);
88
-
89
  $headers = wp_remote_retrieve_headers($response);
90
  if ($headers && $headers instanceof Requests_Utility_CaseInsensitiveDictionary) {
91
  $data = $headers->getAll();
@@ -101,9 +101,10 @@ class SGRequestAdapterWordpress implements SGIRequestAdapter
101
  return $this->parseResponse();
102
  }
103
 
104
- public function sendGetRequest()
105
  {
106
  $args = $this->getRequestArgs();
 
107
 
108
  if (count($this->params)) {
109
  $this->url = rtrim($this->url, '/').'/';
@@ -148,11 +149,11 @@ class SGRequestAdapterWordpress implements SGIRequestAdapter
148
  // $body = http_build_query($this->params, '', '&');
149
  $body = $this->params;
150
  }
151
-
152
  $args = $this->getRequestArgs();
153
  $args['body'] = $body;
154
  $args['method'] = $type;
155
-
156
  $response = wp_remote_request($this->url, $args);
157
  if ($this->stream && !($response instanceof WP_Error)) {
158
  $this->body = file_get_contents($response['filename']);
@@ -161,7 +162,7 @@ class SGRequestAdapterWordpress implements SGIRequestAdapter
161
  $this->body = wp_remote_retrieve_body($response);
162
  }
163
  $this->httpCode = wp_remote_retrieve_response_code($response);
164
-
165
  $headers = wp_remote_retrieve_headers($response);
166
  if ($headers && $headers instanceof Requests_Utility_CaseInsensitiveDictionary) {
167
  $data = $headers->getAll();
73
  // $body = http_build_query($this->params, '', '&');
74
  $body = $this->params;
75
  }
76
+
77
  $args = $this->getRequestArgs();
78
  $args['body'] = $body;
79
 
85
  $this->body = wp_remote_retrieve_body($response);
86
  }
87
  $this->httpCode = wp_remote_retrieve_response_code($response);
88
+
89
  $headers = wp_remote_retrieve_headers($response);
90
  if ($headers && $headers instanceof Requests_Utility_CaseInsensitiveDictionary) {
91
  $data = $headers->getAll();
101
  return $this->parseResponse();
102
  }
103
 
104
+ public function sendGetRequest($otherArgs = array())
105
  {
106
  $args = $this->getRequestArgs();
107
+ $args = array_merge($args, $otherArgs);
108
 
109
  if (count($this->params)) {
110
  $this->url = rtrim($this->url, '/').'/';
149
  // $body = http_build_query($this->params, '', '&');
150
  $body = $this->params;
151
  }
152
+
153
  $args = $this->getRequestArgs();
154
  $args['body'] = $body;
155
  $args['method'] = $type;
156
+
157
  $response = wp_remote_request($this->url, $args);
158
  if ($this->stream && !($response instanceof WP_Error)) {
159
  $this->body = file_get_contents($response['filename']);
162
  $this->body = wp_remote_retrieve_body($response);
163
  }
164
  $this->httpCode = wp_remote_retrieve_response_code($response);
165
+
166
  $headers = wp_remote_retrieve_headers($response);
167
  if ($headers && $headers instanceof Requests_Utility_CaseInsensitiveDictionary) {
168
  $data = $headers->getAll();
com/lib/SGReloadHandler.php CHANGED
@@ -30,6 +30,9 @@ class SGReloadHandler
30
  $request->setUrl($url);
31
  $request->setParams(array());
32
  $request->setHeaders(array());
33
- $request->sendGetRequest();
 
 
 
34
  }
35
  }
30
  $request->setUrl($url);
31
  $request->setParams(array());
32
  $request->setHeaders(array());
33
+ $request->sendGetRequest(array(
34
+ 'blocking' => false,
35
+ 'timeout' => 0.5
36
+ ));
37
  }
38
  }