Version Description
Download this release
Release Info
Developer | boldgrid |
Plugin | Total Upkeep – WordPress Backup Plugin plus Restore & Migrate by BoldGrid |
Version | issue-494-202112011618 |
Comparing to | |
See all releases |
Code changes from version issue-494-202112011135 to issue-494-202112011618
admin/class-boldgrid-backup-admin-core.php
CHANGED
@@ -1389,10 +1389,16 @@ class Boldgrid_Backup_Admin_Core {
|
|
1389 |
global $wp_filesystem;
|
1390 |
|
1391 |
// Validate input.
|
|
|
|
|
1392 |
if ( empty( $dirpath ) || ! $wp_filesystem->is_readable( $dirpath ) ) {
|
1393 |
return [];
|
1394 |
}
|
1395 |
|
|
|
|
|
|
|
|
|
1396 |
// Remove any training slash in dirpath.
|
1397 |
$dirpath = untrailingslashit( $dirpath );
|
1398 |
|
@@ -1402,8 +1408,14 @@ class Boldgrid_Backup_Admin_Core {
|
|
1402 |
}
|
1403 |
|
1404 |
// Get the non-recursive directory listing for the specified path.
|
|
|
|
|
1405 |
$dirlist = $wp_filesystem->dirlist( $dirpath, true, false );
|
1406 |
|
|
|
|
|
|
|
|
|
1407 |
// Initialize $filelist.
|
1408 |
$filelist = [];
|
1409 |
|
@@ -1487,63 +1499,46 @@ class Boldgrid_Backup_Admin_Core {
|
|
1487 |
public function get_filtered_filelist( $dirpath = ABSPATH ) {
|
1488 |
|
1489 |
// Validate input.
|
1490 |
-
$this->logger->add( 'before validate input' );
|
1491 |
if ( empty( $dirpath ) || ! $this->wp_filesystem->is_readable( $dirpath ) ) {
|
1492 |
return [];
|
1493 |
}
|
1494 |
-
|
1495 |
// Get the recursive directory listing for the specified path.
|
1496 |
-
$this->logger->add( 'before recursive directory listing' );
|
1497 |
$filelist = $this->get_filelist( $dirpath );
|
1498 |
-
|
1499 |
// If no files were found, then return an empty array.
|
1500 |
-
$this->logger->add( 'before empty file array' );
|
1501 |
if ( empty( $filelist ) ) {
|
1502 |
return [];
|
1503 |
}
|
1504 |
-
$this->logger->add( 'after empty file array' );
|
1505 |
|
1506 |
// Initialize $new_filelist.
|
1507 |
-
$this->logger->add( 'before $new_filelist initialize' );
|
1508 |
$new_filelist = [];
|
1509 |
-
$this->logger->add( 'after $new_filelist initialize' );
|
1510 |
// Filter the filelist array.
|
1511 |
-
$this->logger->add( 'before filter filelist array' );
|
1512 |
foreach ( $filelist as $fileinfo ) {
|
1513 |
|
1514 |
// @todo The user needs a way to specifiy what to skip in the backups.
|
1515 |
-
$this->logger->add( 'before $is_node_modules variable' );
|
1516 |
$is_node_modules = false !== strpos( $fileinfo[1], '/node_modules/' );
|
1517 |
-
|
1518 |
-
$this->logger->add( 'before $is_backup_directory variable' );
|
1519 |
$is_backup_directory = $this->backup_dir->file_in_dir( $fileinfo[1] );
|
1520 |
-
|
1521 |
-
$this->logger->add( 'before $is_node_modules $is_backup_directory check' );
|
1522 |
if ( $is_node_modules || $is_backup_directory ) {
|
1523 |
continue;
|
1524 |
}
|
1525 |
-
|
1526 |
-
$this->logger->add( 'before folder exclusion check' );
|
1527 |
if ( ! $this->folder_exclusion->allow_file( $fileinfo[1] ) ) {
|
1528 |
continue;
|
1529 |
}
|
1530 |
-
|
1531 |
-
$this->logger->add( 'before $fileinfo set to $new_filelist' );
|
1532 |
$new_filelist[] = $fileinfo;
|
1533 |
-
$this->logger->add( 'after $fileinfo set to $new_filelist' );
|
1534 |
}
|
1535 |
-
|
1536 |
// Replace filelist.
|
1537 |
-
$this->logger->add( 'before replace filelist' );
|
1538 |
$filelist = $new_filelist;
|
1539 |
-
|
1540 |
// Clear filelist_basedir.
|
1541 |
-
$this->logger->add( 'before filelist basedir null' );
|
1542 |
$this->filelist_basedir = null;
|
1543 |
-
$this->logger->add( 'after filelist basedir null' );
|
1544 |
|
1545 |
// Return the filelist array.
|
1546 |
-
$this->logger->add( 'return $filelist' );
|
1547 |
return $filelist;
|
1548 |
}
|
1549 |
|
@@ -1770,15 +1765,12 @@ class Boldgrid_Backup_Admin_Core {
|
|
1770 |
|
1771 |
// Keep track of how long the site was paused for / the time to backup the database.
|
1772 |
$db_time_stop = microtime( true );
|
1773 |
-
|
1774 |
// Get the file list.
|
1775 |
-
$this->logger->add( 'before filelist' );
|
1776 |
$filelist = $this->get_filtered_filelist( ABSPATH );
|
1777 |
-
|
1778 |
// Initialize total_size.
|
1779 |
-
$this->logger->add( 'before total_size' );
|
1780 |
$info['total_size'] = 0;
|
1781 |
-
$this->logger->add( 'after total_size' );
|
1782 |
|
1783 |
// If not saving, then just return info.
|
1784 |
if ( ! $save ) {
|
1389 |
global $wp_filesystem;
|
1390 |
|
1391 |
// Validate input.
|
1392 |
+
$is_readable_time_start = microtime( true );
|
1393 |
+
|
1394 |
if ( empty( $dirpath ) || ! $wp_filesystem->is_readable( $dirpath ) ) {
|
1395 |
return [];
|
1396 |
}
|
1397 |
|
1398 |
+
$is_readable_time_end = microtime( true );
|
1399 |
+
|
1400 |
+
$this->logger->add( 'is_readable Duration: ' . ( $is_readable_time_end - $is_readable_time_start ) );
|
1401 |
+
|
1402 |
// Remove any training slash in dirpath.
|
1403 |
$dirpath = untrailingslashit( $dirpath );
|
1404 |
|
1408 |
}
|
1409 |
|
1410 |
// Get the non-recursive directory listing for the specified path.
|
1411 |
+
$dirlist_time_start = microtime( true );
|
1412 |
+
|
1413 |
$dirlist = $wp_filesystem->dirlist( $dirpath, true, false );
|
1414 |
|
1415 |
+
$dirlist_time_end = microtime( true );
|
1416 |
+
|
1417 |
+
$this->logger->add( '$dirlist Duration: ' . ( $dirlist_time_end - $dirlist_time_start ) );
|
1418 |
+
|
1419 |
// Initialize $filelist.
|
1420 |
$filelist = [];
|
1421 |
|
1499 |
public function get_filtered_filelist( $dirpath = ABSPATH ) {
|
1500 |
|
1501 |
// Validate input.
|
|
|
1502 |
if ( empty( $dirpath ) || ! $this->wp_filesystem->is_readable( $dirpath ) ) {
|
1503 |
return [];
|
1504 |
}
|
1505 |
+
|
1506 |
// Get the recursive directory listing for the specified path.
|
|
|
1507 |
$filelist = $this->get_filelist( $dirpath );
|
1508 |
+
|
1509 |
// If no files were found, then return an empty array.
|
|
|
1510 |
if ( empty( $filelist ) ) {
|
1511 |
return [];
|
1512 |
}
|
|
|
1513 |
|
1514 |
// Initialize $new_filelist.
|
|
|
1515 |
$new_filelist = [];
|
|
|
1516 |
// Filter the filelist array.
|
|
|
1517 |
foreach ( $filelist as $fileinfo ) {
|
1518 |
|
1519 |
// @todo The user needs a way to specifiy what to skip in the backups.
|
|
|
1520 |
$is_node_modules = false !== strpos( $fileinfo[1], '/node_modules/' );
|
1521 |
+
|
|
|
1522 |
$is_backup_directory = $this->backup_dir->file_in_dir( $fileinfo[1] );
|
1523 |
+
|
|
|
1524 |
if ( $is_node_modules || $is_backup_directory ) {
|
1525 |
continue;
|
1526 |
}
|
1527 |
+
|
|
|
1528 |
if ( ! $this->folder_exclusion->allow_file( $fileinfo[1] ) ) {
|
1529 |
continue;
|
1530 |
}
|
1531 |
+
|
|
|
1532 |
$new_filelist[] = $fileinfo;
|
|
|
1533 |
}
|
1534 |
+
|
1535 |
// Replace filelist.
|
|
|
1536 |
$filelist = $new_filelist;
|
1537 |
+
|
1538 |
// Clear filelist_basedir.
|
|
|
1539 |
$this->filelist_basedir = null;
|
|
|
1540 |
|
1541 |
// Return the filelist array.
|
|
|
1542 |
return $filelist;
|
1543 |
}
|
1544 |
|
1765 |
|
1766 |
// Keep track of how long the site was paused for / the time to backup the database.
|
1767 |
$db_time_stop = microtime( true );
|
1768 |
+
|
1769 |
// Get the file list.
|
|
|
1770 |
$filelist = $this->get_filtered_filelist( ABSPATH );
|
1771 |
+
|
1772 |
// Initialize total_size.
|
|
|
1773 |
$info['total_size'] = 0;
|
|
|
1774 |
|
1775 |
// If not saving, then just return info.
|
1776 |
if ( ! $save ) {
|
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 ComposerAutoloaderInit91078cb6ab41234844508601a40b8212::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 ComposerAutoloaderInitaf2880f10c75e0c515b85a1b1be35b5e
|
|
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 ComposerAutoloaderInitaf2880f10c75e0c515b85a1b1be35b5e
|
|
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 ComposerAutoloaderInit91078cb6ab41234844508601a40b8212
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInit91078cb6ab41234844508601a40b8212', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit91078cb6ab41234844508601a40b8212', '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\ComposerStaticInit91078cb6ab41234844508601a40b8212::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\ComposerStaticInit91078cb6ab41234844508601a40b8212::$files;
|
55 |
} else {
|
56 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
}
|
58 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
+
composerRequire91078cb6ab41234844508601a40b8212($fileIdentifier, $file);
|
60 |
}
|
61 |
|
62 |
return $loader;
|
63 |
}
|
64 |
}
|
65 |
|
66 |
+
function composerRequire91078cb6ab41234844508601a40b8212($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 ComposerStaticInitaf2880f10c75e0c515b85a1b1be35b5e
|
|
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 ComposerStaticInit91078cb6ab41234844508601a40b8212
|
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 = ComposerStaticInit91078cb6ab41234844508601a40b8212::$prefixLengthsPsr4;
|
95 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit91078cb6ab41234844508601a40b8212::$prefixDirsPsr4;
|
96 |
+
$loader->classMap = ComposerStaticInit91078cb6ab41234844508601a40b8212::$classMap;
|
97 |
|
98 |
}, null, ClassLoader::class);
|
99 |
}
|