Version Description
- New: Compatible up to WordPress 5.8.2
- Fix: Update notice is shown even when using latest version #1398
- Fix: Backup & cloning 100% compatible with PHP 8.0.12 #1281
- Fix: Skip search replace on backup & cloning query if it's size exceed preg functions limit #1404
- Fix: Skip inserting backup & cloning query if it exceeds mysql max_allowed_package. Show warning to user #1405
- Fix: Make db option wpstg_staging_sites always return an array #1413
- Fix: Fix dependency injection for backup notices class. Solve conflict with TranslatePress #1416
- Tweak: Use php version number as tag for php docker container #1407
- Tweak: Improve symlink tooltip text #1411
- Tweak: Refactor WP STAGING Pro to WP STAGING | PRO in notices #1409
- Tweak: Remove 16 characters limitation for the backup & CLONE NAME and keep it for CLONE DIRECTORY #1412
Download this release
Release Info
Developer | ReneHermi |
Plugin | WP Staging – DB & File Duplicator & Migration |
Version | 2.9.0 |
Comparing to | |
See all releases |
Code changes from version 2.8.9 to 2.9.0
- Backend/Administrator.php +6 -8
- Backend/Modules/Jobs/Cloning.php +1 -0
- Backend/Modules/Jobs/Files.php +4 -4
- Backend/Modules/Jobs/Scan.php +1 -0
- Backend/Modules/Jobs/Verify.php +2 -2
- Backend/Notices/Notices.php +9 -2
- Backend/Notices/OutdatedWpStagingNotice.php +2 -2
- Backend/views/clone/ajax/custom-directory.php +1 -1
- Framework/Adapter/Maintenance.php +2 -2
- Framework/Filesystem/DebugLogReader.php +1 -1
- Framework/Filesystem/{File.php → FileObject.php} +21 -1
- Framework/Queue/FileSeekableQueue.php +5 -5
- Framework/Traits/HydrateTrait.php +8 -2
- Framework/Utils/Cache/BufferedCache.php +11 -12
- Framework/Utils/Cache/Cache.php +3 -3
- assets/js/dist/wpstg-admin.js +1 -1
- assets/js/dist/wpstg-admin.js.map +1 -1
- assets/js/dist/wpstg-admin.min.js +1 -1
- assets/js/dist/wpstg-admin.min.js.map +1 -1
- constantsFree.php +2 -2
- opcacheBootstrap.php +1 -1
- readme.txt +33 -146
- vendor_wpstg/autoload/src.php +1 -1
- wp-staging-error-handler.php +4 -4
- wp-staging.php +1 -1
Backend/Administrator.php
CHANGED
@@ -669,18 +669,14 @@ class Administrator
|
|
669 |
}
|
670 |
|
671 |
$cloneDirectoryName = sanitize_key($_POST["directoryName"]);
|
|
|
|
|
672 |
$cloneDirectoryNameLength = strlen($cloneDirectoryName);
|
673 |
$existingClones = get_option(Sites::STAGING_SITES_OPTION, []);
|
674 |
|
675 |
$cloneDestDir = trailingslashit(get_home_path()) . $cloneDirectoryName;
|
676 |
|
677 |
-
|
678 |
-
if ($cloneDirectoryNameLength < 1 || $cloneDirectoryNameLength > 16) {
|
679 |
-
echo wp_send_json([
|
680 |
-
"status" => "failed",
|
681 |
-
"message" => "Choose a site name below 16 characters"
|
682 |
-
]);
|
683 |
-
|
684 |
return;
|
685 |
}
|
686 |
|
@@ -900,7 +896,9 @@ class Administrator
|
|
900 |
*/
|
901 |
public function messages()
|
902 |
{
|
903 |
-
|
|
|
|
|
904 |
$notices->messages();
|
905 |
|
906 |
// Return this instance when we request it from the container
|
669 |
}
|
670 |
|
671 |
$cloneDirectoryName = sanitize_key($_POST["directoryName"]);
|
672 |
+
$cloneDirectoryName = substr($cloneDirectoryName, 0, 16);
|
673 |
+
|
674 |
$cloneDirectoryNameLength = strlen($cloneDirectoryName);
|
675 |
$existingClones = get_option(Sites::STAGING_SITES_OPTION, []);
|
676 |
|
677 |
$cloneDestDir = trailingslashit(get_home_path()) . $cloneDirectoryName;
|
678 |
|
679 |
+
if ($cloneDirectoryNameLength < 1) {
|
|
|
|
|
|
|
|
|
|
|
|
|
680 |
return;
|
681 |
}
|
682 |
|
896 |
*/
|
897 |
public function messages()
|
898 |
{
|
899 |
+
/** @var Notices */
|
900 |
+
$notices = WPStaging::make(Notices::class);
|
901 |
+
$notices->setPluginPath($this->path);
|
902 |
$notices->messages();
|
903 |
|
904 |
// Return this instance when we request it from the container
|
Backend/Modules/Jobs/Cloning.php
CHANGED
@@ -60,6 +60,7 @@ class Cloning extends Job
|
|
60 |
$this->options->cloneName = wpstg_urldecode($_POST["cloneName"]);
|
61 |
// The slugified version of Clone Name (to use in directory creation)
|
62 |
$this->options->cloneDirectoryName = preg_replace("#\W+#", '-', strtolower($this->options->cloneName));
|
|
|
63 |
$this->options->cloneNumber = 1;
|
64 |
$this->options->prefix = $this->setStagingPrefix();
|
65 |
$this->options->includedDirectories = [];
|
60 |
$this->options->cloneName = wpstg_urldecode($_POST["cloneName"]);
|
61 |
// The slugified version of Clone Name (to use in directory creation)
|
62 |
$this->options->cloneDirectoryName = preg_replace("#\W+#", '-', strtolower($this->options->cloneName));
|
63 |
+
$this->options->cloneDirectoryName = substr($this->options->cloneDirectoryName, 0, 16);
|
64 |
$this->options->cloneNumber = 1;
|
65 |
$this->options->prefix = $this->setStagingPrefix();
|
66 |
$this->options->includedDirectories = [];
|
Backend/Modules/Jobs/Files.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
namespace WPStaging\Backend\Modules\Jobs;
|
4 |
|
5 |
use RuntimeException;
|
6 |
-
use SplFileObject;
|
7 |
use WPStaging\Backend\Modules\Jobs\Cleaners\WpContentCleaner;
|
8 |
use WPStaging\Core\Utils\Logger;
|
9 |
use WPStaging\Core\WPStaging;
|
10 |
use WPStaging\Framework\Adapter\Directory;
|
|
|
11 |
use WPStaging\Framework\Filesystem\Filesystem;
|
12 |
use WPStaging\Framework\Filesystem\Permissions;
|
13 |
use WPStaging\Framework\Filesystem\WpUploadsFolderSymlinker;
|
@@ -26,7 +26,7 @@ class Files extends JobExecutable
|
|
26 |
{
|
27 |
|
28 |
/**
|
29 |
-
* @var
|
30 |
*/
|
31 |
private $file;
|
32 |
|
@@ -58,7 +58,7 @@ class Files extends JobExecutable
|
|
58 |
$filePath = $this->cache->getCacheDir() . "files_to_copy." . $this->cache->getCacheExtension();
|
59 |
|
60 |
if (is_file($filePath)) {
|
61 |
-
$this->file = new
|
62 |
}
|
63 |
|
64 |
$logStep = 0;
|
@@ -257,7 +257,7 @@ class Files extends JobExecutable
|
|
257 |
$this->file->seek($this->options->copiedFiles - 1);
|
258 |
}
|
259 |
|
260 |
-
$this->file->setFlags(
|
261 |
|
262 |
for ($i = 0; $i < $this->maxFilesPerRun; $i++) {
|
263 |
// Increment copied files
|
3 |
namespace WPStaging\Backend\Modules\Jobs;
|
4 |
|
5 |
use RuntimeException;
|
|
|
6 |
use WPStaging\Backend\Modules\Jobs\Cleaners\WpContentCleaner;
|
7 |
use WPStaging\Core\Utils\Logger;
|
8 |
use WPStaging\Core\WPStaging;
|
9 |
use WPStaging\Framework\Adapter\Directory;
|
10 |
+
use WPStaging\Framework\Filesystem\FileObject;
|
11 |
use WPStaging\Framework\Filesystem\Filesystem;
|
12 |
use WPStaging\Framework\Filesystem\Permissions;
|
13 |
use WPStaging\Framework\Filesystem\WpUploadsFolderSymlinker;
|
26 |
{
|
27 |
|
28 |
/**
|
29 |
+
* @var FileObject
|
30 |
*/
|
31 |
private $file;
|
32 |
|
58 |
$filePath = $this->cache->getCacheDir() . "files_to_copy." . $this->cache->getCacheExtension();
|
59 |
|
60 |
if (is_file($filePath)) {
|
61 |
+
$this->file = new FileObject($filePath, 'r');
|
62 |
}
|
63 |
|
64 |
$logStep = 0;
|
257 |
$this->file->seek($this->options->copiedFiles - 1);
|
258 |
}
|
259 |
|
260 |
+
$this->file->setFlags(FileObject::SKIP_EMPTY | FileObject::READ_AHEAD);
|
261 |
|
262 |
for ($i = 0; $i < $this->maxFilesPerRun; $i++) {
|
263 |
// Increment copied files
|
Backend/Modules/Jobs/Scan.php
CHANGED
@@ -148,6 +148,7 @@ class Scan extends Job
|
|
148 |
// Basic Options
|
149 |
$this->options->root = str_replace(["\\", '/'], DIRECTORY_SEPARATOR, WPStaging::getWPpath());
|
150 |
$this->options->existingClones = get_option(Sites::STAGING_SITES_OPTION, []);
|
|
|
151 |
$this->options->current = null;
|
152 |
|
153 |
if (isset($_POST["clone"]) && array_key_exists($_POST["clone"], $this->options->existingClones)) {
|
148 |
// Basic Options
|
149 |
$this->options->root = str_replace(["\\", '/'], DIRECTORY_SEPARATOR, WPStaging::getWPpath());
|
150 |
$this->options->existingClones = get_option(Sites::STAGING_SITES_OPTION, []);
|
151 |
+
$this->options->existingClones = is_array($this->options->existingClones) ? $this->options->existingClones : [];
|
152 |
$this->options->current = null;
|
153 |
|
154 |
if (isset($_POST["clone"]) && array_key_exists($_POST["clone"], $this->options->existingClones)) {
|
Backend/Modules/Jobs/Verify.php
CHANGED
@@ -17,12 +17,12 @@ class Verify extends JobExecutable
|
|
17 |
{
|
18 |
|
19 |
/**
|
20 |
-
* @var
|
21 |
*/
|
22 |
private $files = [];
|
23 |
|
24 |
/**
|
25 |
-
* @var
|
26 |
*/
|
27 |
private $verifyFiles = [];
|
28 |
|
17 |
{
|
18 |
|
19 |
/**
|
20 |
+
* @var array
|
21 |
*/
|
22 |
private $files = [];
|
23 |
|
24 |
/**
|
25 |
+
* @var array
|
26 |
*/
|
27 |
private $verifyFiles = [];
|
28 |
|
Backend/Notices/Notices.php
CHANGED
@@ -47,9 +47,8 @@ class Notices
|
|
47 |
*/
|
48 |
public static $directoryListingErrors = 'directoryListingErrors';
|
49 |
|
50 |
-
public function __construct(
|
51 |
{
|
52 |
-
$this->path = $path;
|
53 |
$this->assets = $assets;
|
54 |
}
|
55 |
|
@@ -343,6 +342,14 @@ class Notices
|
|
343 |
return false;
|
344 |
}
|
345 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
/**
|
347 |
* Get the path of plugin
|
348 |
* @return string
|
47 |
*/
|
48 |
public static $directoryListingErrors = 'directoryListingErrors';
|
49 |
|
50 |
+
public function __construct(Assets $assets)
|
51 |
{
|
|
|
52 |
$this->assets = $assets;
|
53 |
}
|
54 |
|
342 |
return false;
|
343 |
}
|
344 |
|
345 |
+
/**
|
346 |
+
* @param string $path
|
347 |
+
*/
|
348 |
+
public function setPluginPath($path)
|
349 |
+
{
|
350 |
+
$this->path = $path;
|
351 |
+
}
|
352 |
+
|
353 |
/**
|
354 |
* Get the path of plugin
|
355 |
* @return string
|
Backend/Notices/OutdatedWpStagingNotice.php
CHANGED
@@ -66,7 +66,7 @@ class OutdatedWpStagingNotice
|
|
66 |
return false;
|
67 |
}
|
68 |
|
69 |
-
return version_compare($this->getLatestWpstgProVersion(), $this->getCurrentWpstgVersion(), '
|
70 |
}
|
71 |
|
72 |
/**
|
@@ -106,6 +106,6 @@ class OutdatedWpStagingNotice
|
|
106 |
return false;
|
107 |
}
|
108 |
|
109 |
-
return version_compare($this->getLatestWpstgVersion(), $this->getCurrentWpstgVersion(), '
|
110 |
}
|
111 |
}
|
66 |
return false;
|
67 |
}
|
68 |
|
69 |
+
return version_compare($this->getLatestWpstgProVersion(), $this->getCurrentWpstgVersion(), '>') ? true : false;
|
70 |
}
|
71 |
|
72 |
/**
|
106 |
return false;
|
107 |
}
|
108 |
|
109 |
+
return version_compare($this->getLatestWpstgVersion(), $this->getCurrentWpstgVersion(), '>') ? true : false;
|
110 |
}
|
111 |
}
|
Backend/views/clone/ajax/custom-directory.php
CHANGED
@@ -113,7 +113,7 @@ if ($isPro && !empty($options->current) && $options->current !== null) {
|
|
113 |
<span class="wpstg--tooltip">
|
114 |
<img class="wpstg--dashicons" src="<?php echo $scan->getInfoIcon(); ?>" alt="info" />
|
115 |
<span class="wpstg--tooltiptext">
|
116 |
-
<?php _e('Activate to symlink the folder <code>wp-content/uploads</code> to the production site. All images on the production site\'s uploads folder will be linked to the staging site uploads folder. This will speed up the cloning and pushing process tremendously as no
|
117 |
<br/>
|
118 |
<br/>
|
119 |
<?php _e('<strong>This feature only works if the staging site is on the same hosting as the production site.</strong>', 'wp-staging'); ?>
|
113 |
<span class="wpstg--tooltip">
|
114 |
<img class="wpstg--dashicons" src="<?php echo $scan->getInfoIcon(); ?>" alt="info" />
|
115 |
<span class="wpstg--tooltiptext">
|
116 |
+
<?php _e('Activate to symlink the folder <code>wp-content/uploads</code> to the production site. All files including images on the production site\'s uploads folder will be linked to the staging site uploads folder. This will speed up the cloning and pushing process tremendously as no files from the uploads folder are copied between both sites. Note: this can lead to mixed and shared content issues if both site loads (custom) stylesheet files from the same wp-content/uploads folder. Use this with care!', 'wp-staging'); ?>
|
117 |
<br/>
|
118 |
<br/>
|
119 |
<?php _e('<strong>This feature only works if the staging site is on the same hosting as the production site.</strong>', 'wp-staging'); ?>
|
Framework/Adapter/Maintenance.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
namespace WPStaging\Framework\Adapter;
|
4 |
|
5 |
-
use WPStaging\Framework\Filesystem\
|
6 |
use WPStaging\Framework\Filesystem\Filesystem;
|
7 |
|
8 |
class Maintenance
|
@@ -20,7 +20,7 @@ class Maintenance
|
|
20 |
$fileExists = $this->isMaintenance();
|
21 |
if ($isMaintenance && !$fileExists) {
|
22 |
// Perhaps maintenance.php in WP_CONTENT?
|
23 |
-
(new
|
24 |
return;
|
25 |
}
|
26 |
|
2 |
|
3 |
namespace WPStaging\Framework\Adapter;
|
4 |
|
5 |
+
use WPStaging\Framework\Filesystem\FileObject;
|
6 |
use WPStaging\Framework\Filesystem\Filesystem;
|
7 |
|
8 |
class Maintenance
|
20 |
$fileExists = $this->isMaintenance();
|
21 |
if ($isMaintenance && !$fileExists) {
|
22 |
// Perhaps maintenance.php in WP_CONTENT?
|
23 |
+
(new FileObject($maintenanceFile, FileObject::MODE_WRITE))->fwriteSafe('<?php $upgrading = time() ?>');
|
24 |
return;
|
25 |
}
|
26 |
|
Framework/Filesystem/DebugLogReader.php
CHANGED
@@ -69,7 +69,7 @@ class DebugLogReader
|
|
69 |
}
|
70 |
|
71 |
try {
|
72 |
-
$debugFile = new
|
73 |
|
74 |
$negativeOffset = $maxSize;
|
75 |
|
69 |
}
|
70 |
|
71 |
try {
|
72 |
+
$debugFile = new FileObject($debugLogPath, 'r');
|
73 |
|
74 |
$negativeOffset = $maxSize;
|
75 |
|
Framework/Filesystem/{File.php → FileObject.php}
RENAMED
@@ -9,7 +9,7 @@ use LimitIterator;
|
|
9 |
use SplFileObject;
|
10 |
use WPStaging\Core\WPStaging;
|
11 |
|
12 |
-
class
|
13 |
{
|
14 |
const MODE_READ = 'rb'; // read only, binary
|
15 |
const MODE_WRITE = 'wb'; // write only, binary
|
@@ -117,4 +117,24 @@ class File extends SplFileObject
|
|
117 |
$this->seek($currentKey);
|
118 |
return $total;
|
119 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
}
|
9 |
use SplFileObject;
|
10 |
use WPStaging\Core\WPStaging;
|
11 |
|
12 |
+
class FileObject extends SplFileObject
|
13 |
{
|
14 |
const MODE_READ = 'rb'; // read only, binary
|
15 |
const MODE_WRITE = 'wb'; // write only, binary
|
117 |
$this->seek($currentKey);
|
118 |
return $total;
|
119 |
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Override SplFileObject::seek()
|
123 |
+
* To make sure SplFileObject::seek() behaves identical in all PHP Versions. There was a major change in PHP 8.0.1.
|
124 |
+
* @see https://bugs.php.net/bug.php?id=81551
|
125 |
+
* This makes sure that the offset is always incremented by 1
|
126 |
+
*
|
127 |
+
* @param int $offset
|
128 |
+
*/
|
129 |
+
public function seek($offset)
|
130 |
+
{
|
131 |
+
if (version_compare(PHP_VERSION, '8.0.1', '>=')) {
|
132 |
+
// SplFileObject::seek() works only for INT offset, this make sure offset remains INT
|
133 |
+
$offset = $offset === PHP_INT_MAX ? PHP_INT_MAX : $offset + 1;
|
134 |
+
parent::seek($offset);
|
135 |
+
return;
|
136 |
+
}
|
137 |
+
|
138 |
+
parent::seek($offset);
|
139 |
+
}
|
140 |
}
|
Framework/Queue/FileSeekableQueue.php
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
|
3 |
namespace WPStaging\Framework\Queue;
|
4 |
|
5 |
-
use SplFileObject;
|
6 |
use WPStaging\Framework\Adapter\Directory;
|
|
|
7 |
use WPStaging\Framework\Filesystem\Filesystem;
|
8 |
|
9 |
class FileSeekableQueue implements SeekableQueueInterface, \SeekableIterator
|
@@ -11,7 +11,7 @@ class FileSeekableQueue implements SeekableQueueInterface, \SeekableIterator
|
|
11 |
/** @var string The string identifier of this task */
|
12 |
protected $taskName;
|
13 |
|
14 |
-
/** @var
|
15 |
protected $handle;
|
16 |
|
17 |
/** @var \Generator */
|
@@ -40,7 +40,7 @@ class FileSeekableQueue implements SeekableQueueInterface, \SeekableIterator
|
|
40 |
|
41 |
public function __destruct()
|
42 |
{
|
43 |
-
if ($this->needsUnlock && $this->handle instanceof
|
44 |
try {
|
45 |
$this->handle->flock(LOCK_UN);
|
46 |
} catch (\Exception $e) {
|
@@ -70,8 +70,8 @@ class FileSeekableQueue implements SeekableQueueInterface, \SeekableIterator
|
|
70 |
throw new \BadMethodCallException();
|
71 |
}
|
72 |
|
73 |
-
$this->handle = new
|
74 |
-
$this->handle->setFlags(
|
75 |
$this->fileGenerator = $this->initializeGenerator();
|
76 |
|
77 |
$this->isWriteOnly = $queueMode === SeekableQueueInterface::MODE_WRITE;
|
2 |
|
3 |
namespace WPStaging\Framework\Queue;
|
4 |
|
|
|
5 |
use WPStaging\Framework\Adapter\Directory;
|
6 |
+
use WPStaging\Framework\Filesystem\FileObject;
|
7 |
use WPStaging\Framework\Filesystem\Filesystem;
|
8 |
|
9 |
class FileSeekableQueue implements SeekableQueueInterface, \SeekableIterator
|
11 |
/** @var string The string identifier of this task */
|
12 |
protected $taskName;
|
13 |
|
14 |
+
/** @var FileObject The file resource that persists this queue */
|
15 |
protected $handle;
|
16 |
|
17 |
/** @var \Generator */
|
40 |
|
41 |
public function __destruct()
|
42 |
{
|
43 |
+
if ($this->needsUnlock && $this->handle instanceof FileObject) {
|
44 |
try {
|
45 |
$this->handle->flock(LOCK_UN);
|
46 |
} catch (\Exception $e) {
|
70 |
throw new \BadMethodCallException();
|
71 |
}
|
72 |
|
73 |
+
$this->handle = new FileObject($path, $queueMode);
|
74 |
+
$this->handle->setFlags(FileObject::DROP_NEW_LINE);
|
75 |
$this->fileGenerator = $this->initializeGenerator();
|
76 |
|
77 |
$this->isWriteOnly = $queueMode === SeekableQueueInterface::MODE_WRITE;
|
Framework/Traits/HydrateTrait.php
CHANGED
@@ -64,13 +64,19 @@ trait HydrateTrait
|
|
64 |
|
65 |
$param = $params[0];
|
66 |
|
67 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
$method->invoke($this, $value);
|
69 |
return;
|
70 |
}
|
71 |
|
72 |
/** @noinspection PhpUnhandledExceptionInspection */
|
73 |
-
$method->invoke($this, $this->getClassAsValue($
|
74 |
}
|
75 |
|
76 |
/**
|
64 |
|
65 |
$param = $params[0];
|
66 |
|
67 |
+
if (defined('PHP_VERSION_ID') && PHP_VERSION_ID >= 80000) {
|
68 |
+
$class = $param->getType() && !$param->getType()->isBuiltin() ? new ReflectionClass($param->getType()->getName()) : null;
|
69 |
+
} else {
|
70 |
+
$class = $param->getClass();
|
71 |
+
}
|
72 |
+
|
73 |
+
if (!$value || !$class) {
|
74 |
$method->invoke($this, $value);
|
75 |
return;
|
76 |
}
|
77 |
|
78 |
/** @noinspection PhpUnhandledExceptionInspection */
|
79 |
+
$method->invoke($this, $this->getClassAsValue($class, $value));
|
80 |
}
|
81 |
|
82 |
/**
|
Framework/Utils/Cache/BufferedCache.php
CHANGED
@@ -6,15 +6,14 @@
|
|
6 |
|
7 |
namespace WPStaging\Framework\Utils\Cache;
|
8 |
|
9 |
-
use SplFileObject;
|
10 |
use LimitIterator;
|
11 |
use WPStaging\Framework\Exceptions\IOException;
|
12 |
use WPStaging\Framework\Traits\ResourceTrait;
|
13 |
-
use WPStaging\Framework\Filesystem\
|
14 |
use WPStaging\Pro\Backup\Exceptions\DiskNotWritableException;
|
15 |
use WPStaging\Pro\Backup\Exceptions\ThresholdException;
|
16 |
|
17 |
-
// TODO DRY; re-use \WPStaging\Framework\Filesystem\
|
18 |
// Buffered cache reads the file partially
|
19 |
class BufferedCache extends AbstractCache
|
20 |
{
|
@@ -73,7 +72,7 @@ class BufferedCache extends AbstractCache
|
|
73 |
}
|
74 |
|
75 |
/** @noinspection UnnecessaryCastingInspection */
|
76 |
-
return (new
|
77 |
}
|
78 |
|
79 |
/**
|
@@ -87,10 +86,10 @@ class BufferedCache extends AbstractCache
|
|
87 |
copy($this->filePath, $this->filePath . 'tmp');
|
88 |
}
|
89 |
|
90 |
-
$existingFile = new
|
91 |
$existingFile->flock(LOCK_EX);
|
92 |
|
93 |
-
$tempFile = new
|
94 |
$existingFile->flock(LOCK_EX);
|
95 |
|
96 |
$lastLine = null;
|
@@ -163,10 +162,10 @@ class BufferedCache extends AbstractCache
|
|
163 |
|
164 |
copy($this->filePath, $this->filePath . 'tmp');
|
165 |
|
166 |
-
$existingFile = new
|
167 |
$existingFile->flock(LOCK_EX);
|
168 |
|
169 |
-
$tempFile = new
|
170 |
$existingFile->flock(LOCK_EX);
|
171 |
$tempFile->fwrite($data);
|
172 |
|
@@ -288,7 +287,7 @@ class BufferedCache extends AbstractCache
|
|
288 |
*/
|
289 |
public function save($value)
|
290 |
{
|
291 |
-
return (new
|
292 |
}
|
293 |
|
294 |
/**
|
@@ -308,14 +307,14 @@ class BufferedCache extends AbstractCache
|
|
308 |
return $total;
|
309 |
}
|
310 |
|
311 |
-
// TODO DRY \WPStaging\Framework\Filesystem\
|
312 |
/**
|
313 |
* @param int $lines
|
314 |
* @return array
|
315 |
*/
|
316 |
private function readBottomLine($lines)
|
317 |
{
|
318 |
-
$file = new
|
319 |
$file->seek(PHP_INT_MAX);
|
320 |
$lastLine = $file->key();
|
321 |
$offset = max($lastLine - $lines, 0);
|
@@ -326,7 +325,7 @@ class BufferedCache extends AbstractCache
|
|
326 |
|
327 |
public function readLastLine()
|
328 |
{
|
329 |
-
$file = new
|
330 |
$negativeOffset = 16 * KB_IN_BYTES;
|
331 |
|
332 |
// Set the pointer to the end of the file, minus the negative offset for which to start looking for the last line.
|
6 |
|
7 |
namespace WPStaging\Framework\Utils\Cache;
|
8 |
|
|
|
9 |
use LimitIterator;
|
10 |
use WPStaging\Framework\Exceptions\IOException;
|
11 |
use WPStaging\Framework\Traits\ResourceTrait;
|
12 |
+
use WPStaging\Framework\Filesystem\FileObject;
|
13 |
use WPStaging\Pro\Backup\Exceptions\DiskNotWritableException;
|
14 |
use WPStaging\Pro\Backup\Exceptions\ThresholdException;
|
15 |
|
16 |
+
// TODO DRY; re-use \WPStaging\Framework\Filesystem\FileObject
|
17 |
// Buffered cache reads the file partially
|
18 |
class BufferedCache extends AbstractCache
|
19 |
{
|
72 |
}
|
73 |
|
74 |
/** @noinspection UnnecessaryCastingInspection */
|
75 |
+
return (new FileObject($this->filePath, FileObject::MODE_APPEND))->fwriteSafe((string)$value . PHP_EOL);
|
76 |
}
|
77 |
|
78 |
/**
|
86 |
copy($this->filePath, $this->filePath . 'tmp');
|
87 |
}
|
88 |
|
89 |
+
$existingFile = new FileObject($this->filePath, 'rb+');
|
90 |
$existingFile->flock(LOCK_EX);
|
91 |
|
92 |
+
$tempFile = new FileObject($this->filePath . 'tmp', 'rb+');
|
93 |
$existingFile->flock(LOCK_EX);
|
94 |
|
95 |
$lastLine = null;
|
162 |
|
163 |
copy($this->filePath, $this->filePath . 'tmp');
|
164 |
|
165 |
+
$existingFile = new FileObject($this->filePath, 'rb');
|
166 |
$existingFile->flock(LOCK_EX);
|
167 |
|
168 |
+
$tempFile = new FileObject($this->filePath . 'tmp', 'wb');
|
169 |
$existingFile->flock(LOCK_EX);
|
170 |
$tempFile->fwrite($data);
|
171 |
|
287 |
*/
|
288 |
public function save($value)
|
289 |
{
|
290 |
+
return (new FileObject($this->filePath, FileObject::MODE_WRITE))->fwriteSafe($value);
|
291 |
}
|
292 |
|
293 |
/**
|
307 |
return $total;
|
308 |
}
|
309 |
|
310 |
+
// TODO DRY \WPStaging\Framework\Filesystem\FileObject::readBottomLines
|
311 |
/**
|
312 |
* @param int $lines
|
313 |
* @return array
|
314 |
*/
|
315 |
private function readBottomLine($lines)
|
316 |
{
|
317 |
+
$file = new FileObject($this->filePath, 'rb');
|
318 |
$file->seek(PHP_INT_MAX);
|
319 |
$lastLine = $file->key();
|
320 |
$offset = max($lastLine - $lines, 0);
|
325 |
|
326 |
public function readLastLine()
|
327 |
{
|
328 |
+
$file = new FileObject($this->filePath, 'rb');
|
329 |
$negativeOffset = 16 * KB_IN_BYTES;
|
330 |
|
331 |
// Set the pointer to the end of the file, minus the negative offset for which to start looking for the last line.
|
Framework/Utils/Cache/Cache.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
|
7 |
namespace WPStaging\Framework\Utils\Cache;
|
8 |
|
9 |
-
use WPStaging\Framework\Filesystem\
|
10 |
|
11 |
class Cache extends AbstractCache
|
12 |
{
|
@@ -28,9 +28,9 @@ class Cache extends AbstractCache
|
|
28 |
public function save($value, $pretty = false)
|
29 |
{
|
30 |
if ($pretty) {
|
31 |
-
return (new
|
32 |
} else {
|
33 |
-
return (new
|
34 |
}
|
35 |
}
|
36 |
}
|
6 |
|
7 |
namespace WPStaging\Framework\Utils\Cache;
|
8 |
|
9 |
+
use WPStaging\Framework\Filesystem\FileObject;
|
10 |
|
11 |
class Cache extends AbstractCache
|
12 |
{
|
28 |
public function save($value, $pretty = false)
|
29 |
{
|
30 |
if ($pretty) {
|
31 |
+
return (new FileObject($this->filePath, FileObject::MODE_WRITE))->fwriteSafe(json_encode($value, JSON_PRETTY_PRINT));
|
32 |
} else {
|
33 |
+
return (new FileObject($this->filePath, FileObject::MODE_WRITE))->fwriteSafe(json_encode($value));
|
34 |
}
|
35 |
}
|
36 |
}
|
assets/js/dist/wpstg-admin.js
CHANGED
@@ -1878,7 +1878,7 @@
|
|
1878 |
return;
|
1879 |
}
|
1880 |
|
1881 |
-
var slug = WPStagingCommon.slugify(this.value);
|
1882 |
var $targetDir = $('#wpstg-use-target-dir');
|
1883 |
var $targetUri = $('#wpstg-use-target-hostname');
|
1884 |
var path = $targetDir.data('base-path');
|
1878 |
return;
|
1879 |
}
|
1880 |
|
1881 |
+
var slug = WPStagingCommon.slugify(this.value).substring(0, 16);
|
1882 |
var $targetDir = $('#wpstg-use-target-dir');
|
1883 |
var $targetUri = $('#wpstg-use-target-hostname');
|
1884 |
var path = $targetDir.data('base-path');
|
assets/js/dist/wpstg-admin.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"wpstg-admin.js","sources":["../src/modules/wpstg-dom-utils.js","../src/modules/wpstg-clone-staging.js","../src/modules/wpstg-directory-navigation.js","../src/modules/wpstg-exclude-filters.js","../src/modules/wpstg-modal.js","../src/modules/wpstg-hover-intent.js","../src/wpstg.js","../src/modules/wpstg-reset-modal.js","../src/modules/wpstg-cloning-advance-settings.js","../src/modules/wpstg-main-menu.js","../src/wpstg-admin.js"],"sourcesContent":["/**\n * WP STAGING basic jQuery replacement\n */\n\n/**\n * Shortcut for document.querySelector() or jQuery's $()\n * Return single element only\n */\nexport function qs(selector) {\n return document.querySelector(selector);\n}\n\n/**\n * Shortcut for document.querySelector() or jQuery's $()\n * Return collection of elements\n */\nexport function all(selector) {\n return document.querySelectorAll(selector);\n}\n\n/**\n * alternative of jQuery - $(parent).on(event, selector, handler)\n */\nexport function addEvent(parent, evt, selector, handler) {\n parent.addEventListener(evt, function(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n handler(event.target.closest(selector), event);\n }\n }, false);\n}\n\nexport function slideDown(element, duration = 400) {\n element.style.display = 'block';\n element.style.overflow = 'hidden';\n const height = element.offsetHeight;\n element.style.height = '0px';\n element.style.transitionProperty = 'height';\n element.style.transitionDuration = duration + 'ms';\n setTimeout(() => {\n element.style.height = height + 'px';\n window.setTimeout(() => {\n element.style.removeProperty('height');\n element.style.removeProperty('overflow');\n element.style.removeProperty('transition-duration');\n element.style.removeProperty('transition-property');\n }, duration);\n }, 0);\n}\n\nexport function slideUp(element, duration = 400) {\n element.style.display = 'block';\n element.style.overflow = 'hidden';\n const height = element.offsetHeight;\n element.style.height = height + 'px';\n element.style.transitionProperty = 'height';\n element.style.transitionDuration = duration + 'ms';\n setTimeout(() => {\n element.style.height = '0px';\n window.setTimeout(() => {\n element.style.display = 'none';\n element.style.removeProperty('height');\n element.style.removeProperty('overflow');\n element.style.removeProperty('transition-duration');\n element.style.removeProperty('transition-property');\n }, duration);\n }, 0);\n}\n\nexport function fadeOut(element, duration = 300) {\n element.style.opacity = 1;\n element.style.transitionProperty = 'opacity';\n element.style.transitionDuration = duration + 'ms';\n setTimeout(() => {\n element.style.opacity = 0;\n window.setTimeout(() => {\n element.style.display = 'none';\n element.style.removeProperty('opacity');\n element.style.removeProperty('transition-duration');\n element.style.removeProperty('transition-property');\n }, duration);\n }, 0);\n}\n\nexport function getNextSibling(element, selector) {\n let sibling = element.nextElementSibling;\n\n while (sibling) {\n if (sibling.matches(selector)) {\n return sibling;\n }\n\n sibling = sibling.nextElementSibling;\n }\n};\n\nexport function getParents(element, selector) {\n const result = [];\n for (let parent = element && element.parentElement; parent; parent = parent.parentElement) {\n if (parent.matches(selector)) {\n result.push(parent);\n }\n }\n\n return result;\n}\n\n/**\n * Check if element has class name\n * @param element\n * @param className\n * @return {boolean}\n */\nexport function hasClass(element, className) {\n return (' ' + element.className + ' ').indexOf(' ' + className+ ' ') > -1;\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Enable/Disable cloning for staging site\n */\nexport default class WpstgCloneStaging {\n constructor(\n pageWrapperId = '#wpstg-clonepage-wrapper',\n wpstgObject = wpstg,\n ) {\n this.pageWrapper = dom.qs(pageWrapperId);\n this.wpstgObject = wpstgObject;\n this.enableButtonId = '#wpstg-enable-staging-cloning';\n this.enableAction = 'wpstg_enable_staging_cloning';\n\n this.notyf = new Notyf({\n duration: 10000,\n position: {\n x: 'center',\n y: 'bottom',\n },\n dismissible: true,\n types: [\n {\n type: 'warning',\n background: 'orange',\n icon: false,\n },\n ],\n });\n this.init();\n }\n\n addEvents() {\n if (this.pageWrapper === null) {\n return;\n }\n\n dom.addEvent(this.pageWrapper, 'click', this.enableButtonId, () => {\n this.sendRequest(this.enableAction);\n });\n }\n\n init() {\n this.addEvents();\n }\n\n sendRequest(action) {\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams({\n action: action,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n }),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((data) => {\n // Reload current page if successful.\n if ('undefined' !== typeof (data.success) && data.success) {\n location.reload();\n return;\n }\n\n // There will be message probably in case of error\n if ('undefined' !== typeof (data.message)) {\n this.notyf.error(data.message);\n return;\n }\n\n this.notyf.error(this.wpstgObject.i18n['somethingWentWrong']);\n }).catch((error) => {\n console.warn(this.wpstgObject.i18n['somethingWentWrong'], error);\n });\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Fetch directory direct child directories\n */\nexport default class WpstgDirectoryNavigation {\n constructor(\n directoryListingSelector = '#wpstg-directories-listing',\n wpstgObject = wpstg,\n notyf = null,\n ) {\n this.directoryListingContainer = dom.qs(directoryListingSelector);\n this.wpstgObject = wpstgObject;\n this.dirCheckboxSelector = '.wpstg-check-dir';\n this.dirExpandSelector = '.wpstg-expand-dirs';\n this.unselectAllDirsSelector = '.wpstg-unselect-dirs';\n this.selectDefaultDirsSelector = '.wpstg-select-dirs-default';\n this.fetchChildrenAction = 'wpstg_fetch_dir_childrens';\n this.currentCheckboxElement = null;\n this.currentParentDiv = null;\n this.currentLoader = null;\n this.existingExcludes = [];\n this.excludedDirectories = [];\n this.isDefaultSelected = false;\n this.notyf = notyf;\n\n this.init();\n }\n\n addEvents() {\n if (this.directoryListingContainer === null) {\n console.log('Error: directory navigation add events');\n return;\n }\n\n dom.addEvent(this.directoryListingContainer, 'click', this.dirExpandSelector, (element, event) => {\n event.preventDefault();\n if (this.toggleDirExpand(element)) {\n this.sendRequest(this.fetchChildrenAction, element);\n }\n });\n\n dom.addEvent(this.directoryListingContainer, 'click', this.unselectAllDirsSelector, () => {\n this.unselectAll();\n });\n\n dom.addEvent(this.directoryListingContainer, 'click', this.selectDefaultDirsSelector, () => {\n this.selectDefault();\n });\n }\n\n init() {\n this.addEvents();\n this.parseExcludes();\n }\n\n /**\n * Toggle Dir Expand,\n * Return true if children aren't fetched\n * @param {HTMLElement} element\n * @return {boolean}\n */\n toggleDirExpand(element) {\n this.currentParentDiv = element.parentElement;\n this.currentCheckboxElement = element.previousSibling;\n this.currentLoader = this.currentParentDiv.querySelector('.wpstg-is-dir-loading');\n if (this.currentCheckboxElement.getAttribute('data-navigateable', 'false') === 'false') {\n return false;\n }\n\n if (this.currentCheckboxElement.getAttribute('data-scanned', 'false') === 'false') {\n return true;\n }\n\n return false;\n }\n\n sendRequest(action) {\n if (this.currentLoader !== null) {\n this.currentLoader.style.display = 'inline-block';\n }\n\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams({\n action: action,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n dirPath: this.currentCheckboxElement.value,\n isChecked: this.currentCheckboxElement.checked,\n forceDefault: this.isDefaultSelected,\n }),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((data) => {\n if ('undefined' !== typeof (data.success) && data.success) {\n this.currentCheckboxElement.setAttribute('data-scanned', true);\n const dirContainer = document.createElement('div');\n dirContainer.classList.add('wpstg-dir');\n dirContainer.classList.add('wpstg-subdir');\n dirContainer.innerHTML = JSON.parse(data.directoryListing);\n this.currentParentDiv.appendChild(dirContainer);\n if (this.currentLoader !== null) {\n this.currentLoader.style.display = 'none';\n }\n\n dom.slideDown(dirContainer);\n\n return;\n }\n\n if (this.notyf !== null) {\n this.notyf.error(this.wpstgObject.i18n['somethingWentWrong']);\n } else {\n alert('Error: ' + this.wpstgObject.i18n['somethingWentWrong']);\n }\n }).catch((error) => {\n console.warn(this.wpstgObject.i18n['somethingWentWrong'], error);\n });\n }\n\n getExcludedDirectories() {\n this.excludedDirectories = [];\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input:not(:checked)').forEach((element) => {\n if (!this.isParentExcluded(element.value)) {\n this.excludedDirectories.push(element.value);\n }\n });\n\n this.existingExcludes.forEach((exclude) => {\n if (!this.isParentExcluded(exclude) && !this.isExcludeScanned(exclude)) {\n this.excludedDirectories.push(exclude);\n }\n });\n\n return this.excludedDirectories.join(this.wpstgObject.settings.directorySeparator);\n }\n\n /**\n * @param {string} path\n * @return {bool}\n */\n isParentExcluded(path) {\n let isParentAlreadyExcluded = false;\n this.excludedDirectories.forEach((dir) => {\n if (path.startsWith(dir + '/')) {\n isParentAlreadyExcluded = true;\n }\n });\n\n return isParentAlreadyExcluded;\n }\n\n getExtraDirectoriesRootOnly() {\n this.getExcludedDirectories();\n const extraDirectories = [];\n this.directoryListingContainer.querySelectorAll(':not(.wpstg-subdir)>.wpstg-dir>input.wpstg-wp-non-core-dir:checked').forEach((element) => {\n extraDirectories.push(element.value);\n });\n\n // Check if extra directories text area exists\n // TODO: remove extraCustomDirectories code if no one require extraCustomDirectories...\n const extraDirectoriesTextArea = dom.qs('#wpstg_extraDirectories');\n if (extraDirectoriesTextArea === null || extraDirectoriesTextArea.value === '') {\n return extraDirectories.join(this.wpstgObject.settings.directorySeparator);\n }\n\n const extraCustomDirectories = extraDirectoriesTextArea.value.split(/\\r?\\n/);\n\n return extraDirectories.concat(extraCustomDirectories).join(this.wpstgObject.settings.directorySeparator);\n }\n\n unselectAll() {\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input').forEach((element) => {\n element.checked = false;\n });\n }\n\n selectDefault() {\n // unselect all checkboxes\n this.unselectAll();\n\n // only select those checkboxes whose class is wpstg-wp-core-dir\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input.wpstg-wp-core-dir').forEach((element) => {\n element.checked = true;\n });\n\n // then unselect those checkboxes whose parent has wpstg extra checkbox\n this.directoryListingContainer.querySelectorAll('.wpstg-dir > .wpstg-wp-non-core-dir').forEach((element) => {\n element.parentElement.querySelectorAll('input.wpstg-wp-core-dir').forEach((element) => {\n element.checked = false;\n });\n });\n\n this.isDefaultSelected = true;\n }\n\n parseExcludes() {\n this.existingExcludes = this.directoryListingContainer.getAttribute('data-existing-excludes', []);\n if (this.existingExcludes === '') {\n this.existingExcludes = [];\n }\n\n if (this.existingExcludes.length !== 0) {\n this.existingExcludes = this.existingExcludes.split(',');\n }\n }\n\n isExcludeScanned(exclude) {\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input').forEach((element) => {\n if (element.value === exclude) {\n return true;\n }\n });\n\n return false;\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Rich Exclude Filter Module\n */\nexport default class WpstgExcludeFilters {\n constructor(\n excludeFilterContainerSelector = '#wpstg-exclude-filters-container',\n wpstgObject = wpstg,\n ) {\n this.excludeContainer = dom.qs(excludeFilterContainerSelector);\n this.excludeTableBody = dom.qs(`${excludeFilterContainerSelector} tbody`);\n this.wpstgObject = wpstgObject;\n this.init();\n }\n\n addEvents() {\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-file-size-rule', () => {\n this.addFileSizeExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-file-ext-rule', () => {\n this.addFileExtExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-file-name-rule', () => {\n this.addFileNameExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-dir-name-rule', () => {\n this.addDirNameExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-clear-all-rules', () => {\n this.clearExcludes();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-remove-exclude-rule', (target) => {\n this.removeExclude(target);\n });\n }\n\n init() {\n if (this.excludeContainer === null) {\n console.log('Error: Given table selector not found!');\n return;\n }\n\n this.addEvents();\n }\n\n addFileSizeExclude() {\n this.addExcludeRuleRow('#wpstg-file-size-exclude-filter-template');\n }\n\n addFileExtExclude() {\n this.addExcludeRuleRow('#wpstg-file-ext-exclude-filter-template');\n }\n\n addFileNameExclude() {\n this.addExcludeRuleRow('#wpstg-file-name-exclude-filter-template');\n }\n\n addDirNameExclude() {\n this.addExcludeRuleRow('#wpstg-dir-name-exclude-filter-template');\n }\n\n addExcludeRuleRow(templateName) {\n const excludeRowTemplate = dom.qs(templateName);\n if (excludeRowTemplate !== null) {\n const clone = excludeRowTemplate.content.cloneNode(true);\n const excludeRow = clone.querySelector('tr');\n\n this.excludeTableBody.appendChild(excludeRow);\n dom.all('.wpstg-has-exclude-rules').forEach((e) => {\n e.style.display = 'inherit';\n });\n }\n }\n\n clearExcludes() {\n this.excludeTableBody.innerHTML = '';\n dom.all('.wpstg-has-exclude-rules').forEach((e) => {\n e.style.display = 'none';\n });\n }\n\n removeExclude(target) {\n if (target.parentElement !== null && target.parentElement.parentElement !== null) {\n this.excludeTableBody.removeChild(target.parentElement.parentElement);\n }\n\n if (this.excludeTableBody.innerHTML.trim() === '') {\n dom.all('.wpstg-has-exclude-rules').forEach((e) => {\n e.style.display = 'none';\n });\n }\n }\n\n /**\n * Converts all the exclude filters arrays into one single string to keep size of post request small\n * @return {string}\n */\n getExcludeFilters() {\n const globExcludes = [];\n const sizeExcludes = [];\n\n const sizeCompares = this.excludeTableBody.querySelectorAll('select[name=\"wpstgFileSizeExcludeRuleCompare[]\"]');\n const sizeSizes = this.excludeTableBody.querySelectorAll('input[name=\"wpstgFileSizeExcludeRuleSize[]\"]');\n const sizeByte = this.excludeTableBody.querySelectorAll('select[name=\"wpstgFileSizeExcludeRuleByte[]\"]');\n for (const [key, sizeInput] of Object.entries(sizeSizes)) {\n if (sizeInput.value !== '') {\n sizeExcludes.push(sizeCompares[key].value + ' ' + sizeInput.value + sizeByte[key].value);\n }\n }\n\n const extensionInputs = this.excludeTableBody.querySelectorAll('input[name=\"wpstgFileExtExcludeRule[]\"]');\n extensionInputs.forEach((x) => {\n const ext = this.cleanStringForGlob(x.value);\n if (ext !== '') {\n globExcludes.push('ext:' + ext.trim());\n }\n });\n\n const fileNamesPos = this.excludeTableBody.querySelectorAll('select[name=\"wpstgFileNameExcludeRulePos[]\"]');\n const fileNames = this.excludeTableBody.querySelectorAll('input[name=\"wpstgFileNameExcludeRulePath[]\"]');\n for (const [key, fileInput] of Object.entries(fileNames)) {\n const fileName = this.cleanStringForGlob(fileInput.value);\n if (fileName !== '') {\n globExcludes.push('file:' + fileNamesPos[key].value + ' ' + fileName.trim());\n }\n }\n\n const dirNamesPos = this.excludeTableBody.querySelectorAll('select[name=\"wpstgDirNameExcludeRulePos[]\"]');\n const dirNames = this.excludeTableBody.querySelectorAll('input[name=\"wpstgDirNameExcludeRulePath[]\"]');\n for (const [key, dirInput] of Object.entries(dirNames)) {\n const dirName = this.cleanStringForGlob(dirInput.value);\n if (dirName !== '') {\n globExcludes.push('dir:' + dirNamesPos[key].value + ' ' + dirName.trim());\n }\n }\n\n return {\n 'sizes': sizeExcludes.filter(this.onlyUnique).join(','),\n // return set of unique rules\n 'globs': globExcludes.filter(this.onlyUnique).join(','),\n };\n }\n\n onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }\n\n /**\n * Remove most of the comment glob characters from the string\n * @param {String} value\n * @return {String}\n */\n cleanStringForGlob(value) {\n // will replace character like * ^ / \\ ! ? [ from the string\n return value.replace(/[*^//!\\.[?]/g, '');\n }\n}\n","/**\n * Basic WP Staging Modal implemented with help of Sweetalerts\n */\nexport default class WpstgModal {\n constructor(\n confirmAction,\n wpstgObject = wpstg,\n ) {\n this.confirmAction = confirmAction;\n this.wpstgObject = wpstgObject;\n }\n\n show(swalOptions, additionalParams = {}, callback = null) {\n wpstgSwal.fire(swalOptions).then((result) => {\n if (result.value && this.error !== null) {\n this.triggerConfirmAction(additionalParams, callback);\n }\n });\n }\n\n triggerConfirmAction(additionalParams = {}, callback = null) {\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams(Object.assign({\n action: this.confirmAction,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n }, additionalParams)),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((response) => {\n if (callback !== null) {\n callback(response);\n }\n }).catch((error) => {\n console.log(this.wpstgObject.i18n['somethingWentWrong'], error);\n });\n }\n}\n","'use strict';\n\n/**\n * This is a namespaced port of https://github.com/tristen/hoverintent,\n * with slight modification to accept selector with dynamically added element in dom,\n * instead of just already present element.\n *\n * @param {HTMLElement} parent\n * @param {string} selector\n * @param {CallableFunction} onOver\n * @param {CallableFunction} onOut\n *\n * @return {object}\n */\nexport default function(parent, selector, onOver, onOut) {\n let x; let y; let pX; let pY;\n let mouseOver = false;\n let focused = false;\n const h = {};\n let state = 0;\n let timer = 0;\n\n let options = {\n sensitivity: 7,\n interval: 100,\n timeout: 0,\n handleFocus: false,\n };\n\n function delay(el, e) {\n if (timer) {\n timer = clearTimeout(timer);\n }\n\n state = 0;\n return focused ? undefined : onOut(el, e);\n }\n\n function tracker(e) {\n x = e.clientX;\n y = e.clientY;\n }\n\n function compare(el, e) {\n if (timer) timer = clearTimeout(timer);\n if ((Math.abs(pX - x) + Math.abs(pY - y)) < options.sensitivity) {\n state = 1;\n return focused ? undefined : onOver(el, e);\n } else {\n pX = x;\n pY = y;\n timer = setTimeout(function() {\n compare(el, e);\n }, options.interval);\n }\n }\n\n // Public methods\n h.options = function(opt) {\n const focusOptionChanged = opt.handleFocus !== options.handleFocus;\n options = Object.assign({}, options, opt);\n if (focusOptionChanged) {\n options.handleFocus ? addFocus() : removeFocus();\n }\n\n return h;\n };\n\n function dispatchOver(el, e) {\n mouseOver = true;\n if (timer) {\n timer = clearTimeout(timer);\n }\n\n el.removeEventListener('mousemove', tracker, false);\n\n if (state !== 1) {\n pX = e.clientX;\n pY = e.clientY;\n\n el.addEventListener('mousemove', tracker, false);\n\n timer = setTimeout(function() {\n compare(el, e);\n }, options.interval);\n }\n\n return this;\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchOver to support dynamically added elements to dom\n */\n function onMouseOver(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchOver(event.target.closest(selector), event);\n }\n };\n\n function dispatchOut(el, e) {\n mouseOver = false;\n if (timer) {\n timer = clearTimeout(timer);\n }\n\n el.removeEventListener('mousemove', tracker, false);\n\n if (state === 1) {\n timer = setTimeout(function() {\n delay(el, e);\n }, options.timeout);\n }\n\n return this;\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchOut to support dynamically added elements to dom\n */\n function onMouseOut(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchOut(event.target.closest(selector), event);\n }\n };\n\n function dispatchFocus(el, e) {\n if (!mouseOver) {\n focused = true;\n onOver(el, e);\n }\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchFocus to support dynamically added elements to dom\n */\n function onFocus(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchFocus(event.target.closest(selector), event);\n }\n };\n\n function dispatchBlur(el, e) {\n if (!mouseOver && focused) {\n focused = false;\n onOut(el, e);\n }\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchBlur to support dynamically added elements to dom\n */\n function onBlur(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchBlur(event.target.closest(selector), event);\n }\n };\n\n /**\n * Modified to support dynamically added element\n */\n function addFocus() {\n parent.addEventListener('focus', onFocus, false);\n parent.addEventListener('blur', onBlur, false);\n }\n\n /**\n * Modified to support dynamically added element\n */\n function removeFocus() {\n parent.removeEventListener('focus', onFocus, false);\n parent.removeEventListener('blur', onBlur, false);\n }\n\n /**\n * Modified to support dynamically added element\n */\n h.remove = function() {\n if (!parent) {\n return;\n }\n\n parent.removeEventListener('mouseover', onMouseOver, false);\n parent.removeEventListener('mouseout', onMouseOut, false);\n removeFocus();\n };\n\n /**\n * Modified to support dynamically added element\n */\n if (parent) {\n parent.addEventListener('mouseover', onMouseOver, false);\n parent.addEventListener('mouseout', onMouseOut, false);\n }\n\n return h;\n};\n","import wpstgHoverIntent from './modules/wpstg-hover-intent';\n\nexport default (function($) {\n const WPStagingCommon = {\n continueErrorHandle: true,\n cache: {\n elements: [],\n get: function(selector) {\n // It is already cached!\n if ($.inArray(selector, this.elements) !== -1) {\n return this.elements[selector];\n }\n\n // Create cache and return\n this.elements[selector] = $(selector);\n\n return this.elements[selector];\n },\n refresh: function(selector) {\n selector.elements[selector] = $(selector);\n },\n },\n setJobId: function(jobId) {\n localStorage.setItem('jobIdBeingProcessed', jobId);\n },\n getJobId: function() {\n return localStorage.getItem('jobIdBeingProcessed');\n },\n listenTooltip: function() {\n wpstgHoverIntent(document, '.wpstg--tooltip', function(target, event) {\n target.querySelector('.wpstg--tooltiptext').style.visibility = 'visible';\n }, function(target, event) {\n target.querySelector('.wpstg--tooltiptext').style.visibility = 'hidden';\n });\n },\n isEmpty: function(obj) {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n\n return true;\n },\n // Get the custom themed Swal Modal for WP Staging\n // Easy to maintain now in one place now\n getSwalModal: function(isContentCentered = false, customClasses = {}) {\n // common style for all swal modal used in WP Staging\n const defaultCustomClasses = {\n confirmButton: 'wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn wpstg-100-width',\n cancelButton: 'wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn wpstg-100-width',\n actions: 'wpstg--modal--actions',\n popup: isContentCentered ? 'wpstg-swal-popup centered-modal' : 'wpstg-swal-popup',\n };\n\n // If a attribute exists in both default and additional attributes,\n // The class(es) of the additional attribute will overrite the default one.\n const options = {\n customClass: Object.assign(defaultCustomClasses, customClasses),\n buttonsStyling: false,\n reverseButtons: true,\n showClass: {\n popup: 'wpstg--swal2-show wpstg-swal-show',\n },\n };\n\n return wpstgSwal.mixin(options);\n },\n showSuccessModal: function(htmlContent) {\n this.getSwalModal().fire({\n showConfirmButton: false,\n showCancelButton: true,\n cancelButtonText: 'OK',\n icon: 'success',\n title: 'Success!',\n html: '<div class=\"wpstg--grey\" style=\"text-align: left; margin-top: 8px;\">' + htmlContent + '</div>',\n });\n },\n showWarningModal: function(htmlContent) {\n this.getSwalModal().fire({\n showConfirmButton: false,\n showCancelButton: true,\n cancelButtonText: 'OK',\n icon: 'warning',\n title: '',\n html: '<div class=\"wpstg--grey\" style=\"text-align: left; margin-top: 8px;\">' + htmlContent + '</div>',\n });\n },\n showErrorModal: function(htmlContent) {\n this.getSwalModal().fire({\n showConfirmButton: false,\n showCancelButton: true,\n cancelButtonText: 'OK',\n icon: 'error',\n title: 'Error!',\n html: '<div class=\"wpstg--grey\" style=\"text-align: left; margin-top: 8px;\">' + htmlContent + '</div>',\n });\n },\n getSwalContainer: function() {\n return wpstgSwal.getContainer();\n },\n closeSwalModal: function() {\n wpstgSwal.close();\n },\n /**\n * Treats a default response object generated by WordPress's\n * wp_send_json_success() or wp_send_json_error() functions in\n * PHP, parses it in JavaScript, and either throws if it's an error,\n * or returns the data if the response is successful.\n *\n * @param {object} response\n * @return {*}\n */\n getDataFromWordPressResponse(response) {\n if (typeof response !== 'object') {\n throw new Error('Unexpected response (ERR 1341)');\n }\n\n if (!response.hasOwnProperty('success')) {\n throw new Error('Unexpected response (ERR 1342)');\n }\n\n if (!response.hasOwnProperty('data')) {\n throw new Error('Unexpected response (ERR 1343)');\n }\n\n if (response.success === false) {\n if (response.data instanceof Array && response.data.length > 0) {\n throw new Error(response.data.shift());\n } else {\n throw new Error('Response was not successful');\n }\n } else {\n // Successful response. Return the data.\n return response.data;\n }\n },\n isLoading: function(isLoading) {\n if (!isLoading || isLoading === false) {\n WPStagingCommon.cache.get('.wpstg-loader').hide();\n } else {\n WPStagingCommon.cache.get('.wpstg-loader').show();\n }\n },\n /**\n * Convert the given url to make it slug compatible\n * @param {string} url\n */\n slugify: function(url) {\n return url.toString()\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .replace(/\\s+/g, '-')\n .replace(/&/g, '-and-')\n .replace(/[^a-z0-9\\-]/g, '')\n .replace(/-+/g, '-')\n .replace(/^-*/, '')\n .replace(/-*$/, '')\n ;\n },\n showAjaxFatalError: function(response, prependMessage, appendMessage) {\n prependMessage = prependMessage ? prependMessage + '<br/><br/>' : 'Something went wrong! <br/><br/>';\n appendMessage = appendMessage ? appendMessage + '<br/><br/>' : '<br/><br/>Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.';\n\n if (response === false) {\n WPStagingCommon.showError(prependMessage + ' Error: No response.' + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n\n if (typeof response.error !== 'undefined' && response.error) {\n WPStagingCommon.showError(prependMessage + ' Error: ' + response.message + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n },\n handleFetchErrors: function(response) {\n if (!response.ok) {\n WPStagingCommon.showError('Error: ' + response.status + ' - ' + response.statusText + '. Please try again or contact support.');\n }\n return response;\n },\n showError: function(message) {\n WPStagingCommon.cache.get('#wpstg-try-again').css('display', 'inline-block');\n WPStagingCommon.cache.get('#wpstg-cancel-cloning').text('Reset');\n WPStagingCommon.cache.get('#wpstg-resume-cloning').show();\n WPStagingCommon.cache.get('#wpstg-error-wrapper').show();\n WPStagingCommon.cache.get('#wpstg-error-details').show().html(message);\n WPStagingCommon.cache.get('#wpstg-removing-clone').removeClass('loading');\n WPStagingCommon.cache.get('.wpstg-loader').hide();\n $('.wpstg--modal--process--generic-problem').show().html(message);\n },\n resetErrors: function() {\n WPStagingCommon.cache.get('#wpstg-error-details').hide().html('');\n },\n /**\n * Ajax Requests\n * @param {Object} data\n * @param {Function} callback\n * @param {string} dataType\n * @param {bool} showErrors\n * @param {int} tryCount\n * @param {float} incrementRatio\n * @param errorCallback\n */\n ajax: function(data, callback, dataType, showErrors, tryCount, incrementRatio = null, errorCallback = null) {\n if ('undefined' === typeof (dataType)) {\n dataType = 'json';\n }\n\n if (false !== showErrors) {\n showErrors = true;\n }\n\n tryCount = 'undefined' === typeof (tryCount) ? 0 : tryCount;\n\n const retryLimit = 10;\n\n let retryTimeout = 10000 * tryCount;\n\n incrementRatio = parseInt(incrementRatio);\n if (!isNaN(incrementRatio)) {\n retryTimeout *= incrementRatio;\n }\n\n $.ajax({\n url: ajaxurl + '?action=wpstg_processing&_=' + (Date.now() / 1000),\n type: 'POST',\n dataType: dataType,\n cache: false,\n data: data,\n error: function(xhr, textStatus, errorThrown) {\n console.log(xhr.status + ' ' + xhr.statusText + '---' + textStatus);\n\n if (typeof (errorCallback) === 'function') {\n // Custom error handler\n errorCallback(xhr, textStatus, errorThrown);\n\n if (!WPStagingCommon.continueErrorHandle) {\n // Reset state\n WPStagingCommon.continueErrorHandle = true;\n\n return;\n }\n }\n\n // Default error handler\n tryCount++;\n if (tryCount <= retryLimit) {\n setTimeout(function() {\n WPStagingCommon.ajax(data, callback, dataType, showErrors, tryCount, incrementRatio);\n return;\n }, retryTimeout);\n } else {\n const errorCode = 'undefined' === typeof (xhr.status) ? 'Unknown' : xhr.status;\n WPStagingCommon.showError(\n 'Fatal Error: ' + errorCode + ' Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.',\n );\n }\n },\n success: function(data) {\n if ('function' === typeof (callback)) {\n callback(data);\n }\n },\n statusCode: {\n 404: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 404 - Can\\'t find ajax request URL! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 500: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Fatal Error 500 - Internal server error while processing the request! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 504: function() {\n if (tryCount > retryLimit) {\n WPStagingCommon.showError('Error 504 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 502: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 502 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 503: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 503 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 429: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 429 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 403: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Refresh page or login again! The process should be finished successfully. \\n\\ ');\n }\n },\n },\n });\n },\n };\n\n return WPStagingCommon;\n})(jQuery);\n","\nimport * as dom from './wpstg-dom-utils.js';\nimport WpstgDirectoryNavigation from './wpstg-directory-navigation.js';\nimport WpstgExcludeFilters from './wpstg-exclude-filters.js';\nimport WpstgModal from './wpstg-modal.js';\nimport WPStagingCommon from './../wpstg.js';\n\n/**\n * Manage RESET MODAL\n */\nexport default class WpstgResetModal {\n constructor(\n cloneID,\n workflowSelector = '#wpstg-workflow',\n fetchExcludeSettingsAction = 'wpstg_clone_excludes_settings',\n modalErrorAction = 'wpstg_modal_error',\n wpstgObject = wpstg,\n ) {\n this.cloneID = cloneID;\n this.workflow = dom.qs(workflowSelector);\n this.wpstgObject = wpstgObject;\n this.fetchExcludeSettingsAction = fetchExcludeSettingsAction;\n this.modalErrorAction = modalErrorAction;\n this.resetButtonClass = 'wpstg-confirm-reset-clone';\n this.resetModalContainerClass = 'wpstg-reset-confirmation';\n this.resetTabSelector = '.wpstg-reset-exclude-tab';\n this.directoryNavigator = null;\n this.excludeFilters = null;\n this.isAllTablesChecked = true;\n }\n\n addEvents() {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n if (resetModalContainer === null) {\n console.log('Exit');\n return;\n }\n\n dom.addEvent(resetModalContainer, 'click', this.resetTabSelector, (target) => {\n this.toggleContent(target);\n });\n\n dom.addEvent(resetModalContainer, 'click', '.wpstg-button-select', () => {\n this.selectDefaultTables();\n });\n\n dom.addEvent(resetModalContainer, 'click', '.wpstg-button-unselect', () => {\n this.toggleTableSelection();\n });\n\n dom.addEvent(resetModalContainer, 'click', '.wpstg-expand-dirs', (target, event) => {\n event.preventDefault();\n this.toggleDirectoryNavigation(target);\n });\n\n dom.addEvent(resetModalContainer, 'change', 'input.wpstg-check-dir', (target) => {\n this.updateDirectorySelection(target);\n });\n }\n\n init() {\n this.addEvents();\n }\n\n toggleContent(target) {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n const contentId = target.getAttribute('data-id');\n const tabTriangle = target.querySelector('.wpstg-tab-triangle');\n const isCollapsed = target.getAttribute('data-collapsed', 'true');\n const content = dom.qs(contentId);\n if (isCollapsed === 'true') {\n if (resetModalContainer.classList.contains('has-collapsible-open')) {\n resetModalContainer.classList.add('has-collapsible-open-2');\n } else {\n resetModalContainer.classList.add('has-collapsible-open');\n }\n\n dom.slideDown(content);\n tabTriangle.style.transform = 'rotate(90deg)';\n target.setAttribute('data-collapsed', 'false');\n } else {\n if (resetModalContainer.classList.contains('has-collapsible-open-2')) {\n resetModalContainer.classList.remove('has-collapsible-open-2');\n } else {\n resetModalContainer.classList.remove('has-collapsible-open');\n }\n\n dom.slideUp(content);\n tabTriangle.style.removeProperty('transform');\n target.setAttribute('data-collapsed', 'true');\n }\n }\n\n /**\n * Show Swal alert with loader and send ajax request to fetch content of alert.\n * @return Promise\n */\n showModal() {\n const swalPromise = this.loadModal();\n this.init();\n this.fetchCloneExcludes();\n return swalPromise;\n }\n\n loadModal() {\n return WPStagingCommon.getSwalModal(false, {\n confirmButton: this.resetButtonClass + ' wpstg-confirm-reset-clone wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn',\n container: this.resetModalContainerClass + ' wpstg-swal2-container wpstg-swal2-loading',\n }).fire({\n title: '',\n icon: 'warning',\n html: this.getAjaxLoader(),\n width: '400px',\n focusConfirm: false,\n confirmButtonText: this.wpstgObject.i18n.resetClone,\n showCancelButton: true,\n });\n }\n\n fetchCloneExcludes() {\n this.error = null;\n // send ajax request and fetch preserved exclude settings\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams({\n action: this.fetchExcludeSettingsAction,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n clone: this.cloneID,\n job: 'resetting',\n }),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((data) => {\n if (!data.success) {\n const errorModal = new WpstgModal(this.modalErrorAction, this.wpstgObject);\n errorModal.show(Object.assign({\n title: 'Error',\n icon: 'error',\n html: this.wpstgObject.i18n['somethingWentWrong'],\n width: '500px',\n confirmButtonText: 'Ok',\n showCancelButton: false,\n customClass: {\n confirmButton: 'wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn',\n cancelButton: 'wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn',\n actions: 'wpstg--modal--actions',\n popup: 'wpstg-swal-popup centered-modal',\n },\n buttonsStyling: false,\n reverseButtons: true,\n }, data.swalOptions), {\n type: data.type,\n });\n\n return;\n }\n\n const modal = dom.qs('.wpstg-reset-confirmation');\n modal.classList.remove('wpstg-swal2-loading');\n modal.querySelector('.wpstg--swal2-popup').style.width = '500px';\n modal.querySelector('.wpstg--swal2-content').innerHTML = data.html;\n this.directoryNavigator = new WpstgDirectoryNavigation();\n this.excludeFilters = new WpstgExcludeFilters();\n }).catch((error) => {\n this.renderError({\n 'html': this.wpstgObject.i18n['somethingWentWrong'] + ' ' + error,\n });\n });\n }\n\n getDirectoryNavigator() {\n return this.directoryNavigator;\n }\n\n getExcludeFilters() {\n return this.excludeFilters;\n }\n\n getAjaxLoader() {\n return '<div class=\"wpstg-swal2-ajax-loader\"><img src=\"' + this.wpstgObject.wpstgIcon + '\" /></div>';\n }\n\n toggleDirectoryNavigation(element) {\n const cbElement = element.previousSibling;\n if (cbElement.getAttribute('data-navigateable', 'false') === 'false') {\n return;\n }\n\n if (cbElement.getAttribute('data-scanned', 'false') === 'false') {\n return;\n }\n\n const subDirectories = dom.getNextSibling(element, '.wpstg-subdir');\n\n if (subDirectories.style.display === 'none') {\n dom.slideDown(subDirectories);\n } else {\n dom.slideUp(subDirectories);\n }\n }\n\n updateDirectorySelection(element) {\n const parent = element.parentElement;\n if (element.checked) {\n dom.getParents(parent, '.wpstg-dir').forEach((parElem) => {\n for (let i = 0; i < parElem.children.length; i++) {\n if (parElem.children[i].matches('.wpstg-check-dir')) {\n parElem.children[i].checked = true;\n }\n }\n });\n parent.querySelectorAll('.wpstg-expand-dirs').forEach((x) => {\n x.classList.remove('disabled');\n });\n parent.querySelectorAll('.wpstg-subdir .wpstg-check-dir').forEach((x) => {\n x.checked = true;\n });\n } else {\n parent.querySelectorAll('.wpstg-expand-dirs, .wpstg-check-subdirs').forEach((x) => {\n x.classList.add('disabled');\n });\n parent.querySelectorAll('.wpstg-dir .wpstg-check-dir').forEach((x) => {\n x.checked = false;\n });\n }\n }\n\n selectDefaultTables() {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n const options = resetModalContainer.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table');\n const multisitePattern = '^' + this.wpstgObject.tblprefix + '([^0-9])_*';\n const singleSitePattern = '^' + this.wpstgObject.tblprefix;\n options.forEach((option) => {\n const name = option.getAttribute('name', '');\n if (this.wpstgObject.isMultisite === '1' && name.match(multisitePattern)) {\n option.setAttribute('selected', 'selected');\n } else if (this.wpstgObject.isMultisite === '' && name.match(singleSitePattern)) {\n option.setAttribute('selected', 'selected');\n } else {\n option.removeAttribute('selected');\n }\n });\n }\n\n toggleTableSelection() {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n if (false === this.isAllTablesChecked) {\n resetModalContainer.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach((option) => {\n option.setAttribute('selected', 'selected');\n });\n resetModalContainer.querySelector('.wpstg-button-unselect').innerHTML = 'Unselect All';\n // cache.get('.wpstg-db-table-checkboxes').prop('checked', true);\n this.isAllTablesChecked = true;\n } else {\n resetModalContainer.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach((option) => {\n option.removeAttribute('selected');\n });\n resetModalContainer.querySelector('.wpstg-button-unselect').innerHTML = 'Select All';\n // cache.get('.wpstg-db-table-checkboxes').prop('checked', false);\n this.isAllTablesChecked = false;\n }\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Handle toggle of advance settings checkboxes\n */\nexport default class WpstgCloningAdvanceSettings {\n constructor(\n baseContainerSelector = '#wpstg-clonepage-wrapper',\n ) {\n this.baseContainer = dom.qs(baseContainerSelector);\n this.checkBoxSettingTogglerSelector = '.wpstg-toggle-advance-settings-section';\n this.init();\n }\n\n /**\n * Add events\n * @return {void}\n */\n addEvents() {\n if (this.baseContainer === null) {\n return;\n }\n\n dom.addEvent(this.baseContainer, 'change', this.checkBoxSettingTogglerSelector, (element) => {\n this.toggleSettings(element);\n });\n }\n\n /**\n * @return {void}\n */\n init() {\n this.addEvents();\n }\n\n /**\n * Expand/Collapse checkbox content on change\n * @return {void}\n */\n toggleSettings(element) {\n const target = dom.qs('#' + element.getAttribute('data-id'));\n if (element.checked) {\n dom.slideDown(target);\n } else {\n dom.slideUp(target);\n }\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\nexport default class WpstgMainMenu {\n constructor() {\n this.activeTabClass = 'wpstg--tab--active';\n this.mainMenu();\n }\n\n mainMenu() {\n const tabHeader = dom.qs('.wpstg--tab--header');\n // Early bail if tab header is not available\n if (tabHeader === null) {\n return;\n }\n\n dom.addEvent(dom.qs('.wpstg--tab--header'), 'click', '.wpstg-button', (element) => {\n const $this = element;\n const target = $this.getAttribute('data-target');\n const targetElements = dom.all(target);\n const menuItems = dom.all('.wpstg--tab--header a[data-target]');\n const contents = dom.all('.wpstg--tab--contents > .wpstg--tab--content');\n\n contents.forEach((content) => {\n // active tab class is without the css dot class prefix\n if (content.matches('.' + this.activeTabClass + ':not(' + target + ')')) {\n content.classList.remove(this.activeTabClass);\n }\n });\n\n menuItems.forEach((menuItem) => {\n if (menuItem !== $this) {\n menuItem.classList.remove(this.activeTabClass);\n }\n });\n\n $this.classList.add(this.activeTabClass);\n\n targetElements.forEach((targetElement) => {\n targetElement.classList.add(this.activeTabClass);\n });\n\n if ('#wpstg--tab--backup' === target) {\n window.dispatchEvent(new Event('backups-tab'));\n }\n });\n };\n}\n","import WpstgCloneStaging from './modules/wpstg-clone-staging.js';\nimport WpstgDirectoryNavigation from './modules/wpstg-directory-navigation.js';\nimport WpstgExcludeFilters from './modules/wpstg-exclude-filters.js';\nimport WpstgResetModal from './modules/wpstg-reset-modal.js';\nimport WpstgModal from './modules/wpstg-modal.js';\nimport WpstgCloningAdvanceSettings from './modules/wpstg-cloning-advance-settings.js';\nimport WpstgMainMenu from './modules/wpstg-main-menu.js';\nimport WPStagingCommon from './wpstg.js';\n\nvar WPStaging = (function($) {\n const that = {\n isCancelled: false,\n isFinished: false,\n getLogs: false,\n time: 1,\n executionTime: false,\n progressBar: 0,\n cloneExcludeFilters: null,\n directoryNavigator: null,\n notyf: null,\n areAllTablesChecked: true,\n };\n const cache = {elements: []};\n let timeout; let ajaxSpinner;\n\n /**\n * Get / Set Cache for Selector\n * @param {String} selector\n * @return {*}\n */\n cache.get = function(selector) {\n // It is already cached!\n if ($.inArray(selector, cache.elements) !== -1) {\n return cache.elements[selector];\n }\n\n // Create cache and return\n cache.elements[selector] = jQuery(selector);\n\n return cache.elements[selector];\n };\n\n /**\n * Refreshes given cache\n * @param {String} selector\n */\n cache.refresh = function(selector) {\n selector.elements[selector] = jQuery(selector);\n };\n\n /**\n * Show and Log Error Message\n * @param {String} message\n */\n const showError = function(message) {\n cache.get('#wpstg-try-again').css('display', 'inline-block');\n cache.get('#wpstg-cancel-cloning').text('Reset');\n cache.get('#wpstg-resume-cloning').show();\n cache.get('#wpstg-error-wrapper').show();\n cache.get('#wpstg-error-details').show().html(message);\n cache.get('#wpstg-removing-clone').removeClass('loading');\n cache.get('.wpstg-loader').hide();\n $('.wpstg--modal--process--generic-problem').show().html(message);\n\n // Error event information for Staging\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n dataType: 'json',\n data: {\n 'action': 'wpstg_staging_job_error',\n 'accessToken': wpstg.accessToken,\n 'nonce': wpstg.nonce,\n 'error_message': message,\n },\n });\n };\n\n /**\n * Show warning during cloning or push process when closing tab or browser, or changing page\n * @param {beforeunload} event\n * @return {null}\n */\n that.warnIfClosingDuringProcess = function(event) {\n // Only some browsers show the message below, most say something like \"Changes you made may not be saved\" (Chrome) or \"You have unsaved changes. Exit?\"\n event.returnValue = 'You MUST leave this window open while cloning/pushing. Please wait...';\n return null;\n };\n\n /**\n *\n * @param response the error object\n * @param prependMessage Overwrite default error message at beginning\n * @param appendMessage Overwrite default error message at end\n * @returns void\n */\n\n const showAjaxFatalError = function(response, prependMessage, appendMessage) {\n prependMessage = prependMessage ? prependMessage + '<br/><br/>' : 'Something went wrong! <br/><br/>';\n appendMessage = appendMessage ? appendMessage + '<br/><br/>' : '<br/><br/>Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.';\n\n if (response === false) {\n showError(prependMessage + ' Error: No response.' + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n\n if (typeof response.error !== 'undefined' && response.error) {\n console.error(response.message);\n showError(prependMessage + ' Error: ' + response.message + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n };\n\n /**\n *\n * @param response\n * @return {{ok}|*}\n */\n const handleFetchErrors = function(response) {\n if (!response.ok) {\n showError('Error: ' + response.status + ' - ' + response.statusText + '. Please try again or contact support.');\n }\n return response;\n };\n\n /** Hide and reset previous thrown visible errors */\n const resetErrors = function() {\n cache.get('#wpstg-error-details').hide().html('');\n };\n\n /**\n * Common Elements\n */\n const elements = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n let urlSpinner = ajaxurl.replace('/admin-ajax.php', '') + '/images/spinner';\n let timer;\n\n if (2 < window.devicePixelRatio) {\n urlSpinner += '-2x';\n }\n\n urlSpinner += '.gif';\n\n ajaxSpinner = '<img src=\\'\\'' + urlSpinner + '\\' alt=\\'\\' class=\\'ajax-spinner general-spinner\\' />';\n\n const getBaseValues = function() {\n const path = $('#wpstg-use-target-dir').data('base-path');\n const uri = $('#wpstg-use-target-hostname').data('base-uri');\n return {\n path,\n };\n };\n\n $workFlow\n .on('change', '#wpstg_network_clone', function(e) {\n e.preventDefault();\n $('.wpstg-button-select').trigger('click');\n })\n // Check / Un-check All Database Tables New\n .on('click', '.wpstg-button-unselect', function(e) {\n e.preventDefault();\n\n if (false === that.areAllTablesChecked) {\n cache.get('#wpstg_select_tables_cloning .wpstg-db-table').prop('selected', 'selected');\n cache.get('.wpstg-button-unselect').text('Unselect All');\n cache.get('.wpstg-db-table-checkboxes').prop('checked', true);\n that.areAllTablesChecked = true;\n } else {\n cache.get('#wpstg_select_tables_cloning .wpstg-db-table').prop('selected', false);\n cache.get('.wpstg-button-unselect').text('Select All');\n cache.get('.wpstg-db-table-checkboxes').prop('checked', false);\n that.areAllTablesChecked = false;\n }\n })\n\n /**\n * Select tables with certain tbl prefix | NEW\n * @param obj e\n * @returns {undefined}\n */\n .on('click', '.wpstg-button-select', function(e) {\n e.preventDefault();\n $('#wpstg_select_tables_cloning .wpstg-db-table').each(function() {\n let regex = '^' + wpstg.tblprefix;\n if (wpstg.isMultisite === '1' && !$('#wpstg_network_clone').is(':checked')) {\n regex += '([^0-9])_*';\n }\n\n if ($(this).attr('name').match(regex)) {\n $(this).prop('selected', 'selected');\n } else {\n $(this).prop('selected', false);\n }\n });\n })\n // Expand Directories\n .on('click', '.wpstg-expand-dirs', function(e) {\n e.preventDefault();\n\n const $this = $(this);\n\n $this.siblings('.wpstg-subdir').slideToggle();\n })\n // When a directory checkbox is Selected\n .on('change', 'input.wpstg-check-dir', function() {\n const $directory = $(this).parent('.wpstg-dir');\n\n if (this.checked) {\n $directory.parents('.wpstg-dir').children('.wpstg-check-dir').prop('checked', true);\n $directory.find('.wpstg-expand-dirs').removeClass('disabled');\n $directory.find('.wpstg-subdir .wpstg-check-dir').prop('checked', true);\n } else {\n $directory.find('.wpstg-dir .wpstg-check-dir').prop('checked', false);\n $directory.find('.wpstg-expand-dirs, .wpstg-check-subdirs').addClass('disabled');\n $directory.find('.wpstg-check-subdirs').data('action', 'check').text('check');\n }\n })\n // When a directory name is Selected\n .on('change', 'href.wpstg-check-dir', function() {\n const $directory = $(this).parent('.wpstg-dir');\n\n if (this.checked) {\n $directory.parents('.wpstg-dir').children('.wpstg-check-dir').prop('checked', true);\n $directory.find('.wpstg-expand-dirs').removeClass('disabled');\n $directory.find('.wpstg-subdir .wpstg-check-dir').prop('checked', true);\n } else {\n $directory.find('.wpstg-dir .wpstg-check-dir').prop('checked', false);\n $directory.find('.wpstg-expand-dirs, .wpstg-check-subdirs').addClass('disabled');\n $directory.find('.wpstg-check-subdirs').data('action', 'check').text('check');\n }\n })\n // Check the max length of the clone name and if the clone name already exists\n .on('keyup', '#wpstg-new-clone-id', function() {\n // Hide previous errors\n document.getElementById('wpstg-error-details').style.display = 'none';\n\n // This request was already sent, clear it up!\n if ('number' === typeof (timer)) {\n clearInterval(timer);\n }\n\n // Early bail if site name is empty\n if (this.value === undefined || this.value === '') {\n cache.get('#wpstg-new-clone-id').removeClass('wpstg-error-input');\n cache.get('#wpstg-start-cloning').removeAttr('disabled');\n cache.get('#wpstg-clone-id-error').text('').hide();\n return;\n }\n\n // Convert the site name to directory name (slugify the site name to create directory name)\n const cloneDirectoryName = WPStagingCommon.slugify(this.value);\n\n timer = setTimeout(\n function() {\n ajax(\n {\n action: 'wpstg_check_clone',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n directoryName: cloneDirectoryName,\n },\n function(response) {\n if (response.status === 'success') {\n cache.get('#wpstg-new-clone-id').removeClass('wpstg-error-input');\n cache.get('#wpstg-start-cloning').removeAttr('disabled');\n cache.get('#wpstg-clone-id-error').text('').hide();\n } else {\n cache.get('#wpstg-new-clone-id').addClass('wpstg-error-input');\n cache.get('#wpstg-start-cloning').prop('disabled', true);\n cache.get('#wpstg-clone-id-error').text(response.message).show();\n }\n },\n );\n },\n 500,\n );\n })\n // Restart cloning process\n .on('click', '#wpstg-start-cloning', function() {\n resetErrors();\n that.isCancelled = false;\n that.getLogs = false;\n that.progressBar = 0;\n })\n .on('input', '#wpstg-new-clone-id', function() {\n if ($('#wpstg-clone-directory').length < 1) {\n return;\n }\n\n const slug = WPStagingCommon.slugify(this.value);\n const $targetDir = $('#wpstg-use-target-dir');\n const $targetUri = $('#wpstg-use-target-hostname');\n let path = $targetDir.data('base-path');\n let uri = $targetUri.data('base-uri');\n\n if (path) {\n path = path.replace(/\\/+$/g, '') + '/' + slug + '/';\n }\n\n if (uri) {\n uri = uri.replace(/\\/+$/g, '') + '/' + slug;\n }\n\n\n $('.wpstg-use-target-dir--value').text(path);\n $('.wpstg-use-target-hostname--value').text(uri);\n\n $targetDir.attr('data-path', path);\n $targetUri.attr('data-uri', uri);\n $('#wpstg_clone_dir').attr('placeholder', path);\n $('#wpstg_clone_hostname').attr('placeholder', uri);\n })\n .on('input', '#wpstg_clone_hostname', function() {\n if ($(this).val() === '' || validateTargetHost()) {\n $('#wpstg_clone_hostname_error').remove();\n return;\n }\n if (!validateTargetHost() && !$('#wpstg_clone_hostname_error').length) {\n $('#wpstg-clone-directory tr:last-of-type').after('<tr><td> </td><td><p id=\"wpstg_clone_hostname_error\" style=\"color: red;\"> Invalid host name. Please provide it in a format like http://example.com</p></td></tr>');\n }\n })\n ;\n\n cloneActions();\n };\n\n /* @returns {boolean} */\n var validateTargetHost = function() {\n const the_domain = $('#wpstg_clone_hostname').val();\n\n if (the_domain === '') {\n return true;\n }\n\n const reg = /^http(s)?:\\/\\/.*$/;\n if (reg.test(the_domain) === false) {\n return false;\n }\n return true;\n };\n\n /**\n * Clone actions\n */\n var cloneActions = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n\n $workFlow\n // Cancel cloning\n .on('click', '#wpstg-cancel-cloning', function() {\n if (!confirm('Are you sure you want to cancel cloning process?')) {\n return false;\n }\n\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n $this.prop('disabled', true);\n\n that.isCancelled = true;\n that.progressBar = 0;\n\n $('#wpstg-processing-status').text('Please wait...this can take up a while.');\n $('.wpstg-loader, #wpstg-show-log-button').hide();\n\n $this.parent().append(ajaxSpinner);\n\n cancelCloning();\n })\n // Resume cloning\n .on('click', '#wpstg-resume-cloning', function() {\n resetErrors();\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n\n that.isCancelled = false;\n\n $('#wpstg-processing-status').text('Try to resume cloning process...');\n $('#wpstg-error-details').hide();\n $('.wpstg-loader').show();\n\n $this.parent().append(ajaxSpinner);\n\n that.startCloning();\n })\n // Cancel update cloning\n .on('click', '#wpstg-cancel-cloning-update', function() {\n resetErrors();\n\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n $this.prop('disabled', true);\n\n that.isCancelled = true;\n\n $('#wpstg-cloning-result').text('Please wait...this can take up a while.');\n $('.wpstg-loader, #wpstg-show-log-button').hide();\n\n $this.parent().append(ajaxSpinner);\n\n cancelCloningUpdate();\n })\n // Restart cloning\n .on('click', '#wpstg-restart-cloning', function() {\n resetErrors();\n\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n $this.prop('disabled', true);\n\n that.isCancelled = true;\n\n $('#wpstg-cloning-result').text('Please wait...this can take up a while.');\n $('.wpstg-loader, #wpstg-show-log-button').hide();\n\n $this.parent().append(ajaxSpinner);\n\n restart();\n })\n // Delete clone - confirmation\n .on('click', '.wpstg-remove-clone[data-clone]', function(e) {\n resetErrors();\n e.preventDefault();\n\n const $existingClones = cache.get('#wpstg-existing-clones');\n\n $workFlow.removeClass('active');\n\n cache.get('.wpstg-loader').show();\n\n ajax(\n {\n action: 'wpstg_confirm_delete_clone',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n clone: $(this).data('clone'),\n },\n function(response) {\n cache.get('#wpstg-removing-clone').html(response);\n\n $existingClones.children('img').remove();\n\n cache.get('.wpstg-loader').hide();\n\n $('html, body').animate({\n // This logic is meant to be a \"scrollBottom\"\n scrollTop: $('#wpstg-remove-clone').offset().top - $(window).height() +\n $('#wpstg-remove-clone').height() + 50,\n }, 100);\n },\n 'HTML',\n );\n })\n // Delete clone - confirmed\n .on('click', '#wpstg-remove-clone', function(e) {\n resetErrors();\n e.preventDefault();\n\n cache.get('#wpstg-removing-clone').addClass('loading');\n\n cache.get('.wpstg-loader').show();\n\n deleteClone($(this).data('clone'));\n })\n // Cancel deleting clone\n .on('click', '#wpstg-cancel-removing', function(e) {\n e.preventDefault();\n $('.wpstg-clone').removeClass('active');\n cache.get('#wpstg-removing-clone').html('');\n })\n // Update\n .on('click', '.wpstg-execute-clone', function(e) {\n e.preventDefault();\n\n const clone = $(this).data('clone');\n\n $workFlow.addClass('loading');\n that.cloneExcludeFilters = null;\n ajax(\n {\n action: 'wpstg_scanning',\n clone: clone,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response.length < 1) {\n showError(\n 'Something went wrong! Error: No response. Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.',\n );\n }\n\n const jsonResponse = tryParseJson(response);\n if (jsonResponse !== false && jsonResponse.success === false) {\n $workFlow.removeClass('loading');\n showErrorModal(jsonResponse);\n\n return;\n }\n\n $workFlow.removeClass('loading').html(response);\n // register check disk space function for clone update process.\n checkDiskSpace();\n that.directoryNavigator = new WpstgDirectoryNavigation('#wpstg-directories-listing', wpstg, that.notyf);\n that.cloneExcludeFilters = new WpstgExcludeFilters();\n that.switchStep(2);\n },\n 'HTML',\n );\n })\n // Reset Clone\n .on('click', '.wpstg-reset-clone', function(e) {\n e.preventDefault();\n const clone = $(this).data('clone');\n const resetModal = new WpstgResetModal(clone);\n const promise = resetModal.showModal();\n that.areAllTablesChecked = true;\n\n promise.then((result) => {\n if (result.value) {\n const dirNavigator = resetModal.getDirectoryNavigator();\n const exclFilters = resetModal.getExcludeFilters().getExcludeFilters();\n resetClone(clone, {\n includedTables: getIncludedTables(),\n excludeSizeRules: encodeURIComponent(exclFilters.sizes),\n excludeGlobRules: encodeURIComponent(exclFilters.globs),\n excludedDirectories: dirNavigator.getExcludedDirectories(),\n extraDirectories: dirNavigator.getExtraDirectoriesRootOnly(),\n });\n }\n });\n\n return;\n });\n };\n\n /**\n * Ajax Requests\n * @param Object data\n * @param Function callback\n * @param string dataType\n * @param bool showErrors\n * @param int tryCount\n * @param float incrementRatio\n */\n var ajax = function(data, callback, dataType, showErrors, tryCount, incrementRatio = null) {\n if ('undefined' === typeof (dataType)) {\n dataType = 'json';\n }\n\n if (false !== showErrors) {\n showErrors = true;\n }\n\n tryCount = 'undefined' === typeof (tryCount) ? 0 : tryCount;\n\n const retryLimit = 5;\n\n let retryTimeout = 10000 * tryCount;\n\n incrementRatio = parseInt(incrementRatio);\n if (!isNaN(incrementRatio)) {\n retryTimeout *= incrementRatio;\n }\n\n $.ajax({\n url: ajaxurl + '?action=wpstg_processing&_=' + (Date.now() / 1000),\n type: 'POST',\n dataType: dataType,\n cache: false,\n data: data,\n error: function(xhr, textStatus, errorThrown) {\n // try again after 10 seconds\n tryCount++;\n if (tryCount <= retryLimit) {\n console.log('RETRYING ' + tryCount + '/' + retryLimit);\n setTimeout(function() {\n ajax(data, callback, dataType, showErrors, tryCount, incrementRatio);\n return;\n }, retryTimeout);\n } else {\n console.log('RETRYING LIMIT');\n const errorCode = 'undefined' === typeof (xhr.status) ? 'Unknown' : xhr.status;\n showError(\n 'Fatal Error: ' + errorCode + ' Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.',\n );\n }\n },\n success: function(data) {\n if ('function' === typeof (callback)) {\n callback(data);\n }\n },\n statusCode: {\n 404: function() {\n if (tryCount >= retryLimit) {\n showError('Error 404 - Can\\'t find ajax request URL! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 500: function() {\n if (tryCount >= retryLimit) {\n showError('Fatal Error 500 - Internal server error while processing the request! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 504: function() {\n if (tryCount > retryLimit) {\n showError('Error 504 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 502: function() {\n if (tryCount >= retryLimit) {\n showError('Error 502 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 503: function() {\n if (tryCount >= retryLimit) {\n showError('Error 503 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 429: function() {\n if (tryCount >= retryLimit) {\n showError('Error 429 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 403: function() {\n if (tryCount >= retryLimit) {\n showError('Refresh page or login again! The process should be finished successfully. \\n\\ ');\n }\n },\n },\n });\n };\n\n /**\n * Next / Previous Step Clicks to Navigate Through Staging Job\n */\n const stepButtons = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n\n $workFlow\n // Next Button\n .on('click', '.wpstg-next-step-link', function(e) {\n e.preventDefault();\n\n const $this = $(this);\n const isScan = false;\n\n if ($('#wpstg_clone_hostname').length && !validateTargetHost()) {\n $('#wpstg_clone_hostname').focus();\n return false;\n }\n\n if ($this.data('action') === 'wpstg_update' || $this.data('action') === 'wpstg_reset') {\n // Update / Reset Clone - confirmed\n let onlyUpdateMessage = '';\n if ($this.data('action') === 'wpstg_update') {\n onlyUpdateMessage = ' \\n\\nExclude all tables and folders you do not want to overwrite, first! \\n\\nDo not cancel the updating process! This can break your staging site. \\n\\n\\Create a backup of your staging website before you proceed.';\n }\n\n if (!confirm('STOP! This will overwrite your staging site with all selected data from the production site! This should be used only if you want to clone again your production site. Are you sure you want to do this?' + onlyUpdateMessage)) {\n return false;\n }\n }\n\n // Button is disabled\n if ($this.attr('disabled')) {\n return false;\n }\n\n if ($this.data('action') === 'wpstg_cloning') {\n // Verify External Database If Checked and Not Skipped\n if ($('#wpstg-ext-db').is(':checked')) {\n verifyExternalDatabase($this, $workFlow);\n return;\n }\n }\n\n proceedCloning($this, $workFlow);\n })\n // Previous Button\n .on('click', '.wpstg-prev-step-link', function(e) {\n e.preventDefault();\n cache.get('.wpstg-loader').removeClass('wpstg-finished');\n cache.get('.wpstg-loader').hide();\n loadOverview();\n });\n };\n\n /**\n * Get Included (Checked) Database Tables\n * @return {Array}\n */\n const getIncludedTables = function() {\n const includedTables = [];\n\n $('#wpstg_select_tables_cloning option:selected').each(function() {\n includedTables.push(this.value);\n });\n\n return includedTables;\n };\n\n /**\n * Get Excluded (Unchecked) Database Tables\n * Not used anymore!\n * @return {Array}\n */\n const getExcludedTables = function() {\n const excludedTables = [];\n\n $('.wpstg-db-table input:not(:checked)').each(function() {\n excludedTables.push(this.name);\n });\n\n return excludedTables;\n };\n\n /**\n * Verify External Database for Cloning\n */\n var verifyExternalDatabase = function($this, workflow) {\n cache.get('.wpstg-loader').show();\n ajax(\n {\n action: 'wpstg_database_verification',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n databaseUser: cache.get('#wpstg_db_username').val(),\n databasePassword: cache.get('#wpstg_db_password').val(),\n databaseServer: cache.get('#wpstg_db_server').val(),\n databaseDatabase: cache.get('#wpstg_db_database').val(),\n },\n function(response) {\n // Undefined Error\n if (false === response) {\n showError(\n 'Something went wrong! Error: No response.' +\n 'Please try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n cache.get('.wpstg-loader').hide();\n return;\n }\n\n // Throw Error\n if ('undefined' === typeof (response.success)) {\n showError(\n 'Something went wrong! Error: Invalid response.' +\n 'Please try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n cache.get('.wpstg-loader').hide();\n return;\n }\n\n if (response.success) {\n cache.get('.wpstg-loader').hide();\n proceedCloning($this, workflow);\n return;\n }\n\n if (response.error_type === 'comparison') {\n cache.get('.wpstg-loader').hide();\n let render = '<table class=\"wpstg-db-comparison-table\"><thead><tr><th>Property</th><th>Production DB</th><th>Staging DB</th><th>Status</th></tr></thead><tbody>';\n response.checks.forEach((x) => {\n let icon = '<span class=\"wpstg-css-tick\"></span>';\n if (x.production !== x.staging) {\n icon = '<span class=\"wpstg-css-cross\"></span>';\n }\n render += '<tr><td>' + x.name + '</td><td>' + x.production + '</td><td>' + x.staging + '</td><td>' + icon + '</td></tr>';\n });\n render += '</tbody></table><p>Note: Some MySQL/MariaDB properties do not match. You may proceed but the staging site may not work as expected.</p>';\n WPStagingCommon.getSwalModal(true, {\n popup: 'wpstg-swal-popup wpstg-db-comparison-modal centered-modal',\n }).fire({\n title: 'Different Database Properties',\n icon: 'warning',\n html: render,\n width: '650px',\n focusConfirm: false,\n confirmButtonText: 'Proceed',\n showCancelButton: true,\n }).then(function(result) {\n if (result.value) {\n proceedCloning($this, workflow);\n }\n });\n return;\n }\n\n WPStagingCommon.getSwalModal(true).fire({\n title: 'Different Database Properties',\n icon: 'error',\n html: response.message,\n focusConfirm: true,\n confirmButtonText: 'Ok',\n showCancelButton: false,\n });\n cache.get('.wpstg-loader').hide();\n },\n 'json',\n false,\n );\n };\n\n /**\n * Get Cloning Step Data\n */\n const getCloningData = function() {\n if ('wpstg_cloning' !== that.data.action && 'wpstg_update' !== that.data.action && 'wpstg_reset' !== that.data.action) {\n return;\n }\n\n that.data.cloneID = new Date().getTime().toString();\n if ('wpstg_update' === that.data.action) {\n that.data.cloneID = $('#wpstg-new-clone-id').data('clone');\n }\n\n that.data.cloneName = $('#wpstg-new-clone-id').val() || that.data.cloneID;\n\n // Remove this to keep &_POST[] small otherwise mod_security will throw error 404\n // that.data.excludedTables = getExcludedTables();\n\n if (that.directoryNavigator !== null) {\n that.data.excludedDirectories = encodeURIComponent(that.directoryNavigator.getExcludedDirectories());\n that.data.extraDirectories = encodeURIComponent(that.directoryNavigator.getExtraDirectoriesRootOnly());\n }\n\n that.data.excludeGlobRules = '';\n that.data.excludeSizeRules = '';\n if (that.cloneExcludeFilters instanceof WpstgExcludeFilters) {\n const rules = that.cloneExcludeFilters.getExcludeFilters();\n that.data.excludeGlobRules = encodeURIComponent(rules.globs);\n that.data.excludeSizeRules = encodeURIComponent(rules.sizes);\n }\n\n that.data.includedTables = getIncludedTables();\n that.data.databaseServer = $('#wpstg_db_server').val();\n that.data.databaseUser = $('#wpstg_db_username').val();\n that.data.databasePassword = $('#wpstg_db_password').val();\n that.data.databaseDatabase = $('#wpstg_db_database').val();\n that.data.databasePrefix = $('#wpstg_db_prefix').val();\n const cloneDir = $('#wpstg_clone_dir').val();\n that.data.cloneDir = encodeURIComponent($.trim(cloneDir));\n that.data.cloneHostname = $('#wpstg_clone_hostname').val();\n that.data.emailsAllowed = $('#wpstg_allow_emails').is(':checked');\n that.data.networkClone = $('#wpstg_network_clone').is(':checked');\n that.data.uploadsSymlinked = $('#wpstg_symlink_upload').is(':checked');\n that.data.cleanPluginsThemes = $('#wpstg-clean-plugins-themes').is(':checked');\n that.data.cleanUploadsDir = $('#wpstg-clean-uploads').is(':checked');\n };\n\n var proceedCloning = function($this, workflow) {\n // Add loading overlay\n workflow.addClass('loading');\n\n // Prepare data\n that.data = {\n action: $this.data('action'),\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n };\n\n // Cloning data\n getCloningData();\n\n sendCloningAjax(workflow);\n };\n\n var sendCloningAjax = function(workflow) {\n // Send ajax request\n ajax(\n that.data,\n function(response) {\n // Undefined Error\n if (false === response) {\n showError(\n 'Something went wrong!<br/><br/> Go to WP Staging > Settings and lower \\'File Copy Limit\\' and \\'DB Query Limit\\'. Also set \\'CPU Load Priority to low \\'' +\n 'and try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n }\n\n\n if (response.length < 1) {\n showError(\n 'Something went wrong! No response. Go to WP Staging > Settings and lower \\'File Copy Limit\\' and \\'DB Query Limit\\'. Also set \\'CPU Load Priority to low \\'' +\n 'and try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n }\n\n const jsonResponse = tryParseJson(response);\n if (jsonResponse !== false && jsonResponse.success === false) {\n workflow.removeClass('loading');\n showErrorModal(jsonResponse);\n\n return;\n }\n\n // Styling of elements\n workflow.removeClass('loading').html(response);\n that.cloneExcludeFilters = null;\n if (that.data.action === 'wpstg_scanning') {\n that.areAllTablesChecked = true;\n that.directoryNavigator = new WpstgDirectoryNavigation('#wpstg-directories-listing', wpstg, that.notyf);\n that.switchStep(2);\n that.cloneExcludeFilters = new WpstgExcludeFilters();\n } else if (that.data.action === 'wpstg_cloning' || that.data.action === 'wpstg_update' || that.data.action === 'wpstg_reset') {\n that.switchStep(3);\n }\n\n // Start cloning\n that.startCloning();\n },\n 'HTML',\n );\n };\n\n var showErrorModal = function(response) {\n const errorModal = new WpstgModal('wpstg_modal_error', wpstg);\n errorModal.show(Object.assign({\n title: 'Error',\n icon: 'error',\n html: wpstg.i18n['somethingWentWrong'],\n width: '500px',\n confirmButtonText: 'Ok',\n showCancelButton: false,\n customClass: {\n confirmButton: 'wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn',\n cancelButton: 'wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn',\n actions: 'wpstg--modal--actions',\n popup: 'wpstg-swal-popup centered-modal',\n },\n buttonsStyling: false,\n reverseButtons: true,\n }, response.swalOptions), {\n type: response.type,\n });\n };\n\n const tryParseJson = function(json) {\n // early bail if not string\n if (!json) {\n return false;\n }\n\n try {\n const object = JSON.parse(json);\n if (object && typeof object === 'object') {\n return object;\n }\n } catch (e) {\n // do nothing on catch\n }\n\n return false;\n };\n\n var resetClone = function(clone, excludeOptions) {\n that.data = {\n action: 'wpstg_reset',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n cloneID: clone,\n };\n\n that.data = {...that.data, ...excludeOptions};\n\n const $workFlow = cache.get('#wpstg-workflow');\n sendCloningAjax($workFlow);\n };\n\n /**\n * Loads Overview (first step) of Staging Job\n */\n var loadOverview = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n\n $workFlow.addClass('loading');\n\n ajax(\n {\n action: 'wpstg_overview',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response.length < 1) {\n showError(\n 'Something went wrong! No response. Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report.',\n );\n }\n\n const $currentStep = cache.get('.wpstg-current-step');\n\n // Styling of elements\n $workFlow.removeClass('loading').html(response);\n },\n 'HTML',\n );\n\n that.switchStep(1);\n cache.get('.wpstg-step3-cloning').show();\n cache.get('.wpstg-step3-pushing').hide();\n };\n\n /**\n * Load Tabs\n */\n const tabs = function() {\n cache.get('#wpstg-workflow').on('click', '.wpstg-tab-header', function(e) {\n e.preventDefault();\n\n const $this = $(this);\n const $section = cache.get($this.data('id'));\n\n $this.toggleClass('expand');\n\n $section.slideToggle();\n\n const tabTriangle = $this.find('.wpstg-tab-triangle');\n\n if ($this.hasClass('expand')) {\n tabTriangle.removeClass('wpstg-no-icon');\n tabTriangle.text('');\n tabTriangle.addClass('wpstg-rotate-90');\n } else {\n tabTriangle.removeClass('wpstg-rotate-90');\n }\n });\n };\n\n /**\n * Delete Clone\n * @param {String} clone\n */\n var deleteClone = function(clone) {\n const deleteDir = $('#deleteDirectory:checked').data('deletepath');\n\n ajax(\n {\n action: 'wpstg_delete_clone',\n clone: clone,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n excludedTables: getExcludedTables(),\n deleteDir: deleteDir,\n },\n function(response) {\n if (response) {\n showAjaxFatalError(response);\n\n // Finished\n if ('undefined' !== typeof response.delete && (response.delete === 'finished' || response.delete === 'unfinished')) {\n cache.get('#wpstg-removing-clone').removeClass('loading').html('');\n\n if (response.delete === 'finished' && response.error === undefined) {\n $('.wpstg-clone[data-clone-id=\"' + clone + '\"]').remove();\n }\n\n // No staging site message is also of type/class .wpstg-class but hidden\n // We have just excluded that from search when counting no of clones\n if ($('#wpstg-existing-clones .wpstg-clone').length < 1) {\n cache.get('#wpstg-existing-clones').find('h3').text('');\n cache.get('#wpstg-no-staging-site-results').show();\n }\n\n cache.get('.wpstg-loader').hide();\n return;\n }\n }\n // continue\n if (true !== response) {\n deleteClone(clone);\n return;\n }\n },\n );\n };\n\n /**\n * Cancel Cloning Process\n */\n var cancelCloning = function() {\n that.timer('stop');\n\n\n if (true === that.isFinished) {\n return true;\n }\n\n ajax(\n {\n action: 'wpstg_cancel_clone',\n clone: that.data.cloneID,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response && 'undefined' !== typeof (response.delete) && response.delete === 'finished') {\n cache.get('.wpstg-loader').hide();\n // Load overview\n loadOverview();\n return;\n }\n\n if (true !== response) {\n // continue\n cancelCloning();\n return;\n }\n\n // Load overview\n loadOverview();\n },\n );\n };\n\n /**\n * Cancel Cloning Process\n */\n var cancelCloningUpdate = function() {\n if (true === that.isFinished) {\n return true;\n }\n\n ajax(\n {\n action: 'wpstg_cancel_update',\n clone: that.data.cloneID,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response && 'undefined' !== typeof (response.delete) && response.delete === 'finished') {\n // Load overview\n loadOverview();\n return;\n }\n\n if (true !== response) {\n // continue\n cancelCloningUpdate();\n return;\n }\n\n // Load overview\n loadOverview();\n },\n );\n };\n\n /**\n * Cancel Cloning Process\n */\n var restart = function() {\n if (true === that.isFinished) {\n return true;\n }\n\n ajax(\n {\n action: 'wpstg_restart',\n // clone: that.data.cloneID,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response && 'undefined' !== typeof (response.delete) && response.delete === 'finished') {\n // Load overview\n loadOverview();\n return;\n }\n\n if (true !== response) {\n // continue\n cancelCloningUpdate();\n return;\n }\n\n // Load overview\n loadOverview();\n },\n );\n };\n\n /**\n * Scroll the window log to bottom\n * @return void\n */\n const logscroll = function() {\n const $div = cache.get('.wpstg-log-details');\n if ('undefined' !== typeof ($div[0])) {\n $div.scrollTop($div[0].scrollHeight);\n }\n };\n\n /**\n * Append the log to the logging window\n * @param string log\n * @return void\n */\n const getLogs = function(log) {\n if (log != null && 'undefined' !== typeof (log)) {\n if (log.constructor === Array) {\n $.each(log, function(index, value) {\n if (value === null) {\n return;\n }\n if (value.type === 'ERROR') {\n cache.get('.wpstg-log-details').append('<span class=\"wpstg--red\">[' + value.type + ']</span>-' + '[' + value.date + '] ' + value.message + '</br>');\n } else {\n cache.get('.wpstg-log-details').append('[' + value.type + ']-' + '[' + value.date + '] ' + value.message + '</br>');\n }\n });\n } else {\n cache.get('.wpstg-log-details').append('[' + log.type + ']-' + '[' + log.date + '] ' + log.message + '</br>');\n }\n }\n logscroll();\n };\n\n /**\n * Check diskspace\n * @return string json\n */\n var checkDiskSpace = function() {\n cache.get('#wpstg-check-space').on('click', function(e) {\n cache.get('.wpstg-loader').show();\n const excludedDirectories = encodeURIComponent(that.directoryNavigator.getExcludedDirectories());\n const extraDirectories = encodeURIComponent(that.directoryNavigator.getExtraDirectoriesRootOnly());\n\n ajax(\n {\n action: 'wpstg_check_disk_space',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n excludedDirectories: excludedDirectories,\n extraDirectories: extraDirectories,\n },\n function(response) {\n if (false === response) {\n cache.get('#wpstg-clone-id-error').text('Can not detect required disk space').show();\n cache.get('.wpstg-loader').hide();\n return;\n }\n\n // Show required disk space\n cache.get('#wpstg-clone-id-error').html(\n 'Estimated necessary disk space: ' + response.requiredSpace +\n (response.errorMessage !== null ? ('<br>' + response.errorMessage) : '') +\n '<br> <span style=\"color:#444;\">Before you proceed ensure your account has enough free disk space to hold the entire instance of the production site. You can check the available space from your hosting account (cPanel or similar).</span>').show();\n cache.get('.wpstg-loader').hide();\n },\n 'json',\n false,\n );\n });\n };\n\n /**\n * Show or hide animated loading icon\n * @param isLoading bool\n */\n const isLoading = function(isLoading) {\n if (!isLoading || isLoading === false) {\n cache.get('.wpstg-loader').hide();\n } else {\n cache.get('.wpstg-loader').show();\n }\n };\n\n /**\n * Count up processing execution time\n * @param string status\n * @return html\n */\n that.timer = function(status) {\n if (status === 'stop') {\n const time = that.time;\n that.time = 1;\n clearInterval(that.executionTime);\n return that.convertSeconds(time);\n }\n\n\n that.executionTime = setInterval(function() {\n if (null !== document.getElementById('wpstg-processing-timer')) {\n document.getElementById('wpstg-processing-timer').innerHTML = 'Elapsed Time: ' + that.convertSeconds(that.time);\n }\n that.time++;\n if (status === 'stop') {\n that.time = 1;\n clearInterval(that.executionTime);\n }\n }, 1000);\n };\n\n /**\n * Convert seconds to hourly format\n * @param int seconds\n * @return string\n */\n that.convertSeconds = function(seconds) {\n const date = new Date(null);\n date.setSeconds(seconds); // specify value for SECONDS here\n return date.toISOString().substr(11, 8);\n };\n\n /**\n * Start Cloning Process\n * @type {Function}\n */\n that.startCloning = (function() {\n resetErrors();\n\n // Register function for checking disk space\n checkDiskSpace();\n\n if ('wpstg_cloning' !== that.data.action && 'wpstg_update' !== that.data.action && 'wpstg_reset' !== that.data.action) {\n return;\n }\n\n that.isCancelled = false;\n\n // Start the process\n start();\n\n // Functions\n // Start\n function start() {\n cache.get('.wpstg-loader').show();\n cache.get('#wpstg-cancel-cloning').text('Cancel');\n cache.get('#wpstg-resume-cloning').hide();\n cache.get('#wpstg-error-details').hide();\n\n\n // Clone Database\n setTimeout(function() {\n // cloneDatabase();\n window.addEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n processing();\n }, wpstg.delayReq);\n\n that.timer('start');\n }\n\n\n /**\n * Start ajax processing\n * @return string\n */\n var processing = function() {\n if (true === that.isCancelled) {\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return false;\n }\n\n isLoading(true);\n\n let excludedDirectories = '';\n let extraDirectories = '';\n if (that.directoryNavigator !== null) {\n excludedDirectories = that.directoryNavigator.getExcludedDirectories();\n extraDirectories = that.directoryNavigator.getExtraDirectoriesRootOnly();\n }\n\n // Show logging window\n cache.get('.wpstg-log-details').show();\n\n WPStaging.ajax(\n {\n action: 'wpstg_processing',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n excludedTables: getExcludedTables(),\n excludedDirectories: encodeURIComponent(excludedDirectories),\n extraDirectories: encodeURIComponent(extraDirectories),\n },\n function(response) {\n showAjaxFatalError(response);\n\n // Add Log messages\n if ('undefined' !== typeof (response.last_msg) && response.last_msg) {\n getLogs(response.last_msg);\n }\n // Continue processing\n if (false === response.status) {\n progressBar(response);\n\n setTimeout(function() {\n cache.get('.wpstg-loader').show();\n processing();\n }, wpstg.delayReq);\n } else if (true === response.status && 'finished' !== response.status) {\n cache.get('#wpstg-error-details').hide();\n cache.get('#wpstg-error-wrapper').hide();\n progressBar(response, true);\n processing();\n } else if ('finished' === response.status || ('undefined' !== typeof (response.job_done) && response.job_done)) {\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n finish(response);\n }\n ;\n },\n 'json',\n false,\n );\n };\n\n // Finish\n function finish(response) {\n if (true === that.getLogs) {\n getLogs();\n }\n\n progressBar(response);\n\n // Add Log\n if ('undefined' !== typeof (response.last_msg)) {\n getLogs(response.last_msg);\n }\n\n cache.get('.wpstg-loader').hide();\n cache.get('#wpstg-processing-header').html('Processing Complete');\n $('#wpstg-processing-status').text('Succesfully finished');\n\n cache.get('#wpstg_staging_name').html(that.data.cloneID);\n cache.get('#wpstg-finished-result').show();\n cache.get('#wpstg-cancel-cloning').hide();\n cache.get('#wpstg-resume-cloning').hide();\n cache.get('#wpstg-cancel-cloning-update').prop('disabled', true);\n\n const $link1 = cache.get('#wpstg-clone-url-1');\n const $link = cache.get('#wpstg-clone-url');\n $link1.attr('href', response.url);\n $link1.html(response.url);\n $link.attr('href', response.url);\n\n cache.get('#wpstg-remove-clone').data('clone', that.data.cloneID);\n\n // Finished\n that.isFinished = true;\n that.timer('stop');\n\n\n cache.get('.wpstg-loader').hide();\n cache.get('#wpstg-processing-header').html('Processing Complete');\n\n // show alert\n let msg = wpstg.i18n.cloneResetComplete;\n if (that.data.action === 'wpstg_update') {\n msg = wpstg.i18n.cloneUpdateComplete;\n }\n\n if (that.data.action === 'wpstg_update' || that.data.action === 'wpstg_reset') {\n cache.get('#wpstg-cancel-cloning-update').hide();\n cache.get('.wpstg-prev-step-link').show();\n\n WPStagingCommon.getSwalModal(true, {\n confirmButton: 'wpstg--btn--confirm wpstg-green-button wpstg-button wpstg-link-btn wpstg-100-width',\n }).fire({\n title: '',\n icon: 'success',\n html: msg,\n width: '500px',\n focusConfirm: true,\n });\n }\n\n return false;\n }\n\n /**\n * Add percentage progress bar\n * @param object response\n * @return {Boolean}\n */\n var progressBar = function(response, restart) {\n if ('undefined' === typeof (response.percentage)) {\n return false;\n }\n\n if (response.job === 'database') {\n cache.get('#wpstg-progress-db').width(response.percentage * 0.2 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 1 of 4 Cloning Database Tables...');\n }\n\n if (response.job === 'SearchReplace') {\n cache.get('#wpstg-progress-db').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-db').html('1. Database');\n // Assumption: All previous steps are done.\n // This avoids bugs where some steps are skipped and the progress bar is incomplete as a result\n cache.get('#wpstg-progress-db').width('20%');\n\n cache.get('#wpstg-progress-sr').width(response.percentage * 0.1 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 2 of 4 Preparing Database Data...');\n }\n\n if (response.job === 'directories') {\n cache.get('#wpstg-progress-sr').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-sr').html('2. Data');\n cache.get('#wpstg-progress-sr').width('10%');\n\n cache.get('#wpstg-progress-dirs').width(response.percentage * 0.1 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 3 of 4 Getting files...');\n }\n if (response.job === 'files') {\n cache.get('#wpstg-progress-dirs').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-dirs').html('3. Files');\n cache.get('#wpstg-progress-dirs').width('10%');\n\n cache.get('#wpstg-progress-files').width(response.percentage * 0.6 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 4 of 4 Copy files...');\n }\n if (response.job === 'finish') {\n cache.get('#wpstg-progress-files').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-files').html('4. Copy Files');\n cache.get('#wpstg-progress-files').width('60%');\n\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Cloning Process Finished');\n }\n };\n });\n\n that.switchStep = function(step) {\n cache.get('.wpstg-current-step')\n .removeClass('wpstg-current-step');\n cache.get('.wpstg-step' + step)\n .addClass('wpstg-current-step');\n };\n\n /**\n * Initiation\n * @type {Function}\n */\n that.init = (function() {\n loadOverview();\n elements();\n stepButtons();\n tabs();\n WPStagingCommon.listenTooltip();\n new WpstgMainMenu();\n new WpstgCloneStaging();\n new WpstgCloningAdvanceSettings();\n that.notyf = new Notyf({\n duration: 10000,\n position: {\n x: 'center',\n y: 'bottom',\n },\n dismissible: true,\n types: [\n {\n type: 'warning',\n background: 'orange',\n icon: false,\n },\n ],\n });\n });\n\n /**\n * Ajax call\n * @type {ajax}\n */\n that.ajax = ajax;\n that.showError = showError;\n that.getLogs = getLogs;\n that.loadOverview = loadOverview;\n\n return that;\n})(jQuery);\n\njQuery(document).ready(function() {\n WPStaging.init();\n // This is necessary to make WPStaging var accessibile in WP Staging PRO js script\n window.WPStaging = WPStaging;\n});\n\n/**\n * Report Issue modal\n */\njQuery(document).ready(function($) {\n $('body').on('click', '#wpstg-report-issue-button', function(e) {\n console.log('REPORT');\n $('.wpstg--tab--active .wpstg-report-issue-form').toggleClass('wpstg-report-show');\n e.preventDefault();\n });\n\n $('body').on('click', '#wpstg-backups-report-issue-button', function(e) {\n $('.wpstg--tab--active .wpstg-report-issue-form').toggleClass('wpstg-report-show');\n e.preventDefault();\n });\n\n $('body').on('click', '#wpstg-report-cancel', function(e) {\n $('.wpstg--tab--active .wpstg-report-issue-form').removeClass('wpstg-report-show');\n e.preventDefault();\n });\n\n $('body').on('click', '.wpstg--tab--active #wpstg-report-submit', function(e) {\n const self = $(this);\n sendIssueReport(self, 'false');\n e.preventDefault();\n });\n\n /*\n * Close Success Modal\n */\n\n $('body').on('click', '#wpstg-success-button', function(e) {\n e.preventDefault();\n $('.wpstg-report-issue-form').removeClass('wpstg-report-show');\n });\n\n function sendIssueReport(button, forceSend = 'false') {\n const spinner = button.next();\n const email = $('.wpstg--tab--active .wpstg-report-email').val();\n const hosting_provider = $('.wpstg--tab--active .wpstg-report-hosting-provider').val();\n const message = $('.wpstg--tab--active .wpstg-report-description').val();\n const syslog = $('.wpstg--tab--active .wpstg-report-syslog').is(':checked');\n const terms = $('.wpstg--tab--active .wpstg-report-terms').is(':checked');\n\n button.attr('disabled', true);\n spinner.css('visibility', 'visible');\n\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n dataType: 'json',\n async: true,\n data: {\n 'action': 'wpstg_send_report',\n 'accessToken': wpstg.accessToken,\n 'nonce': wpstg.nonce,\n 'wpstg_email': email,\n 'wpstg_provider': hosting_provider,\n 'wpstg_message': message,\n 'wpstg_syslog': +syslog,\n 'wpstg_terms': +terms,\n 'wpstg_force_send': forceSend,\n },\n }).done(function(data) {\n button.attr('disabled', false);\n spinner.css('visibility', 'hidden');\n\n if (data.errors.length > 0) {\n $('.wpstg--tab--active .wpstg-report-issue-form .wpstg-message').remove();\n\n let errorMessage = $('<div />').addClass('wpstg-message wpstg-error-message');\n $.each(data.errors, function(key, value) {\n if (value.status === 'already_submitted') {\n errorMessage = '';\n // TODO: remove default custom classes\n WPStagingCommon.getSwalModal(true, {\n container: 'wpstg-issue-resubmit-confirmation',\n }).fire({\n title: '',\n icon: 'warning',\n html: value.message,\n showCancelButton: true,\n focusConfirm: false,\n confirmButtonText: 'Yes',\n cancelButtonText: 'No',\n }).then((result) => {\n if (result.isConfirmed) {\n sendIssueReport(button, 'true');\n }\n });\n } else {\n errorMessage.append('<p>' + value + '</p>');\n }\n });\n\n $('.wpstg--tab--active .wpstg-report-issue-form').prepend(errorMessage);\n } else {\n const successMessage = $('<div />').addClass('wpstg-message wpstg-success-message');\n successMessage.append('<p>Thanks for submitting your request! You should receive an auto reply mail with your ticket ID immediately for confirmation!<br><br>If you do not get that mail please contact us directly at <strong>support@wp-staging.com</strong></p>');\n\n $('.wpstg--tab--active .wpstg-report-issue-form').html(successMessage);\n $('.wpstg--tab--active .wpstg-success-message').append('<div style=\"float:right;margin-top:10px;\"><a id=\"wpstg-success-button\" href=\"#\" class=\"wpstg--red\">[X] CLOSE</a></div>');\n\n // Hide message\n setTimeout(function() {\n $('.wpstg--tab--active .wpstg-report-issue-form').removeClass('wpstg-report-active');\n }, 2000);\n }\n });\n }\n\n // Open/close actions drop down menu\n $(document).on('click', '.wpstg-dropdown>.wpstg-dropdown-toggler', function(e) {\n e.preventDefault();\n $(e.target).next('.wpstg-dropdown-menu').toggleClass('shown');\n\n $(e.target).find('.wpstg-caret').toggleClass('wpstg-caret-up');\n });\n\n $(document).on('click', '.wpstg-caret', function(e) {\n e.preventDefault();\n\n const toggler = $(e.target).closest('.wpstg-dropdown-toggler');\n\n if (toggler) {\n toggler.trigger('click');\n }\n });\n\n // Close action drop down menu if clicked anywhere outside\n document.addEventListener('click', function(event) {\n const isClickInside = event.target.closest('.wpstg-dropdown-toggler');\n if (!isClickInside) {\n const dropDown = document.getElementsByClassName('wpstg-dropdown-menu');\n for (let i = 0; i < dropDown.length; i++) {\n dropDown[i].classList.remove('shown');\n }\n $('.wpstg-caret').removeClass('wpstg-caret-up');\n }\n });\n\n // \"Event info\" for backup errors\n window.addEventListener('finishedProcessWithError', function(customEvent) {\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n dataType: 'json',\n data: {\n 'action': 'wpstg_job_error',\n 'accessToken': wpstg.accessToken,\n 'nonce': wpstg.nonce,\n 'error_message': customEvent.detail.error,\n 'job_id': WPStagingCommon.getJobId(),\n },\n });\n });\n});\n"],"names":["qs","selector","document","querySelector","all","querySelectorAll","addEvent","parent","evt","handler","addEventListener","event","target","matches","closest","slideDown","element","duration","style","display","overflow","height","offsetHeight","transitionProperty","transitionDuration","setTimeout","window","removeProperty","slideUp","getNextSibling","sibling","nextElementSibling","getParents","result","parentElement","push","WpstgCloneStaging","pageWrapperId","wpstgObject","wpstg","pageWrapper","dom","enableButtonId","enableAction","notyf","Notyf","position","x","y","dismissible","types","type","background","icon","init","addEvents","sendRequest","action","fetch","ajaxUrl","method","credentials","body","URLSearchParams","accessToken","nonce","headers","then","response","ok","json","Promise","reject","data","success","location","reload","message","error","i18n","console","warn","WpstgDirectoryNavigation","directoryListingSelector","directoryListingContainer","dirCheckboxSelector","dirExpandSelector","unselectAllDirsSelector","selectDefaultDirsSelector","fetchChildrenAction","currentCheckboxElement","currentParentDiv","currentLoader","existingExcludes","excludedDirectories","isDefaultSelected","log","preventDefault","toggleDirExpand","unselectAll","selectDefault","parseExcludes","previousSibling","getAttribute","dirPath","value","isChecked","checked","forceDefault","setAttribute","dirContainer","createElement","classList","add","innerHTML","JSON","parse","directoryListing","appendChild","alert","getExcludedDirectories","forEach","isParentExcluded","exclude","isExcludeScanned","join","settings","directorySeparator","path","isParentAlreadyExcluded","dir","startsWith","getExtraDirectoriesRootOnly","extraDirectories","extraDirectoriesTextArea","extraCustomDirectories","split","concat","length","WpstgExcludeFilters","excludeFilterContainerSelector","excludeContainer","excludeTableBody","addFileSizeExclude","addFileExtExclude","addFileNameExclude","addDirNameExclude","clearExcludes","removeExclude","addExcludeRuleRow","templateName","excludeRowTemplate","clone","content","cloneNode","excludeRow","e","removeChild","trim","getExcludeFilters","globExcludes","sizeExcludes","sizeCompares","sizeSizes","sizeByte","Object","entries","key","sizeInput","extensionInputs","ext","cleanStringForGlob","fileNamesPos","fileNames","fileInput","fileName","dirNamesPos","dirNames","dirInput","dirName","filter","onlyUnique","index","self","indexOf","replace","WpstgModal","confirmAction","show","swalOptions","additionalParams","callback","wpstgSwal","fire","triggerConfirmAction","assign","onOver","onOut","pX","pY","mouseOver","focused","h","state","timer","options","sensitivity","interval","timeout","handleFocus","delay","el","clearTimeout","undefined","tracker","clientX","clientY","compare","Math","abs","opt","focusOptionChanged","addFocus","removeFocus","dispatchOver","removeEventListener","onMouseOver","dispatchOut","onMouseOut","dispatchFocus","onFocus","dispatchBlur","onBlur","remove","$","WPStagingCommon","continueErrorHandle","cache","elements","get","inArray","refresh","setJobId","jobId","localStorage","setItem","getJobId","getItem","listenTooltip","wpstgHoverIntent","visibility","isEmpty","obj","prop","hasOwnProperty","getSwalModal","isContentCentered","customClasses","defaultCustomClasses","confirmButton","cancelButton","actions","popup","customClass","buttonsStyling","reverseButtons","showClass","mixin","showSuccessModal","htmlContent","showConfirmButton","showCancelButton","cancelButtonText","title","html","showWarningModal","showErrorModal","getSwalContainer","getContainer","closeSwalModal","close","getDataFromWordPressResponse","Error","Array","shift","isLoading","hide","slugify","url","toString","toLowerCase","normalize","showAjaxFatalError","prependMessage","appendMessage","showError","WPStaging","warnIfClosingDuringProcess","handleFetchErrors","status","statusText","css","text","removeClass","resetErrors","ajax","dataType","showErrors","tryCount","incrementRatio","errorCallback","retryLimit","retryTimeout","parseInt","isNaN","ajaxurl","Date","now","xhr","textStatus","errorThrown","errorCode","statusCode","jQuery","WpstgResetModal","cloneID","workflowSelector","fetchExcludeSettingsAction","modalErrorAction","workflow","resetButtonClass","resetModalContainerClass","resetTabSelector","directoryNavigator","excludeFilters","isAllTablesChecked","resetModalContainer","toggleContent","selectDefaultTables","toggleTableSelection","toggleDirectoryNavigation","updateDirectorySelection","contentId","tabTriangle","isCollapsed","contains","transform","showModal","swalPromise","loadModal","fetchCloneExcludes","container","getAjaxLoader","width","focusConfirm","confirmButtonText","resetClone","job","errorModal","modal","renderError","getDirectoryNavigator","wpstgIcon","cbElement","subDirectories","parElem","i","children","multisitePattern","tblprefix","singleSitePattern","option","name","isMultisite","match","removeAttribute","WpstgCloningAdvanceSettings","baseContainerSelector","baseContainer","checkBoxSettingTogglerSelector","toggleSettings","WpstgMainMenu","activeTabClass","mainMenu","tabHeader","$this","targetElements","menuItems","contents","menuItem","targetElement","dispatchEvent","Event","that","isCancelled","isFinished","getLogs","time","executionTime","progressBar","cloneExcludeFilters","areAllTablesChecked","ajaxSpinner","returnValue","$workFlow","urlSpinner","devicePixelRatio","on","trigger","each","regex","is","attr","siblings","slideToggle","$directory","parents","find","addClass","getElementById","clearInterval","removeAttr","cloneDirectoryName","directoryName","slug","$targetDir","$targetUri","uri","val","validateTargetHost","after","cloneActions","the_domain","reg","test","confirm","append","cancelCloning","startCloning","cancelCloningUpdate","restart","$existingClones","animate","scrollTop","offset","top","deleteClone","jsonResponse","tryParseJson","checkDiskSpace","switchStep","resetModal","promise","dirNavigator","exclFilters","includedTables","getIncludedTables","excludeSizeRules","encodeURIComponent","sizes","excludeGlobRules","globs","stepButtons","focus","onlyUpdateMessage","verifyExternalDatabase","proceedCloning","loadOverview","getExcludedTables","excludedTables","databaseUser","databasePassword","databaseServer","databaseDatabase","error_type","render","checks","production","staging","getCloningData","getTime","cloneName","rules","databasePrefix","cloneDir","cloneHostname","emailsAllowed","networkClone","uploadsSymlinked","cleanPluginsThemes","cleanUploadsDir","sendCloningAjax","object","excludeOptions","tabs","$section","toggleClass","hasClass","deleteDir","logscroll","$div","scrollHeight","constructor","date","requiredSpace","errorMessage","convertSeconds","setInterval","seconds","setSeconds","toISOString","substr","start","processing","delayReq","last_msg","job_done","finish","$link1","$link","msg","cloneResetComplete","cloneUpdateComplete","percentage","toFixed","step","ready","sendIssueReport","button","forceSend","spinner","next","email","hosting_provider","syslog","terms","async","done","errors","isConfirmed","prepend","successMessage","toggler","isClickInside","dropDown","getElementsByClassName","customEvent","detail"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACO,SAASA,EAAT,CAAYC,QAAZ,EAAsB;EAC3B,SAAOC,QAAQ,CAACC,aAAT,CAAuBF,QAAvB,CAAP;EACD;EAED;EACA;EACA;EACA;;EACO,SAASG,GAAT,CAAaH,QAAb,EAAuB;EAC5B,SAAOC,QAAQ,CAACG,gBAAT,CAA0BJ,QAA1B,CAAP;EACD;EAED;EACA;EACA;;EACO,SAASK,QAAT,CAAkBC,MAAlB,EAA0BC,GAA1B,EAA+BP,QAA/B,EAAyCQ,OAAzC,EAAkD;EACvDF,EAAAA,MAAM,CAACG,gBAAP,CAAwBF,GAAxB,EAA6B,UAASG,KAAT,EAAgB;EAC3C,QAAIA,KAAK,CAACC,MAAN,CAAaC,OAAb,CAAqBZ,QAAQ,GAAG,IAAX,GAAkBA,QAAlB,GAA6B,IAAlD,CAAJ,EAA6D;EAC3DQ,MAAAA,OAAO,CAACE,KAAK,CAACC,MAAN,CAAaE,OAAb,CAAqBb,QAArB,CAAD,EAAiCU,KAAjC,CAAP;EACD;EACF,GAJD,EAIG,KAJH;EAKD;EAEM,SAASI,SAAT,CAAmBC,OAAnB,EAA4BC,QAA5B,EAA4C;EAAA,MAAhBA,QAAgB;EAAhBA,IAAAA,QAA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BAAhC,CAAjB;;EACA,WAAK,IAAInL,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGkL,QAAQ,CAACtZ,MAA7B,EAAqCoO,CAAC,EAAtC,EAA0C;EACxCkL,QAAAA,QAAQ,CAAClL,CAAD,CAAR,CAAY9P,SAAZ,CAAsByH,MAAtB,CAA6B,OAA7B;EACD;;EACDC,MAAAA,CAAC,CAAC,cAAD,CAAD,CAAkBqE,WAAlB,CAA8B,gBAA9B;EACD;EACF,GATD,EA9HiC;;EA0IjCrR,EAAAA,MAAM,CAAChB,gBAAP,CAAwB,0BAAxB,EAAoD,UAASwhB,WAAT,EAAsB;EACxExT,IAAAA,CAAC,CAACuE,IAAF,CAAO;EACLjB,MAAAA,GAAG,EAAE2B,OADA;EAELxQ,MAAAA,IAAI,EAAE,MAFD;EAGL+P,MAAAA,QAAQ,EAAE,MAHL;EAILzO,MAAAA,IAAI,EAAE;EACJ,kBAAU,iBADN;EAEJ,uBAAelC,KAAK,CAACyB,WAFjB;EAGJ,iBAASzB,KAAK,CAAC0B,KAHX;EAIJ,yBAAiBie,WAAW,CAACC,MAAZ,CAAmBrd,KAJhC;EAKJ,kBAAU6J,eAAe,CAACW,QAAhB;EALN;EAJD,KAAP;EAYD,GAbD;EAcD,CAxJD;;;;;;"}
|
1 |
+
{"version":3,"file":"wpstg-admin.js","sources":["../src/modules/wpstg-dom-utils.js","../src/modules/wpstg-clone-staging.js","../src/modules/wpstg-directory-navigation.js","../src/modules/wpstg-exclude-filters.js","../src/modules/wpstg-modal.js","../src/modules/wpstg-hover-intent.js","../src/wpstg.js","../src/modules/wpstg-reset-modal.js","../src/modules/wpstg-cloning-advance-settings.js","../src/modules/wpstg-main-menu.js","../src/wpstg-admin.js"],"sourcesContent":["/**\n * WP STAGING basic jQuery replacement\n */\n\n/**\n * Shortcut for document.querySelector() or jQuery's $()\n * Return single element only\n */\nexport function qs(selector) {\n return document.querySelector(selector);\n}\n\n/**\n * Shortcut for document.querySelector() or jQuery's $()\n * Return collection of elements\n */\nexport function all(selector) {\n return document.querySelectorAll(selector);\n}\n\n/**\n * alternative of jQuery - $(parent).on(event, selector, handler)\n */\nexport function addEvent(parent, evt, selector, handler) {\n parent.addEventListener(evt, function(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n handler(event.target.closest(selector), event);\n }\n }, false);\n}\n\nexport function slideDown(element, duration = 400) {\n element.style.display = 'block';\n element.style.overflow = 'hidden';\n const height = element.offsetHeight;\n element.style.height = '0px';\n element.style.transitionProperty = 'height';\n element.style.transitionDuration = duration + 'ms';\n setTimeout(() => {\n element.style.height = height + 'px';\n window.setTimeout(() => {\n element.style.removeProperty('height');\n element.style.removeProperty('overflow');\n element.style.removeProperty('transition-duration');\n element.style.removeProperty('transition-property');\n }, duration);\n }, 0);\n}\n\nexport function slideUp(element, duration = 400) {\n element.style.display = 'block';\n element.style.overflow = 'hidden';\n const height = element.offsetHeight;\n element.style.height = height + 'px';\n element.style.transitionProperty = 'height';\n element.style.transitionDuration = duration + 'ms';\n setTimeout(() => {\n element.style.height = '0px';\n window.setTimeout(() => {\n element.style.display = 'none';\n element.style.removeProperty('height');\n element.style.removeProperty('overflow');\n element.style.removeProperty('transition-duration');\n element.style.removeProperty('transition-property');\n }, duration);\n }, 0);\n}\n\nexport function fadeOut(element, duration = 300) {\n element.style.opacity = 1;\n element.style.transitionProperty = 'opacity';\n element.style.transitionDuration = duration + 'ms';\n setTimeout(() => {\n element.style.opacity = 0;\n window.setTimeout(() => {\n element.style.display = 'none';\n element.style.removeProperty('opacity');\n element.style.removeProperty('transition-duration');\n element.style.removeProperty('transition-property');\n }, duration);\n }, 0);\n}\n\nexport function getNextSibling(element, selector) {\n let sibling = element.nextElementSibling;\n\n while (sibling) {\n if (sibling.matches(selector)) {\n return sibling;\n }\n\n sibling = sibling.nextElementSibling;\n }\n};\n\nexport function getParents(element, selector) {\n const result = [];\n for (let parent = element && element.parentElement; parent; parent = parent.parentElement) {\n if (parent.matches(selector)) {\n result.push(parent);\n }\n }\n\n return result;\n}\n\n/**\n * Check if element has class name\n * @param element\n * @param className\n * @return {boolean}\n */\nexport function hasClass(element, className) {\n return (' ' + element.className + ' ').indexOf(' ' + className+ ' ') > -1;\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Enable/Disable cloning for staging site\n */\nexport default class WpstgCloneStaging {\n constructor(\n pageWrapperId = '#wpstg-clonepage-wrapper',\n wpstgObject = wpstg,\n ) {\n this.pageWrapper = dom.qs(pageWrapperId);\n this.wpstgObject = wpstgObject;\n this.enableButtonId = '#wpstg-enable-staging-cloning';\n this.enableAction = 'wpstg_enable_staging_cloning';\n\n this.notyf = new Notyf({\n duration: 10000,\n position: {\n x: 'center',\n y: 'bottom',\n },\n dismissible: true,\n types: [\n {\n type: 'warning',\n background: 'orange',\n icon: false,\n },\n ],\n });\n this.init();\n }\n\n addEvents() {\n if (this.pageWrapper === null) {\n return;\n }\n\n dom.addEvent(this.pageWrapper, 'click', this.enableButtonId, () => {\n this.sendRequest(this.enableAction);\n });\n }\n\n init() {\n this.addEvents();\n }\n\n sendRequest(action) {\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams({\n action: action,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n }),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((data) => {\n // Reload current page if successful.\n if ('undefined' !== typeof (data.success) && data.success) {\n location.reload();\n return;\n }\n\n // There will be message probably in case of error\n if ('undefined' !== typeof (data.message)) {\n this.notyf.error(data.message);\n return;\n }\n\n this.notyf.error(this.wpstgObject.i18n['somethingWentWrong']);\n }).catch((error) => {\n console.warn(this.wpstgObject.i18n['somethingWentWrong'], error);\n });\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Fetch directory direct child directories\n */\nexport default class WpstgDirectoryNavigation {\n constructor(\n directoryListingSelector = '#wpstg-directories-listing',\n wpstgObject = wpstg,\n notyf = null,\n ) {\n this.directoryListingContainer = dom.qs(directoryListingSelector);\n this.wpstgObject = wpstgObject;\n this.dirCheckboxSelector = '.wpstg-check-dir';\n this.dirExpandSelector = '.wpstg-expand-dirs';\n this.unselectAllDirsSelector = '.wpstg-unselect-dirs';\n this.selectDefaultDirsSelector = '.wpstg-select-dirs-default';\n this.fetchChildrenAction = 'wpstg_fetch_dir_childrens';\n this.currentCheckboxElement = null;\n this.currentParentDiv = null;\n this.currentLoader = null;\n this.existingExcludes = [];\n this.excludedDirectories = [];\n this.isDefaultSelected = false;\n this.notyf = notyf;\n\n this.init();\n }\n\n addEvents() {\n if (this.directoryListingContainer === null) {\n console.log('Error: directory navigation add events');\n return;\n }\n\n dom.addEvent(this.directoryListingContainer, 'click', this.dirExpandSelector, (element, event) => {\n event.preventDefault();\n if (this.toggleDirExpand(element)) {\n this.sendRequest(this.fetchChildrenAction, element);\n }\n });\n\n dom.addEvent(this.directoryListingContainer, 'click', this.unselectAllDirsSelector, () => {\n this.unselectAll();\n });\n\n dom.addEvent(this.directoryListingContainer, 'click', this.selectDefaultDirsSelector, () => {\n this.selectDefault();\n });\n }\n\n init() {\n this.addEvents();\n this.parseExcludes();\n }\n\n /**\n * Toggle Dir Expand,\n * Return true if children aren't fetched\n * @param {HTMLElement} element\n * @return {boolean}\n */\n toggleDirExpand(element) {\n this.currentParentDiv = element.parentElement;\n this.currentCheckboxElement = element.previousSibling;\n this.currentLoader = this.currentParentDiv.querySelector('.wpstg-is-dir-loading');\n if (this.currentCheckboxElement.getAttribute('data-navigateable', 'false') === 'false') {\n return false;\n }\n\n if (this.currentCheckboxElement.getAttribute('data-scanned', 'false') === 'false') {\n return true;\n }\n\n return false;\n }\n\n sendRequest(action) {\n if (this.currentLoader !== null) {\n this.currentLoader.style.display = 'inline-block';\n }\n\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams({\n action: action,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n dirPath: this.currentCheckboxElement.value,\n isChecked: this.currentCheckboxElement.checked,\n forceDefault: this.isDefaultSelected,\n }),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((data) => {\n if ('undefined' !== typeof (data.success) && data.success) {\n this.currentCheckboxElement.setAttribute('data-scanned', true);\n const dirContainer = document.createElement('div');\n dirContainer.classList.add('wpstg-dir');\n dirContainer.classList.add('wpstg-subdir');\n dirContainer.innerHTML = JSON.parse(data.directoryListing);\n this.currentParentDiv.appendChild(dirContainer);\n if (this.currentLoader !== null) {\n this.currentLoader.style.display = 'none';\n }\n\n dom.slideDown(dirContainer);\n\n return;\n }\n\n if (this.notyf !== null) {\n this.notyf.error(this.wpstgObject.i18n['somethingWentWrong']);\n } else {\n alert('Error: ' + this.wpstgObject.i18n['somethingWentWrong']);\n }\n }).catch((error) => {\n console.warn(this.wpstgObject.i18n['somethingWentWrong'], error);\n });\n }\n\n getExcludedDirectories() {\n this.excludedDirectories = [];\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input:not(:checked)').forEach((element) => {\n if (!this.isParentExcluded(element.value)) {\n this.excludedDirectories.push(element.value);\n }\n });\n\n this.existingExcludes.forEach((exclude) => {\n if (!this.isParentExcluded(exclude) && !this.isExcludeScanned(exclude)) {\n this.excludedDirectories.push(exclude);\n }\n });\n\n return this.excludedDirectories.join(this.wpstgObject.settings.directorySeparator);\n }\n\n /**\n * @param {string} path\n * @return {bool}\n */\n isParentExcluded(path) {\n let isParentAlreadyExcluded = false;\n this.excludedDirectories.forEach((dir) => {\n if (path.startsWith(dir + '/')) {\n isParentAlreadyExcluded = true;\n }\n });\n\n return isParentAlreadyExcluded;\n }\n\n getExtraDirectoriesRootOnly() {\n this.getExcludedDirectories();\n const extraDirectories = [];\n this.directoryListingContainer.querySelectorAll(':not(.wpstg-subdir)>.wpstg-dir>input.wpstg-wp-non-core-dir:checked').forEach((element) => {\n extraDirectories.push(element.value);\n });\n\n // Check if extra directories text area exists\n // TODO: remove extraCustomDirectories code if no one require extraCustomDirectories...\n const extraDirectoriesTextArea = dom.qs('#wpstg_extraDirectories');\n if (extraDirectoriesTextArea === null || extraDirectoriesTextArea.value === '') {\n return extraDirectories.join(this.wpstgObject.settings.directorySeparator);\n }\n\n const extraCustomDirectories = extraDirectoriesTextArea.value.split(/\\r?\\n/);\n\n return extraDirectories.concat(extraCustomDirectories).join(this.wpstgObject.settings.directorySeparator);\n }\n\n unselectAll() {\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input').forEach((element) => {\n element.checked = false;\n });\n }\n\n selectDefault() {\n // unselect all checkboxes\n this.unselectAll();\n\n // only select those checkboxes whose class is wpstg-wp-core-dir\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input.wpstg-wp-core-dir').forEach((element) => {\n element.checked = true;\n });\n\n // then unselect those checkboxes whose parent has wpstg extra checkbox\n this.directoryListingContainer.querySelectorAll('.wpstg-dir > .wpstg-wp-non-core-dir').forEach((element) => {\n element.parentElement.querySelectorAll('input.wpstg-wp-core-dir').forEach((element) => {\n element.checked = false;\n });\n });\n\n this.isDefaultSelected = true;\n }\n\n parseExcludes() {\n this.existingExcludes = this.directoryListingContainer.getAttribute('data-existing-excludes', []);\n if (this.existingExcludes === '') {\n this.existingExcludes = [];\n }\n\n if (this.existingExcludes.length !== 0) {\n this.existingExcludes = this.existingExcludes.split(',');\n }\n }\n\n isExcludeScanned(exclude) {\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input').forEach((element) => {\n if (element.value === exclude) {\n return true;\n }\n });\n\n return false;\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Rich Exclude Filter Module\n */\nexport default class WpstgExcludeFilters {\n constructor(\n excludeFilterContainerSelector = '#wpstg-exclude-filters-container',\n wpstgObject = wpstg,\n ) {\n this.excludeContainer = dom.qs(excludeFilterContainerSelector);\n this.excludeTableBody = dom.qs(`${excludeFilterContainerSelector} tbody`);\n this.wpstgObject = wpstgObject;\n this.init();\n }\n\n addEvents() {\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-file-size-rule', () => {\n this.addFileSizeExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-file-ext-rule', () => {\n this.addFileExtExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-file-name-rule', () => {\n this.addFileNameExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-dir-name-rule', () => {\n this.addDirNameExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-clear-all-rules', () => {\n this.clearExcludes();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-remove-exclude-rule', (target) => {\n this.removeExclude(target);\n });\n }\n\n init() {\n if (this.excludeContainer === null) {\n console.log('Error: Given table selector not found!');\n return;\n }\n\n this.addEvents();\n }\n\n addFileSizeExclude() {\n this.addExcludeRuleRow('#wpstg-file-size-exclude-filter-template');\n }\n\n addFileExtExclude() {\n this.addExcludeRuleRow('#wpstg-file-ext-exclude-filter-template');\n }\n\n addFileNameExclude() {\n this.addExcludeRuleRow('#wpstg-file-name-exclude-filter-template');\n }\n\n addDirNameExclude() {\n this.addExcludeRuleRow('#wpstg-dir-name-exclude-filter-template');\n }\n\n addExcludeRuleRow(templateName) {\n const excludeRowTemplate = dom.qs(templateName);\n if (excludeRowTemplate !== null) {\n const clone = excludeRowTemplate.content.cloneNode(true);\n const excludeRow = clone.querySelector('tr');\n\n this.excludeTableBody.appendChild(excludeRow);\n dom.all('.wpstg-has-exclude-rules').forEach((e) => {\n e.style.display = 'inherit';\n });\n }\n }\n\n clearExcludes() {\n this.excludeTableBody.innerHTML = '';\n dom.all('.wpstg-has-exclude-rules').forEach((e) => {\n e.style.display = 'none';\n });\n }\n\n removeExclude(target) {\n if (target.parentElement !== null && target.parentElement.parentElement !== null) {\n this.excludeTableBody.removeChild(target.parentElement.parentElement);\n }\n\n if (this.excludeTableBody.innerHTML.trim() === '') {\n dom.all('.wpstg-has-exclude-rules').forEach((e) => {\n e.style.display = 'none';\n });\n }\n }\n\n /**\n * Converts all the exclude filters arrays into one single string to keep size of post request small\n * @return {string}\n */\n getExcludeFilters() {\n const globExcludes = [];\n const sizeExcludes = [];\n\n const sizeCompares = this.excludeTableBody.querySelectorAll('select[name=\"wpstgFileSizeExcludeRuleCompare[]\"]');\n const sizeSizes = this.excludeTableBody.querySelectorAll('input[name=\"wpstgFileSizeExcludeRuleSize[]\"]');\n const sizeByte = this.excludeTableBody.querySelectorAll('select[name=\"wpstgFileSizeExcludeRuleByte[]\"]');\n for (const [key, sizeInput] of Object.entries(sizeSizes)) {\n if (sizeInput.value !== '') {\n sizeExcludes.push(sizeCompares[key].value + ' ' + sizeInput.value + sizeByte[key].value);\n }\n }\n\n const extensionInputs = this.excludeTableBody.querySelectorAll('input[name=\"wpstgFileExtExcludeRule[]\"]');\n extensionInputs.forEach((x) => {\n const ext = this.cleanStringForGlob(x.value);\n if (ext !== '') {\n globExcludes.push('ext:' + ext.trim());\n }\n });\n\n const fileNamesPos = this.excludeTableBody.querySelectorAll('select[name=\"wpstgFileNameExcludeRulePos[]\"]');\n const fileNames = this.excludeTableBody.querySelectorAll('input[name=\"wpstgFileNameExcludeRulePath[]\"]');\n for (const [key, fileInput] of Object.entries(fileNames)) {\n const fileName = this.cleanStringForGlob(fileInput.value);\n if (fileName !== '') {\n globExcludes.push('file:' + fileNamesPos[key].value + ' ' + fileName.trim());\n }\n }\n\n const dirNamesPos = this.excludeTableBody.querySelectorAll('select[name=\"wpstgDirNameExcludeRulePos[]\"]');\n const dirNames = this.excludeTableBody.querySelectorAll('input[name=\"wpstgDirNameExcludeRulePath[]\"]');\n for (const [key, dirInput] of Object.entries(dirNames)) {\n const dirName = this.cleanStringForGlob(dirInput.value);\n if (dirName !== '') {\n globExcludes.push('dir:' + dirNamesPos[key].value + ' ' + dirName.trim());\n }\n }\n\n return {\n 'sizes': sizeExcludes.filter(this.onlyUnique).join(','),\n // return set of unique rules\n 'globs': globExcludes.filter(this.onlyUnique).join(','),\n };\n }\n\n onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }\n\n /**\n * Remove most of the comment glob characters from the string\n * @param {String} value\n * @return {String}\n */\n cleanStringForGlob(value) {\n // will replace character like * ^ / \\ ! ? [ from the string\n return value.replace(/[*^//!\\.[?]/g, '');\n }\n}\n","/**\n * Basic WP Staging Modal implemented with help of Sweetalerts\n */\nexport default class WpstgModal {\n constructor(\n confirmAction,\n wpstgObject = wpstg,\n ) {\n this.confirmAction = confirmAction;\n this.wpstgObject = wpstgObject;\n }\n\n show(swalOptions, additionalParams = {}, callback = null) {\n wpstgSwal.fire(swalOptions).then((result) => {\n if (result.value && this.error !== null) {\n this.triggerConfirmAction(additionalParams, callback);\n }\n });\n }\n\n triggerConfirmAction(additionalParams = {}, callback = null) {\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams(Object.assign({\n action: this.confirmAction,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n }, additionalParams)),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((response) => {\n if (callback !== null) {\n callback(response);\n }\n }).catch((error) => {\n console.log(this.wpstgObject.i18n['somethingWentWrong'], error);\n });\n }\n}\n","'use strict';\n\n/**\n * This is a namespaced port of https://github.com/tristen/hoverintent,\n * with slight modification to accept selector with dynamically added element in dom,\n * instead of just already present element.\n *\n * @param {HTMLElement} parent\n * @param {string} selector\n * @param {CallableFunction} onOver\n * @param {CallableFunction} onOut\n *\n * @return {object}\n */\nexport default function(parent, selector, onOver, onOut) {\n let x; let y; let pX; let pY;\n let mouseOver = false;\n let focused = false;\n const h = {};\n let state = 0;\n let timer = 0;\n\n let options = {\n sensitivity: 7,\n interval: 100,\n timeout: 0,\n handleFocus: false,\n };\n\n function delay(el, e) {\n if (timer) {\n timer = clearTimeout(timer);\n }\n\n state = 0;\n return focused ? undefined : onOut(el, e);\n }\n\n function tracker(e) {\n x = e.clientX;\n y = e.clientY;\n }\n\n function compare(el, e) {\n if (timer) timer = clearTimeout(timer);\n if ((Math.abs(pX - x) + Math.abs(pY - y)) < options.sensitivity) {\n state = 1;\n return focused ? undefined : onOver(el, e);\n } else {\n pX = x;\n pY = y;\n timer = setTimeout(function() {\n compare(el, e);\n }, options.interval);\n }\n }\n\n // Public methods\n h.options = function(opt) {\n const focusOptionChanged = opt.handleFocus !== options.handleFocus;\n options = Object.assign({}, options, opt);\n if (focusOptionChanged) {\n options.handleFocus ? addFocus() : removeFocus();\n }\n\n return h;\n };\n\n function dispatchOver(el, e) {\n mouseOver = true;\n if (timer) {\n timer = clearTimeout(timer);\n }\n\n el.removeEventListener('mousemove', tracker, false);\n\n if (state !== 1) {\n pX = e.clientX;\n pY = e.clientY;\n\n el.addEventListener('mousemove', tracker, false);\n\n timer = setTimeout(function() {\n compare(el, e);\n }, options.interval);\n }\n\n return this;\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchOver to support dynamically added elements to dom\n */\n function onMouseOver(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchOver(event.target.closest(selector), event);\n }\n };\n\n function dispatchOut(el, e) {\n mouseOver = false;\n if (timer) {\n timer = clearTimeout(timer);\n }\n\n el.removeEventListener('mousemove', tracker, false);\n\n if (state === 1) {\n timer = setTimeout(function() {\n delay(el, e);\n }, options.timeout);\n }\n\n return this;\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchOut to support dynamically added elements to dom\n */\n function onMouseOut(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchOut(event.target.closest(selector), event);\n }\n };\n\n function dispatchFocus(el, e) {\n if (!mouseOver) {\n focused = true;\n onOver(el, e);\n }\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchFocus to support dynamically added elements to dom\n */\n function onFocus(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchFocus(event.target.closest(selector), event);\n }\n };\n\n function dispatchBlur(el, e) {\n if (!mouseOver && focused) {\n focused = false;\n onOut(el, e);\n }\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchBlur to support dynamically added elements to dom\n */\n function onBlur(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchBlur(event.target.closest(selector), event);\n }\n };\n\n /**\n * Modified to support dynamically added element\n */\n function addFocus() {\n parent.addEventListener('focus', onFocus, false);\n parent.addEventListener('blur', onBlur, false);\n }\n\n /**\n * Modified to support dynamically added element\n */\n function removeFocus() {\n parent.removeEventListener('focus', onFocus, false);\n parent.removeEventListener('blur', onBlur, false);\n }\n\n /**\n * Modified to support dynamically added element\n */\n h.remove = function() {\n if (!parent) {\n return;\n }\n\n parent.removeEventListener('mouseover', onMouseOver, false);\n parent.removeEventListener('mouseout', onMouseOut, false);\n removeFocus();\n };\n\n /**\n * Modified to support dynamically added element\n */\n if (parent) {\n parent.addEventListener('mouseover', onMouseOver, false);\n parent.addEventListener('mouseout', onMouseOut, false);\n }\n\n return h;\n};\n","import wpstgHoverIntent from './modules/wpstg-hover-intent';\n\nexport default (function($) {\n const WPStagingCommon = {\n continueErrorHandle: true,\n cache: {\n elements: [],\n get: function(selector) {\n // It is already cached!\n if ($.inArray(selector, this.elements) !== -1) {\n return this.elements[selector];\n }\n\n // Create cache and return\n this.elements[selector] = $(selector);\n\n return this.elements[selector];\n },\n refresh: function(selector) {\n selector.elements[selector] = $(selector);\n },\n },\n setJobId: function(jobId) {\n localStorage.setItem('jobIdBeingProcessed', jobId);\n },\n getJobId: function() {\n return localStorage.getItem('jobIdBeingProcessed');\n },\n listenTooltip: function() {\n wpstgHoverIntent(document, '.wpstg--tooltip', function(target, event) {\n target.querySelector('.wpstg--tooltiptext').style.visibility = 'visible';\n }, function(target, event) {\n target.querySelector('.wpstg--tooltiptext').style.visibility = 'hidden';\n });\n },\n isEmpty: function(obj) {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n\n return true;\n },\n // Get the custom themed Swal Modal for WP Staging\n // Easy to maintain now in one place now\n getSwalModal: function(isContentCentered = false, customClasses = {}) {\n // common style for all swal modal used in WP Staging\n const defaultCustomClasses = {\n confirmButton: 'wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn wpstg-100-width',\n cancelButton: 'wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn wpstg-100-width',\n actions: 'wpstg--modal--actions',\n popup: isContentCentered ? 'wpstg-swal-popup centered-modal' : 'wpstg-swal-popup',\n };\n\n // If a attribute exists in both default and additional attributes,\n // The class(es) of the additional attribute will overrite the default one.\n const options = {\n customClass: Object.assign(defaultCustomClasses, customClasses),\n buttonsStyling: false,\n reverseButtons: true,\n showClass: {\n popup: 'wpstg--swal2-show wpstg-swal-show',\n },\n };\n\n return wpstgSwal.mixin(options);\n },\n showSuccessModal: function(htmlContent) {\n this.getSwalModal().fire({\n showConfirmButton: false,\n showCancelButton: true,\n cancelButtonText: 'OK',\n icon: 'success',\n title: 'Success!',\n html: '<div class=\"wpstg--grey\" style=\"text-align: left; margin-top: 8px;\">' + htmlContent + '</div>',\n });\n },\n showWarningModal: function(htmlContent) {\n this.getSwalModal().fire({\n showConfirmButton: false,\n showCancelButton: true,\n cancelButtonText: 'OK',\n icon: 'warning',\n title: '',\n html: '<div class=\"wpstg--grey\" style=\"text-align: left; margin-top: 8px;\">' + htmlContent + '</div>',\n });\n },\n showErrorModal: function(htmlContent) {\n this.getSwalModal().fire({\n showConfirmButton: false,\n showCancelButton: true,\n cancelButtonText: 'OK',\n icon: 'error',\n title: 'Error!',\n html: '<div class=\"wpstg--grey\" style=\"text-align: left; margin-top: 8px;\">' + htmlContent + '</div>',\n });\n },\n getSwalContainer: function() {\n return wpstgSwal.getContainer();\n },\n closeSwalModal: function() {\n wpstgSwal.close();\n },\n /**\n * Treats a default response object generated by WordPress's\n * wp_send_json_success() or wp_send_json_error() functions in\n * PHP, parses it in JavaScript, and either throws if it's an error,\n * or returns the data if the response is successful.\n *\n * @param {object} response\n * @return {*}\n */\n getDataFromWordPressResponse(response) {\n if (typeof response !== 'object') {\n throw new Error('Unexpected response (ERR 1341)');\n }\n\n if (!response.hasOwnProperty('success')) {\n throw new Error('Unexpected response (ERR 1342)');\n }\n\n if (!response.hasOwnProperty('data')) {\n throw new Error('Unexpected response (ERR 1343)');\n }\n\n if (response.success === false) {\n if (response.data instanceof Array && response.data.length > 0) {\n throw new Error(response.data.shift());\n } else {\n throw new Error('Response was not successful');\n }\n } else {\n // Successful response. Return the data.\n return response.data;\n }\n },\n isLoading: function(isLoading) {\n if (!isLoading || isLoading === false) {\n WPStagingCommon.cache.get('.wpstg-loader').hide();\n } else {\n WPStagingCommon.cache.get('.wpstg-loader').show();\n }\n },\n /**\n * Convert the given url to make it slug compatible\n * @param {string} url\n */\n slugify: function(url) {\n return url.toString()\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .replace(/\\s+/g, '-')\n .replace(/&/g, '-and-')\n .replace(/[^a-z0-9\\-]/g, '')\n .replace(/-+/g, '-')\n .replace(/^-*/, '')\n .replace(/-*$/, '')\n ;\n },\n showAjaxFatalError: function(response, prependMessage, appendMessage) {\n prependMessage = prependMessage ? prependMessage + '<br/><br/>' : 'Something went wrong! <br/><br/>';\n appendMessage = appendMessage ? appendMessage + '<br/><br/>' : '<br/><br/>Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.';\n\n if (response === false) {\n WPStagingCommon.showError(prependMessage + ' Error: No response.' + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n\n if (typeof response.error !== 'undefined' && response.error) {\n WPStagingCommon.showError(prependMessage + ' Error: ' + response.message + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n },\n handleFetchErrors: function(response) {\n if (!response.ok) {\n WPStagingCommon.showError('Error: ' + response.status + ' - ' + response.statusText + '. Please try again or contact support.');\n }\n return response;\n },\n showError: function(message) {\n WPStagingCommon.cache.get('#wpstg-try-again').css('display', 'inline-block');\n WPStagingCommon.cache.get('#wpstg-cancel-cloning').text('Reset');\n WPStagingCommon.cache.get('#wpstg-resume-cloning').show();\n WPStagingCommon.cache.get('#wpstg-error-wrapper').show();\n WPStagingCommon.cache.get('#wpstg-error-details').show().html(message);\n WPStagingCommon.cache.get('#wpstg-removing-clone').removeClass('loading');\n WPStagingCommon.cache.get('.wpstg-loader').hide();\n $('.wpstg--modal--process--generic-problem').show().html(message);\n },\n resetErrors: function() {\n WPStagingCommon.cache.get('#wpstg-error-details').hide().html('');\n },\n /**\n * Ajax Requests\n * @param {Object} data\n * @param {Function} callback\n * @param {string} dataType\n * @param {bool} showErrors\n * @param {int} tryCount\n * @param {float} incrementRatio\n * @param errorCallback\n */\n ajax: function(data, callback, dataType, showErrors, tryCount, incrementRatio = null, errorCallback = null) {\n if ('undefined' === typeof (dataType)) {\n dataType = 'json';\n }\n\n if (false !== showErrors) {\n showErrors = true;\n }\n\n tryCount = 'undefined' === typeof (tryCount) ? 0 : tryCount;\n\n const retryLimit = 10;\n\n let retryTimeout = 10000 * tryCount;\n\n incrementRatio = parseInt(incrementRatio);\n if (!isNaN(incrementRatio)) {\n retryTimeout *= incrementRatio;\n }\n\n $.ajax({\n url: ajaxurl + '?action=wpstg_processing&_=' + (Date.now() / 1000),\n type: 'POST',\n dataType: dataType,\n cache: false,\n data: data,\n error: function(xhr, textStatus, errorThrown) {\n console.log(xhr.status + ' ' + xhr.statusText + '---' + textStatus);\n\n if (typeof (errorCallback) === 'function') {\n // Custom error handler\n errorCallback(xhr, textStatus, errorThrown);\n\n if (!WPStagingCommon.continueErrorHandle) {\n // Reset state\n WPStagingCommon.continueErrorHandle = true;\n\n return;\n }\n }\n\n // Default error handler\n tryCount++;\n if (tryCount <= retryLimit) {\n setTimeout(function() {\n WPStagingCommon.ajax(data, callback, dataType, showErrors, tryCount, incrementRatio);\n return;\n }, retryTimeout);\n } else {\n const errorCode = 'undefined' === typeof (xhr.status) ? 'Unknown' : xhr.status;\n WPStagingCommon.showError(\n 'Fatal Error: ' + errorCode + ' Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.',\n );\n }\n },\n success: function(data) {\n if ('function' === typeof (callback)) {\n callback(data);\n }\n },\n statusCode: {\n 404: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 404 - Can\\'t find ajax request URL! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 500: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Fatal Error 500 - Internal server error while processing the request! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 504: function() {\n if (tryCount > retryLimit) {\n WPStagingCommon.showError('Error 504 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 502: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 502 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 503: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 503 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 429: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 429 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 403: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Refresh page or login again! The process should be finished successfully. \\n\\ ');\n }\n },\n },\n });\n },\n };\n\n return WPStagingCommon;\n})(jQuery);\n","\nimport * as dom from './wpstg-dom-utils.js';\nimport WpstgDirectoryNavigation from './wpstg-directory-navigation.js';\nimport WpstgExcludeFilters from './wpstg-exclude-filters.js';\nimport WpstgModal from './wpstg-modal.js';\nimport WPStagingCommon from './../wpstg.js';\n\n/**\n * Manage RESET MODAL\n */\nexport default class WpstgResetModal {\n constructor(\n cloneID,\n workflowSelector = '#wpstg-workflow',\n fetchExcludeSettingsAction = 'wpstg_clone_excludes_settings',\n modalErrorAction = 'wpstg_modal_error',\n wpstgObject = wpstg,\n ) {\n this.cloneID = cloneID;\n this.workflow = dom.qs(workflowSelector);\n this.wpstgObject = wpstgObject;\n this.fetchExcludeSettingsAction = fetchExcludeSettingsAction;\n this.modalErrorAction = modalErrorAction;\n this.resetButtonClass = 'wpstg-confirm-reset-clone';\n this.resetModalContainerClass = 'wpstg-reset-confirmation';\n this.resetTabSelector = '.wpstg-reset-exclude-tab';\n this.directoryNavigator = null;\n this.excludeFilters = null;\n this.isAllTablesChecked = true;\n }\n\n addEvents() {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n if (resetModalContainer === null) {\n console.log('Exit');\n return;\n }\n\n dom.addEvent(resetModalContainer, 'click', this.resetTabSelector, (target) => {\n this.toggleContent(target);\n });\n\n dom.addEvent(resetModalContainer, 'click', '.wpstg-button-select', () => {\n this.selectDefaultTables();\n });\n\n dom.addEvent(resetModalContainer, 'click', '.wpstg-button-unselect', () => {\n this.toggleTableSelection();\n });\n\n dom.addEvent(resetModalContainer, 'click', '.wpstg-expand-dirs', (target, event) => {\n event.preventDefault();\n this.toggleDirectoryNavigation(target);\n });\n\n dom.addEvent(resetModalContainer, 'change', 'input.wpstg-check-dir', (target) => {\n this.updateDirectorySelection(target);\n });\n }\n\n init() {\n this.addEvents();\n }\n\n toggleContent(target) {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n const contentId = target.getAttribute('data-id');\n const tabTriangle = target.querySelector('.wpstg-tab-triangle');\n const isCollapsed = target.getAttribute('data-collapsed', 'true');\n const content = dom.qs(contentId);\n if (isCollapsed === 'true') {\n if (resetModalContainer.classList.contains('has-collapsible-open')) {\n resetModalContainer.classList.add('has-collapsible-open-2');\n } else {\n resetModalContainer.classList.add('has-collapsible-open');\n }\n\n dom.slideDown(content);\n tabTriangle.style.transform = 'rotate(90deg)';\n target.setAttribute('data-collapsed', 'false');\n } else {\n if (resetModalContainer.classList.contains('has-collapsible-open-2')) {\n resetModalContainer.classList.remove('has-collapsible-open-2');\n } else {\n resetModalContainer.classList.remove('has-collapsible-open');\n }\n\n dom.slideUp(content);\n tabTriangle.style.removeProperty('transform');\n target.setAttribute('data-collapsed', 'true');\n }\n }\n\n /**\n * Show Swal alert with loader and send ajax request to fetch content of alert.\n * @return Promise\n */\n showModal() {\n const swalPromise = this.loadModal();\n this.init();\n this.fetchCloneExcludes();\n return swalPromise;\n }\n\n loadModal() {\n return WPStagingCommon.getSwalModal(false, {\n confirmButton: this.resetButtonClass + ' wpstg-confirm-reset-clone wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn',\n container: this.resetModalContainerClass + ' wpstg-swal2-container wpstg-swal2-loading',\n }).fire({\n title: '',\n icon: 'warning',\n html: this.getAjaxLoader(),\n width: '400px',\n focusConfirm: false,\n confirmButtonText: this.wpstgObject.i18n.resetClone,\n showCancelButton: true,\n });\n }\n\n fetchCloneExcludes() {\n this.error = null;\n // send ajax request and fetch preserved exclude settings\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams({\n action: this.fetchExcludeSettingsAction,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n clone: this.cloneID,\n job: 'resetting',\n }),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((data) => {\n if (!data.success) {\n const errorModal = new WpstgModal(this.modalErrorAction, this.wpstgObject);\n errorModal.show(Object.assign({\n title: 'Error',\n icon: 'error',\n html: this.wpstgObject.i18n['somethingWentWrong'],\n width: '500px',\n confirmButtonText: 'Ok',\n showCancelButton: false,\n customClass: {\n confirmButton: 'wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn',\n cancelButton: 'wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn',\n actions: 'wpstg--modal--actions',\n popup: 'wpstg-swal-popup centered-modal',\n },\n buttonsStyling: false,\n reverseButtons: true,\n }, data.swalOptions), {\n type: data.type,\n });\n\n return;\n }\n\n const modal = dom.qs('.wpstg-reset-confirmation');\n modal.classList.remove('wpstg-swal2-loading');\n modal.querySelector('.wpstg--swal2-popup').style.width = '500px';\n modal.querySelector('.wpstg--swal2-content').innerHTML = data.html;\n this.directoryNavigator = new WpstgDirectoryNavigation();\n this.excludeFilters = new WpstgExcludeFilters();\n }).catch((error) => {\n this.renderError({\n 'html': this.wpstgObject.i18n['somethingWentWrong'] + ' ' + error,\n });\n });\n }\n\n getDirectoryNavigator() {\n return this.directoryNavigator;\n }\n\n getExcludeFilters() {\n return this.excludeFilters;\n }\n\n getAjaxLoader() {\n return '<div class=\"wpstg-swal2-ajax-loader\"><img src=\"' + this.wpstgObject.wpstgIcon + '\" /></div>';\n }\n\n toggleDirectoryNavigation(element) {\n const cbElement = element.previousSibling;\n if (cbElement.getAttribute('data-navigateable', 'false') === 'false') {\n return;\n }\n\n if (cbElement.getAttribute('data-scanned', 'false') === 'false') {\n return;\n }\n\n const subDirectories = dom.getNextSibling(element, '.wpstg-subdir');\n\n if (subDirectories.style.display === 'none') {\n dom.slideDown(subDirectories);\n } else {\n dom.slideUp(subDirectories);\n }\n }\n\n updateDirectorySelection(element) {\n const parent = element.parentElement;\n if (element.checked) {\n dom.getParents(parent, '.wpstg-dir').forEach((parElem) => {\n for (let i = 0; i < parElem.children.length; i++) {\n if (parElem.children[i].matches('.wpstg-check-dir')) {\n parElem.children[i].checked = true;\n }\n }\n });\n parent.querySelectorAll('.wpstg-expand-dirs').forEach((x) => {\n x.classList.remove('disabled');\n });\n parent.querySelectorAll('.wpstg-subdir .wpstg-check-dir').forEach((x) => {\n x.checked = true;\n });\n } else {\n parent.querySelectorAll('.wpstg-expand-dirs, .wpstg-check-subdirs').forEach((x) => {\n x.classList.add('disabled');\n });\n parent.querySelectorAll('.wpstg-dir .wpstg-check-dir').forEach((x) => {\n x.checked = false;\n });\n }\n }\n\n selectDefaultTables() {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n const options = resetModalContainer.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table');\n const multisitePattern = '^' + this.wpstgObject.tblprefix + '([^0-9])_*';\n const singleSitePattern = '^' + this.wpstgObject.tblprefix;\n options.forEach((option) => {\n const name = option.getAttribute('name', '');\n if (this.wpstgObject.isMultisite === '1' && name.match(multisitePattern)) {\n option.setAttribute('selected', 'selected');\n } else if (this.wpstgObject.isMultisite === '' && name.match(singleSitePattern)) {\n option.setAttribute('selected', 'selected');\n } else {\n option.removeAttribute('selected');\n }\n });\n }\n\n toggleTableSelection() {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n if (false === this.isAllTablesChecked) {\n resetModalContainer.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach((option) => {\n option.setAttribute('selected', 'selected');\n });\n resetModalContainer.querySelector('.wpstg-button-unselect').innerHTML = 'Unselect All';\n // cache.get('.wpstg-db-table-checkboxes').prop('checked', true);\n this.isAllTablesChecked = true;\n } else {\n resetModalContainer.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach((option) => {\n option.removeAttribute('selected');\n });\n resetModalContainer.querySelector('.wpstg-button-unselect').innerHTML = 'Select All';\n // cache.get('.wpstg-db-table-checkboxes').prop('checked', false);\n this.isAllTablesChecked = false;\n }\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Handle toggle of advance settings checkboxes\n */\nexport default class WpstgCloningAdvanceSettings {\n constructor(\n baseContainerSelector = '#wpstg-clonepage-wrapper',\n ) {\n this.baseContainer = dom.qs(baseContainerSelector);\n this.checkBoxSettingTogglerSelector = '.wpstg-toggle-advance-settings-section';\n this.init();\n }\n\n /**\n * Add events\n * @return {void}\n */\n addEvents() {\n if (this.baseContainer === null) {\n return;\n }\n\n dom.addEvent(this.baseContainer, 'change', this.checkBoxSettingTogglerSelector, (element) => {\n this.toggleSettings(element);\n });\n }\n\n /**\n * @return {void}\n */\n init() {\n this.addEvents();\n }\n\n /**\n * Expand/Collapse checkbox content on change\n * @return {void}\n */\n toggleSettings(element) {\n const target = dom.qs('#' + element.getAttribute('data-id'));\n if (element.checked) {\n dom.slideDown(target);\n } else {\n dom.slideUp(target);\n }\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\nexport default class WpstgMainMenu {\n constructor() {\n this.activeTabClass = 'wpstg--tab--active';\n this.mainMenu();\n }\n\n mainMenu() {\n const tabHeader = dom.qs('.wpstg--tab--header');\n // Early bail if tab header is not available\n if (tabHeader === null) {\n return;\n }\n\n dom.addEvent(dom.qs('.wpstg--tab--header'), 'click', '.wpstg-button', (element) => {\n const $this = element;\n const target = $this.getAttribute('data-target');\n const targetElements = dom.all(target);\n const menuItems = dom.all('.wpstg--tab--header a[data-target]');\n const contents = dom.all('.wpstg--tab--contents > .wpstg--tab--content');\n\n contents.forEach((content) => {\n // active tab class is without the css dot class prefix\n if (content.matches('.' + this.activeTabClass + ':not(' + target + ')')) {\n content.classList.remove(this.activeTabClass);\n }\n });\n\n menuItems.forEach((menuItem) => {\n if (menuItem !== $this) {\n menuItem.classList.remove(this.activeTabClass);\n }\n });\n\n $this.classList.add(this.activeTabClass);\n\n targetElements.forEach((targetElement) => {\n targetElement.classList.add(this.activeTabClass);\n });\n\n if ('#wpstg--tab--backup' === target) {\n window.dispatchEvent(new Event('backups-tab'));\n }\n });\n };\n}\n","import WpstgCloneStaging from './modules/wpstg-clone-staging.js';\nimport WpstgDirectoryNavigation from './modules/wpstg-directory-navigation.js';\nimport WpstgExcludeFilters from './modules/wpstg-exclude-filters.js';\nimport WpstgResetModal from './modules/wpstg-reset-modal.js';\nimport WpstgModal from './modules/wpstg-modal.js';\nimport WpstgCloningAdvanceSettings from './modules/wpstg-cloning-advance-settings.js';\nimport WpstgMainMenu from './modules/wpstg-main-menu.js';\nimport WPStagingCommon from './wpstg.js';\n\nvar WPStaging = (function($) {\n const that = {\n isCancelled: false,\n isFinished: false,\n getLogs: false,\n time: 1,\n executionTime: false,\n progressBar: 0,\n cloneExcludeFilters: null,\n directoryNavigator: null,\n notyf: null,\n areAllTablesChecked: true,\n };\n const cache = {elements: []};\n let timeout; let ajaxSpinner;\n\n /**\n * Get / Set Cache for Selector\n * @param {String} selector\n * @return {*}\n */\n cache.get = function(selector) {\n // It is already cached!\n if ($.inArray(selector, cache.elements) !== -1) {\n return cache.elements[selector];\n }\n\n // Create cache and return\n cache.elements[selector] = jQuery(selector);\n\n return cache.elements[selector];\n };\n\n /**\n * Refreshes given cache\n * @param {String} selector\n */\n cache.refresh = function(selector) {\n selector.elements[selector] = jQuery(selector);\n };\n\n /**\n * Show and Log Error Message\n * @param {String} message\n */\n const showError = function(message) {\n cache.get('#wpstg-try-again').css('display', 'inline-block');\n cache.get('#wpstg-cancel-cloning').text('Reset');\n cache.get('#wpstg-resume-cloning').show();\n cache.get('#wpstg-error-wrapper').show();\n cache.get('#wpstg-error-details').show().html(message);\n cache.get('#wpstg-removing-clone').removeClass('loading');\n cache.get('.wpstg-loader').hide();\n $('.wpstg--modal--process--generic-problem').show().html(message);\n\n // Error event information for Staging\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n dataType: 'json',\n data: {\n 'action': 'wpstg_staging_job_error',\n 'accessToken': wpstg.accessToken,\n 'nonce': wpstg.nonce,\n 'error_message': message,\n },\n });\n };\n\n /**\n * Show warning during cloning or push process when closing tab or browser, or changing page\n * @param {beforeunload} event\n * @return {null}\n */\n that.warnIfClosingDuringProcess = function(event) {\n // Only some browsers show the message below, most say something like \"Changes you made may not be saved\" (Chrome) or \"You have unsaved changes. Exit?\"\n event.returnValue = 'You MUST leave this window open while cloning/pushing. Please wait...';\n return null;\n };\n\n /**\n *\n * @param response the error object\n * @param prependMessage Overwrite default error message at beginning\n * @param appendMessage Overwrite default error message at end\n * @returns void\n */\n\n const showAjaxFatalError = function(response, prependMessage, appendMessage) {\n prependMessage = prependMessage ? prependMessage + '<br/><br/>' : 'Something went wrong! <br/><br/>';\n appendMessage = appendMessage ? appendMessage + '<br/><br/>' : '<br/><br/>Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.';\n\n if (response === false) {\n showError(prependMessage + ' Error: No response.' + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n\n if (typeof response.error !== 'undefined' && response.error) {\n console.error(response.message);\n showError(prependMessage + ' Error: ' + response.message + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n };\n\n /**\n *\n * @param response\n * @return {{ok}|*}\n */\n const handleFetchErrors = function(response) {\n if (!response.ok) {\n showError('Error: ' + response.status + ' - ' + response.statusText + '. Please try again or contact support.');\n }\n return response;\n };\n\n /** Hide and reset previous thrown visible errors */\n const resetErrors = function() {\n cache.get('#wpstg-error-details').hide().html('');\n };\n\n /**\n * Common Elements\n */\n const elements = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n let urlSpinner = ajaxurl.replace('/admin-ajax.php', '') + '/images/spinner';\n let timer;\n\n if (2 < window.devicePixelRatio) {\n urlSpinner += '-2x';\n }\n\n urlSpinner += '.gif';\n\n ajaxSpinner = '<img src=\\'\\'' + urlSpinner + '\\' alt=\\'\\' class=\\'ajax-spinner general-spinner\\' />';\n\n const getBaseValues = function() {\n const path = $('#wpstg-use-target-dir').data('base-path');\n const uri = $('#wpstg-use-target-hostname').data('base-uri');\n return {\n path,\n };\n };\n\n $workFlow\n .on('change', '#wpstg_network_clone', function(e) {\n e.preventDefault();\n $('.wpstg-button-select').trigger('click');\n })\n // Check / Un-check All Database Tables New\n .on('click', '.wpstg-button-unselect', function(e) {\n e.preventDefault();\n\n if (false === that.areAllTablesChecked) {\n cache.get('#wpstg_select_tables_cloning .wpstg-db-table').prop('selected', 'selected');\n cache.get('.wpstg-button-unselect').text('Unselect All');\n cache.get('.wpstg-db-table-checkboxes').prop('checked', true);\n that.areAllTablesChecked = true;\n } else {\n cache.get('#wpstg_select_tables_cloning .wpstg-db-table').prop('selected', false);\n cache.get('.wpstg-button-unselect').text('Select All');\n cache.get('.wpstg-db-table-checkboxes').prop('checked', false);\n that.areAllTablesChecked = false;\n }\n })\n\n /**\n * Select tables with certain tbl prefix | NEW\n * @param obj e\n * @returns {undefined}\n */\n .on('click', '.wpstg-button-select', function(e) {\n e.preventDefault();\n $('#wpstg_select_tables_cloning .wpstg-db-table').each(function() {\n let regex = '^' + wpstg.tblprefix;\n if (wpstg.isMultisite === '1' && !$('#wpstg_network_clone').is(':checked')) {\n regex += '([^0-9])_*';\n }\n\n if ($(this).attr('name').match(regex)) {\n $(this).prop('selected', 'selected');\n } else {\n $(this).prop('selected', false);\n }\n });\n })\n // Expand Directories\n .on('click', '.wpstg-expand-dirs', function(e) {\n e.preventDefault();\n\n const $this = $(this);\n\n $this.siblings('.wpstg-subdir').slideToggle();\n })\n // When a directory checkbox is Selected\n .on('change', 'input.wpstg-check-dir', function() {\n const $directory = $(this).parent('.wpstg-dir');\n\n if (this.checked) {\n $directory.parents('.wpstg-dir').children('.wpstg-check-dir').prop('checked', true);\n $directory.find('.wpstg-expand-dirs').removeClass('disabled');\n $directory.find('.wpstg-subdir .wpstg-check-dir').prop('checked', true);\n } else {\n $directory.find('.wpstg-dir .wpstg-check-dir').prop('checked', false);\n $directory.find('.wpstg-expand-dirs, .wpstg-check-subdirs').addClass('disabled');\n $directory.find('.wpstg-check-subdirs').data('action', 'check').text('check');\n }\n })\n // When a directory name is Selected\n .on('change', 'href.wpstg-check-dir', function() {\n const $directory = $(this).parent('.wpstg-dir');\n\n if (this.checked) {\n $directory.parents('.wpstg-dir').children('.wpstg-check-dir').prop('checked', true);\n $directory.find('.wpstg-expand-dirs').removeClass('disabled');\n $directory.find('.wpstg-subdir .wpstg-check-dir').prop('checked', true);\n } else {\n $directory.find('.wpstg-dir .wpstg-check-dir').prop('checked', false);\n $directory.find('.wpstg-expand-dirs, .wpstg-check-subdirs').addClass('disabled');\n $directory.find('.wpstg-check-subdirs').data('action', 'check').text('check');\n }\n })\n // Check the max length of the clone name and if the clone name already exists\n .on('keyup', '#wpstg-new-clone-id', function() {\n // Hide previous errors\n document.getElementById('wpstg-error-details').style.display = 'none';\n\n // This request was already sent, clear it up!\n if ('number' === typeof (timer)) {\n clearInterval(timer);\n }\n\n // Early bail if site name is empty\n if (this.value === undefined || this.value === '') {\n cache.get('#wpstg-new-clone-id').removeClass('wpstg-error-input');\n cache.get('#wpstg-start-cloning').removeAttr('disabled');\n cache.get('#wpstg-clone-id-error').text('').hide();\n return;\n }\n\n // Convert the site name to directory name (slugify the site name to create directory name)\n const cloneDirectoryName = WPStagingCommon.slugify(this.value);\n\n timer = setTimeout(\n function() {\n ajax(\n {\n action: 'wpstg_check_clone',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n directoryName: cloneDirectoryName,\n },\n function(response) {\n if (response.status === 'success') {\n cache.get('#wpstg-new-clone-id').removeClass('wpstg-error-input');\n cache.get('#wpstg-start-cloning').removeAttr('disabled');\n cache.get('#wpstg-clone-id-error').text('').hide();\n } else {\n cache.get('#wpstg-new-clone-id').addClass('wpstg-error-input');\n cache.get('#wpstg-start-cloning').prop('disabled', true);\n cache.get('#wpstg-clone-id-error').text(response.message).show();\n }\n },\n );\n },\n 500,\n );\n })\n // Restart cloning process\n .on('click', '#wpstg-start-cloning', function() {\n resetErrors();\n that.isCancelled = false;\n that.getLogs = false;\n that.progressBar = 0;\n })\n .on('input', '#wpstg-new-clone-id', function() {\n if ($('#wpstg-clone-directory').length < 1) {\n return;\n }\n\n const slug = WPStagingCommon.slugify(this.value).substring(0, 16);\n const $targetDir = $('#wpstg-use-target-dir');\n const $targetUri = $('#wpstg-use-target-hostname');\n let path = $targetDir.data('base-path');\n let uri = $targetUri.data('base-uri');\n\n if (path) {\n path = path.replace(/\\/+$/g, '') + '/' + slug + '/';\n }\n\n if (uri) {\n uri = uri.replace(/\\/+$/g, '') + '/' + slug;\n }\n\n\n $('.wpstg-use-target-dir--value').text(path);\n $('.wpstg-use-target-hostname--value').text(uri);\n\n $targetDir.attr('data-path', path);\n $targetUri.attr('data-uri', uri);\n $('#wpstg_clone_dir').attr('placeholder', path);\n $('#wpstg_clone_hostname').attr('placeholder', uri);\n })\n .on('input', '#wpstg_clone_hostname', function() {\n if ($(this).val() === '' || validateTargetHost()) {\n $('#wpstg_clone_hostname_error').remove();\n return;\n }\n if (!validateTargetHost() && !$('#wpstg_clone_hostname_error').length) {\n $('#wpstg-clone-directory tr:last-of-type').after('<tr><td> </td><td><p id=\"wpstg_clone_hostname_error\" style=\"color: red;\"> Invalid host name. Please provide it in a format like http://example.com</p></td></tr>');\n }\n })\n ;\n\n cloneActions();\n };\n\n /* @returns {boolean} */\n var validateTargetHost = function() {\n const the_domain = $('#wpstg_clone_hostname').val();\n\n if (the_domain === '') {\n return true;\n }\n\n const reg = /^http(s)?:\\/\\/.*$/;\n if (reg.test(the_domain) === false) {\n return false;\n }\n return true;\n };\n\n /**\n * Clone actions\n */\n var cloneActions = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n\n $workFlow\n // Cancel cloning\n .on('click', '#wpstg-cancel-cloning', function() {\n if (!confirm('Are you sure you want to cancel cloning process?')) {\n return false;\n }\n\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n $this.prop('disabled', true);\n\n that.isCancelled = true;\n that.progressBar = 0;\n\n $('#wpstg-processing-status').text('Please wait...this can take up a while.');\n $('.wpstg-loader, #wpstg-show-log-button').hide();\n\n $this.parent().append(ajaxSpinner);\n\n cancelCloning();\n })\n // Resume cloning\n .on('click', '#wpstg-resume-cloning', function() {\n resetErrors();\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n\n that.isCancelled = false;\n\n $('#wpstg-processing-status').text('Try to resume cloning process...');\n $('#wpstg-error-details').hide();\n $('.wpstg-loader').show();\n\n $this.parent().append(ajaxSpinner);\n\n that.startCloning();\n })\n // Cancel update cloning\n .on('click', '#wpstg-cancel-cloning-update', function() {\n resetErrors();\n\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n $this.prop('disabled', true);\n\n that.isCancelled = true;\n\n $('#wpstg-cloning-result').text('Please wait...this can take up a while.');\n $('.wpstg-loader, #wpstg-show-log-button').hide();\n\n $this.parent().append(ajaxSpinner);\n\n cancelCloningUpdate();\n })\n // Restart cloning\n .on('click', '#wpstg-restart-cloning', function() {\n resetErrors();\n\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n $this.prop('disabled', true);\n\n that.isCancelled = true;\n\n $('#wpstg-cloning-result').text('Please wait...this can take up a while.');\n $('.wpstg-loader, #wpstg-show-log-button').hide();\n\n $this.parent().append(ajaxSpinner);\n\n restart();\n })\n // Delete clone - confirmation\n .on('click', '.wpstg-remove-clone[data-clone]', function(e) {\n resetErrors();\n e.preventDefault();\n\n const $existingClones = cache.get('#wpstg-existing-clones');\n\n $workFlow.removeClass('active');\n\n cache.get('.wpstg-loader').show();\n\n ajax(\n {\n action: 'wpstg_confirm_delete_clone',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n clone: $(this).data('clone'),\n },\n function(response) {\n cache.get('#wpstg-removing-clone').html(response);\n\n $existingClones.children('img').remove();\n\n cache.get('.wpstg-loader').hide();\n\n $('html, body').animate({\n // This logic is meant to be a \"scrollBottom\"\n scrollTop: $('#wpstg-remove-clone').offset().top - $(window).height() +\n $('#wpstg-remove-clone').height() + 50,\n }, 100);\n },\n 'HTML',\n );\n })\n // Delete clone - confirmed\n .on('click', '#wpstg-remove-clone', function(e) {\n resetErrors();\n e.preventDefault();\n\n cache.get('#wpstg-removing-clone').addClass('loading');\n\n cache.get('.wpstg-loader').show();\n\n deleteClone($(this).data('clone'));\n })\n // Cancel deleting clone\n .on('click', '#wpstg-cancel-removing', function(e) {\n e.preventDefault();\n $('.wpstg-clone').removeClass('active');\n cache.get('#wpstg-removing-clone').html('');\n })\n // Update\n .on('click', '.wpstg-execute-clone', function(e) {\n e.preventDefault();\n\n const clone = $(this).data('clone');\n\n $workFlow.addClass('loading');\n that.cloneExcludeFilters = null;\n ajax(\n {\n action: 'wpstg_scanning',\n clone: clone,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response.length < 1) {\n showError(\n 'Something went wrong! Error: No response. Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.',\n );\n }\n\n const jsonResponse = tryParseJson(response);\n if (jsonResponse !== false && jsonResponse.success === false) {\n $workFlow.removeClass('loading');\n showErrorModal(jsonResponse);\n\n return;\n }\n\n $workFlow.removeClass('loading').html(response);\n // register check disk space function for clone update process.\n checkDiskSpace();\n that.directoryNavigator = new WpstgDirectoryNavigation('#wpstg-directories-listing', wpstg, that.notyf);\n that.cloneExcludeFilters = new WpstgExcludeFilters();\n that.switchStep(2);\n },\n 'HTML',\n );\n })\n // Reset Clone\n .on('click', '.wpstg-reset-clone', function(e) {\n e.preventDefault();\n const clone = $(this).data('clone');\n const resetModal = new WpstgResetModal(clone);\n const promise = resetModal.showModal();\n that.areAllTablesChecked = true;\n\n promise.then((result) => {\n if (result.value) {\n const dirNavigator = resetModal.getDirectoryNavigator();\n const exclFilters = resetModal.getExcludeFilters().getExcludeFilters();\n resetClone(clone, {\n includedTables: getIncludedTables(),\n excludeSizeRules: encodeURIComponent(exclFilters.sizes),\n excludeGlobRules: encodeURIComponent(exclFilters.globs),\n excludedDirectories: dirNavigator.getExcludedDirectories(),\n extraDirectories: dirNavigator.getExtraDirectoriesRootOnly(),\n });\n }\n });\n\n return;\n });\n };\n\n /**\n * Ajax Requests\n * @param Object data\n * @param Function callback\n * @param string dataType\n * @param bool showErrors\n * @param int tryCount\n * @param float incrementRatio\n */\n var ajax = function(data, callback, dataType, showErrors, tryCount, incrementRatio = null) {\n if ('undefined' === typeof (dataType)) {\n dataType = 'json';\n }\n\n if (false !== showErrors) {\n showErrors = true;\n }\n\n tryCount = 'undefined' === typeof (tryCount) ? 0 : tryCount;\n\n const retryLimit = 5;\n\n let retryTimeout = 10000 * tryCount;\n\n incrementRatio = parseInt(incrementRatio);\n if (!isNaN(incrementRatio)) {\n retryTimeout *= incrementRatio;\n }\n\n $.ajax({\n url: ajaxurl + '?action=wpstg_processing&_=' + (Date.now() / 1000),\n type: 'POST',\n dataType: dataType,\n cache: false,\n data: data,\n error: function(xhr, textStatus, errorThrown) {\n // try again after 10 seconds\n tryCount++;\n if (tryCount <= retryLimit) {\n console.log('RETRYING ' + tryCount + '/' + retryLimit);\n setTimeout(function() {\n ajax(data, callback, dataType, showErrors, tryCount, incrementRatio);\n return;\n }, retryTimeout);\n } else {\n console.log('RETRYING LIMIT');\n const errorCode = 'undefined' === typeof (xhr.status) ? 'Unknown' : xhr.status;\n showError(\n 'Fatal Error: ' + errorCode + ' Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.',\n );\n }\n },\n success: function(data) {\n if ('function' === typeof (callback)) {\n callback(data);\n }\n },\n statusCode: {\n 404: function() {\n if (tryCount >= retryLimit) {\n showError('Error 404 - Can\\'t find ajax request URL! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 500: function() {\n if (tryCount >= retryLimit) {\n showError('Fatal Error 500 - Internal server error while processing the request! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 504: function() {\n if (tryCount > retryLimit) {\n showError('Error 504 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 502: function() {\n if (tryCount >= retryLimit) {\n showError('Error 502 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 503: function() {\n if (tryCount >= retryLimit) {\n showError('Error 503 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 429: function() {\n if (tryCount >= retryLimit) {\n showError('Error 429 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 403: function() {\n if (tryCount >= retryLimit) {\n showError('Refresh page or login again! The process should be finished successfully. \\n\\ ');\n }\n },\n },\n });\n };\n\n /**\n * Next / Previous Step Clicks to Navigate Through Staging Job\n */\n const stepButtons = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n\n $workFlow\n // Next Button\n .on('click', '.wpstg-next-step-link', function(e) {\n e.preventDefault();\n\n const $this = $(this);\n const isScan = false;\n\n if ($('#wpstg_clone_hostname').length && !validateTargetHost()) {\n $('#wpstg_clone_hostname').focus();\n return false;\n }\n\n if ($this.data('action') === 'wpstg_update' || $this.data('action') === 'wpstg_reset') {\n // Update / Reset Clone - confirmed\n let onlyUpdateMessage = '';\n if ($this.data('action') === 'wpstg_update') {\n onlyUpdateMessage = ' \\n\\nExclude all tables and folders you do not want to overwrite, first! \\n\\nDo not cancel the updating process! This can break your staging site. \\n\\n\\Create a backup of your staging website before you proceed.';\n }\n\n if (!confirm('STOP! This will overwrite your staging site with all selected data from the production site! This should be used only if you want to clone again your production site. Are you sure you want to do this?' + onlyUpdateMessage)) {\n return false;\n }\n }\n\n // Button is disabled\n if ($this.attr('disabled')) {\n return false;\n }\n\n if ($this.data('action') === 'wpstg_cloning') {\n // Verify External Database If Checked and Not Skipped\n if ($('#wpstg-ext-db').is(':checked')) {\n verifyExternalDatabase($this, $workFlow);\n return;\n }\n }\n\n proceedCloning($this, $workFlow);\n })\n // Previous Button\n .on('click', '.wpstg-prev-step-link', function(e) {\n e.preventDefault();\n cache.get('.wpstg-loader').removeClass('wpstg-finished');\n cache.get('.wpstg-loader').hide();\n loadOverview();\n });\n };\n\n /**\n * Get Included (Checked) Database Tables\n * @return {Array}\n */\n const getIncludedTables = function() {\n const includedTables = [];\n\n $('#wpstg_select_tables_cloning option:selected').each(function() {\n includedTables.push(this.value);\n });\n\n return includedTables;\n };\n\n /**\n * Get Excluded (Unchecked) Database Tables\n * Not used anymore!\n * @return {Array}\n */\n const getExcludedTables = function() {\n const excludedTables = [];\n\n $('.wpstg-db-table input:not(:checked)').each(function() {\n excludedTables.push(this.name);\n });\n\n return excludedTables;\n };\n\n /**\n * Verify External Database for Cloning\n */\n var verifyExternalDatabase = function($this, workflow) {\n cache.get('.wpstg-loader').show();\n ajax(\n {\n action: 'wpstg_database_verification',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n databaseUser: cache.get('#wpstg_db_username').val(),\n databasePassword: cache.get('#wpstg_db_password').val(),\n databaseServer: cache.get('#wpstg_db_server').val(),\n databaseDatabase: cache.get('#wpstg_db_database').val(),\n },\n function(response) {\n // Undefined Error\n if (false === response) {\n showError(\n 'Something went wrong! Error: No response.' +\n 'Please try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n cache.get('.wpstg-loader').hide();\n return;\n }\n\n // Throw Error\n if ('undefined' === typeof (response.success)) {\n showError(\n 'Something went wrong! Error: Invalid response.' +\n 'Please try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n cache.get('.wpstg-loader').hide();\n return;\n }\n\n if (response.success) {\n cache.get('.wpstg-loader').hide();\n proceedCloning($this, workflow);\n return;\n }\n\n if (response.error_type === 'comparison') {\n cache.get('.wpstg-loader').hide();\n let render = '<table class=\"wpstg-db-comparison-table\"><thead><tr><th>Property</th><th>Production DB</th><th>Staging DB</th><th>Status</th></tr></thead><tbody>';\n response.checks.forEach((x) => {\n let icon = '<span class=\"wpstg-css-tick\"></span>';\n if (x.production !== x.staging) {\n icon = '<span class=\"wpstg-css-cross\"></span>';\n }\n render += '<tr><td>' + x.name + '</td><td>' + x.production + '</td><td>' + x.staging + '</td><td>' + icon + '</td></tr>';\n });\n render += '</tbody></table><p>Note: Some MySQL/MariaDB properties do not match. You may proceed but the staging site may not work as expected.</p>';\n WPStagingCommon.getSwalModal(true, {\n popup: 'wpstg-swal-popup wpstg-db-comparison-modal centered-modal',\n }).fire({\n title: 'Different Database Properties',\n icon: 'warning',\n html: render,\n width: '650px',\n focusConfirm: false,\n confirmButtonText: 'Proceed',\n showCancelButton: true,\n }).then(function(result) {\n if (result.value) {\n proceedCloning($this, workflow);\n }\n });\n return;\n }\n\n WPStagingCommon.getSwalModal(true).fire({\n title: 'Different Database Properties',\n icon: 'error',\n html: response.message,\n focusConfirm: true,\n confirmButtonText: 'Ok',\n showCancelButton: false,\n });\n cache.get('.wpstg-loader').hide();\n },\n 'json',\n false,\n );\n };\n\n /**\n * Get Cloning Step Data\n */\n const getCloningData = function() {\n if ('wpstg_cloning' !== that.data.action && 'wpstg_update' !== that.data.action && 'wpstg_reset' !== that.data.action) {\n return;\n }\n\n that.data.cloneID = new Date().getTime().toString();\n if ('wpstg_update' === that.data.action) {\n that.data.cloneID = $('#wpstg-new-clone-id').data('clone');\n }\n\n that.data.cloneName = $('#wpstg-new-clone-id').val() || that.data.cloneID;\n\n // Remove this to keep &_POST[] small otherwise mod_security will throw error 404\n // that.data.excludedTables = getExcludedTables();\n\n if (that.directoryNavigator !== null) {\n that.data.excludedDirectories = encodeURIComponent(that.directoryNavigator.getExcludedDirectories());\n that.data.extraDirectories = encodeURIComponent(that.directoryNavigator.getExtraDirectoriesRootOnly());\n }\n\n that.data.excludeGlobRules = '';\n that.data.excludeSizeRules = '';\n if (that.cloneExcludeFilters instanceof WpstgExcludeFilters) {\n const rules = that.cloneExcludeFilters.getExcludeFilters();\n that.data.excludeGlobRules = encodeURIComponent(rules.globs);\n that.data.excludeSizeRules = encodeURIComponent(rules.sizes);\n }\n\n that.data.includedTables = getIncludedTables();\n that.data.databaseServer = $('#wpstg_db_server').val();\n that.data.databaseUser = $('#wpstg_db_username').val();\n that.data.databasePassword = $('#wpstg_db_password').val();\n that.data.databaseDatabase = $('#wpstg_db_database').val();\n that.data.databasePrefix = $('#wpstg_db_prefix').val();\n const cloneDir = $('#wpstg_clone_dir').val();\n that.data.cloneDir = encodeURIComponent($.trim(cloneDir));\n that.data.cloneHostname = $('#wpstg_clone_hostname').val();\n that.data.emailsAllowed = $('#wpstg_allow_emails').is(':checked');\n that.data.networkClone = $('#wpstg_network_clone').is(':checked');\n that.data.uploadsSymlinked = $('#wpstg_symlink_upload').is(':checked');\n that.data.cleanPluginsThemes = $('#wpstg-clean-plugins-themes').is(':checked');\n that.data.cleanUploadsDir = $('#wpstg-clean-uploads').is(':checked');\n };\n\n var proceedCloning = function($this, workflow) {\n // Add loading overlay\n workflow.addClass('loading');\n\n // Prepare data\n that.data = {\n action: $this.data('action'),\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n };\n\n // Cloning data\n getCloningData();\n\n sendCloningAjax(workflow);\n };\n\n var sendCloningAjax = function(workflow) {\n // Send ajax request\n ajax(\n that.data,\n function(response) {\n // Undefined Error\n if (false === response) {\n showError(\n 'Something went wrong!<br/><br/> Go to WP Staging > Settings and lower \\'File Copy Limit\\' and \\'DB Query Limit\\'. Also set \\'CPU Load Priority to low \\'' +\n 'and try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n }\n\n\n if (response.length < 1) {\n showError(\n 'Something went wrong! No response. Go to WP Staging > Settings and lower \\'File Copy Limit\\' and \\'DB Query Limit\\'. Also set \\'CPU Load Priority to low \\'' +\n 'and try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n }\n\n const jsonResponse = tryParseJson(response);\n if (jsonResponse !== false && jsonResponse.success === false) {\n workflow.removeClass('loading');\n showErrorModal(jsonResponse);\n\n return;\n }\n\n // Styling of elements\n workflow.removeClass('loading').html(response);\n that.cloneExcludeFilters = null;\n if (that.data.action === 'wpstg_scanning') {\n that.areAllTablesChecked = true;\n that.directoryNavigator = new WpstgDirectoryNavigation('#wpstg-directories-listing', wpstg, that.notyf);\n that.switchStep(2);\n that.cloneExcludeFilters = new WpstgExcludeFilters();\n } else if (that.data.action === 'wpstg_cloning' || that.data.action === 'wpstg_update' || that.data.action === 'wpstg_reset') {\n that.switchStep(3);\n }\n\n // Start cloning\n that.startCloning();\n },\n 'HTML',\n );\n };\n\n var showErrorModal = function(response) {\n const errorModal = new WpstgModal('wpstg_modal_error', wpstg);\n errorModal.show(Object.assign({\n title: 'Error',\n icon: 'error',\n html: wpstg.i18n['somethingWentWrong'],\n width: '500px',\n confirmButtonText: 'Ok',\n showCancelButton: false,\n customClass: {\n confirmButton: 'wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn',\n cancelButton: 'wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn',\n actions: 'wpstg--modal--actions',\n popup: 'wpstg-swal-popup centered-modal',\n },\n buttonsStyling: false,\n reverseButtons: true,\n }, response.swalOptions), {\n type: response.type,\n });\n };\n\n const tryParseJson = function(json) {\n // early bail if not string\n if (!json) {\n return false;\n }\n\n try {\n const object = JSON.parse(json);\n if (object && typeof object === 'object') {\n return object;\n }\n } catch (e) {\n // do nothing on catch\n }\n\n return false;\n };\n\n var resetClone = function(clone, excludeOptions) {\n that.data = {\n action: 'wpstg_reset',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n cloneID: clone,\n };\n\n that.data = {...that.data, ...excludeOptions};\n\n const $workFlow = cache.get('#wpstg-workflow');\n sendCloningAjax($workFlow);\n };\n\n /**\n * Loads Overview (first step) of Staging Job\n */\n var loadOverview = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n\n $workFlow.addClass('loading');\n\n ajax(\n {\n action: 'wpstg_overview',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response.length < 1) {\n showError(\n 'Something went wrong! No response. Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report.',\n );\n }\n\n const $currentStep = cache.get('.wpstg-current-step');\n\n // Styling of elements\n $workFlow.removeClass('loading').html(response);\n },\n 'HTML',\n );\n\n that.switchStep(1);\n cache.get('.wpstg-step3-cloning').show();\n cache.get('.wpstg-step3-pushing').hide();\n };\n\n /**\n * Load Tabs\n */\n const tabs = function() {\n cache.get('#wpstg-workflow').on('click', '.wpstg-tab-header', function(e) {\n e.preventDefault();\n\n const $this = $(this);\n const $section = cache.get($this.data('id'));\n\n $this.toggleClass('expand');\n\n $section.slideToggle();\n\n const tabTriangle = $this.find('.wpstg-tab-triangle');\n\n if ($this.hasClass('expand')) {\n tabTriangle.removeClass('wpstg-no-icon');\n tabTriangle.text('');\n tabTriangle.addClass('wpstg-rotate-90');\n } else {\n tabTriangle.removeClass('wpstg-rotate-90');\n }\n });\n };\n\n /**\n * Delete Clone\n * @param {String} clone\n */\n var deleteClone = function(clone) {\n const deleteDir = $('#deleteDirectory:checked').data('deletepath');\n\n ajax(\n {\n action: 'wpstg_delete_clone',\n clone: clone,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n excludedTables: getExcludedTables(),\n deleteDir: deleteDir,\n },\n function(response) {\n if (response) {\n showAjaxFatalError(response);\n\n // Finished\n if ('undefined' !== typeof response.delete && (response.delete === 'finished' || response.delete === 'unfinished')) {\n cache.get('#wpstg-removing-clone').removeClass('loading').html('');\n\n if (response.delete === 'finished' && response.error === undefined) {\n $('.wpstg-clone[data-clone-id=\"' + clone + '\"]').remove();\n }\n\n // No staging site message is also of type/class .wpstg-class but hidden\n // We have just excluded that from search when counting no of clones\n if ($('#wpstg-existing-clones .wpstg-clone').length < 1) {\n cache.get('#wpstg-existing-clones').find('h3').text('');\n cache.get('#wpstg-no-staging-site-results').show();\n }\n\n cache.get('.wpstg-loader').hide();\n return;\n }\n }\n // continue\n if (true !== response) {\n deleteClone(clone);\n return;\n }\n },\n );\n };\n\n /**\n * Cancel Cloning Process\n */\n var cancelCloning = function() {\n that.timer('stop');\n\n\n if (true === that.isFinished) {\n return true;\n }\n\n ajax(\n {\n action: 'wpstg_cancel_clone',\n clone: that.data.cloneID,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response && 'undefined' !== typeof (response.delete) && response.delete === 'finished') {\n cache.get('.wpstg-loader').hide();\n // Load overview\n loadOverview();\n return;\n }\n\n if (true !== response) {\n // continue\n cancelCloning();\n return;\n }\n\n // Load overview\n loadOverview();\n },\n );\n };\n\n /**\n * Cancel Cloning Process\n */\n var cancelCloningUpdate = function() {\n if (true === that.isFinished) {\n return true;\n }\n\n ajax(\n {\n action: 'wpstg_cancel_update',\n clone: that.data.cloneID,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response && 'undefined' !== typeof (response.delete) && response.delete === 'finished') {\n // Load overview\n loadOverview();\n return;\n }\n\n if (true !== response) {\n // continue\n cancelCloningUpdate();\n return;\n }\n\n // Load overview\n loadOverview();\n },\n );\n };\n\n /**\n * Cancel Cloning Process\n */\n var restart = function() {\n if (true === that.isFinished) {\n return true;\n }\n\n ajax(\n {\n action: 'wpstg_restart',\n // clone: that.data.cloneID,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response && 'undefined' !== typeof (response.delete) && response.delete === 'finished') {\n // Load overview\n loadOverview();\n return;\n }\n\n if (true !== response) {\n // continue\n cancelCloningUpdate();\n return;\n }\n\n // Load overview\n loadOverview();\n },\n );\n };\n\n /**\n * Scroll the window log to bottom\n * @return void\n */\n const logscroll = function() {\n const $div = cache.get('.wpstg-log-details');\n if ('undefined' !== typeof ($div[0])) {\n $div.scrollTop($div[0].scrollHeight);\n }\n };\n\n /**\n * Append the log to the logging window\n * @param string log\n * @return void\n */\n const getLogs = function(log) {\n if (log != null && 'undefined' !== typeof (log)) {\n if (log.constructor === Array) {\n $.each(log, function(index, value) {\n if (value === null) {\n return;\n }\n if (value.type === 'ERROR') {\n cache.get('.wpstg-log-details').append('<span class=\"wpstg--red\">[' + value.type + ']</span>-' + '[' + value.date + '] ' + value.message + '</br>');\n } else {\n cache.get('.wpstg-log-details').append('[' + value.type + ']-' + '[' + value.date + '] ' + value.message + '</br>');\n }\n });\n } else {\n cache.get('.wpstg-log-details').append('[' + log.type + ']-' + '[' + log.date + '] ' + log.message + '</br>');\n }\n }\n logscroll();\n };\n\n /**\n * Check diskspace\n * @return string json\n */\n var checkDiskSpace = function() {\n cache.get('#wpstg-check-space').on('click', function(e) {\n cache.get('.wpstg-loader').show();\n const excludedDirectories = encodeURIComponent(that.directoryNavigator.getExcludedDirectories());\n const extraDirectories = encodeURIComponent(that.directoryNavigator.getExtraDirectoriesRootOnly());\n\n ajax(\n {\n action: 'wpstg_check_disk_space',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n excludedDirectories: excludedDirectories,\n extraDirectories: extraDirectories,\n },\n function(response) {\n if (false === response) {\n cache.get('#wpstg-clone-id-error').text('Can not detect required disk space').show();\n cache.get('.wpstg-loader').hide();\n return;\n }\n\n // Show required disk space\n cache.get('#wpstg-clone-id-error').html(\n 'Estimated necessary disk space: ' + response.requiredSpace +\n (response.errorMessage !== null ? ('<br>' + response.errorMessage) : '') +\n '<br> <span style=\"color:#444;\">Before you proceed ensure your account has enough free disk space to hold the entire instance of the production site. You can check the available space from your hosting account (cPanel or similar).</span>').show();\n cache.get('.wpstg-loader').hide();\n },\n 'json',\n false,\n );\n });\n };\n\n /**\n * Show or hide animated loading icon\n * @param isLoading bool\n */\n const isLoading = function(isLoading) {\n if (!isLoading || isLoading === false) {\n cache.get('.wpstg-loader').hide();\n } else {\n cache.get('.wpstg-loader').show();\n }\n };\n\n /**\n * Count up processing execution time\n * @param string status\n * @return html\n */\n that.timer = function(status) {\n if (status === 'stop') {\n const time = that.time;\n that.time = 1;\n clearInterval(that.executionTime);\n return that.convertSeconds(time);\n }\n\n\n that.executionTime = setInterval(function() {\n if (null !== document.getElementById('wpstg-processing-timer')) {\n document.getElementById('wpstg-processing-timer').innerHTML = 'Elapsed Time: ' + that.convertSeconds(that.time);\n }\n that.time++;\n if (status === 'stop') {\n that.time = 1;\n clearInterval(that.executionTime);\n }\n }, 1000);\n };\n\n /**\n * Convert seconds to hourly format\n * @param int seconds\n * @return string\n */\n that.convertSeconds = function(seconds) {\n const date = new Date(null);\n date.setSeconds(seconds); // specify value for SECONDS here\n return date.toISOString().substr(11, 8);\n };\n\n /**\n * Start Cloning Process\n * @type {Function}\n */\n that.startCloning = (function() {\n resetErrors();\n\n // Register function for checking disk space\n checkDiskSpace();\n\n if ('wpstg_cloning' !== that.data.action && 'wpstg_update' !== that.data.action && 'wpstg_reset' !== that.data.action) {\n return;\n }\n\n that.isCancelled = false;\n\n // Start the process\n start();\n\n // Functions\n // Start\n function start() {\n cache.get('.wpstg-loader').show();\n cache.get('#wpstg-cancel-cloning').text('Cancel');\n cache.get('#wpstg-resume-cloning').hide();\n cache.get('#wpstg-error-details').hide();\n\n\n // Clone Database\n setTimeout(function() {\n // cloneDatabase();\n window.addEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n processing();\n }, wpstg.delayReq);\n\n that.timer('start');\n }\n\n\n /**\n * Start ajax processing\n * @return string\n */\n var processing = function() {\n if (true === that.isCancelled) {\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return false;\n }\n\n isLoading(true);\n\n let excludedDirectories = '';\n let extraDirectories = '';\n if (that.directoryNavigator !== null) {\n excludedDirectories = that.directoryNavigator.getExcludedDirectories();\n extraDirectories = that.directoryNavigator.getExtraDirectoriesRootOnly();\n }\n\n // Show logging window\n cache.get('.wpstg-log-details').show();\n\n WPStaging.ajax(\n {\n action: 'wpstg_processing',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n excludedTables: getExcludedTables(),\n excludedDirectories: encodeURIComponent(excludedDirectories),\n extraDirectories: encodeURIComponent(extraDirectories),\n },\n function(response) {\n showAjaxFatalError(response);\n\n // Add Log messages\n if ('undefined' !== typeof (response.last_msg) && response.last_msg) {\n getLogs(response.last_msg);\n }\n // Continue processing\n if (false === response.status) {\n progressBar(response);\n\n setTimeout(function() {\n cache.get('.wpstg-loader').show();\n processing();\n }, wpstg.delayReq);\n } else if (true === response.status && 'finished' !== response.status) {\n cache.get('#wpstg-error-details').hide();\n cache.get('#wpstg-error-wrapper').hide();\n progressBar(response, true);\n processing();\n } else if ('finished' === response.status || ('undefined' !== typeof (response.job_done) && response.job_done)) {\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n finish(response);\n }\n ;\n },\n 'json',\n false,\n );\n };\n\n // Finish\n function finish(response) {\n if (true === that.getLogs) {\n getLogs();\n }\n\n progressBar(response);\n\n // Add Log\n if ('undefined' !== typeof (response.last_msg)) {\n getLogs(response.last_msg);\n }\n\n cache.get('.wpstg-loader').hide();\n cache.get('#wpstg-processing-header').html('Processing Complete');\n $('#wpstg-processing-status').text('Succesfully finished');\n\n cache.get('#wpstg_staging_name').html(that.data.cloneID);\n cache.get('#wpstg-finished-result').show();\n cache.get('#wpstg-cancel-cloning').hide();\n cache.get('#wpstg-resume-cloning').hide();\n cache.get('#wpstg-cancel-cloning-update').prop('disabled', true);\n\n const $link1 = cache.get('#wpstg-clone-url-1');\n const $link = cache.get('#wpstg-clone-url');\n $link1.attr('href', response.url);\n $link1.html(response.url);\n $link.attr('href', response.url);\n\n cache.get('#wpstg-remove-clone').data('clone', that.data.cloneID);\n\n // Finished\n that.isFinished = true;\n that.timer('stop');\n\n\n cache.get('.wpstg-loader').hide();\n cache.get('#wpstg-processing-header').html('Processing Complete');\n\n // show alert\n let msg = wpstg.i18n.cloneResetComplete;\n if (that.data.action === 'wpstg_update') {\n msg = wpstg.i18n.cloneUpdateComplete;\n }\n\n if (that.data.action === 'wpstg_update' || that.data.action === 'wpstg_reset') {\n cache.get('#wpstg-cancel-cloning-update').hide();\n cache.get('.wpstg-prev-step-link').show();\n\n WPStagingCommon.getSwalModal(true, {\n confirmButton: 'wpstg--btn--confirm wpstg-green-button wpstg-button wpstg-link-btn wpstg-100-width',\n }).fire({\n title: '',\n icon: 'success',\n html: msg,\n width: '500px',\n focusConfirm: true,\n });\n }\n\n return false;\n }\n\n /**\n * Add percentage progress bar\n * @param object response\n * @return {Boolean}\n */\n var progressBar = function(response, restart) {\n if ('undefined' === typeof (response.percentage)) {\n return false;\n }\n\n if (response.job === 'database') {\n cache.get('#wpstg-progress-db').width(response.percentage * 0.2 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 1 of 4 Cloning Database Tables...');\n }\n\n if (response.job === 'SearchReplace') {\n cache.get('#wpstg-progress-db').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-db').html('1. Database');\n // Assumption: All previous steps are done.\n // This avoids bugs where some steps are skipped and the progress bar is incomplete as a result\n cache.get('#wpstg-progress-db').width('20%');\n\n cache.get('#wpstg-progress-sr').width(response.percentage * 0.1 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 2 of 4 Preparing Database Data...');\n }\n\n if (response.job === 'directories') {\n cache.get('#wpstg-progress-sr').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-sr').html('2. Data');\n cache.get('#wpstg-progress-sr').width('10%');\n\n cache.get('#wpstg-progress-dirs').width(response.percentage * 0.1 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 3 of 4 Getting files...');\n }\n if (response.job === 'files') {\n cache.get('#wpstg-progress-dirs').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-dirs').html('3. Files');\n cache.get('#wpstg-progress-dirs').width('10%');\n\n cache.get('#wpstg-progress-files').width(response.percentage * 0.6 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 4 of 4 Copy files...');\n }\n if (response.job === 'finish') {\n cache.get('#wpstg-progress-files').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-files').html('4. Copy Files');\n cache.get('#wpstg-progress-files').width('60%');\n\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Cloning Process Finished');\n }\n };\n });\n\n that.switchStep = function(step) {\n cache.get('.wpstg-current-step')\n .removeClass('wpstg-current-step');\n cache.get('.wpstg-step' + step)\n .addClass('wpstg-current-step');\n };\n\n /**\n * Initiation\n * @type {Function}\n */\n that.init = (function() {\n loadOverview();\n elements();\n stepButtons();\n tabs();\n WPStagingCommon.listenTooltip();\n new WpstgMainMenu();\n new WpstgCloneStaging();\n new WpstgCloningAdvanceSettings();\n that.notyf = new Notyf({\n duration: 10000,\n position: {\n x: 'center',\n y: 'bottom',\n },\n dismissible: true,\n types: [\n {\n type: 'warning',\n background: 'orange',\n icon: false,\n },\n ],\n });\n });\n\n /**\n * Ajax call\n * @type {ajax}\n */\n that.ajax = ajax;\n that.showError = showError;\n that.getLogs = getLogs;\n that.loadOverview = loadOverview;\n\n return that;\n})(jQuery);\n\njQuery(document).ready(function() {\n WPStaging.init();\n // This is necessary to make WPStaging var accessibile in WP Staging PRO js script\n window.WPStaging = WPStaging;\n});\n\n/**\n * Report Issue modal\n */\njQuery(document).ready(function($) {\n $('body').on('click', '#wpstg-report-issue-button', function(e) {\n console.log('REPORT');\n $('.wpstg--tab--active .wpstg-report-issue-form').toggleClass('wpstg-report-show');\n e.preventDefault();\n });\n\n $('body').on('click', '#wpstg-backups-report-issue-button', function(e) {\n $('.wpstg--tab--active .wpstg-report-issue-form').toggleClass('wpstg-report-show');\n e.preventDefault();\n });\n\n $('body').on('click', '#wpstg-report-cancel', function(e) {\n $('.wpstg--tab--active .wpstg-report-issue-form').removeClass('wpstg-report-show');\n e.preventDefault();\n });\n\n $('body').on('click', '.wpstg--tab--active #wpstg-report-submit', function(e) {\n const self = $(this);\n sendIssueReport(self, 'false');\n e.preventDefault();\n });\n\n /*\n * Close Success Modal\n */\n\n $('body').on('click', '#wpstg-success-button', function(e) {\n e.preventDefault();\n $('.wpstg-report-issue-form').removeClass('wpstg-report-show');\n });\n\n function sendIssueReport(button, forceSend = 'false') {\n const spinner = button.next();\n const email = $('.wpstg--tab--active .wpstg-report-email').val();\n const hosting_provider = $('.wpstg--tab--active .wpstg-report-hosting-provider').val();\n const message = $('.wpstg--tab--active .wpstg-report-description').val();\n const syslog = $('.wpstg--tab--active .wpstg-report-syslog').is(':checked');\n const terms = $('.wpstg--tab--active .wpstg-report-terms').is(':checked');\n\n button.attr('disabled', true);\n spinner.css('visibility', 'visible');\n\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n dataType: 'json',\n async: true,\n data: {\n 'action': 'wpstg_send_report',\n 'accessToken': wpstg.accessToken,\n 'nonce': wpstg.nonce,\n 'wpstg_email': email,\n 'wpstg_provider': hosting_provider,\n 'wpstg_message': message,\n 'wpstg_syslog': +syslog,\n 'wpstg_terms': +terms,\n 'wpstg_force_send': forceSend,\n },\n }).done(function(data) {\n button.attr('disabled', false);\n spinner.css('visibility', 'hidden');\n\n if (data.errors.length > 0) {\n $('.wpstg--tab--active .wpstg-report-issue-form .wpstg-message').remove();\n\n let errorMessage = $('<div />').addClass('wpstg-message wpstg-error-message');\n $.each(data.errors, function(key, value) {\n if (value.status === 'already_submitted') {\n errorMessage = '';\n // TODO: remove default custom classes\n WPStagingCommon.getSwalModal(true, {\n container: 'wpstg-issue-resubmit-confirmation',\n }).fire({\n title: '',\n icon: 'warning',\n html: value.message,\n showCancelButton: true,\n focusConfirm: false,\n confirmButtonText: 'Yes',\n cancelButtonText: 'No',\n }).then((result) => {\n if (result.isConfirmed) {\n sendIssueReport(button, 'true');\n }\n });\n } else {\n errorMessage.append('<p>' + value + '</p>');\n }\n });\n\n $('.wpstg--tab--active .wpstg-report-issue-form').prepend(errorMessage);\n } else {\n const successMessage = $('<div />').addClass('wpstg-message wpstg-success-message');\n successMessage.append('<p>Thanks for submitting your request! You should receive an auto reply mail with your ticket ID immediately for confirmation!<br><br>If you do not get that mail please contact us directly at <strong>support@wp-staging.com</strong></p>');\n\n $('.wpstg--tab--active .wpstg-report-issue-form').html(successMessage);\n $('.wpstg--tab--active .wpstg-success-message').append('<div style=\"float:right;margin-top:10px;\"><a id=\"wpstg-success-button\" href=\"#\" class=\"wpstg--red\">[X] CLOSE</a></div>');\n\n // Hide message\n setTimeout(function() {\n $('.wpstg--tab--active .wpstg-report-issue-form').removeClass('wpstg-report-active');\n }, 2000);\n }\n });\n }\n\n // Open/close actions drop down menu\n $(document).on('click', '.wpstg-dropdown>.wpstg-dropdown-toggler', function(e) {\n e.preventDefault();\n $(e.target).next('.wpstg-dropdown-menu').toggleClass('shown');\n\n $(e.target).find('.wpstg-caret').toggleClass('wpstg-caret-up');\n });\n\n $(document).on('click', '.wpstg-caret', function(e) {\n e.preventDefault();\n\n const toggler = $(e.target).closest('.wpstg-dropdown-toggler');\n\n if (toggler) {\n toggler.trigger('click');\n }\n });\n\n // Close action drop down menu if clicked anywhere outside\n document.addEventListener('click', function(event) {\n const isClickInside = event.target.closest('.wpstg-dropdown-toggler');\n if (!isClickInside) {\n const dropDown = document.getElementsByClassName('wpstg-dropdown-menu');\n for (let i = 0; i < dropDown.length; i++) {\n dropDown[i].classList.remove('shown');\n }\n $('.wpstg-caret').removeClass('wpstg-caret-up');\n }\n });\n\n // \"Event info\" for backup errors\n window.addEventListener('finishedProcessWithError', function(customEvent) {\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n dataType: 'json',\n data: {\n 'action': 'wpstg_job_error',\n 'accessToken': wpstg.accessToken,\n 'nonce': wpstg.nonce,\n 'error_message': customEvent.detail.error,\n 'job_id': WPStagingCommon.getJobId(),\n },\n });\n });\n});\n"],"names":["qs","selector","document","querySelector","all","querySelectorAll","addEvent","parent","evt","handler","addEventListener","event","target","matches","closest","slideDown","element","duration","style","display","overflow","height","offsetHeight","transitionProperty","transitionDuration","setTimeout","window","removeProperty","slideUp","getNextSibling","sibling","nextElementSibling","getParents","result","parentElement","push","WpstgCloneStaging","pageWrapperId","wpstgObject","wpstg","pageWrapper","dom","enableButtonId","enableAction","notyf","Notyf","position","x","y","dismissible","types","type","background","icon","init","addEvents","sendRequest","action","fetch","ajaxUrl","method","credentials","body","URLSearchParams","accessToken","nonce","headers","then","response","ok","json","Promise","reject","data","success","location","reload","message","error","i18n","console","warn","WpstgDirectoryNavigation","directoryListingSelector","directoryListingContainer","dirCheckboxSelector","dirExpandSelector","unselectAllDirsSelector","selectDefaultDirsSelector","fetchChildrenAction","currentCheckboxElement","currentParentDiv","currentLoader","existingExcludes","excludedDirectories","isDefaultSelected","log","preventDefault","toggleDirExpand","unselectAll","selectDefault","parseExcludes","previousSibling","getAttribute","dirPath","value","isChecked","checked","forceDefault","setAttribute","dirContainer","createElement","classList","add","innerHTML","JSON","parse","directoryListing","appendChild","alert","getExcludedDirectories","forEach","isParentExcluded","exclude","isExcludeScanned","join","settings","directorySeparator","path","isParentAlreadyExcluded","dir","startsWith","getExtraDirectoriesRootOnly","extraDirectories","extraDirectoriesTextArea","extraCustomDirectories","split","concat","length","WpstgExcludeFilters","excludeFilterContainerSelector","excludeContainer","excludeTableBody","addFileSizeExclude","addFileExtExclude","addFileNameExclude","addDirNameExclude","clearExcludes","removeExclude","addExcludeRuleRow","templateName","excludeRowTemplate","clone","content","cloneNode","excludeRow","e","removeChild","trim","getExcludeFilters","globExcludes","sizeExcludes","sizeCompares","sizeSizes","sizeByte","Object","entries","key","sizeInput","extensionInputs","ext","cleanStringForGlob","fileNamesPos","fileNames","fileInput","fileName","dirNamesPos","dirNames","dirInput","dirName","filter","onlyUnique","index","self","indexOf","replace","WpstgModal","confirmAction","show","swalOptions","additionalParams","callback","wpstgSwal","fire","triggerConfirmAction","assign","onOver","onOut","pX","pY","mouseOver","focused","h","state","timer","options","sensitivity","interval","timeout","handleFocus","delay","el","clearTimeout","undefined","tracker","clientX","clientY","compare","Math","abs","opt","focusOptionChanged","addFocus","removeFocus","dispatchOver","removeEventListener","onMouseOver","dispatchOut","onMouseOut","dispatchFocus","onFocus","dispatchBlur","onBlur","remove","$","WPStagingCommon","continueErrorHandle","cache","elements","get","inArray","refresh","setJobId","jobId","localStorage","setItem","getJobId","getItem","listenTooltip","wpstgHoverIntent","visibility","isEmpty","obj","prop","hasOwnProperty","getSwalModal","isContentCentered","customClasses","defaultCustomClasses","confirmButton","cancelButton","actions","popup","customClass","buttonsStyling","reverseButtons","showClass","mixin","showSuccessModal","htmlContent","showConfirmButton","showCancelButton","cancelButtonText","title","html","showWarningModal","showErrorModal","getSwalContainer","getContainer","closeSwalModal","close","getDataFromWordPressResponse","Error","Array","shift","isLoading","hide","slugify","url","toString","toLowerCase","normalize","showAjaxFatalError","prependMessage","appendMessage","showError","WPStaging","warnIfClosingDuringProcess","handleFetchErrors","status","statusText","css","text","removeClass","resetErrors","ajax","dataType","showErrors","tryCount","incrementRatio","errorCallback","retryLimit","retryTimeout","parseInt","isNaN","ajaxurl","Date","now","xhr","textStatus","errorThrown","errorCode","statusCode","jQuery","WpstgResetModal","cloneID","workflowSelector","fetchExcludeSettingsAction","modalErrorAction","workflow","resetButtonClass","resetModalContainerClass","resetTabSelector","directoryNavigator","excludeFilters","isAllTablesChecked","resetModalContainer","toggleContent","selectDefaultTables","toggleTableSelection","toggleDirectoryNavigation","updateDirectorySelection","contentId","tabTriangle","isCollapsed","contains","transform","showModal","swalPromise","loadModal","fetchCloneExcludes","container","getAjaxLoader","width","focusConfirm","confirmButtonText","resetClone","job","errorModal","modal","renderError","getDirectoryNavigator","wpstgIcon","cbElement","subDirectories","parElem","i","children","multisitePattern","tblprefix","singleSitePattern","option","name","isMultisite","match","removeAttribute","WpstgCloningAdvanceSettings","baseContainerSelector","baseContainer","checkBoxSettingTogglerSelector","toggleSettings","WpstgMainMenu","activeTabClass","mainMenu","tabHeader","$this","targetElements","menuItems","contents","menuItem","targetElement","dispatchEvent","Event","that","isCancelled","isFinished","getLogs","time","executionTime","progressBar","cloneExcludeFilters","areAllTablesChecked","ajaxSpinner","returnValue","$workFlow","urlSpinner","devicePixelRatio","on","trigger","each","regex","is","attr","siblings","slideToggle","$directory","parents","find","addClass","getElementById","clearInterval","removeAttr","cloneDirectoryName","directoryName","slug","substring","$targetDir","$targetUri","uri","val","validateTargetHost","after","cloneActions","the_domain","reg","test","confirm","append","cancelCloning","startCloning","cancelCloningUpdate","restart","$existingClones","animate","scrollTop","offset","top","deleteClone","jsonResponse","tryParseJson","checkDiskSpace","switchStep","resetModal","promise","dirNavigator","exclFilters","includedTables","getIncludedTables","excludeSizeRules","encodeURIComponent","sizes","excludeGlobRules","globs","stepButtons","focus","onlyUpdateMessage","verifyExternalDatabase","proceedCloning","loadOverview","getExcludedTables","excludedTables","databaseUser","databasePassword","databaseServer","databaseDatabase","error_type","render","checks","production","staging","getCloningData","getTime","cloneName","rules","databasePrefix","cloneDir","cloneHostname","emailsAllowed","networkClone","uploadsSymlinked","cleanPluginsThemes","cleanUploadsDir","sendCloningAjax","object","excludeOptions","tabs","$section","toggleClass","hasClass","deleteDir","logscroll","$div","scrollHeight","constructor","date","requiredSpace","errorMessage","convertSeconds","setInterval","seconds","setSeconds","toISOString","substr","start","processing","delayReq","last_msg","job_done","finish","$link1","$link","msg","cloneResetComplete","cloneUpdateComplete","percentage","toFixed","step","ready","sendIssueReport","button","forceSend","spinner","next","email","hosting_provider","syslog","terms","async","done","errors","isConfirmed","prepend","successMessage","toggler","isClickInside","dropDown","getElementsByClassName","customEvent","detail"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACO,SAASA,EAAT,CAAYC,QAAZ,EAAsB;EAC3B,SAAOC,QAAQ,CAACC,aAAT,CAAuBF,QAAvB,CAAP;EACD;E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AAI,EAAE;EACJ,kBAAU,iBADN;EAEJ,uBAAelC,KAAK,CAACyB,WAFjB;EAGJ,iBAASzB,KAAK,CAAC0B,KAHX;EAIJ,yBAAiBke,WAAW,CAACC,MAAZ,CAAmBtd,KAJhC;EAKJ,kBAAU6J,eAAe,CAACW,QAAhB;EALN;EAJD,KAAP;EAYD,GAbD;EAcD,CAxJD;;;;;;"}
|
assets/js/dist/wpstg-admin.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
!function(){"use strict";function e(){return(e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e}).apply(this,arguments)}function t(e){return document.querySelector(e)}function s(e){return document.querySelectorAll(e)}function n(e,t,s,n){e.addEventListener(t,(function(e){e.target.matches(s+", "+s+" *")&&n(e.target.closest(s),e)}),!1)}function r(e,t){void 0===t&&(t=400),e.style.display="block",e.style.overflow="hidden";var s=e.offsetHeight;e.style.height="0px",e.style.transitionProperty="height",e.style.transitionDuration=t+"ms",setTimeout((function(){e.style.height=s+"px",window.setTimeout((function(){e.style.removeProperty("height"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")}),t)}),0)}function o(e,t){void 0===t&&(t=400),e.style.display="block",e.style.overflow="hidden";var s=e.offsetHeight;e.style.height=s+"px",e.style.transitionProperty="height",e.style.transitionDuration=t+"ms",setTimeout((function(){e.style.height="0px",window.setTimeout((function(){e.style.display="none",e.style.removeProperty("height"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")}),t)}),0)}var i=function(){function e(e,s){void 0===e&&(e="#wpstg-clonepage-wrapper"),void 0===s&&(s=wpstg),this.pageWrapper=t(e),this.wpstgObject=s,this.enableButtonId="#wpstg-enable-staging-cloning",this.enableAction="wpstg_enable_staging_cloning",this.notyf=new Notyf({duration:1e4,position:{x:"center",y:"bottom"},dismissible:!0,types:[{type:"warning",background:"orange",icon:!1}]}),this.init()}var s=e.prototype;return s.addEvents=function(){var e=this;null!==this.pageWrapper&&n(this.pageWrapper,"click",this.enableButtonId,(function(){e.sendRequest(e.enableAction)}))},s.init=function(){this.addEvents()},s.sendRequest=function(e){var t=this;fetch(this.wpstgObject.ajaxUrl,{method:"POST",credentials:"same-origin",body:new URLSearchParams({action:e,accessToken:this.wpstgObject.accessToken,nonce:this.wpstgObject.nonce}),headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((function(e){return e.ok?e.json():Promise.reject(e)})).then((function(e){void 0!==e.success&&e.success?location.reload():void 0===e.message?t.notyf.error(t.wpstgObject.i18n.somethingWentWrong):t.notyf.error(e.message)})).catch((function(e){console.warn(t.wpstgObject.i18n.somethingWentWrong,e)}))},e}(),a=function(){function e(e,s,n){void 0===e&&(e="#wpstg-directories-listing"),void 0===s&&(s=wpstg),void 0===n&&(n=null),this.directoryListingContainer=t(e),this.wpstgObject=s,this.dirCheckboxSelector=".wpstg-check-dir",this.dirExpandSelector=".wpstg-expand-dirs",this.unselectAllDirsSelector=".wpstg-unselect-dirs",this.selectDefaultDirsSelector=".wpstg-select-dirs-default",this.fetchChildrenAction="wpstg_fetch_dir_childrens",this.currentCheckboxElement=null,this.currentParentDiv=null,this.currentLoader=null,this.existingExcludes=[],this.excludedDirectories=[],this.isDefaultSelected=!1,this.notyf=n,this.init()}var s=e.prototype;return s.addEvents=function(){var e=this;null!==this.directoryListingContainer?(n(this.directoryListingContainer,"click",this.dirExpandSelector,(function(t,s){s.preventDefault(),e.toggleDirExpand(t)&&e.sendRequest(e.fetchChildrenAction,t)})),n(this.directoryListingContainer,"click",this.unselectAllDirsSelector,(function(){e.unselectAll()})),n(this.directoryListingContainer,"click",this.selectDefaultDirsSelector,(function(){e.selectDefault()}))):console.log("Error: directory navigation add events")},s.init=function(){this.addEvents(),this.parseExcludes()},s.toggleDirExpand=function(e){return this.currentParentDiv=e.parentElement,this.currentCheckboxElement=e.previousSibling,this.currentLoader=this.currentParentDiv.querySelector(".wpstg-is-dir-loading"),"false"!==this.currentCheckboxElement.getAttribute("data-navigateable","false")&&"false"===this.currentCheckboxElement.getAttribute("data-scanned","false")},s.sendRequest=function(e){var t=this;null!==this.currentLoader&&(this.currentLoader.style.display="inline-block"),fetch(this.wpstgObject.ajaxUrl,{method:"POST",credentials:"same-origin",body:new URLSearchParams({action:e,accessToken:this.wpstgObject.accessToken,nonce:this.wpstgObject.nonce,dirPath:this.currentCheckboxElement.value,isChecked:this.currentCheckboxElement.checked,forceDefault:this.isDefaultSelected}),headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((function(e){return e.ok?e.json():Promise.reject(e)})).then((function(e){if(void 0!==e.success&&e.success){t.currentCheckboxElement.setAttribute("data-scanned",!0);var s=document.createElement("div");return s.classList.add("wpstg-dir"),s.classList.add("wpstg-subdir"),s.innerHTML=JSON.parse(e.directoryListing),t.currentParentDiv.appendChild(s),null!==t.currentLoader&&(t.currentLoader.style.display="none"),void r(s)}null!==t.notyf?t.notyf.error(t.wpstgObject.i18n.somethingWentWrong):alert("Error: "+t.wpstgObject.i18n.somethingWentWrong)})).catch((function(e){console.warn(t.wpstgObject.i18n.somethingWentWrong,e)}))},s.getExcludedDirectories=function(){var e=this;return this.excludedDirectories=[],this.directoryListingContainer.querySelectorAll(".wpstg-dir input:not(:checked)").forEach((function(t){e.isParentExcluded(t.value)||e.excludedDirectories.push(t.value)})),this.existingExcludes.forEach((function(t){e.isParentExcluded(t)||e.isExcludeScanned(t)||e.excludedDirectories.push(t)})),this.excludedDirectories.join(this.wpstgObject.settings.directorySeparator)},s.isParentExcluded=function(e){var t=!1;return this.excludedDirectories.forEach((function(s){e.startsWith(s+"/")&&(t=!0)})),t},s.getExtraDirectoriesRootOnly=function(){this.getExcludedDirectories();var e=[];this.directoryListingContainer.querySelectorAll(":not(.wpstg-subdir)>.wpstg-dir>input.wpstg-wp-non-core-dir:checked").forEach((function(t){e.push(t.value)}));var s=t("#wpstg_extraDirectories");if(null===s||""===s.value)return e.join(this.wpstgObject.settings.directorySeparator);var n=s.value.split(/\r?\n/);return e.concat(n).join(this.wpstgObject.settings.directorySeparator)},s.unselectAll=function(){this.directoryListingContainer.querySelectorAll(".wpstg-dir input").forEach((function(e){e.checked=!1}))},s.selectDefault=function(){this.unselectAll(),this.directoryListingContainer.querySelectorAll(".wpstg-dir input.wpstg-wp-core-dir").forEach((function(e){e.checked=!0})),this.directoryListingContainer.querySelectorAll(".wpstg-dir > .wpstg-wp-non-core-dir").forEach((function(e){e.parentElement.querySelectorAll("input.wpstg-wp-core-dir").forEach((function(e){e.checked=!1}))})),this.isDefaultSelected=!0},s.parseExcludes=function(){this.existingExcludes=this.directoryListingContainer.getAttribute("data-existing-excludes",[]),""===this.existingExcludes&&(this.existingExcludes=[]),0!==this.existingExcludes.length&&(this.existingExcludes=this.existingExcludes.split(","))},s.isExcludeScanned=function(e){return this.directoryListingContainer.querySelectorAll(".wpstg-dir input").forEach((function(t){if(t.value===e)return!0})),!1},e}(),c=function(){function e(e,s){void 0===e&&(e="#wpstg-exclude-filters-container"),void 0===s&&(s=wpstg),this.excludeContainer=t(e),this.excludeTableBody=t(e+" tbody"),this.wpstgObject=s,this.init()}var r=e.prototype;return r.addEvents=function(){var e=this;n(this.excludeContainer,"click",".wpstg-file-size-rule",(function(){e.addFileSizeExclude()})),n(this.excludeContainer,"click",".wpstg-file-ext-rule",(function(){e.addFileExtExclude()})),n(this.excludeContainer,"click",".wpstg-file-name-rule",(function(){e.addFileNameExclude()})),n(this.excludeContainer,"click",".wpstg-dir-name-rule",(function(){e.addDirNameExclude()})),n(this.excludeContainer,"click",".wpstg-clear-all-rules",(function(){e.clearExcludes()})),n(this.excludeContainer,"click",".wpstg-remove-exclude-rule",(function(t){e.removeExclude(t)}))},r.init=function(){null!==this.excludeContainer?this.addEvents():console.log("Error: Given table selector not found!")},r.addFileSizeExclude=function(){this.addExcludeRuleRow("#wpstg-file-size-exclude-filter-template")},r.addFileExtExclude=function(){this.addExcludeRuleRow("#wpstg-file-ext-exclude-filter-template")},r.addFileNameExclude=function(){this.addExcludeRuleRow("#wpstg-file-name-exclude-filter-template")},r.addDirNameExclude=function(){this.addExcludeRuleRow("#wpstg-dir-name-exclude-filter-template")},r.addExcludeRuleRow=function(e){var n=t(e);if(null!==n){var r=n.content.cloneNode(!0).querySelector("tr");this.excludeTableBody.appendChild(r),s(".wpstg-has-exclude-rules").forEach((function(e){e.style.display="inherit"}))}},r.clearExcludes=function(){this.excludeTableBody.innerHTML="",s(".wpstg-has-exclude-rules").forEach((function(e){e.style.display="none"}))},r.removeExclude=function(e){null!==e.parentElement&&null!==e.parentElement.parentElement&&this.excludeTableBody.removeChild(e.parentElement.parentElement),""===this.excludeTableBody.innerHTML.trim()&&s(".wpstg-has-exclude-rules").forEach((function(e){e.style.display="none"}))},r.getExcludeFilters=function(){for(var e=this,t=[],s=[],n=this.excludeTableBody.querySelectorAll('select[name="wpstgFileSizeExcludeRuleCompare[]"]'),r=this.excludeTableBody.querySelectorAll('input[name="wpstgFileSizeExcludeRuleSize[]"]'),o=this.excludeTableBody.querySelectorAll('select[name="wpstgFileSizeExcludeRuleByte[]"]'),i=0,a=Object.entries(r);i<a.length;i++){var c=a[i],l=c[0],g=c[1];""!==g.value&&s.push(n[l].value+" "+g.value+o[l].value)}this.excludeTableBody.querySelectorAll('input[name="wpstgFileExtExcludeRule[]"]').forEach((function(s){var n=e.cleanStringForGlob(s.value);""!==n&&t.push("ext:"+n.trim())}));for(var p=this.excludeTableBody.querySelectorAll('select[name="wpstgFileNameExcludeRulePos[]"]'),d=this.excludeTableBody.querySelectorAll('input[name="wpstgFileNameExcludeRulePath[]"]'),u=0,w=Object.entries(d);u<w.length;u++){var h=w[u],f=h[0],m=h[1],v=this.cleanStringForGlob(m.value);""!==v&&t.push("file:"+p[f].value+" "+v.trim())}for(var b=this.excludeTableBody.querySelectorAll('select[name="wpstgDirNameExcludeRulePos[]"]'),y=this.excludeTableBody.querySelectorAll('input[name="wpstgDirNameExcludeRulePath[]"]'),x=0,k=Object.entries(y);x<k.length;x++){var S=k[x],E=S[0],C=S[1],_=this.cleanStringForGlob(C.value);""!==_&&t.push("dir:"+b[E].value+" "+_.trim())}return{sizes:s.filter(this.onlyUnique).join(","),globs:t.filter(this.onlyUnique).join(",")}},r.onlyUnique=function(e,t,s){return s.indexOf(e)===t},r.cleanStringForGlob=function(e){return e.replace(/[*^//!\.[?]/g,"")},e}(),l=function(){function e(e,t){void 0===t&&(t=wpstg),this.confirmAction=e,this.wpstgObject=t}var t=e.prototype;return t.show=function(e,t,s){var n=this;void 0===t&&(t={}),void 0===s&&(s=null),wpstgSwal.fire(e).then((function(e){e.value&&null!==n.error&&n.triggerConfirmAction(t,s)}))},t.triggerConfirmAction=function(e,t){var s=this;void 0===e&&(e={}),void 0===t&&(t=null),fetch(this.wpstgObject.ajaxUrl,{method:"POST",credentials:"same-origin",body:new URLSearchParams(Object.assign({action:this.confirmAction,accessToken:this.wpstgObject.accessToken,nonce:this.wpstgObject.nonce},e)),headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((function(e){return e.ok?e.json():Promise.reject(e)})).then((function(e){null!==t&&t(e)})).catch((function(e){console.log(s.wpstgObject.i18n.somethingWentWrong,e)}))},e}();function g(e,t,s,n){var r,o,i,a,c=!1,l=!1,g={},p=0,d=0,u={sensitivity:7,interval:100,timeout:0,handleFocus:!1};function w(e){r=e.clientX,o=e.clientY}function h(e,t){if(d&&(d=clearTimeout(d)),Math.abs(i-r)+Math.abs(a-o)<u.sensitivity)return p=1,l?void 0:s(e,t);i=r,a=o,d=setTimeout((function(){h(e,t)}),u.interval)}function f(e,t){return c=!0,d&&(d=clearTimeout(d)),e.removeEventListener("mousemove",w,!1),1!==p&&(i=t.clientX,a=t.clientY,e.addEventListener("mousemove",w,!1),d=setTimeout((function(){h(e,t)}),u.interval)),this}function m(e){e.target.matches(t+", "+t+" *")&&f(e.target.closest(t),e)}function v(e,t){return c=!1,d&&(d=clearTimeout(d)),e.removeEventListener("mousemove",w,!1),1===p&&(d=setTimeout((function(){!function(e,t){d&&(d=clearTimeout(d)),p=0,l||n(e,t)}(e,t)}),u.timeout)),this}function b(e){e.target.matches(t+", "+t+" *")&&v(e.target.closest(t),e)}function y(e){var n,r;e.target.matches(t+", "+t+" *")&&(n=e.target.closest(t),r=e,c||(l=!0,s(n,r)))}function x(e){var s,r;e.target.matches(t+", "+t+" *")&&(s=e.target.closest(t),r=e,!c&&l&&(l=!1,n(s,r)))}function k(){e.removeEventListener("focus",y,!1),e.removeEventListener("blur",x,!1)}return g.options=function(t){var s=t.handleFocus!==u.handleFocus;return u=Object.assign({},u,t),s&&(u.handleFocus?(e.addEventListener("focus",y,!1),e.addEventListener("blur",x,!1)):k()),g},g.remove=function(){e&&(e.removeEventListener("mouseover",m,!1),e.removeEventListener("mouseout",b,!1),k())},e&&(e.addEventListener("mouseover",m,!1),e.addEventListener("mouseout",b,!1)),g}var p=function(e){var t={continueErrorHandle:!0,cache:{elements:[],get:function(t){return-1!==e.inArray(t,this.elements)||(this.elements[t]=e(t)),this.elements[t]},refresh:function(t){t.elements[t]=e(t)}},setJobId:function(e){localStorage.setItem("jobIdBeingProcessed",e)},getJobId:function(){return localStorage.getItem("jobIdBeingProcessed")},listenTooltip:function(){g(document,".wpstg--tooltip",(function(e,t){e.querySelector(".wpstg--tooltiptext").style.visibility="visible"}),(function(e,t){e.querySelector(".wpstg--tooltiptext").style.visibility="hidden"}))},isEmpty:function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},getSwalModal:function(e,t){void 0===e&&(e=!1),void 0===t&&(t={});var s={confirmButton:"wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn wpstg-100-width",cancelButton:"wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn wpstg-100-width",actions:"wpstg--modal--actions",popup:e?"wpstg-swal-popup centered-modal":"wpstg-swal-popup"},n={customClass:Object.assign(s,t),buttonsStyling:!1,reverseButtons:!0,showClass:{popup:"wpstg--swal2-show wpstg-swal-show"}};return wpstgSwal.mixin(n)},showSuccessModal:function(e){this.getSwalModal().fire({showConfirmButton:!1,showCancelButton:!0,cancelButtonText:"OK",icon:"success",title:"Success!",html:'<div class="wpstg--grey" style="text-align: left; margin-top: 8px;">'+e+"</div>"})},showWarningModal:function(e){this.getSwalModal().fire({showConfirmButton:!1,showCancelButton:!0,cancelButtonText:"OK",icon:"warning",title:"",html:'<div class="wpstg--grey" style="text-align: left; margin-top: 8px;">'+e+"</div>"})},showErrorModal:function(e){this.getSwalModal().fire({showConfirmButton:!1,showCancelButton:!0,cancelButtonText:"OK",icon:"error",title:"Error!",html:'<div class="wpstg--grey" style="text-align: left; margin-top: 8px;">'+e+"</div>"})},getSwalContainer:function(){return wpstgSwal.getContainer()},closeSwalModal:function(){wpstgSwal.close()},getDataFromWordPressResponse:function(e){if("object"!=typeof e)throw new Error("Unexpected response (ERR 1341)");if(!e.hasOwnProperty("success"))throw new Error("Unexpected response (ERR 1342)");if(!e.hasOwnProperty("data"))throw new Error("Unexpected response (ERR 1343)");if(!1===e.success)throw e.data instanceof Array&&e.data.length>0?new Error(e.data.shift()):new Error("Response was not successful");return e.data},isLoading:function(e){e&&!1!==e?t.cache.get(".wpstg-loader").show():t.cache.get(".wpstg-loader").hide()},slugify:function(e){return e.toString().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g,"-").replace(/&/g,"-and-").replace(/[^a-z0-9\-]/g,"").replace(/-+/g,"-").replace(/^-*/,"").replace(/-*$/,"")},showAjaxFatalError:function(e,s,n){return s=s?s+"<br/><br/>":"Something went wrong! <br/><br/>",n=n?n+"<br/><br/>":"<br/><br/>Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.",!1===e?(t.showError(s+" Error: No response."+n),void window.removeEventListener("beforeunload",WPStaging.warnIfClosingDuringProcess)):void 0!==e.error&&e.error?(t.showError(s+" Error: "+e.message+n),void window.removeEventListener("beforeunload",WPStaging.warnIfClosingDuringProcess)):void 0},handleFetchErrors:function(e){return e.ok||t.showError("Error: "+e.status+" - "+e.statusText+". Please try again or contact support."),e},showError:function(s){t.cache.get("#wpstg-try-again").css("display","inline-block"),t.cache.get("#wpstg-cancel-cloning").text("Reset"),t.cache.get("#wpstg-resume-cloning").show(),t.cache.get("#wpstg-error-wrapper").show(),t.cache.get("#wpstg-error-details").show().html(s),t.cache.get("#wpstg-removing-clone").removeClass("loading"),t.cache.get(".wpstg-loader").hide(),e(".wpstg--modal--process--generic-problem").show().html(s)},resetErrors:function(){t.cache.get("#wpstg-error-details").hide().html("")},ajax:function(s,n,r,o,i,a,c){void 0===a&&(a=null),void 0===c&&(c=null),void 0===r&&(r="json"),!1!==o&&(o=!0);var l=10,g=1e4*(i=void 0===i?0:i);a=parseInt(a),isNaN(a)||(g*=a),e.ajax({url:ajaxurl+"?action=wpstg_processing&_="+Date.now()/1e3,type:"POST",dataType:r,cache:!1,data:s,error:function(e,p,d){if(console.log(e.status+" "+e.statusText+"---"+p),"function"!=typeof c||(c(e,p,d),t.continueErrorHandle))if(++i<=l)setTimeout((function(){t.ajax(s,n,r,o,i,a)}),g);else{var u=void 0===e.status?"Unknown":e.status;t.showError("Fatal Error: "+u+" Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.")}else t.continueErrorHandle=!0},success:function(e){"function"==typeof n&&n(e)},statusCode:{404:function(){i>=l&&t.showError("Error 404 - Can't find ajax request URL! Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.")},500:function(){i>=l&&t.showError("Fatal Error 500 - Internal server error while processing the request! Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.")},504:function(){i>l&&t.showError("Error 504 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},502:function(){i>=l&&t.showError("Error 502 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},503:function(){i>=l&&t.showError("Error 503 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},429:function(){i>=l&&t.showError("Error 429 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},403:function(){i>=l&&t.showError("Refresh page or login again! The process should be finished successfully. \n ")}}})}};return t}(jQuery),d=function(){function e(e,s,n,r,o){void 0===s&&(s="#wpstg-workflow"),void 0===n&&(n="wpstg_clone_excludes_settings"),void 0===r&&(r="wpstg_modal_error"),void 0===o&&(o=wpstg),this.cloneID=e,this.workflow=t(s),this.wpstgObject=o,this.fetchExcludeSettingsAction=n,this.modalErrorAction=r,this.resetButtonClass="wpstg-confirm-reset-clone",this.resetModalContainerClass="wpstg-reset-confirmation",this.resetTabSelector=".wpstg-reset-exclude-tab",this.directoryNavigator=null,this.excludeFilters=null,this.isAllTablesChecked=!0}var s=e.prototype;return s.addEvents=function(){var e=this,s=t("."+this.resetModalContainerClass);null!==s?(n(s,"click",this.resetTabSelector,(function(t){e.toggleContent(t)})),n(s,"click",".wpstg-button-select",(function(){e.selectDefaultTables()})),n(s,"click",".wpstg-button-unselect",(function(){e.toggleTableSelection()})),n(s,"click",".wpstg-expand-dirs",(function(t,s){s.preventDefault(),e.toggleDirectoryNavigation(t)})),n(s,"change","input.wpstg-check-dir",(function(t){e.updateDirectorySelection(t)}))):console.log("Exit")},s.init=function(){this.addEvents()},s.toggleContent=function(e){var s=t("."+this.resetModalContainerClass),n=e.getAttribute("data-id"),i=e.querySelector(".wpstg-tab-triangle"),a=e.getAttribute("data-collapsed","true"),c=t(n);"true"===a?(s.classList.contains("has-collapsible-open")?s.classList.add("has-collapsible-open-2"):s.classList.add("has-collapsible-open"),r(c),i.style.transform="rotate(90deg)",e.setAttribute("data-collapsed","false")):(s.classList.contains("has-collapsible-open-2")?s.classList.remove("has-collapsible-open-2"):s.classList.remove("has-collapsible-open"),o(c),i.style.removeProperty("transform"),e.setAttribute("data-collapsed","true"))},s.showModal=function(){var e=this.loadModal();return this.init(),this.fetchCloneExcludes(),e},s.loadModal=function(){return p.getSwalModal(!1,{confirmButton:this.resetButtonClass+" wpstg-confirm-reset-clone wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn",container:this.resetModalContainerClass+" wpstg-swal2-container wpstg-swal2-loading"}).fire({title:"",icon:"warning",html:this.getAjaxLoader(),width:"400px",focusConfirm:!1,confirmButtonText:this.wpstgObject.i18n.resetClone,showCancelButton:!0})},s.fetchCloneExcludes=function(){var e=this;this.error=null,fetch(this.wpstgObject.ajaxUrl,{method:"POST",credentials:"same-origin",body:new URLSearchParams({action:this.fetchExcludeSettingsAction,accessToken:this.wpstgObject.accessToken,nonce:this.wpstgObject.nonce,clone:this.cloneID,job:"resetting"}),headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((function(e){return e.ok?e.json():Promise.reject(e)})).then((function(s){if(s.success){var n=t(".wpstg-reset-confirmation");n.classList.remove("wpstg-swal2-loading"),n.querySelector(".wpstg--swal2-popup").style.width="500px",n.querySelector(".wpstg--swal2-content").innerHTML=s.html,e.directoryNavigator=new a,e.excludeFilters=new c}else{new l(e.modalErrorAction,e.wpstgObject).show(Object.assign({title:"Error",icon:"error",html:e.wpstgObject.i18n.somethingWentWrong,width:"500px",confirmButtonText:"Ok",showCancelButton:!1,customClass:{confirmButton:"wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn",cancelButton:"wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn",actions:"wpstg--modal--actions",popup:"wpstg-swal-popup centered-modal"},buttonsStyling:!1,reverseButtons:!0},s.swalOptions),{type:s.type})}})).catch((function(t){e.renderError({html:e.wpstgObject.i18n.somethingWentWrong+" "+t})}))},s.getDirectoryNavigator=function(){return this.directoryNavigator},s.getExcludeFilters=function(){return this.excludeFilters},s.getAjaxLoader=function(){return'<div class="wpstg-swal2-ajax-loader"><img src="'+this.wpstgObject.wpstgIcon+'" /></div>'},s.toggleDirectoryNavigation=function(e){var t=e.previousSibling;if("false"!==t.getAttribute("data-navigateable","false")&&"false"!==t.getAttribute("data-scanned","false")){var s=function(e,t){for(var s=e.nextElementSibling;s;){if(s.matches(t))return s;s=s.nextElementSibling}}(e,".wpstg-subdir");"none"===s.style.display?r(s):o(s)}},s.updateDirectorySelection=function(e){var t=e.parentElement;e.checked?(function(e,t){for(var s=[],n=e&&e.parentElement;n;n=n.parentElement)n.matches(t)&&s.push(n);return s}(t,".wpstg-dir").forEach((function(e){for(var t=0;t<e.children.length;t++)e.children[t].matches(".wpstg-check-dir")&&(e.children[t].checked=!0)})),t.querySelectorAll(".wpstg-expand-dirs").forEach((function(e){e.classList.remove("disabled")})),t.querySelectorAll(".wpstg-subdir .wpstg-check-dir").forEach((function(e){e.checked=!0}))):(t.querySelectorAll(".wpstg-expand-dirs, .wpstg-check-subdirs").forEach((function(e){e.classList.add("disabled")})),t.querySelectorAll(".wpstg-dir .wpstg-check-dir").forEach((function(e){e.checked=!1})))},s.selectDefaultTables=function(){var e=this,s=t("."+this.resetModalContainerClass).querySelectorAll("#wpstg_select_tables_cloning .wpstg-db-table"),n="^"+this.wpstgObject.tblprefix+"([^0-9])_*",r="^"+this.wpstgObject.tblprefix;s.forEach((function(t){var s=t.getAttribute("name","");"1"===e.wpstgObject.isMultisite&&s.match(n)||""===e.wpstgObject.isMultisite&&s.match(r)?t.setAttribute("selected","selected"):t.removeAttribute("selected")}))},s.toggleTableSelection=function(){var e=t("."+this.resetModalContainerClass);!1===this.isAllTablesChecked?(e.querySelectorAll("#wpstg_select_tables_cloning .wpstg-db-table").forEach((function(e){e.setAttribute("selected","selected")})),e.querySelector(".wpstg-button-unselect").innerHTML="Unselect All",this.isAllTablesChecked=!0):(e.querySelectorAll("#wpstg_select_tables_cloning .wpstg-db-table").forEach((function(e){e.removeAttribute("selected")})),e.querySelector(".wpstg-button-unselect").innerHTML="Select All",this.isAllTablesChecked=!1)},e}(),u=function(){function e(e){void 0===e&&(e="#wpstg-clonepage-wrapper"),this.baseContainer=t(e),this.checkBoxSettingTogglerSelector=".wpstg-toggle-advance-settings-section",this.init()}var s=e.prototype;return s.addEvents=function(){var e=this;null!==this.baseContainer&&n(this.baseContainer,"change",this.checkBoxSettingTogglerSelector,(function(t){e.toggleSettings(t)}))},s.init=function(){this.addEvents()},s.toggleSettings=function(e){var s=t("#"+e.getAttribute("data-id"));e.checked?r(s):o(s)},e}(),w=function(){function e(){this.activeTabClass="wpstg--tab--active",this.mainMenu()}return e.prototype.mainMenu=function(){var e=this;null!==t(".wpstg--tab--header")&&n(t(".wpstg--tab--header"),"click",".wpstg-button",(function(t){var n=t,r=n.getAttribute("data-target"),o=s(r),i=s(".wpstg--tab--header a[data-target]");s(".wpstg--tab--contents > .wpstg--tab--content").forEach((function(t){t.matches("."+e.activeTabClass+":not("+r+")")&&t.classList.remove(e.activeTabClass)})),i.forEach((function(t){t!==n&&t.classList.remove(e.activeTabClass)})),n.classList.add(e.activeTabClass),o.forEach((function(t){t.classList.add(e.activeTabClass)})),"#wpstg--tab--backup"===r&&window.dispatchEvent(new Event("backups-tab"))}))},e}(),h=function(t){var s,n={isCancelled:!1,isFinished:!1,getLogs:!1,time:1,executionTime:!1,progressBar:0,cloneExcludeFilters:null,directoryNavigator:null,notyf:null,areAllTablesChecked:!0},r={elements:[]};r.get=function(e){return-1!==t.inArray(e,r.elements)||(r.elements[e]=jQuery(e)),r.elements[e]},r.refresh=function(e){e.elements[e]=jQuery(e)};var o=function(e){r.get("#wpstg-try-again").css("display","inline-block"),r.get("#wpstg-cancel-cloning").text("Reset"),r.get("#wpstg-resume-cloning").show(),r.get("#wpstg-error-wrapper").show(),r.get("#wpstg-error-details").show().html(e),r.get("#wpstg-removing-clone").removeClass("loading"),r.get(".wpstg-loader").hide(),t(".wpstg--modal--process--generic-problem").show().html(e),t.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"wpstg_staging_job_error",accessToken:wpstg.accessToken,nonce:wpstg.nonce,error_message:e}})};n.warnIfClosingDuringProcess=function(e){return e.returnValue="You MUST leave this window open while cloning/pushing. Please wait...",null};var g=function(e,t,s){return t=t?t+"<br/><br/>":"Something went wrong! <br/><br/>",s=s?s+"<br/><br/>":"<br/><br/>Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.",!1===e?(o(t+" Error: No response."+s),void window.removeEventListener("beforeunload",h.warnIfClosingDuringProcess)):void 0!==e.error&&e.error?(console.error(e.message),o(t+" Error: "+e.message+s),void window.removeEventListener("beforeunload",h.warnIfClosingDuringProcess)):void 0},f=function(){r.get("#wpstg-error-details").hide().html("")},m=function(){var e=t("#wpstg_clone_hostname").val();if(""===e)return!0;return!1!==/^http(s)?:\/\/.*$/.test(e)},v=function(){var e=r.get("#wpstg-workflow");e.on("click","#wpstg-cancel-cloning",(function(){if(!confirm("Are you sure you want to cancel cloning process?"))return!1;var e=t(this);t("#wpstg-try-again, #wpstg-home-link").hide(),e.prop("disabled",!0),n.isCancelled=!0,n.progressBar=0,t("#wpstg-processing-status").text("Please wait...this can take up a while."),t(".wpstg-loader, #wpstg-show-log-button").hide(),e.parent().append(s),j()})).on("click","#wpstg-resume-cloning",(function(){f();var e=t(this);t("#wpstg-try-again, #wpstg-home-link").hide(),n.isCancelled=!1,t("#wpstg-processing-status").text("Try to resume cloning process..."),t("#wpstg-error-details").hide(),t(".wpstg-loader").show(),e.parent().append(s),n.startCloning()})).on("click","#wpstg-cancel-cloning-update",(function(){f();var e=t(this);t("#wpstg-try-again, #wpstg-home-link").hide(),e.prop("disabled",!0),n.isCancelled=!0,t("#wpstg-cloning-result").text("Please wait...this can take up a while."),t(".wpstg-loader, #wpstg-show-log-button").hide(),e.parent().append(s),L()})).on("click","#wpstg-restart-cloning",(function(){f();var e=t(this);t("#wpstg-try-again, #wpstg-home-link").hide(),e.prop("disabled",!0),n.isCancelled=!0,t("#wpstg-cloning-result").text("Please wait...this can take up a while."),t(".wpstg-loader, #wpstg-show-log-button").hide(),e.parent().append(s),A()})).on("click",".wpstg-remove-clone[data-clone]",(function(s){f(),s.preventDefault();var n=r.get("#wpstg-existing-clones");e.removeClass("active"),r.get(".wpstg-loader").show(),b({action:"wpstg_confirm_delete_clone",accessToken:wpstg.accessToken,nonce:wpstg.nonce,clone:t(this).data("clone")},(function(e){r.get("#wpstg-removing-clone").html(e),n.children("img").remove(),r.get(".wpstg-loader").hide(),t("html, body").animate({scrollTop:t("#wpstg-remove-clone").offset().top-t(window).height()+t("#wpstg-remove-clone").height()+50},100)}),"HTML")})).on("click","#wpstg-remove-clone",(function(e){f(),e.preventDefault(),r.get("#wpstg-removing-clone").addClass("loading"),r.get(".wpstg-loader").show(),D(t(this).data("clone"))})).on("click","#wpstg-cancel-removing",(function(e){e.preventDefault(),t(".wpstg-clone").removeClass("active"),r.get("#wpstg-removing-clone").html("")})).on("click",".wpstg-execute-clone",(function(s){s.preventDefault();var r=t(this).data("clone");e.addClass("loading"),n.cloneExcludeFilters=null,b({action:"wpstg_scanning",clone:r,accessToken:wpstg.accessToken,nonce:wpstg.nonce},(function(t){t.length<1&&o("Something went wrong! Error: No response. Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.");var s=_(t);if(!1!==s&&!1===s.success)return e.removeClass("loading"),void C(s);e.removeClass("loading").html(t),I(),n.directoryNavigator=new a("#wpstg-directories-listing",wpstg,n.notyf),n.cloneExcludeFilters=new c,n.switchStep(2)}),"HTML")})).on("click",".wpstg-reset-clone",(function(e){e.preventDefault();var s=t(this).data("clone"),r=new d(s),o=r.showModal();n.areAllTablesChecked=!0,o.then((function(e){if(e.value){var t=r.getDirectoryNavigator(),n=r.getExcludeFilters().getExcludeFilters();T(s,{includedTables:y(),excludeSizeRules:encodeURIComponent(n.sizes),excludeGlobRules:encodeURIComponent(n.globs),excludedDirectories:t.getExcludedDirectories(),extraDirectories:t.getExtraDirectoriesRootOnly()})}}))}))},b=function e(s,n,r,i,a,c){void 0===c&&(c=null),void 0===r&&(r="json"),!1!==i&&(i=!0);var l=1e4*(a=void 0===a?0:a);c=parseInt(c),isNaN(c)||(l*=c),t.ajax({url:ajaxurl+"?action=wpstg_processing&_="+Date.now()/1e3,type:"POST",dataType:r,cache:!1,data:s,error:function(t,g,p){if(++a<=5)console.log("RETRYING "+a+"/5"),setTimeout((function(){e(s,n,r,i,a,c)}),l);else{console.log("RETRYING LIMIT");var d=void 0===t.status?"Unknown":t.status;o("Fatal Error: "+d+" Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.")}},success:function(e){"function"==typeof n&&n(e)},statusCode:{404:function(){a>=5&&o("Error 404 - Can't find ajax request URL! Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.")},500:function(){a>=5&&o("Fatal Error 500 - Internal server error while processing the request! Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.")},504:function(){a>5&&o("Error 504 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},502:function(){a>=5&&o("Error 502 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},503:function(){a>=5&&o("Error 503 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},429:function(){a>=5&&o("Error 429 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},403:function(){a>=5&&o("Refresh page or login again! The process should be finished successfully. \n ")}}})},y=function(){var e=[];return t("#wpstg_select_tables_cloning option:selected").each((function(){e.push(this.value)})),e},x=function(){var e=[];return t(".wpstg-db-table input:not(:checked)").each((function(){e.push(this.name)})),e},k=function(e,t){r.get(".wpstg-loader").show(),b({action:"wpstg_database_verification",accessToken:wpstg.accessToken,nonce:wpstg.nonce,databaseUser:r.get("#wpstg_db_username").val(),databasePassword:r.get("#wpstg_db_password").val(),databaseServer:r.get("#wpstg_db_server").val(),databaseDatabase:r.get("#wpstg_db_database").val()},(function(s){if(!1===s)return o("Something went wrong! Error: No response.Please try again. If that does not help, <a href='https://wp-staging.com/support/' target='_blank'>open a support ticket</a> "),void r.get(".wpstg-loader").hide();if(void 0===s.success)return o("Something went wrong! Error: Invalid response.Please try again. If that does not help, <a href='https://wp-staging.com/support/' target='_blank'>open a support ticket</a> "),void r.get(".wpstg-loader").hide();if(s.success)return r.get(".wpstg-loader").hide(),void S(e,t);if("comparison"===s.error_type){r.get(".wpstg-loader").hide();var n='<table class="wpstg-db-comparison-table"><thead><tr><th>Property</th><th>Production DB</th><th>Staging DB</th><th>Status</th></tr></thead><tbody>';return s.checks.forEach((function(e){var t='<span class="wpstg-css-tick"></span>';e.production!==e.staging&&(t='<span class="wpstg-css-cross"></span>'),n+="<tr><td>"+e.name+"</td><td>"+e.production+"</td><td>"+e.staging+"</td><td>"+t+"</td></tr>"})),n+="</tbody></table><p>Note: Some MySQL/MariaDB properties do not match. You may proceed but the staging site may not work as expected.</p>",void p.getSwalModal(!0,{popup:"wpstg-swal-popup wpstg-db-comparison-modal centered-modal"}).fire({title:"Different Database Properties",icon:"warning",html:n,width:"650px",focusConfirm:!1,confirmButtonText:"Proceed",showCancelButton:!0}).then((function(s){s.value&&S(e,t)}))}p.getSwalModal(!0).fire({title:"Different Database Properties",icon:"error",html:s.message,focusConfirm:!0,confirmButtonText:"Ok",showCancelButton:!1}),r.get(".wpstg-loader").hide()}),"json",!1)},S=function(e,s){s.addClass("loading"),n.data={action:e.data("action"),accessToken:wpstg.accessToken,nonce:wpstg.nonce},function(){if("wpstg_cloning"===n.data.action||"wpstg_update"===n.data.action||"wpstg_reset"===n.data.action){if(n.data.cloneID=(new Date).getTime().toString(),"wpstg_update"===n.data.action&&(n.data.cloneID=t("#wpstg-new-clone-id").data("clone")),n.data.cloneName=t("#wpstg-new-clone-id").val()||n.data.cloneID,null!==n.directoryNavigator&&(n.data.excludedDirectories=encodeURIComponent(n.directoryNavigator.getExcludedDirectories()),n.data.extraDirectories=encodeURIComponent(n.directoryNavigator.getExtraDirectoriesRootOnly())),n.data.excludeGlobRules="",n.data.excludeSizeRules="",n.cloneExcludeFilters instanceof c){var e=n.cloneExcludeFilters.getExcludeFilters();n.data.excludeGlobRules=encodeURIComponent(e.globs),n.data.excludeSizeRules=encodeURIComponent(e.sizes)}n.data.includedTables=y(),n.data.databaseServer=t("#wpstg_db_server").val(),n.data.databaseUser=t("#wpstg_db_username").val(),n.data.databasePassword=t("#wpstg_db_password").val(),n.data.databaseDatabase=t("#wpstg_db_database").val(),n.data.databasePrefix=t("#wpstg_db_prefix").val();var s=t("#wpstg_clone_dir").val();n.data.cloneDir=encodeURIComponent(t.trim(s)),n.data.cloneHostname=t("#wpstg_clone_hostname").val(),n.data.emailsAllowed=t("#wpstg_allow_emails").is(":checked"),n.data.networkClone=t("#wpstg_network_clone").is(":checked"),n.data.uploadsSymlinked=t("#wpstg_symlink_upload").is(":checked"),n.data.cleanPluginsThemes=t("#wpstg-clean-plugins-themes").is(":checked"),n.data.cleanUploadsDir=t("#wpstg-clean-uploads").is(":checked")}}(),E(s)},E=function(e){b(n.data,(function(t){!1===t&&o("Something went wrong!<br/><br/> Go to WP Staging > Settings and lower 'File Copy Limit' and 'DB Query Limit'. Also set 'CPU Load Priority to low 'and try again. If that does not help, <a href='https://wp-staging.com/support/' target='_blank'>open a support ticket</a> "),t.length<1&&o("Something went wrong! No response. Go to WP Staging > Settings and lower 'File Copy Limit' and 'DB Query Limit'. Also set 'CPU Load Priority to low 'and try again. If that does not help, <a href='https://wp-staging.com/support/' target='_blank'>open a support ticket</a> ");var s=_(t);if(!1!==s&&!1===s.success)return e.removeClass("loading"),void C(s);e.removeClass("loading").html(t),n.cloneExcludeFilters=null,"wpstg_scanning"===n.data.action?(n.areAllTablesChecked=!0,n.directoryNavigator=new a("#wpstg-directories-listing",wpstg,n.notyf),n.switchStep(2),n.cloneExcludeFilters=new c):"wpstg_cloning"!==n.data.action&&"wpstg_update"!==n.data.action&&"wpstg_reset"!==n.data.action||n.switchStep(3),n.startCloning()}),"HTML")},C=function(e){new l("wpstg_modal_error",wpstg).show(Object.assign({title:"Error",icon:"error",html:wpstg.i18n.somethingWentWrong,width:"500px",confirmButtonText:"Ok",showCancelButton:!1,customClass:{confirmButton:"wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn",cancelButton:"wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn",actions:"wpstg--modal--actions",popup:"wpstg-swal-popup centered-modal"},buttonsStyling:!1,reverseButtons:!0},e.swalOptions),{type:e.type})},_=function(e){if(!e)return!1;try{var t=JSON.parse(e);if(t&&"object"==typeof t)return t}catch(e){}return!1},T=function(t,s){n.data={action:"wpstg_reset",accessToken:wpstg.accessToken,nonce:wpstg.nonce,cloneID:t},n.data=e({},n.data,s);var o=r.get("#wpstg-workflow");E(o)},P=function(){var e=r.get("#wpstg-workflow");e.addClass("loading"),b({action:"wpstg_overview",accessToken:wpstg.accessToken,nonce:wpstg.nonce},(function(t){t.length<1&&o("Something went wrong! No response. Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report."),r.get(".wpstg-current-step"),e.removeClass("loading").html(t)}),"HTML"),n.switchStep(1),r.get(".wpstg-step3-cloning").show(),r.get(".wpstg-step3-pushing").hide()},D=function e(s){var n=t("#deleteDirectory:checked").data("deletepath");b({action:"wpstg_delete_clone",clone:s,accessToken:wpstg.accessToken,nonce:wpstg.nonce,excludedTables:x(),deleteDir:n},(function(n){if(n&&(g(n),void 0!==n.delete&&("finished"===n.delete||"unfinished"===n.delete)))return r.get("#wpstg-removing-clone").removeClass("loading").html(""),"finished"===n.delete&&void 0===n.error&&t('.wpstg-clone[data-clone-id="'+s+'"]').remove(),t("#wpstg-existing-clones .wpstg-clone").length<1&&(r.get("#wpstg-existing-clones").find("h3").text(""),r.get("#wpstg-no-staging-site-results").show()),void r.get(".wpstg-loader").hide();!0===n||e(s)}))},j=function e(){if(n.timer("stop"),!0===n.isFinished)return!0;b({action:"wpstg_cancel_clone",clone:n.data.cloneID,accessToken:wpstg.accessToken,nonce:wpstg.nonce},(function(t){if(t&&void 0!==t.delete&&"finished"===t.delete)return r.get(".wpstg-loader").hide(),void P();!0===t?P():e()}))},L=function e(){if(!0===n.isFinished)return!0;b({action:"wpstg_cancel_update",clone:n.data.cloneID,accessToken:wpstg.accessToken,nonce:wpstg.nonce},(function(t){t&&void 0!==t.delete&&"finished"===t.delete||!0===t?P():e()}))},A=function(){if(!0===n.isFinished)return!0;b({action:"wpstg_restart",accessToken:wpstg.accessToken,nonce:wpstg.nonce},(function(e){e&&void 0!==e.delete&&"finished"===e.delete||!0===e?P():L()}))},O=function(e){var s;null!=e&&void 0!==e&&(e.constructor===Array?t.each(e,(function(e,t){null!==t&&("ERROR"===t.type?r.get(".wpstg-log-details").append('<span class="wpstg--red">['+t.type+"]</span>-["+t.date+"] "+t.message+"</br>"):r.get(".wpstg-log-details").append("["+t.type+"]-["+t.date+"] "+t.message+"</br>"))})):r.get(".wpstg-log-details").append("["+e.type+"]-["+e.date+"] "+e.message+"</br>")),void 0!==(s=r.get(".wpstg-log-details"))[0]&&s.scrollTop(s[0].scrollHeight)},I=function(){r.get("#wpstg-check-space").on("click",(function(e){r.get(".wpstg-loader").show();var t=encodeURIComponent(n.directoryNavigator.getExcludedDirectories()),s=encodeURIComponent(n.directoryNavigator.getExtraDirectoriesRootOnly());b({action:"wpstg_check_disk_space",accessToken:wpstg.accessToken,nonce:wpstg.nonce,excludedDirectories:t,extraDirectories:s},(function(e){if(!1===e)return r.get("#wpstg-clone-id-error").text("Can not detect required disk space").show(),void r.get(".wpstg-loader").hide();r.get("#wpstg-clone-id-error").html("Estimated necessary disk space: "+e.requiredSpace+(null!==e.errorMessage?"<br>"+e.errorMessage:"")+'<br> <span style="color:#444;">Before you proceed ensure your account has enough free disk space to hold the entire instance of the production site. You can check the available space from your hosting account (cPanel or similar).</span>').show(),r.get(".wpstg-loader").hide()}),"json",!1)}))};return n.timer=function(e){if("stop"===e){var t=n.time;return n.time=1,clearInterval(n.executionTime),n.convertSeconds(t)}n.executionTime=setInterval((function(){null!==document.getElementById("wpstg-processing-timer")&&(document.getElementById("wpstg-processing-timer").innerHTML="Elapsed Time: "+n.convertSeconds(n.time)),n.time++,"stop"===e&&(n.time=1,clearInterval(n.executionTime))}),1e3)},n.convertSeconds=function(e){var t=new Date(null);return t.setSeconds(e),t.toISOString().substr(11,8)},n.startCloning=function(){if(f(),I(),"wpstg_cloning"===n.data.action||"wpstg_update"===n.data.action||"wpstg_reset"===n.data.action){n.isCancelled=!1,r.get(".wpstg-loader").show(),r.get("#wpstg-cancel-cloning").text("Cancel"),r.get("#wpstg-resume-cloning").hide(),r.get("#wpstg-error-details").hide(),setTimeout((function(){window.addEventListener("beforeunload",h.warnIfClosingDuringProcess),e()}),wpstg.delayReq),n.timer("start");var e=function e(){if(!0===n.isCancelled)return window.removeEventListener("beforeunload",h.warnIfClosingDuringProcess),!1;var o;(o=!0)&&!1!==o?r.get(".wpstg-loader").show():r.get(".wpstg-loader").hide();var i="",a="";null!==n.directoryNavigator&&(i=n.directoryNavigator.getExcludedDirectories(),a=n.directoryNavigator.getExtraDirectoriesRootOnly()),r.get(".wpstg-log-details").show(),h.ajax({action:"wpstg_processing",accessToken:wpstg.accessToken,nonce:wpstg.nonce,excludedTables:x(),excludedDirectories:encodeURIComponent(i),extraDirectories:encodeURIComponent(a)},(function(o){g(o),void 0!==o.last_msg&&o.last_msg&&O(o.last_msg),!1===o.status?(s(o),setTimeout((function(){r.get(".wpstg-loader").show(),e()}),wpstg.delayReq)):!0===o.status&&"finished"!==o.status?(r.get("#wpstg-error-details").hide(),r.get("#wpstg-error-wrapper").hide(),s(o),e()):("finished"===o.status||void 0!==o.job_done&&o.job_done)&&(window.removeEventListener("beforeunload",h.warnIfClosingDuringProcess),function(e){!0===n.getLogs&&O();s(e),void 0!==e.last_msg&&O(e.last_msg);r.get(".wpstg-loader").hide(),r.get("#wpstg-processing-header").html("Processing Complete"),t("#wpstg-processing-status").text("Succesfully finished"),r.get("#wpstg_staging_name").html(n.data.cloneID),r.get("#wpstg-finished-result").show(),r.get("#wpstg-cancel-cloning").hide(),r.get("#wpstg-resume-cloning").hide(),r.get("#wpstg-cancel-cloning-update").prop("disabled",!0);var o=r.get("#wpstg-clone-url-1"),i=r.get("#wpstg-clone-url");o.attr("href",e.url),o.html(e.url),i.attr("href",e.url),r.get("#wpstg-remove-clone").data("clone",n.data.cloneID),n.isFinished=!0,n.timer("stop"),r.get(".wpstg-loader").hide(),r.get("#wpstg-processing-header").html("Processing Complete");var a=wpstg.i18n.cloneResetComplete;"wpstg_update"===n.data.action&&(a=wpstg.i18n.cloneUpdateComplete);"wpstg_update"!==n.data.action&&"wpstg_reset"!==n.data.action||(r.get("#wpstg-cancel-cloning-update").hide(),r.get(".wpstg-prev-step-link").show(),p.getSwalModal(!0,{confirmButton:"wpstg--btn--confirm wpstg-green-button wpstg-button wpstg-link-btn wpstg-100-width"}).fire({title:"",icon:"success",html:a,width:"500px",focusConfirm:!0}))}(o))}),"json",!1)},s=function(e,t){if(void 0===e.percentage)return!1;"database"===e.job&&(r.get("#wpstg-progress-db").width(.2*e.percentage+"%").html(e.percentage+"%"),r.get("#wpstg-processing-status").html(e.percentage.toFixed(0)+"% - Step 1 of 4 Cloning Database Tables...")),"SearchReplace"===e.job&&(r.get("#wpstg-progress-db").css("background-color","#3bc36b"),r.get("#wpstg-progress-db").html("1. Database"),r.get("#wpstg-progress-db").width("20%"),r.get("#wpstg-progress-sr").width(.1*e.percentage+"%").html(e.percentage+"%"),r.get("#wpstg-processing-status").html(e.percentage.toFixed(0)+"% - Step 2 of 4 Preparing Database Data...")),"directories"===e.job&&(r.get("#wpstg-progress-sr").css("background-color","#3bc36b"),r.get("#wpstg-progress-sr").html("2. Data"),r.get("#wpstg-progress-sr").width("10%"),r.get("#wpstg-progress-dirs").width(.1*e.percentage+"%").html(e.percentage+"%"),r.get("#wpstg-processing-status").html(e.percentage.toFixed(0)+"% - Step 3 of 4 Getting files...")),"files"===e.job&&(r.get("#wpstg-progress-dirs").css("background-color","#3bc36b"),r.get("#wpstg-progress-dirs").html("3. Files"),r.get("#wpstg-progress-dirs").width("10%"),r.get("#wpstg-progress-files").width(.6*e.percentage+"%").html(e.percentage+"%"),r.get("#wpstg-processing-status").html(e.percentage.toFixed(0)+"% - Step 4 of 4 Copy files...")),"finish"===e.job&&(r.get("#wpstg-progress-files").css("background-color","#3bc36b"),r.get("#wpstg-progress-files").html("4. Copy Files"),r.get("#wpstg-progress-files").width("60%"),r.get("#wpstg-processing-status").html(e.percentage.toFixed(0)+"% - Cloning Process Finished"))}}},n.switchStep=function(e){r.get(".wpstg-current-step").removeClass("wpstg-current-step"),r.get(".wpstg-step"+e).addClass("wpstg-current-step")},n.init=function(){var e,o,a;P(),o=r.get("#wpstg-workflow"),a=ajaxurl.replace("/admin-ajax.php","")+"/images/spinner",2<window.devicePixelRatio&&(a+="-2x"),s="<img src=''"+(a+=".gif")+"' alt='' class='ajax-spinner general-spinner' />",o.on("change","#wpstg_network_clone",(function(e){e.preventDefault(),t(".wpstg-button-select").trigger("click")})).on("click",".wpstg-button-unselect",(function(e){e.preventDefault(),!1===n.areAllTablesChecked?(r.get("#wpstg_select_tables_cloning .wpstg-db-table").prop("selected","selected"),r.get(".wpstg-button-unselect").text("Unselect All"),r.get(".wpstg-db-table-checkboxes").prop("checked",!0),n.areAllTablesChecked=!0):(r.get("#wpstg_select_tables_cloning .wpstg-db-table").prop("selected",!1),r.get(".wpstg-button-unselect").text("Select All"),r.get(".wpstg-db-table-checkboxes").prop("checked",!1),n.areAllTablesChecked=!1)})).on("click",".wpstg-button-select",(function(e){e.preventDefault(),t("#wpstg_select_tables_cloning .wpstg-db-table").each((function(){var e="^"+wpstg.tblprefix;"1"!==wpstg.isMultisite||t("#wpstg_network_clone").is(":checked")||(e+="([^0-9])_*"),t(this).attr("name").match(e)?t(this).prop("selected","selected"):t(this).prop("selected",!1)}))})).on("click",".wpstg-expand-dirs",(function(e){e.preventDefault(),t(this).siblings(".wpstg-subdir").slideToggle()})).on("change","input.wpstg-check-dir",(function(){var e=t(this).parent(".wpstg-dir");this.checked?(e.parents(".wpstg-dir").children(".wpstg-check-dir").prop("checked",!0),e.find(".wpstg-expand-dirs").removeClass("disabled"),e.find(".wpstg-subdir .wpstg-check-dir").prop("checked",!0)):(e.find(".wpstg-dir .wpstg-check-dir").prop("checked",!1),e.find(".wpstg-expand-dirs, .wpstg-check-subdirs").addClass("disabled"),e.find(".wpstg-check-subdirs").data("action","check").text("check"))})).on("change","href.wpstg-check-dir",(function(){var e=t(this).parent(".wpstg-dir");this.checked?(e.parents(".wpstg-dir").children(".wpstg-check-dir").prop("checked",!0),e.find(".wpstg-expand-dirs").removeClass("disabled"),e.find(".wpstg-subdir .wpstg-check-dir").prop("checked",!0)):(e.find(".wpstg-dir .wpstg-check-dir").prop("checked",!1),e.find(".wpstg-expand-dirs, .wpstg-check-subdirs").addClass("disabled"),e.find(".wpstg-check-subdirs").data("action","check").text("check"))})).on("keyup","#wpstg-new-clone-id",(function(){if(document.getElementById("wpstg-error-details").style.display="none","number"==typeof e&&clearInterval(e),void 0===this.value||""===this.value)return r.get("#wpstg-new-clone-id").removeClass("wpstg-error-input"),r.get("#wpstg-start-cloning").removeAttr("disabled"),void r.get("#wpstg-clone-id-error").text("").hide();var t=p.slugify(this.value);e=setTimeout((function(){b({action:"wpstg_check_clone",accessToken:wpstg.accessToken,nonce:wpstg.nonce,directoryName:t},(function(e){"success"===e.status?(r.get("#wpstg-new-clone-id").removeClass("wpstg-error-input"),r.get("#wpstg-start-cloning").removeAttr("disabled"),r.get("#wpstg-clone-id-error").text("").hide()):(r.get("#wpstg-new-clone-id").addClass("wpstg-error-input"),r.get("#wpstg-start-cloning").prop("disabled",!0),r.get("#wpstg-clone-id-error").text(e.message).show())}))}),500)})).on("click","#wpstg-start-cloning",(function(){f(),n.isCancelled=!1,n.getLogs=!1,n.progressBar=0})).on("input","#wpstg-new-clone-id",(function(){if(!(t("#wpstg-clone-directory").length<1)){var e=p.slugify(this.value),s=t("#wpstg-use-target-dir"),n=t("#wpstg-use-target-hostname"),r=s.data("base-path"),o=n.data("base-uri");r&&(r=r.replace(/\/+$/g,"")+"/"+e+"/"),o&&(o=o.replace(/\/+$/g,"")+"/"+e),t(".wpstg-use-target-dir--value").text(r),t(".wpstg-use-target-hostname--value").text(o),s.attr("data-path",r),n.attr("data-uri",o),t("#wpstg_clone_dir").attr("placeholder",r),t("#wpstg_clone_hostname").attr("placeholder",o)}})).on("input","#wpstg_clone_hostname",(function(){""===t(this).val()||m()?t("#wpstg_clone_hostname_error").remove():m()||t("#wpstg_clone_hostname_error").length||t("#wpstg-clone-directory tr:last-of-type").after('<tr><td> </td><td><p id="wpstg_clone_hostname_error" style="color: red;"> Invalid host name. Please provide it in a format like http://example.com</p></td></tr>')})),v(),function(){var e=r.get("#wpstg-workflow");e.on("click",".wpstg-next-step-link",(function(s){s.preventDefault();var n=t(this);if(t("#wpstg_clone_hostname").length&&!m())return t("#wpstg_clone_hostname").focus(),!1;if("wpstg_update"===n.data("action")||"wpstg_reset"===n.data("action")){var r="";if("wpstg_update"===n.data("action")&&(r=" \n\nExclude all tables and folders you do not want to overwrite, first! \n\nDo not cancel the updating process! This can break your staging site. \n\nCreate a backup of your staging website before you proceed."),!confirm("STOP! This will overwrite your staging site with all selected data from the production site! This should be used only if you want to clone again your production site. Are you sure you want to do this?"+r))return!1}if(n.attr("disabled"))return!1;"wpstg_cloning"===n.data("action")&&t("#wpstg-ext-db").is(":checked")?k(n,e):S(n,e)})).on("click",".wpstg-prev-step-link",(function(e){e.preventDefault(),r.get(".wpstg-loader").removeClass("wpstg-finished"),r.get(".wpstg-loader").hide(),P()}))}(),r.get("#wpstg-workflow").on("click",".wpstg-tab-header",(function(e){e.preventDefault();var s=t(this),n=r.get(s.data("id"));s.toggleClass("expand"),n.slideToggle();var o=s.find(".wpstg-tab-triangle");s.hasClass("expand")?(o.removeClass("wpstg-no-icon"),o.text(""),o.addClass("wpstg-rotate-90")):o.removeClass("wpstg-rotate-90")})),p.listenTooltip(),new w,new i,new u,n.notyf=new Notyf({duration:1e4,position:{x:"center",y:"bottom"},dismissible:!0,types:[{type:"warning",background:"orange",icon:!1}]})},n.ajax=b,n.showError=o,n.getLogs=O,n.loadOverview=P,n}(jQuery);jQuery(document).ready((function(){h.init(),window.WPStaging=h})),jQuery(document).ready((function(e){function t(s,n){void 0===n&&(n="false");var r=s.next(),o=e(".wpstg--tab--active .wpstg-report-email").val(),i=e(".wpstg--tab--active .wpstg-report-hosting-provider").val(),a=e(".wpstg--tab--active .wpstg-report-description").val(),c=e(".wpstg--tab--active .wpstg-report-syslog").is(":checked"),l=e(".wpstg--tab--active .wpstg-report-terms").is(":checked");s.attr("disabled",!0),r.css("visibility","visible"),e.ajax({url:ajaxurl,type:"POST",dataType:"json",async:!0,data:{action:"wpstg_send_report",accessToken:wpstg.accessToken,nonce:wpstg.nonce,wpstg_email:o,wpstg_provider:i,wpstg_message:a,wpstg_syslog:+c,wpstg_terms:+l,wpstg_force_send:n}}).done((function(n){if(s.attr("disabled",!1),r.css("visibility","hidden"),n.errors.length>0){e(".wpstg--tab--active .wpstg-report-issue-form .wpstg-message").remove();var o=e("<div />").addClass("wpstg-message wpstg-error-message");e.each(n.errors,(function(e,n){"already_submitted"===n.status?(o="",p.getSwalModal(!0,{container:"wpstg-issue-resubmit-confirmation"}).fire({title:"",icon:"warning",html:n.message,showCancelButton:!0,focusConfirm:!1,confirmButtonText:"Yes",cancelButtonText:"No"}).then((function(e){e.isConfirmed&&t(s,"true")}))):o.append("<p>"+n+"</p>")})),e(".wpstg--tab--active .wpstg-report-issue-form").prepend(o)}else{var i=e("<div />").addClass("wpstg-message wpstg-success-message");i.append("<p>Thanks for submitting your request! You should receive an auto reply mail with your ticket ID immediately for confirmation!<br><br>If you do not get that mail please contact us directly at <strong>support@wp-staging.com</strong></p>"),e(".wpstg--tab--active .wpstg-report-issue-form").html(i),e(".wpstg--tab--active .wpstg-success-message").append('<div style="float:right;margin-top:10px;"><a id="wpstg-success-button" href="#" class="wpstg--red">[X] CLOSE</a></div>'),setTimeout((function(){e(".wpstg--tab--active .wpstg-report-issue-form").removeClass("wpstg-report-active")}),2e3)}}))}e("body").on("click","#wpstg-report-issue-button",(function(t){console.log("REPORT"),e(".wpstg--tab--active .wpstg-report-issue-form").toggleClass("wpstg-report-show"),t.preventDefault()})),e("body").on("click","#wpstg-backups-report-issue-button",(function(t){e(".wpstg--tab--active .wpstg-report-issue-form").toggleClass("wpstg-report-show"),t.preventDefault()})),e("body").on("click","#wpstg-report-cancel",(function(t){e(".wpstg--tab--active .wpstg-report-issue-form").removeClass("wpstg-report-show"),t.preventDefault()})),e("body").on("click",".wpstg--tab--active #wpstg-report-submit",(function(s){t(e(this),"false"),s.preventDefault()})),e("body").on("click","#wpstg-success-button",(function(t){t.preventDefault(),e(".wpstg-report-issue-form").removeClass("wpstg-report-show")})),e(document).on("click",".wpstg-dropdown>.wpstg-dropdown-toggler",(function(t){t.preventDefault(),e(t.target).next(".wpstg-dropdown-menu").toggleClass("shown"),e(t.target).find(".wpstg-caret").toggleClass("wpstg-caret-up")})),e(document).on("click",".wpstg-caret",(function(t){t.preventDefault();var s=e(t.target).closest(".wpstg-dropdown-toggler");s&&s.trigger("click")})),document.addEventListener("click",(function(t){if(!t.target.closest(".wpstg-dropdown-toggler")){for(var s=document.getElementsByClassName("wpstg-dropdown-menu"),n=0;n<s.length;n++)s[n].classList.remove("shown");e(".wpstg-caret").removeClass("wpstg-caret-up")}})),window.addEventListener("finishedProcessWithError",(function(t){e.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"wpstg_job_error",accessToken:wpstg.accessToken,nonce:wpstg.nonce,error_message:t.detail.error,job_id:p.getJobId()}})}))}))}();
|
2 |
//# sourceMappingURL=wpstg-admin.min.js.map
|
1 |
+
!function(){"use strict";function e(){return(e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e}).apply(this,arguments)}function t(e){return document.querySelector(e)}function s(e){return document.querySelectorAll(e)}function n(e,t,s,n){e.addEventListener(t,(function(e){e.target.matches(s+", "+s+" *")&&n(e.target.closest(s),e)}),!1)}function r(e,t){void 0===t&&(t=400),e.style.display="block",e.style.overflow="hidden";var s=e.offsetHeight;e.style.height="0px",e.style.transitionProperty="height",e.style.transitionDuration=t+"ms",setTimeout((function(){e.style.height=s+"px",window.setTimeout((function(){e.style.removeProperty("height"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")}),t)}),0)}function o(e,t){void 0===t&&(t=400),e.style.display="block",e.style.overflow="hidden";var s=e.offsetHeight;e.style.height=s+"px",e.style.transitionProperty="height",e.style.transitionDuration=t+"ms",setTimeout((function(){e.style.height="0px",window.setTimeout((function(){e.style.display="none",e.style.removeProperty("height"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")}),t)}),0)}var i=function(){function e(e,s){void 0===e&&(e="#wpstg-clonepage-wrapper"),void 0===s&&(s=wpstg),this.pageWrapper=t(e),this.wpstgObject=s,this.enableButtonId="#wpstg-enable-staging-cloning",this.enableAction="wpstg_enable_staging_cloning",this.notyf=new Notyf({duration:1e4,position:{x:"center",y:"bottom"},dismissible:!0,types:[{type:"warning",background:"orange",icon:!1}]}),this.init()}var s=e.prototype;return s.addEvents=function(){var e=this;null!==this.pageWrapper&&n(this.pageWrapper,"click",this.enableButtonId,(function(){e.sendRequest(e.enableAction)}))},s.init=function(){this.addEvents()},s.sendRequest=function(e){var t=this;fetch(this.wpstgObject.ajaxUrl,{method:"POST",credentials:"same-origin",body:new URLSearchParams({action:e,accessToken:this.wpstgObject.accessToken,nonce:this.wpstgObject.nonce}),headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((function(e){return e.ok?e.json():Promise.reject(e)})).then((function(e){void 0!==e.success&&e.success?location.reload():void 0===e.message?t.notyf.error(t.wpstgObject.i18n.somethingWentWrong):t.notyf.error(e.message)})).catch((function(e){console.warn(t.wpstgObject.i18n.somethingWentWrong,e)}))},e}(),a=function(){function e(e,s,n){void 0===e&&(e="#wpstg-directories-listing"),void 0===s&&(s=wpstg),void 0===n&&(n=null),this.directoryListingContainer=t(e),this.wpstgObject=s,this.dirCheckboxSelector=".wpstg-check-dir",this.dirExpandSelector=".wpstg-expand-dirs",this.unselectAllDirsSelector=".wpstg-unselect-dirs",this.selectDefaultDirsSelector=".wpstg-select-dirs-default",this.fetchChildrenAction="wpstg_fetch_dir_childrens",this.currentCheckboxElement=null,this.currentParentDiv=null,this.currentLoader=null,this.existingExcludes=[],this.excludedDirectories=[],this.isDefaultSelected=!1,this.notyf=n,this.init()}var s=e.prototype;return s.addEvents=function(){var e=this;null!==this.directoryListingContainer?(n(this.directoryListingContainer,"click",this.dirExpandSelector,(function(t,s){s.preventDefault(),e.toggleDirExpand(t)&&e.sendRequest(e.fetchChildrenAction,t)})),n(this.directoryListingContainer,"click",this.unselectAllDirsSelector,(function(){e.unselectAll()})),n(this.directoryListingContainer,"click",this.selectDefaultDirsSelector,(function(){e.selectDefault()}))):console.log("Error: directory navigation add events")},s.init=function(){this.addEvents(),this.parseExcludes()},s.toggleDirExpand=function(e){return this.currentParentDiv=e.parentElement,this.currentCheckboxElement=e.previousSibling,this.currentLoader=this.currentParentDiv.querySelector(".wpstg-is-dir-loading"),"false"!==this.currentCheckboxElement.getAttribute("data-navigateable","false")&&"false"===this.currentCheckboxElement.getAttribute("data-scanned","false")},s.sendRequest=function(e){var t=this;null!==this.currentLoader&&(this.currentLoader.style.display="inline-block"),fetch(this.wpstgObject.ajaxUrl,{method:"POST",credentials:"same-origin",body:new URLSearchParams({action:e,accessToken:this.wpstgObject.accessToken,nonce:this.wpstgObject.nonce,dirPath:this.currentCheckboxElement.value,isChecked:this.currentCheckboxElement.checked,forceDefault:this.isDefaultSelected}),headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((function(e){return e.ok?e.json():Promise.reject(e)})).then((function(e){if(void 0!==e.success&&e.success){t.currentCheckboxElement.setAttribute("data-scanned",!0);var s=document.createElement("div");return s.classList.add("wpstg-dir"),s.classList.add("wpstg-subdir"),s.innerHTML=JSON.parse(e.directoryListing),t.currentParentDiv.appendChild(s),null!==t.currentLoader&&(t.currentLoader.style.display="none"),void r(s)}null!==t.notyf?t.notyf.error(t.wpstgObject.i18n.somethingWentWrong):alert("Error: "+t.wpstgObject.i18n.somethingWentWrong)})).catch((function(e){console.warn(t.wpstgObject.i18n.somethingWentWrong,e)}))},s.getExcludedDirectories=function(){var e=this;return this.excludedDirectories=[],this.directoryListingContainer.querySelectorAll(".wpstg-dir input:not(:checked)").forEach((function(t){e.isParentExcluded(t.value)||e.excludedDirectories.push(t.value)})),this.existingExcludes.forEach((function(t){e.isParentExcluded(t)||e.isExcludeScanned(t)||e.excludedDirectories.push(t)})),this.excludedDirectories.join(this.wpstgObject.settings.directorySeparator)},s.isParentExcluded=function(e){var t=!1;return this.excludedDirectories.forEach((function(s){e.startsWith(s+"/")&&(t=!0)})),t},s.getExtraDirectoriesRootOnly=function(){this.getExcludedDirectories();var e=[];this.directoryListingContainer.querySelectorAll(":not(.wpstg-subdir)>.wpstg-dir>input.wpstg-wp-non-core-dir:checked").forEach((function(t){e.push(t.value)}));var s=t("#wpstg_extraDirectories");if(null===s||""===s.value)return e.join(this.wpstgObject.settings.directorySeparator);var n=s.value.split(/\r?\n/);return e.concat(n).join(this.wpstgObject.settings.directorySeparator)},s.unselectAll=function(){this.directoryListingContainer.querySelectorAll(".wpstg-dir input").forEach((function(e){e.checked=!1}))},s.selectDefault=function(){this.unselectAll(),this.directoryListingContainer.querySelectorAll(".wpstg-dir input.wpstg-wp-core-dir").forEach((function(e){e.checked=!0})),this.directoryListingContainer.querySelectorAll(".wpstg-dir > .wpstg-wp-non-core-dir").forEach((function(e){e.parentElement.querySelectorAll("input.wpstg-wp-core-dir").forEach((function(e){e.checked=!1}))})),this.isDefaultSelected=!0},s.parseExcludes=function(){this.existingExcludes=this.directoryListingContainer.getAttribute("data-existing-excludes",[]),""===this.existingExcludes&&(this.existingExcludes=[]),0!==this.existingExcludes.length&&(this.existingExcludes=this.existingExcludes.split(","))},s.isExcludeScanned=function(e){return this.directoryListingContainer.querySelectorAll(".wpstg-dir input").forEach((function(t){if(t.value===e)return!0})),!1},e}(),c=function(){function e(e,s){void 0===e&&(e="#wpstg-exclude-filters-container"),void 0===s&&(s=wpstg),this.excludeContainer=t(e),this.excludeTableBody=t(e+" tbody"),this.wpstgObject=s,this.init()}var r=e.prototype;return r.addEvents=function(){var e=this;n(this.excludeContainer,"click",".wpstg-file-size-rule",(function(){e.addFileSizeExclude()})),n(this.excludeContainer,"click",".wpstg-file-ext-rule",(function(){e.addFileExtExclude()})),n(this.excludeContainer,"click",".wpstg-file-name-rule",(function(){e.addFileNameExclude()})),n(this.excludeContainer,"click",".wpstg-dir-name-rule",(function(){e.addDirNameExclude()})),n(this.excludeContainer,"click",".wpstg-clear-all-rules",(function(){e.clearExcludes()})),n(this.excludeContainer,"click",".wpstg-remove-exclude-rule",(function(t){e.removeExclude(t)}))},r.init=function(){null!==this.excludeContainer?this.addEvents():console.log("Error: Given table selector not found!")},r.addFileSizeExclude=function(){this.addExcludeRuleRow("#wpstg-file-size-exclude-filter-template")},r.addFileExtExclude=function(){this.addExcludeRuleRow("#wpstg-file-ext-exclude-filter-template")},r.addFileNameExclude=function(){this.addExcludeRuleRow("#wpstg-file-name-exclude-filter-template")},r.addDirNameExclude=function(){this.addExcludeRuleRow("#wpstg-dir-name-exclude-filter-template")},r.addExcludeRuleRow=function(e){var n=t(e);if(null!==n){var r=n.content.cloneNode(!0).querySelector("tr");this.excludeTableBody.appendChild(r),s(".wpstg-has-exclude-rules").forEach((function(e){e.style.display="inherit"}))}},r.clearExcludes=function(){this.excludeTableBody.innerHTML="",s(".wpstg-has-exclude-rules").forEach((function(e){e.style.display="none"}))},r.removeExclude=function(e){null!==e.parentElement&&null!==e.parentElement.parentElement&&this.excludeTableBody.removeChild(e.parentElement.parentElement),""===this.excludeTableBody.innerHTML.trim()&&s(".wpstg-has-exclude-rules").forEach((function(e){e.style.display="none"}))},r.getExcludeFilters=function(){for(var e=this,t=[],s=[],n=this.excludeTableBody.querySelectorAll('select[name="wpstgFileSizeExcludeRuleCompare[]"]'),r=this.excludeTableBody.querySelectorAll('input[name="wpstgFileSizeExcludeRuleSize[]"]'),o=this.excludeTableBody.querySelectorAll('select[name="wpstgFileSizeExcludeRuleByte[]"]'),i=0,a=Object.entries(r);i<a.length;i++){var c=a[i],l=c[0],g=c[1];""!==g.value&&s.push(n[l].value+" "+g.value+o[l].value)}this.excludeTableBody.querySelectorAll('input[name="wpstgFileExtExcludeRule[]"]').forEach((function(s){var n=e.cleanStringForGlob(s.value);""!==n&&t.push("ext:"+n.trim())}));for(var p=this.excludeTableBody.querySelectorAll('select[name="wpstgFileNameExcludeRulePos[]"]'),d=this.excludeTableBody.querySelectorAll('input[name="wpstgFileNameExcludeRulePath[]"]'),u=0,w=Object.entries(d);u<w.length;u++){var h=w[u],f=h[0],m=h[1],v=this.cleanStringForGlob(m.value);""!==v&&t.push("file:"+p[f].value+" "+v.trim())}for(var b=this.excludeTableBody.querySelectorAll('select[name="wpstgDirNameExcludeRulePos[]"]'),y=this.excludeTableBody.querySelectorAll('input[name="wpstgDirNameExcludeRulePath[]"]'),x=0,k=Object.entries(y);x<k.length;x++){var S=k[x],E=S[0],C=S[1],_=this.cleanStringForGlob(C.value);""!==_&&t.push("dir:"+b[E].value+" "+_.trim())}return{sizes:s.filter(this.onlyUnique).join(","),globs:t.filter(this.onlyUnique).join(",")}},r.onlyUnique=function(e,t,s){return s.indexOf(e)===t},r.cleanStringForGlob=function(e){return e.replace(/[*^//!\.[?]/g,"")},e}(),l=function(){function e(e,t){void 0===t&&(t=wpstg),this.confirmAction=e,this.wpstgObject=t}var t=e.prototype;return t.show=function(e,t,s){var n=this;void 0===t&&(t={}),void 0===s&&(s=null),wpstgSwal.fire(e).then((function(e){e.value&&null!==n.error&&n.triggerConfirmAction(t,s)}))},t.triggerConfirmAction=function(e,t){var s=this;void 0===e&&(e={}),void 0===t&&(t=null),fetch(this.wpstgObject.ajaxUrl,{method:"POST",credentials:"same-origin",body:new URLSearchParams(Object.assign({action:this.confirmAction,accessToken:this.wpstgObject.accessToken,nonce:this.wpstgObject.nonce},e)),headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((function(e){return e.ok?e.json():Promise.reject(e)})).then((function(e){null!==t&&t(e)})).catch((function(e){console.log(s.wpstgObject.i18n.somethingWentWrong,e)}))},e}();function g(e,t,s,n){var r,o,i,a,c=!1,l=!1,g={},p=0,d=0,u={sensitivity:7,interval:100,timeout:0,handleFocus:!1};function w(e){r=e.clientX,o=e.clientY}function h(e,t){if(d&&(d=clearTimeout(d)),Math.abs(i-r)+Math.abs(a-o)<u.sensitivity)return p=1,l?void 0:s(e,t);i=r,a=o,d=setTimeout((function(){h(e,t)}),u.interval)}function f(e,t){return c=!0,d&&(d=clearTimeout(d)),e.removeEventListener("mousemove",w,!1),1!==p&&(i=t.clientX,a=t.clientY,e.addEventListener("mousemove",w,!1),d=setTimeout((function(){h(e,t)}),u.interval)),this}function m(e){e.target.matches(t+", "+t+" *")&&f(e.target.closest(t),e)}function v(e,t){return c=!1,d&&(d=clearTimeout(d)),e.removeEventListener("mousemove",w,!1),1===p&&(d=setTimeout((function(){!function(e,t){d&&(d=clearTimeout(d)),p=0,l||n(e,t)}(e,t)}),u.timeout)),this}function b(e){e.target.matches(t+", "+t+" *")&&v(e.target.closest(t),e)}function y(e){var n,r;e.target.matches(t+", "+t+" *")&&(n=e.target.closest(t),r=e,c||(l=!0,s(n,r)))}function x(e){var s,r;e.target.matches(t+", "+t+" *")&&(s=e.target.closest(t),r=e,!c&&l&&(l=!1,n(s,r)))}function k(){e.removeEventListener("focus",y,!1),e.removeEventListener("blur",x,!1)}return g.options=function(t){var s=t.handleFocus!==u.handleFocus;return u=Object.assign({},u,t),s&&(u.handleFocus?(e.addEventListener("focus",y,!1),e.addEventListener("blur",x,!1)):k()),g},g.remove=function(){e&&(e.removeEventListener("mouseover",m,!1),e.removeEventListener("mouseout",b,!1),k())},e&&(e.addEventListener("mouseover",m,!1),e.addEventListener("mouseout",b,!1)),g}var p=function(e){var t={continueErrorHandle:!0,cache:{elements:[],get:function(t){return-1!==e.inArray(t,this.elements)||(this.elements[t]=e(t)),this.elements[t]},refresh:function(t){t.elements[t]=e(t)}},setJobId:function(e){localStorage.setItem("jobIdBeingProcessed",e)},getJobId:function(){return localStorage.getItem("jobIdBeingProcessed")},listenTooltip:function(){g(document,".wpstg--tooltip",(function(e,t){e.querySelector(".wpstg--tooltiptext").style.visibility="visible"}),(function(e,t){e.querySelector(".wpstg--tooltiptext").style.visibility="hidden"}))},isEmpty:function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},getSwalModal:function(e,t){void 0===e&&(e=!1),void 0===t&&(t={});var s={confirmButton:"wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn wpstg-100-width",cancelButton:"wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn wpstg-100-width",actions:"wpstg--modal--actions",popup:e?"wpstg-swal-popup centered-modal":"wpstg-swal-popup"},n={customClass:Object.assign(s,t),buttonsStyling:!1,reverseButtons:!0,showClass:{popup:"wpstg--swal2-show wpstg-swal-show"}};return wpstgSwal.mixin(n)},showSuccessModal:function(e){this.getSwalModal().fire({showConfirmButton:!1,showCancelButton:!0,cancelButtonText:"OK",icon:"success",title:"Success!",html:'<div class="wpstg--grey" style="text-align: left; margin-top: 8px;">'+e+"</div>"})},showWarningModal:function(e){this.getSwalModal().fire({showConfirmButton:!1,showCancelButton:!0,cancelButtonText:"OK",icon:"warning",title:"",html:'<div class="wpstg--grey" style="text-align: left; margin-top: 8px;">'+e+"</div>"})},showErrorModal:function(e){this.getSwalModal().fire({showConfirmButton:!1,showCancelButton:!0,cancelButtonText:"OK",icon:"error",title:"Error!",html:'<div class="wpstg--grey" style="text-align: left; margin-top: 8px;">'+e+"</div>"})},getSwalContainer:function(){return wpstgSwal.getContainer()},closeSwalModal:function(){wpstgSwal.close()},getDataFromWordPressResponse:function(e){if("object"!=typeof e)throw new Error("Unexpected response (ERR 1341)");if(!e.hasOwnProperty("success"))throw new Error("Unexpected response (ERR 1342)");if(!e.hasOwnProperty("data"))throw new Error("Unexpected response (ERR 1343)");if(!1===e.success)throw e.data instanceof Array&&e.data.length>0?new Error(e.data.shift()):new Error("Response was not successful");return e.data},isLoading:function(e){e&&!1!==e?t.cache.get(".wpstg-loader").show():t.cache.get(".wpstg-loader").hide()},slugify:function(e){return e.toString().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g,"-").replace(/&/g,"-and-").replace(/[^a-z0-9\-]/g,"").replace(/-+/g,"-").replace(/^-*/,"").replace(/-*$/,"")},showAjaxFatalError:function(e,s,n){return s=s?s+"<br/><br/>":"Something went wrong! <br/><br/>",n=n?n+"<br/><br/>":"<br/><br/>Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.",!1===e?(t.showError(s+" Error: No response."+n),void window.removeEventListener("beforeunload",WPStaging.warnIfClosingDuringProcess)):void 0!==e.error&&e.error?(t.showError(s+" Error: "+e.message+n),void window.removeEventListener("beforeunload",WPStaging.warnIfClosingDuringProcess)):void 0},handleFetchErrors:function(e){return e.ok||t.showError("Error: "+e.status+" - "+e.statusText+". Please try again or contact support."),e},showError:function(s){t.cache.get("#wpstg-try-again").css("display","inline-block"),t.cache.get("#wpstg-cancel-cloning").text("Reset"),t.cache.get("#wpstg-resume-cloning").show(),t.cache.get("#wpstg-error-wrapper").show(),t.cache.get("#wpstg-error-details").show().html(s),t.cache.get("#wpstg-removing-clone").removeClass("loading"),t.cache.get(".wpstg-loader").hide(),e(".wpstg--modal--process--generic-problem").show().html(s)},resetErrors:function(){t.cache.get("#wpstg-error-details").hide().html("")},ajax:function(s,n,r,o,i,a,c){void 0===a&&(a=null),void 0===c&&(c=null),void 0===r&&(r="json"),!1!==o&&(o=!0);var l=10,g=1e4*(i=void 0===i?0:i);a=parseInt(a),isNaN(a)||(g*=a),e.ajax({url:ajaxurl+"?action=wpstg_processing&_="+Date.now()/1e3,type:"POST",dataType:r,cache:!1,data:s,error:function(e,p,d){if(console.log(e.status+" "+e.statusText+"---"+p),"function"!=typeof c||(c(e,p,d),t.continueErrorHandle))if(++i<=l)setTimeout((function(){t.ajax(s,n,r,o,i,a)}),g);else{var u=void 0===e.status?"Unknown":e.status;t.showError("Fatal Error: "+u+" Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.")}else t.continueErrorHandle=!0},success:function(e){"function"==typeof n&&n(e)},statusCode:{404:function(){i>=l&&t.showError("Error 404 - Can't find ajax request URL! Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.")},500:function(){i>=l&&t.showError("Fatal Error 500 - Internal server error while processing the request! Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.")},504:function(){i>l&&t.showError("Error 504 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},502:function(){i>=l&&t.showError("Error 502 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},503:function(){i>=l&&t.showError("Error 503 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},429:function(){i>=l&&t.showError("Error 429 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},403:function(){i>=l&&t.showError("Refresh page or login again! The process should be finished successfully. \n ")}}})}};return t}(jQuery),d=function(){function e(e,s,n,r,o){void 0===s&&(s="#wpstg-workflow"),void 0===n&&(n="wpstg_clone_excludes_settings"),void 0===r&&(r="wpstg_modal_error"),void 0===o&&(o=wpstg),this.cloneID=e,this.workflow=t(s),this.wpstgObject=o,this.fetchExcludeSettingsAction=n,this.modalErrorAction=r,this.resetButtonClass="wpstg-confirm-reset-clone",this.resetModalContainerClass="wpstg-reset-confirmation",this.resetTabSelector=".wpstg-reset-exclude-tab",this.directoryNavigator=null,this.excludeFilters=null,this.isAllTablesChecked=!0}var s=e.prototype;return s.addEvents=function(){var e=this,s=t("."+this.resetModalContainerClass);null!==s?(n(s,"click",this.resetTabSelector,(function(t){e.toggleContent(t)})),n(s,"click",".wpstg-button-select",(function(){e.selectDefaultTables()})),n(s,"click",".wpstg-button-unselect",(function(){e.toggleTableSelection()})),n(s,"click",".wpstg-expand-dirs",(function(t,s){s.preventDefault(),e.toggleDirectoryNavigation(t)})),n(s,"change","input.wpstg-check-dir",(function(t){e.updateDirectorySelection(t)}))):console.log("Exit")},s.init=function(){this.addEvents()},s.toggleContent=function(e){var s=t("."+this.resetModalContainerClass),n=e.getAttribute("data-id"),i=e.querySelector(".wpstg-tab-triangle"),a=e.getAttribute("data-collapsed","true"),c=t(n);"true"===a?(s.classList.contains("has-collapsible-open")?s.classList.add("has-collapsible-open-2"):s.classList.add("has-collapsible-open"),r(c),i.style.transform="rotate(90deg)",e.setAttribute("data-collapsed","false")):(s.classList.contains("has-collapsible-open-2")?s.classList.remove("has-collapsible-open-2"):s.classList.remove("has-collapsible-open"),o(c),i.style.removeProperty("transform"),e.setAttribute("data-collapsed","true"))},s.showModal=function(){var e=this.loadModal();return this.init(),this.fetchCloneExcludes(),e},s.loadModal=function(){return p.getSwalModal(!1,{confirmButton:this.resetButtonClass+" wpstg-confirm-reset-clone wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn",container:this.resetModalContainerClass+" wpstg-swal2-container wpstg-swal2-loading"}).fire({title:"",icon:"warning",html:this.getAjaxLoader(),width:"400px",focusConfirm:!1,confirmButtonText:this.wpstgObject.i18n.resetClone,showCancelButton:!0})},s.fetchCloneExcludes=function(){var e=this;this.error=null,fetch(this.wpstgObject.ajaxUrl,{method:"POST",credentials:"same-origin",body:new URLSearchParams({action:this.fetchExcludeSettingsAction,accessToken:this.wpstgObject.accessToken,nonce:this.wpstgObject.nonce,clone:this.cloneID,job:"resetting"}),headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((function(e){return e.ok?e.json():Promise.reject(e)})).then((function(s){if(s.success){var n=t(".wpstg-reset-confirmation");n.classList.remove("wpstg-swal2-loading"),n.querySelector(".wpstg--swal2-popup").style.width="500px",n.querySelector(".wpstg--swal2-content").innerHTML=s.html,e.directoryNavigator=new a,e.excludeFilters=new c}else{new l(e.modalErrorAction,e.wpstgObject).show(Object.assign({title:"Error",icon:"error",html:e.wpstgObject.i18n.somethingWentWrong,width:"500px",confirmButtonText:"Ok",showCancelButton:!1,customClass:{confirmButton:"wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn",cancelButton:"wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn",actions:"wpstg--modal--actions",popup:"wpstg-swal-popup centered-modal"},buttonsStyling:!1,reverseButtons:!0},s.swalOptions),{type:s.type})}})).catch((function(t){e.renderError({html:e.wpstgObject.i18n.somethingWentWrong+" "+t})}))},s.getDirectoryNavigator=function(){return this.directoryNavigator},s.getExcludeFilters=function(){return this.excludeFilters},s.getAjaxLoader=function(){return'<div class="wpstg-swal2-ajax-loader"><img src="'+this.wpstgObject.wpstgIcon+'" /></div>'},s.toggleDirectoryNavigation=function(e){var t=e.previousSibling;if("false"!==t.getAttribute("data-navigateable","false")&&"false"!==t.getAttribute("data-scanned","false")){var s=function(e,t){for(var s=e.nextElementSibling;s;){if(s.matches(t))return s;s=s.nextElementSibling}}(e,".wpstg-subdir");"none"===s.style.display?r(s):o(s)}},s.updateDirectorySelection=function(e){var t=e.parentElement;e.checked?(function(e,t){for(var s=[],n=e&&e.parentElement;n;n=n.parentElement)n.matches(t)&&s.push(n);return s}(t,".wpstg-dir").forEach((function(e){for(var t=0;t<e.children.length;t++)e.children[t].matches(".wpstg-check-dir")&&(e.children[t].checked=!0)})),t.querySelectorAll(".wpstg-expand-dirs").forEach((function(e){e.classList.remove("disabled")})),t.querySelectorAll(".wpstg-subdir .wpstg-check-dir").forEach((function(e){e.checked=!0}))):(t.querySelectorAll(".wpstg-expand-dirs, .wpstg-check-subdirs").forEach((function(e){e.classList.add("disabled")})),t.querySelectorAll(".wpstg-dir .wpstg-check-dir").forEach((function(e){e.checked=!1})))},s.selectDefaultTables=function(){var e=this,s=t("."+this.resetModalContainerClass).querySelectorAll("#wpstg_select_tables_cloning .wpstg-db-table"),n="^"+this.wpstgObject.tblprefix+"([^0-9])_*",r="^"+this.wpstgObject.tblprefix;s.forEach((function(t){var s=t.getAttribute("name","");"1"===e.wpstgObject.isMultisite&&s.match(n)||""===e.wpstgObject.isMultisite&&s.match(r)?t.setAttribute("selected","selected"):t.removeAttribute("selected")}))},s.toggleTableSelection=function(){var e=t("."+this.resetModalContainerClass);!1===this.isAllTablesChecked?(e.querySelectorAll("#wpstg_select_tables_cloning .wpstg-db-table").forEach((function(e){e.setAttribute("selected","selected")})),e.querySelector(".wpstg-button-unselect").innerHTML="Unselect All",this.isAllTablesChecked=!0):(e.querySelectorAll("#wpstg_select_tables_cloning .wpstg-db-table").forEach((function(e){e.removeAttribute("selected")})),e.querySelector(".wpstg-button-unselect").innerHTML="Select All",this.isAllTablesChecked=!1)},e}(),u=function(){function e(e){void 0===e&&(e="#wpstg-clonepage-wrapper"),this.baseContainer=t(e),this.checkBoxSettingTogglerSelector=".wpstg-toggle-advance-settings-section",this.init()}var s=e.prototype;return s.addEvents=function(){var e=this;null!==this.baseContainer&&n(this.baseContainer,"change",this.checkBoxSettingTogglerSelector,(function(t){e.toggleSettings(t)}))},s.init=function(){this.addEvents()},s.toggleSettings=function(e){var s=t("#"+e.getAttribute("data-id"));e.checked?r(s):o(s)},e}(),w=function(){function e(){this.activeTabClass="wpstg--tab--active",this.mainMenu()}return e.prototype.mainMenu=function(){var e=this;null!==t(".wpstg--tab--header")&&n(t(".wpstg--tab--header"),"click",".wpstg-button",(function(t){var n=t,r=n.getAttribute("data-target"),o=s(r),i=s(".wpstg--tab--header a[data-target]");s(".wpstg--tab--contents > .wpstg--tab--content").forEach((function(t){t.matches("."+e.activeTabClass+":not("+r+")")&&t.classList.remove(e.activeTabClass)})),i.forEach((function(t){t!==n&&t.classList.remove(e.activeTabClass)})),n.classList.add(e.activeTabClass),o.forEach((function(t){t.classList.add(e.activeTabClass)})),"#wpstg--tab--backup"===r&&window.dispatchEvent(new Event("backups-tab"))}))},e}(),h=function(t){var s,n={isCancelled:!1,isFinished:!1,getLogs:!1,time:1,executionTime:!1,progressBar:0,cloneExcludeFilters:null,directoryNavigator:null,notyf:null,areAllTablesChecked:!0},r={elements:[]};r.get=function(e){return-1!==t.inArray(e,r.elements)||(r.elements[e]=jQuery(e)),r.elements[e]},r.refresh=function(e){e.elements[e]=jQuery(e)};var o=function(e){r.get("#wpstg-try-again").css("display","inline-block"),r.get("#wpstg-cancel-cloning").text("Reset"),r.get("#wpstg-resume-cloning").show(),r.get("#wpstg-error-wrapper").show(),r.get("#wpstg-error-details").show().html(e),r.get("#wpstg-removing-clone").removeClass("loading"),r.get(".wpstg-loader").hide(),t(".wpstg--modal--process--generic-problem").show().html(e),t.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"wpstg_staging_job_error",accessToken:wpstg.accessToken,nonce:wpstg.nonce,error_message:e}})};n.warnIfClosingDuringProcess=function(e){return e.returnValue="You MUST leave this window open while cloning/pushing. Please wait...",null};var g=function(e,t,s){return t=t?t+"<br/><br/>":"Something went wrong! <br/><br/>",s=s?s+"<br/><br/>":"<br/><br/>Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.",!1===e?(o(t+" Error: No response."+s),void window.removeEventListener("beforeunload",h.warnIfClosingDuringProcess)):void 0!==e.error&&e.error?(console.error(e.message),o(t+" Error: "+e.message+s),void window.removeEventListener("beforeunload",h.warnIfClosingDuringProcess)):void 0},f=function(){r.get("#wpstg-error-details").hide().html("")},m=function(){var e=t("#wpstg_clone_hostname").val();if(""===e)return!0;return!1!==/^http(s)?:\/\/.*$/.test(e)},v=function(){var e=r.get("#wpstg-workflow");e.on("click","#wpstg-cancel-cloning",(function(){if(!confirm("Are you sure you want to cancel cloning process?"))return!1;var e=t(this);t("#wpstg-try-again, #wpstg-home-link").hide(),e.prop("disabled",!0),n.isCancelled=!0,n.progressBar=0,t("#wpstg-processing-status").text("Please wait...this can take up a while."),t(".wpstg-loader, #wpstg-show-log-button").hide(),e.parent().append(s),j()})).on("click","#wpstg-resume-cloning",(function(){f();var e=t(this);t("#wpstg-try-again, #wpstg-home-link").hide(),n.isCancelled=!1,t("#wpstg-processing-status").text("Try to resume cloning process..."),t("#wpstg-error-details").hide(),t(".wpstg-loader").show(),e.parent().append(s),n.startCloning()})).on("click","#wpstg-cancel-cloning-update",(function(){f();var e=t(this);t("#wpstg-try-again, #wpstg-home-link").hide(),e.prop("disabled",!0),n.isCancelled=!0,t("#wpstg-cloning-result").text("Please wait...this can take up a while."),t(".wpstg-loader, #wpstg-show-log-button").hide(),e.parent().append(s),L()})).on("click","#wpstg-restart-cloning",(function(){f();var e=t(this);t("#wpstg-try-again, #wpstg-home-link").hide(),e.prop("disabled",!0),n.isCancelled=!0,t("#wpstg-cloning-result").text("Please wait...this can take up a while."),t(".wpstg-loader, #wpstg-show-log-button").hide(),e.parent().append(s),A()})).on("click",".wpstg-remove-clone[data-clone]",(function(s){f(),s.preventDefault();var n=r.get("#wpstg-existing-clones");e.removeClass("active"),r.get(".wpstg-loader").show(),b({action:"wpstg_confirm_delete_clone",accessToken:wpstg.accessToken,nonce:wpstg.nonce,clone:t(this).data("clone")},(function(e){r.get("#wpstg-removing-clone").html(e),n.children("img").remove(),r.get(".wpstg-loader").hide(),t("html, body").animate({scrollTop:t("#wpstg-remove-clone").offset().top-t(window).height()+t("#wpstg-remove-clone").height()+50},100)}),"HTML")})).on("click","#wpstg-remove-clone",(function(e){f(),e.preventDefault(),r.get("#wpstg-removing-clone").addClass("loading"),r.get(".wpstg-loader").show(),D(t(this).data("clone"))})).on("click","#wpstg-cancel-removing",(function(e){e.preventDefault(),t(".wpstg-clone").removeClass("active"),r.get("#wpstg-removing-clone").html("")})).on("click",".wpstg-execute-clone",(function(s){s.preventDefault();var r=t(this).data("clone");e.addClass("loading"),n.cloneExcludeFilters=null,b({action:"wpstg_scanning",clone:r,accessToken:wpstg.accessToken,nonce:wpstg.nonce},(function(t){t.length<1&&o("Something went wrong! Error: No response. Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.");var s=_(t);if(!1!==s&&!1===s.success)return e.removeClass("loading"),void C(s);e.removeClass("loading").html(t),I(),n.directoryNavigator=new a("#wpstg-directories-listing",wpstg,n.notyf),n.cloneExcludeFilters=new c,n.switchStep(2)}),"HTML")})).on("click",".wpstg-reset-clone",(function(e){e.preventDefault();var s=t(this).data("clone"),r=new d(s),o=r.showModal();n.areAllTablesChecked=!0,o.then((function(e){if(e.value){var t=r.getDirectoryNavigator(),n=r.getExcludeFilters().getExcludeFilters();T(s,{includedTables:y(),excludeSizeRules:encodeURIComponent(n.sizes),excludeGlobRules:encodeURIComponent(n.globs),excludedDirectories:t.getExcludedDirectories(),extraDirectories:t.getExtraDirectoriesRootOnly()})}}))}))},b=function e(s,n,r,i,a,c){void 0===c&&(c=null),void 0===r&&(r="json"),!1!==i&&(i=!0);var l=1e4*(a=void 0===a?0:a);c=parseInt(c),isNaN(c)||(l*=c),t.ajax({url:ajaxurl+"?action=wpstg_processing&_="+Date.now()/1e3,type:"POST",dataType:r,cache:!1,data:s,error:function(t,g,p){if(++a<=5)console.log("RETRYING "+a+"/5"),setTimeout((function(){e(s,n,r,i,a,c)}),l);else{console.log("RETRYING LIMIT");var d=void 0===t.status?"Unknown":t.status;o("Fatal Error: "+d+" Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.")}},success:function(e){"function"==typeof n&&n(e)},statusCode:{404:function(){a>=5&&o("Error 404 - Can't find ajax request URL! Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.")},500:function(){a>=5&&o("Fatal Error 500 - Internal server error while processing the request! Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.")},504:function(){a>5&&o("Error 504 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},502:function(){a>=5&&o("Error 502 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},503:function(){a>=5&&o("Error 503 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},429:function(){a>=5&&o("Error 429 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report and contact us.\n ")},403:function(){a>=5&&o("Refresh page or login again! The process should be finished successfully. \n ")}}})},y=function(){var e=[];return t("#wpstg_select_tables_cloning option:selected").each((function(){e.push(this.value)})),e},x=function(){var e=[];return t(".wpstg-db-table input:not(:checked)").each((function(){e.push(this.name)})),e},k=function(e,t){r.get(".wpstg-loader").show(),b({action:"wpstg_database_verification",accessToken:wpstg.accessToken,nonce:wpstg.nonce,databaseUser:r.get("#wpstg_db_username").val(),databasePassword:r.get("#wpstg_db_password").val(),databaseServer:r.get("#wpstg_db_server").val(),databaseDatabase:r.get("#wpstg_db_database").val()},(function(s){if(!1===s)return o("Something went wrong! Error: No response.Please try again. If that does not help, <a href='https://wp-staging.com/support/' target='_blank'>open a support ticket</a> "),void r.get(".wpstg-loader").hide();if(void 0===s.success)return o("Something went wrong! Error: Invalid response.Please try again. If that does not help, <a href='https://wp-staging.com/support/' target='_blank'>open a support ticket</a> "),void r.get(".wpstg-loader").hide();if(s.success)return r.get(".wpstg-loader").hide(),void S(e,t);if("comparison"===s.error_type){r.get(".wpstg-loader").hide();var n='<table class="wpstg-db-comparison-table"><thead><tr><th>Property</th><th>Production DB</th><th>Staging DB</th><th>Status</th></tr></thead><tbody>';return s.checks.forEach((function(e){var t='<span class="wpstg-css-tick"></span>';e.production!==e.staging&&(t='<span class="wpstg-css-cross"></span>'),n+="<tr><td>"+e.name+"</td><td>"+e.production+"</td><td>"+e.staging+"</td><td>"+t+"</td></tr>"})),n+="</tbody></table><p>Note: Some MySQL/MariaDB properties do not match. You may proceed but the staging site may not work as expected.</p>",void p.getSwalModal(!0,{popup:"wpstg-swal-popup wpstg-db-comparison-modal centered-modal"}).fire({title:"Different Database Properties",icon:"warning",html:n,width:"650px",focusConfirm:!1,confirmButtonText:"Proceed",showCancelButton:!0}).then((function(s){s.value&&S(e,t)}))}p.getSwalModal(!0).fire({title:"Different Database Properties",icon:"error",html:s.message,focusConfirm:!0,confirmButtonText:"Ok",showCancelButton:!1}),r.get(".wpstg-loader").hide()}),"json",!1)},S=function(e,s){s.addClass("loading"),n.data={action:e.data("action"),accessToken:wpstg.accessToken,nonce:wpstg.nonce},function(){if("wpstg_cloning"===n.data.action||"wpstg_update"===n.data.action||"wpstg_reset"===n.data.action){if(n.data.cloneID=(new Date).getTime().toString(),"wpstg_update"===n.data.action&&(n.data.cloneID=t("#wpstg-new-clone-id").data("clone")),n.data.cloneName=t("#wpstg-new-clone-id").val()||n.data.cloneID,null!==n.directoryNavigator&&(n.data.excludedDirectories=encodeURIComponent(n.directoryNavigator.getExcludedDirectories()),n.data.extraDirectories=encodeURIComponent(n.directoryNavigator.getExtraDirectoriesRootOnly())),n.data.excludeGlobRules="",n.data.excludeSizeRules="",n.cloneExcludeFilters instanceof c){var e=n.cloneExcludeFilters.getExcludeFilters();n.data.excludeGlobRules=encodeURIComponent(e.globs),n.data.excludeSizeRules=encodeURIComponent(e.sizes)}n.data.includedTables=y(),n.data.databaseServer=t("#wpstg_db_server").val(),n.data.databaseUser=t("#wpstg_db_username").val(),n.data.databasePassword=t("#wpstg_db_password").val(),n.data.databaseDatabase=t("#wpstg_db_database").val(),n.data.databasePrefix=t("#wpstg_db_prefix").val();var s=t("#wpstg_clone_dir").val();n.data.cloneDir=encodeURIComponent(t.trim(s)),n.data.cloneHostname=t("#wpstg_clone_hostname").val(),n.data.emailsAllowed=t("#wpstg_allow_emails").is(":checked"),n.data.networkClone=t("#wpstg_network_clone").is(":checked"),n.data.uploadsSymlinked=t("#wpstg_symlink_upload").is(":checked"),n.data.cleanPluginsThemes=t("#wpstg-clean-plugins-themes").is(":checked"),n.data.cleanUploadsDir=t("#wpstg-clean-uploads").is(":checked")}}(),E(s)},E=function(e){b(n.data,(function(t){!1===t&&o("Something went wrong!<br/><br/> Go to WP Staging > Settings and lower 'File Copy Limit' and 'DB Query Limit'. Also set 'CPU Load Priority to low 'and try again. If that does not help, <a href='https://wp-staging.com/support/' target='_blank'>open a support ticket</a> "),t.length<1&&o("Something went wrong! No response. Go to WP Staging > Settings and lower 'File Copy Limit' and 'DB Query Limit'. Also set 'CPU Load Priority to low 'and try again. If that does not help, <a href='https://wp-staging.com/support/' target='_blank'>open a support ticket</a> ");var s=_(t);if(!1!==s&&!1===s.success)return e.removeClass("loading"),void C(s);e.removeClass("loading").html(t),n.cloneExcludeFilters=null,"wpstg_scanning"===n.data.action?(n.areAllTablesChecked=!0,n.directoryNavigator=new a("#wpstg-directories-listing",wpstg,n.notyf),n.switchStep(2),n.cloneExcludeFilters=new c):"wpstg_cloning"!==n.data.action&&"wpstg_update"!==n.data.action&&"wpstg_reset"!==n.data.action||n.switchStep(3),n.startCloning()}),"HTML")},C=function(e){new l("wpstg_modal_error",wpstg).show(Object.assign({title:"Error",icon:"error",html:wpstg.i18n.somethingWentWrong,width:"500px",confirmButtonText:"Ok",showCancelButton:!1,customClass:{confirmButton:"wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn",cancelButton:"wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn",actions:"wpstg--modal--actions",popup:"wpstg-swal-popup centered-modal"},buttonsStyling:!1,reverseButtons:!0},e.swalOptions),{type:e.type})},_=function(e){if(!e)return!1;try{var t=JSON.parse(e);if(t&&"object"==typeof t)return t}catch(e){}return!1},T=function(t,s){n.data={action:"wpstg_reset",accessToken:wpstg.accessToken,nonce:wpstg.nonce,cloneID:t},n.data=e({},n.data,s);var o=r.get("#wpstg-workflow");E(o)},P=function(){var e=r.get("#wpstg-workflow");e.addClass("loading"),b({action:"wpstg_overview",accessToken:wpstg.accessToken,nonce:wpstg.nonce},(function(t){t.length<1&&o("Something went wrong! No response. Please try the <a href='https://wp-staging.com/docs/wp-staging-settings-for-small-servers/' target='_blank'>WP Staging Small Server Settings</a> or submit an error report."),r.get(".wpstg-current-step"),e.removeClass("loading").html(t)}),"HTML"),n.switchStep(1),r.get(".wpstg-step3-cloning").show(),r.get(".wpstg-step3-pushing").hide()},D=function e(s){var n=t("#deleteDirectory:checked").data("deletepath");b({action:"wpstg_delete_clone",clone:s,accessToken:wpstg.accessToken,nonce:wpstg.nonce,excludedTables:x(),deleteDir:n},(function(n){if(n&&(g(n),void 0!==n.delete&&("finished"===n.delete||"unfinished"===n.delete)))return r.get("#wpstg-removing-clone").removeClass("loading").html(""),"finished"===n.delete&&void 0===n.error&&t('.wpstg-clone[data-clone-id="'+s+'"]').remove(),t("#wpstg-existing-clones .wpstg-clone").length<1&&(r.get("#wpstg-existing-clones").find("h3").text(""),r.get("#wpstg-no-staging-site-results").show()),void r.get(".wpstg-loader").hide();!0===n||e(s)}))},j=function e(){if(n.timer("stop"),!0===n.isFinished)return!0;b({action:"wpstg_cancel_clone",clone:n.data.cloneID,accessToken:wpstg.accessToken,nonce:wpstg.nonce},(function(t){if(t&&void 0!==t.delete&&"finished"===t.delete)return r.get(".wpstg-loader").hide(),void P();!0===t?P():e()}))},L=function e(){if(!0===n.isFinished)return!0;b({action:"wpstg_cancel_update",clone:n.data.cloneID,accessToken:wpstg.accessToken,nonce:wpstg.nonce},(function(t){t&&void 0!==t.delete&&"finished"===t.delete||!0===t?P():e()}))},A=function(){if(!0===n.isFinished)return!0;b({action:"wpstg_restart",accessToken:wpstg.accessToken,nonce:wpstg.nonce},(function(e){e&&void 0!==e.delete&&"finished"===e.delete||!0===e?P():L()}))},O=function(e){var s;null!=e&&void 0!==e&&(e.constructor===Array?t.each(e,(function(e,t){null!==t&&("ERROR"===t.type?r.get(".wpstg-log-details").append('<span class="wpstg--red">['+t.type+"]</span>-["+t.date+"] "+t.message+"</br>"):r.get(".wpstg-log-details").append("["+t.type+"]-["+t.date+"] "+t.message+"</br>"))})):r.get(".wpstg-log-details").append("["+e.type+"]-["+e.date+"] "+e.message+"</br>")),void 0!==(s=r.get(".wpstg-log-details"))[0]&&s.scrollTop(s[0].scrollHeight)},I=function(){r.get("#wpstg-check-space").on("click",(function(e){r.get(".wpstg-loader").show();var t=encodeURIComponent(n.directoryNavigator.getExcludedDirectories()),s=encodeURIComponent(n.directoryNavigator.getExtraDirectoriesRootOnly());b({action:"wpstg_check_disk_space",accessToken:wpstg.accessToken,nonce:wpstg.nonce,excludedDirectories:t,extraDirectories:s},(function(e){if(!1===e)return r.get("#wpstg-clone-id-error").text("Can not detect required disk space").show(),void r.get(".wpstg-loader").hide();r.get("#wpstg-clone-id-error").html("Estimated necessary disk space: "+e.requiredSpace+(null!==e.errorMessage?"<br>"+e.errorMessage:"")+'<br> <span style="color:#444;">Before you proceed ensure your account has enough free disk space to hold the entire instance of the production site. You can check the available space from your hosting account (cPanel or similar).</span>').show(),r.get(".wpstg-loader").hide()}),"json",!1)}))};return n.timer=function(e){if("stop"===e){var t=n.time;return n.time=1,clearInterval(n.executionTime),n.convertSeconds(t)}n.executionTime=setInterval((function(){null!==document.getElementById("wpstg-processing-timer")&&(document.getElementById("wpstg-processing-timer").innerHTML="Elapsed Time: "+n.convertSeconds(n.time)),n.time++,"stop"===e&&(n.time=1,clearInterval(n.executionTime))}),1e3)},n.convertSeconds=function(e){var t=new Date(null);return t.setSeconds(e),t.toISOString().substr(11,8)},n.startCloning=function(){if(f(),I(),"wpstg_cloning"===n.data.action||"wpstg_update"===n.data.action||"wpstg_reset"===n.data.action){n.isCancelled=!1,r.get(".wpstg-loader").show(),r.get("#wpstg-cancel-cloning").text("Cancel"),r.get("#wpstg-resume-cloning").hide(),r.get("#wpstg-error-details").hide(),setTimeout((function(){window.addEventListener("beforeunload",h.warnIfClosingDuringProcess),e()}),wpstg.delayReq),n.timer("start");var e=function e(){if(!0===n.isCancelled)return window.removeEventListener("beforeunload",h.warnIfClosingDuringProcess),!1;var o;(o=!0)&&!1!==o?r.get(".wpstg-loader").show():r.get(".wpstg-loader").hide();var i="",a="";null!==n.directoryNavigator&&(i=n.directoryNavigator.getExcludedDirectories(),a=n.directoryNavigator.getExtraDirectoriesRootOnly()),r.get(".wpstg-log-details").show(),h.ajax({action:"wpstg_processing",accessToken:wpstg.accessToken,nonce:wpstg.nonce,excludedTables:x(),excludedDirectories:encodeURIComponent(i),extraDirectories:encodeURIComponent(a)},(function(o){g(o),void 0!==o.last_msg&&o.last_msg&&O(o.last_msg),!1===o.status?(s(o),setTimeout((function(){r.get(".wpstg-loader").show(),e()}),wpstg.delayReq)):!0===o.status&&"finished"!==o.status?(r.get("#wpstg-error-details").hide(),r.get("#wpstg-error-wrapper").hide(),s(o),e()):("finished"===o.status||void 0!==o.job_done&&o.job_done)&&(window.removeEventListener("beforeunload",h.warnIfClosingDuringProcess),function(e){!0===n.getLogs&&O();s(e),void 0!==e.last_msg&&O(e.last_msg);r.get(".wpstg-loader").hide(),r.get("#wpstg-processing-header").html("Processing Complete"),t("#wpstg-processing-status").text("Succesfully finished"),r.get("#wpstg_staging_name").html(n.data.cloneID),r.get("#wpstg-finished-result").show(),r.get("#wpstg-cancel-cloning").hide(),r.get("#wpstg-resume-cloning").hide(),r.get("#wpstg-cancel-cloning-update").prop("disabled",!0);var o=r.get("#wpstg-clone-url-1"),i=r.get("#wpstg-clone-url");o.attr("href",e.url),o.html(e.url),i.attr("href",e.url),r.get("#wpstg-remove-clone").data("clone",n.data.cloneID),n.isFinished=!0,n.timer("stop"),r.get(".wpstg-loader").hide(),r.get("#wpstg-processing-header").html("Processing Complete");var a=wpstg.i18n.cloneResetComplete;"wpstg_update"===n.data.action&&(a=wpstg.i18n.cloneUpdateComplete);"wpstg_update"!==n.data.action&&"wpstg_reset"!==n.data.action||(r.get("#wpstg-cancel-cloning-update").hide(),r.get(".wpstg-prev-step-link").show(),p.getSwalModal(!0,{confirmButton:"wpstg--btn--confirm wpstg-green-button wpstg-button wpstg-link-btn wpstg-100-width"}).fire({title:"",icon:"success",html:a,width:"500px",focusConfirm:!0}))}(o))}),"json",!1)},s=function(e,t){if(void 0===e.percentage)return!1;"database"===e.job&&(r.get("#wpstg-progress-db").width(.2*e.percentage+"%").html(e.percentage+"%"),r.get("#wpstg-processing-status").html(e.percentage.toFixed(0)+"% - Step 1 of 4 Cloning Database Tables...")),"SearchReplace"===e.job&&(r.get("#wpstg-progress-db").css("background-color","#3bc36b"),r.get("#wpstg-progress-db").html("1. Database"),r.get("#wpstg-progress-db").width("20%"),r.get("#wpstg-progress-sr").width(.1*e.percentage+"%").html(e.percentage+"%"),r.get("#wpstg-processing-status").html(e.percentage.toFixed(0)+"% - Step 2 of 4 Preparing Database Data...")),"directories"===e.job&&(r.get("#wpstg-progress-sr").css("background-color","#3bc36b"),r.get("#wpstg-progress-sr").html("2. Data"),r.get("#wpstg-progress-sr").width("10%"),r.get("#wpstg-progress-dirs").width(.1*e.percentage+"%").html(e.percentage+"%"),r.get("#wpstg-processing-status").html(e.percentage.toFixed(0)+"% - Step 3 of 4 Getting files...")),"files"===e.job&&(r.get("#wpstg-progress-dirs").css("background-color","#3bc36b"),r.get("#wpstg-progress-dirs").html("3. Files"),r.get("#wpstg-progress-dirs").width("10%"),r.get("#wpstg-progress-files").width(.6*e.percentage+"%").html(e.percentage+"%"),r.get("#wpstg-processing-status").html(e.percentage.toFixed(0)+"% - Step 4 of 4 Copy files...")),"finish"===e.job&&(r.get("#wpstg-progress-files").css("background-color","#3bc36b"),r.get("#wpstg-progress-files").html("4. Copy Files"),r.get("#wpstg-progress-files").width("60%"),r.get("#wpstg-processing-status").html(e.percentage.toFixed(0)+"% - Cloning Process Finished"))}}},n.switchStep=function(e){r.get(".wpstg-current-step").removeClass("wpstg-current-step"),r.get(".wpstg-step"+e).addClass("wpstg-current-step")},n.init=function(){var e,o,a;P(),o=r.get("#wpstg-workflow"),a=ajaxurl.replace("/admin-ajax.php","")+"/images/spinner",2<window.devicePixelRatio&&(a+="-2x"),s="<img src=''"+(a+=".gif")+"' alt='' class='ajax-spinner general-spinner' />",o.on("change","#wpstg_network_clone",(function(e){e.preventDefault(),t(".wpstg-button-select").trigger("click")})).on("click",".wpstg-button-unselect",(function(e){e.preventDefault(),!1===n.areAllTablesChecked?(r.get("#wpstg_select_tables_cloning .wpstg-db-table").prop("selected","selected"),r.get(".wpstg-button-unselect").text("Unselect All"),r.get(".wpstg-db-table-checkboxes").prop("checked",!0),n.areAllTablesChecked=!0):(r.get("#wpstg_select_tables_cloning .wpstg-db-table").prop("selected",!1),r.get(".wpstg-button-unselect").text("Select All"),r.get(".wpstg-db-table-checkboxes").prop("checked",!1),n.areAllTablesChecked=!1)})).on("click",".wpstg-button-select",(function(e){e.preventDefault(),t("#wpstg_select_tables_cloning .wpstg-db-table").each((function(){var e="^"+wpstg.tblprefix;"1"!==wpstg.isMultisite||t("#wpstg_network_clone").is(":checked")||(e+="([^0-9])_*"),t(this).attr("name").match(e)?t(this).prop("selected","selected"):t(this).prop("selected",!1)}))})).on("click",".wpstg-expand-dirs",(function(e){e.preventDefault(),t(this).siblings(".wpstg-subdir").slideToggle()})).on("change","input.wpstg-check-dir",(function(){var e=t(this).parent(".wpstg-dir");this.checked?(e.parents(".wpstg-dir").children(".wpstg-check-dir").prop("checked",!0),e.find(".wpstg-expand-dirs").removeClass("disabled"),e.find(".wpstg-subdir .wpstg-check-dir").prop("checked",!0)):(e.find(".wpstg-dir .wpstg-check-dir").prop("checked",!1),e.find(".wpstg-expand-dirs, .wpstg-check-subdirs").addClass("disabled"),e.find(".wpstg-check-subdirs").data("action","check").text("check"))})).on("change","href.wpstg-check-dir",(function(){var e=t(this).parent(".wpstg-dir");this.checked?(e.parents(".wpstg-dir").children(".wpstg-check-dir").prop("checked",!0),e.find(".wpstg-expand-dirs").removeClass("disabled"),e.find(".wpstg-subdir .wpstg-check-dir").prop("checked",!0)):(e.find(".wpstg-dir .wpstg-check-dir").prop("checked",!1),e.find(".wpstg-expand-dirs, .wpstg-check-subdirs").addClass("disabled"),e.find(".wpstg-check-subdirs").data("action","check").text("check"))})).on("keyup","#wpstg-new-clone-id",(function(){if(document.getElementById("wpstg-error-details").style.display="none","number"==typeof e&&clearInterval(e),void 0===this.value||""===this.value)return r.get("#wpstg-new-clone-id").removeClass("wpstg-error-input"),r.get("#wpstg-start-cloning").removeAttr("disabled"),void r.get("#wpstg-clone-id-error").text("").hide();var t=p.slugify(this.value);e=setTimeout((function(){b({action:"wpstg_check_clone",accessToken:wpstg.accessToken,nonce:wpstg.nonce,directoryName:t},(function(e){"success"===e.status?(r.get("#wpstg-new-clone-id").removeClass("wpstg-error-input"),r.get("#wpstg-start-cloning").removeAttr("disabled"),r.get("#wpstg-clone-id-error").text("").hide()):(r.get("#wpstg-new-clone-id").addClass("wpstg-error-input"),r.get("#wpstg-start-cloning").prop("disabled",!0),r.get("#wpstg-clone-id-error").text(e.message).show())}))}),500)})).on("click","#wpstg-start-cloning",(function(){f(),n.isCancelled=!1,n.getLogs=!1,n.progressBar=0})).on("input","#wpstg-new-clone-id",(function(){if(!(t("#wpstg-clone-directory").length<1)){var e=p.slugify(this.value).substring(0,16),s=t("#wpstg-use-target-dir"),n=t("#wpstg-use-target-hostname"),r=s.data("base-path"),o=n.data("base-uri");r&&(r=r.replace(/\/+$/g,"")+"/"+e+"/"),o&&(o=o.replace(/\/+$/g,"")+"/"+e),t(".wpstg-use-target-dir--value").text(r),t(".wpstg-use-target-hostname--value").text(o),s.attr("data-path",r),n.attr("data-uri",o),t("#wpstg_clone_dir").attr("placeholder",r),t("#wpstg_clone_hostname").attr("placeholder",o)}})).on("input","#wpstg_clone_hostname",(function(){""===t(this).val()||m()?t("#wpstg_clone_hostname_error").remove():m()||t("#wpstg_clone_hostname_error").length||t("#wpstg-clone-directory tr:last-of-type").after('<tr><td> </td><td><p id="wpstg_clone_hostname_error" style="color: red;"> Invalid host name. Please provide it in a format like http://example.com</p></td></tr>')})),v(),function(){var e=r.get("#wpstg-workflow");e.on("click",".wpstg-next-step-link",(function(s){s.preventDefault();var n=t(this);if(t("#wpstg_clone_hostname").length&&!m())return t("#wpstg_clone_hostname").focus(),!1;if("wpstg_update"===n.data("action")||"wpstg_reset"===n.data("action")){var r="";if("wpstg_update"===n.data("action")&&(r=" \n\nExclude all tables and folders you do not want to overwrite, first! \n\nDo not cancel the updating process! This can break your staging site. \n\nCreate a backup of your staging website before you proceed."),!confirm("STOP! This will overwrite your staging site with all selected data from the production site! This should be used only if you want to clone again your production site. Are you sure you want to do this?"+r))return!1}if(n.attr("disabled"))return!1;"wpstg_cloning"===n.data("action")&&t("#wpstg-ext-db").is(":checked")?k(n,e):S(n,e)})).on("click",".wpstg-prev-step-link",(function(e){e.preventDefault(),r.get(".wpstg-loader").removeClass("wpstg-finished"),r.get(".wpstg-loader").hide(),P()}))}(),r.get("#wpstg-workflow").on("click",".wpstg-tab-header",(function(e){e.preventDefault();var s=t(this),n=r.get(s.data("id"));s.toggleClass("expand"),n.slideToggle();var o=s.find(".wpstg-tab-triangle");s.hasClass("expand")?(o.removeClass("wpstg-no-icon"),o.text(""),o.addClass("wpstg-rotate-90")):o.removeClass("wpstg-rotate-90")})),p.listenTooltip(),new w,new i,new u,n.notyf=new Notyf({duration:1e4,position:{x:"center",y:"bottom"},dismissible:!0,types:[{type:"warning",background:"orange",icon:!1}]})},n.ajax=b,n.showError=o,n.getLogs=O,n.loadOverview=P,n}(jQuery);jQuery(document).ready((function(){h.init(),window.WPStaging=h})),jQuery(document).ready((function(e){function t(s,n){void 0===n&&(n="false");var r=s.next(),o=e(".wpstg--tab--active .wpstg-report-email").val(),i=e(".wpstg--tab--active .wpstg-report-hosting-provider").val(),a=e(".wpstg--tab--active .wpstg-report-description").val(),c=e(".wpstg--tab--active .wpstg-report-syslog").is(":checked"),l=e(".wpstg--tab--active .wpstg-report-terms").is(":checked");s.attr("disabled",!0),r.css("visibility","visible"),e.ajax({url:ajaxurl,type:"POST",dataType:"json",async:!0,data:{action:"wpstg_send_report",accessToken:wpstg.accessToken,nonce:wpstg.nonce,wpstg_email:o,wpstg_provider:i,wpstg_message:a,wpstg_syslog:+c,wpstg_terms:+l,wpstg_force_send:n}}).done((function(n){if(s.attr("disabled",!1),r.css("visibility","hidden"),n.errors.length>0){e(".wpstg--tab--active .wpstg-report-issue-form .wpstg-message").remove();var o=e("<div />").addClass("wpstg-message wpstg-error-message");e.each(n.errors,(function(e,n){"already_submitted"===n.status?(o="",p.getSwalModal(!0,{container:"wpstg-issue-resubmit-confirmation"}).fire({title:"",icon:"warning",html:n.message,showCancelButton:!0,focusConfirm:!1,confirmButtonText:"Yes",cancelButtonText:"No"}).then((function(e){e.isConfirmed&&t(s,"true")}))):o.append("<p>"+n+"</p>")})),e(".wpstg--tab--active .wpstg-report-issue-form").prepend(o)}else{var i=e("<div />").addClass("wpstg-message wpstg-success-message");i.append("<p>Thanks for submitting your request! You should receive an auto reply mail with your ticket ID immediately for confirmation!<br><br>If you do not get that mail please contact us directly at <strong>support@wp-staging.com</strong></p>"),e(".wpstg--tab--active .wpstg-report-issue-form").html(i),e(".wpstg--tab--active .wpstg-success-message").append('<div style="float:right;margin-top:10px;"><a id="wpstg-success-button" href="#" class="wpstg--red">[X] CLOSE</a></div>'),setTimeout((function(){e(".wpstg--tab--active .wpstg-report-issue-form").removeClass("wpstg-report-active")}),2e3)}}))}e("body").on("click","#wpstg-report-issue-button",(function(t){console.log("REPORT"),e(".wpstg--tab--active .wpstg-report-issue-form").toggleClass("wpstg-report-show"),t.preventDefault()})),e("body").on("click","#wpstg-backups-report-issue-button",(function(t){e(".wpstg--tab--active .wpstg-report-issue-form").toggleClass("wpstg-report-show"),t.preventDefault()})),e("body").on("click","#wpstg-report-cancel",(function(t){e(".wpstg--tab--active .wpstg-report-issue-form").removeClass("wpstg-report-show"),t.preventDefault()})),e("body").on("click",".wpstg--tab--active #wpstg-report-submit",(function(s){t(e(this),"false"),s.preventDefault()})),e("body").on("click","#wpstg-success-button",(function(t){t.preventDefault(),e(".wpstg-report-issue-form").removeClass("wpstg-report-show")})),e(document).on("click",".wpstg-dropdown>.wpstg-dropdown-toggler",(function(t){t.preventDefault(),e(t.target).next(".wpstg-dropdown-menu").toggleClass("shown"),e(t.target).find(".wpstg-caret").toggleClass("wpstg-caret-up")})),e(document).on("click",".wpstg-caret",(function(t){t.preventDefault();var s=e(t.target).closest(".wpstg-dropdown-toggler");s&&s.trigger("click")})),document.addEventListener("click",(function(t){if(!t.target.closest(".wpstg-dropdown-toggler")){for(var s=document.getElementsByClassName("wpstg-dropdown-menu"),n=0;n<s.length;n++)s[n].classList.remove("shown");e(".wpstg-caret").removeClass("wpstg-caret-up")}})),window.addEventListener("finishedProcessWithError",(function(t){e.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"wpstg_job_error",accessToken:wpstg.accessToken,nonce:wpstg.nonce,error_message:t.detail.error,job_id:p.getJobId()}})}))}))}();
|
2 |
//# sourceMappingURL=wpstg-admin.min.js.map
|
assets/js/dist/wpstg-admin.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"wpstg-admin.min.js","sources":["../src/modules/wpstg-dom-utils.js","../src/modules/wpstg-clone-staging.js","../src/modules/wpstg-directory-navigation.js","../src/modules/wpstg-exclude-filters.js","../src/modules/wpstg-modal.js","../src/modules/wpstg-hover-intent.js","../src/wpstg.js","../src/modules/wpstg-reset-modal.js","../src/modules/wpstg-cloning-advance-settings.js","../src/modules/wpstg-main-menu.js","../src/wpstg-admin.js"],"sourcesContent":["/**\n * WP STAGING basic jQuery replacement\n */\n\n/**\n * Shortcut for document.querySelector() or jQuery's $()\n * Return single element only\n */\nexport function qs(selector) {\n return document.querySelector(selector);\n}\n\n/**\n * Shortcut for document.querySelector() or jQuery's $()\n * Return collection of elements\n */\nexport function all(selector) {\n return document.querySelectorAll(selector);\n}\n\n/**\n * alternative of jQuery - $(parent).on(event, selector, handler)\n */\nexport function addEvent(parent, evt, selector, handler) {\n parent.addEventListener(evt, function(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n handler(event.target.closest(selector), event);\n }\n }, false);\n}\n\nexport function slideDown(element, duration = 400) {\n element.style.display = 'block';\n element.style.overflow = 'hidden';\n const height = element.offsetHeight;\n element.style.height = '0px';\n element.style.transitionProperty = 'height';\n element.style.transitionDuration = duration + 'ms';\n setTimeout(() => {\n element.style.height = height + 'px';\n window.setTimeout(() => {\n element.style.removeProperty('height');\n element.style.removeProperty('overflow');\n element.style.removeProperty('transition-duration');\n element.style.removeProperty('transition-property');\n }, duration);\n }, 0);\n}\n\nexport function slideUp(element, duration = 400) {\n element.style.display = 'block';\n element.style.overflow = 'hidden';\n const height = element.offsetHeight;\n element.style.height = height + 'px';\n element.style.transitionProperty = 'height';\n element.style.transitionDuration = duration + 'ms';\n setTimeout(() => {\n element.style.height = '0px';\n window.setTimeout(() => {\n element.style.display = 'none';\n element.style.removeProperty('height');\n element.style.removeProperty('overflow');\n element.style.removeProperty('transition-duration');\n element.style.removeProperty('transition-property');\n }, duration);\n }, 0);\n}\n\nexport function fadeOut(element, duration = 300) {\n element.style.opacity = 1;\n element.style.transitionProperty = 'opacity';\n element.style.transitionDuration = duration + 'ms';\n setTimeout(() => {\n element.style.opacity = 0;\n window.setTimeout(() => {\n element.style.display = 'none';\n element.style.removeProperty('opacity');\n element.style.removeProperty('transition-duration');\n element.style.removeProperty('transition-property');\n }, duration);\n }, 0);\n}\n\nexport function getNextSibling(element, selector) {\n let sibling = element.nextElementSibling;\n\n while (sibling) {\n if (sibling.matches(selector)) {\n return sibling;\n }\n\n sibling = sibling.nextElementSibling;\n }\n};\n\nexport function getParents(element, selector) {\n const result = [];\n for (let parent = element && element.parentElement; parent; parent = parent.parentElement) {\n if (parent.matches(selector)) {\n result.push(parent);\n }\n }\n\n return result;\n}\n\n/**\n * Check if element has class name\n * @param element\n * @param className\n * @return {boolean}\n */\nexport function hasClass(element, className) {\n return (' ' + element.className + ' ').indexOf(' ' + className+ ' ') > -1;\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Enable/Disable cloning for staging site\n */\nexport default class WpstgCloneStaging {\n constructor(\n pageWrapperId = '#wpstg-clonepage-wrapper',\n wpstgObject = wpstg,\n ) {\n this.pageWrapper = dom.qs(pageWrapperId);\n this.wpstgObject = wpstgObject;\n this.enableButtonId = '#wpstg-enable-staging-cloning';\n this.enableAction = 'wpstg_enable_staging_cloning';\n\n this.notyf = new Notyf({\n duration: 10000,\n position: {\n x: 'center',\n y: 'bottom',\n },\n dismissible: true,\n types: [\n {\n type: 'warning',\n background: 'orange',\n icon: false,\n },\n ],\n });\n this.init();\n }\n\n addEvents() {\n if (this.pageWrapper === null) {\n return;\n }\n\n dom.addEvent(this.pageWrapper, 'click', this.enableButtonId, () => {\n this.sendRequest(this.enableAction);\n });\n }\n\n init() {\n this.addEvents();\n }\n\n sendRequest(action) {\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams({\n action: action,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n }),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((data) => {\n // Reload current page if successful.\n if ('undefined' !== typeof (data.success) && data.success) {\n location.reload();\n return;\n }\n\n // There will be message probably in case of error\n if ('undefined' !== typeof (data.message)) {\n this.notyf.error(data.message);\n return;\n }\n\n this.notyf.error(this.wpstgObject.i18n['somethingWentWrong']);\n }).catch((error) => {\n console.warn(this.wpstgObject.i18n['somethingWentWrong'], error);\n });\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Fetch directory direct child directories\n */\nexport default class WpstgDirectoryNavigation {\n constructor(\n directoryListingSelector = '#wpstg-directories-listing',\n wpstgObject = wpstg,\n notyf = null,\n ) {\n this.directoryListingContainer = dom.qs(directoryListingSelector);\n this.wpstgObject = wpstgObject;\n this.dirCheckboxSelector = '.wpstg-check-dir';\n this.dirExpandSelector = '.wpstg-expand-dirs';\n this.unselectAllDirsSelector = '.wpstg-unselect-dirs';\n this.selectDefaultDirsSelector = '.wpstg-select-dirs-default';\n this.fetchChildrenAction = 'wpstg_fetch_dir_childrens';\n this.currentCheckboxElement = null;\n this.currentParentDiv = null;\n this.currentLoader = null;\n this.existingExcludes = [];\n this.excludedDirectories = [];\n this.isDefaultSelected = false;\n this.notyf = notyf;\n\n this.init();\n }\n\n addEvents() {\n if (this.directoryListingContainer === null) {\n console.log('Error: directory navigation add events');\n return;\n }\n\n dom.addEvent(this.directoryListingContainer, 'click', this.dirExpandSelector, (element, event) => {\n event.preventDefault();\n if (this.toggleDirExpand(element)) {\n this.sendRequest(this.fetchChildrenAction, element);\n }\n });\n\n dom.addEvent(this.directoryListingContainer, 'click', this.unselectAllDirsSelector, () => {\n this.unselectAll();\n });\n\n dom.addEvent(this.directoryListingContainer, 'click', this.selectDefaultDirsSelector, () => {\n this.selectDefault();\n });\n }\n\n init() {\n this.addEvents();\n this.parseExcludes();\n }\n\n /**\n * Toggle Dir Expand,\n * Return true if children aren't fetched\n * @param {HTMLElement} element\n * @return {boolean}\n */\n toggleDirExpand(element) {\n this.currentParentDiv = element.parentElement;\n this.currentCheckboxElement = element.previousSibling;\n this.currentLoader = this.currentParentDiv.querySelector('.wpstg-is-dir-loading');\n if (this.currentCheckboxElement.getAttribute('data-navigateable', 'false') === 'false') {\n return false;\n }\n\n if (this.currentCheckboxElement.getAttribute('data-scanned', 'false') === 'false') {\n return true;\n }\n\n return false;\n }\n\n sendRequest(action) {\n if (this.currentLoader !== null) {\n this.currentLoader.style.display = 'inline-block';\n }\n\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams({\n action: action,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n dirPath: this.currentCheckboxElement.value,\n isChecked: this.currentCheckboxElement.checked,\n forceDefault: this.isDefaultSelected,\n }),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((data) => {\n if ('undefined' !== typeof (data.success) && data.success) {\n this.currentCheckboxElement.setAttribute('data-scanned', true);\n const dirContainer = document.createElement('div');\n dirContainer.classList.add('wpstg-dir');\n dirContainer.classList.add('wpstg-subdir');\n dirContainer.innerHTML = JSON.parse(data.directoryListing);\n this.currentParentDiv.appendChild(dirContainer);\n if (this.currentLoader !== null) {\n this.currentLoader.style.display = 'none';\n }\n\n dom.slideDown(dirContainer);\n\n return;\n }\n\n if (this.notyf !== null) {\n this.notyf.error(this.wpstgObject.i18n['somethingWentWrong']);\n } else {\n alert('Error: ' + this.wpstgObject.i18n['somethingWentWrong']);\n }\n }).catch((error) => {\n console.warn(this.wpstgObject.i18n['somethingWentWrong'], error);\n });\n }\n\n getExcludedDirectories() {\n this.excludedDirectories = [];\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input:not(:checked)').forEach((element) => {\n if (!this.isParentExcluded(element.value)) {\n this.excludedDirectories.push(element.value);\n }\n });\n\n this.existingExcludes.forEach((exclude) => {\n if (!this.isParentExcluded(exclude) && !this.isExcludeScanned(exclude)) {\n this.excludedDirectories.push(exclude);\n }\n });\n\n return this.excludedDirectories.join(this.wpstgObject.settings.directorySeparator);\n }\n\n /**\n * @param {string} path\n * @return {bool}\n */\n isParentExcluded(path) {\n let isParentAlreadyExcluded = false;\n this.excludedDirectories.forEach((dir) => {\n if (path.startsWith(dir + '/')) {\n isParentAlreadyExcluded = true;\n }\n });\n\n return isParentAlreadyExcluded;\n }\n\n getExtraDirectoriesRootOnly() {\n this.getExcludedDirectories();\n const extraDirectories = [];\n this.directoryListingContainer.querySelectorAll(':not(.wpstg-subdir)>.wpstg-dir>input.wpstg-wp-non-core-dir:checked').forEach((element) => {\n extraDirectories.push(element.value);\n });\n\n // Check if extra directories text area exists\n // TODO: remove extraCustomDirectories code if no one require extraCustomDirectories...\n const extraDirectoriesTextArea = dom.qs('#wpstg_extraDirectories');\n if (extraDirectoriesTextArea === null || extraDirectoriesTextArea.value === '') {\n return extraDirectories.join(this.wpstgObject.settings.directorySeparator);\n }\n\n const extraCustomDirectories = extraDirectoriesTextArea.value.split(/\\r?\\n/);\n\n return extraDirectories.concat(extraCustomDirectories).join(this.wpstgObject.settings.directorySeparator);\n }\n\n unselectAll() {\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input').forEach((element) => {\n element.checked = false;\n });\n }\n\n selectDefault() {\n // unselect all checkboxes\n this.unselectAll();\n\n // only select those checkboxes whose class is wpstg-wp-core-dir\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input.wpstg-wp-core-dir').forEach((element) => {\n element.checked = true;\n });\n\n // then unselect those checkboxes whose parent has wpstg extra checkbox\n this.directoryListingContainer.querySelectorAll('.wpstg-dir > .wpstg-wp-non-core-dir').forEach((element) => {\n element.parentElement.querySelectorAll('input.wpstg-wp-core-dir').forEach((element) => {\n element.checked = false;\n });\n });\n\n this.isDefaultSelected = true;\n }\n\n parseExcludes() {\n this.existingExcludes = this.directoryListingContainer.getAttribute('data-existing-excludes', []);\n if (this.existingExcludes === '') {\n this.existingExcludes = [];\n }\n\n if (this.existingExcludes.length !== 0) {\n this.existingExcludes = this.existingExcludes.split(',');\n }\n }\n\n isExcludeScanned(exclude) {\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input').forEach((element) => {\n if (element.value === exclude) {\n return true;\n }\n });\n\n return false;\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Rich Exclude Filter Module\n */\nexport default class WpstgExcludeFilters {\n constructor(\n excludeFilterContainerSelector = '#wpstg-exclude-filters-container',\n wpstgObject = wpstg,\n ) {\n this.excludeContainer = dom.qs(excludeFilterContainerSelector);\n this.excludeTableBody = dom.qs(`${excludeFilterContainerSelector} tbody`);\n this.wpstgObject = wpstgObject;\n this.init();\n }\n\n addEvents() {\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-file-size-rule', () => {\n this.addFileSizeExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-file-ext-rule', () => {\n this.addFileExtExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-file-name-rule', () => {\n this.addFileNameExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-dir-name-rule', () => {\n this.addDirNameExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-clear-all-rules', () => {\n this.clearExcludes();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-remove-exclude-rule', (target) => {\n this.removeExclude(target);\n });\n }\n\n init() {\n if (this.excludeContainer === null) {\n console.log('Error: Given table selector not found!');\n return;\n }\n\n this.addEvents();\n }\n\n addFileSizeExclude() {\n this.addExcludeRuleRow('#wpstg-file-size-exclude-filter-template');\n }\n\n addFileExtExclude() {\n this.addExcludeRuleRow('#wpstg-file-ext-exclude-filter-template');\n }\n\n addFileNameExclude() {\n this.addExcludeRuleRow('#wpstg-file-name-exclude-filter-template');\n }\n\n addDirNameExclude() {\n this.addExcludeRuleRow('#wpstg-dir-name-exclude-filter-template');\n }\n\n addExcludeRuleRow(templateName) {\n const excludeRowTemplate = dom.qs(templateName);\n if (excludeRowTemplate !== null) {\n const clone = excludeRowTemplate.content.cloneNode(true);\n const excludeRow = clone.querySelector('tr');\n\n this.excludeTableBody.appendChild(excludeRow);\n dom.all('.wpstg-has-exclude-rules').forEach((e) => {\n e.style.display = 'inherit';\n });\n }\n }\n\n clearExcludes() {\n this.excludeTableBody.innerHTML = '';\n dom.all('.wpstg-has-exclude-rules').forEach((e) => {\n e.style.display = 'none';\n });\n }\n\n removeExclude(target) {\n if (target.parentElement !== null && target.parentElement.parentElement !== null) {\n this.excludeTableBody.removeChild(target.parentElement.parentElement);\n }\n\n if (this.excludeTableBody.innerHTML.trim() === '') {\n dom.all('.wpstg-has-exclude-rules').forEach((e) => {\n e.style.display = 'none';\n });\n }\n }\n\n /**\n * Converts all the exclude filters arrays into one single string to keep size of post request small\n * @return {string}\n */\n getExcludeFilters() {\n const globExcludes = [];\n const sizeExcludes = [];\n\n const sizeCompares = this.excludeTableBody.querySelectorAll('select[name=\"wpstgFileSizeExcludeRuleCompare[]\"]');\n const sizeSizes = this.excludeTableBody.querySelectorAll('input[name=\"wpstgFileSizeExcludeRuleSize[]\"]');\n const sizeByte = this.excludeTableBody.querySelectorAll('select[name=\"wpstgFileSizeExcludeRuleByte[]\"]');\n for (const [key, sizeInput] of Object.entries(sizeSizes)) {\n if (sizeInput.value !== '') {\n sizeExcludes.push(sizeCompares[key].value + ' ' + sizeInput.value + sizeByte[key].value);\n }\n }\n\n const extensionInputs = this.excludeTableBody.querySelectorAll('input[name=\"wpstgFileExtExcludeRule[]\"]');\n extensionInputs.forEach((x) => {\n const ext = this.cleanStringForGlob(x.value);\n if (ext !== '') {\n globExcludes.push('ext:' + ext.trim());\n }\n });\n\n const fileNamesPos = this.excludeTableBody.querySelectorAll('select[name=\"wpstgFileNameExcludeRulePos[]\"]');\n const fileNames = this.excludeTableBody.querySelectorAll('input[name=\"wpstgFileNameExcludeRulePath[]\"]');\n for (const [key, fileInput] of Object.entries(fileNames)) {\n const fileName = this.cleanStringForGlob(fileInput.value);\n if (fileName !== '') {\n globExcludes.push('file:' + fileNamesPos[key].value + ' ' + fileName.trim());\n }\n }\n\n const dirNamesPos = this.excludeTableBody.querySelectorAll('select[name=\"wpstgDirNameExcludeRulePos[]\"]');\n const dirNames = this.excludeTableBody.querySelectorAll('input[name=\"wpstgDirNameExcludeRulePath[]\"]');\n for (const [key, dirInput] of Object.entries(dirNames)) {\n const dirName = this.cleanStringForGlob(dirInput.value);\n if (dirName !== '') {\n globExcludes.push('dir:' + dirNamesPos[key].value + ' ' + dirName.trim());\n }\n }\n\n return {\n 'sizes': sizeExcludes.filter(this.onlyUnique).join(','),\n // return set of unique rules\n 'globs': globExcludes.filter(this.onlyUnique).join(','),\n };\n }\n\n onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }\n\n /**\n * Remove most of the comment glob characters from the string\n * @param {String} value\n * @return {String}\n */\n cleanStringForGlob(value) {\n // will replace character like * ^ / \\ ! ? [ from the string\n return value.replace(/[*^//!\\.[?]/g, '');\n }\n}\n","/**\n * Basic WP Staging Modal implemented with help of Sweetalerts\n */\nexport default class WpstgModal {\n constructor(\n confirmAction,\n wpstgObject = wpstg,\n ) {\n this.confirmAction = confirmAction;\n this.wpstgObject = wpstgObject;\n }\n\n show(swalOptions, additionalParams = {}, callback = null) {\n wpstgSwal.fire(swalOptions).then((result) => {\n if (result.value && this.error !== null) {\n this.triggerConfirmAction(additionalParams, callback);\n }\n });\n }\n\n triggerConfirmAction(additionalParams = {}, callback = null) {\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams(Object.assign({\n action: this.confirmAction,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n }, additionalParams)),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((response) => {\n if (callback !== null) {\n callback(response);\n }\n }).catch((error) => {\n console.log(this.wpstgObject.i18n['somethingWentWrong'], error);\n });\n }\n}\n","'use strict';\n\n/**\n * This is a namespaced port of https://github.com/tristen/hoverintent,\n * with slight modification to accept selector with dynamically added element in dom,\n * instead of just already present element.\n *\n * @param {HTMLElement} parent\n * @param {string} selector\n * @param {CallableFunction} onOver\n * @param {CallableFunction} onOut\n *\n * @return {object}\n */\nexport default function(parent, selector, onOver, onOut) {\n let x; let y; let pX; let pY;\n let mouseOver = false;\n let focused = false;\n const h = {};\n let state = 0;\n let timer = 0;\n\n let options = {\n sensitivity: 7,\n interval: 100,\n timeout: 0,\n handleFocus: false,\n };\n\n function delay(el, e) {\n if (timer) {\n timer = clearTimeout(timer);\n }\n\n state = 0;\n return focused ? undefined : onOut(el, e);\n }\n\n function tracker(e) {\n x = e.clientX;\n y = e.clientY;\n }\n\n function compare(el, e) {\n if (timer) timer = clearTimeout(timer);\n if ((Math.abs(pX - x) + Math.abs(pY - y)) < options.sensitivity) {\n state = 1;\n return focused ? undefined : onOver(el, e);\n } else {\n pX = x;\n pY = y;\n timer = setTimeout(function() {\n compare(el, e);\n }, options.interval);\n }\n }\n\n // Public methods\n h.options = function(opt) {\n const focusOptionChanged = opt.handleFocus !== options.handleFocus;\n options = Object.assign({}, options, opt);\n if (focusOptionChanged) {\n options.handleFocus ? addFocus() : removeFocus();\n }\n\n return h;\n };\n\n function dispatchOver(el, e) {\n mouseOver = true;\n if (timer) {\n timer = clearTimeout(timer);\n }\n\n el.removeEventListener('mousemove', tracker, false);\n\n if (state !== 1) {\n pX = e.clientX;\n pY = e.clientY;\n\n el.addEventListener('mousemove', tracker, false);\n\n timer = setTimeout(function() {\n compare(el, e);\n }, options.interval);\n }\n\n return this;\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchOver to support dynamically added elements to dom\n */\n function onMouseOver(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchOver(event.target.closest(selector), event);\n }\n };\n\n function dispatchOut(el, e) {\n mouseOver = false;\n if (timer) {\n timer = clearTimeout(timer);\n }\n\n el.removeEventListener('mousemove', tracker, false);\n\n if (state === 1) {\n timer = setTimeout(function() {\n delay(el, e);\n }, options.timeout);\n }\n\n return this;\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchOut to support dynamically added elements to dom\n */\n function onMouseOut(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchOut(event.target.closest(selector), event);\n }\n };\n\n function dispatchFocus(el, e) {\n if (!mouseOver) {\n focused = true;\n onOver(el, e);\n }\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchFocus to support dynamically added elements to dom\n */\n function onFocus(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchFocus(event.target.closest(selector), event);\n }\n };\n\n function dispatchBlur(el, e) {\n if (!mouseOver && focused) {\n focused = false;\n onOut(el, e);\n }\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchBlur to support dynamically added elements to dom\n */\n function onBlur(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchBlur(event.target.closest(selector), event);\n }\n };\n\n /**\n * Modified to support dynamically added element\n */\n function addFocus() {\n parent.addEventListener('focus', onFocus, false);\n parent.addEventListener('blur', onBlur, false);\n }\n\n /**\n * Modified to support dynamically added element\n */\n function removeFocus() {\n parent.removeEventListener('focus', onFocus, false);\n parent.removeEventListener('blur', onBlur, false);\n }\n\n /**\n * Modified to support dynamically added element\n */\n h.remove = function() {\n if (!parent) {\n return;\n }\n\n parent.removeEventListener('mouseover', onMouseOver, false);\n parent.removeEventListener('mouseout', onMouseOut, false);\n removeFocus();\n };\n\n /**\n * Modified to support dynamically added element\n */\n if (parent) {\n parent.addEventListener('mouseover', onMouseOver, false);\n parent.addEventListener('mouseout', onMouseOut, false);\n }\n\n return h;\n};\n","import wpstgHoverIntent from './modules/wpstg-hover-intent';\n\nexport default (function($) {\n const WPStagingCommon = {\n continueErrorHandle: true,\n cache: {\n elements: [],\n get: function(selector) {\n // It is already cached!\n if ($.inArray(selector, this.elements) !== -1) {\n return this.elements[selector];\n }\n\n // Create cache and return\n this.elements[selector] = $(selector);\n\n return this.elements[selector];\n },\n refresh: function(selector) {\n selector.elements[selector] = $(selector);\n },\n },\n setJobId: function(jobId) {\n localStorage.setItem('jobIdBeingProcessed', jobId);\n },\n getJobId: function() {\n return localStorage.getItem('jobIdBeingProcessed');\n },\n listenTooltip: function() {\n wpstgHoverIntent(document, '.wpstg--tooltip', function(target, event) {\n target.querySelector('.wpstg--tooltiptext').style.visibility = 'visible';\n }, function(target, event) {\n target.querySelector('.wpstg--tooltiptext').style.visibility = 'hidden';\n });\n },\n isEmpty: function(obj) {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n\n return true;\n },\n // Get the custom themed Swal Modal for WP Staging\n // Easy to maintain now in one place now\n getSwalModal: function(isContentCentered = false, customClasses = {}) {\n // common style for all swal modal used in WP Staging\n const defaultCustomClasses = {\n confirmButton: 'wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn wpstg-100-width',\n cancelButton: 'wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn wpstg-100-width',\n actions: 'wpstg--modal--actions',\n popup: isContentCentered ? 'wpstg-swal-popup centered-modal' : 'wpstg-swal-popup',\n };\n\n // If a attribute exists in both default and additional attributes,\n // The class(es) of the additional attribute will overrite the default one.\n const options = {\n customClass: Object.assign(defaultCustomClasses, customClasses),\n buttonsStyling: false,\n reverseButtons: true,\n showClass: {\n popup: 'wpstg--swal2-show wpstg-swal-show',\n },\n };\n\n return wpstgSwal.mixin(options);\n },\n showSuccessModal: function(htmlContent) {\n this.getSwalModal().fire({\n showConfirmButton: false,\n showCancelButton: true,\n cancelButtonText: 'OK',\n icon: 'success',\n title: 'Success!',\n html: '<div class=\"wpstg--grey\" style=\"text-align: left; margin-top: 8px;\">' + htmlContent + '</div>',\n });\n },\n showWarningModal: function(htmlContent) {\n this.getSwalModal().fire({\n showConfirmButton: false,\n showCancelButton: true,\n cancelButtonText: 'OK',\n icon: 'warning',\n title: '',\n html: '<div class=\"wpstg--grey\" style=\"text-align: left; margin-top: 8px;\">' + htmlContent + '</div>',\n });\n },\n showErrorModal: function(htmlContent) {\n this.getSwalModal().fire({\n showConfirmButton: false,\n showCancelButton: true,\n cancelButtonText: 'OK',\n icon: 'error',\n title: 'Error!',\n html: '<div class=\"wpstg--grey\" style=\"text-align: left; margin-top: 8px;\">' + htmlContent + '</div>',\n });\n },\n getSwalContainer: function() {\n return wpstgSwal.getContainer();\n },\n closeSwalModal: function() {\n wpstgSwal.close();\n },\n /**\n * Treats a default response object generated by WordPress's\n * wp_send_json_success() or wp_send_json_error() functions in\n * PHP, parses it in JavaScript, and either throws if it's an error,\n * or returns the data if the response is successful.\n *\n * @param {object} response\n * @return {*}\n */\n getDataFromWordPressResponse(response) {\n if (typeof response !== 'object') {\n throw new Error('Unexpected response (ERR 1341)');\n }\n\n if (!response.hasOwnProperty('success')) {\n throw new Error('Unexpected response (ERR 1342)');\n }\n\n if (!response.hasOwnProperty('data')) {\n throw new Error('Unexpected response (ERR 1343)');\n }\n\n if (response.success === false) {\n if (response.data instanceof Array && response.data.length > 0) {\n throw new Error(response.data.shift());\n } else {\n throw new Error('Response was not successful');\n }\n } else {\n // Successful response. Return the data.\n return response.data;\n }\n },\n isLoading: function(isLoading) {\n if (!isLoading || isLoading === false) {\n WPStagingCommon.cache.get('.wpstg-loader').hide();\n } else {\n WPStagingCommon.cache.get('.wpstg-loader').show();\n }\n },\n /**\n * Convert the given url to make it slug compatible\n * @param {string} url\n */\n slugify: function(url) {\n return url.toString()\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .replace(/\\s+/g, '-')\n .replace(/&/g, '-and-')\n .replace(/[^a-z0-9\\-]/g, '')\n .replace(/-+/g, '-')\n .replace(/^-*/, '')\n .replace(/-*$/, '')\n ;\n },\n showAjaxFatalError: function(response, prependMessage, appendMessage) {\n prependMessage = prependMessage ? prependMessage + '<br/><br/>' : 'Something went wrong! <br/><br/>';\n appendMessage = appendMessage ? appendMessage + '<br/><br/>' : '<br/><br/>Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.';\n\n if (response === false) {\n WPStagingCommon.showError(prependMessage + ' Error: No response.' + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n\n if (typeof response.error !== 'undefined' && response.error) {\n WPStagingCommon.showError(prependMessage + ' Error: ' + response.message + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n },\n handleFetchErrors: function(response) {\n if (!response.ok) {\n WPStagingCommon.showError('Error: ' + response.status + ' - ' + response.statusText + '. Please try again or contact support.');\n }\n return response;\n },\n showError: function(message) {\n WPStagingCommon.cache.get('#wpstg-try-again').css('display', 'inline-block');\n WPStagingCommon.cache.get('#wpstg-cancel-cloning').text('Reset');\n WPStagingCommon.cache.get('#wpstg-resume-cloning').show();\n WPStagingCommon.cache.get('#wpstg-error-wrapper').show();\n WPStagingCommon.cache.get('#wpstg-error-details').show().html(message);\n WPStagingCommon.cache.get('#wpstg-removing-clone').removeClass('loading');\n WPStagingCommon.cache.get('.wpstg-loader').hide();\n $('.wpstg--modal--process--generic-problem').show().html(message);\n },\n resetErrors: function() {\n WPStagingCommon.cache.get('#wpstg-error-details').hide().html('');\n },\n /**\n * Ajax Requests\n * @param {Object} data\n * @param {Function} callback\n * @param {string} dataType\n * @param {bool} showErrors\n * @param {int} tryCount\n * @param {float} incrementRatio\n * @param errorCallback\n */\n ajax: function(data, callback, dataType, showErrors, tryCount, incrementRatio = null, errorCallback = null) {\n if ('undefined' === typeof (dataType)) {\n dataType = 'json';\n }\n\n if (false !== showErrors) {\n showErrors = true;\n }\n\n tryCount = 'undefined' === typeof (tryCount) ? 0 : tryCount;\n\n const retryLimit = 10;\n\n let retryTimeout = 10000 * tryCount;\n\n incrementRatio = parseInt(incrementRatio);\n if (!isNaN(incrementRatio)) {\n retryTimeout *= incrementRatio;\n }\n\n $.ajax({\n url: ajaxurl + '?action=wpstg_processing&_=' + (Date.now() / 1000),\n type: 'POST',\n dataType: dataType,\n cache: false,\n data: data,\n error: function(xhr, textStatus, errorThrown) {\n console.log(xhr.status + ' ' + xhr.statusText + '---' + textStatus);\n\n if (typeof (errorCallback) === 'function') {\n // Custom error handler\n errorCallback(xhr, textStatus, errorThrown);\n\n if (!WPStagingCommon.continueErrorHandle) {\n // Reset state\n WPStagingCommon.continueErrorHandle = true;\n\n return;\n }\n }\n\n // Default error handler\n tryCount++;\n if (tryCount <= retryLimit) {\n setTimeout(function() {\n WPStagingCommon.ajax(data, callback, dataType, showErrors, tryCount, incrementRatio);\n return;\n }, retryTimeout);\n } else {\n const errorCode = 'undefined' === typeof (xhr.status) ? 'Unknown' : xhr.status;\n WPStagingCommon.showError(\n 'Fatal Error: ' + errorCode + ' Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.',\n );\n }\n },\n success: function(data) {\n if ('function' === typeof (callback)) {\n callback(data);\n }\n },\n statusCode: {\n 404: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 404 - Can\\'t find ajax request URL! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 500: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Fatal Error 500 - Internal server error while processing the request! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 504: function() {\n if (tryCount > retryLimit) {\n WPStagingCommon.showError('Error 504 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 502: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 502 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 503: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 503 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 429: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 429 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 403: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Refresh page or login again! The process should be finished successfully. \\n\\ ');\n }\n },\n },\n });\n },\n };\n\n return WPStagingCommon;\n})(jQuery);\n","\nimport * as dom from './wpstg-dom-utils.js';\nimport WpstgDirectoryNavigation from './wpstg-directory-navigation.js';\nimport WpstgExcludeFilters from './wpstg-exclude-filters.js';\nimport WpstgModal from './wpstg-modal.js';\nimport WPStagingCommon from './../wpstg.js';\n\n/**\n * Manage RESET MODAL\n */\nexport default class WpstgResetModal {\n constructor(\n cloneID,\n workflowSelector = '#wpstg-workflow',\n fetchExcludeSettingsAction = 'wpstg_clone_excludes_settings',\n modalErrorAction = 'wpstg_modal_error',\n wpstgObject = wpstg,\n ) {\n this.cloneID = cloneID;\n this.workflow = dom.qs(workflowSelector);\n this.wpstgObject = wpstgObject;\n this.fetchExcludeSettingsAction = fetchExcludeSettingsAction;\n this.modalErrorAction = modalErrorAction;\n this.resetButtonClass = 'wpstg-confirm-reset-clone';\n this.resetModalContainerClass = 'wpstg-reset-confirmation';\n this.resetTabSelector = '.wpstg-reset-exclude-tab';\n this.directoryNavigator = null;\n this.excludeFilters = null;\n this.isAllTablesChecked = true;\n }\n\n addEvents() {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n if (resetModalContainer === null) {\n console.log('Exit');\n return;\n }\n\n dom.addEvent(resetModalContainer, 'click', this.resetTabSelector, (target) => {\n this.toggleContent(target);\n });\n\n dom.addEvent(resetModalContainer, 'click', '.wpstg-button-select', () => {\n this.selectDefaultTables();\n });\n\n dom.addEvent(resetModalContainer, 'click', '.wpstg-button-unselect', () => {\n this.toggleTableSelection();\n });\n\n dom.addEvent(resetModalContainer, 'click', '.wpstg-expand-dirs', (target, event) => {\n event.preventDefault();\n this.toggleDirectoryNavigation(target);\n });\n\n dom.addEvent(resetModalContainer, 'change', 'input.wpstg-check-dir', (target) => {\n this.updateDirectorySelection(target);\n });\n }\n\n init() {\n this.addEvents();\n }\n\n toggleContent(target) {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n const contentId = target.getAttribute('data-id');\n const tabTriangle = target.querySelector('.wpstg-tab-triangle');\n const isCollapsed = target.getAttribute('data-collapsed', 'true');\n const content = dom.qs(contentId);\n if (isCollapsed === 'true') {\n if (resetModalContainer.classList.contains('has-collapsible-open')) {\n resetModalContainer.classList.add('has-collapsible-open-2');\n } else {\n resetModalContainer.classList.add('has-collapsible-open');\n }\n\n dom.slideDown(content);\n tabTriangle.style.transform = 'rotate(90deg)';\n target.setAttribute('data-collapsed', 'false');\n } else {\n if (resetModalContainer.classList.contains('has-collapsible-open-2')) {\n resetModalContainer.classList.remove('has-collapsible-open-2');\n } else {\n resetModalContainer.classList.remove('has-collapsible-open');\n }\n\n dom.slideUp(content);\n tabTriangle.style.removeProperty('transform');\n target.setAttribute('data-collapsed', 'true');\n }\n }\n\n /**\n * Show Swal alert with loader and send ajax request to fetch content of alert.\n * @return Promise\n */\n showModal() {\n const swalPromise = this.loadModal();\n this.init();\n this.fetchCloneExcludes();\n return swalPromise;\n }\n\n loadModal() {\n return WPStagingCommon.getSwalModal(false, {\n confirmButton: this.resetButtonClass + ' wpstg-confirm-reset-clone wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn',\n container: this.resetModalContainerClass + ' wpstg-swal2-container wpstg-swal2-loading',\n }).fire({\n title: '',\n icon: 'warning',\n html: this.getAjaxLoader(),\n width: '400px',\n focusConfirm: false,\n confirmButtonText: this.wpstgObject.i18n.resetClone,\n showCancelButton: true,\n });\n }\n\n fetchCloneExcludes() {\n this.error = null;\n // send ajax request and fetch preserved exclude settings\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams({\n action: this.fetchExcludeSettingsAction,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n clone: this.cloneID,\n job: 'resetting',\n }),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((data) => {\n if (!data.success) {\n const errorModal = new WpstgModal(this.modalErrorAction, this.wpstgObject);\n errorModal.show(Object.assign({\n title: 'Error',\n icon: 'error',\n html: this.wpstgObject.i18n['somethingWentWrong'],\n width: '500px',\n confirmButtonText: 'Ok',\n showCancelButton: false,\n customClass: {\n confirmButton: 'wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn',\n cancelButton: 'wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn',\n actions: 'wpstg--modal--actions',\n popup: 'wpstg-swal-popup centered-modal',\n },\n buttonsStyling: false,\n reverseButtons: true,\n }, data.swalOptions), {\n type: data.type,\n });\n\n return;\n }\n\n const modal = dom.qs('.wpstg-reset-confirmation');\n modal.classList.remove('wpstg-swal2-loading');\n modal.querySelector('.wpstg--swal2-popup').style.width = '500px';\n modal.querySelector('.wpstg--swal2-content').innerHTML = data.html;\n this.directoryNavigator = new WpstgDirectoryNavigation();\n this.excludeFilters = new WpstgExcludeFilters();\n }).catch((error) => {\n this.renderError({\n 'html': this.wpstgObject.i18n['somethingWentWrong'] + ' ' + error,\n });\n });\n }\n\n getDirectoryNavigator() {\n return this.directoryNavigator;\n }\n\n getExcludeFilters() {\n return this.excludeFilters;\n }\n\n getAjaxLoader() {\n return '<div class=\"wpstg-swal2-ajax-loader\"><img src=\"' + this.wpstgObject.wpstgIcon + '\" /></div>';\n }\n\n toggleDirectoryNavigation(element) {\n const cbElement = element.previousSibling;\n if (cbElement.getAttribute('data-navigateable', 'false') === 'false') {\n return;\n }\n\n if (cbElement.getAttribute('data-scanned', 'false') === 'false') {\n return;\n }\n\n const subDirectories = dom.getNextSibling(element, '.wpstg-subdir');\n\n if (subDirectories.style.display === 'none') {\n dom.slideDown(subDirectories);\n } else {\n dom.slideUp(subDirectories);\n }\n }\n\n updateDirectorySelection(element) {\n const parent = element.parentElement;\n if (element.checked) {\n dom.getParents(parent, '.wpstg-dir').forEach((parElem) => {\n for (let i = 0; i < parElem.children.length; i++) {\n if (parElem.children[i].matches('.wpstg-check-dir')) {\n parElem.children[i].checked = true;\n }\n }\n });\n parent.querySelectorAll('.wpstg-expand-dirs').forEach((x) => {\n x.classList.remove('disabled');\n });\n parent.querySelectorAll('.wpstg-subdir .wpstg-check-dir').forEach((x) => {\n x.checked = true;\n });\n } else {\n parent.querySelectorAll('.wpstg-expand-dirs, .wpstg-check-subdirs').forEach((x) => {\n x.classList.add('disabled');\n });\n parent.querySelectorAll('.wpstg-dir .wpstg-check-dir').forEach((x) => {\n x.checked = false;\n });\n }\n }\n\n selectDefaultTables() {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n const options = resetModalContainer.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table');\n const multisitePattern = '^' + this.wpstgObject.tblprefix + '([^0-9])_*';\n const singleSitePattern = '^' + this.wpstgObject.tblprefix;\n options.forEach((option) => {\n const name = option.getAttribute('name', '');\n if (this.wpstgObject.isMultisite === '1' && name.match(multisitePattern)) {\n option.setAttribute('selected', 'selected');\n } else if (this.wpstgObject.isMultisite === '' && name.match(singleSitePattern)) {\n option.setAttribute('selected', 'selected');\n } else {\n option.removeAttribute('selected');\n }\n });\n }\n\n toggleTableSelection() {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n if (false === this.isAllTablesChecked) {\n resetModalContainer.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach((option) => {\n option.setAttribute('selected', 'selected');\n });\n resetModalContainer.querySelector('.wpstg-button-unselect').innerHTML = 'Unselect All';\n // cache.get('.wpstg-db-table-checkboxes').prop('checked', true);\n this.isAllTablesChecked = true;\n } else {\n resetModalContainer.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach((option) => {\n option.removeAttribute('selected');\n });\n resetModalContainer.querySelector('.wpstg-button-unselect').innerHTML = 'Select All';\n // cache.get('.wpstg-db-table-checkboxes').prop('checked', false);\n this.isAllTablesChecked = false;\n }\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Handle toggle of advance settings checkboxes\n */\nexport default class WpstgCloningAdvanceSettings {\n constructor(\n baseContainerSelector = '#wpstg-clonepage-wrapper',\n ) {\n this.baseContainer = dom.qs(baseContainerSelector);\n this.checkBoxSettingTogglerSelector = '.wpstg-toggle-advance-settings-section';\n this.init();\n }\n\n /**\n * Add events\n * @return {void}\n */\n addEvents() {\n if (this.baseContainer === null) {\n return;\n }\n\n dom.addEvent(this.baseContainer, 'change', this.checkBoxSettingTogglerSelector, (element) => {\n this.toggleSettings(element);\n });\n }\n\n /**\n * @return {void}\n */\n init() {\n this.addEvents();\n }\n\n /**\n * Expand/Collapse checkbox content on change\n * @return {void}\n */\n toggleSettings(element) {\n const target = dom.qs('#' + element.getAttribute('data-id'));\n if (element.checked) {\n dom.slideDown(target);\n } else {\n dom.slideUp(target);\n }\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\nexport default class WpstgMainMenu {\n constructor() {\n this.activeTabClass = 'wpstg--tab--active';\n this.mainMenu();\n }\n\n mainMenu() {\n const tabHeader = dom.qs('.wpstg--tab--header');\n // Early bail if tab header is not available\n if (tabHeader === null) {\n return;\n }\n\n dom.addEvent(dom.qs('.wpstg--tab--header'), 'click', '.wpstg-button', (element) => {\n const $this = element;\n const target = $this.getAttribute('data-target');\n const targetElements = dom.all(target);\n const menuItems = dom.all('.wpstg--tab--header a[data-target]');\n const contents = dom.all('.wpstg--tab--contents > .wpstg--tab--content');\n\n contents.forEach((content) => {\n // active tab class is without the css dot class prefix\n if (content.matches('.' + this.activeTabClass + ':not(' + target + ')')) {\n content.classList.remove(this.activeTabClass);\n }\n });\n\n menuItems.forEach((menuItem) => {\n if (menuItem !== $this) {\n menuItem.classList.remove(this.activeTabClass);\n }\n });\n\n $this.classList.add(this.activeTabClass);\n\n targetElements.forEach((targetElement) => {\n targetElement.classList.add(this.activeTabClass);\n });\n\n if ('#wpstg--tab--backup' === target) {\n window.dispatchEvent(new Event('backups-tab'));\n }\n });\n };\n}\n","import WpstgCloneStaging from './modules/wpstg-clone-staging.js';\nimport WpstgDirectoryNavigation from './modules/wpstg-directory-navigation.js';\nimport WpstgExcludeFilters from './modules/wpstg-exclude-filters.js';\nimport WpstgResetModal from './modules/wpstg-reset-modal.js';\nimport WpstgModal from './modules/wpstg-modal.js';\nimport WpstgCloningAdvanceSettings from './modules/wpstg-cloning-advance-settings.js';\nimport WpstgMainMenu from './modules/wpstg-main-menu.js';\nimport WPStagingCommon from './wpstg.js';\n\nvar WPStaging = (function($) {\n const that = {\n isCancelled: false,\n isFinished: false,\n getLogs: false,\n time: 1,\n executionTime: false,\n progressBar: 0,\n cloneExcludeFilters: null,\n directoryNavigator: null,\n notyf: null,\n areAllTablesChecked: true,\n };\n const cache = {elements: []};\n let timeout; let ajaxSpinner;\n\n /**\n * Get / Set Cache for Selector\n * @param {String} selector\n * @return {*}\n */\n cache.get = function(selector) {\n // It is already cached!\n if ($.inArray(selector, cache.elements) !== -1) {\n return cache.elements[selector];\n }\n\n // Create cache and return\n cache.elements[selector] = jQuery(selector);\n\n return cache.elements[selector];\n };\n\n /**\n * Refreshes given cache\n * @param {String} selector\n */\n cache.refresh = function(selector) {\n selector.elements[selector] = jQuery(selector);\n };\n\n /**\n * Show and Log Error Message\n * @param {String} message\n */\n const showError = function(message) {\n cache.get('#wpstg-try-again').css('display', 'inline-block');\n cache.get('#wpstg-cancel-cloning').text('Reset');\n cache.get('#wpstg-resume-cloning').show();\n cache.get('#wpstg-error-wrapper').show();\n cache.get('#wpstg-error-details').show().html(message);\n cache.get('#wpstg-removing-clone').removeClass('loading');\n cache.get('.wpstg-loader').hide();\n $('.wpstg--modal--process--generic-problem').show().html(message);\n\n // Error event information for Staging\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n dataType: 'json',\n data: {\n 'action': 'wpstg_staging_job_error',\n 'accessToken': wpstg.accessToken,\n 'nonce': wpstg.nonce,\n 'error_message': message,\n },\n });\n };\n\n /**\n * Show warning during cloning or push process when closing tab or browser, or changing page\n * @param {beforeunload} event\n * @return {null}\n */\n that.warnIfClosingDuringProcess = function(event) {\n // Only some browsers show the message below, most say something like \"Changes you made may not be saved\" (Chrome) or \"You have unsaved changes. Exit?\"\n event.returnValue = 'You MUST leave this window open while cloning/pushing. Please wait...';\n return null;\n };\n\n /**\n *\n * @param response the error object\n * @param prependMessage Overwrite default error message at beginning\n * @param appendMessage Overwrite default error message at end\n * @returns void\n */\n\n const showAjaxFatalError = function(response, prependMessage, appendMessage) {\n prependMessage = prependMessage ? prependMessage + '<br/><br/>' : 'Something went wrong! <br/><br/>';\n appendMessage = appendMessage ? appendMessage + '<br/><br/>' : '<br/><br/>Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.';\n\n if (response === false) {\n showError(prependMessage + ' Error: No response.' + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n\n if (typeof response.error !== 'undefined' && response.error) {\n console.error(response.message);\n showError(prependMessage + ' Error: ' + response.message + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n };\n\n /**\n *\n * @param response\n * @return {{ok}|*}\n */\n const handleFetchErrors = function(response) {\n if (!response.ok) {\n showError('Error: ' + response.status + ' - ' + response.statusText + '. Please try again or contact support.');\n }\n return response;\n };\n\n /** Hide and reset previous thrown visible errors */\n const resetErrors = function() {\n cache.get('#wpstg-error-details').hide().html('');\n };\n\n /**\n * Common Elements\n */\n const elements = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n let urlSpinner = ajaxurl.replace('/admin-ajax.php', '') + '/images/spinner';\n let timer;\n\n if (2 < window.devicePixelRatio) {\n urlSpinner += '-2x';\n }\n\n urlSpinner += '.gif';\n\n ajaxSpinner = '<img src=\\'\\'' + urlSpinner + '\\' alt=\\'\\' class=\\'ajax-spinner general-spinner\\' />';\n\n const getBaseValues = function() {\n const path = $('#wpstg-use-target-dir').data('base-path');\n const uri = $('#wpstg-use-target-hostname').data('base-uri');\n return {\n path,\n };\n };\n\n $workFlow\n .on('change', '#wpstg_network_clone', function(e) {\n e.preventDefault();\n $('.wpstg-button-select').trigger('click');\n })\n // Check / Un-check All Database Tables New\n .on('click', '.wpstg-button-unselect', function(e) {\n e.preventDefault();\n\n if (false === that.areAllTablesChecked) {\n cache.get('#wpstg_select_tables_cloning .wpstg-db-table').prop('selected', 'selected');\n cache.get('.wpstg-button-unselect').text('Unselect All');\n cache.get('.wpstg-db-table-checkboxes').prop('checked', true);\n that.areAllTablesChecked = true;\n } else {\n cache.get('#wpstg_select_tables_cloning .wpstg-db-table').prop('selected', false);\n cache.get('.wpstg-button-unselect').text('Select All');\n cache.get('.wpstg-db-table-checkboxes').prop('checked', false);\n that.areAllTablesChecked = false;\n }\n })\n\n /**\n * Select tables with certain tbl prefix | NEW\n * @param obj e\n * @returns {undefined}\n */\n .on('click', '.wpstg-button-select', function(e) {\n e.preventDefault();\n $('#wpstg_select_tables_cloning .wpstg-db-table').each(function() {\n let regex = '^' + wpstg.tblprefix;\n if (wpstg.isMultisite === '1' && !$('#wpstg_network_clone').is(':checked')) {\n regex += '([^0-9])_*';\n }\n\n if ($(this).attr('name').match(regex)) {\n $(this).prop('selected', 'selected');\n } else {\n $(this).prop('selected', false);\n }\n });\n })\n // Expand Directories\n .on('click', '.wpstg-expand-dirs', function(e) {\n e.preventDefault();\n\n const $this = $(this);\n\n $this.siblings('.wpstg-subdir').slideToggle();\n })\n // When a directory checkbox is Selected\n .on('change', 'input.wpstg-check-dir', function() {\n const $directory = $(this).parent('.wpstg-dir');\n\n if (this.checked) {\n $directory.parents('.wpstg-dir').children('.wpstg-check-dir').prop('checked', true);\n $directory.find('.wpstg-expand-dirs').removeClass('disabled');\n $directory.find('.wpstg-subdir .wpstg-check-dir').prop('checked', true);\n } else {\n $directory.find('.wpstg-dir .wpstg-check-dir').prop('checked', false);\n $directory.find('.wpstg-expand-dirs, .wpstg-check-subdirs').addClass('disabled');\n $directory.find('.wpstg-check-subdirs').data('action', 'check').text('check');\n }\n })\n // When a directory name is Selected\n .on('change', 'href.wpstg-check-dir', function() {\n const $directory = $(this).parent('.wpstg-dir');\n\n if (this.checked) {\n $directory.parents('.wpstg-dir').children('.wpstg-check-dir').prop('checked', true);\n $directory.find('.wpstg-expand-dirs').removeClass('disabled');\n $directory.find('.wpstg-subdir .wpstg-check-dir').prop('checked', true);\n } else {\n $directory.find('.wpstg-dir .wpstg-check-dir').prop('checked', false);\n $directory.find('.wpstg-expand-dirs, .wpstg-check-subdirs').addClass('disabled');\n $directory.find('.wpstg-check-subdirs').data('action', 'check').text('check');\n }\n })\n // Check the max length of the clone name and if the clone name already exists\n .on('keyup', '#wpstg-new-clone-id', function() {\n // Hide previous errors\n document.getElementById('wpstg-error-details').style.display = 'none';\n\n // This request was already sent, clear it up!\n if ('number' === typeof (timer)) {\n clearInterval(timer);\n }\n\n // Early bail if site name is empty\n if (this.value === undefined || this.value === '') {\n cache.get('#wpstg-new-clone-id').removeClass('wpstg-error-input');\n cache.get('#wpstg-start-cloning').removeAttr('disabled');\n cache.get('#wpstg-clone-id-error').text('').hide();\n return;\n }\n\n // Convert the site name to directory name (slugify the site name to create directory name)\n const cloneDirectoryName = WPStagingCommon.slugify(this.value);\n\n timer = setTimeout(\n function() {\n ajax(\n {\n action: 'wpstg_check_clone',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n directoryName: cloneDirectoryName,\n },\n function(response) {\n if (response.status === 'success') {\n cache.get('#wpstg-new-clone-id').removeClass('wpstg-error-input');\n cache.get('#wpstg-start-cloning').removeAttr('disabled');\n cache.get('#wpstg-clone-id-error').text('').hide();\n } else {\n cache.get('#wpstg-new-clone-id').addClass('wpstg-error-input');\n cache.get('#wpstg-start-cloning').prop('disabled', true);\n cache.get('#wpstg-clone-id-error').text(response.message).show();\n }\n },\n );\n },\n 500,\n );\n })\n // Restart cloning process\n .on('click', '#wpstg-start-cloning', function() {\n resetErrors();\n that.isCancelled = false;\n that.getLogs = false;\n that.progressBar = 0;\n })\n .on('input', '#wpstg-new-clone-id', function() {\n if ($('#wpstg-clone-directory').length < 1) {\n return;\n }\n\n const slug = WPStagingCommon.slugify(this.value);\n const $targetDir = $('#wpstg-use-target-dir');\n const $targetUri = $('#wpstg-use-target-hostname');\n let path = $targetDir.data('base-path');\n let uri = $targetUri.data('base-uri');\n\n if (path) {\n path = path.replace(/\\/+$/g, '') + '/' + slug + '/';\n }\n\n if (uri) {\n uri = uri.replace(/\\/+$/g, '') + '/' + slug;\n }\n\n\n $('.wpstg-use-target-dir--value').text(path);\n $('.wpstg-use-target-hostname--value').text(uri);\n\n $targetDir.attr('data-path', path);\n $targetUri.attr('data-uri', uri);\n $('#wpstg_clone_dir').attr('placeholder', path);\n $('#wpstg_clone_hostname').attr('placeholder', uri);\n })\n .on('input', '#wpstg_clone_hostname', function() {\n if ($(this).val() === '' || validateTargetHost()) {\n $('#wpstg_clone_hostname_error').remove();\n return;\n }\n if (!validateTargetHost() && !$('#wpstg_clone_hostname_error').length) {\n $('#wpstg-clone-directory tr:last-of-type').after('<tr><td> </td><td><p id=\"wpstg_clone_hostname_error\" style=\"color: red;\"> Invalid host name. Please provide it in a format like http://example.com</p></td></tr>');\n }\n })\n ;\n\n cloneActions();\n };\n\n /* @returns {boolean} */\n var validateTargetHost = function() {\n const the_domain = $('#wpstg_clone_hostname').val();\n\n if (the_domain === '') {\n return true;\n }\n\n const reg = /^http(s)?:\\/\\/.*$/;\n if (reg.test(the_domain) === false) {\n return false;\n }\n return true;\n };\n\n /**\n * Clone actions\n */\n var cloneActions = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n\n $workFlow\n // Cancel cloning\n .on('click', '#wpstg-cancel-cloning', function() {\n if (!confirm('Are you sure you want to cancel cloning process?')) {\n return false;\n }\n\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n $this.prop('disabled', true);\n\n that.isCancelled = true;\n that.progressBar = 0;\n\n $('#wpstg-processing-status').text('Please wait...this can take up a while.');\n $('.wpstg-loader, #wpstg-show-log-button').hide();\n\n $this.parent().append(ajaxSpinner);\n\n cancelCloning();\n })\n // Resume cloning\n .on('click', '#wpstg-resume-cloning', function() {\n resetErrors();\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n\n that.isCancelled = false;\n\n $('#wpstg-processing-status').text('Try to resume cloning process...');\n $('#wpstg-error-details').hide();\n $('.wpstg-loader').show();\n\n $this.parent().append(ajaxSpinner);\n\n that.startCloning();\n })\n // Cancel update cloning\n .on('click', '#wpstg-cancel-cloning-update', function() {\n resetErrors();\n\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n $this.prop('disabled', true);\n\n that.isCancelled = true;\n\n $('#wpstg-cloning-result').text('Please wait...this can take up a while.');\n $('.wpstg-loader, #wpstg-show-log-button').hide();\n\n $this.parent().append(ajaxSpinner);\n\n cancelCloningUpdate();\n })\n // Restart cloning\n .on('click', '#wpstg-restart-cloning', function() {\n resetErrors();\n\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n $this.prop('disabled', true);\n\n that.isCancelled = true;\n\n $('#wpstg-cloning-result').text('Please wait...this can take up a while.');\n $('.wpstg-loader, #wpstg-show-log-button').hide();\n\n $this.parent().append(ajaxSpinner);\n\n restart();\n })\n // Delete clone - confirmation\n .on('click', '.wpstg-remove-clone[data-clone]', function(e) {\n resetErrors();\n e.preventDefault();\n\n const $existingClones = cache.get('#wpstg-existing-clones');\n\n $workFlow.removeClass('active');\n\n cache.get('.wpstg-loader').show();\n\n ajax(\n {\n action: 'wpstg_confirm_delete_clone',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n clone: $(this).data('clone'),\n },\n function(response) {\n cache.get('#wpstg-removing-clone').html(response);\n\n $existingClones.children('img').remove();\n\n cache.get('.wpstg-loader').hide();\n\n $('html, body').animate({\n // This logic is meant to be a \"scrollBottom\"\n scrollTop: $('#wpstg-remove-clone').offset().top - $(window).height() +\n $('#wpstg-remove-clone').height() + 50,\n }, 100);\n },\n 'HTML',\n );\n })\n // Delete clone - confirmed\n .on('click', '#wpstg-remove-clone', function(e) {\n resetErrors();\n e.preventDefault();\n\n cache.get('#wpstg-removing-clone').addClass('loading');\n\n cache.get('.wpstg-loader').show();\n\n deleteClone($(this).data('clone'));\n })\n // Cancel deleting clone\n .on('click', '#wpstg-cancel-removing', function(e) {\n e.preventDefault();\n $('.wpstg-clone').removeClass('active');\n cache.get('#wpstg-removing-clone').html('');\n })\n // Update\n .on('click', '.wpstg-execute-clone', function(e) {\n e.preventDefault();\n\n const clone = $(this).data('clone');\n\n $workFlow.addClass('loading');\n that.cloneExcludeFilters = null;\n ajax(\n {\n action: 'wpstg_scanning',\n clone: clone,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response.length < 1) {\n showError(\n 'Something went wrong! Error: No response. Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.',\n );\n }\n\n const jsonResponse = tryParseJson(response);\n if (jsonResponse !== false && jsonResponse.success === false) {\n $workFlow.removeClass('loading');\n showErrorModal(jsonResponse);\n\n return;\n }\n\n $workFlow.removeClass('loading').html(response);\n // register check disk space function for clone update process.\n checkDiskSpace();\n that.directoryNavigator = new WpstgDirectoryNavigation('#wpstg-directories-listing', wpstg, that.notyf);\n that.cloneExcludeFilters = new WpstgExcludeFilters();\n that.switchStep(2);\n },\n 'HTML',\n );\n })\n // Reset Clone\n .on('click', '.wpstg-reset-clone', function(e) {\n e.preventDefault();\n const clone = $(this).data('clone');\n const resetModal = new WpstgResetModal(clone);\n const promise = resetModal.showModal();\n that.areAllTablesChecked = true;\n\n promise.then((result) => {\n if (result.value) {\n const dirNavigator = resetModal.getDirectoryNavigator();\n const exclFilters = resetModal.getExcludeFilters().getExcludeFilters();\n resetClone(clone, {\n includedTables: getIncludedTables(),\n excludeSizeRules: encodeURIComponent(exclFilters.sizes),\n excludeGlobRules: encodeURIComponent(exclFilters.globs),\n excludedDirectories: dirNavigator.getExcludedDirectories(),\n extraDirectories: dirNavigator.getExtraDirectoriesRootOnly(),\n });\n }\n });\n\n return;\n });\n };\n\n /**\n * Ajax Requests\n * @param Object data\n * @param Function callback\n * @param string dataType\n * @param bool showErrors\n * @param int tryCount\n * @param float incrementRatio\n */\n var ajax = function(data, callback, dataType, showErrors, tryCount, incrementRatio = null) {\n if ('undefined' === typeof (dataType)) {\n dataType = 'json';\n }\n\n if (false !== showErrors) {\n showErrors = true;\n }\n\n tryCount = 'undefined' === typeof (tryCount) ? 0 : tryCount;\n\n const retryLimit = 5;\n\n let retryTimeout = 10000 * tryCount;\n\n incrementRatio = parseInt(incrementRatio);\n if (!isNaN(incrementRatio)) {\n retryTimeout *= incrementRatio;\n }\n\n $.ajax({\n url: ajaxurl + '?action=wpstg_processing&_=' + (Date.now() / 1000),\n type: 'POST',\n dataType: dataType,\n cache: false,\n data: data,\n error: function(xhr, textStatus, errorThrown) {\n // try again after 10 seconds\n tryCount++;\n if (tryCount <= retryLimit) {\n console.log('RETRYING ' + tryCount + '/' + retryLimit);\n setTimeout(function() {\n ajax(data, callback, dataType, showErrors, tryCount, incrementRatio);\n return;\n }, retryTimeout);\n } else {\n console.log('RETRYING LIMIT');\n const errorCode = 'undefined' === typeof (xhr.status) ? 'Unknown' : xhr.status;\n showError(\n 'Fatal Error: ' + errorCode + ' Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.',\n );\n }\n },\n success: function(data) {\n if ('function' === typeof (callback)) {\n callback(data);\n }\n },\n statusCode: {\n 404: function() {\n if (tryCount >= retryLimit) {\n showError('Error 404 - Can\\'t find ajax request URL! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 500: function() {\n if (tryCount >= retryLimit) {\n showError('Fatal Error 500 - Internal server error while processing the request! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 504: function() {\n if (tryCount > retryLimit) {\n showError('Error 504 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 502: function() {\n if (tryCount >= retryLimit) {\n showError('Error 502 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 503: function() {\n if (tryCount >= retryLimit) {\n showError('Error 503 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 429: function() {\n if (tryCount >= retryLimit) {\n showError('Error 429 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 403: function() {\n if (tryCount >= retryLimit) {\n showError('Refresh page or login again! The process should be finished successfully. \\n\\ ');\n }\n },\n },\n });\n };\n\n /**\n * Next / Previous Step Clicks to Navigate Through Staging Job\n */\n const stepButtons = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n\n $workFlow\n // Next Button\n .on('click', '.wpstg-next-step-link', function(e) {\n e.preventDefault();\n\n const $this = $(this);\n const isScan = false;\n\n if ($('#wpstg_clone_hostname').length && !validateTargetHost()) {\n $('#wpstg_clone_hostname').focus();\n return false;\n }\n\n if ($this.data('action') === 'wpstg_update' || $this.data('action') === 'wpstg_reset') {\n // Update / Reset Clone - confirmed\n let onlyUpdateMessage = '';\n if ($this.data('action') === 'wpstg_update') {\n onlyUpdateMessage = ' \\n\\nExclude all tables and folders you do not want to overwrite, first! \\n\\nDo not cancel the updating process! This can break your staging site. \\n\\n\\Create a backup of your staging website before you proceed.';\n }\n\n if (!confirm('STOP! This will overwrite your staging site with all selected data from the production site! This should be used only if you want to clone again your production site. Are you sure you want to do this?' + onlyUpdateMessage)) {\n return false;\n }\n }\n\n // Button is disabled\n if ($this.attr('disabled')) {\n return false;\n }\n\n if ($this.data('action') === 'wpstg_cloning') {\n // Verify External Database If Checked and Not Skipped\n if ($('#wpstg-ext-db').is(':checked')) {\n verifyExternalDatabase($this, $workFlow);\n return;\n }\n }\n\n proceedCloning($this, $workFlow);\n })\n // Previous Button\n .on('click', '.wpstg-prev-step-link', function(e) {\n e.preventDefault();\n cache.get('.wpstg-loader').removeClass('wpstg-finished');\n cache.get('.wpstg-loader').hide();\n loadOverview();\n });\n };\n\n /**\n * Get Included (Checked) Database Tables\n * @return {Array}\n */\n const getIncludedTables = function() {\n const includedTables = [];\n\n $('#wpstg_select_tables_cloning option:selected').each(function() {\n includedTables.push(this.value);\n });\n\n return includedTables;\n };\n\n /**\n * Get Excluded (Unchecked) Database Tables\n * Not used anymore!\n * @return {Array}\n */\n const getExcludedTables = function() {\n const excludedTables = [];\n\n $('.wpstg-db-table input:not(:checked)').each(function() {\n excludedTables.push(this.name);\n });\n\n return excludedTables;\n };\n\n /**\n * Verify External Database for Cloning\n */\n var verifyExternalDatabase = function($this, workflow) {\n cache.get('.wpstg-loader').show();\n ajax(\n {\n action: 'wpstg_database_verification',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n databaseUser: cache.get('#wpstg_db_username').val(),\n databasePassword: cache.get('#wpstg_db_password').val(),\n databaseServer: cache.get('#wpstg_db_server').val(),\n databaseDatabase: cache.get('#wpstg_db_database').val(),\n },\n function(response) {\n // Undefined Error\n if (false === response) {\n showError(\n 'Something went wrong! Error: No response.' +\n 'Please try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n cache.get('.wpstg-loader').hide();\n return;\n }\n\n // Throw Error\n if ('undefined' === typeof (response.success)) {\n showError(\n 'Something went wrong! Error: Invalid response.' +\n 'Please try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n cache.get('.wpstg-loader').hide();\n return;\n }\n\n if (response.success) {\n cache.get('.wpstg-loader').hide();\n proceedCloning($this, workflow);\n return;\n }\n\n if (response.error_type === 'comparison') {\n cache.get('.wpstg-loader').hide();\n let render = '<table class=\"wpstg-db-comparison-table\"><thead><tr><th>Property</th><th>Production DB</th><th>Staging DB</th><th>Status</th></tr></thead><tbody>';\n response.checks.forEach((x) => {\n let icon = '<span class=\"wpstg-css-tick\"></span>';\n if (x.production !== x.staging) {\n icon = '<span class=\"wpstg-css-cross\"></span>';\n }\n render += '<tr><td>' + x.name + '</td><td>' + x.production + '</td><td>' + x.staging + '</td><td>' + icon + '</td></tr>';\n });\n render += '</tbody></table><p>Note: Some MySQL/MariaDB properties do not match. You may proceed but the staging site may not work as expected.</p>';\n WPStagingCommon.getSwalModal(true, {\n popup: 'wpstg-swal-popup wpstg-db-comparison-modal centered-modal',\n }).fire({\n title: 'Different Database Properties',\n icon: 'warning',\n html: render,\n width: '650px',\n focusConfirm: false,\n confirmButtonText: 'Proceed',\n showCancelButton: true,\n }).then(function(result) {\n if (result.value) {\n proceedCloning($this, workflow);\n }\n });\n return;\n }\n\n WPStagingCommon.getSwalModal(true).fire({\n title: 'Different Database Properties',\n icon: 'error',\n html: response.message,\n focusConfirm: true,\n confirmButtonText: 'Ok',\n showCancelButton: false,\n });\n cache.get('.wpstg-loader').hide();\n },\n 'json',\n false,\n );\n };\n\n /**\n * Get Cloning Step Data\n */\n const getCloningData = function() {\n if ('wpstg_cloning' !== that.data.action && 'wpstg_update' !== that.data.action && 'wpstg_reset' !== that.data.action) {\n return;\n }\n\n that.data.cloneID = new Date().getTime().toString();\n if ('wpstg_update' === that.data.action) {\n that.data.cloneID = $('#wpstg-new-clone-id').data('clone');\n }\n\n that.data.cloneName = $('#wpstg-new-clone-id').val() || that.data.cloneID;\n\n // Remove this to keep &_POST[] small otherwise mod_security will throw error 404\n // that.data.excludedTables = getExcludedTables();\n\n if (that.directoryNavigator !== null) {\n that.data.excludedDirectories = encodeURIComponent(that.directoryNavigator.getExcludedDirectories());\n that.data.extraDirectories = encodeURIComponent(that.directoryNavigator.getExtraDirectoriesRootOnly());\n }\n\n that.data.excludeGlobRules = '';\n that.data.excludeSizeRules = '';\n if (that.cloneExcludeFilters instanceof WpstgExcludeFilters) {\n const rules = that.cloneExcludeFilters.getExcludeFilters();\n that.data.excludeGlobRules = encodeURIComponent(rules.globs);\n that.data.excludeSizeRules = encodeURIComponent(rules.sizes);\n }\n\n that.data.includedTables = getIncludedTables();\n that.data.databaseServer = $('#wpstg_db_server').val();\n that.data.databaseUser = $('#wpstg_db_username').val();\n that.data.databasePassword = $('#wpstg_db_password').val();\n that.data.databaseDatabase = $('#wpstg_db_database').val();\n that.data.databasePrefix = $('#wpstg_db_prefix').val();\n const cloneDir = $('#wpstg_clone_dir').val();\n that.data.cloneDir = encodeURIComponent($.trim(cloneDir));\n that.data.cloneHostname = $('#wpstg_clone_hostname').val();\n that.data.emailsAllowed = $('#wpstg_allow_emails').is(':checked');\n that.data.networkClone = $('#wpstg_network_clone').is(':checked');\n that.data.uploadsSymlinked = $('#wpstg_symlink_upload').is(':checked');\n that.data.cleanPluginsThemes = $('#wpstg-clean-plugins-themes').is(':checked');\n that.data.cleanUploadsDir = $('#wpstg-clean-uploads').is(':checked');\n };\n\n var proceedCloning = function($this, workflow) {\n // Add loading overlay\n workflow.addClass('loading');\n\n // Prepare data\n that.data = {\n action: $this.data('action'),\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n };\n\n // Cloning data\n getCloningData();\n\n sendCloningAjax(workflow);\n };\n\n var sendCloningAjax = function(workflow) {\n // Send ajax request\n ajax(\n that.data,\n function(response) {\n // Undefined Error\n if (false === response) {\n showError(\n 'Something went wrong!<br/><br/> Go to WP Staging > Settings and lower \\'File Copy Limit\\' and \\'DB Query Limit\\'. Also set \\'CPU Load Priority to low \\'' +\n 'and try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n }\n\n\n if (response.length < 1) {\n showError(\n 'Something went wrong! No response. Go to WP Staging > Settings and lower \\'File Copy Limit\\' and \\'DB Query Limit\\'. Also set \\'CPU Load Priority to low \\'' +\n 'and try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n }\n\n const jsonResponse = tryParseJson(response);\n if (jsonResponse !== false && jsonResponse.success === false) {\n workflow.removeClass('loading');\n showErrorModal(jsonResponse);\n\n return;\n }\n\n // Styling of elements\n workflow.removeClass('loading').html(response);\n that.cloneExcludeFilters = null;\n if (that.data.action === 'wpstg_scanning') {\n that.areAllTablesChecked = true;\n that.directoryNavigator = new WpstgDirectoryNavigation('#wpstg-directories-listing', wpstg, that.notyf);\n that.switchStep(2);\n that.cloneExcludeFilters = new WpstgExcludeFilters();\n } else if (that.data.action === 'wpstg_cloning' || that.data.action === 'wpstg_update' || that.data.action === 'wpstg_reset') {\n that.switchStep(3);\n }\n\n // Start cloning\n that.startCloning();\n },\n 'HTML',\n );\n };\n\n var showErrorModal = function(response) {\n const errorModal = new WpstgModal('wpstg_modal_error', wpstg);\n errorModal.show(Object.assign({\n title: 'Error',\n icon: 'error',\n html: wpstg.i18n['somethingWentWrong'],\n width: '500px',\n confirmButtonText: 'Ok',\n showCancelButton: false,\n customClass: {\n confirmButton: 'wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn',\n cancelButton: 'wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn',\n actions: 'wpstg--modal--actions',\n popup: 'wpstg-swal-popup centered-modal',\n },\n buttonsStyling: false,\n reverseButtons: true,\n }, response.swalOptions), {\n type: response.type,\n });\n };\n\n const tryParseJson = function(json) {\n // early bail if not string\n if (!json) {\n return false;\n }\n\n try {\n const object = JSON.parse(json);\n if (object && typeof object === 'object') {\n return object;\n }\n } catch (e) {\n // do nothing on catch\n }\n\n return false;\n };\n\n var resetClone = function(clone, excludeOptions) {\n that.data = {\n action: 'wpstg_reset',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n cloneID: clone,\n };\n\n that.data = {...that.data, ...excludeOptions};\n\n const $workFlow = cache.get('#wpstg-workflow');\n sendCloningAjax($workFlow);\n };\n\n /**\n * Loads Overview (first step) of Staging Job\n */\n var loadOverview = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n\n $workFlow.addClass('loading');\n\n ajax(\n {\n action: 'wpstg_overview',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response.length < 1) {\n showError(\n 'Something went wrong! No response. Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report.',\n );\n }\n\n const $currentStep = cache.get('.wpstg-current-step');\n\n // Styling of elements\n $workFlow.removeClass('loading').html(response);\n },\n 'HTML',\n );\n\n that.switchStep(1);\n cache.get('.wpstg-step3-cloning').show();\n cache.get('.wpstg-step3-pushing').hide();\n };\n\n /**\n * Load Tabs\n */\n const tabs = function() {\n cache.get('#wpstg-workflow').on('click', '.wpstg-tab-header', function(e) {\n e.preventDefault();\n\n const $this = $(this);\n const $section = cache.get($this.data('id'));\n\n $this.toggleClass('expand');\n\n $section.slideToggle();\n\n const tabTriangle = $this.find('.wpstg-tab-triangle');\n\n if ($this.hasClass('expand')) {\n tabTriangle.removeClass('wpstg-no-icon');\n tabTriangle.text('');\n tabTriangle.addClass('wpstg-rotate-90');\n } else {\n tabTriangle.removeClass('wpstg-rotate-90');\n }\n });\n };\n\n /**\n * Delete Clone\n * @param {String} clone\n */\n var deleteClone = function(clone) {\n const deleteDir = $('#deleteDirectory:checked').data('deletepath');\n\n ajax(\n {\n action: 'wpstg_delete_clone',\n clone: clone,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n excludedTables: getExcludedTables(),\n deleteDir: deleteDir,\n },\n function(response) {\n if (response) {\n showAjaxFatalError(response);\n\n // Finished\n if ('undefined' !== typeof response.delete && (response.delete === 'finished' || response.delete === 'unfinished')) {\n cache.get('#wpstg-removing-clone').removeClass('loading').html('');\n\n if (response.delete === 'finished' && response.error === undefined) {\n $('.wpstg-clone[data-clone-id=\"' + clone + '\"]').remove();\n }\n\n // No staging site message is also of type/class .wpstg-class but hidden\n // We have just excluded that from search when counting no of clones\n if ($('#wpstg-existing-clones .wpstg-clone').length < 1) {\n cache.get('#wpstg-existing-clones').find('h3').text('');\n cache.get('#wpstg-no-staging-site-results').show();\n }\n\n cache.get('.wpstg-loader').hide();\n return;\n }\n }\n // continue\n if (true !== response) {\n deleteClone(clone);\n return;\n }\n },\n );\n };\n\n /**\n * Cancel Cloning Process\n */\n var cancelCloning = function() {\n that.timer('stop');\n\n\n if (true === that.isFinished) {\n return true;\n }\n\n ajax(\n {\n action: 'wpstg_cancel_clone',\n clone: that.data.cloneID,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response && 'undefined' !== typeof (response.delete) && response.delete === 'finished') {\n cache.get('.wpstg-loader').hide();\n // Load overview\n loadOverview();\n return;\n }\n\n if (true !== response) {\n // continue\n cancelCloning();\n return;\n }\n\n // Load overview\n loadOverview();\n },\n );\n };\n\n /**\n * Cancel Cloning Process\n */\n var cancelCloningUpdate = function() {\n if (true === that.isFinished) {\n return true;\n }\n\n ajax(\n {\n action: 'wpstg_cancel_update',\n clone: that.data.cloneID,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response && 'undefined' !== typeof (response.delete) && response.delete === 'finished') {\n // Load overview\n loadOverview();\n return;\n }\n\n if (true !== response) {\n // continue\n cancelCloningUpdate();\n return;\n }\n\n // Load overview\n loadOverview();\n },\n );\n };\n\n /**\n * Cancel Cloning Process\n */\n var restart = function() {\n if (true === that.isFinished) {\n return true;\n }\n\n ajax(\n {\n action: 'wpstg_restart',\n // clone: that.data.cloneID,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response && 'undefined' !== typeof (response.delete) && response.delete === 'finished') {\n // Load overview\n loadOverview();\n return;\n }\n\n if (true !== response) {\n // continue\n cancelCloningUpdate();\n return;\n }\n\n // Load overview\n loadOverview();\n },\n );\n };\n\n /**\n * Scroll the window log to bottom\n * @return void\n */\n const logscroll = function() {\n const $div = cache.get('.wpstg-log-details');\n if ('undefined' !== typeof ($div[0])) {\n $div.scrollTop($div[0].scrollHeight);\n }\n };\n\n /**\n * Append the log to the logging window\n * @param string log\n * @return void\n */\n const getLogs = function(log) {\n if (log != null && 'undefined' !== typeof (log)) {\n if (log.constructor === Array) {\n $.each(log, function(index, value) {\n if (value === null) {\n return;\n }\n if (value.type === 'ERROR') {\n cache.get('.wpstg-log-details').append('<span class=\"wpstg--red\">[' + value.type + ']</span>-' + '[' + value.date + '] ' + value.message + '</br>');\n } else {\n cache.get('.wpstg-log-details').append('[' + value.type + ']-' + '[' + value.date + '] ' + value.message + '</br>');\n }\n });\n } else {\n cache.get('.wpstg-log-details').append('[' + log.type + ']-' + '[' + log.date + '] ' + log.message + '</br>');\n }\n }\n logscroll();\n };\n\n /**\n * Check diskspace\n * @return string json\n */\n var checkDiskSpace = function() {\n cache.get('#wpstg-check-space').on('click', function(e) {\n cache.get('.wpstg-loader').show();\n const excludedDirectories = encodeURIComponent(that.directoryNavigator.getExcludedDirectories());\n const extraDirectories = encodeURIComponent(that.directoryNavigator.getExtraDirectoriesRootOnly());\n\n ajax(\n {\n action: 'wpstg_check_disk_space',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n excludedDirectories: excludedDirectories,\n extraDirectories: extraDirectories,\n },\n function(response) {\n if (false === response) {\n cache.get('#wpstg-clone-id-error').text('Can not detect required disk space').show();\n cache.get('.wpstg-loader').hide();\n return;\n }\n\n // Show required disk space\n cache.get('#wpstg-clone-id-error').html(\n 'Estimated necessary disk space: ' + response.requiredSpace +\n (response.errorMessage !== null ? ('<br>' + response.errorMessage) : '') +\n '<br> <span style=\"color:#444;\">Before you proceed ensure your account has enough free disk space to hold the entire instance of the production site. You can check the available space from your hosting account (cPanel or similar).</span>').show();\n cache.get('.wpstg-loader').hide();\n },\n 'json',\n false,\n );\n });\n };\n\n /**\n * Show or hide animated loading icon\n * @param isLoading bool\n */\n const isLoading = function(isLoading) {\n if (!isLoading || isLoading === false) {\n cache.get('.wpstg-loader').hide();\n } else {\n cache.get('.wpstg-loader').show();\n }\n };\n\n /**\n * Count up processing execution time\n * @param string status\n * @return html\n */\n that.timer = function(status) {\n if (status === 'stop') {\n const time = that.time;\n that.time = 1;\n clearInterval(that.executionTime);\n return that.convertSeconds(time);\n }\n\n\n that.executionTime = setInterval(function() {\n if (null !== document.getElementById('wpstg-processing-timer')) {\n document.getElementById('wpstg-processing-timer').innerHTML = 'Elapsed Time: ' + that.convertSeconds(that.time);\n }\n that.time++;\n if (status === 'stop') {\n that.time = 1;\n clearInterval(that.executionTime);\n }\n }, 1000);\n };\n\n /**\n * Convert seconds to hourly format\n * @param int seconds\n * @return string\n */\n that.convertSeconds = function(seconds) {\n const date = new Date(null);\n date.setSeconds(seconds); // specify value for SECONDS here\n return date.toISOString().substr(11, 8);\n };\n\n /**\n * Start Cloning Process\n * @type {Function}\n */\n that.startCloning = (function() {\n resetErrors();\n\n // Register function for checking disk space\n checkDiskSpace();\n\n if ('wpstg_cloning' !== that.data.action && 'wpstg_update' !== that.data.action && 'wpstg_reset' !== that.data.action) {\n return;\n }\n\n that.isCancelled = false;\n\n // Start the process\n start();\n\n // Functions\n // Start\n function start() {\n cache.get('.wpstg-loader').show();\n cache.get('#wpstg-cancel-cloning').text('Cancel');\n cache.get('#wpstg-resume-cloning').hide();\n cache.get('#wpstg-error-details').hide();\n\n\n // Clone Database\n setTimeout(function() {\n // cloneDatabase();\n window.addEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n processing();\n }, wpstg.delayReq);\n\n that.timer('start');\n }\n\n\n /**\n * Start ajax processing\n * @return string\n */\n var processing = function() {\n if (true === that.isCancelled) {\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return false;\n }\n\n isLoading(true);\n\n let excludedDirectories = '';\n let extraDirectories = '';\n if (that.directoryNavigator !== null) {\n excludedDirectories = that.directoryNavigator.getExcludedDirectories();\n extraDirectories = that.directoryNavigator.getExtraDirectoriesRootOnly();\n }\n\n // Show logging window\n cache.get('.wpstg-log-details').show();\n\n WPStaging.ajax(\n {\n action: 'wpstg_processing',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n excludedTables: getExcludedTables(),\n excludedDirectories: encodeURIComponent(excludedDirectories),\n extraDirectories: encodeURIComponent(extraDirectories),\n },\n function(response) {\n showAjaxFatalError(response);\n\n // Add Log messages\n if ('undefined' !== typeof (response.last_msg) && response.last_msg) {\n getLogs(response.last_msg);\n }\n // Continue processing\n if (false === response.status) {\n progressBar(response);\n\n setTimeout(function() {\n cache.get('.wpstg-loader').show();\n processing();\n }, wpstg.delayReq);\n } else if (true === response.status && 'finished' !== response.status) {\n cache.get('#wpstg-error-details').hide();\n cache.get('#wpstg-error-wrapper').hide();\n progressBar(response, true);\n processing();\n } else if ('finished' === response.status || ('undefined' !== typeof (response.job_done) && response.job_done)) {\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n finish(response);\n }\n ;\n },\n 'json',\n false,\n );\n };\n\n // Finish\n function finish(response) {\n if (true === that.getLogs) {\n getLogs();\n }\n\n progressBar(response);\n\n // Add Log\n if ('undefined' !== typeof (response.last_msg)) {\n getLogs(response.last_msg);\n }\n\n cache.get('.wpstg-loader').hide();\n cache.get('#wpstg-processing-header').html('Processing Complete');\n $('#wpstg-processing-status').text('Succesfully finished');\n\n cache.get('#wpstg_staging_name').html(that.data.cloneID);\n cache.get('#wpstg-finished-result').show();\n cache.get('#wpstg-cancel-cloning').hide();\n cache.get('#wpstg-resume-cloning').hide();\n cache.get('#wpstg-cancel-cloning-update').prop('disabled', true);\n\n const $link1 = cache.get('#wpstg-clone-url-1');\n const $link = cache.get('#wpstg-clone-url');\n $link1.attr('href', response.url);\n $link1.html(response.url);\n $link.attr('href', response.url);\n\n cache.get('#wpstg-remove-clone').data('clone', that.data.cloneID);\n\n // Finished\n that.isFinished = true;\n that.timer('stop');\n\n\n cache.get('.wpstg-loader').hide();\n cache.get('#wpstg-processing-header').html('Processing Complete');\n\n // show alert\n let msg = wpstg.i18n.cloneResetComplete;\n if (that.data.action === 'wpstg_update') {\n msg = wpstg.i18n.cloneUpdateComplete;\n }\n\n if (that.data.action === 'wpstg_update' || that.data.action === 'wpstg_reset') {\n cache.get('#wpstg-cancel-cloning-update').hide();\n cache.get('.wpstg-prev-step-link').show();\n\n WPStagingCommon.getSwalModal(true, {\n confirmButton: 'wpstg--btn--confirm wpstg-green-button wpstg-button wpstg-link-btn wpstg-100-width',\n }).fire({\n title: '',\n icon: 'success',\n html: msg,\n width: '500px',\n focusConfirm: true,\n });\n }\n\n return false;\n }\n\n /**\n * Add percentage progress bar\n * @param object response\n * @return {Boolean}\n */\n var progressBar = function(response, restart) {\n if ('undefined' === typeof (response.percentage)) {\n return false;\n }\n\n if (response.job === 'database') {\n cache.get('#wpstg-progress-db').width(response.percentage * 0.2 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 1 of 4 Cloning Database Tables...');\n }\n\n if (response.job === 'SearchReplace') {\n cache.get('#wpstg-progress-db').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-db').html('1. Database');\n // Assumption: All previous steps are done.\n // This avoids bugs where some steps are skipped and the progress bar is incomplete as a result\n cache.get('#wpstg-progress-db').width('20%');\n\n cache.get('#wpstg-progress-sr').width(response.percentage * 0.1 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 2 of 4 Preparing Database Data...');\n }\n\n if (response.job === 'directories') {\n cache.get('#wpstg-progress-sr').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-sr').html('2. Data');\n cache.get('#wpstg-progress-sr').width('10%');\n\n cache.get('#wpstg-progress-dirs').width(response.percentage * 0.1 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 3 of 4 Getting files...');\n }\n if (response.job === 'files') {\n cache.get('#wpstg-progress-dirs').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-dirs').html('3. Files');\n cache.get('#wpstg-progress-dirs').width('10%');\n\n cache.get('#wpstg-progress-files').width(response.percentage * 0.6 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 4 of 4 Copy files...');\n }\n if (response.job === 'finish') {\n cache.get('#wpstg-progress-files').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-files').html('4. Copy Files');\n cache.get('#wpstg-progress-files').width('60%');\n\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Cloning Process Finished');\n }\n };\n });\n\n that.switchStep = function(step) {\n cache.get('.wpstg-current-step')\n .removeClass('wpstg-current-step');\n cache.get('.wpstg-step' + step)\n .addClass('wpstg-current-step');\n };\n\n /**\n * Initiation\n * @type {Function}\n */\n that.init = (function() {\n loadOverview();\n elements();\n stepButtons();\n tabs();\n WPStagingCommon.listenTooltip();\n new WpstgMainMenu();\n new WpstgCloneStaging();\n new WpstgCloningAdvanceSettings();\n that.notyf = new Notyf({\n duration: 10000,\n position: {\n x: 'center',\n y: 'bottom',\n },\n dismissible: true,\n types: [\n {\n type: 'warning',\n background: 'orange',\n icon: false,\n },\n ],\n });\n });\n\n /**\n * Ajax call\n * @type {ajax}\n */\n that.ajax = ajax;\n that.showError = showError;\n that.getLogs = getLogs;\n that.loadOverview = loadOverview;\n\n return that;\n})(jQuery);\n\njQuery(document).ready(function() {\n WPStaging.init();\n // This is necessary to make WPStaging var accessibile in WP Staging PRO js script\n window.WPStaging = WPStaging;\n});\n\n/**\n * Report Issue modal\n */\njQuery(document).ready(function($) {\n $('body').on('click', '#wpstg-report-issue-button', function(e) {\n console.log('REPORT');\n $('.wpstg--tab--active .wpstg-report-issue-form').toggleClass('wpstg-report-show');\n e.preventDefault();\n });\n\n $('body').on('click', '#wpstg-backups-report-issue-button', function(e) {\n $('.wpstg--tab--active .wpstg-report-issue-form').toggleClass('wpstg-report-show');\n e.preventDefault();\n });\n\n $('body').on('click', '#wpstg-report-cancel', function(e) {\n $('.wpstg--tab--active .wpstg-report-issue-form').removeClass('wpstg-report-show');\n e.preventDefault();\n });\n\n $('body').on('click', '.wpstg--tab--active #wpstg-report-submit', function(e) {\n const self = $(this);\n sendIssueReport(self, 'false');\n e.preventDefault();\n });\n\n /*\n * Close Success Modal\n */\n\n $('body').on('click', '#wpstg-success-button', function(e) {\n e.preventDefault();\n $('.wpstg-report-issue-form').removeClass('wpstg-report-show');\n });\n\n function sendIssueReport(button, forceSend = 'false') {\n const spinner = button.next();\n const email = $('.wpstg--tab--active .wpstg-report-email').val();\n const hosting_provider = $('.wpstg--tab--active .wpstg-report-hosting-provider').val();\n const message = $('.wpstg--tab--active .wpstg-report-description').val();\n const syslog = $('.wpstg--tab--active .wpstg-report-syslog').is(':checked');\n const terms = $('.wpstg--tab--active .wpstg-report-terms').is(':checked');\n\n button.attr('disabled', true);\n spinner.css('visibility', 'visible');\n\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n dataType: 'json',\n async: true,\n data: {\n 'action': 'wpstg_send_report',\n 'accessToken': wpstg.accessToken,\n 'nonce': wpstg.nonce,\n 'wpstg_email': email,\n 'wpstg_provider': hosting_provider,\n 'wpstg_message': message,\n 'wpstg_syslog': +syslog,\n 'wpstg_terms': +terms,\n 'wpstg_force_send': forceSend,\n },\n }).done(function(data) {\n button.attr('disabled', false);\n spinner.css('visibility', 'hidden');\n\n if (data.errors.length > 0) {\n $('.wpstg--tab--active .wpstg-report-issue-form .wpstg-message').remove();\n\n let errorMessage = $('<div />').addClass('wpstg-message wpstg-error-message');\n $.each(data.errors, function(key, value) {\n if (value.status === 'already_submitted') {\n errorMessage = '';\n // TODO: remove default custom classes\n WPStagingCommon.getSwalModal(true, {\n container: 'wpstg-issue-resubmit-confirmation',\n }).fire({\n title: '',\n icon: 'warning',\n html: value.message,\n showCancelButton: true,\n focusConfirm: false,\n confirmButtonText: 'Yes',\n cancelButtonText: 'No',\n }).then((result) => {\n if (result.isConfirmed) {\n sendIssueReport(button, 'true');\n }\n });\n } else {\n errorMessage.append('<p>' + value + '</p>');\n }\n });\n\n $('.wpstg--tab--active .wpstg-report-issue-form').prepend(errorMessage);\n } else {\n const successMessage = $('<div />').addClass('wpstg-message wpstg-success-message');\n successMessage.append('<p>Thanks for submitting your request! You should receive an auto reply mail with your ticket ID immediately for confirmation!<br><br>If you do not get that mail please contact us directly at <strong>support@wp-staging.com</strong></p>');\n\n $('.wpstg--tab--active .wpstg-report-issue-form').html(successMessage);\n $('.wpstg--tab--active .wpstg-success-message').append('<div style=\"float:right;margin-top:10px;\"><a id=\"wpstg-success-button\" href=\"#\" class=\"wpstg--red\">[X] CLOSE</a></div>');\n\n // Hide message\n setTimeout(function() {\n $('.wpstg--tab--active .wpstg-report-issue-form').removeClass('wpstg-report-active');\n }, 2000);\n }\n });\n }\n\n // Open/close actions drop down menu\n $(document).on('click', '.wpstg-dropdown>.wpstg-dropdown-toggler', function(e) {\n e.preventDefault();\n $(e.target).next('.wpstg-dropdown-menu').toggleClass('shown');\n\n $(e.target).find('.wpstg-caret').toggleClass('wpstg-caret-up');\n });\n\n $(document).on('click', '.wpstg-caret', function(e) {\n e.preventDefault();\n\n const toggler = $(e.target).closest('.wpstg-dropdown-toggler');\n\n if (toggler) {\n toggler.trigger('click');\n }\n });\n\n // Close action drop down menu if clicked anywhere outside\n document.addEventListener('click', function(event) {\n const isClickInside = event.target.closest('.wpstg-dropdown-toggler');\n if (!isClickInside) {\n const dropDown = document.getElementsByClassName('wpstg-dropdown-menu');\n for (let i = 0; i < dropDown.length; i++) {\n dropDown[i].classList.remove('shown');\n }\n $('.wpstg-caret').removeClass('wpstg-caret-up');\n }\n });\n\n // \"Event info\" for backup errors\n window.addEventListener('finishedProcessWithError', function(customEvent) {\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n dataType: 'json',\n data: {\n 'action': 'wpstg_job_error',\n 'accessToken': wpstg.accessToken,\n 'nonce': wpstg.nonce,\n 'error_message': customEvent.detail.error,\n 'job_id': WPStagingCommon.getJobId(),\n },\n });\n });\n});\n"],"names":["qs","selector","document","querySelector","all","querySelectorAll","addEvent","parent","evt","handler","addEventListener","event","target","matches","closest","slideDown","element","duration","style","display","overflow","height","offsetHeight","transitionProperty","transitionDuration","setTimeout","window","removeProperty","slideUp","WpstgCloneStaging","pageWrapperId","wpstgObject","wpstg","pageWrapper","dom","enableButtonId","enableAction","notyf","Notyf","position","x","y","dismissible","types","type","background","icon","init","addEvents","this","_this","sendRequest","action","fetch","ajaxUrl","method","credentials","body","URLSearchParams","accessToken","nonce","headers","then","response","ok","json","Promise","reject","data","success","location","reload","message","_this2","error","i18n","console","warn","WpstgDirectoryNavigation","directoryListingSelector","directoryListingContainer","dirCheckboxSelector","dirExpandSelector","unselectAllDirsSelector","selectDefaultDirsSelector","fetchChildrenAction","currentCheckboxElement","currentParentDiv","currentLoader","existingExcludes","excludedDirectories","isDefaultSelected","preventDefault","toggleDirExpand","unselectAll","selectDefault","log","parseExcludes","parentElement","previousSibling","getAttribute","dirPath","value","isChecked","checked","forceDefault","setAttribute","dirContainer","createElement","classList","add","innerHTML","JSON","parse","directoryListing","appendChild","alert","getExcludedDirectories","forEach","_this3","isParentExcluded","push","exclude","isExcludeScanned","join","settings","directorySeparator","path","isParentAlreadyExcluded","dir","startsWith","getExtraDirectoriesRootOnly","extraDirectories","extraDirectoriesTextArea","extraCustomDirectories","split","concat","length","WpstgExcludeFilters","excludeFilterContainerSelector","excludeContainer","excludeTableBody","addFileSizeExclude","addFileExtExclude","addFileNameExclude","addDirNameExclude","clearExcludes","removeExclude","addExcludeRuleRow","templateName","excludeRowTemplate","excludeRow","content","cloneNode","e","removeChild","trim","getExcludeFilters","globExcludes","sizeExcludes","sizeCompares","sizeSizes","sizeByte","Object","entries","key","sizeInput","ext","cleanStringForGlob","fileNamesPos","fileNames","fileInput","fileName","dirNamesPos","dirNames","dirInput","dirName","filter","onlyUnique","index","self","indexOf","replace","WpstgModal","confirmAction","show","swalOptions","additionalParams","callback","wpstgSwal","fire","result","triggerConfirmAction","assign","onOver","onOut","pX","pY","mouseOver","focused","h","state","timer","options","sensitivity","interval","timeout","handleFocus","tracker","clientX","clientY","compare","el","clearTimeout","Math","abs","undefined","dispatchOver","removeEventListener","onMouseOver","dispatchOut","delay","onMouseOut","onFocus","onBlur","removeFocus","opt","focusOptionChanged","remove","$","WPStagingCommon","continueErrorHandle","cache","elements","get","inArray","refresh","setJobId","jobId","localStorage","setItem","getJobId","getItem","listenTooltip","wpstgHoverIntent","visibility","isEmpty","obj","prop","hasOwnProperty","getSwalModal","isContentCentered","customClasses","defaultCustomClasses","confirmButton","cancelButton","actions","popup","customClass","buttonsStyling","reverseButtons","showClass","mixin","showSuccessModal","htmlContent","showConfirmButton","showCancelButton","cancelButtonText","title","html","showWarningModal","showErrorModal","getSwalContainer","getContainer","closeSwalModal","close","getDataFromWordPressResponse","Error","Array","shift","isLoading","hide","slugify","url","toString","toLowerCase","normalize","showAjaxFatalError","prependMessage","appendMessage","showError","WPStaging","warnIfClosingDuringProcess","handleFetchErrors","status","statusText","css","text","removeClass","resetErrors","ajax","dataType","showErrors","tryCount","incrementRatio","errorCallback","retryLimit","retryTimeout","parseInt","isNaN","ajaxurl","Date","now","xhr","textStatus","errorThrown","errorCode","statusCode","jQuery","WpstgResetModal","cloneID","workflowSelector","fetchExcludeSettingsAction","modalErrorAction","workflow","resetButtonClass","resetModalContainerClass","resetTabSelector","directoryNavigator","excludeFilters","isAllTablesChecked","resetModalContainer","toggleContent","selectDefaultTables","toggleTableSelection","toggleDirectoryNavigation","updateDirectorySelection","contentId","tabTriangle","isCollapsed","contains","transform","showModal","swalPromise","loadModal","fetchCloneExcludes","container","getAjaxLoader","width","focusConfirm","confirmButtonText","resetClone","clone","job","modal","renderError","getDirectoryNavigator","wpstgIcon","cbElement","subDirectories","sibling","nextElementSibling","parElem","i","children","multisitePattern","tblprefix","singleSitePattern","option","name","isMultisite","match","removeAttribute","WpstgCloningAdvanceSettings","baseContainerSelector","baseContainer","checkBoxSettingTogglerSelector","toggleSettings","WpstgMainMenu","activeTabClass","mainMenu","$this","targetElements","menuItems","menuItem","targetElement","dispatchEvent","Event","ajaxSpinner","that","isCancelled","isFinished","getLogs","time","executionTime","progressBar","cloneExcludeFilters","areAllTablesChecked","returnValue","validateTargetHost","the_domain","val","test","cloneActions","$workFlow","on","confirm","append","cancelCloning","startCloning","cancelCloningUpdate","restart","$existingClones","animate","scrollTop","offset","top","addClass","deleteClone","jsonResponse","tryParseJson","checkDiskSpace","switchStep","resetModal","promise","dirNavigator","exclFilters","includedTables","getIncludedTables","excludeSizeRules","encodeURIComponent","sizes","excludeGlobRules","globs","each","getExcludedTables","excludedTables","verifyExternalDatabase","databaseUser","databasePassword","databaseServer","databaseDatabase","proceedCloning","error_type","render","checks","production","staging","getTime","cloneName","rules","databasePrefix","cloneDir","cloneHostname","emailsAllowed","is","networkClone","uploadsSymlinked","cleanPluginsThemes","cleanUploadsDir","getCloningData","sendCloningAjax","object","excludeOptions","loadOverview","deleteDir","find","$div","constructor","date","scrollHeight","requiredSpace","errorMessage","clearInterval","convertSeconds","setInterval","getElementById","seconds","setSeconds","toISOString","substr","processing","delayReq","last_msg","job_done","$link1","$link","attr","msg","cloneResetComplete","cloneUpdateComplete","finish","percentage","toFixed","step","urlSpinner","devicePixelRatio","trigger","regex","siblings","slideToggle","$directory","parents","removeAttr","cloneDirectoryName","directoryName","slug","$targetDir","$targetUri","uri","after","focus","onlyUpdateMessage","stepButtons","$section","toggleClass","hasClass","ready","sendIssueReport","button","forceSend","spinner","next","email","hosting_provider","syslog","terms","async","done","errors","isConfirmed","prepend","successMessage","toggler","dropDown","getElementsByClassName","customEvent","detail"],"mappings":"wOAQO,SAASA,EAAGC,UACVC,SAASC,cAAcF,GAOzB,SAASG,EAAIH,UACXC,SAASG,iBAAiBJ,GAM5B,SAASK,EAASC,EAAQC,EAAKP,EAAUQ,GAC9CF,EAAOG,iBAAiBF,GAAK,SAASG,GAChCA,EAAMC,OAAOC,QAAQZ,EAAW,KAAOA,EAAW,OACpDQ,EAAQE,EAAMC,OAAOE,QAAQb,GAAWU,MAEzC,GAGE,SAASI,EAAUC,EAASC,YAAAA,IAAAA,EAAW,KAC5CD,EAAQE,MAAMC,QAAU,QACxBH,EAAQE,MAAME,SAAW,aACnBC,EAASL,EAAQM,aACvBN,EAAQE,MAAMG,OAAS,MACvBL,EAAQE,MAAMK,mBAAqB,SACnCP,EAAQE,MAAMM,mBAAqBP,EAAW,KAC9CQ,YAAW,WACTT,EAAQE,MAAMG,OAASA,EAAS,KAChCK,OAAOD,YAAW,WAChBT,EAAQE,MAAMS,eAAe,UAC7BX,EAAQE,MAAMS,eAAe,YAC7BX,EAAQE,MAAMS,eAAe,uBAC7BX,EAAQE,MAAMS,eAAe,yBAC5BV,KACF,GAGE,SAASW,EAAQZ,EAASC,YAAAA,IAAAA,EAAW,KAC1CD,EAAQE,MAAMC,QAAU,QACxBH,EAAQE,MAAME,SAAW,aACnBC,EAASL,EAAQM,aAC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AAEuE,KAAK,CACLjB,IAAK2B,QACL1Q,KAAM,OACNiQ,SAAU,OACVzO,KAAM,QACM,8BACKpC,MAAM2B,kBACZ3B,MAAM4B,oBACE4d,EAAYC,OAAO/c,aAC1B4J,EAAgBW"}
|
1 |
+
{"version":3,"file":"wpstg-admin.min.js","sources":["../src/modules/wpstg-dom-utils.js","../src/modules/wpstg-clone-staging.js","../src/modules/wpstg-directory-navigation.js","../src/modules/wpstg-exclude-filters.js","../src/modules/wpstg-modal.js","../src/modules/wpstg-hover-intent.js","../src/wpstg.js","../src/modules/wpstg-reset-modal.js","../src/modules/wpstg-cloning-advance-settings.js","../src/modules/wpstg-main-menu.js","../src/wpstg-admin.js"],"sourcesContent":["/**\n * WP STAGING basic jQuery replacement\n */\n\n/**\n * Shortcut for document.querySelector() or jQuery's $()\n * Return single element only\n */\nexport function qs(selector) {\n return document.querySelector(selector);\n}\n\n/**\n * Shortcut for document.querySelector() or jQuery's $()\n * Return collection of elements\n */\nexport function all(selector) {\n return document.querySelectorAll(selector);\n}\n\n/**\n * alternative of jQuery - $(parent).on(event, selector, handler)\n */\nexport function addEvent(parent, evt, selector, handler) {\n parent.addEventListener(evt, function(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n handler(event.target.closest(selector), event);\n }\n }, false);\n}\n\nexport function slideDown(element, duration = 400) {\n element.style.display = 'block';\n element.style.overflow = 'hidden';\n const height = element.offsetHeight;\n element.style.height = '0px';\n element.style.transitionProperty = 'height';\n element.style.transitionDuration = duration + 'ms';\n setTimeout(() => {\n element.style.height = height + 'px';\n window.setTimeout(() => {\n element.style.removeProperty('height');\n element.style.removeProperty('overflow');\n element.style.removeProperty('transition-duration');\n element.style.removeProperty('transition-property');\n }, duration);\n }, 0);\n}\n\nexport function slideUp(element, duration = 400) {\n element.style.display = 'block';\n element.style.overflow = 'hidden';\n const height = element.offsetHeight;\n element.style.height = height + 'px';\n element.style.transitionProperty = 'height';\n element.style.transitionDuration = duration + 'ms';\n setTimeout(() => {\n element.style.height = '0px';\n window.setTimeout(() => {\n element.style.display = 'none';\n element.style.removeProperty('height');\n element.style.removeProperty('overflow');\n element.style.removeProperty('transition-duration');\n element.style.removeProperty('transition-property');\n }, duration);\n }, 0);\n}\n\nexport function fadeOut(element, duration = 300) {\n element.style.opacity = 1;\n element.style.transitionProperty = 'opacity';\n element.style.transitionDuration = duration + 'ms';\n setTimeout(() => {\n element.style.opacity = 0;\n window.setTimeout(() => {\n element.style.display = 'none';\n element.style.removeProperty('opacity');\n element.style.removeProperty('transition-duration');\n element.style.removeProperty('transition-property');\n }, duration);\n }, 0);\n}\n\nexport function getNextSibling(element, selector) {\n let sibling = element.nextElementSibling;\n\n while (sibling) {\n if (sibling.matches(selector)) {\n return sibling;\n }\n\n sibling = sibling.nextElementSibling;\n }\n};\n\nexport function getParents(element, selector) {\n const result = [];\n for (let parent = element && element.parentElement; parent; parent = parent.parentElement) {\n if (parent.matches(selector)) {\n result.push(parent);\n }\n }\n\n return result;\n}\n\n/**\n * Check if element has class name\n * @param element\n * @param className\n * @return {boolean}\n */\nexport function hasClass(element, className) {\n return (' ' + element.className + ' ').indexOf(' ' + className+ ' ') > -1;\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Enable/Disable cloning for staging site\n */\nexport default class WpstgCloneStaging {\n constructor(\n pageWrapperId = '#wpstg-clonepage-wrapper',\n wpstgObject = wpstg,\n ) {\n this.pageWrapper = dom.qs(pageWrapperId);\n this.wpstgObject = wpstgObject;\n this.enableButtonId = '#wpstg-enable-staging-cloning';\n this.enableAction = 'wpstg_enable_staging_cloning';\n\n this.notyf = new Notyf({\n duration: 10000,\n position: {\n x: 'center',\n y: 'bottom',\n },\n dismissible: true,\n types: [\n {\n type: 'warning',\n background: 'orange',\n icon: false,\n },\n ],\n });\n this.init();\n }\n\n addEvents() {\n if (this.pageWrapper === null) {\n return;\n }\n\n dom.addEvent(this.pageWrapper, 'click', this.enableButtonId, () => {\n this.sendRequest(this.enableAction);\n });\n }\n\n init() {\n this.addEvents();\n }\n\n sendRequest(action) {\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams({\n action: action,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n }),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((data) => {\n // Reload current page if successful.\n if ('undefined' !== typeof (data.success) && data.success) {\n location.reload();\n return;\n }\n\n // There will be message probably in case of error\n if ('undefined' !== typeof (data.message)) {\n this.notyf.error(data.message);\n return;\n }\n\n this.notyf.error(this.wpstgObject.i18n['somethingWentWrong']);\n }).catch((error) => {\n console.warn(this.wpstgObject.i18n['somethingWentWrong'], error);\n });\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Fetch directory direct child directories\n */\nexport default class WpstgDirectoryNavigation {\n constructor(\n directoryListingSelector = '#wpstg-directories-listing',\n wpstgObject = wpstg,\n notyf = null,\n ) {\n this.directoryListingContainer = dom.qs(directoryListingSelector);\n this.wpstgObject = wpstgObject;\n this.dirCheckboxSelector = '.wpstg-check-dir';\n this.dirExpandSelector = '.wpstg-expand-dirs';\n this.unselectAllDirsSelector = '.wpstg-unselect-dirs';\n this.selectDefaultDirsSelector = '.wpstg-select-dirs-default';\n this.fetchChildrenAction = 'wpstg_fetch_dir_childrens';\n this.currentCheckboxElement = null;\n this.currentParentDiv = null;\n this.currentLoader = null;\n this.existingExcludes = [];\n this.excludedDirectories = [];\n this.isDefaultSelected = false;\n this.notyf = notyf;\n\n this.init();\n }\n\n addEvents() {\n if (this.directoryListingContainer === null) {\n console.log('Error: directory navigation add events');\n return;\n }\n\n dom.addEvent(this.directoryListingContainer, 'click', this.dirExpandSelector, (element, event) => {\n event.preventDefault();\n if (this.toggleDirExpand(element)) {\n this.sendRequest(this.fetchChildrenAction, element);\n }\n });\n\n dom.addEvent(this.directoryListingContainer, 'click', this.unselectAllDirsSelector, () => {\n this.unselectAll();\n });\n\n dom.addEvent(this.directoryListingContainer, 'click', this.selectDefaultDirsSelector, () => {\n this.selectDefault();\n });\n }\n\n init() {\n this.addEvents();\n this.parseExcludes();\n }\n\n /**\n * Toggle Dir Expand,\n * Return true if children aren't fetched\n * @param {HTMLElement} element\n * @return {boolean}\n */\n toggleDirExpand(element) {\n this.currentParentDiv = element.parentElement;\n this.currentCheckboxElement = element.previousSibling;\n this.currentLoader = this.currentParentDiv.querySelector('.wpstg-is-dir-loading');\n if (this.currentCheckboxElement.getAttribute('data-navigateable', 'false') === 'false') {\n return false;\n }\n\n if (this.currentCheckboxElement.getAttribute('data-scanned', 'false') === 'false') {\n return true;\n }\n\n return false;\n }\n\n sendRequest(action) {\n if (this.currentLoader !== null) {\n this.currentLoader.style.display = 'inline-block';\n }\n\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams({\n action: action,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n dirPath: this.currentCheckboxElement.value,\n isChecked: this.currentCheckboxElement.checked,\n forceDefault: this.isDefaultSelected,\n }),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((data) => {\n if ('undefined' !== typeof (data.success) && data.success) {\n this.currentCheckboxElement.setAttribute('data-scanned', true);\n const dirContainer = document.createElement('div');\n dirContainer.classList.add('wpstg-dir');\n dirContainer.classList.add('wpstg-subdir');\n dirContainer.innerHTML = JSON.parse(data.directoryListing);\n this.currentParentDiv.appendChild(dirContainer);\n if (this.currentLoader !== null) {\n this.currentLoader.style.display = 'none';\n }\n\n dom.slideDown(dirContainer);\n\n return;\n }\n\n if (this.notyf !== null) {\n this.notyf.error(this.wpstgObject.i18n['somethingWentWrong']);\n } else {\n alert('Error: ' + this.wpstgObject.i18n['somethingWentWrong']);\n }\n }).catch((error) => {\n console.warn(this.wpstgObject.i18n['somethingWentWrong'], error);\n });\n }\n\n getExcludedDirectories() {\n this.excludedDirectories = [];\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input:not(:checked)').forEach((element) => {\n if (!this.isParentExcluded(element.value)) {\n this.excludedDirectories.push(element.value);\n }\n });\n\n this.existingExcludes.forEach((exclude) => {\n if (!this.isParentExcluded(exclude) && !this.isExcludeScanned(exclude)) {\n this.excludedDirectories.push(exclude);\n }\n });\n\n return this.excludedDirectories.join(this.wpstgObject.settings.directorySeparator);\n }\n\n /**\n * @param {string} path\n * @return {bool}\n */\n isParentExcluded(path) {\n let isParentAlreadyExcluded = false;\n this.excludedDirectories.forEach((dir) => {\n if (path.startsWith(dir + '/')) {\n isParentAlreadyExcluded = true;\n }\n });\n\n return isParentAlreadyExcluded;\n }\n\n getExtraDirectoriesRootOnly() {\n this.getExcludedDirectories();\n const extraDirectories = [];\n this.directoryListingContainer.querySelectorAll(':not(.wpstg-subdir)>.wpstg-dir>input.wpstg-wp-non-core-dir:checked').forEach((element) => {\n extraDirectories.push(element.value);\n });\n\n // Check if extra directories text area exists\n // TODO: remove extraCustomDirectories code if no one require extraCustomDirectories...\n const extraDirectoriesTextArea = dom.qs('#wpstg_extraDirectories');\n if (extraDirectoriesTextArea === null || extraDirectoriesTextArea.value === '') {\n return extraDirectories.join(this.wpstgObject.settings.directorySeparator);\n }\n\n const extraCustomDirectories = extraDirectoriesTextArea.value.split(/\\r?\\n/);\n\n return extraDirectories.concat(extraCustomDirectories).join(this.wpstgObject.settings.directorySeparator);\n }\n\n unselectAll() {\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input').forEach((element) => {\n element.checked = false;\n });\n }\n\n selectDefault() {\n // unselect all checkboxes\n this.unselectAll();\n\n // only select those checkboxes whose class is wpstg-wp-core-dir\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input.wpstg-wp-core-dir').forEach((element) => {\n element.checked = true;\n });\n\n // then unselect those checkboxes whose parent has wpstg extra checkbox\n this.directoryListingContainer.querySelectorAll('.wpstg-dir > .wpstg-wp-non-core-dir').forEach((element) => {\n element.parentElement.querySelectorAll('input.wpstg-wp-core-dir').forEach((element) => {\n element.checked = false;\n });\n });\n\n this.isDefaultSelected = true;\n }\n\n parseExcludes() {\n this.existingExcludes = this.directoryListingContainer.getAttribute('data-existing-excludes', []);\n if (this.existingExcludes === '') {\n this.existingExcludes = [];\n }\n\n if (this.existingExcludes.length !== 0) {\n this.existingExcludes = this.existingExcludes.split(',');\n }\n }\n\n isExcludeScanned(exclude) {\n this.directoryListingContainer.querySelectorAll('.wpstg-dir input').forEach((element) => {\n if (element.value === exclude) {\n return true;\n }\n });\n\n return false;\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Rich Exclude Filter Module\n */\nexport default class WpstgExcludeFilters {\n constructor(\n excludeFilterContainerSelector = '#wpstg-exclude-filters-container',\n wpstgObject = wpstg,\n ) {\n this.excludeContainer = dom.qs(excludeFilterContainerSelector);\n this.excludeTableBody = dom.qs(`${excludeFilterContainerSelector} tbody`);\n this.wpstgObject = wpstgObject;\n this.init();\n }\n\n addEvents() {\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-file-size-rule', () => {\n this.addFileSizeExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-file-ext-rule', () => {\n this.addFileExtExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-file-name-rule', () => {\n this.addFileNameExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-dir-name-rule', () => {\n this.addDirNameExclude();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-clear-all-rules', () => {\n this.clearExcludes();\n });\n\n dom.addEvent(this.excludeContainer, 'click', '.wpstg-remove-exclude-rule', (target) => {\n this.removeExclude(target);\n });\n }\n\n init() {\n if (this.excludeContainer === null) {\n console.log('Error: Given table selector not found!');\n return;\n }\n\n this.addEvents();\n }\n\n addFileSizeExclude() {\n this.addExcludeRuleRow('#wpstg-file-size-exclude-filter-template');\n }\n\n addFileExtExclude() {\n this.addExcludeRuleRow('#wpstg-file-ext-exclude-filter-template');\n }\n\n addFileNameExclude() {\n this.addExcludeRuleRow('#wpstg-file-name-exclude-filter-template');\n }\n\n addDirNameExclude() {\n this.addExcludeRuleRow('#wpstg-dir-name-exclude-filter-template');\n }\n\n addExcludeRuleRow(templateName) {\n const excludeRowTemplate = dom.qs(templateName);\n if (excludeRowTemplate !== null) {\n const clone = excludeRowTemplate.content.cloneNode(true);\n const excludeRow = clone.querySelector('tr');\n\n this.excludeTableBody.appendChild(excludeRow);\n dom.all('.wpstg-has-exclude-rules').forEach((e) => {\n e.style.display = 'inherit';\n });\n }\n }\n\n clearExcludes() {\n this.excludeTableBody.innerHTML = '';\n dom.all('.wpstg-has-exclude-rules').forEach((e) => {\n e.style.display = 'none';\n });\n }\n\n removeExclude(target) {\n if (target.parentElement !== null && target.parentElement.parentElement !== null) {\n this.excludeTableBody.removeChild(target.parentElement.parentElement);\n }\n\n if (this.excludeTableBody.innerHTML.trim() === '') {\n dom.all('.wpstg-has-exclude-rules').forEach((e) => {\n e.style.display = 'none';\n });\n }\n }\n\n /**\n * Converts all the exclude filters arrays into one single string to keep size of post request small\n * @return {string}\n */\n getExcludeFilters() {\n const globExcludes = [];\n const sizeExcludes = [];\n\n const sizeCompares = this.excludeTableBody.querySelectorAll('select[name=\"wpstgFileSizeExcludeRuleCompare[]\"]');\n const sizeSizes = this.excludeTableBody.querySelectorAll('input[name=\"wpstgFileSizeExcludeRuleSize[]\"]');\n const sizeByte = this.excludeTableBody.querySelectorAll('select[name=\"wpstgFileSizeExcludeRuleByte[]\"]');\n for (const [key, sizeInput] of Object.entries(sizeSizes)) {\n if (sizeInput.value !== '') {\n sizeExcludes.push(sizeCompares[key].value + ' ' + sizeInput.value + sizeByte[key].value);\n }\n }\n\n const extensionInputs = this.excludeTableBody.querySelectorAll('input[name=\"wpstgFileExtExcludeRule[]\"]');\n extensionInputs.forEach((x) => {\n const ext = this.cleanStringForGlob(x.value);\n if (ext !== '') {\n globExcludes.push('ext:' + ext.trim());\n }\n });\n\n const fileNamesPos = this.excludeTableBody.querySelectorAll('select[name=\"wpstgFileNameExcludeRulePos[]\"]');\n const fileNames = this.excludeTableBody.querySelectorAll('input[name=\"wpstgFileNameExcludeRulePath[]\"]');\n for (const [key, fileInput] of Object.entries(fileNames)) {\n const fileName = this.cleanStringForGlob(fileInput.value);\n if (fileName !== '') {\n globExcludes.push('file:' + fileNamesPos[key].value + ' ' + fileName.trim());\n }\n }\n\n const dirNamesPos = this.excludeTableBody.querySelectorAll('select[name=\"wpstgDirNameExcludeRulePos[]\"]');\n const dirNames = this.excludeTableBody.querySelectorAll('input[name=\"wpstgDirNameExcludeRulePath[]\"]');\n for (const [key, dirInput] of Object.entries(dirNames)) {\n const dirName = this.cleanStringForGlob(dirInput.value);\n if (dirName !== '') {\n globExcludes.push('dir:' + dirNamesPos[key].value + ' ' + dirName.trim());\n }\n }\n\n return {\n 'sizes': sizeExcludes.filter(this.onlyUnique).join(','),\n // return set of unique rules\n 'globs': globExcludes.filter(this.onlyUnique).join(','),\n };\n }\n\n onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }\n\n /**\n * Remove most of the comment glob characters from the string\n * @param {String} value\n * @return {String}\n */\n cleanStringForGlob(value) {\n // will replace character like * ^ / \\ ! ? [ from the string\n return value.replace(/[*^//!\\.[?]/g, '');\n }\n}\n","/**\n * Basic WP Staging Modal implemented with help of Sweetalerts\n */\nexport default class WpstgModal {\n constructor(\n confirmAction,\n wpstgObject = wpstg,\n ) {\n this.confirmAction = confirmAction;\n this.wpstgObject = wpstgObject;\n }\n\n show(swalOptions, additionalParams = {}, callback = null) {\n wpstgSwal.fire(swalOptions).then((result) => {\n if (result.value && this.error !== null) {\n this.triggerConfirmAction(additionalParams, callback);\n }\n });\n }\n\n triggerConfirmAction(additionalParams = {}, callback = null) {\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams(Object.assign({\n action: this.confirmAction,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n }, additionalParams)),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((response) => {\n if (callback !== null) {\n callback(response);\n }\n }).catch((error) => {\n console.log(this.wpstgObject.i18n['somethingWentWrong'], error);\n });\n }\n}\n","'use strict';\n\n/**\n * This is a namespaced port of https://github.com/tristen/hoverintent,\n * with slight modification to accept selector with dynamically added element in dom,\n * instead of just already present element.\n *\n * @param {HTMLElement} parent\n * @param {string} selector\n * @param {CallableFunction} onOver\n * @param {CallableFunction} onOut\n *\n * @return {object}\n */\nexport default function(parent, selector, onOver, onOut) {\n let x; let y; let pX; let pY;\n let mouseOver = false;\n let focused = false;\n const h = {};\n let state = 0;\n let timer = 0;\n\n let options = {\n sensitivity: 7,\n interval: 100,\n timeout: 0,\n handleFocus: false,\n };\n\n function delay(el, e) {\n if (timer) {\n timer = clearTimeout(timer);\n }\n\n state = 0;\n return focused ? undefined : onOut(el, e);\n }\n\n function tracker(e) {\n x = e.clientX;\n y = e.clientY;\n }\n\n function compare(el, e) {\n if (timer) timer = clearTimeout(timer);\n if ((Math.abs(pX - x) + Math.abs(pY - y)) < options.sensitivity) {\n state = 1;\n return focused ? undefined : onOver(el, e);\n } else {\n pX = x;\n pY = y;\n timer = setTimeout(function() {\n compare(el, e);\n }, options.interval);\n }\n }\n\n // Public methods\n h.options = function(opt) {\n const focusOptionChanged = opt.handleFocus !== options.handleFocus;\n options = Object.assign({}, options, opt);\n if (focusOptionChanged) {\n options.handleFocus ? addFocus() : removeFocus();\n }\n\n return h;\n };\n\n function dispatchOver(el, e) {\n mouseOver = true;\n if (timer) {\n timer = clearTimeout(timer);\n }\n\n el.removeEventListener('mousemove', tracker, false);\n\n if (state !== 1) {\n pX = e.clientX;\n pY = e.clientY;\n\n el.addEventListener('mousemove', tracker, false);\n\n timer = setTimeout(function() {\n compare(el, e);\n }, options.interval);\n }\n\n return this;\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchOver to support dynamically added elements to dom\n */\n function onMouseOver(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchOver(event.target.closest(selector), event);\n }\n };\n\n function dispatchOut(el, e) {\n mouseOver = false;\n if (timer) {\n timer = clearTimeout(timer);\n }\n\n el.removeEventListener('mousemove', tracker, false);\n\n if (state === 1) {\n timer = setTimeout(function() {\n delay(el, e);\n }, options.timeout);\n }\n\n return this;\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchOut to support dynamically added elements to dom\n */\n function onMouseOut(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchOut(event.target.closest(selector), event);\n }\n };\n\n function dispatchFocus(el, e) {\n if (!mouseOver) {\n focused = true;\n onOver(el, e);\n }\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchFocus to support dynamically added elements to dom\n */\n function onFocus(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchFocus(event.target.closest(selector), event);\n }\n };\n\n function dispatchBlur(el, e) {\n if (!mouseOver && focused) {\n focused = false;\n onOut(el, e);\n }\n }\n\n /**\n * Newly added method,\n * A wrapper around dispatchBlur to support dynamically added elements to dom\n */\n function onBlur(event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n dispatchBlur(event.target.closest(selector), event);\n }\n };\n\n /**\n * Modified to support dynamically added element\n */\n function addFocus() {\n parent.addEventListener('focus', onFocus, false);\n parent.addEventListener('blur', onBlur, false);\n }\n\n /**\n * Modified to support dynamically added element\n */\n function removeFocus() {\n parent.removeEventListener('focus', onFocus, false);\n parent.removeEventListener('blur', onBlur, false);\n }\n\n /**\n * Modified to support dynamically added element\n */\n h.remove = function() {\n if (!parent) {\n return;\n }\n\n parent.removeEventListener('mouseover', onMouseOver, false);\n parent.removeEventListener('mouseout', onMouseOut, false);\n removeFocus();\n };\n\n /**\n * Modified to support dynamically added element\n */\n if (parent) {\n parent.addEventListener('mouseover', onMouseOver, false);\n parent.addEventListener('mouseout', onMouseOut, false);\n }\n\n return h;\n};\n","import wpstgHoverIntent from './modules/wpstg-hover-intent';\n\nexport default (function($) {\n const WPStagingCommon = {\n continueErrorHandle: true,\n cache: {\n elements: [],\n get: function(selector) {\n // It is already cached!\n if ($.inArray(selector, this.elements) !== -1) {\n return this.elements[selector];\n }\n\n // Create cache and return\n this.elements[selector] = $(selector);\n\n return this.elements[selector];\n },\n refresh: function(selector) {\n selector.elements[selector] = $(selector);\n },\n },\n setJobId: function(jobId) {\n localStorage.setItem('jobIdBeingProcessed', jobId);\n },\n getJobId: function() {\n return localStorage.getItem('jobIdBeingProcessed');\n },\n listenTooltip: function() {\n wpstgHoverIntent(document, '.wpstg--tooltip', function(target, event) {\n target.querySelector('.wpstg--tooltiptext').style.visibility = 'visible';\n }, function(target, event) {\n target.querySelector('.wpstg--tooltiptext').style.visibility = 'hidden';\n });\n },\n isEmpty: function(obj) {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n\n return true;\n },\n // Get the custom themed Swal Modal for WP Staging\n // Easy to maintain now in one place now\n getSwalModal: function(isContentCentered = false, customClasses = {}) {\n // common style for all swal modal used in WP Staging\n const defaultCustomClasses = {\n confirmButton: 'wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn wpstg-100-width',\n cancelButton: 'wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn wpstg-100-width',\n actions: 'wpstg--modal--actions',\n popup: isContentCentered ? 'wpstg-swal-popup centered-modal' : 'wpstg-swal-popup',\n };\n\n // If a attribute exists in both default and additional attributes,\n // The class(es) of the additional attribute will overrite the default one.\n const options = {\n customClass: Object.assign(defaultCustomClasses, customClasses),\n buttonsStyling: false,\n reverseButtons: true,\n showClass: {\n popup: 'wpstg--swal2-show wpstg-swal-show',\n },\n };\n\n return wpstgSwal.mixin(options);\n },\n showSuccessModal: function(htmlContent) {\n this.getSwalModal().fire({\n showConfirmButton: false,\n showCancelButton: true,\n cancelButtonText: 'OK',\n icon: 'success',\n title: 'Success!',\n html: '<div class=\"wpstg--grey\" style=\"text-align: left; margin-top: 8px;\">' + htmlContent + '</div>',\n });\n },\n showWarningModal: function(htmlContent) {\n this.getSwalModal().fire({\n showConfirmButton: false,\n showCancelButton: true,\n cancelButtonText: 'OK',\n icon: 'warning',\n title: '',\n html: '<div class=\"wpstg--grey\" style=\"text-align: left; margin-top: 8px;\">' + htmlContent + '</div>',\n });\n },\n showErrorModal: function(htmlContent) {\n this.getSwalModal().fire({\n showConfirmButton: false,\n showCancelButton: true,\n cancelButtonText: 'OK',\n icon: 'error',\n title: 'Error!',\n html: '<div class=\"wpstg--grey\" style=\"text-align: left; margin-top: 8px;\">' + htmlContent + '</div>',\n });\n },\n getSwalContainer: function() {\n return wpstgSwal.getContainer();\n },\n closeSwalModal: function() {\n wpstgSwal.close();\n },\n /**\n * Treats a default response object generated by WordPress's\n * wp_send_json_success() or wp_send_json_error() functions in\n * PHP, parses it in JavaScript, and either throws if it's an error,\n * or returns the data if the response is successful.\n *\n * @param {object} response\n * @return {*}\n */\n getDataFromWordPressResponse(response) {\n if (typeof response !== 'object') {\n throw new Error('Unexpected response (ERR 1341)');\n }\n\n if (!response.hasOwnProperty('success')) {\n throw new Error('Unexpected response (ERR 1342)');\n }\n\n if (!response.hasOwnProperty('data')) {\n throw new Error('Unexpected response (ERR 1343)');\n }\n\n if (response.success === false) {\n if (response.data instanceof Array && response.data.length > 0) {\n throw new Error(response.data.shift());\n } else {\n throw new Error('Response was not successful');\n }\n } else {\n // Successful response. Return the data.\n return response.data;\n }\n },\n isLoading: function(isLoading) {\n if (!isLoading || isLoading === false) {\n WPStagingCommon.cache.get('.wpstg-loader').hide();\n } else {\n WPStagingCommon.cache.get('.wpstg-loader').show();\n }\n },\n /**\n * Convert the given url to make it slug compatible\n * @param {string} url\n */\n slugify: function(url) {\n return url.toString()\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .replace(/\\s+/g, '-')\n .replace(/&/g, '-and-')\n .replace(/[^a-z0-9\\-]/g, '')\n .replace(/-+/g, '-')\n .replace(/^-*/, '')\n .replace(/-*$/, '')\n ;\n },\n showAjaxFatalError: function(response, prependMessage, appendMessage) {\n prependMessage = prependMessage ? prependMessage + '<br/><br/>' : 'Something went wrong! <br/><br/>';\n appendMessage = appendMessage ? appendMessage + '<br/><br/>' : '<br/><br/>Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.';\n\n if (response === false) {\n WPStagingCommon.showError(prependMessage + ' Error: No response.' + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n\n if (typeof response.error !== 'undefined' && response.error) {\n WPStagingCommon.showError(prependMessage + ' Error: ' + response.message + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n },\n handleFetchErrors: function(response) {\n if (!response.ok) {\n WPStagingCommon.showError('Error: ' + response.status + ' - ' + response.statusText + '. Please try again or contact support.');\n }\n return response;\n },\n showError: function(message) {\n WPStagingCommon.cache.get('#wpstg-try-again').css('display', 'inline-block');\n WPStagingCommon.cache.get('#wpstg-cancel-cloning').text('Reset');\n WPStagingCommon.cache.get('#wpstg-resume-cloning').show();\n WPStagingCommon.cache.get('#wpstg-error-wrapper').show();\n WPStagingCommon.cache.get('#wpstg-error-details').show().html(message);\n WPStagingCommon.cache.get('#wpstg-removing-clone').removeClass('loading');\n WPStagingCommon.cache.get('.wpstg-loader').hide();\n $('.wpstg--modal--process--generic-problem').show().html(message);\n },\n resetErrors: function() {\n WPStagingCommon.cache.get('#wpstg-error-details').hide().html('');\n },\n /**\n * Ajax Requests\n * @param {Object} data\n * @param {Function} callback\n * @param {string} dataType\n * @param {bool} showErrors\n * @param {int} tryCount\n * @param {float} incrementRatio\n * @param errorCallback\n */\n ajax: function(data, callback, dataType, showErrors, tryCount, incrementRatio = null, errorCallback = null) {\n if ('undefined' === typeof (dataType)) {\n dataType = 'json';\n }\n\n if (false !== showErrors) {\n showErrors = true;\n }\n\n tryCount = 'undefined' === typeof (tryCount) ? 0 : tryCount;\n\n const retryLimit = 10;\n\n let retryTimeout = 10000 * tryCount;\n\n incrementRatio = parseInt(incrementRatio);\n if (!isNaN(incrementRatio)) {\n retryTimeout *= incrementRatio;\n }\n\n $.ajax({\n url: ajaxurl + '?action=wpstg_processing&_=' + (Date.now() / 1000),\n type: 'POST',\n dataType: dataType,\n cache: false,\n data: data,\n error: function(xhr, textStatus, errorThrown) {\n console.log(xhr.status + ' ' + xhr.statusText + '---' + textStatus);\n\n if (typeof (errorCallback) === 'function') {\n // Custom error handler\n errorCallback(xhr, textStatus, errorThrown);\n\n if (!WPStagingCommon.continueErrorHandle) {\n // Reset state\n WPStagingCommon.continueErrorHandle = true;\n\n return;\n }\n }\n\n // Default error handler\n tryCount++;\n if (tryCount <= retryLimit) {\n setTimeout(function() {\n WPStagingCommon.ajax(data, callback, dataType, showErrors, tryCount, incrementRatio);\n return;\n }, retryTimeout);\n } else {\n const errorCode = 'undefined' === typeof (xhr.status) ? 'Unknown' : xhr.status;\n WPStagingCommon.showError(\n 'Fatal Error: ' + errorCode + ' Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.',\n );\n }\n },\n success: function(data) {\n if ('function' === typeof (callback)) {\n callback(data);\n }\n },\n statusCode: {\n 404: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 404 - Can\\'t find ajax request URL! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 500: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Fatal Error 500 - Internal server error while processing the request! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 504: function() {\n if (tryCount > retryLimit) {\n WPStagingCommon.showError('Error 504 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 502: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 502 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 503: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 503 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 429: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Error 429 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 403: function() {\n if (tryCount >= retryLimit) {\n WPStagingCommon.showError('Refresh page or login again! The process should be finished successfully. \\n\\ ');\n }\n },\n },\n });\n },\n };\n\n return WPStagingCommon;\n})(jQuery);\n","\nimport * as dom from './wpstg-dom-utils.js';\nimport WpstgDirectoryNavigation from './wpstg-directory-navigation.js';\nimport WpstgExcludeFilters from './wpstg-exclude-filters.js';\nimport WpstgModal from './wpstg-modal.js';\nimport WPStagingCommon from './../wpstg.js';\n\n/**\n * Manage RESET MODAL\n */\nexport default class WpstgResetModal {\n constructor(\n cloneID,\n workflowSelector = '#wpstg-workflow',\n fetchExcludeSettingsAction = 'wpstg_clone_excludes_settings',\n modalErrorAction = 'wpstg_modal_error',\n wpstgObject = wpstg,\n ) {\n this.cloneID = cloneID;\n this.workflow = dom.qs(workflowSelector);\n this.wpstgObject = wpstgObject;\n this.fetchExcludeSettingsAction = fetchExcludeSettingsAction;\n this.modalErrorAction = modalErrorAction;\n this.resetButtonClass = 'wpstg-confirm-reset-clone';\n this.resetModalContainerClass = 'wpstg-reset-confirmation';\n this.resetTabSelector = '.wpstg-reset-exclude-tab';\n this.directoryNavigator = null;\n this.excludeFilters = null;\n this.isAllTablesChecked = true;\n }\n\n addEvents() {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n if (resetModalContainer === null) {\n console.log('Exit');\n return;\n }\n\n dom.addEvent(resetModalContainer, 'click', this.resetTabSelector, (target) => {\n this.toggleContent(target);\n });\n\n dom.addEvent(resetModalContainer, 'click', '.wpstg-button-select', () => {\n this.selectDefaultTables();\n });\n\n dom.addEvent(resetModalContainer, 'click', '.wpstg-button-unselect', () => {\n this.toggleTableSelection();\n });\n\n dom.addEvent(resetModalContainer, 'click', '.wpstg-expand-dirs', (target, event) => {\n event.preventDefault();\n this.toggleDirectoryNavigation(target);\n });\n\n dom.addEvent(resetModalContainer, 'change', 'input.wpstg-check-dir', (target) => {\n this.updateDirectorySelection(target);\n });\n }\n\n init() {\n this.addEvents();\n }\n\n toggleContent(target) {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n const contentId = target.getAttribute('data-id');\n const tabTriangle = target.querySelector('.wpstg-tab-triangle');\n const isCollapsed = target.getAttribute('data-collapsed', 'true');\n const content = dom.qs(contentId);\n if (isCollapsed === 'true') {\n if (resetModalContainer.classList.contains('has-collapsible-open')) {\n resetModalContainer.classList.add('has-collapsible-open-2');\n } else {\n resetModalContainer.classList.add('has-collapsible-open');\n }\n\n dom.slideDown(content);\n tabTriangle.style.transform = 'rotate(90deg)';\n target.setAttribute('data-collapsed', 'false');\n } else {\n if (resetModalContainer.classList.contains('has-collapsible-open-2')) {\n resetModalContainer.classList.remove('has-collapsible-open-2');\n } else {\n resetModalContainer.classList.remove('has-collapsible-open');\n }\n\n dom.slideUp(content);\n tabTriangle.style.removeProperty('transform');\n target.setAttribute('data-collapsed', 'true');\n }\n }\n\n /**\n * Show Swal alert with loader and send ajax request to fetch content of alert.\n * @return Promise\n */\n showModal() {\n const swalPromise = this.loadModal();\n this.init();\n this.fetchCloneExcludes();\n return swalPromise;\n }\n\n loadModal() {\n return WPStagingCommon.getSwalModal(false, {\n confirmButton: this.resetButtonClass + ' wpstg-confirm-reset-clone wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn',\n container: this.resetModalContainerClass + ' wpstg-swal2-container wpstg-swal2-loading',\n }).fire({\n title: '',\n icon: 'warning',\n html: this.getAjaxLoader(),\n width: '400px',\n focusConfirm: false,\n confirmButtonText: this.wpstgObject.i18n.resetClone,\n showCancelButton: true,\n });\n }\n\n fetchCloneExcludes() {\n this.error = null;\n // send ajax request and fetch preserved exclude settings\n fetch(this.wpstgObject.ajaxUrl, {\n method: 'POST',\n credentials: 'same-origin',\n body: new URLSearchParams({\n action: this.fetchExcludeSettingsAction,\n accessToken: this.wpstgObject.accessToken,\n nonce: this.wpstgObject.nonce,\n clone: this.cloneID,\n job: 'resetting',\n }),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n return Promise.reject(response);\n }).then((data) => {\n if (!data.success) {\n const errorModal = new WpstgModal(this.modalErrorAction, this.wpstgObject);\n errorModal.show(Object.assign({\n title: 'Error',\n icon: 'error',\n html: this.wpstgObject.i18n['somethingWentWrong'],\n width: '500px',\n confirmButtonText: 'Ok',\n showCancelButton: false,\n customClass: {\n confirmButton: 'wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn',\n cancelButton: 'wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn',\n actions: 'wpstg--modal--actions',\n popup: 'wpstg-swal-popup centered-modal',\n },\n buttonsStyling: false,\n reverseButtons: true,\n }, data.swalOptions), {\n type: data.type,\n });\n\n return;\n }\n\n const modal = dom.qs('.wpstg-reset-confirmation');\n modal.classList.remove('wpstg-swal2-loading');\n modal.querySelector('.wpstg--swal2-popup').style.width = '500px';\n modal.querySelector('.wpstg--swal2-content').innerHTML = data.html;\n this.directoryNavigator = new WpstgDirectoryNavigation();\n this.excludeFilters = new WpstgExcludeFilters();\n }).catch((error) => {\n this.renderError({\n 'html': this.wpstgObject.i18n['somethingWentWrong'] + ' ' + error,\n });\n });\n }\n\n getDirectoryNavigator() {\n return this.directoryNavigator;\n }\n\n getExcludeFilters() {\n return this.excludeFilters;\n }\n\n getAjaxLoader() {\n return '<div class=\"wpstg-swal2-ajax-loader\"><img src=\"' + this.wpstgObject.wpstgIcon + '\" /></div>';\n }\n\n toggleDirectoryNavigation(element) {\n const cbElement = element.previousSibling;\n if (cbElement.getAttribute('data-navigateable', 'false') === 'false') {\n return;\n }\n\n if (cbElement.getAttribute('data-scanned', 'false') === 'false') {\n return;\n }\n\n const subDirectories = dom.getNextSibling(element, '.wpstg-subdir');\n\n if (subDirectories.style.display === 'none') {\n dom.slideDown(subDirectories);\n } else {\n dom.slideUp(subDirectories);\n }\n }\n\n updateDirectorySelection(element) {\n const parent = element.parentElement;\n if (element.checked) {\n dom.getParents(parent, '.wpstg-dir').forEach((parElem) => {\n for (let i = 0; i < parElem.children.length; i++) {\n if (parElem.children[i].matches('.wpstg-check-dir')) {\n parElem.children[i].checked = true;\n }\n }\n });\n parent.querySelectorAll('.wpstg-expand-dirs').forEach((x) => {\n x.classList.remove('disabled');\n });\n parent.querySelectorAll('.wpstg-subdir .wpstg-check-dir').forEach((x) => {\n x.checked = true;\n });\n } else {\n parent.querySelectorAll('.wpstg-expand-dirs, .wpstg-check-subdirs').forEach((x) => {\n x.classList.add('disabled');\n });\n parent.querySelectorAll('.wpstg-dir .wpstg-check-dir').forEach((x) => {\n x.checked = false;\n });\n }\n }\n\n selectDefaultTables() {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n const options = resetModalContainer.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table');\n const multisitePattern = '^' + this.wpstgObject.tblprefix + '([^0-9])_*';\n const singleSitePattern = '^' + this.wpstgObject.tblprefix;\n options.forEach((option) => {\n const name = option.getAttribute('name', '');\n if (this.wpstgObject.isMultisite === '1' && name.match(multisitePattern)) {\n option.setAttribute('selected', 'selected');\n } else if (this.wpstgObject.isMultisite === '' && name.match(singleSitePattern)) {\n option.setAttribute('selected', 'selected');\n } else {\n option.removeAttribute('selected');\n }\n });\n }\n\n toggleTableSelection() {\n const resetModalContainer = dom.qs('.' + this.resetModalContainerClass);\n if (false === this.isAllTablesChecked) {\n resetModalContainer.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach((option) => {\n option.setAttribute('selected', 'selected');\n });\n resetModalContainer.querySelector('.wpstg-button-unselect').innerHTML = 'Unselect All';\n // cache.get('.wpstg-db-table-checkboxes').prop('checked', true);\n this.isAllTablesChecked = true;\n } else {\n resetModalContainer.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach((option) => {\n option.removeAttribute('selected');\n });\n resetModalContainer.querySelector('.wpstg-button-unselect').innerHTML = 'Select All';\n // cache.get('.wpstg-db-table-checkboxes').prop('checked', false);\n this.isAllTablesChecked = false;\n }\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Handle toggle of advance settings checkboxes\n */\nexport default class WpstgCloningAdvanceSettings {\n constructor(\n baseContainerSelector = '#wpstg-clonepage-wrapper',\n ) {\n this.baseContainer = dom.qs(baseContainerSelector);\n this.checkBoxSettingTogglerSelector = '.wpstg-toggle-advance-settings-section';\n this.init();\n }\n\n /**\n * Add events\n * @return {void}\n */\n addEvents() {\n if (this.baseContainer === null) {\n return;\n }\n\n dom.addEvent(this.baseContainer, 'change', this.checkBoxSettingTogglerSelector, (element) => {\n this.toggleSettings(element);\n });\n }\n\n /**\n * @return {void}\n */\n init() {\n this.addEvents();\n }\n\n /**\n * Expand/Collapse checkbox content on change\n * @return {void}\n */\n toggleSettings(element) {\n const target = dom.qs('#' + element.getAttribute('data-id'));\n if (element.checked) {\n dom.slideDown(target);\n } else {\n dom.slideUp(target);\n }\n }\n}\n","import * as dom from './wpstg-dom-utils.js';\n\nexport default class WpstgMainMenu {\n constructor() {\n this.activeTabClass = 'wpstg--tab--active';\n this.mainMenu();\n }\n\n mainMenu() {\n const tabHeader = dom.qs('.wpstg--tab--header');\n // Early bail if tab header is not available\n if (tabHeader === null) {\n return;\n }\n\n dom.addEvent(dom.qs('.wpstg--tab--header'), 'click', '.wpstg-button', (element) => {\n const $this = element;\n const target = $this.getAttribute('data-target');\n const targetElements = dom.all(target);\n const menuItems = dom.all('.wpstg--tab--header a[data-target]');\n const contents = dom.all('.wpstg--tab--contents > .wpstg--tab--content');\n\n contents.forEach((content) => {\n // active tab class is without the css dot class prefix\n if (content.matches('.' + this.activeTabClass + ':not(' + target + ')')) {\n content.classList.remove(this.activeTabClass);\n }\n });\n\n menuItems.forEach((menuItem) => {\n if (menuItem !== $this) {\n menuItem.classList.remove(this.activeTabClass);\n }\n });\n\n $this.classList.add(this.activeTabClass);\n\n targetElements.forEach((targetElement) => {\n targetElement.classList.add(this.activeTabClass);\n });\n\n if ('#wpstg--tab--backup' === target) {\n window.dispatchEvent(new Event('backups-tab'));\n }\n });\n };\n}\n","import WpstgCloneStaging from './modules/wpstg-clone-staging.js';\nimport WpstgDirectoryNavigation from './modules/wpstg-directory-navigation.js';\nimport WpstgExcludeFilters from './modules/wpstg-exclude-filters.js';\nimport WpstgResetModal from './modules/wpstg-reset-modal.js';\nimport WpstgModal from './modules/wpstg-modal.js';\nimport WpstgCloningAdvanceSettings from './modules/wpstg-cloning-advance-settings.js';\nimport WpstgMainMenu from './modules/wpstg-main-menu.js';\nimport WPStagingCommon from './wpstg.js';\n\nvar WPStaging = (function($) {\n const that = {\n isCancelled: false,\n isFinished: false,\n getLogs: false,\n time: 1,\n executionTime: false,\n progressBar: 0,\n cloneExcludeFilters: null,\n directoryNavigator: null,\n notyf: null,\n areAllTablesChecked: true,\n };\n const cache = {elements: []};\n let timeout; let ajaxSpinner;\n\n /**\n * Get / Set Cache for Selector\n * @param {String} selector\n * @return {*}\n */\n cache.get = function(selector) {\n // It is already cached!\n if ($.inArray(selector, cache.elements) !== -1) {\n return cache.elements[selector];\n }\n\n // Create cache and return\n cache.elements[selector] = jQuery(selector);\n\n return cache.elements[selector];\n };\n\n /**\n * Refreshes given cache\n * @param {String} selector\n */\n cache.refresh = function(selector) {\n selector.elements[selector] = jQuery(selector);\n };\n\n /**\n * Show and Log Error Message\n * @param {String} message\n */\n const showError = function(message) {\n cache.get('#wpstg-try-again').css('display', 'inline-block');\n cache.get('#wpstg-cancel-cloning').text('Reset');\n cache.get('#wpstg-resume-cloning').show();\n cache.get('#wpstg-error-wrapper').show();\n cache.get('#wpstg-error-details').show().html(message);\n cache.get('#wpstg-removing-clone').removeClass('loading');\n cache.get('.wpstg-loader').hide();\n $('.wpstg--modal--process--generic-problem').show().html(message);\n\n // Error event information for Staging\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n dataType: 'json',\n data: {\n 'action': 'wpstg_staging_job_error',\n 'accessToken': wpstg.accessToken,\n 'nonce': wpstg.nonce,\n 'error_message': message,\n },\n });\n };\n\n /**\n * Show warning during cloning or push process when closing tab or browser, or changing page\n * @param {beforeunload} event\n * @return {null}\n */\n that.warnIfClosingDuringProcess = function(event) {\n // Only some browsers show the message below, most say something like \"Changes you made may not be saved\" (Chrome) or \"You have unsaved changes. Exit?\"\n event.returnValue = 'You MUST leave this window open while cloning/pushing. Please wait...';\n return null;\n };\n\n /**\n *\n * @param response the error object\n * @param prependMessage Overwrite default error message at beginning\n * @param appendMessage Overwrite default error message at end\n * @returns void\n */\n\n const showAjaxFatalError = function(response, prependMessage, appendMessage) {\n prependMessage = prependMessage ? prependMessage + '<br/><br/>' : 'Something went wrong! <br/><br/>';\n appendMessage = appendMessage ? appendMessage + '<br/><br/>' : '<br/><br/>Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.';\n\n if (response === false) {\n showError(prependMessage + ' Error: No response.' + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n\n if (typeof response.error !== 'undefined' && response.error) {\n console.error(response.message);\n showError(prependMessage + ' Error: ' + response.message + appendMessage);\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return;\n }\n };\n\n /**\n *\n * @param response\n * @return {{ok}|*}\n */\n const handleFetchErrors = function(response) {\n if (!response.ok) {\n showError('Error: ' + response.status + ' - ' + response.statusText + '. Please try again or contact support.');\n }\n return response;\n };\n\n /** Hide and reset previous thrown visible errors */\n const resetErrors = function() {\n cache.get('#wpstg-error-details').hide().html('');\n };\n\n /**\n * Common Elements\n */\n const elements = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n let urlSpinner = ajaxurl.replace('/admin-ajax.php', '') + '/images/spinner';\n let timer;\n\n if (2 < window.devicePixelRatio) {\n urlSpinner += '-2x';\n }\n\n urlSpinner += '.gif';\n\n ajaxSpinner = '<img src=\\'\\'' + urlSpinner + '\\' alt=\\'\\' class=\\'ajax-spinner general-spinner\\' />';\n\n const getBaseValues = function() {\n const path = $('#wpstg-use-target-dir').data('base-path');\n const uri = $('#wpstg-use-target-hostname').data('base-uri');\n return {\n path,\n };\n };\n\n $workFlow\n .on('change', '#wpstg_network_clone', function(e) {\n e.preventDefault();\n $('.wpstg-button-select').trigger('click');\n })\n // Check / Un-check All Database Tables New\n .on('click', '.wpstg-button-unselect', function(e) {\n e.preventDefault();\n\n if (false === that.areAllTablesChecked) {\n cache.get('#wpstg_select_tables_cloning .wpstg-db-table').prop('selected', 'selected');\n cache.get('.wpstg-button-unselect').text('Unselect All');\n cache.get('.wpstg-db-table-checkboxes').prop('checked', true);\n that.areAllTablesChecked = true;\n } else {\n cache.get('#wpstg_select_tables_cloning .wpstg-db-table').prop('selected', false);\n cache.get('.wpstg-button-unselect').text('Select All');\n cache.get('.wpstg-db-table-checkboxes').prop('checked', false);\n that.areAllTablesChecked = false;\n }\n })\n\n /**\n * Select tables with certain tbl prefix | NEW\n * @param obj e\n * @returns {undefined}\n */\n .on('click', '.wpstg-button-select', function(e) {\n e.preventDefault();\n $('#wpstg_select_tables_cloning .wpstg-db-table').each(function() {\n let regex = '^' + wpstg.tblprefix;\n if (wpstg.isMultisite === '1' && !$('#wpstg_network_clone').is(':checked')) {\n regex += '([^0-9])_*';\n }\n\n if ($(this).attr('name').match(regex)) {\n $(this).prop('selected', 'selected');\n } else {\n $(this).prop('selected', false);\n }\n });\n })\n // Expand Directories\n .on('click', '.wpstg-expand-dirs', function(e) {\n e.preventDefault();\n\n const $this = $(this);\n\n $this.siblings('.wpstg-subdir').slideToggle();\n })\n // When a directory checkbox is Selected\n .on('change', 'input.wpstg-check-dir', function() {\n const $directory = $(this).parent('.wpstg-dir');\n\n if (this.checked) {\n $directory.parents('.wpstg-dir').children('.wpstg-check-dir').prop('checked', true);\n $directory.find('.wpstg-expand-dirs').removeClass('disabled');\n $directory.find('.wpstg-subdir .wpstg-check-dir').prop('checked', true);\n } else {\n $directory.find('.wpstg-dir .wpstg-check-dir').prop('checked', false);\n $directory.find('.wpstg-expand-dirs, .wpstg-check-subdirs').addClass('disabled');\n $directory.find('.wpstg-check-subdirs').data('action', 'check').text('check');\n }\n })\n // When a directory name is Selected\n .on('change', 'href.wpstg-check-dir', function() {\n const $directory = $(this).parent('.wpstg-dir');\n\n if (this.checked) {\n $directory.parents('.wpstg-dir').children('.wpstg-check-dir').prop('checked', true);\n $directory.find('.wpstg-expand-dirs').removeClass('disabled');\n $directory.find('.wpstg-subdir .wpstg-check-dir').prop('checked', true);\n } else {\n $directory.find('.wpstg-dir .wpstg-check-dir').prop('checked', false);\n $directory.find('.wpstg-expand-dirs, .wpstg-check-subdirs').addClass('disabled');\n $directory.find('.wpstg-check-subdirs').data('action', 'check').text('check');\n }\n })\n // Check the max length of the clone name and if the clone name already exists\n .on('keyup', '#wpstg-new-clone-id', function() {\n // Hide previous errors\n document.getElementById('wpstg-error-details').style.display = 'none';\n\n // This request was already sent, clear it up!\n if ('number' === typeof (timer)) {\n clearInterval(timer);\n }\n\n // Early bail if site name is empty\n if (this.value === undefined || this.value === '') {\n cache.get('#wpstg-new-clone-id').removeClass('wpstg-error-input');\n cache.get('#wpstg-start-cloning').removeAttr('disabled');\n cache.get('#wpstg-clone-id-error').text('').hide();\n return;\n }\n\n // Convert the site name to directory name (slugify the site name to create directory name)\n const cloneDirectoryName = WPStagingCommon.slugify(this.value);\n\n timer = setTimeout(\n function() {\n ajax(\n {\n action: 'wpstg_check_clone',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n directoryName: cloneDirectoryName,\n },\n function(response) {\n if (response.status === 'success') {\n cache.get('#wpstg-new-clone-id').removeClass('wpstg-error-input');\n cache.get('#wpstg-start-cloning').removeAttr('disabled');\n cache.get('#wpstg-clone-id-error').text('').hide();\n } else {\n cache.get('#wpstg-new-clone-id').addClass('wpstg-error-input');\n cache.get('#wpstg-start-cloning').prop('disabled', true);\n cache.get('#wpstg-clone-id-error').text(response.message).show();\n }\n },\n );\n },\n 500,\n );\n })\n // Restart cloning process\n .on('click', '#wpstg-start-cloning', function() {\n resetErrors();\n that.isCancelled = false;\n that.getLogs = false;\n that.progressBar = 0;\n })\n .on('input', '#wpstg-new-clone-id', function() {\n if ($('#wpstg-clone-directory').length < 1) {\n return;\n }\n\n const slug = WPStagingCommon.slugify(this.value).substring(0, 16);\n const $targetDir = $('#wpstg-use-target-dir');\n const $targetUri = $('#wpstg-use-target-hostname');\n let path = $targetDir.data('base-path');\n let uri = $targetUri.data('base-uri');\n\n if (path) {\n path = path.replace(/\\/+$/g, '') + '/' + slug + '/';\n }\n\n if (uri) {\n uri = uri.replace(/\\/+$/g, '') + '/' + slug;\n }\n\n\n $('.wpstg-use-target-dir--value').text(path);\n $('.wpstg-use-target-hostname--value').text(uri);\n\n $targetDir.attr('data-path', path);\n $targetUri.attr('data-uri', uri);\n $('#wpstg_clone_dir').attr('placeholder', path);\n $('#wpstg_clone_hostname').attr('placeholder', uri);\n })\n .on('input', '#wpstg_clone_hostname', function() {\n if ($(this).val() === '' || validateTargetHost()) {\n $('#wpstg_clone_hostname_error').remove();\n return;\n }\n if (!validateTargetHost() && !$('#wpstg_clone_hostname_error').length) {\n $('#wpstg-clone-directory tr:last-of-type').after('<tr><td> </td><td><p id=\"wpstg_clone_hostname_error\" style=\"color: red;\"> Invalid host name. Please provide it in a format like http://example.com</p></td></tr>');\n }\n })\n ;\n\n cloneActions();\n };\n\n /* @returns {boolean} */\n var validateTargetHost = function() {\n const the_domain = $('#wpstg_clone_hostname').val();\n\n if (the_domain === '') {\n return true;\n }\n\n const reg = /^http(s)?:\\/\\/.*$/;\n if (reg.test(the_domain) === false) {\n return false;\n }\n return true;\n };\n\n /**\n * Clone actions\n */\n var cloneActions = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n\n $workFlow\n // Cancel cloning\n .on('click', '#wpstg-cancel-cloning', function() {\n if (!confirm('Are you sure you want to cancel cloning process?')) {\n return false;\n }\n\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n $this.prop('disabled', true);\n\n that.isCancelled = true;\n that.progressBar = 0;\n\n $('#wpstg-processing-status').text('Please wait...this can take up a while.');\n $('.wpstg-loader, #wpstg-show-log-button').hide();\n\n $this.parent().append(ajaxSpinner);\n\n cancelCloning();\n })\n // Resume cloning\n .on('click', '#wpstg-resume-cloning', function() {\n resetErrors();\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n\n that.isCancelled = false;\n\n $('#wpstg-processing-status').text('Try to resume cloning process...');\n $('#wpstg-error-details').hide();\n $('.wpstg-loader').show();\n\n $this.parent().append(ajaxSpinner);\n\n that.startCloning();\n })\n // Cancel update cloning\n .on('click', '#wpstg-cancel-cloning-update', function() {\n resetErrors();\n\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n $this.prop('disabled', true);\n\n that.isCancelled = true;\n\n $('#wpstg-cloning-result').text('Please wait...this can take up a while.');\n $('.wpstg-loader, #wpstg-show-log-button').hide();\n\n $this.parent().append(ajaxSpinner);\n\n cancelCloningUpdate();\n })\n // Restart cloning\n .on('click', '#wpstg-restart-cloning', function() {\n resetErrors();\n\n const $this = $(this);\n\n $('#wpstg-try-again, #wpstg-home-link').hide();\n $this.prop('disabled', true);\n\n that.isCancelled = true;\n\n $('#wpstg-cloning-result').text('Please wait...this can take up a while.');\n $('.wpstg-loader, #wpstg-show-log-button').hide();\n\n $this.parent().append(ajaxSpinner);\n\n restart();\n })\n // Delete clone - confirmation\n .on('click', '.wpstg-remove-clone[data-clone]', function(e) {\n resetErrors();\n e.preventDefault();\n\n const $existingClones = cache.get('#wpstg-existing-clones');\n\n $workFlow.removeClass('active');\n\n cache.get('.wpstg-loader').show();\n\n ajax(\n {\n action: 'wpstg_confirm_delete_clone',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n clone: $(this).data('clone'),\n },\n function(response) {\n cache.get('#wpstg-removing-clone').html(response);\n\n $existingClones.children('img').remove();\n\n cache.get('.wpstg-loader').hide();\n\n $('html, body').animate({\n // This logic is meant to be a \"scrollBottom\"\n scrollTop: $('#wpstg-remove-clone').offset().top - $(window).height() +\n $('#wpstg-remove-clone').height() + 50,\n }, 100);\n },\n 'HTML',\n );\n })\n // Delete clone - confirmed\n .on('click', '#wpstg-remove-clone', function(e) {\n resetErrors();\n e.preventDefault();\n\n cache.get('#wpstg-removing-clone').addClass('loading');\n\n cache.get('.wpstg-loader').show();\n\n deleteClone($(this).data('clone'));\n })\n // Cancel deleting clone\n .on('click', '#wpstg-cancel-removing', function(e) {\n e.preventDefault();\n $('.wpstg-clone').removeClass('active');\n cache.get('#wpstg-removing-clone').html('');\n })\n // Update\n .on('click', '.wpstg-execute-clone', function(e) {\n e.preventDefault();\n\n const clone = $(this).data('clone');\n\n $workFlow.addClass('loading');\n that.cloneExcludeFilters = null;\n ajax(\n {\n action: 'wpstg_scanning',\n clone: clone,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response.length < 1) {\n showError(\n 'Something went wrong! Error: No response. Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.',\n );\n }\n\n const jsonResponse = tryParseJson(response);\n if (jsonResponse !== false && jsonResponse.success === false) {\n $workFlow.removeClass('loading');\n showErrorModal(jsonResponse);\n\n return;\n }\n\n $workFlow.removeClass('loading').html(response);\n // register check disk space function for clone update process.\n checkDiskSpace();\n that.directoryNavigator = new WpstgDirectoryNavigation('#wpstg-directories-listing', wpstg, that.notyf);\n that.cloneExcludeFilters = new WpstgExcludeFilters();\n that.switchStep(2);\n },\n 'HTML',\n );\n })\n // Reset Clone\n .on('click', '.wpstg-reset-clone', function(e) {\n e.preventDefault();\n const clone = $(this).data('clone');\n const resetModal = new WpstgResetModal(clone);\n const promise = resetModal.showModal();\n that.areAllTablesChecked = true;\n\n promise.then((result) => {\n if (result.value) {\n const dirNavigator = resetModal.getDirectoryNavigator();\n const exclFilters = resetModal.getExcludeFilters().getExcludeFilters();\n resetClone(clone, {\n includedTables: getIncludedTables(),\n excludeSizeRules: encodeURIComponent(exclFilters.sizes),\n excludeGlobRules: encodeURIComponent(exclFilters.globs),\n excludedDirectories: dirNavigator.getExcludedDirectories(),\n extraDirectories: dirNavigator.getExtraDirectoriesRootOnly(),\n });\n }\n });\n\n return;\n });\n };\n\n /**\n * Ajax Requests\n * @param Object data\n * @param Function callback\n * @param string dataType\n * @param bool showErrors\n * @param int tryCount\n * @param float incrementRatio\n */\n var ajax = function(data, callback, dataType, showErrors, tryCount, incrementRatio = null) {\n if ('undefined' === typeof (dataType)) {\n dataType = 'json';\n }\n\n if (false !== showErrors) {\n showErrors = true;\n }\n\n tryCount = 'undefined' === typeof (tryCount) ? 0 : tryCount;\n\n const retryLimit = 5;\n\n let retryTimeout = 10000 * tryCount;\n\n incrementRatio = parseInt(incrementRatio);\n if (!isNaN(incrementRatio)) {\n retryTimeout *= incrementRatio;\n }\n\n $.ajax({\n url: ajaxurl + '?action=wpstg_processing&_=' + (Date.now() / 1000),\n type: 'POST',\n dataType: dataType,\n cache: false,\n data: data,\n error: function(xhr, textStatus, errorThrown) {\n // try again after 10 seconds\n tryCount++;\n if (tryCount <= retryLimit) {\n console.log('RETRYING ' + tryCount + '/' + retryLimit);\n setTimeout(function() {\n ajax(data, callback, dataType, showErrors, tryCount, incrementRatio);\n return;\n }, retryTimeout);\n } else {\n console.log('RETRYING LIMIT');\n const errorCode = 'undefined' === typeof (xhr.status) ? 'Unknown' : xhr.status;\n showError(\n 'Fatal Error: ' + errorCode + ' Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.',\n );\n }\n },\n success: function(data) {\n if ('function' === typeof (callback)) {\n callback(data);\n }\n },\n statusCode: {\n 404: function() {\n if (tryCount >= retryLimit) {\n showError('Error 404 - Can\\'t find ajax request URL! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 500: function() {\n if (tryCount >= retryLimit) {\n showError('Fatal Error 500 - Internal server error while processing the request! Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.');\n }\n },\n 504: function() {\n if (tryCount > retryLimit) {\n showError('Error 504 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 502: function() {\n if (tryCount >= retryLimit) {\n showError('Error 502 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 503: function() {\n if (tryCount >= retryLimit) {\n showError('Error 503 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 429: function() {\n if (tryCount >= retryLimit) {\n showError('Error 429 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute. If this still not works try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report and contact us.\\n\\ ');\n }\n },\n 403: function() {\n if (tryCount >= retryLimit) {\n showError('Refresh page or login again! The process should be finished successfully. \\n\\ ');\n }\n },\n },\n });\n };\n\n /**\n * Next / Previous Step Clicks to Navigate Through Staging Job\n */\n const stepButtons = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n\n $workFlow\n // Next Button\n .on('click', '.wpstg-next-step-link', function(e) {\n e.preventDefault();\n\n const $this = $(this);\n const isScan = false;\n\n if ($('#wpstg_clone_hostname').length && !validateTargetHost()) {\n $('#wpstg_clone_hostname').focus();\n return false;\n }\n\n if ($this.data('action') === 'wpstg_update' || $this.data('action') === 'wpstg_reset') {\n // Update / Reset Clone - confirmed\n let onlyUpdateMessage = '';\n if ($this.data('action') === 'wpstg_update') {\n onlyUpdateMessage = ' \\n\\nExclude all tables and folders you do not want to overwrite, first! \\n\\nDo not cancel the updating process! This can break your staging site. \\n\\n\\Create a backup of your staging website before you proceed.';\n }\n\n if (!confirm('STOP! This will overwrite your staging site with all selected data from the production site! This should be used only if you want to clone again your production site. Are you sure you want to do this?' + onlyUpdateMessage)) {\n return false;\n }\n }\n\n // Button is disabled\n if ($this.attr('disabled')) {\n return false;\n }\n\n if ($this.data('action') === 'wpstg_cloning') {\n // Verify External Database If Checked and Not Skipped\n if ($('#wpstg-ext-db').is(':checked')) {\n verifyExternalDatabase($this, $workFlow);\n return;\n }\n }\n\n proceedCloning($this, $workFlow);\n })\n // Previous Button\n .on('click', '.wpstg-prev-step-link', function(e) {\n e.preventDefault();\n cache.get('.wpstg-loader').removeClass('wpstg-finished');\n cache.get('.wpstg-loader').hide();\n loadOverview();\n });\n };\n\n /**\n * Get Included (Checked) Database Tables\n * @return {Array}\n */\n const getIncludedTables = function() {\n const includedTables = [];\n\n $('#wpstg_select_tables_cloning option:selected').each(function() {\n includedTables.push(this.value);\n });\n\n return includedTables;\n };\n\n /**\n * Get Excluded (Unchecked) Database Tables\n * Not used anymore!\n * @return {Array}\n */\n const getExcludedTables = function() {\n const excludedTables = [];\n\n $('.wpstg-db-table input:not(:checked)').each(function() {\n excludedTables.push(this.name);\n });\n\n return excludedTables;\n };\n\n /**\n * Verify External Database for Cloning\n */\n var verifyExternalDatabase = function($this, workflow) {\n cache.get('.wpstg-loader').show();\n ajax(\n {\n action: 'wpstg_database_verification',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n databaseUser: cache.get('#wpstg_db_username').val(),\n databasePassword: cache.get('#wpstg_db_password').val(),\n databaseServer: cache.get('#wpstg_db_server').val(),\n databaseDatabase: cache.get('#wpstg_db_database').val(),\n },\n function(response) {\n // Undefined Error\n if (false === response) {\n showError(\n 'Something went wrong! Error: No response.' +\n 'Please try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n cache.get('.wpstg-loader').hide();\n return;\n }\n\n // Throw Error\n if ('undefined' === typeof (response.success)) {\n showError(\n 'Something went wrong! Error: Invalid response.' +\n 'Please try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n cache.get('.wpstg-loader').hide();\n return;\n }\n\n if (response.success) {\n cache.get('.wpstg-loader').hide();\n proceedCloning($this, workflow);\n return;\n }\n\n if (response.error_type === 'comparison') {\n cache.get('.wpstg-loader').hide();\n let render = '<table class=\"wpstg-db-comparison-table\"><thead><tr><th>Property</th><th>Production DB</th><th>Staging DB</th><th>Status</th></tr></thead><tbody>';\n response.checks.forEach((x) => {\n let icon = '<span class=\"wpstg-css-tick\"></span>';\n if (x.production !== x.staging) {\n icon = '<span class=\"wpstg-css-cross\"></span>';\n }\n render += '<tr><td>' + x.name + '</td><td>' + x.production + '</td><td>' + x.staging + '</td><td>' + icon + '</td></tr>';\n });\n render += '</tbody></table><p>Note: Some MySQL/MariaDB properties do not match. You may proceed but the staging site may not work as expected.</p>';\n WPStagingCommon.getSwalModal(true, {\n popup: 'wpstg-swal-popup wpstg-db-comparison-modal centered-modal',\n }).fire({\n title: 'Different Database Properties',\n icon: 'warning',\n html: render,\n width: '650px',\n focusConfirm: false,\n confirmButtonText: 'Proceed',\n showCancelButton: true,\n }).then(function(result) {\n if (result.value) {\n proceedCloning($this, workflow);\n }\n });\n return;\n }\n\n WPStagingCommon.getSwalModal(true).fire({\n title: 'Different Database Properties',\n icon: 'error',\n html: response.message,\n focusConfirm: true,\n confirmButtonText: 'Ok',\n showCancelButton: false,\n });\n cache.get('.wpstg-loader').hide();\n },\n 'json',\n false,\n );\n };\n\n /**\n * Get Cloning Step Data\n */\n const getCloningData = function() {\n if ('wpstg_cloning' !== that.data.action && 'wpstg_update' !== that.data.action && 'wpstg_reset' !== that.data.action) {\n return;\n }\n\n that.data.cloneID = new Date().getTime().toString();\n if ('wpstg_update' === that.data.action) {\n that.data.cloneID = $('#wpstg-new-clone-id').data('clone');\n }\n\n that.data.cloneName = $('#wpstg-new-clone-id').val() || that.data.cloneID;\n\n // Remove this to keep &_POST[] small otherwise mod_security will throw error 404\n // that.data.excludedTables = getExcludedTables();\n\n if (that.directoryNavigator !== null) {\n that.data.excludedDirectories = encodeURIComponent(that.directoryNavigator.getExcludedDirectories());\n that.data.extraDirectories = encodeURIComponent(that.directoryNavigator.getExtraDirectoriesRootOnly());\n }\n\n that.data.excludeGlobRules = '';\n that.data.excludeSizeRules = '';\n if (that.cloneExcludeFilters instanceof WpstgExcludeFilters) {\n const rules = that.cloneExcludeFilters.getExcludeFilters();\n that.data.excludeGlobRules = encodeURIComponent(rules.globs);\n that.data.excludeSizeRules = encodeURIComponent(rules.sizes);\n }\n\n that.data.includedTables = getIncludedTables();\n that.data.databaseServer = $('#wpstg_db_server').val();\n that.data.databaseUser = $('#wpstg_db_username').val();\n that.data.databasePassword = $('#wpstg_db_password').val();\n that.data.databaseDatabase = $('#wpstg_db_database').val();\n that.data.databasePrefix = $('#wpstg_db_prefix').val();\n const cloneDir = $('#wpstg_clone_dir').val();\n that.data.cloneDir = encodeURIComponent($.trim(cloneDir));\n that.data.cloneHostname = $('#wpstg_clone_hostname').val();\n that.data.emailsAllowed = $('#wpstg_allow_emails').is(':checked');\n that.data.networkClone = $('#wpstg_network_clone').is(':checked');\n that.data.uploadsSymlinked = $('#wpstg_symlink_upload').is(':checked');\n that.data.cleanPluginsThemes = $('#wpstg-clean-plugins-themes').is(':checked');\n that.data.cleanUploadsDir = $('#wpstg-clean-uploads').is(':checked');\n };\n\n var proceedCloning = function($this, workflow) {\n // Add loading overlay\n workflow.addClass('loading');\n\n // Prepare data\n that.data = {\n action: $this.data('action'),\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n };\n\n // Cloning data\n getCloningData();\n\n sendCloningAjax(workflow);\n };\n\n var sendCloningAjax = function(workflow) {\n // Send ajax request\n ajax(\n that.data,\n function(response) {\n // Undefined Error\n if (false === response) {\n showError(\n 'Something went wrong!<br/><br/> Go to WP Staging > Settings and lower \\'File Copy Limit\\' and \\'DB Query Limit\\'. Also set \\'CPU Load Priority to low \\'' +\n 'and try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n }\n\n\n if (response.length < 1) {\n showError(\n 'Something went wrong! No response. Go to WP Staging > Settings and lower \\'File Copy Limit\\' and \\'DB Query Limit\\'. Also set \\'CPU Load Priority to low \\'' +\n 'and try again. If that does not help, ' +\n '<a href=\\'https://wp-staging.com/support/\\' target=\\'_blank\\'>open a support ticket</a> ',\n );\n }\n\n const jsonResponse = tryParseJson(response);\n if (jsonResponse !== false && jsonResponse.success === false) {\n workflow.removeClass('loading');\n showErrorModal(jsonResponse);\n\n return;\n }\n\n // Styling of elements\n workflow.removeClass('loading').html(response);\n that.cloneExcludeFilters = null;\n if (that.data.action === 'wpstg_scanning') {\n that.areAllTablesChecked = true;\n that.directoryNavigator = new WpstgDirectoryNavigation('#wpstg-directories-listing', wpstg, that.notyf);\n that.switchStep(2);\n that.cloneExcludeFilters = new WpstgExcludeFilters();\n } else if (that.data.action === 'wpstg_cloning' || that.data.action === 'wpstg_update' || that.data.action === 'wpstg_reset') {\n that.switchStep(3);\n }\n\n // Start cloning\n that.startCloning();\n },\n 'HTML',\n );\n };\n\n var showErrorModal = function(response) {\n const errorModal = new WpstgModal('wpstg_modal_error', wpstg);\n errorModal.show(Object.assign({\n title: 'Error',\n icon: 'error',\n html: wpstg.i18n['somethingWentWrong'],\n width: '500px',\n confirmButtonText: 'Ok',\n showCancelButton: false,\n customClass: {\n confirmButton: 'wpstg--btn--confirm wpstg-blue-primary wpstg-button wpstg-link-btn',\n cancelButton: 'wpstg--btn--cancel wpstg-blue-primary wpstg-link-btn',\n actions: 'wpstg--modal--actions',\n popup: 'wpstg-swal-popup centered-modal',\n },\n buttonsStyling: false,\n reverseButtons: true,\n }, response.swalOptions), {\n type: response.type,\n });\n };\n\n const tryParseJson = function(json) {\n // early bail if not string\n if (!json) {\n return false;\n }\n\n try {\n const object = JSON.parse(json);\n if (object && typeof object === 'object') {\n return object;\n }\n } catch (e) {\n // do nothing on catch\n }\n\n return false;\n };\n\n var resetClone = function(clone, excludeOptions) {\n that.data = {\n action: 'wpstg_reset',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n cloneID: clone,\n };\n\n that.data = {...that.data, ...excludeOptions};\n\n const $workFlow = cache.get('#wpstg-workflow');\n sendCloningAjax($workFlow);\n };\n\n /**\n * Loads Overview (first step) of Staging Job\n */\n var loadOverview = function() {\n const $workFlow = cache.get('#wpstg-workflow');\n\n $workFlow.addClass('loading');\n\n ajax(\n {\n action: 'wpstg_overview',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response.length < 1) {\n showError(\n 'Something went wrong! No response. Please try the <a href=\\'https://wp-staging.com/docs/wp-staging-settings-for-small-servers/\\' target=\\'_blank\\'>WP Staging Small Server Settings</a> or submit an error report.',\n );\n }\n\n const $currentStep = cache.get('.wpstg-current-step');\n\n // Styling of elements\n $workFlow.removeClass('loading').html(response);\n },\n 'HTML',\n );\n\n that.switchStep(1);\n cache.get('.wpstg-step3-cloning').show();\n cache.get('.wpstg-step3-pushing').hide();\n };\n\n /**\n * Load Tabs\n */\n const tabs = function() {\n cache.get('#wpstg-workflow').on('click', '.wpstg-tab-header', function(e) {\n e.preventDefault();\n\n const $this = $(this);\n const $section = cache.get($this.data('id'));\n\n $this.toggleClass('expand');\n\n $section.slideToggle();\n\n const tabTriangle = $this.find('.wpstg-tab-triangle');\n\n if ($this.hasClass('expand')) {\n tabTriangle.removeClass('wpstg-no-icon');\n tabTriangle.text('');\n tabTriangle.addClass('wpstg-rotate-90');\n } else {\n tabTriangle.removeClass('wpstg-rotate-90');\n }\n });\n };\n\n /**\n * Delete Clone\n * @param {String} clone\n */\n var deleteClone = function(clone) {\n const deleteDir = $('#deleteDirectory:checked').data('deletepath');\n\n ajax(\n {\n action: 'wpstg_delete_clone',\n clone: clone,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n excludedTables: getExcludedTables(),\n deleteDir: deleteDir,\n },\n function(response) {\n if (response) {\n showAjaxFatalError(response);\n\n // Finished\n if ('undefined' !== typeof response.delete && (response.delete === 'finished' || response.delete === 'unfinished')) {\n cache.get('#wpstg-removing-clone').removeClass('loading').html('');\n\n if (response.delete === 'finished' && response.error === undefined) {\n $('.wpstg-clone[data-clone-id=\"' + clone + '\"]').remove();\n }\n\n // No staging site message is also of type/class .wpstg-class but hidden\n // We have just excluded that from search when counting no of clones\n if ($('#wpstg-existing-clones .wpstg-clone').length < 1) {\n cache.get('#wpstg-existing-clones').find('h3').text('');\n cache.get('#wpstg-no-staging-site-results').show();\n }\n\n cache.get('.wpstg-loader').hide();\n return;\n }\n }\n // continue\n if (true !== response) {\n deleteClone(clone);\n return;\n }\n },\n );\n };\n\n /**\n * Cancel Cloning Process\n */\n var cancelCloning = function() {\n that.timer('stop');\n\n\n if (true === that.isFinished) {\n return true;\n }\n\n ajax(\n {\n action: 'wpstg_cancel_clone',\n clone: that.data.cloneID,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response && 'undefined' !== typeof (response.delete) && response.delete === 'finished') {\n cache.get('.wpstg-loader').hide();\n // Load overview\n loadOverview();\n return;\n }\n\n if (true !== response) {\n // continue\n cancelCloning();\n return;\n }\n\n // Load overview\n loadOverview();\n },\n );\n };\n\n /**\n * Cancel Cloning Process\n */\n var cancelCloningUpdate = function() {\n if (true === that.isFinished) {\n return true;\n }\n\n ajax(\n {\n action: 'wpstg_cancel_update',\n clone: that.data.cloneID,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response && 'undefined' !== typeof (response.delete) && response.delete === 'finished') {\n // Load overview\n loadOverview();\n return;\n }\n\n if (true !== response) {\n // continue\n cancelCloningUpdate();\n return;\n }\n\n // Load overview\n loadOverview();\n },\n );\n };\n\n /**\n * Cancel Cloning Process\n */\n var restart = function() {\n if (true === that.isFinished) {\n return true;\n }\n\n ajax(\n {\n action: 'wpstg_restart',\n // clone: that.data.cloneID,\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n },\n function(response) {\n if (response && 'undefined' !== typeof (response.delete) && response.delete === 'finished') {\n // Load overview\n loadOverview();\n return;\n }\n\n if (true !== response) {\n // continue\n cancelCloningUpdate();\n return;\n }\n\n // Load overview\n loadOverview();\n },\n );\n };\n\n /**\n * Scroll the window log to bottom\n * @return void\n */\n const logscroll = function() {\n const $div = cache.get('.wpstg-log-details');\n if ('undefined' !== typeof ($div[0])) {\n $div.scrollTop($div[0].scrollHeight);\n }\n };\n\n /**\n * Append the log to the logging window\n * @param string log\n * @return void\n */\n const getLogs = function(log) {\n if (log != null && 'undefined' !== typeof (log)) {\n if (log.constructor === Array) {\n $.each(log, function(index, value) {\n if (value === null) {\n return;\n }\n if (value.type === 'ERROR') {\n cache.get('.wpstg-log-details').append('<span class=\"wpstg--red\">[' + value.type + ']</span>-' + '[' + value.date + '] ' + value.message + '</br>');\n } else {\n cache.get('.wpstg-log-details').append('[' + value.type + ']-' + '[' + value.date + '] ' + value.message + '</br>');\n }\n });\n } else {\n cache.get('.wpstg-log-details').append('[' + log.type + ']-' + '[' + log.date + '] ' + log.message + '</br>');\n }\n }\n logscroll();\n };\n\n /**\n * Check diskspace\n * @return string json\n */\n var checkDiskSpace = function() {\n cache.get('#wpstg-check-space').on('click', function(e) {\n cache.get('.wpstg-loader').show();\n const excludedDirectories = encodeURIComponent(that.directoryNavigator.getExcludedDirectories());\n const extraDirectories = encodeURIComponent(that.directoryNavigator.getExtraDirectoriesRootOnly());\n\n ajax(\n {\n action: 'wpstg_check_disk_space',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n excludedDirectories: excludedDirectories,\n extraDirectories: extraDirectories,\n },\n function(response) {\n if (false === response) {\n cache.get('#wpstg-clone-id-error').text('Can not detect required disk space').show();\n cache.get('.wpstg-loader').hide();\n return;\n }\n\n // Show required disk space\n cache.get('#wpstg-clone-id-error').html(\n 'Estimated necessary disk space: ' + response.requiredSpace +\n (response.errorMessage !== null ? ('<br>' + response.errorMessage) : '') +\n '<br> <span style=\"color:#444;\">Before you proceed ensure your account has enough free disk space to hold the entire instance of the production site. You can check the available space from your hosting account (cPanel or similar).</span>').show();\n cache.get('.wpstg-loader').hide();\n },\n 'json',\n false,\n );\n });\n };\n\n /**\n * Show or hide animated loading icon\n * @param isLoading bool\n */\n const isLoading = function(isLoading) {\n if (!isLoading || isLoading === false) {\n cache.get('.wpstg-loader').hide();\n } else {\n cache.get('.wpstg-loader').show();\n }\n };\n\n /**\n * Count up processing execution time\n * @param string status\n * @return html\n */\n that.timer = function(status) {\n if (status === 'stop') {\n const time = that.time;\n that.time = 1;\n clearInterval(that.executionTime);\n return that.convertSeconds(time);\n }\n\n\n that.executionTime = setInterval(function() {\n if (null !== document.getElementById('wpstg-processing-timer')) {\n document.getElementById('wpstg-processing-timer').innerHTML = 'Elapsed Time: ' + that.convertSeconds(that.time);\n }\n that.time++;\n if (status === 'stop') {\n that.time = 1;\n clearInterval(that.executionTime);\n }\n }, 1000);\n };\n\n /**\n * Convert seconds to hourly format\n * @param int seconds\n * @return string\n */\n that.convertSeconds = function(seconds) {\n const date = new Date(null);\n date.setSeconds(seconds); // specify value for SECONDS here\n return date.toISOString().substr(11, 8);\n };\n\n /**\n * Start Cloning Process\n * @type {Function}\n */\n that.startCloning = (function() {\n resetErrors();\n\n // Register function for checking disk space\n checkDiskSpace();\n\n if ('wpstg_cloning' !== that.data.action && 'wpstg_update' !== that.data.action && 'wpstg_reset' !== that.data.action) {\n return;\n }\n\n that.isCancelled = false;\n\n // Start the process\n start();\n\n // Functions\n // Start\n function start() {\n cache.get('.wpstg-loader').show();\n cache.get('#wpstg-cancel-cloning').text('Cancel');\n cache.get('#wpstg-resume-cloning').hide();\n cache.get('#wpstg-error-details').hide();\n\n\n // Clone Database\n setTimeout(function() {\n // cloneDatabase();\n window.addEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n processing();\n }, wpstg.delayReq);\n\n that.timer('start');\n }\n\n\n /**\n * Start ajax processing\n * @return string\n */\n var processing = function() {\n if (true === that.isCancelled) {\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n return false;\n }\n\n isLoading(true);\n\n let excludedDirectories = '';\n let extraDirectories = '';\n if (that.directoryNavigator !== null) {\n excludedDirectories = that.directoryNavigator.getExcludedDirectories();\n extraDirectories = that.directoryNavigator.getExtraDirectoriesRootOnly();\n }\n\n // Show logging window\n cache.get('.wpstg-log-details').show();\n\n WPStaging.ajax(\n {\n action: 'wpstg_processing',\n accessToken: wpstg.accessToken,\n nonce: wpstg.nonce,\n excludedTables: getExcludedTables(),\n excludedDirectories: encodeURIComponent(excludedDirectories),\n extraDirectories: encodeURIComponent(extraDirectories),\n },\n function(response) {\n showAjaxFatalError(response);\n\n // Add Log messages\n if ('undefined' !== typeof (response.last_msg) && response.last_msg) {\n getLogs(response.last_msg);\n }\n // Continue processing\n if (false === response.status) {\n progressBar(response);\n\n setTimeout(function() {\n cache.get('.wpstg-loader').show();\n processing();\n }, wpstg.delayReq);\n } else if (true === response.status && 'finished' !== response.status) {\n cache.get('#wpstg-error-details').hide();\n cache.get('#wpstg-error-wrapper').hide();\n progressBar(response, true);\n processing();\n } else if ('finished' === response.status || ('undefined' !== typeof (response.job_done) && response.job_done)) {\n window.removeEventListener('beforeunload', WPStaging.warnIfClosingDuringProcess);\n finish(response);\n }\n ;\n },\n 'json',\n false,\n );\n };\n\n // Finish\n function finish(response) {\n if (true === that.getLogs) {\n getLogs();\n }\n\n progressBar(response);\n\n // Add Log\n if ('undefined' !== typeof (response.last_msg)) {\n getLogs(response.last_msg);\n }\n\n cache.get('.wpstg-loader').hide();\n cache.get('#wpstg-processing-header').html('Processing Complete');\n $('#wpstg-processing-status').text('Succesfully finished');\n\n cache.get('#wpstg_staging_name').html(that.data.cloneID);\n cache.get('#wpstg-finished-result').show();\n cache.get('#wpstg-cancel-cloning').hide();\n cache.get('#wpstg-resume-cloning').hide();\n cache.get('#wpstg-cancel-cloning-update').prop('disabled', true);\n\n const $link1 = cache.get('#wpstg-clone-url-1');\n const $link = cache.get('#wpstg-clone-url');\n $link1.attr('href', response.url);\n $link1.html(response.url);\n $link.attr('href', response.url);\n\n cache.get('#wpstg-remove-clone').data('clone', that.data.cloneID);\n\n // Finished\n that.isFinished = true;\n that.timer('stop');\n\n\n cache.get('.wpstg-loader').hide();\n cache.get('#wpstg-processing-header').html('Processing Complete');\n\n // show alert\n let msg = wpstg.i18n.cloneResetComplete;\n if (that.data.action === 'wpstg_update') {\n msg = wpstg.i18n.cloneUpdateComplete;\n }\n\n if (that.data.action === 'wpstg_update' || that.data.action === 'wpstg_reset') {\n cache.get('#wpstg-cancel-cloning-update').hide();\n cache.get('.wpstg-prev-step-link').show();\n\n WPStagingCommon.getSwalModal(true, {\n confirmButton: 'wpstg--btn--confirm wpstg-green-button wpstg-button wpstg-link-btn wpstg-100-width',\n }).fire({\n title: '',\n icon: 'success',\n html: msg,\n width: '500px',\n focusConfirm: true,\n });\n }\n\n return false;\n }\n\n /**\n * Add percentage progress bar\n * @param object response\n * @return {Boolean}\n */\n var progressBar = function(response, restart) {\n if ('undefined' === typeof (response.percentage)) {\n return false;\n }\n\n if (response.job === 'database') {\n cache.get('#wpstg-progress-db').width(response.percentage * 0.2 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 1 of 4 Cloning Database Tables...');\n }\n\n if (response.job === 'SearchReplace') {\n cache.get('#wpstg-progress-db').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-db').html('1. Database');\n // Assumption: All previous steps are done.\n // This avoids bugs where some steps are skipped and the progress bar is incomplete as a result\n cache.get('#wpstg-progress-db').width('20%');\n\n cache.get('#wpstg-progress-sr').width(response.percentage * 0.1 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 2 of 4 Preparing Database Data...');\n }\n\n if (response.job === 'directories') {\n cache.get('#wpstg-progress-sr').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-sr').html('2. Data');\n cache.get('#wpstg-progress-sr').width('10%');\n\n cache.get('#wpstg-progress-dirs').width(response.percentage * 0.1 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 3 of 4 Getting files...');\n }\n if (response.job === 'files') {\n cache.get('#wpstg-progress-dirs').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-dirs').html('3. Files');\n cache.get('#wpstg-progress-dirs').width('10%');\n\n cache.get('#wpstg-progress-files').width(response.percentage * 0.6 + '%').html(response.percentage + '%');\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Step 4 of 4 Copy files...');\n }\n if (response.job === 'finish') {\n cache.get('#wpstg-progress-files').css('background-color', '#3bc36b');\n cache.get('#wpstg-progress-files').html('4. Copy Files');\n cache.get('#wpstg-progress-files').width('60%');\n\n cache.get('#wpstg-processing-status').html(response.percentage.toFixed(0) + '%' + ' - Cloning Process Finished');\n }\n };\n });\n\n that.switchStep = function(step) {\n cache.get('.wpstg-current-step')\n .removeClass('wpstg-current-step');\n cache.get('.wpstg-step' + step)\n .addClass('wpstg-current-step');\n };\n\n /**\n * Initiation\n * @type {Function}\n */\n that.init = (function() {\n loadOverview();\n elements();\n stepButtons();\n tabs();\n WPStagingCommon.listenTooltip();\n new WpstgMainMenu();\n new WpstgCloneStaging();\n new WpstgCloningAdvanceSettings();\n that.notyf = new Notyf({\n duration: 10000,\n position: {\n x: 'center',\n y: 'bottom',\n },\n dismissible: true,\n types: [\n {\n type: 'warning',\n background: 'orange',\n icon: false,\n },\n ],\n });\n });\n\n /**\n * Ajax call\n * @type {ajax}\n */\n that.ajax = ajax;\n that.showError = showError;\n that.getLogs = getLogs;\n that.loadOverview = loadOverview;\n\n return that;\n})(jQuery);\n\njQuery(document).ready(function() {\n WPStaging.init();\n // This is necessary to make WPStaging var accessibile in WP Staging PRO js script\n window.WPStaging = WPStaging;\n});\n\n/**\n * Report Issue modal\n */\njQuery(document).ready(function($) {\n $('body').on('click', '#wpstg-report-issue-button', function(e) {\n console.log('REPORT');\n $('.wpstg--tab--active .wpstg-report-issue-form').toggleClass('wpstg-report-show');\n e.preventDefault();\n });\n\n $('body').on('click', '#wpstg-backups-report-issue-button', function(e) {\n $('.wpstg--tab--active .wpstg-report-issue-form').toggleClass('wpstg-report-show');\n e.preventDefault();\n });\n\n $('body').on('click', '#wpstg-report-cancel', function(e) {\n $('.wpstg--tab--active .wpstg-report-issue-form').removeClass('wpstg-report-show');\n e.preventDefault();\n });\n\n $('body').on('click', '.wpstg--tab--active #wpstg-report-submit', function(e) {\n const self = $(this);\n sendIssueReport(self, 'false');\n e.preventDefault();\n });\n\n /*\n * Close Success Modal\n */\n\n $('body').on('click', '#wpstg-success-button', function(e) {\n e.preventDefault();\n $('.wpstg-report-issue-form').removeClass('wpstg-report-show');\n });\n\n function sendIssueReport(button, forceSend = 'false') {\n const spinner = button.next();\n const email = $('.wpstg--tab--active .wpstg-report-email').val();\n const hosting_provider = $('.wpstg--tab--active .wpstg-report-hosting-provider').val();\n const message = $('.wpstg--tab--active .wpstg-report-description').val();\n const syslog = $('.wpstg--tab--active .wpstg-report-syslog').is(':checked');\n const terms = $('.wpstg--tab--active .wpstg-report-terms').is(':checked');\n\n button.attr('disabled', true);\n spinner.css('visibility', 'visible');\n\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n dataType: 'json',\n async: true,\n data: {\n 'action': 'wpstg_send_report',\n 'accessToken': wpstg.accessToken,\n 'nonce': wpstg.nonce,\n 'wpstg_email': email,\n 'wpstg_provider': hosting_provider,\n 'wpstg_message': message,\n 'wpstg_syslog': +syslog,\n 'wpstg_terms': +terms,\n 'wpstg_force_send': forceSend,\n },\n }).done(function(data) {\n button.attr('disabled', false);\n spinner.css('visibility', 'hidden');\n\n if (data.errors.length > 0) {\n $('.wpstg--tab--active .wpstg-report-issue-form .wpstg-message').remove();\n\n let errorMessage = $('<div />').addClass('wpstg-message wpstg-error-message');\n $.each(data.errors, function(key, value) {\n if (value.status === 'already_submitted') {\n errorMessage = '';\n // TODO: remove default custom classes\n WPStagingCommon.getSwalModal(true, {\n container: 'wpstg-issue-resubmit-confirmation',\n }).fire({\n title: '',\n icon: 'warning',\n html: value.message,\n showCancelButton: true,\n focusConfirm: false,\n confirmButtonText: 'Yes',\n cancelButtonText: 'No',\n }).then((result) => {\n if (result.isConfirmed) {\n sendIssueReport(button, 'true');\n }\n });\n } else {\n errorMessage.append('<p>' + value + '</p>');\n }\n });\n\n $('.wpstg--tab--active .wpstg-report-issue-form').prepend(errorMessage);\n } else {\n const successMessage = $('<div />').addClass('wpstg-message wpstg-success-message');\n successMessage.append('<p>Thanks for submitting your request! You should receive an auto reply mail with your ticket ID immediately for confirmation!<br><br>If you do not get that mail please contact us directly at <strong>support@wp-staging.com</strong></p>');\n\n $('.wpstg--tab--active .wpstg-report-issue-form').html(successMessage);\n $('.wpstg--tab--active .wpstg-success-message').append('<div style=\"float:right;margin-top:10px;\"><a id=\"wpstg-success-button\" href=\"#\" class=\"wpstg--red\">[X] CLOSE</a></div>');\n\n // Hide message\n setTimeout(function() {\n $('.wpstg--tab--active .wpstg-report-issue-form').removeClass('wpstg-report-active');\n }, 2000);\n }\n });\n }\n\n // Open/close actions drop down menu\n $(document).on('click', '.wpstg-dropdown>.wpstg-dropdown-toggler', function(e) {\n e.preventDefault();\n $(e.target).next('.wpstg-dropdown-menu').toggleClass('shown');\n\n $(e.target).find('.wpstg-caret').toggleClass('wpstg-caret-up');\n });\n\n $(document).on('click', '.wpstg-caret', function(e) {\n e.preventDefault();\n\n const toggler = $(e.target).closest('.wpstg-dropdown-toggler');\n\n if (toggler) {\n toggler.trigger('click');\n }\n });\n\n // Close action drop down menu if clicked anywhere outside\n document.addEventListener('click', function(event) {\n const isClickInside = event.target.closest('.wpstg-dropdown-toggler');\n if (!isClickInside) {\n const dropDown = document.getElementsByClassName('wpstg-dropdown-menu');\n for (let i = 0; i < dropDown.length; i++) {\n dropDown[i].classList.remove('shown');\n }\n $('.wpstg-caret').removeClass('wpstg-caret-up');\n }\n });\n\n // \"Event info\" for backup errors\n window.addEventListener('finishedProcessWithError', function(customEvent) {\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n dataType: 'json',\n data: {\n 'action': 'wpstg_job_error',\n 'accessToken': wpstg.accessToken,\n 'nonce': wpstg.nonce,\n 'error_message': customEvent.detail.error,\n 'job_id': WPStagingCommon.getJobId(),\n },\n });\n });\n});\n"],"names":["qs","selector","document","querySelector","all","querySelectorAll","addEvent","parent","evt","handler","addEventListener","event","target","matches","closest","slideDown","element","duration","style","display","overflow","height","offsetHeight","transitionProperty","transitionDuration","setTimeout","window","removeProperty","slideUp","WpstgCloneStaging","pageWrapperId","wpstgObject","wpstg","pageWrapper","dom","enableButtonId","enableAction","notyf","Notyf","position","x","y","dismissible","types","type","background","icon","init","addEvents","this","_this","sendRequest","action","fetch","ajaxUrl","method","credentials","body","URLSearchParams","accessToken","nonce","headers","then","response","ok","json","Promise","reject","data","success","location","reload","message","_this2","error","i18n","console","warn","WpstgDirectoryNavigation","directoryListingSelector","directoryListingContainer","dirCheckboxSelector","dirExpandSelector","unselectAllDirsSelector","selectDefaultDirsSelector","fetchChildrenAction","currentCheckboxElement","currentParentDiv","currentLoader","existingExcludes","excludedDirectories","isDefaultSelected","preventDefault","toggleDirExpand","unselectAll","selectDefault","log","parseExcludes","parentElement","previousSibling","getAttribute","dirPath","value","isChecked","checked","forceDefault","setAttribute","dirContainer","createElement","classList","add","innerHTML","JSON","parse","directoryListing","appendChild","alert","getExcludedDirectories","forEach","_this3","isParentExcluded","push","exclude","isExcludeScanned","join","settings","directorySeparator","path","isParentAlreadyExcluded","dir","startsWith","getExtraDirectoriesRootOnly","extraDirectories","extraDirectoriesTextArea","extraCustomDirectories","split","concat","length","WpstgExcludeFilters","excludeFilterContainerSelector","excludeContainer","excludeTableBody","addFileSizeExclude","addFileExtExclude","addFileNameExclude","addDirNameExclude","clearExcludes","removeExclude","addExcludeRuleRow","templateName","excludeRowTemplate","excludeRow","content","cloneNode","e","removeChild","trim","getExcludeFilters","globExcludes","sizeExcludes","sizeCompares","sizeSizes","sizeByte","Object","entries","key","sizeInput","ext","cleanStringForGlob","fileNamesPos","fileNames","fileInput","fileName","dirNamesPos","dirNames","dirInput","dirName","filter","onlyUnique","index","self","indexOf","replace","WpstgModal","confirmAction","show","swalOptions","additionalParams","callback","wpstgSwal","fire","result","triggerConfirmAction","assign","onOver","onOut","pX","pY","mouseOver","focused","h","state","timer","options","sensitivity","interval","timeout","handleFocus","tracker","clientX","clientY","compare","el","clearTimeout","Math","abs","undefined","dispatchOver","removeEventListener","onMouseOver","dispatchOut","delay","onMouseOut","onFocus","onBlur","removeFocus","opt","focusOptionChanged","remove","$","WPStagingCommon","continueErrorHandle","cache","elements","get","inArray","refresh","setJobId","jobId","localStorage","setItem","getJobId","getItem","listenTooltip","wpstgHoverIntent","visibility","isEmpty","obj","prop","hasOwnProperty","getSwalModal","isContentCentered","customClasses","defaultCustomClasses","confirmButton","cancelButton","actions","popup","customClass","buttonsStyling","reverseButtons","showClass","mixin","showSuccessModal","htmlContent","showConfirmButton","showCancelButton","cancelButtonText","title","html","showWarningModal","showErrorModal","getSwalContainer","getContainer","closeSwalModal","close","getDataFromWordPressResponse","Error","Array","shift","isLoading","hide","slugify","url","toString","toLowerCase","normalize","showAjaxFatalError","prependMessage","appendMessage","showError","WPStaging","warnIfClosingDuringProcess","handleFetchErrors","status","statusText","css","text","removeClass","resetErrors","ajax","dataType","showErrors","tryCount","incrementRatio","errorCallback","retryLimit","retryTimeout","parseInt","isNaN","ajaxurl","Date","now","xhr","textStatus","errorThrown","errorCode","statusCode","jQuery","WpstgResetModal","cloneID","workflowSelector","fetchExcludeSettingsAction","modalErrorAction","workflow","resetButtonClass","resetModalContainerClass","resetTabSelector","directoryNavigator","excludeFilters","isAllTablesChecked","resetModalContainer","toggleContent","selectDefaultTables","toggleTableSelection","toggleDirectoryNavigation","updateDirectorySelection","contentId","tabTriangle","isCollapsed","contains","transform","showModal","swalPromise","loadModal","fetchCloneExcludes","container","getAjaxLoader","width","focusConfirm","confirmButtonText","resetClone","clone","job","modal","renderError","getDirectoryNavigator","wpstgIcon","cbElement","subDirectories","sibling","nextElementSibling","parElem","i","children","multisitePattern","tblprefix","singleSitePattern","option","name","isMultisite","match","removeAttribute","WpstgCloningAdvanceSettings","baseContainerSelector","baseContainer","checkBoxSettingTogglerSelector","toggleSettings","WpstgMainMenu","activeTabClass","mainMenu","$this","targetElements","menuItems","menuItem","targetElement","dispatchEvent","Event","ajaxSpinner","that","isCancelled","isFinished","getLogs","time","executionTime","progressBar","cloneExcludeFilters","areAllTablesChecked","returnValue","validateTargetHost","the_domain","val","test","cloneActions","$workFlow","on","confirm","append","cancelCloning","startCloning","cancelCloningUpdate","restart","$existingClones","animate","scrollTop","offset","top","addClass","deleteClone","jsonResponse","tryParseJson","checkDiskSpace","switchStep","resetModal","promise","dirNavigator","exclFilters","includedTables","getIncludedTables","excludeSizeRules","encodeURIComponent","sizes","excludeGlobRules","globs","each","getExcludedTables","excludedTables","verifyExternalDatabase","databaseUser","databasePassword","databaseServer","databaseDatabase","proceedCloning","error_type","render","checks","production","staging","getTime","cloneName","rules","databasePrefix","cloneDir","cloneHostname","emailsAllowed","is","networkClone","uploadsSymlinked","cleanPluginsThemes","cleanUploadsDir","getCloningData","sendCloningAjax","object","excludeOptions","loadOverview","deleteDir","find","$div","constructor","date","scrollHeight","requiredSpace","errorMessage","clearInterval","convertSeconds","setInterval","getElementById","seconds","setSeconds","toISOString","substr","processing","delayReq","last_msg","job_done","$link1","$link","attr","msg","cloneResetComplete","cloneUpdateComplete","finish","percentage","toFixed","step","urlSpinner","devicePixelRatio","trigger","regex","siblings","slideToggle","$directory","parents","removeAttr","cloneDirectoryName","directoryName","slug","substring","$targetDir","$targetUri","uri","after","focus","onlyUpdateMessage","stepButtons","$section","toggleClass","hasClass","ready","sendIssueReport","button","forceSend","spinner","next","email","hosting_provider","syslog","terms","async","done","errors","isConfirmed","prepend","successMessage","toggler","dropDown","getElementsByClassName","customEvent","detail"],"mappings":"wOAQO,SAASA,EAAGC,UACVC,SAASC,cAAcF,GAOzB,SAASG,EAAIH,UACXC,SAASG,iBAAiBJ,GAM5B,SAASK,EAASC,EAAQC,EAAKP,EAAUQ,GAC9CF,EAAOG,iBAAiBF,GAAK,SAASG,GAChCA,EAAMC,OAAOC,QAAQZ,EAAW,KAAOA,EAAW,OACpDQ,EAAQE,EAAMC,OAAOE,QAAQb,GAAWU,MAEzC,GAGE,SAASI,EAAUC,EAASC,YAAAA,IAAAA,EAAW,KAC5CD,EAAQE,MAAMC,QAAU,QACxBH,EAAQE,MAAME,SAAW,aACnBC,EAASL,EAAQM,aACvBN,EAAQE,MAAMG,OAAS,MACvBL,EAAQE,MAAMK,mBAAqB,SACnCP,EAAQE,MAAMM,mBAAqBP,EAAW,KAC9CQ,YAAW,WACTT,EAAQE,MAAMG,OAASA,EAAS,KAChCK,OAAOD,YAAW,WAChBT,EAAQE,MAAMS,eAAe,UAC7BX,EAAQE,MAAMS,eAAe,YAC7BX,EAAQE,MAAMS,eAAe,uBAC7BX,EAAQE,MAAMS,eAAe,yBAC5BV,KACF,GAGE,SAASW,EAAQZ,EAASC,YAAAA,IAAAA,EAAW,KAC1CD,EAAQE,MAAMC,QAAU,QACxBH,EAAQE,MAAME,SAAW,aACnBC,EAASL,EAAQM,aACvBN,EAAQE,MAAMG,OAASA,EAAS,KAChCL,EAAQE,MAAMK,mBAAqB,SACnCP,EA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Q,SAAU,OACVzO,KAAM,QACM,8BACKpC,MAAM2B,kBACZ3B,MAAM4B,oBACE6d,EAAYC,OAAOhd,aAC1B4J,EAAgBW"}
|
constantsFree.php
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
|
3 |
// WP STAGING version number
|
4 |
if (!defined('WPSTG_VERSION')) {
|
5 |
-
define('WPSTG_VERSION', '2.
|
6 |
}
|
7 |
|
8 |
// Compatible up to WordPress Version
|
9 |
if (!defined('WPSTG_COMPATIBLE')) {
|
10 |
-
define('WPSTG_COMPATIBLE', '5.8.
|
11 |
}
|
2 |
|
3 |
// WP STAGING version number
|
4 |
if (!defined('WPSTG_VERSION')) {
|
5 |
+
define('WPSTG_VERSION', '2.9.0');
|
6 |
}
|
7 |
|
8 |
// Compatible up to WordPress Version
|
9 |
if (!defined('WPSTG_COMPATIBLE')) {
|
10 |
+
define('WPSTG_COMPATIBLE', '5.8.2');
|
11 |
}
|
opcacheBootstrap.php
CHANGED
@@ -45,7 +45,7 @@ if (!$canInvalidate) {
|
|
45 |
*
|
46 |
* We use the "Version" from the headers of the main file of the plugin to compare.
|
47 |
*/
|
48 |
-
$runtimeVersionDifferentFromBuildVersion = get_file_data($pluginFilePath, ['Version' => 'Version'])['Version'] !== '2.
|
49 |
$lastCheckHappenedAfterInterval = current_time('timestamp') > (int)get_site_transient('wpstg.bootstrap.opcache.lastCleared') + 5 * MINUTE_IN_SECONDS;
|
50 |
|
51 |
$shouldClearOpCache = apply_filters('wpstg.bootstrap.opcache.shouldClear', $runtimeVersionDifferentFromBuildVersion && $lastCheckHappenedAfterInterval);
|
45 |
*
|
46 |
* We use the "Version" from the headers of the main file of the plugin to compare.
|
47 |
*/
|
48 |
+
$runtimeVersionDifferentFromBuildVersion = get_file_data($pluginFilePath, ['Version' => 'Version'])['Version'] !== '2.9.0';
|
49 |
$lastCheckHappenedAfterInterval = current_time('timestamp') > (int)get_site_transient('wpstg.bootstrap.opcache.lastCleared') + 5 * MINUTE_IN_SECONDS;
|
50 |
|
51 |
$shouldClearOpCache = apply_filters('wpstg.bootstrap.opcache.shouldClear', $runtimeVersionDifferentFromBuildVersion && $lastCheckHappenedAfterInterval);
|
readme.txt
CHANGED
@@ -9,7 +9,7 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
9 |
Tags: backup, database backup, staging, duplication, clone
|
10 |
Requires at least: 3.6+
|
11 |
Tested up to: 5.8
|
12 |
-
Stable tag: 2.
|
13 |
Requires PHP: 5.5
|
14 |
|
15 |
A backup & duplicator plugin - clone, move, duplicate & migrate websites to staging, backup, and development sites for authorized users only.
|
@@ -82,13 +82,13 @@ This is where WP STAGING comes into play... Site cloning, backup, and staging si
|
|
82 |
|
83 |
== Frequently Asked Questions ==
|
84 |
|
85 |
-
= Why should I use a Staging Website? =
|
86 |
|
87 |
-
Plugin updates and theme customizations should be tested on a staging platform first before they are done on your production website.
|
88 |
-
It's recommended to have the staging platform on the same server where the production website is located to use the same hardware and software environment for your test website and to catch all possible errors during testing.
|
89 |
|
90 |
-
Before you update a plugin or going to install a new one, it is highly recommended to check out the modifications on a clone of your production website.
|
91 |
-
|
92 |
|
93 |
Testing a plugin update before installing it in a production environment isn´t done very often by most users because existing staging solutions are too complex and need a lot of time to create a
|
94 |
an up-to-date copy of your website.
|
@@ -96,14 +96,14 @@ an up-to-date copy of your website.
|
|
96 |
You may be afraid of installing plugins updates because you follow the rule "never touch a running system" with having in mind that untested updates are increasing the risk of breaking your site.
|
97 |
This is one of the main reasons why WordPress installations are often outdated, not updated at all, and insecure because of this non-update behavior.
|
98 |
|
99 |
-
<strong>
|
100 |
|
101 |
-
= How to install and set up? =
|
102 |
Install WP STAGING backup via the admin dashboard. Go to 'Plugins', click 'Add New' and search the plugins for 'WP STAGING'. Install the plugin with 'Install Now'.
|
103 |
After installation, go to WP STAGING > Staging Sites and create your first staging / backup site
|
104 |
|
105 |
= Is this a backup plugin? =
|
106 |
-
Even though you can use WP STAGING for backup purposes, the free version is not a usual backup plugin per
|
107 |
You can even use it as some kind of backup in case something happens to your production site but only the WP STAGING | PRO pro version allows you to download the backup to your local computer. There are many other popular backup plugins out there but our goal is to bring the reliability and performance of a backup plugin to a new level. So instead of offering our backup feature free of charge, we think it's time to provide a full-fledged premium backup solution with enterprise code quality affordable for everyone.
|
108 |
|
109 |
[Video: How we run automated tests for WP STAGING](https://www.youtube.com/watch?v=Tf9C9Pgu7Bs)
|
@@ -179,6 +179,19 @@ https://wp-staging.com
|
|
179 |
|
180 |
== Changelog ==
|
181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
= 2.8.9 =
|
183 |
* New: Show a summary of selected tables and plugins in the backup push selection
|
184 |
* New: Ask user to allow sending non-personalized usage information for improving the backup & staginguser experience
|
@@ -394,146 +407,20 @@ https://wp-staging.com
|
|
394 |
* Fix: Can not delete entire staging site on error
|
395 |
* Fix: Activating pro version does not properly disable free version
|
396 |
|
397 |
-
= 2.8.0 =
|
398 |
-
* Fix: Latest supported WP version is not reflected on wordpress.org plugin repo
|
399 |
-
* Enh: Show confirmation popup if user tries to send another support request within an hour
|
400 |
-
|
401 |
-
= 2.7.9 =
|
402 |
-
* New: Compatible up to WordPress 5.6
|
403 |
-
* Fix: Uninstall function can throw fatal error
|
404 |
-
* Fix: Do not write sensitive information into debug.log if debug mode is active
|
405 |
-
* Fix: Update notification shown even if there is no more recent version
|
406 |
-
* Dev: Memory exhausted during tests
|
407 |
-
* Dev: Prefix composer vendor libraries with PHP-Scoper
|
408 |
-
* Dev: Add more unit and webdriver tests to improve QA
|
409 |
-
* Enh: Change authentication to a combination of nonces and access tokens
|
410 |
-
* Enh: Improve tests performance
|
411 |
-
* Enh: Add tests for database export and restore
|
412 |
-
|
413 |
-
= 2.7.8 =
|
414 |
-
* New: Add special admin notice if plugin is not tested with latest WordPress version
|
415 |
-
* New: Compatible up to WordPress 5.5.2
|
416 |
-
* New: Allow deleting of orphaned staging site entries if staging site was deleted manually before
|
417 |
-
|
418 |
-
* Fix: Activation hook is not fired after first time installation and wpstg optimizer and cron tasks are not set up
|
419 |
-
* Fix: Staging site does not work if database password contains dollar sign in password
|
420 |
-
* Fix: Prevent fatal error when the plugin is activated, but there is no permission to create folder wp-content/uploads/wp-staging or wp-content/uploads/wp-staging/logs.
|
421 |
-
|
422 |
-
* Dev: Add new DI container implementation
|
423 |
-
* Dev: Add composer 2
|
424 |
-
|
425 |
-
= 2.7.7 =
|
426 |
-
* Fix: Fatal error on activation in pro version (Syntax error)
|
427 |
-
|
428 |
-
= 2.7.6 =
|
429 |
-
* New: Compatible up to WordPress 5.5.1
|
430 |
-
* New: Add WP_ENVIRONMENT_TYPE constant for staging site
|
431 |
-
* New: Better and wider test coverage
|
432 |
-
* New: Implementing of automated CI tests
|
433 |
-
* New: Huge code base refactor for cleaner code
|
434 |
-
* New: Updated authentication mechanism for ajax requests
|
435 |
-
* New: Show welcome video message
|
436 |
-
* New: Show message asking for admin credentials on login form
|
437 |
-
* New: Move WP STAGING menu down below the menu Plugins
|
438 |
-
* New: Selected tables are highlighted with a blue background color
|
439 |
-
* Fix: Show access denied message if a non but existing user tries to access the staging site
|
440 |
-
* Fix: Remove wp_logout() in staging site login form to prevent multiple login log entries with plugin WP Activity Log
|
441 |
-
* Fix: Wrong german translations
|
442 |
-
* Fix: Cloning fails if there is no underscore in table prefix
|
443 |
-
|
444 |
-
= 2.7.5 =
|
445 |
-
* New: Compatible up to WordPress 5.4.2
|
446 |
-
* Fix: Remove beta notice
|
447 |
-
* Fix: Error if views are cloned
|
448 |
-
* Fix: Fatal error if WordPress is older than 4.5
|
449 |
-
* Fix: Merge pro/free version
|
450 |
-
* Fix: Step switching logic does not work properly
|
451 |
-
* Fix: Fix progress bar when certains steps are skipped
|
452 |
-
* Fix: Change german translation for REPORT ISSUE
|
453 |
-
|
454 |
-
= 2.7.4 =
|
455 |
-
SKIP VERSION
|
456 |
-
|
457 |
-
= 2.7.3 =
|
458 |
-
* New: Compatible up to WordPress 5.4.1
|
459 |
-
* New: Allow filtering of staging site title
|
460 |
-
* Fix: Since WordPress WP 5.4 cloning fails if WordPress is installed in subfolder
|
461 |
-
* Fix: Loading icon not shown when disk space is checked
|
462 |
-
* Fix: Can not copy tables if prefix is capitalized & has no underscore
|
463 |
-
|
464 |
-
= 2.7.2 =
|
465 |
-
* New: Compatible up to WordPress 5.4
|
466 |
-
* Fix: Fatal error on WordPress 4.6 and older
|
467 |
-
|
468 |
-
= 2.7.1 =
|
469 |
-
* HotFix: Prefix hotfix failed
|
470 |
-
|
471 |
-
= 2.7.0 =
|
472 |
-
* HotFix: Fix fatal error in step 6 after updating to WordPress 5.4
|
473 |
-
|
474 |
-
= 2.6.9 =
|
475 |
-
* Fix: Can not login to staging site under certain circumstances
|
476 |
-
* Fix: Use user selected language setting instead global site based one
|
477 |
-
* Fix: Fatal Error: curl_version() not defined in SystemInfo.php
|
478 |
-
* New: Refactored structure for easier maintenance
|
479 |
-
* New: Core support for WP Staging snapshots
|
480 |
-
* New: Implementing of UnitTests
|
481 |
-
|
482 |
-
= 2.6.8 =
|
483 |
-
* Fix: If server is windows it will result in missing files after cloning and can lead to fatal errors of the staging site
|
484 |
-
|
485 |
-
= 2.6.7 =
|
486 |
-
* Fix: Update function adds duplicate string to internal urls like https://example.com/staging/staging/wp-content/*
|
487 |
-
* New: Support for WP 5.3.2
|
488 |
-
|
489 |
-
= 2.6.6 =
|
490 |
-
* Fix: Fatal error: Cannot redeclare wpstgpro_overwrite_nonce() and wpstg_overwrite_nonce() after activating pro version on top of this free one
|
491 |
-
* Fix: wpdb->prepare() warning after initial cloning
|
492 |
-
|
493 |
-
= 2.6.5 =
|
494 |
-
* New: Support for WordPress 5.3.1
|
495 |
-
* New: Refactoring code base and remove app folder
|
496 |
-
* New: Add french language files
|
497 |
-
* New: Add WP Staging logo to login form
|
498 |
-
* New: Set 24 hours expiration date to process lock
|
499 |
-
* New: Add link URL to staging site title
|
500 |
-
* Fix: Fatal error: Invalid serialization data for DateTime object #91
|
501 |
-
* Fix: Add missing string language location
|
502 |
-
* Fix: Function fnmatch() not available in all systems
|
503 |
-
* Fix: Warning in staging site after initial cloning in db row rewrite_rules
|
504 |
-
* Fix: Wrong staging site is selected when delete function is executed and there are more then 10 staging sites
|
505 |
-
|
506 |
-
= 2.6.4 =
|
507 |
-
* Fix: Broken image folder with duplicate leading slash after cloning
|
508 |
-
|
509 |
-
= 2.6.3 =
|
510 |
-
* New Support for WordPress 5.2.4
|
511 |
-
* New: Allow wildcards for excluding files
|
512 |
-
* New: Add hook "wpstg_clone_action_staging" to execute code on staging site after cloning
|
513 |
-
* Tweak: Improved support for custom uploads folder if user customized UPLOADS constant or upload_path in DB
|
514 |
-
* Fix: Better compatibility with Windows IIS server
|
515 |
-
* Fix: External links are broken after cloning if ABSPATH is equal to /www/
|
516 |
-
* Fix: use an alternative method for file_put_contents as it is not supported on all systems due to file permission issues
|
517 |
-
* Fix: Redundant and duplicated update comments in wp-config.php in staging site
|
518 |
-
|
519 |
-
= 2.6.2 =
|
520 |
-
* Fix: Do not show warning "Preparing Data Step3: Failed to update rewrite_rules in wpstg0_options"
|
521 |
-
* Fix: Change error "Table wpstgtmp_options does not exist" to warning
|
522 |
-
* New: Add arguments for hook wpstg_cloning_complete
|
523 |
-
* New: Setup server environment variables per process and not globally (e.g. set_time_limit)
|
524 |
-
* New: Add support for custom uploads folder if user customized UPLOADS constant or upload_path in DB
|
525 |
-
|
526 |
-
= 2.6.1 =
|
527 |
-
* New: Improve styling of login form. Thanks to Andy Kennan (Screaming Frog)
|
528 |
-
* New: Add 'password lost' button to login form
|
529 |
-
* New: Change welcome page CTA
|
530 |
-
* New: Add feedback option when plugin is disabled
|
531 |
-
* Fix: PDO instances can not be serialized or unserialized
|
532 |
-
* Fix: Can not update staging site db table if there are constraints in it
|
533 |
-
|
534 |
Full changelog: [https://wp-staging.com/wp-staging-changelog](https://wp-staging.com/wp-staging-changelog)
|
535 |
|
536 |
== Upgrade Notice ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
537 |
* Enh: Refactor the wp_login action hook to work with different parameter count than the one in WordPress Core #1223
|
538 |
* Enh: Sort new staging backup sites in descending order by creation time #1226
|
539 |
* Enh: Warn if creating a backup in PHP 32 bit version #1231
|
9 |
Tags: backup, database backup, staging, duplication, clone
|
10 |
Requires at least: 3.6+
|
11 |
Tested up to: 5.8
|
12 |
+
Stable tag: 2.9.0
|
13 |
Requires PHP: 5.5
|
14 |
|
15 |
A backup & duplicator plugin - clone, move, duplicate & migrate websites to staging, backup, and development sites for authorized users only.
|
82 |
|
83 |
== Frequently Asked Questions ==
|
84 |
|
85 |
+
= Why should I use a Backup & Staging Website? =
|
86 |
|
87 |
+
Plugin updates and theme customizations should be tested on a staging / backup platform first before they are done on your production website.
|
88 |
+
It's recommended to have the staging / backup platform on the same server where the production website is located to use the same hardware and software environment for your test & backup website and to catch all possible errors during testing.
|
89 |
|
90 |
+
Before you update a plugin or going to install a new one, it is highly recommended to check out the modifications on a clone / backup of your production website.
|
91 |
+
That ensures that any modifications work on your production website without throwing unexpected errors or preventing your site from loading, better known as the "WordPress blank page error".
|
92 |
|
93 |
Testing a plugin update before installing it in a production environment isn´t done very often by most users because existing staging solutions are too complex and need a lot of time to create a
|
94 |
an up-to-date copy of your website.
|
96 |
You may be afraid of installing plugins updates because you follow the rule "never touch a running system" with having in mind that untested updates are increasing the risk of breaking your site.
|
97 |
This is one of the main reasons why WordPress installations are often outdated, not updated at all, and insecure because of this non-update behavior.
|
98 |
|
99 |
+
<strong>It's time to change this, so there is no easier way than using "WP STAGING" for cloning, backup, and migration of your WordPress website.</strong>
|
100 |
|
101 |
+
= How to install and set up a staging site / site backup? =
|
102 |
Install WP STAGING backup via the admin dashboard. Go to 'Plugins', click 'Add New' and search the plugins for 'WP STAGING'. Install the plugin with 'Install Now'.
|
103 |
After installation, go to WP STAGING > Staging Sites and create your first staging / backup site
|
104 |
|
105 |
= Is this a backup plugin? =
|
106 |
+
Even though you can use WP STAGING for backup purposes, the free version is not a usual backup plugin per general definition. WP STAGING creates a clone of your entire website which you can immediately use for developing and testing.
|
107 |
You can even use it as some kind of backup in case something happens to your production site but only the WP STAGING | PRO pro version allows you to download the backup to your local computer. There are many other popular backup plugins out there but our goal is to bring the reliability and performance of a backup plugin to a new level. So instead of offering our backup feature free of charge, we think it's time to provide a full-fledged premium backup solution with enterprise code quality affordable for everyone.
|
108 |
|
109 |
[Video: How we run automated tests for WP STAGING](https://www.youtube.com/watch?v=Tf9C9Pgu7Bs)
|
179 |
|
180 |
== Changelog ==
|
181 |
|
182 |
+
= 2.9.0 =
|
183 |
+
* New: Compatible up to WordPress 5.8.2
|
184 |
+
* Fix: Update notice is shown even when using latest version #1398
|
185 |
+
* Fix: Backup & cloning 100% compatible with PHP 8.0.12 #1281
|
186 |
+
* Fix: Skip search replace on backup & cloning query if it's size exceed preg functions limit #1404
|
187 |
+
* Fix: Skip inserting backup & cloning query if it exceeds mysql max_allowed_package. Show warning to user #1405
|
188 |
+
* Fix: Make db option wpstg_staging_sites always return an array #1413
|
189 |
+
* Fix: Fix dependency injection for backup notices class. Solve conflict with TranslatePress #1416
|
190 |
+
* Tweak: Use php version number as tag for php docker container #1407
|
191 |
+
* Tweak: Improve symlink tooltip text #1411
|
192 |
+
* Tweak: Refactor WP STAGING Pro to WP STAGING | PRO in notices #1409
|
193 |
+
* Tweak: Remove 16 characters limitation for the backup & CLONE NAME and keep it for CLONE DIRECTORY #1412
|
194 |
+
|
195 |
= 2.8.9 =
|
196 |
* New: Show a summary of selected tables and plugins in the backup push selection
|
197 |
* New: Ask user to allow sending non-personalized usage information for improving the backup & staginguser experience
|
407 |
* Fix: Can not delete entire staging site on error
|
408 |
* Fix: Activating pro version does not properly disable free version
|
409 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
Full changelog: [https://wp-staging.com/wp-staging-changelog](https://wp-staging.com/wp-staging-changelog)
|
411 |
|
412 |
== Upgrade Notice ==
|
413 |
+
* Fix: Update notice is shown even when using latest version #1398
|
414 |
+
* Fix: Backup & cloning 100% compatible with PHP 8.0.12 #1281
|
415 |
+
* Fix: Skip search replace on backup & cloning query if it's size exceed preg functions limit #1404
|
416 |
+
* Fix: Skip inserting backup & cloning query if it exceeds mysql max_allowed_package. Show warning to user #1405
|
417 |
+
* Fix: Make db option wpstg_staging_sites always return an array #1413
|
418 |
+
* Fix: Fix dependency injection for backup notices class. Solve conflict with TranslatePress #1416
|
419 |
+
* Tweak: Use php version number as tag for php docker container #1407
|
420 |
+
* Tweak: Improve symlink tooltip text #1411
|
421 |
+
* Tweak: Refactor WP STAGING Pro to WP STAGING | PRO in notices #1409
|
422 |
+
* Tweak: Remove 16 characters limitation for the backup & CLONE NAME and keep it for CLONE DIRECTORY #1412
|
423 |
+
|
424 |
* Enh: Refactor the wp_login action hook to work with different parameter count than the one in WordPress Core #1223
|
425 |
* Enh: Sort new staging backup sites in descending order by creation time #1226
|
426 |
* Enh: Warn if creating a backup in PHP 32 bit version #1231
|
vendor_wpstg/autoload/src.php
CHANGED
@@ -181,7 +181,7 @@ return array(
|
|
181 |
'WPStaging\\Framework\\Filesystem\\DebugLogReader' => $baseDir . '/Framework/Filesystem/DebugLogReader.php',
|
182 |
'WPStaging\\Framework\\Filesystem\\DirectoryListing' => $baseDir . '/Framework/Filesystem/DirectoryListing.php',
|
183 |
'WPStaging\\Framework\\Filesystem\\DiskWriteCheck' => $baseDir . '/Framework/Filesystem/DiskWriteCheck.php',
|
184 |
-
'WPStaging\\Framework\\Filesystem\\
|
185 |
'WPStaging\\Framework\\Filesystem\\Filesystem' => $baseDir . '/Framework/Filesystem/Filesystem.php',
|
186 |
'WPStaging\\Framework\\Filesystem\\FilesystemExceptions' => $baseDir . '/Framework/Filesystem/FilesystemExceptions.php',
|
187 |
'WPStaging\\Framework\\Filesystem\\FilterableDirectoryIterator' => $baseDir . '/Framework/Filesystem/FilterableDirectoryIterator.php',
|
181 |
'WPStaging\\Framework\\Filesystem\\DebugLogReader' => $baseDir . '/Framework/Filesystem/DebugLogReader.php',
|
182 |
'WPStaging\\Framework\\Filesystem\\DirectoryListing' => $baseDir . '/Framework/Filesystem/DirectoryListing.php',
|
183 |
'WPStaging\\Framework\\Filesystem\\DiskWriteCheck' => $baseDir . '/Framework/Filesystem/DiskWriteCheck.php',
|
184 |
+
'WPStaging\\Framework\\Filesystem\\FileObject' => $baseDir . '/Framework/Filesystem/FileObject.php',
|
185 |
'WPStaging\\Framework\\Filesystem\\Filesystem' => $baseDir . '/Framework/Filesystem/Filesystem.php',
|
186 |
'WPStaging\\Framework\\Filesystem\\FilesystemExceptions' => $baseDir . '/Framework/Filesystem/FilesystemExceptions.php',
|
187 |
'WPStaging\\Framework\\Filesystem\\FilterableDirectoryIterator' => $baseDir . '/Framework/Filesystem/FilterableDirectoryIterator.php',
|
wp-staging-error-handler.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
/*
|
4 |
-
* Low-level error handler and debugger for
|
5 |
*/
|
6 |
|
7 |
namespace WPStaging\functions;
|
@@ -34,7 +34,7 @@ function debug_log($message, $logType = 'info')
|
|
34 |
}
|
35 |
|
36 |
$message = sprintf(
|
37 |
-
"[
|
38 |
$logType,
|
39 |
current_time('mysql'),
|
40 |
$message
|
@@ -46,7 +46,7 @@ function debug_log($message, $logType = 'info')
|
|
46 |
}
|
47 |
|
48 |
/**
|
49 |
-
* Logs fatal errors in the
|
50 |
*/
|
51 |
function shutdown_function()
|
52 |
{
|
@@ -104,7 +104,7 @@ function shutdown_function()
|
|
104 |
$fileHandler = fopen(WPSTG_DEBUG_LOG_FILE, 'a');
|
105 |
|
106 |
$message = sprintf(
|
107 |
-
"[
|
108 |
$allErrorTypes[$error['type']],
|
109 |
current_time('mysql'),
|
110 |
$error['message'],
|
1 |
<?php
|
2 |
|
3 |
/*
|
4 |
+
* Low-level error handler and debugger for WP STAGING
|
5 |
*/
|
6 |
|
7 |
namespace WPStaging\functions;
|
34 |
}
|
35 |
|
36 |
$message = sprintf(
|
37 |
+
"[WP STAGING Manual Logging][%s][%s] %s\n",
|
38 |
$logType,
|
39 |
current_time('mysql'),
|
40 |
$message
|
46 |
}
|
47 |
|
48 |
/**
|
49 |
+
* Logs fatal errors in the WP STAGING debug file.
|
50 |
*/
|
51 |
function shutdown_function()
|
52 |
{
|
104 |
$fileHandler = fopen(WPSTG_DEBUG_LOG_FILE, 'a');
|
105 |
|
106 |
$message = sprintf(
|
107 |
+
"[WP STAGING Shutdown Function][%s][%s] %s - File: %s Line: %s Fatal? %s Comes from WP STAGING? %s\n",
|
108 |
$allErrorTypes[$error['type']],
|
109 |
current_time('mysql'),
|
110 |
$error['message'],
|
wp-staging.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* Author: WP-STAGING
|
8 |
* Author URI: https://wp-staging.com
|
9 |
* Contributors: ReneHermi
|
10 |
-
* Version: 2.
|
11 |
* Text Domain: wp-staging
|
12 |
* Domain Path: /languages/
|
13 |
*
|
7 |
* Author: WP-STAGING
|
8 |
* Author URI: https://wp-staging.com
|
9 |
* Contributors: ReneHermi
|
10 |
+
* Version: 2.9.0
|
11 |
* Text Domain: wp-staging
|
12 |
* Domain Path: /languages/
|
13 |
*
|