XCloner – Backup and Restore - Version 4.2.11

Version Description

  • OneDrive file upload size limit fix
Download this release

Release Info

Developer watchful
Plugin Icon 128x128 XCloner – Backup and Restore
Version 4.2.11
Comparing to
See all releases

Code changes from version 4.2.10b to 4.2.11

README.txt CHANGED
@@ -5,7 +5,7 @@ Tags: backup, database backup, cloud backup, WordPress backup, WordPress migrati
5
  Requires at least: 3.0.1
6
  Requires PHP: 7.1
7
  Tested up to: 5.4
8
- Stable tag: 4.2.10
9
 
10
  XCloner is a backup plugin that allows you to safely back up and restore your WordPress sites. You can send site backups to SFTP, Dropbox, Amazon, Google Drive, Backblaze and other locations.
11
 
@@ -116,7 +116,11 @@ Of course, schedules can be adjusted accordingly to how often you update your si
116
 
117
  == Changelog ==
118
 
119
- = 4.2.10=
 
 
 
 
120
 
121
  * Add `Local Storage` to the `Remote Storage` area
122
  * Cleanup uploaded archive after restore
5
  Requires at least: 3.0.1
6
  Requires PHP: 7.1
7
  Tested up to: 5.4
8
+ Stable tag: 4.2.11
9
 
10
  XCloner is a backup plugin that allows you to safely back up and restore your WordPress sites. You can send site backups to SFTP, Dropbox, Amazon, Google Drive, Backblaze and other locations.
11
 
116
 
117
  == Changelog ==
118
 
119
+ = 4.2.11 =
120
+
121
+ * OneDrive file upload size limit fix
122
+
123
+ = 4.2.10 =
124
 
125
  * Add `Local Storage` to the `Remote Storage` area
126
  * Cleanup uploaded archive after restore
vendor/nicolasbeauvais/flysystem-onedrive/src/OneDriveAdapter.php CHANGED
@@ -213,7 +213,7 @@ class OneDriveAdapter extends AbstractAdapter
213
  {
214
  if ($directory === '' && $this->usePath) {
215
  $endpoint = str_replace(':/', ':/', $this->getPathPrefix()).':/children';
216
- $endpoint = str_replace(':/:/','/', $endpoint);
217
  } else {
218
  $endpoint = $this->applyPathPrefix($directory).($this->usePath ? ':' : '').'/children';
219
  }
@@ -306,16 +306,26 @@ class OneDriveAdapter extends AbstractAdapter
306
  {
307
  $path = $this->applyPathPrefix($path);
308
 
 
 
 
 
 
 
 
 
309
  try {
310
  $contents = $stream = \GuzzleHttp\Psr7\stream_for($contents);
311
 
312
- $response = $this->graph->createRequest('PUT', $path.($this->usePath ? ':' : '').'/content')
313
- ->attachBody($contents)
 
 
314
  ->execute();
315
  } catch (\Exception $e) {
316
  return false;
317
  }
318
-
319
  return $this->normalizeResponse($response->getBody(), $path);
320
  }
321
 
213
  {
214
  if ($directory === '' && $this->usePath) {
215
  $endpoint = str_replace(':/', ':/', $this->getPathPrefix()).':/children';
216
+ $endpoint = str_replace(':/:/', '/', $endpoint);
217
  } else {
218
  $endpoint = $this->applyPathPrefix($directory).($this->usePath ? ':' : '').'/children';
219
  }
306
  {
307
  $path = $this->applyPathPrefix($path);
308
 
309
+ if (is_resource($contents)) {
310
+ $filesize = (fstat($contents)['size']);
311
+ } else {
312
+ $filesize = strlen($contents);
313
+ }
314
+ $response = $this->graph->createRequest('POST', $path.($this->usePath ? ':' : '').'/createUploadSession')->execute();
315
+ $uploadUrl = $response->getBody()['uploadUrl'];
316
+
317
  try {
318
  $contents = $stream = \GuzzleHttp\Psr7\stream_for($contents);
319
 
320
+ //$response = $this->graph->createRequest('PUT', $path.($this->usePath ? ':' : '').'/content')
321
+ $response = $this->graph->createRequest('PUT', $uploadUrl)
322
+ ->addHeaders(array("Content-Length" => $filesize, "Content-Range" => 'bytes 0-'.($filesize-1)."/".$filesize))
323
+ ->attachBody(($contents))
324
  ->execute();
325
  } catch (\Exception $e) {
326
  return false;
327
  }
328
+
329
  return $this->normalizeResponse($response->getBody(), $path);
330
  }
331
 
vendor/watchfulli/xcloner-core/src/Xcloner_Logger.php CHANGED
@@ -131,7 +131,7 @@ class Xcloner_Logger extends Logger
131
  */
132
  public function print_info($message, $context = array())
133
  {
134
- if (!WP_DEBUG) {
135
  echo sprintf("[%s] %s \n", date("Y-m-d H:i:s"), $message);
136
  }
137
  return parent::info($message, $context);
131
  */
132
  public function print_info($message, $context = array())
133
  {
134
+ if (php_sapi_name() == "cli" && !WP_DEBUG) {
135
  echo sprintf("[%s] %s \n", date("Y-m-d H:i:s"), $message);
136
  }
137
  return parent::info($message, $context);
xcloner.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: XCloner - Site Backup and Restore
16
  * Plugin URI: https://xcloner.com/
17
  * Description: XCloner is a tool that will help you manage your website backups, generate/restore/move so your website will be always secured! With XCloner you will be able to clone your site to any other location with just a few clicks, as well as transfer the backup archives to remote FTP, SFTP, DropBox, Amazon S3, Google Drive, WebDAV, Backblaze, Azure accounts.
18
- * Version: 4.2.10
19
  * Author: watchful
20
  * Author URI: https://watchful.net/
21
  * License: GPL-2.0+
15
  * Plugin Name: XCloner - Site Backup and Restore
16
  * Plugin URI: https://xcloner.com/
17
  * Description: XCloner is a tool that will help you manage your website backups, generate/restore/move so your website will be always secured! With XCloner you will be able to clone your site to any other location with just a few clicks, as well as transfer the backup archives to remote FTP, SFTP, DropBox, Amazon S3, Google Drive, WebDAV, Backblaze, Azure accounts.
18
+ * Version: 4.2.11
19
  * Author: watchful
20
  * Author URI: https://watchful.net/
21
  * License: GPL-2.0+