Migrate Guru: Migrate & Clone WordPress Free - Version 4.35

Version Description

  • scanlist and filelist functions improved
Download this release

Release Info

Developer ritesh.soni36
Plugin Icon 128x128 Migrate Guru: Migrate & Clone WordPress Free
Version 4.35
Comparing to
See all releases

Code changes from version 4.31 to 4.35

Files changed (4) hide show
  1. callback/wings/fs.php +62 -20
  2. info.php +1 -1
  3. migrateguru.php +1 -1
  4. readme.txt +7 -4
callback/wings/fs.php CHANGED
@@ -14,7 +14,7 @@ class BVFSCallback extends BVCallbackBase {
14
  $this->account = $callback_handler->account;
15
  }
16
 
17
- function fileStat($relfile) {
18
  $absfile = ABSPATH.$relfile;
19
  $fdata = array();
20
  $fdata["filename"] = $relfile;
@@ -26,6 +26,9 @@ class BVFSCallback extends BVCallbackBase {
26
  if (is_link($absfile)) {
27
  $fdata["link"] = @readlink($absfile);
28
  }
 
 
 
29
  } else {
30
  $fdata["failed"] = true;
31
  }
@@ -78,8 +81,9 @@ class BVFSCallback extends BVCallbackBase {
78
  return array("status" => "done");
79
  }
80
 
81
- function scanFiles($initdir = "./", $offset = 0, $limit = 0, $bsize = 512, $recurse = true) {
82
  $i = 0;
 
83
  $dirs = array();
84
  $dirs[] = $initdir;
85
  $bfc = 0;
@@ -93,6 +97,9 @@ class BVFSCallback extends BVCallbackBase {
93
  if ($file == '.' || $file == '..') { continue; }
94
  $relfile = $dir.$file;
95
  $absfile = ABSPATH.$relfile;
 
 
 
96
  if (is_dir($absfile) && !is_link($absfile)) {
97
  $dirs[] = $relfile."/";
98
  }
@@ -103,7 +110,7 @@ class BVFSCallback extends BVCallbackBase {
103
  $i = count($dirs);
104
  break;
105
  }
106
- $bfa[] = $this->fileStat($relfile);
107
  $bfc++;
108
  if ($bfc == $bsize) {
109
  $str = serialize($bfa);
@@ -122,7 +129,8 @@ class BVFSCallback extends BVCallbackBase {
122
  $str = serialize($bfa);
123
  $this->stream->writeStream($str);
124
  }
125
- return array("status" => "done");
 
126
  }
127
 
128
  function calculateMd5($absfile, $fdata, $offset, $limit, $bsize) {
@@ -256,15 +264,29 @@ class BVFSCallback extends BVCallbackBase {
256
  $resp = $this->scanFilesUsingGlob($initdir, $offset, $limit, $bsize, $recurse, $regex);
257
  break;
258
  case "scanfiles":
259
- $initdir = urldecode($params['initdir']);
260
- $offset = intval(urldecode($params['offset']));
261
- $limit = intval(urldecode($params['limit']));
 
 
262
  $bsize = intval(urldecode($params['bsize']));
263
- $recurse = true;
264
- if (array_key_exists('recurse', $params) && $params["recurse"] == "false") {
265
- $recurse = false;
 
 
 
 
 
 
 
 
 
 
 
 
266
  }
267
- $resp = $this->scanFiles($initdir, $offset, $limit, $bsize, $recurse);
268
  break;
269
  case "getfilesstats":
270
  $files = $params['files'];
@@ -285,17 +307,37 @@ class BVFSCallback extends BVCallbackBase {
285
  $resp = $this->uploadFiles($files, $offset, $limit, $bsize);
286
  break;
287
  case "filelist":
288
- $initdir = $params['initdir'];
289
- $glob_option = GLOB_MARK;
290
- if(array_key_exists('onlydir', $params)) {
291
- $glob_option = GLOB_ONLYDIR;
 
 
292
  }
293
- $regex = "*";
294
- if(array_key_exists('regex', $params)){
295
- $regex = $params['regex'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
296
  }
297
- $directoryList = glob($initdir.$regex, $glob_option);
298
- $resp = $this->getFilesStats($directoryList);
299
  break;
300
  case "dirsexists":
301
  $resp = array();
14
  $this->account = $callback_handler->account;
15
  }
16
 
17
+ function fileStat($relfile, $md5 = false) {
18
  $absfile = ABSPATH.$relfile;
19
  $fdata = array();
20
  $fdata["filename"] = $relfile;
26
  if (is_link($absfile)) {
27
  $fdata["link"] = @readlink($absfile);
28
  }
29
+ if ($md5 === true) {
30
+ $fdata["md5"] = $this->calculateMd5($absfile, array(), 0, 0, 0);
31
+ }
32
  } else {
33
  $fdata["failed"] = true;
34
  }
81
  return array("status" => "done");
82
  }
83
 
84
+ function scanFiles($initdir = "./", $offset = 0, $limit = 0, $bsize = 512, $recurse = true, $md5 = false) {
85
  $i = 0;
86
+ $links = array();
87
  $dirs = array();
88
  $dirs[] = $initdir;
89
  $bfc = 0;
97
  if ($file == '.' || $file == '..') { continue; }
98
  $relfile = $dir.$file;
99
  $absfile = ABSPATH.$relfile;
100
+ if (is_link($absfile)) {
101
+ $links[] = $relfile;
102
+ }
103
  if (is_dir($absfile) && !is_link($absfile)) {
104
  $dirs[] = $relfile."/";
105
  }
110
  $i = count($dirs);
111
  break;
112
  }
113
+ $bfa[] = $this->fileStat($relfile, $md5);
114
  $bfc++;
115
  if ($bfc == $bsize) {
116
  $str = serialize($bfa);
129
  $str = serialize($bfa);
130
  $this->stream->writeStream($str);
131
  }
132
+
133
+ return $links;
134
  }
135
 
136
  function calculateMd5($absfile, $fdata, $offset, $limit, $bsize) {
264
  $resp = $this->scanFilesUsingGlob($initdir, $offset, $limit, $bsize, $recurse, $regex);
265
  break;
266
  case "scanfiles":
267
+ $links = array();
268
+ $dir_options = array();
269
+ if (array_key_exists('dir_options', $params)) {
270
+ $dir_options = $params['dir_options'];
271
+ }
272
  $bsize = intval(urldecode($params['bsize']));
273
+ foreach($dir_options as $option) {
274
+ $dir = urldecode($option['dir']);
275
+ $offset = intval(urldecode($option['offset']));
276
+ $limit = intval(urldecode($option['limit']));
277
+ $recurse = true;
278
+ if (array_key_exists('recurse', $option) && $option["recurse"] == "false") {
279
+ $recurse = false;
280
+ }
281
+ $md5 = true;
282
+ if (array_key_exists('md5', $option) && $option["md5"] == "false") {
283
+ $md5 = false;
284
+ }
285
+
286
+ $_links = $this->scanFiles($dir, $offset, $limit, $bsize, $recurse, $md5);
287
+ $links = array_merge($links, $_links);
288
  }
289
+ $resp = array("status" => "done", "links" => $links);
290
  break;
291
  case "getfilesstats":
292
  $files = $params['files'];
307
  $resp = $this->uploadFiles($files, $offset, $limit, $bsize);
308
  break;
309
  case "filelist":
310
+ $dir_options = array();
311
+ if (array_key_exists('dir_options', $params)) {
312
+ $dir_options = $params['dir_options'];
313
+ }
314
+ if (array_key_exists('chdir', $params)) {
315
+ chdir(ABSPATH);
316
  }
317
+ $resp = array();
318
+ foreach($dir_options as $options) {
319
+ $glob_option = 0;
320
+ if (array_key_exists('onlydir', $options)) {
321
+ $glob_option = GLOB_ONLYDIR;
322
+ }
323
+
324
+ $regexes = array("*", ".*");
325
+ if (array_key_exists('regex', $options)) {
326
+ $regexes = array($options['regex']);
327
+ }
328
+
329
+ $md5 = false;
330
+ if (array_key_exists('md5', $options)) {
331
+ $md5 = $options['md5'];
332
+ }
333
+
334
+ $directoryList = array();
335
+
336
+ foreach($regexes as $regex) {
337
+ $directoryList = array_merge($directoryList, glob($options['dir'].$regex, $glob_option));
338
+ }
339
+ $resp[$options['dir']] = $this->getFilesStats($directoryList, 0, 0, 0, $md5);
340
  }
 
 
341
  break;
342
  case "dirsexists":
343
  $resp = array();
info.php CHANGED
@@ -9,7 +9,7 @@ if (!class_exists('MGInfo')) :
9
  public $badgeinfo = 'bvmgbadge';
10
  public $ip_header_option = 'bvmgipheader';
11
  public $brand_option = 'bvmgbrand';
12
- public $version = '4.31';
13
  public $webpage = 'https://www.migrateguru.com';
14
  public $appurl = 'https://mg.blogvault.net';
15
  public $slug = 'migrate-guru/migrateguru.php';
9
  public $badgeinfo = 'bvmgbadge';
10
  public $ip_header_option = 'bvmgipheader';
11
  public $brand_option = 'bvmgbrand';
12
+ public $version = '4.35';
13
  public $webpage = 'https://www.migrateguru.com';
14
  public $appurl = 'https://mg.blogvault.net';
15
  public $slug = 'migrate-guru/migrateguru.php';
migrateguru.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://www.migrateguru.com
5
  Description: Migrating your site(s) to any WordPress Hosting platform has never been so easy.
6
  Author: Migrate Guru
7
  Author URI: http://www.migrateguru.com
8
- Version: 4.31
9
  Network: True
10
  */
11
 
5
  Description: Migrating your site(s) to any WordPress Hosting platform has never been so easy.
6
  Author: Migrate Guru
7
  Author URI: http://www.migrateguru.com
8
+ Version: 4.35
9
  Network: True
10
  */
11
 
readme.txt CHANGED
@@ -4,9 +4,9 @@ Tags: migrate, migrate WordPress, WordPress migration, migration, clone, transfe
4
  Plugin URI: https://www.migrateguru.com/
5
  Donate link: https://www.migrateguru.com/
6
  Requires at least: 4.0
7
- Tested up to: 5.4
8
  Requires PHP: 5.4.0
9
- Stable tag: 4.31
10
  License: GPLv2 or later
11
  License URI: [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)
12
 
@@ -70,11 +70,11 @@ Currently we don't support:
70
  3. Choose the destination web host that you want to clone your website to, enter details.
71
  4. Click ‘Migrate’.
72
 
73
- = PROUD MIGRATION PARTNERS of WP Engine and Pantheon =
74
 
75
  = SUPPORTS ALL 5,000+ WEB HOSTS AROUND THE WORLD =
76
 
77
- WPEngine, Pantheon, FlyWheel, LiquidWeb, Cloudways, Savvii, DigitalOcean, Hostgator, Godaddy, Bluehost, SiteGround, Kinsta, AWS, Pressable, Webhostingtalk, Inmotion Hosting, Softlayer, Reverbnation, Homestead, Site5, Linode, Fatcow, Dreamhost, Liquid Web, Rackspace, etc.
78
 
79
  == Installation ==
80
 
@@ -132,6 +132,9 @@ Yes, we do. You can access it here: https://migrateguru.freshdesk.com/support/ho
132
  6. Click ‘Migrate’.
133
 
134
  == Changelog =
 
 
 
135
  = 4.31 =
136
  * Fetching Mysql Version
137
  * Robust data fetch APIs
4
  Plugin URI: https://www.migrateguru.com/
5
  Donate link: https://www.migrateguru.com/
6
  Requires at least: 4.0
7
+ Tested up to: 5.7
8
  Requires PHP: 5.4.0
9
+ Stable tag: 4.35
10
  License: GPLv2 or later
11
  License URI: [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)
12
 
70
  3. Choose the destination web host that you want to clone your website to, enter details.
71
  4. Click ‘Migrate’.
72
 
73
+ = PROUD MIGRATION PARTNERS of WP Engine, Pantheon and DreamHost =
74
 
75
  = SUPPORTS ALL 5,000+ WEB HOSTS AROUND THE WORLD =
76
 
77
+ WPEngine, Pantheon, FlyWheel, LiquidWeb, Cloudways, Savvii, DigitalOcean, Hostgator, Godaddy, Bluehost, SiteGround, Kinsta, AWS, Pressable, Webhostingtalk, Inmotion Hosting, Softlayer, Reverbnation, Homestead, Site5, Linode, Fatcow, DreamHost, Liquid Web, Rackspace, etc.
78
 
79
  == Installation ==
80
 
132
  6. Click ‘Migrate’.
133
 
134
  == Changelog =
135
+ = 4.35 =
136
+ * scanlist and filelist functions improved
137
+
138
  = 4.31 =
139
  * Fetching Mysql Version
140
  * Robust data fetch APIs