InfiniteWP Client - Version 1.3.16

Version Description

  • Fix: Dropbox download while restore create memory issue Fatal Error: Allowed Memory Size of __ Bytes Exhausted
Download this release

Release Info

Developer infinitewp
Plugin Icon 128x128 InfiniteWP Client
Version 1.3.16
Comparing to
See all releases

Code changes from version 1.3.15 to 1.3.16

backup.class.multicall.php CHANGED
@@ -4462,22 +4462,17 @@ function ftp_backup($historyID,$args = '')
4462
 
4463
  try {
4464
 
4465
- $file = $dropbox->download($dropbox_destination.'/'.$backup_file);
4466
- $handle = @fopen($temp, 'w');
4467
- $result = fwrite($handle, $file);
4468
- fclose($handle);
4469
-
4470
- if($result)
4471
- return $temp;
4472
- else
4473
- return false;
4474
- } catch (Exception $e) {
4475
- $this->_log($e->getMessage());
4476
- return array(
4477
- 'error' => $e->getMessage(),
4478
- 'partial' => 1
4479
- );
4480
- }
4481
  }
4482
 
4483
  /*
4462
 
4463
  try {
4464
 
4465
+ //exception should handle the errors
4466
+ $dropbox->download($dropbox_destination.'/'.$backup_file, $temp);
4467
+ return $temp;
4468
+ } catch (Exception $e) {
4469
+ $this->_log($e->getMessage());
4470
+ return array(
4471
+ 'error' => $e->getMessage(),
4472
+ 'partial' => 1
4473
+ );
4474
+ }
4475
+
 
 
 
 
 
4476
  }
4477
 
4478
  /*
backup.class.singlecall.php CHANGED
@@ -146,7 +146,6 @@ class IWP_MMB_Backup_Singlecall extends IWP_MMB_Core
146
 
147
  function set_backup_task($params){
148
  if (!empty($params)) {
149
-
150
  $this->statusLog($historyID, array('stage' => 'verification', 'status' => 'processing', 'statusMsg' => 'verificationInitiated'), $params);
151
 
152
  $this->set_resource_limit();
@@ -173,26 +172,25 @@ class IWP_MMB_Backup_Singlecall extends IWP_MMB_Core
173
 
174
  return false;
175
  }
176
-
177
 
178
- function delete_task_now($task_name){
179
- global $wpdb;
180
 
181
- $table_name = $wpdb->base_prefix . "iwp_backup_status";
182
-
183
- $tasks = $this->tasks;
184
- //unset($tasks[$task_name]);
185
-
186
-
187
- $delete_query = "DELETE FROM ".$table_name." WHERE taskName = '".$task_name."' ";
188
- $deleteRes = $wpdb->query($delete_query);
189
-
190
- $this->update_tasks($tasks);
191
- $this->cleanup();
192
-
193
- return $task_name;
194
-
195
- }
196
 
197
  /*
198
  * If Task Name not set then it's manual backup
146
 
147
  function set_backup_task($params){
148
  if (!empty($params)) {
 
149
  $this->statusLog($historyID, array('stage' => 'verification', 'status' => 'processing', 'statusMsg' => 'verificationInitiated'), $params);
150
 
151
  $this->set_resource_limit();
172
 
173
  return false;
174
  }
 
175
 
176
+ function delete_task_now($task_name){
177
+ global $wpdb;
178
 
179
+ $table_name = $wpdb->base_prefix . "iwp_backup_status";
180
+
181
+ $tasks = $this->tasks;
182
+ //unset($tasks[$task_name]);
183
+
184
+
185
+ $delete_query = "DELETE FROM ".$table_name." WHERE taskName = '".$task_name."' ";
186
+ $deleteRes = $wpdb->query($delete_query);
187
+
188
+ $this->update_tasks($tasks);
189
+ $this->cleanup();
190
+
191
+ return $task_name;
192
+
193
+ }
194
 
195
  /*
196
  * If Task Name not set then it's manual backup
init.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: InfiniteWP - Client
4
  Plugin URI: http://infinitewp.com/
5
  Description: This is the client plugin of InfiniteWP that communicates with the InfiniteWP Admin panel.
6
  Author: Revmakx
7
- Version: 1.3.15
8
  Author URI: http://www.revmakx.com
9
  */
10
  /************************************************************
@@ -26,7 +26,7 @@ Author URI: http://www.revmakx.com
26
  **************************************************************/
27
 
28
  if(!defined('IWP_MMB_CLIENT_VERSION'))
29
- define('IWP_MMB_CLIENT_VERSION', '1.3.15');
30
 
31
 
32
 
4
  Plugin URI: http://infinitewp.com/
5
  Description: This is the client plugin of InfiniteWP that communicates with the InfiniteWP Admin panel.
6
  Author: Revmakx
7
+ Version: 1.3.16
8
  Author URI: http://www.revmakx.com
9
  */
10
  /************************************************************
26
  **************************************************************/
27
 
28
  if(!defined('IWP_MMB_CLIENT_VERSION'))
29
+ define('IWP_MMB_CLIENT_VERSION', '1.3.16');
30
 
31
 
32
 
lib/dropbox.php CHANGED
@@ -136,10 +136,16 @@ class IWP_Dropbox {
136
  return $output;
137
  }
138
 
139
- public function download($path,$echo=false){
140
  $url = self::API_CONTENT_URL.self::API_VERSION_URL.'files/'.$this->root.'/'.trim($path,'/');
141
- if (!$echo)
142
- return $this->request($url);
 
 
 
 
 
 
143
  else
144
  $this->request($url,'','GET','','',true);
145
  }
@@ -258,6 +264,10 @@ class IWP_Dropbox {
258
  curl_setopt($ch,CURLOPT_INFILESIZE,$filesize);
259
  $args = (is_array($args)) ? '?'.http_build_query($args, '', '&') : $args;
260
  curl_setopt($ch, CURLOPT_URL, $url.$args);
 
 
 
 
261
  } else {
262
  $args = (is_array($args)) ? '?'.http_build_query($args, '', '&') : $args;
263
  curl_setopt($ch, CURLOPT_URL, $url.$args);
@@ -265,7 +275,9 @@ class IWP_Dropbox {
265
 
266
  curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
267
  curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
268
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 
 
269
  curl_setopt($ch, CURLOPT_SSLVERSION,1);
270
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
271
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
136
  return $output;
137
  }
138
 
139
+ public function download($path, $file, $echo=false){
140
  $url = self::API_CONTENT_URL.self::API_VERSION_URL.'files/'.$this->root.'/'.trim($path,'/');
141
+ if (!$echo){
142
+ $handle = fopen($file, 'w');
143
+ if($handle === false){
144
+ throw new IWP_DropboxException('Error while trying to open the file('.$file.') for writing');
145
+ }
146
+ $this->request($url,'','GET_DOWNLOAD_IN_FILE', $handle);
147
+ fclose($handle);
148
+ }
149
  else
150
  $this->request($url,'','GET','','',true);
151
  }
264
  curl_setopt($ch,CURLOPT_INFILESIZE,$filesize);
265
  $args = (is_array($args)) ? '?'.http_build_query($args, '', '&') : $args;
266
  curl_setopt($ch, CURLOPT_URL, $url.$args);
267
+ } elseif ($method == 'GET_DOWNLOAD_IN_FILE') {
268
+ curl_setopt($ch, CURLOPT_FILE, $filehandle);
269
+ $args = (is_array($args)) ? '?'.http_build_query($args, '', '&') : $args;
270
+ curl_setopt($ch, CURLOPT_URL, $url.$args);
271
  } else {
272
  $args = (is_array($args)) ? '?'.http_build_query($args, '', '&') : $args;
273
  curl_setopt($ch, CURLOPT_URL, $url.$args);
275
 
276
  curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
277
  curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
278
+ if($method != 'GET_DOWNLOAD_IN_FILE'){
279
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
280
+ }
281
  curl_setopt($ch, CURLOPT_SSLVERSION,1);
282
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
283
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: infinitewp
3
  Tags: admin, administration, amazon, api, authentication, automatic, dashboard, dropbox, events, integration, manage, multisite, multiple, notification, performance, s3, security, seo, stats, tracking, infinitewp, updates, backup, restore, iwp, infinite
4
  Requires at least: 3.0
5
- Tested up to: 4.2.2
6
  Stable tag: trunk
7
 
8
  Install this plugin on unlimited sites and manage them all from a central dashboard.
@@ -48,6 +48,9 @@ Credits: [Vladimir Prelovac](http://prelovac.com/vladimir) for his worker plugin
48
 
49
  == Changelog ==
50
 
 
 
 
51
  = 1.3.15 =
52
  * Improvement: Security improvement.
53
  * Fix: Parent theme update showing as child theme update.
2
  Contributors: infinitewp
3
  Tags: admin, administration, amazon, api, authentication, automatic, dashboard, dropbox, events, integration, manage, multisite, multiple, notification, performance, s3, security, seo, stats, tracking, infinitewp, updates, backup, restore, iwp, infinite
4
  Requires at least: 3.0
5
+ Tested up to: 4.2.3
6
  Stable tag: trunk
7
 
8
  Install this plugin on unlimited sites and manage them all from a central dashboard.
48
 
49
  == Changelog ==
50
 
51
+ = 1.3.16 =
52
+ * Fix: Dropbox download while restore create memory issue Fatal Error: Allowed Memory Size of __ Bytes Exhausted
53
+
54
  = 1.3.15 =
55
  * Improvement: Security improvement.
56
  * Fix: Parent theme update showing as child theme update.