Version Description
Download this release
Release Info
Developer | boldgrid |
Plugin | Total Upkeep – WordPress Backup Plugin plus Restore & Migrate by BoldGrid |
Version | issue-494-202111301428 |
Comparing to | |
See all releases |
Code changes from version issue-494-202111291554 to issue-494-202111301428
admin/class-boldgrid-backup-admin-core.php
CHANGED
@@ -1379,31 +1379,45 @@ class Boldgrid_Backup_Admin_Core {
|
|
1379 |
public function get_filelist( $dirpath ) {
|
1380 |
|
1381 |
// If this is a node_modules folder, do not iterate through it.
|
|
|
1382 |
if ( false !== strpos( $dirpath, '/node_modules' ) ) {
|
1383 |
return [];
|
1384 |
}
|
|
|
1385 |
|
1386 |
// Connect to the WordPress Filesystem API.
|
|
|
1387 |
global $wp_filesystem;
|
|
|
1388 |
|
1389 |
// Validate input.
|
|
|
1390 |
if ( empty( $dirpath ) || ! $wp_filesystem->is_readable( $dirpath ) ) {
|
1391 |
return [];
|
1392 |
}
|
|
|
1393 |
|
1394 |
// Remove any training slash in dirpath.
|
|
|
1395 |
$dirpath = untrailingslashit( $dirpath );
|
|
|
1396 |
|
1397 |
// Mark the base directory, if not set (the first run).
|
|
|
1398 |
if ( empty( $this->filelist_basedir ) ) {
|
1399 |
$this->filelist_basedir = $dirpath;
|
1400 |
}
|
|
|
1401 |
|
1402 |
// Get the non-recursive directory listing for the specified path.
|
|
|
1403 |
$dirlist = $wp_filesystem->dirlist( $dirpath, true, false );
|
|
|
1404 |
|
1405 |
// Initialize $filelist.
|
|
|
1406 |
$filelist = [];
|
|
|
1407 |
|
1408 |
/*
|
1409 |
* Add empty directory.
|
@@ -1414,6 +1428,7 @@ class Boldgrid_Backup_Admin_Core {
|
|
1414 |
* Previously we used Boldgrid_Backup_Admin_Compressor_Php_Zip::add_dirs
|
1415 |
* to add all empty directories, but that method is no longer needed.
|
1416 |
*/
|
|
|
1417 |
if ( empty( $dirlist ) ) {
|
1418 |
$filelist[] = [
|
1419 |
$dirpath,
|
@@ -1423,8 +1438,10 @@ class Boldgrid_Backup_Admin_Core {
|
|
1423 |
'd',
|
1424 |
];
|
1425 |
}
|
|
|
1426 |
|
1427 |
// Sort the dirlist array by filename.
|
|
|
1428 |
uasort(
|
1429 |
$dirlist,
|
1430 |
function ( $a, $b ) {
|
@@ -1439,10 +1456,13 @@ class Boldgrid_Backup_Admin_Core {
|
|
1439 |
return 0;
|
1440 |
}
|
1441 |
);
|
|
|
1442 |
|
1443 |
// Perform conversion.
|
|
|
1444 |
foreach ( $dirlist as $fileinfo ) {
|
1445 |
// If item is a directory, then recurse, merge, and continue.
|
|
|
1446 |
if ( 'd' === $fileinfo['type'] ) {
|
1447 |
$filelist_add = $this->get_filelist( $dirpath . '/' . $fileinfo['name'] );
|
1448 |
|
@@ -1450,22 +1470,31 @@ class Boldgrid_Backup_Admin_Core {
|
|
1450 |
|
1451 |
continue;
|
1452 |
}
|
|
|
1453 |
|
1454 |
// Get the file path.
|
|
|
1455 |
$filepath = $dirpath . '/' . $fileinfo['name'];
|
|
|
1456 |
|
1457 |
// The relative path inside the ZIP file.
|
|
|
1458 |
$relative_path = substr( $filepath, strlen( $this->filelist_basedir ) + 1 );
|
|
|
1459 |
|
1460 |
// For files, add to the filelist array.
|
|
|
1461 |
$filelist[] = [
|
1462 |
$filepath,
|
1463 |
$relative_path,
|
1464 |
$fileinfo['size'],
|
1465 |
];
|
|
|
1466 |
}
|
|
|
1467 |
|
1468 |
// Return the array.
|
|
|
1469 |
return $filelist;
|
1470 |
}
|
1471 |
|
1379 |
public function get_filelist( $dirpath ) {
|
1380 |
|
1381 |
// If this is a node_modules folder, do not iterate through it.
|
1382 |
+
$this->logger->add( 'before node_modules folder check' );
|
1383 |
if ( false !== strpos( $dirpath, '/node_modules' ) ) {
|
1384 |
return [];
|
1385 |
}
|
1386 |
+
$this->logger->add( 'after node_modules folder check' );
|
1387 |
|
1388 |
// Connect to the WordPress Filesystem API.
|
1389 |
+
$this->logger->add( 'before $wp_filesystem global' );
|
1390 |
global $wp_filesystem;
|
1391 |
+
$this->logger->add( 'after $wp_filesystem global' );
|
1392 |
|
1393 |
// Validate input.
|
1394 |
+
$this->logger->add( 'before validate input' );
|
1395 |
if ( empty( $dirpath ) || ! $wp_filesystem->is_readable( $dirpath ) ) {
|
1396 |
return [];
|
1397 |
}
|
1398 |
+
$this->logger->add( 'after validate input' );
|
1399 |
|
1400 |
// Remove any training slash in dirpath.
|
1401 |
+
$this->logger->add( 'before remove trailing slash dirpath' );
|
1402 |
$dirpath = untrailingslashit( $dirpath );
|
1403 |
+
$this->logger->add( 'after remove trailing slash dirpath' );
|
1404 |
|
1405 |
// Mark the base directory, if not set (the first run).
|
1406 |
+
$this->logger->add( 'before mark the base directory' );
|
1407 |
if ( empty( $this->filelist_basedir ) ) {
|
1408 |
$this->filelist_basedir = $dirpath;
|
1409 |
}
|
1410 |
+
$this->logger->add( 'after mark the base directory' );
|
1411 |
|
1412 |
// Get the non-recursive directory listing for the specified path.
|
1413 |
+
$this->logger->add( 'before get-nonrecursive directory listing' );
|
1414 |
$dirlist = $wp_filesystem->dirlist( $dirpath, true, false );
|
1415 |
+
$this->logger->add( 'after get-nonrecursive directory listing' );
|
1416 |
|
1417 |
// Initialize $filelist.
|
1418 |
+
$this->logger->add( 'before initialize $filelist' );
|
1419 |
$filelist = [];
|
1420 |
+
$this->logger->add( 'after initialize $filelist' );
|
1421 |
|
1422 |
/*
|
1423 |
* Add empty directory.
|
1428 |
* Previously we used Boldgrid_Backup_Admin_Compressor_Php_Zip::add_dirs
|
1429 |
* to add all empty directories, but that method is no longer needed.
|
1430 |
*/
|
1431 |
+
$this->logger->add( 'before add empty directory' );
|
1432 |
if ( empty( $dirlist ) ) {
|
1433 |
$filelist[] = [
|
1434 |
$dirpath,
|
1438 |
'd',
|
1439 |
];
|
1440 |
}
|
1441 |
+
$this->logger->add( 'after add empty directory' );
|
1442 |
|
1443 |
// Sort the dirlist array by filename.
|
1444 |
+
$this->logger->add( 'before sort dirlist array by filename' );
|
1445 |
uasort(
|
1446 |
$dirlist,
|
1447 |
function ( $a, $b ) {
|
1456 |
return 0;
|
1457 |
}
|
1458 |
);
|
1459 |
+
$this->logger->add( 'after sort dirlist array by filename' );
|
1460 |
|
1461 |
// Perform conversion.
|
1462 |
+
$this->logger->add( 'before perform conversion' );
|
1463 |
foreach ( $dirlist as $fileinfo ) {
|
1464 |
// If item is a directory, then recurse, merge, and continue.
|
1465 |
+
$this->logger->add( 'before if item is a directory' );
|
1466 |
if ( 'd' === $fileinfo['type'] ) {
|
1467 |
$filelist_add = $this->get_filelist( $dirpath . '/' . $fileinfo['name'] );
|
1468 |
|
1470 |
|
1471 |
continue;
|
1472 |
}
|
1473 |
+
$this->logger->add( 'after if item is a directory' );
|
1474 |
|
1475 |
// Get the file path.
|
1476 |
+
$this->logger->add( 'before get the file path' );
|
1477 |
$filepath = $dirpath . '/' . $fileinfo['name'];
|
1478 |
+
$this->logger->add( 'after get the file path' );
|
1479 |
|
1480 |
// The relative path inside the ZIP file.
|
1481 |
+
$this->logger->add( 'before relative path in ZIP' );
|
1482 |
$relative_path = substr( $filepath, strlen( $this->filelist_basedir ) + 1 );
|
1483 |
+
$this->logger->add( 'after relative path in ZIP' );
|
1484 |
|
1485 |
// For files, add to the filelist array.
|
1486 |
+
$this->logger->add( 'before add files to filelist array' );
|
1487 |
$filelist[] = [
|
1488 |
$filepath,
|
1489 |
$relative_path,
|
1490 |
$fileinfo['size'],
|
1491 |
];
|
1492 |
+
$this->logger->add( 'before add files to filelist array' );
|
1493 |
}
|
1494 |
+
$this->logger->add( 'before perform conversion' );
|
1495 |
|
1496 |
// Return the array.
|
1497 |
+
$this->logger->add( 'before array return' );
|
1498 |
return $filelist;
|
1499 |
}
|
1500 |
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit58e1147593d93966915ab6e21f807783::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -22,15 +22,15 @@ class ComposerAutoloaderInitc59d7ad9acee448e52ddf6373e42e912
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
-
call_user_func(\Composer\Autoload\
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
@@ -51,19 +51,19 @@ class ComposerAutoloaderInitc59d7ad9acee448e52ddf6373e42e912
|
|
51 |
$loader->register(true);
|
52 |
|
53 |
if ($useStaticLoader) {
|
54 |
-
$includeFiles = Composer\Autoload\
|
55 |
} else {
|
56 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
}
|
58 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
-
|
60 |
}
|
61 |
|
62 |
return $loader;
|
63 |
}
|
64 |
}
|
65 |
|
66 |
-
function
|
67 |
{
|
68 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
69 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit58e1147593d93966915ab6e21f807783
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInit58e1147593d93966915ab6e21f807783', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit58e1147593d93966915ab6e21f807783', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit58e1147593d93966915ab6e21f807783::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
51 |
$loader->register(true);
|
52 |
|
53 |
if ($useStaticLoader) {
|
54 |
+
$includeFiles = Composer\Autoload\ComposerStaticInit58e1147593d93966915ab6e21f807783::$files;
|
55 |
} else {
|
56 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
}
|
58 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
+
composerRequire58e1147593d93966915ab6e21f807783($fileIdentifier, $file);
|
60 |
}
|
61 |
|
62 |
return $loader;
|
63 |
}
|
64 |
}
|
65 |
|
66 |
+
function composerRequire58e1147593d93966915ab6e21f807783($fileIdentifier, $file)
|
67 |
{
|
68 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
69 |
require $file;
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
|
@@ -91,9 +91,9 @@ class ComposerStaticInitc59d7ad9acee448e52ddf6373e42e912
|
|
91 |
public static function getInitializer(ClassLoader $loader)
|
92 |
{
|
93 |
return \Closure::bind(function () use ($loader) {
|
94 |
-
$loader->prefixLengthsPsr4 =
|
95 |
-
$loader->prefixDirsPsr4 =
|
96 |
-
$loader->classMap =
|
97 |
|
98 |
}, null, ClassLoader::class);
|
99 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit58e1147593d93966915ab6e21f807783
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
|
91 |
public static function getInitializer(ClassLoader $loader)
|
92 |
{
|
93 |
return \Closure::bind(function () use ($loader) {
|
94 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit58e1147593d93966915ab6e21f807783::$prefixLengthsPsr4;
|
95 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit58e1147593d93966915ab6e21f807783::$prefixDirsPsr4;
|
96 |
+
$loader->classMap = ComposerStaticInit58e1147593d93966915ab6e21f807783::$classMap;
|
97 |
|
98 |
}, null, ClassLoader::class);
|
99 |
}
|