WP Staging – DB & File Duplicator & Migration - Version 2.9.14

Version Description

  • Fix: Certain default plugins like wps-hide are not excluded anymore during cloning #1742
  • Fix: Scheduled backup not always executed #1754
  • Fix: Backup folder is deleted during backup restore on Windows OS #1737
  • Fix: On backup restore retry deleting an item again in next request instead of re adding it at the end of queue, if item isn't completely deleted in current request #1758
  • Enh: Refactor normalizePath() #1751
  • Enh: Optimize table selection to reduce POST characters. Send either selected tables or excluded tables whichever is smaller along to reduce the POST size for cloning and pushing #1727
  • Enh: Allow automatic update of WP STAGING | PRO on the staging site. It can still be disabled using the filter wpstg.notices.disable.plugin-update-notice #1749
  • Enh: Add filter wpstg.backup.restore.extended-search-replace. The extended search replace allow properly replacing to destination URL for some plugins like rev-sliders in backup restore #1741
Download this release

Release Info

Developer ReneHermi
Plugin Icon 128x128 WP Staging – DB & File Duplicator & Migration
Version 2.9.14
Comparing to
See all releases

Code changes from version 2.9.13 to 2.9.14

Backend/Administrator.php CHANGED
@@ -38,6 +38,7 @@ use WPStaging\Backend\Feedback;
38
  use WPStaging\Backend\Pro\Modules\Jobs\Processing;
39
  use WPStaging\Backend\Pro\Modules\Jobs\Backups\BackupUploadsDir;
40
  use WPStaging\Backend\Pluginmeta\Pluginmeta;
 
41
  use WPStaging\Pro\Backup\BackupScheduler;
42
 
43
  /**
@@ -1114,16 +1115,21 @@ class Administrator
1114
  $scan = new Pro\Modules\Jobs\Scan();
1115
 
1116
  $scan->start();
1117
-
 
 
 
 
 
1118
  $templateEngine = new TemplateEngine();
1119
 
1120
  echo json_encode([
1121
  'success' => true,
1122
  "content" => $templateEngine->render("/Backend/Pro/views/selections/tables.php", [
1123
  'isNetworkClone' => $scan->isNetworkClone(),
1124
- 'options' => $scan->getOptions(),
1125
  'showAll' => true,
1126
- 'selected' => isset($_POST['tables']) ? explode(',', $_POST['tables']) : false
1127
  ])
1128
  ]);
1129
 
38
  use WPStaging\Backend\Pro\Modules\Jobs\Processing;
39
  use WPStaging\Backend\Pro\Modules\Jobs\Backups\BackupUploadsDir;
40
  use WPStaging\Backend\Pluginmeta\Pluginmeta;
41
+ use WPStaging\Framework\Database\SelectedTables;
42
  use WPStaging\Pro\Backup\BackupScheduler;
43
 
44
  /**
1115
  $scan = new Pro\Modules\Jobs\Scan();
1116
 
1117
  $scan->start();
1118
+ $options = $scan->getOptions();
1119
+
1120
+ $selectedTables = new SelectedTables($_POST['includedTables'], $_POST['excludedTables'], $_POST['selectedTablesWithoutPrefix']);
1121
+ $selectedTables->setDatabaseInfo($options->databaseServer, $options->databaseUser, $options->databasePassword, $options->databaseDatabase, empty($options->databasePrefix) ? $options->prefix : $options->databasePrefix);
1122
+ $tables = $selectedTables->getSelectedTables($options->networkClone);
1123
+
1124
  $templateEngine = new TemplateEngine();
1125
 
1126
  echo json_encode([
1127
  'success' => true,
1128
  "content" => $templateEngine->render("/Backend/Pro/views/selections/tables.php", [
1129
  'isNetworkClone' => $scan->isNetworkClone(),
1130
+ 'options' => $options,
1131
  'showAll' => true,
1132
+ 'selected' => $tables
1133
  ])
1134
  ]);
1135
 
Backend/Modules/Jobs/Cloning.php CHANGED
@@ -7,6 +7,7 @@ use WPStaging\Backend\Modules\Jobs\Exceptions\JobNotFoundException;
7
  use WPStaging\Core\Utils\Helper;
8
  use WPStaging\Core\WPStaging;
9
  use WPStaging\Framework\Analytics\Actions\AnalyticsStagingCreate;
 
10
  use WPStaging\Framework\Filesystem\Scanning\ScanConst;
11
  use WPStaging\Framework\Security\AccessToken;
12
  use WPStaging\Framework\Staging\Sites;
@@ -125,13 +126,15 @@ class Cloning extends Job
125
  $this->options->cloneNumber = count($this->options->existingClones) + 1;
126
  }
127
 
128
- // Included Tables
129
- if (isset($_POST["includedTables"]) && is_array($_POST["includedTables"])) {
130
- $this->options->tables = $_POST["includedTables"];
131
- } else {
132
- $this->options->tables = [];
133
  }
134
 
 
 
 
 
135
  // Exclude File Size Rules
136
  $this->options->excludeSizeRules = [];
137
  if (!empty($_POST["excludeSizeRules"])) {
@@ -215,11 +218,6 @@ class Cloning extends Job
215
  );
216
  }
217
 
218
- $this->options->networkClone = false;
219
- if ($this->isMultisiteAndPro() && is_main_site()) {
220
- $this->options->networkClone = isset($_POST['networkClone']) && $_POST['networkClone'] !== "false";
221
- }
222
-
223
  $this->options->destinationHostname = $this->getDestinationHostname();
224
  $this->options->destinationDir = $this->getDestinationDir();
225
 
7
  use WPStaging\Core\Utils\Helper;
8
  use WPStaging\Core\WPStaging;
9
  use WPStaging\Framework\Analytics\Actions\AnalyticsStagingCreate;
10
+ use WPStaging\Framework\Database\SelectedTables;
11
  use WPStaging\Framework\Filesystem\Scanning\ScanConst;
12
  use WPStaging\Framework\Security\AccessToken;
13
  use WPStaging\Framework\Staging\Sites;
126
  $this->options->cloneNumber = count($this->options->existingClones) + 1;
127
  }
128
 
129
+ $this->options->networkClone = false;
130
+ if ($this->isMultisiteAndPro() && is_main_site()) {
131
+ $this->options->networkClone = isset($_POST['networkClone']) && $_POST['networkClone'] !== "false";
 
 
132
  }
133
 
134
+ // Included Tables / Prefixed Table - Excluded Tables
135
+ $selectedTables = new SelectedTables($_POST['includedTables'], $_POST['excludedTables'], $_POST['selectedTablesWithoutPrefix']);
136
+ $this->options->tables = $selectedTables->getSelectedTables($this->options->networkClone);
137
+
138
  // Exclude File Size Rules
139
  $this->options->excludeSizeRules = [];
140
  if (!empty($_POST["excludeSizeRules"])) {
218
  );
219
  }
220
 
 
 
 
 
 
221
  $this->options->destinationHostname = $this->getDestinationHostname();
222
  $this->options->destinationDir = $this->getDestinationDir();
223
 
Backend/Modules/Jobs/Directories.php CHANGED
@@ -68,7 +68,7 @@ class Directories extends JobExecutable
68
  $this->wpDirectories = new WpDefaultDirectories();
69
  $this->strUtils = new Strings();
70
  $this->filesystem = WPStaging::make(Filesystem::class);
71
- $this->rootPath = $this->filesystem->normalizePath(ABSPATH, true);
72
  }
73
 
74
  /**
@@ -140,7 +140,7 @@ class Directories extends JobExecutable
140
  return true;
141
  }
142
 
143
- $directory = $this->filesystem->normalizePath($directory);
144
  $relPath = str_replace($this->rootPath, '', $directory);
145
 
146
  // Skip it
@@ -165,7 +165,7 @@ class Directories extends JobExecutable
165
  ];
166
 
167
  // Exclude predefined plugins if given directory is plugins dir
168
- if (WP_PLUGIN_DIR === $directory) {
169
  $excludePaths[] = '**/wp-staging*/**/node_modules'; // only exclude node modules in WP Staging's plugins
170
  // add excluded plugins defined by WP Staging
171
  $excludePaths = array_merge((new ExcludedPlugins())->getPluginsToExcludeWithRelativePath(), $excludePaths);
@@ -192,7 +192,7 @@ class Directories extends JobExecutable
192
  {
193
  $directory = WP_CONTENT_DIR;
194
 
195
- $directory = $this->filesystem->normalizePath($directory);
196
  $relPath = str_replace($this->rootPath, '', $directory);
197
 
198
  // Skip it
@@ -238,7 +238,7 @@ class Directories extends JobExecutable
238
  {
239
  $directory = ABSPATH . 'wp-includes';
240
 
241
- $directory = $this->filesystem->normalizePath($directory);
242
  $relPath = str_replace($this->rootPath, '', $directory);
243
 
244
  // Skip it
@@ -272,7 +272,7 @@ class Directories extends JobExecutable
272
  {
273
  $directory = ABSPATH . 'wp-admin';
274
 
275
- $directory = $this->filesystem->normalizePath($directory);
276
  $relPath = str_replace($this->rootPath, '', $directory);
277
 
278
  // Skip it
68
  $this->wpDirectories = new WpDefaultDirectories();
69
  $this->strUtils = new Strings();
70
  $this->filesystem = WPStaging::make(Filesystem::class);
71
+ $this->rootPath = $this->filesystem->normalizePath(ABSPATH);
72
  }
73
 
74
  /**
140
  return true;
141
  }
142
 
143
+ $directory = $this->filesystem->normalizePath($directory, true);
144
  $relPath = str_replace($this->rootPath, '', $directory);
145
 
146
  // Skip it
165
  ];
166
 
167
  // Exclude predefined plugins if given directory is plugins dir
168
+ if ($this->filesystem->normalizePath(WP_PLUGIN_DIR) === $directory) {
169
  $excludePaths[] = '**/wp-staging*/**/node_modules'; // only exclude node modules in WP Staging's plugins
170
  // add excluded plugins defined by WP Staging
171
  $excludePaths = array_merge((new ExcludedPlugins())->getPluginsToExcludeWithRelativePath(), $excludePaths);
192
  {
193
  $directory = WP_CONTENT_DIR;
194
 
195
+ $directory = $this->filesystem->normalizePath($directory, true);
196
  $relPath = str_replace($this->rootPath, '', $directory);
197
 
198
  // Skip it
238
  {
239
  $directory = ABSPATH . 'wp-includes';
240
 
241
+ $directory = $this->filesystem->normalizePath($directory, true);
242
  $relPath = str_replace($this->rootPath, '', $directory);
243
 
244
  // Skip it
272
  {
273
  $directory = ABSPATH . 'wp-admin';
274
 
275
+ $directory = $this->filesystem->normalizePath($directory, true);
276
  $relPath = str_replace($this->rootPath, '', $directory);
277
 
278
  // Skip it
Backend/Modules/Jobs/Files.php CHANGED
@@ -63,9 +63,9 @@ class Files extends JobExecutable
63
  /** @var Filesystem */
64
  $this->filesystem = WPStaging::make(Filesystem::class);
65
 
66
- $this->rootPath = $this->filesystem->normalizePath(WPStaging::getWPpath(), true);
67
 
68
- $this->destination = $this->filesystem->normalizePath($this->options->destinationDir, true);
69
 
70
  $filePath = $this->cache->getCacheDir() . "files_to_copy." . $this->cache->getCacheExtension();
71
 
@@ -352,7 +352,7 @@ class Files extends JobExecutable
352
  {
353
  $file = trim(WPStaging::getWPpath() . $file);
354
 
355
- $file = $this->filesystem->normalizePath($file, true);
356
 
357
  $directory = dirname($file);
358
 
@@ -442,7 +442,7 @@ class Files extends JobExecutable
442
  */
443
  private function getDestination($file)
444
  {
445
- $file = $this->filesystem->normalizePath($file, true);
446
  $relativePath = str_replace($this->rootPath, '', $file);
447
  $destinationPath = $this->destination . $relativePath;
448
  $destinationDirectory = dirname($destinationPath);
@@ -453,7 +453,7 @@ class Files extends JobExecutable
453
  return false;
454
  }
455
 
456
- return $this->filesystem->normalizePath($destinationPath, true);
457
  }
458
 
459
  /**
63
  /** @var Filesystem */
64
  $this->filesystem = WPStaging::make(Filesystem::class);
65
 
66
+ $this->rootPath = $this->filesystem->normalizePath(WPStaging::getWPpath());
67
 
68
+ $this->destination = $this->filesystem->normalizePath($this->options->destinationDir);
69
 
70
  $filePath = $this->cache->getCacheDir() . "files_to_copy." . $this->cache->getCacheExtension();
71
 
352
  {
353
  $file = trim(WPStaging::getWPpath() . $file);
354
 
355
+ $file = $this->filesystem->normalizePath($file);
356
 
357
  $directory = dirname($file);
358
 
442
  */
443
  private function getDestination($file)
444
  {
445
+ $file = $this->filesystem->normalizePath($file);
446
  $relativePath = str_replace($this->rootPath, '', $file);
447
  $destinationPath = $this->destination . $relativePath;
448
  $destinationDirectory = dirname($destinationPath);
453
  return false;
454
  }
455
 
456
+ return $this->filesystem->normalizePath($destinationPath);
457
  }
458
 
459
  /**
Backend/Modules/Jobs/Updating.php CHANGED
@@ -5,6 +5,7 @@ namespace WPStaging\Backend\Modules\Jobs;
5
  use WPStaging\Core\WPStaging;
6
  use WPStaging\Core\Utils\Helper;
7
  use WPStaging\Framework\Adapter\Database as DatabaseAdapter;
 
8
  use WPStaging\Framework\Filesystem\Scanning\ScanConst;
9
  use WPStaging\Framework\Database\TableService;
10
  use WPStaging\Framework\Utils\SlashMode;
@@ -227,12 +228,9 @@ class Updating extends Job
227
 
228
  private function setTablesForUpdateJob()
229
  {
230
- // Included Tables
231
- if (isset($_POST["includedTables"]) && is_array($_POST["includedTables"])) {
232
- $this->options->tables = $_POST["includedTables"];
233
- } else {
234
- $this->options->tables = [];
235
- }
236
  }
237
 
238
  /**
5
  use WPStaging\Core\WPStaging;
6
  use WPStaging\Core\Utils\Helper;
7
  use WPStaging\Framework\Adapter\Database as DatabaseAdapter;
8
+ use WPStaging\Framework\Database\SelectedTables;
9
  use WPStaging\Framework\Filesystem\Scanning\ScanConst;
10
  use WPStaging\Framework\Database\TableService;
11
  use WPStaging\Framework\Utils\SlashMode;
228
 
229
  private function setTablesForUpdateJob()
230
  {
231
+ // Included Tables / Prefixed Table - Excluded Tables
232
+ $selectedTables = new SelectedTables($_POST['includedTables'], $_POST['excludedTables'], $_POST['selectedTablesWithoutPrefix']);
233
+ $this->options->tables = $selectedTables->getSelectedTables($this->options->networkClone);
 
 
 
234
  }
235
 
236
  /**
Backend/views/backup/modal/export.php CHANGED
@@ -14,7 +14,7 @@ $time = WPStaging\Core\WPStaging::make(\WPStaging\Framework\Utils\Times::class);
14
  /** @var \WPStaging\Pro\Backup\Storage\Providers */
15
  $storages = WPStaging\Core\WPStaging::make(\WPStaging\Pro\Backup\Storage\Providers::class);
16
 
17
- $recurrenceTimes = $time->range('midnight', 'tomorrow - 60 minutes', defined('WPSTG_DEV') && WPSTG_DEV ? 'PT1M' : 'PT15M');
18
  ?>
19
  <div id="wpstg--modal--backup--new" data-confirmButtonText="<?php esc_attr_e('Start Backup', 'wp-staging') ?>" style="display: none">
20
  <h3 class="wpstg--swal2-title wpstg-w-100" for="wpstg-backup-name-input"><?php esc_html_e('Create Site Backup', 'wp-staging') ?></h3>
14
  /** @var \WPStaging\Pro\Backup\Storage\Providers */
15
  $storages = WPStaging\Core\WPStaging::make(\WPStaging\Pro\Backup\Storage\Providers::class);
16
 
17
+ $recurrenceTimes = $time->range('midnight', 'tomorrow - 1 minutes', defined('WPSTG_DEV') && WPSTG_DEV ? 'PT1M' : 'PT15M');
18
  ?>
19
  <div id="wpstg--modal--backup--new" data-confirmButtonText="<?php esc_attr_e('Start Backup', 'wp-staging') ?>" style="display: none">
20
  <h3 class="wpstg--swal2-title wpstg-w-100" for="wpstg-backup-name-input"><?php esc_html_e('Create Site Backup', 'wp-staging') ?></h3>
Backend/views/clone/ajax/single-overview.php CHANGED
@@ -47,7 +47,7 @@
47
  <a href="#" class="wpstg-execute-clone wpstg-clone-action" data-clone="<?php echo $cloneID ?>" title="<?php echo __("Update and overwrite this clone. Select folders and database tables in the next step.", "wp-staging") ?>">
48
  <?php _e("Update", "wp-staging"); ?>
49
  </a>
50
- <a href="#" class="wpstg-reset-clone wpstg-clone-action" data-clone="<?php echo $cloneID ?>" title="<?php echo __("Reset this clone with existing production site. Confirm to proceed.", "wp-staging") ?>">
51
  <?php _e("Reset", "wp-staging"); ?>
52
  </a>
53
  <a href="#" class="wpstg-remove-clone wpstg-clone-action" data-clone="<?php echo $cloneID ?>" title="<?php echo __("Delete this clone. Select specific folders and database tables in the next step.", "wp-staging") ?>">
47
  <a href="#" class="wpstg-execute-clone wpstg-clone-action" data-clone="<?php echo $cloneID ?>" title="<?php echo __("Update and overwrite this clone. Select folders and database tables in the next step.", "wp-staging") ?>">
48
  <?php _e("Update", "wp-staging"); ?>
49
  </a>
50
+ <a href="#" class="wpstg-reset-clone wpstg-clone-action" data-clone="<?php echo $cloneID ?>" data-network="<?php echo is_multisite() && $data['networkClone'] ? 'yes' : 'no' ?>" title="<?php echo __("Reset this clone with existing production site. Confirm to proceed.", "wp-staging") ?>">
51
  <?php _e("Reset", "wp-staging"); ?>
52
  </a>
53
  <a href="#" class="wpstg-remove-clone wpstg-clone-action" data-clone="<?php echo $cloneID ?>" title="<?php echo __("Delete this clone. Select specific folders and database tables in the next step.", "wp-staging") ?>">
Framework/Adapter/Directory.php CHANGED
@@ -184,7 +184,7 @@ class Directory
184
  public function getPluginsDirectory()
185
  {
186
  if (!isset($this->pluginsDir)) {
187
- $this->pluginsDir = $this->filesystem->normalizePath(WP_PLUGIN_DIR);
188
  }
189
 
190
  return $this->pluginsDir;
@@ -196,7 +196,7 @@ class Directory
196
  public function getMuPluginsDirectory()
197
  {
198
  if (!isset($this->muPluginsDir)) {
199
- $this->muPluginsDir = $this->filesystem->normalizePath(WPMU_PLUGIN_DIR);
200
  }
201
 
202
  return $this->muPluginsDir;
@@ -211,7 +211,7 @@ class Directory
211
  {
212
  if (!isset($this->themesDirs)) {
213
  $this->themesDirs = array_map(function ($directory) {
214
- return $this->filesystem->normalizePath($directory['theme_root']);
215
  }, search_theme_directories(true));
216
 
217
  if (!is_array($this->themesDirs)) {
@@ -245,7 +245,7 @@ class Directory
245
  public function getActiveThemeParentDirectory()
246
  {
247
  if (!isset($this->activeThemeParentDir)) {
248
- $this->activeThemeParentDir = $this->filesystem->normalizePath(get_theme_root(get_template()));
249
  }
250
 
251
  return $this->activeThemeParentDir;
@@ -257,7 +257,7 @@ class Directory
257
  public function getLangsDirectory()
258
  {
259
  if (!isset($this->langDir)) {
260
- $this->langDir = $this->filesystem->normalizePath(WP_LANG_DIR);
261
  }
262
 
263
  return $this->langDir;
@@ -269,7 +269,7 @@ class Directory
269
  public function getAbsPath()
270
  {
271
  if (!isset($this->absPath)) {
272
- $this->absPath = $this->filesystem->normalizePath(ABSPATH);
273
  }
274
 
275
  return $this->absPath;
@@ -281,7 +281,7 @@ class Directory
281
  public function getWpContentDirectory()
282
  {
283
  if (!isset($this->wpContentDirectory)) {
284
- $this->wpContentDirectory = $this->filesystem->normalizePath(WP_CONTENT_DIR);
285
  }
286
 
287
  return $this->wpContentDirectory;
184
  public function getPluginsDirectory()
185
  {
186
  if (!isset($this->pluginsDir)) {
187
+ $this->pluginsDir = $this->filesystem->normalizePath(WP_PLUGIN_DIR, true);
188
  }
189
 
190
  return $this->pluginsDir;
196
  public function getMuPluginsDirectory()
197
  {
198
  if (!isset($this->muPluginsDir)) {
199
+ $this->muPluginsDir = $this->filesystem->normalizePath(WPMU_PLUGIN_DIR, true);
200
  }
201
 
202
  return $this->muPluginsDir;
211
  {
212
  if (!isset($this->themesDirs)) {
213
  $this->themesDirs = array_map(function ($directory) {
214
+ return $this->filesystem->normalizePath($directory['theme_root'], true);
215
  }, search_theme_directories(true));
216
 
217
  if (!is_array($this->themesDirs)) {
245
  public function getActiveThemeParentDirectory()
246
  {
247
  if (!isset($this->activeThemeParentDir)) {
248
+ $this->activeThemeParentDir = $this->filesystem->normalizePath(get_theme_root(get_template()), true);
249
  }
250
 
251
  return $this->activeThemeParentDir;
257
  public function getLangsDirectory()
258
  {
259
  if (!isset($this->langDir)) {
260
+ $this->langDir = $this->filesystem->normalizePath(WP_LANG_DIR, true);
261
  }
262
 
263
  return $this->langDir;
269
  public function getAbsPath()
270
  {
271
  if (!isset($this->absPath)) {
272
+ $this->absPath = $this->filesystem->normalizePath(ABSPATH, true);
273
  }
274
 
275
  return $this->absPath;
281
  public function getWpContentDirectory()
282
  {
283
  if (!isset($this->wpContentDirectory)) {
284
+ $this->wpContentDirectory = $this->filesystem->normalizePath(WP_CONTENT_DIR, true);
285
  }
286
 
287
  return $this->wpContentDirectory;
Framework/Database/SelectedTables.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPStaging\Framework\Database;
4
+
5
+ use wpdb;
6
+ use WPStaging\Core\WPStaging;
7
+ use WPStaging\Framework\Filesystem\Scanning\ScanConst;
8
+
9
+ class SelectedTables
10
+ {
11
+ /** @var array */
12
+ private $includedTables = '';
13
+
14
+ /** @var array */
15
+ private $excludedTables = '';
16
+
17
+ /** @var array */
18
+ private $selectedTablesWithoutPrefix = '';
19
+
20
+ /** @var wpdb|null */
21
+ private $wpdb;
22
+
23
+ /** @var string|null */
24
+ private $prefix;
25
+
26
+ public function __construct($includedTables = '', $excludedTables = '', $selectedTablesWithoutPrefix = '')
27
+ {
28
+ $this->includedTables = $includedTables === '' ? [] : explode(ScanConst::DIRECTORIES_SEPARATOR, $includedTables);
29
+ $this->excludedTables = $excludedTables === '' ? [] : explode(ScanConst::DIRECTORIES_SEPARATOR, $excludedTables);
30
+ $this->selectedTablesWithoutPrefix = $selectedTablesWithoutPrefix === '' ? [] : explode(ScanConst::DIRECTORIES_SEPARATOR, $selectedTablesWithoutPrefix);
31
+ $this->wpdb = null;
32
+ $this->prefix = null;
33
+ }
34
+
35
+ /**
36
+ * @param bool $isNetworkClone
37
+ * @return array
38
+ */
39
+ public function getSelectedTables($isNetworkClone)
40
+ {
41
+ if (!empty($this->includedTables)) {
42
+ return array_merge($this->includedTables, $this->selectedTablesWithoutPrefix);
43
+ }
44
+
45
+ $selectedTables = $this->getPrefixedTables($isNetworkClone);
46
+ return array_merge($selectedTables, $this->selectedTablesWithoutPrefix);
47
+ }
48
+
49
+ /**
50
+ * @param string $server
51
+ * @param string $username
52
+ * @param string $password
53
+ * @param string $database
54
+ * @param string $prefix
55
+ */
56
+ public function setDatabaseInfo($server, $username, $password, $database, $prefix)
57
+ {
58
+ if (empty($username) || empty($database)) {
59
+ $this->wpdb = WPStaging::getInstance()->get("wpdb");
60
+ } else {
61
+ $this->wpdb = new wpdb($username, str_replace("\\\\", "\\", $password), $database, $server);
62
+ }
63
+
64
+ $this->wpdb->prefix = $prefix;
65
+ $this->prefix = $prefix;
66
+ }
67
+
68
+ /**
69
+ * @param wpdb $wpdb
70
+ * @param string $prefix
71
+ */
72
+ public function setWpdb($wpdb, $prefix)
73
+ {
74
+ $this->wpdb = $wpdb;
75
+ $this->wpdb->prefix = $prefix;
76
+ $this->prefix = $prefix;
77
+ }
78
+
79
+ /**
80
+ * Get Prefixed Table excluding the excluded tables
81
+ * @param bool $isNetworkClone
82
+ * @param bool $includeSize
83
+ */
84
+ public function getPrefixedTables($isNetworkClone, $includeSize = false)
85
+ {
86
+ if ($this->wpdb === null) {
87
+ $this->wpdb = WPStaging::getInstance()->get("wpdb");
88
+ }
89
+
90
+ if ($this->prefix === null) {
91
+ $this->prefix = WPStaging::getTablePrefix();
92
+ }
93
+
94
+ $sql = "SHOW TABLE STATUS";
95
+ $tables = $this->wpdb->get_results($sql);
96
+
97
+ $selectedTables = [];
98
+
99
+ foreach ($tables as $table) {
100
+ if (!$this->isPrefixedTable($table->Name, $this->prefix, is_multisite(), is_main_site(), $isNetworkClone)) {
101
+ continue;
102
+ }
103
+
104
+ if (in_array($table->Name, $this->excludedTables)) {
105
+ continue;
106
+ }
107
+
108
+ if ($table->Comment === "VIEW") {
109
+ continue;
110
+ }
111
+
112
+ if (!$includeSize) {
113
+ $selectedTables[] = $table->Name;
114
+ continue;
115
+ }
116
+
117
+ $selectedTables[] = [
118
+ "name" => $table->Name,
119
+ "size" => ($table->Data_length + $table->Index_length)
120
+ ];
121
+ }
122
+
123
+ return $selectedTables;
124
+ }
125
+
126
+ /**
127
+ * @param string $tableName
128
+ * @param string $tablePrefix
129
+ * @param bool $isMultisite
130
+ * @param bool $isMainsite
131
+ * @param bool $isNetwork
132
+ *
133
+ * @return bool
134
+ */
135
+ public function isPrefixedTable($tableName, $tablePrefix, $isMultisite, $isMainsite, $isNetwork)
136
+ {
137
+ if (!empty($tablePrefix) && strpos($tableName, $tablePrefix) !== 0) {
138
+ return false;
139
+ }
140
+
141
+ /**
142
+ * We also need to skip subsite tables for multisite mainsite if it is not a network clone
143
+ * i.e. tables like wpstg0_1_*, wpstg0_2_* will not be selected it is a single site clone from multisite mainsite if the prefix is wpstg0
144
+ */
145
+ if ($isMultisite && $isMainsite && !$isNetwork && preg_match('/^' . $tablePrefix . '\d+_/', $tableName)) {
146
+ return false;
147
+ }
148
+
149
+ return true;
150
+ }
151
+ }
Framework/Filesystem/Filesystem.php CHANGED
@@ -759,11 +759,11 @@ class Filesystem extends FilterableDirectoryIterator
759
  * aiming to compare paths with precision.
760
  *
761
  * @param string $path
762
- * @param bool $onlyNormalize. Default false
763
  *
764
  * @return string
765
  */
766
- public function normalizePath($path, $onlyNormalize = false)
767
  {
768
  /**
769
  * For UNC Paths
@@ -777,15 +777,15 @@ class Filesystem extends FilterableDirectoryIterator
777
  $path = '\\' . $path;
778
  }
779
 
780
- if ($onlyNormalize) {
781
- return wp_normalize_path($path);
782
- }
 
783
 
784
- $path = trim($path);
785
- $path = wp_normalize_path($path);
786
- $path = trailingslashit($path);
787
 
788
- return $path;
789
  }
790
 
791
  public function handleMkdirError($errno, $errstr)
@@ -874,6 +874,8 @@ class Filesystem extends FilterableDirectoryIterator
874
  */
875
  public function findFilesInDir($path)
876
  {
 
 
877
  $it = @new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS);
878
  $it = new \RecursiveIteratorIterator($it);
879
 
@@ -886,7 +888,7 @@ class Filesystem extends FilterableDirectoryIterator
886
  continue;
887
  }
888
 
889
- $pathName = $item->getPathname();
890
 
891
  $relativePath = str_replace($path, '', $pathName);
892
 
759
  * aiming to compare paths with precision.
760
  *
761
  * @param string $path
762
+ * @param bool $addTrailingslash. Default false
763
  *
764
  * @return string
765
  */
766
+ public function normalizePath($path, $addTrailingslash = false)
767
  {
768
  /**
769
  * For UNC Paths
777
  $path = '\\' . $path;
778
  }
779
 
780
+ if ($addTrailingslash) {
781
+ $path = trim($path);
782
+ $path = wp_normalize_path($path);
783
+ $path = trailingslashit($path);
784
 
785
+ return $path;
786
+ }
 
787
 
788
+ return wp_normalize_path($path);
789
  }
790
 
791
  public function handleMkdirError($errno, $errstr)
874
  */
875
  public function findFilesInDir($path)
876
  {
877
+ $path = $this->normalizePath($path);
878
+
879
  $it = @new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS);
880
  $it = new \RecursiveIteratorIterator($it);
881
 
888
  continue;
889
  }
890
 
891
+ $pathName = $this->normalizePath($item->getPathname());
892
 
893
  $relativePath = str_replace($path, '', $pathName);
894
 
Framework/Queue/FileSeekableQueue.php CHANGED
@@ -2,10 +2,13 @@
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
10
  {
11
  /** @var string The string identifier of this task */
@@ -40,13 +43,7 @@ class FileSeekableQueue implements SeekableQueueInterface, \SeekableIterator
40
 
41
  public function __destruct()
42
  {
43
- if ($this->needsUnlock && $this->handle instanceof FileObject && is_resource($this->handle)) {
44
- try {
45
- $this->handle->flock(LOCK_UN);
46
- } catch (\Exception $e) {
47
- // no-op
48
- }
49
- }
50
  }
51
 
52
  /**
@@ -91,7 +88,7 @@ class FileSeekableQueue implements SeekableQueueInterface, \SeekableIterator
91
  usleep(250000); // 0.25s
92
  $waitedTimes++;
93
  if ($waitedTimes > 5) {
94
- throw new \RuntimeException('Could not acquire exclusive lock for writing to Queue file.');
95
  }
96
  }
97
  } while (!$locked);
@@ -209,4 +206,15 @@ class FileSeekableQueue implements SeekableQueueInterface, \SeekableIterator
209
  {
210
  return $this->handle->ftell();
211
  }
 
 
 
 
 
 
 
 
 
 
 
212
  }
2
 
3
  namespace WPStaging\Framework\Queue;
4
 
5
+ use WPStaging\Core\Utils\Logger;
6
  use WPStaging\Framework\Adapter\Directory;
7
  use WPStaging\Framework\Filesystem\FileObject;
8
  use WPStaging\Framework\Filesystem\Filesystem;
9
 
10
+ use function WPStaging\functions\debug_log;
11
+
12
  class FileSeekableQueue implements SeekableQueueInterface, \SeekableIterator
13
  {
14
  /** @var string The string identifier of this task */
43
 
44
  public function __destruct()
45
  {
46
+ $this->shutdown();
 
 
 
 
 
 
47
  }
48
 
49
  /**
88
  usleep(250000); // 0.25s
89
  $waitedTimes++;
90
  if ($waitedTimes > 5) {
91
+ throw new \RuntimeException('Could not acquire exclusive lock for writing to Queue file: ' . $this->taskName . '.task');
92
  }
93
  }
94
  } while (!$locked);
206
  {
207
  return $this->handle->ftell();
208
  }
209
+
210
+ public function shutdown()
211
+ {
212
+ if ($this->needsUnlock && $this->handle instanceof FileObject) {
213
+ try {
214
+ $this->handle->flock(LOCK_UN);
215
+ } catch (\Exception $e) {
216
+ debug_log("Unable to unlock handle " . $this->taskName . '.task : ' . $e->getMessage(), Logger::TYPE_DEBUG);
217
+ }
218
+ }
219
+ }
220
  }
Framework/Queue/SeekableQueueInterface.php CHANGED
@@ -61,4 +61,9 @@ interface SeekableQueueInterface
61
  * Returns the Queue offset
62
  */
63
  public function getOffset();
 
 
 
 
 
64
  }
61
  * Returns the Queue offset
62
  */
63
  public function getOffset();
64
+
65
+ /**
66
+ * Close all connection to the queue
67
+ */
68
+ public function shutdown();
69
  }
assets/js/dist/wpstg-admin.js CHANGED
@@ -448,11 +448,15 @@
448
  */
449
 
450
  var WpstgDirectoryNavigation = /*#__PURE__*/function () {
451
- function WpstgDirectoryNavigation(directoryListingSelector, wpstgObject, notyf) {
452
  if (directoryListingSelector === void 0) {
453
  directoryListingSelector = '#wpstg-directories-listing';
454
  }
455
 
 
 
 
 
456
  if (wpstgObject === void 0) {
457
  wpstgObject = wpstg;
458
  }
@@ -462,6 +466,7 @@
462
  }
463
 
464
  this.directoryListingContainer = qs(directoryListingSelector);
 
465
  this.wpstgObject = wpstgObject;
466
  this.dirCheckboxSelector = '.wpstg-check-dir';
467
  this.dirExpandSelector = '.wpstg-expand-dirs';
@@ -505,6 +510,14 @@
505
  addEvent(this.directoryListingContainer, 'click', this.selectDefaultDirsSelector, function () {
506
  _this.selectDefault();
507
  });
 
 
 
 
 
 
 
 
508
  };
509
 
510
  _proto.init = function init() {
@@ -696,9 +709,219 @@
696
  return scanned;
697
  };
698
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
699
  return WpstgDirectoryNavigation;
700
  }();
701
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
702
  /**
703
  * Rich Exclude Filter Module
704
  */
@@ -1513,7 +1736,8 @@
1513
  this.resetTabSelector = '.wpstg-reset-exclude-tab';
1514
  this.directoryNavigator = null;
1515
  this.excludeFilters = null;
1516
- this.isAllTablesChecked = true;
 
1517
  }
1518
 
1519
  var _proto = WpstgResetModal.prototype;
@@ -1531,26 +1755,16 @@
1531
  addEvent(resetModalContainer, 'click', this.resetTabSelector, function (target) {
1532
  _this.toggleContent(target);
1533
  });
1534
- addEvent(resetModalContainer, 'click', '.wpstg-button-select', function () {
1535
- _this.selectDefaultTables();
1536
- });
1537
- addEvent(resetModalContainer, 'click', '.wpstg-button-unselect', function () {
1538
- _this.toggleTableSelection();
1539
- });
1540
- addEvent(resetModalContainer, 'click', '.wpstg-expand-dirs', function (target, event) {
1541
- event.preventDefault();
1542
-
1543
- _this.toggleDirectoryNavigation(target);
1544
- });
1545
- addEvent(resetModalContainer, 'change', 'input.wpstg-check-dir', function (target) {
1546
- _this.updateDirectorySelection(target);
1547
- });
1548
  };
1549
 
1550
  _proto.init = function init() {
1551
  this.addEvents();
1552
  };
1553
 
 
 
 
 
1554
  _proto.toggleContent = function toggleContent(target) {
1555
  var resetModalContainer = qs('.' + this.resetModalContainerClass);
1556
  var contentId = target.getAttribute('data-id');
@@ -1662,6 +1876,9 @@
1662
  modal.querySelector('.wpstg--swal2-content').innerHTML = data.html;
1663
  _this2.directoryNavigator = new WpstgDirectoryNavigation();
1664
  _this2.excludeFilters = new WpstgExcludeFilters();
 
 
 
1665
  })["catch"](function (error) {
1666
  _this2.renderError({
1667
  'html': _this2.wpstgObject.i18n['somethingWentWrong'] + ' ' + error
@@ -1677,95 +1894,12 @@
1677
  return this.excludeFilters;
1678
  };
1679
 
1680
- _proto.getAjaxLoader = function getAjaxLoader() {
1681
- return '<div class="wpstg-swal2-ajax-loader"><img src="' + this.wpstgObject.wpstgIcon + '" /></div>';
1682
- };
1683
-
1684
- _proto.toggleDirectoryNavigation = function toggleDirectoryNavigation(element) {
1685
- var cbElement = element.previousSibling;
1686
-
1687
- if (cbElement.getAttribute('data-navigateable', 'false') === 'false') {
1688
- return;
1689
- }
1690
-
1691
- if (cbElement.getAttribute('data-scanned', 'false') === 'false') {
1692
- return;
1693
- }
1694
-
1695
- var subDirectories = getNextSibling(element, '.wpstg-subdir');
1696
-
1697
- if (subDirectories.style.display === 'none') {
1698
- slideDown(subDirectories);
1699
- } else {
1700
- slideUp(subDirectories);
1701
- }
1702
- };
1703
-
1704
- _proto.updateDirectorySelection = function updateDirectorySelection(element) {
1705
- var parent = element.parentElement;
1706
-
1707
- if (element.checked) {
1708
- getParents(parent, '.wpstg-dir').forEach(function (parElem) {
1709
- for (var i = 0; i < parElem.children.length; i++) {
1710
- if (parElem.children[i].matches('.wpstg-check-dir')) {
1711
- parElem.children[i].checked = true;
1712
- }
1713
- }
1714
- });
1715
- parent.querySelectorAll('.wpstg-expand-dirs').forEach(function (x) {
1716
- x.classList.remove('disabled');
1717
- });
1718
- parent.querySelectorAll('.wpstg-subdir .wpstg-check-dir').forEach(function (x) {
1719
- x.checked = true;
1720
- });
1721
- } else {
1722
- parent.querySelectorAll('.wpstg-expand-dirs, .wpstg-check-subdirs').forEach(function (x) {
1723
- x.classList.add('disabled');
1724
- });
1725
- parent.querySelectorAll('.wpstg-dir .wpstg-check-dir').forEach(function (x) {
1726
- x.checked = false;
1727
- });
1728
- }
1729
- };
1730
-
1731
- _proto.selectDefaultTables = function selectDefaultTables() {
1732
- var _this3 = this;
1733
-
1734
- var resetModalContainer = qs('.' + this.resetModalContainerClass);
1735
- var options = resetModalContainer.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table');
1736
- var multisitePattern = '^' + this.wpstgObject.tblprefix + '([^0-9])_*';
1737
- var singleSitePattern = '^' + this.wpstgObject.tblprefix;
1738
- options.forEach(function (option) {
1739
- var name = option.getAttribute('name', '');
1740
-
1741
- if (_this3.wpstgObject.isMultisite === '1' && name.match(multisitePattern)) {
1742
- option.setAttribute('selected', 'selected');
1743
- } else if (_this3.wpstgObject.isMultisite === '' && name.match(singleSitePattern)) {
1744
- option.setAttribute('selected', 'selected');
1745
- } else {
1746
- option.removeAttribute('selected');
1747
- }
1748
- });
1749
  };
1750
 
1751
- _proto.toggleTableSelection = function toggleTableSelection() {
1752
- var resetModalContainer = qs('.' + this.resetModalContainerClass);
1753
-
1754
- if (false === this.isAllTablesChecked) {
1755
- resetModalContainer.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach(function (option) {
1756
- option.setAttribute('selected', 'selected');
1757
- });
1758
- resetModalContainer.querySelector('.wpstg-button-unselect').innerHTML = 'Unselect All'; // cache.get('.wpstg-db-table-checkboxes').prop('checked', true);
1759
-
1760
- this.isAllTablesChecked = true;
1761
- } else {
1762
- resetModalContainer.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach(function (option) {
1763
- option.removeAttribute('selected');
1764
- });
1765
- resetModalContainer.querySelector('.wpstg-button-unselect').innerHTML = 'Select All'; // cache.get('.wpstg-db-table-checkboxes').prop('checked', false);
1766
-
1767
- this.isAllTablesChecked = false;
1768
- }
1769
  };
1770
 
1771
  return WpstgResetModal;
@@ -1889,6 +2023,7 @@
1889
  progressBar: 0,
1890
  cloneExcludeFilters: null,
1891
  directoryNavigator: null,
 
1892
  notyf: null,
1893
  areAllTablesChecked: true,
1894
  handleDisplayDependencies: handleDisplayDependencies,
@@ -2014,77 +2149,82 @@
2014
  urlSpinner += '.gif';
2015
  ajaxSpinner = '<img src=\'\'' + urlSpinner + '\' alt=\'\' class=\'ajax-spinner general-spinner\' />';
2016
 
2017
- $workFlow.on('change', '#wpstg_network_clone', function (e) {
2018
- e.preventDefault();
2019
- $('.wpstg-button-select').trigger('click');
2020
- }) // Check / Un-check All Database Tables New
2021
- .on('click', '.wpstg-button-unselect', function (e) {
2022
- e.preventDefault();
2023
-
2024
- if (false === that.areAllTablesChecked) {
2025
- cache.get('#wpstg_select_tables_cloning .wpstg-db-table').prop('selected', 'selected');
2026
- cache.get('.wpstg-button-unselect').text('Unselect All');
2027
- cache.get('.wpstg-db-table-checkboxes').prop('checked', true);
2028
- that.areAllTablesChecked = true;
2029
- } else {
2030
- cache.get('#wpstg_select_tables_cloning .wpstg-db-table').prop('selected', false);
2031
- cache.get('.wpstg-button-unselect').text('Select All');
2032
- cache.get('.wpstg-db-table-checkboxes').prop('checked', false);
2033
- that.areAllTablesChecked = false;
2034
- }
2035
- })
2036
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2037
  * Select tables with certain tbl prefix | NEW
2038
  * @param obj e
2039
  * @returns {undefined}
2040
  */
2041
- .on('click', '.wpstg-button-select', function (e) {
2042
- e.preventDefault();
2043
- $('#wpstg_select_tables_cloning .wpstg-db-table').each(function () {
2044
- var regex = '^' + wpstg.tblprefix;
2045
-
2046
- if (wpstg.isMultisite === '1' && !$('#wpstg_network_clone').is(':checked')) {
2047
- regex += '([^0-9])_*';
2048
- }
2049
 
2050
- if ($(this).attr('name').match(regex)) {
2051
- $(this).prop('selected', 'selected');
2052
- } else {
2053
- $(this).prop('selected', false);
2054
- }
2055
- });
2056
- }) // Expand Directories
2057
- .on('click', '.wpstg-expand-dirs', function (e) {
2058
- e.preventDefault();
2059
- var $this = $(this);
2060
- $this.siblings('.wpstg-subdir').slideToggle();
2061
- }) // When a directory checkbox is Selected
2062
- .on('change', 'input.wpstg-check-dir', function () {
2063
- var $directory = $(this).parent('.wpstg-dir');
2064
-
2065
- if (this.checked) {
2066
- $directory.parents('.wpstg-dir').children('.wpstg-check-dir').prop('checked', true);
2067
- $directory.find('.wpstg-expand-dirs').removeClass('disabled');
2068
- $directory.find('.wpstg-subdir .wpstg-check-dir').prop('checked', true);
2069
- } else {
2070
- $directory.find('.wpstg-dir .wpstg-check-dir').prop('checked', false);
2071
- $directory.find('.wpstg-expand-dirs, .wpstg-check-subdirs').addClass('disabled');
2072
- $directory.find('.wpstg-check-subdirs').data('action', 'check').text('check');
2073
- }
2074
- }) // When a directory name is Selected
2075
- .on('change', 'href.wpstg-check-dir', function () {
2076
- var $directory = $(this).parent('.wpstg-dir');
2077
-
2078
- if (this.checked) {
2079
- $directory.parents('.wpstg-dir').children('.wpstg-check-dir').prop('checked', true);
2080
- $directory.find('.wpstg-expand-dirs').removeClass('disabled');
2081
- $directory.find('.wpstg-subdir .wpstg-check-dir').prop('checked', true);
2082
- } else {
2083
- $directory.find('.wpstg-dir .wpstg-check-dir').prop('checked', false);
2084
- $directory.find('.wpstg-expand-dirs, .wpstg-check-subdirs').addClass('disabled');
2085
- $directory.find('.wpstg-check-subdirs').data('action', 'check').text('check');
2086
- }
2087
- }) // Check the max length of the clone name and if the clone name already exists
 
 
 
 
 
 
 
 
 
 
 
2088
  .on('keyup', '#wpstg-new-clone-id', function () {
2089
  // Hide previous errors
2090
  document.getElementById('wpstg-error-details').style.display = 'none'; // This request was already sent, clear it up!
@@ -2297,7 +2437,8 @@
2297
  $workFlow.removeClass('loading').html(response); // register check disk space function for clone update process.
2298
 
2299
  checkDiskSpace();
2300
- that.directoryNavigator = new WpstgDirectoryNavigation('#wpstg-directories-listing', wpstg, that.notyf);
 
2301
  that.cloneExcludeFilters = new WpstgExcludeFilters();
2302
  that.switchStep(2);
2303
  }, 'HTML');
@@ -2306,14 +2447,34 @@
2306
  e.preventDefault();
2307
  var clone = $(this).data('clone');
2308
  var resetModal = new WpstgResetModal(clone);
 
2309
  var promise = resetModal.showModal();
2310
  that.areAllTablesChecked = true;
2311
  promise.then(function (result) {
2312
  if (result.value) {
2313
  var dirNavigator = resetModal.getDirectoryNavigator();
 
2314
  var exclFilters = resetModal.getExcludeFilters().getExcludeFilters();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2315
  resetClone(clone, {
2316
- includedTables: getIncludedTables(),
 
 
2317
  excludeSizeRules: encodeURIComponent(exclFilters.sizes),
2318
  excludeGlobRules: encodeURIComponent(exclFilters.globs),
2319
  excludedDirectories: dirNavigator.getExcludedDirectories(),
@@ -2475,19 +2636,6 @@
2475
  loadOverview();
2476
  });
2477
  };
2478
- /**
2479
- * Get Included (Checked) Database Tables
2480
- * @return {Array}
2481
- */
2482
-
2483
-
2484
- var getIncludedTables = function getIncludedTables() {
2485
- var includedTables = [];
2486
- $('#wpstg_select_tables_cloning option:selected').each(function () {
2487
- includedTables.push(this.value);
2488
- });
2489
- return includedTables;
2490
- };
2491
  /**
2492
  * Get Excluded (Unchecked) Database Tables
2493
  * Not used anymore!
@@ -2596,8 +2744,7 @@
2596
  that.data.cloneID = $('#wpstg-new-clone-id').data('clone');
2597
  }
2598
 
2599
- that.data.cloneName = $('#wpstg-new-clone-id').val() || that.data.cloneID; // Remove this to keep &_POST[] small otherwise mod_security will throw error 404
2600
- // that.data.excludedTables = getExcludedTables();
2601
 
2602
  if (that.directoryNavigator !== null) {
2603
  that.data.excludedDirectories = encodeURIComponent(that.directoryNavigator.getExcludedDirectories());
@@ -2613,7 +2760,21 @@
2613
  that.data.excludeSizeRules = encodeURIComponent(rules.sizes);
2614
  }
2615
 
2616
- that.data.includedTables = getIncludedTables();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2617
  that.data.databaseServer = $('#wpstg_db_server').val();
2618
  that.data.databaseUser = $('#wpstg_db_username').val();
2619
  that.data.databasePassword = $('#wpstg_db_password').val();
@@ -2669,7 +2830,8 @@
2669
 
2670
  if (that.data.action === 'wpstg_scanning') {
2671
  that.areAllTablesChecked = true;
2672
- that.directoryNavigator = new WpstgDirectoryNavigation('#wpstg-directories-listing', wpstg, that.notyf);
 
2673
  that.switchStep(2);
2674
  that.cloneExcludeFilters = new WpstgExcludeFilters();
2675
  } else if (that.data.action === 'wpstg_cloning' || that.data.action === 'wpstg_update' || that.data.action === 'wpstg_reset') {
448
  */
449
 
450
  var WpstgDirectoryNavigation = /*#__PURE__*/function () {
451
+ function WpstgDirectoryNavigation(directoryListingSelector, workflowSelector, wpstgObject, notyf) {
452
  if (directoryListingSelector === void 0) {
453
  directoryListingSelector = '#wpstg-directories-listing';
454
  }
455
 
456
+ if (workflowSelector === void 0) {
457
+ workflowSelector = '#wpstg-workflow';
458
+ }
459
+
460
  if (wpstgObject === void 0) {
461
  wpstgObject = wpstg;
462
  }
466
  }
467
 
468
  this.directoryListingContainer = qs(directoryListingSelector);
469
+ this.workflow = qs(workflowSelector);
470
  this.wpstgObject = wpstgObject;
471
  this.dirCheckboxSelector = '.wpstg-check-dir';
472
  this.dirExpandSelector = '.wpstg-expand-dirs';
510
  addEvent(this.directoryListingContainer, 'click', this.selectDefaultDirsSelector, function () {
511
  _this.selectDefault();
512
  });
513
+ addEvent(this.directoryListingContainer, 'click', '.wpstg-expand-dirs', function (target, event) {
514
+ event.preventDefault();
515
+
516
+ _this.toggleDirectoryNavigation(target);
517
+ });
518
+ addEvent(this.directoryListingContainer, 'change', 'input.wpstg-check-dir', function (target) {
519
+ _this.updateDirectorySelection(target);
520
+ });
521
  };
522
 
523
  _proto.init = function init() {
709
  return scanned;
710
  };
711
 
712
+ _proto.toggleDirectoryNavigation = function toggleDirectoryNavigation(element) {
713
+ var cbElement = element.previousSibling;
714
+
715
+ if (cbElement.getAttribute('data-navigateable', 'false') === 'false') {
716
+ return;
717
+ }
718
+
719
+ if (cbElement.getAttribute('data-scanned', 'false') === 'false') {
720
+ return;
721
+ }
722
+
723
+ var subDirectories = getNextSibling(element, '.wpstg-subdir');
724
+
725
+ if (subDirectories.style.display === 'none') {
726
+ slideDown(subDirectories);
727
+ } else {
728
+ slideUp(subDirectories);
729
+ }
730
+ };
731
+
732
+ _proto.updateDirectorySelection = function updateDirectorySelection(element) {
733
+ var parent = element.parentElement;
734
+
735
+ if (element.checked) {
736
+ getParents(parent, '.wpstg-dir').forEach(function (parElem) {
737
+ for (var i = 0; i < parElem.children.length; i++) {
738
+ if (parElem.children[i].matches('.wpstg-check-dir')) {
739
+ parElem.children[i].checked = true;
740
+ }
741
+ }
742
+ });
743
+ parent.querySelectorAll('.wpstg-expand-dirs').forEach(function (x) {
744
+ x.classList.remove('disabled');
745
+ });
746
+ parent.querySelectorAll('.wpstg-subdir .wpstg-check-dir').forEach(function (x) {
747
+ x.checked = true;
748
+ });
749
+ } else {
750
+ parent.querySelectorAll('.wpstg-expand-dirs, .wpstg-check-subdirs').forEach(function (x) {
751
+ x.classList.add('disabled');
752
+ });
753
+ parent.querySelectorAll('.wpstg-dir .wpstg-check-dir').forEach(function (x) {
754
+ x.checked = false;
755
+ });
756
+ }
757
+ };
758
+
759
  return WpstgDirectoryNavigation;
760
  }();
761
 
762
+ /**
763
+ * Database tables selection
764
+ */
765
+
766
+ var WpstgTableSelection = /*#__PURE__*/function () {
767
+ function WpstgTableSelection(databaseTableSectionSelector, workflowSelector, networkCloneSelector, wpstgObject) {
768
+ if (databaseTableSectionSelector === void 0) {
769
+ databaseTableSectionSelector = '#wpstg-scanning-db';
770
+ }
771
+
772
+ if (workflowSelector === void 0) {
773
+ workflowSelector = '#wpstg-workflow';
774
+ }
775
+
776
+ if (networkCloneSelector === void 0) {
777
+ networkCloneSelector = '#wpstg_network_clone';
778
+ }
779
+
780
+ if (wpstgObject === void 0) {
781
+ wpstgObject = wpstg;
782
+ }
783
+
784
+ this.databaseTableSection = qs(databaseTableSectionSelector);
785
+ this.workflow = qs(workflowSelector);
786
+ this.networkCloneSelector = networkCloneSelector;
787
+ this.networkCloneCheckbox = qs(networkCloneSelector);
788
+ this.wpstgObject = wpstgObject;
789
+ this.isAllTablesChecked = true;
790
+ this.isMultisite = this.wpstgObject.isMultisite === '1';
791
+ this.isNetworkClone = false;
792
+ this.init();
793
+ }
794
+
795
+ var _proto = WpstgTableSelection.prototype;
796
+
797
+ _proto.setNetworkClone = function setNetworkClone(isNetworkClone) {
798
+ this.isNetworkClone = isNetworkClone;
799
+ };
800
+
801
+ _proto.addEvents = function addEvents() {
802
+ var _this = this;
803
+
804
+ if (this.workflow === null) {
805
+ console.log('Error: database table section is null. Cannot register events');
806
+ return;
807
+ }
808
+
809
+ addEvent(this.workflow, 'change', this.networkCloneSelector, function () {
810
+ _this.selectDefaultTables();
811
+ });
812
+ addEvent(this.workflow, 'click', '.wpstg-button-select', function (target, event) {
813
+ event.preventDefault();
814
+
815
+ _this.selectDefaultTables();
816
+ });
817
+ addEvent(this.workflow, 'click', '.wpstg-button-unselect', function (target, event) {
818
+ event.preventDefault();
819
+
820
+ _this.toggleTableSelection();
821
+ });
822
+ };
823
+
824
+ _proto.init = function init() {
825
+ this.addEvents();
826
+ };
827
+
828
+ _proto.getRegexPattern = function getRegexPattern() {
829
+ var pattern = '^' + this.wpstgObject.tblprefix;
830
+ var isNetwork = false;
831
+
832
+ if (this.networkCloneCheckbox !== undefined && this.networkCloneCheckbox !== null) {
833
+ isNetwork = this.networkCloneCheckbox.checked;
834
+ } // Force network clone true if set explicitly
835
+
836
+
837
+ if (this.isNetworkClone) {
838
+ isNetwork = true;
839
+ }
840
+
841
+ if (this.isMultisite && !isNetwork) {
842
+ pattern += '([^0-9])_*';
843
+ }
844
+
845
+ return pattern;
846
+ };
847
+
848
+ _proto.selectDefaultTables = function selectDefaultTables() {
849
+ var options = this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table');
850
+ var regexPattern = this.getRegexPattern();
851
+ options.forEach(function (option) {
852
+ var name = option.getAttribute('name', '');
853
+
854
+ if (name.match(regexPattern)) {
855
+ option.selected = true;
856
+ } else {
857
+ option.selected = false;
858
+ }
859
+ });
860
+ };
861
+
862
+ _proto.toggleTableSelection = function toggleTableSelection() {
863
+ if (false === this.isAllTablesChecked) {
864
+ this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach(function (option) {
865
+ option.selected = true;
866
+ });
867
+ this.databaseTableSection.querySelector('.wpstg-button-unselect').innerHTML = 'Unselect All'; // cache.get('.wpstg-db-table-checkboxes').prop('checked', true);
868
+
869
+ this.isAllTablesChecked = true;
870
+ } else {
871
+ this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach(function (option) {
872
+ option.selected = false;
873
+ });
874
+ this.databaseTableSection.querySelector('.wpstg-button-unselect').innerHTML = 'Select All'; // cache.get('.wpstg-db-table-checkboxes').prop('checked', false);
875
+
876
+ this.isAllTablesChecked = false;
877
+ }
878
+ };
879
+
880
+ _proto.getSelectedTablesWithoutPrefix = function getSelectedTablesWithoutPrefix() {
881
+ var selectedTablesWithoutPrefix = [];
882
+ var options = this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning option:checked');
883
+ var regexPattern = this.getRegexPattern();
884
+ options.forEach(function (option) {
885
+ var name = option.getAttribute('name', '');
886
+
887
+ if (!name.match(regexPattern)) {
888
+ selectedTablesWithoutPrefix.push(option.value);
889
+ }
890
+ });
891
+ return selectedTablesWithoutPrefix.join(this.wpstgObject.settings.directorySeparator);
892
+ };
893
+
894
+ _proto.getIncludedTables = function getIncludedTables() {
895
+ var includedTables = [];
896
+ var options = this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning option:checked');
897
+ var regexPattern = this.getRegexPattern();
898
+ options.forEach(function (option) {
899
+ var name = option.getAttribute('name', '');
900
+
901
+ if (name.match(regexPattern)) {
902
+ includedTables.push(option.value);
903
+ }
904
+ });
905
+ return includedTables.join(this.wpstgObject.settings.directorySeparator);
906
+ };
907
+
908
+ _proto.getExcludedTables = function getExcludedTables() {
909
+ var excludedTables = [];
910
+ var options = this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning option:not(:checked)');
911
+ var regexPattern = this.getRegexPattern();
912
+ options.forEach(function (option) {
913
+ var name = option.getAttribute('name', '');
914
+
915
+ if (name.match(regexPattern)) {
916
+ excludedTables.push(option.value);
917
+ }
918
+ });
919
+ return excludedTables.join(this.wpstgObject.settings.directorySeparator);
920
+ };
921
+
922
+ return WpstgTableSelection;
923
+ }();
924
+
925
  /**
926
  * Rich Exclude Filter Module
927
  */
1736
  this.resetTabSelector = '.wpstg-reset-exclude-tab';
1737
  this.directoryNavigator = null;
1738
  this.excludeFilters = null;
1739
+ this.tableSelector = null;
1740
+ this.isNetworkClone = false;
1741
  }
1742
 
1743
  var _proto = WpstgResetModal.prototype;
1755
  addEvent(resetModalContainer, 'click', this.resetTabSelector, function (target) {
1756
  _this.toggleContent(target);
1757
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1758
  };
1759
 
1760
  _proto.init = function init() {
1761
  this.addEvents();
1762
  };
1763
 
1764
+ _proto.setNetworkClone = function setNetworkClone(isNetworkClone) {
1765
+ this.isNetworkClone = isNetworkClone;
1766
+ };
1767
+
1768
  _proto.toggleContent = function toggleContent(target) {
1769
  var resetModalContainer = qs('.' + this.resetModalContainerClass);
1770
  var contentId = target.getAttribute('data-id');
1876
  modal.querySelector('.wpstg--swal2-content').innerHTML = data.html;
1877
  _this2.directoryNavigator = new WpstgDirectoryNavigation();
1878
  _this2.excludeFilters = new WpstgExcludeFilters();
1879
+ _this2.tableSelector = new WpstgTableSelection('#wpstg-reset-excluded-tables', '.' + _this2.resetModalContainerClass);
1880
+
1881
+ _this2.tableSelector.setNetworkClone(_this2.isNetworkClone);
1882
  })["catch"](function (error) {
1883
  _this2.renderError({
1884
  'html': _this2.wpstgObject.i18n['somethingWentWrong'] + ' ' + error
1894
  return this.excludeFilters;
1895
  };
1896
 
1897
+ _proto.getTableSelector = function getTableSelector() {
1898
+ return this.tableSelector;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1899
  };
1900
 
1901
+ _proto.getAjaxLoader = function getAjaxLoader() {
1902
+ return '<div class="wpstg-swal2-ajax-loader"><img src="' + this.wpstgObject.wpstgIcon + '" /></div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1903
  };
1904
 
1905
  return WpstgResetModal;
2023
  progressBar: 0,
2024
  cloneExcludeFilters: null,
2025
  directoryNavigator: null,
2026
+ tableSelector: null,
2027
  notyf: null,
2028
  areAllTablesChecked: true,
2029
  handleDisplayDependencies: handleDisplayDependencies,
2149
  urlSpinner += '.gif';
2150
  ajaxSpinner = '<img src=\'\'' + urlSpinner + '\' alt=\'\' class=\'ajax-spinner general-spinner\' />';
2151
 
2152
+ $workFlow
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2153
  /**
2154
+ .on('change', '#wpstg_network_clone', function(e) {
2155
+ e.preventDefault();
2156
+ $('.wpstg-button-select').trigger('click');
2157
+ })
2158
+ // Check / Un-check All Database Tables New
2159
+ .on('click', '.wpstg-button-unselect', function(e) {
2160
+ e.preventDefault();
2161
+ if (false === that.areAllTablesChecked) {
2162
+ cache.get('#wpstg_select_tables_cloning .wpstg-db-table').prop('selected', 'selected');
2163
+ cache.get('.wpstg-button-unselect').text('Unselect All');
2164
+ cache.get('.wpstg-db-table-checkboxes').prop('checked', true);
2165
+ that.areAllTablesChecked = true;
2166
+ } else {
2167
+ cache.get('#wpstg_select_tables_cloning .wpstg-db-table').prop('selected', false);
2168
+ cache.get('.wpstg-button-unselect').text('Select All');
2169
+ cache.get('.wpstg-db-table-checkboxes').prop('checked', false);
2170
+ that.areAllTablesChecked = false;
2171
+ }
2172
+ })
2173
+ /**
2174
  * Select tables with certain tbl prefix | NEW
2175
  * @param obj e
2176
  * @returns {undefined}
2177
  */
 
 
 
 
 
 
 
 
2178
 
2179
+ /**
2180
+ .on('click', '.wpstg-button-select', function(e) {
2181
+ e.preventDefault();
2182
+ $('#wpstg_select_tables_cloning .wpstg-db-table').each(function() {
2183
+ let regex = '^' + wpstg.tblprefix;
2184
+ if (wpstg.isMultisite === '1' && !$('#wpstg_network_clone').is(':checked')) {
2185
+ regex += '([^0-9])_*';
2186
+ }
2187
+ if ($(this).attr('name').match(regex)) {
2188
+ $(this).prop('selected', 'selected');
2189
+ } else {
2190
+ $(this).prop('selected', false);
2191
+ }
2192
+ });
2193
+ })
2194
+ // Expand Directories
2195
+ .on('click', '.wpstg-expand-dirs', function(e) {
2196
+ e.preventDefault();
2197
+ const $this = $(this);
2198
+ $this.siblings('.wpstg-subdir').slideToggle();
2199
+ })
2200
+ // When a directory checkbox is Selected
2201
+ .on('change', 'input.wpstg-check-dir', function() {
2202
+ const $directory = $(this).parent('.wpstg-dir');
2203
+ if (this.checked) {
2204
+ $directory.parents('.wpstg-dir').children('.wpstg-check-dir').prop('checked', true);
2205
+ $directory.find('.wpstg-expand-dirs').removeClass('disabled');
2206
+ $directory.find('.wpstg-subdir .wpstg-check-dir').prop('checked', true);
2207
+ } else {
2208
+ $directory.find('.wpstg-dir .wpstg-check-dir').prop('checked', false);
2209
+ $directory.find('.wpstg-expand-dirs, .wpstg-check-subdirs').addClass('disabled');
2210
+ $directory.find('.wpstg-check-subdirs').data('action', 'check').text('check');
2211
+ }
2212
+ })
2213
+ // When a directory name is Selected
2214
+ .on('change', 'href.wpstg-check-dir', function() {
2215
+ const $directory = $(this).parent('.wpstg-dir');
2216
+ if (this.checked) {
2217
+ $directory.parents('.wpstg-dir').children('.wpstg-check-dir').prop('checked', true);
2218
+ $directory.find('.wpstg-expand-dirs').removeClass('disabled');
2219
+ $directory.find('.wpstg-subdir .wpstg-check-dir').prop('checked', true);
2220
+ } else {
2221
+ $directory.find('.wpstg-dir .wpstg-check-dir').prop('checked', false);
2222
+ $directory.find('.wpstg-expand-dirs, .wpstg-check-subdirs').addClass('disabled');
2223
+ $directory.find('.wpstg-check-subdirs').data('action', 'check').text('check');
2224
+ }
2225
+ })
2226
+ */
2227
+ // Check the max length of the clone name and if the clone name already exists
2228
  .on('keyup', '#wpstg-new-clone-id', function () {
2229
  // Hide previous errors
2230
  document.getElementById('wpstg-error-details').style.display = 'none'; // This request was already sent, clear it up!
2437
  $workFlow.removeClass('loading').html(response); // register check disk space function for clone update process.
2438
 
2439
  checkDiskSpace();
2440
+ that.directoryNavigator = new WpstgDirectoryNavigation('#wpstg-directories-listing', '#wpstg-workflow', wpstg, that.notyf);
2441
+ that.tableSelector = new WpstgTableSelection('#wpstg-scanning-db', '#wpstg-workflow', '#wpstg_network_clone', wpstg, that.notyf);
2442
  that.cloneExcludeFilters = new WpstgExcludeFilters();
2443
  that.switchStep(2);
2444
  }, 'HTML');
2447
  e.preventDefault();
2448
  var clone = $(this).data('clone');
2449
  var resetModal = new WpstgResetModal(clone);
2450
+ resetModal.setNetworkClone($(this).data('network') === 'yes');
2451
  var promise = resetModal.showModal();
2452
  that.areAllTablesChecked = true;
2453
  promise.then(function (result) {
2454
  if (result.value) {
2455
  var dirNavigator = resetModal.getDirectoryNavigator();
2456
+ var tableSelector = resetModal.getTableSelector();
2457
  var exclFilters = resetModal.getExcludeFilters().getExcludeFilters();
2458
+ var includedTables = '';
2459
+ var excludedTables = '';
2460
+ var selectedTablesWithoutPrefix = '';
2461
+
2462
+ if (tableSelector !== null) {
2463
+ includedTables = tableSelector.getIncludedTables();
2464
+ excludedTables = tableSelector.getExcludedTables();
2465
+ selectedTablesWithoutPrefix = tableSelector.getSelectedTablesWithoutPrefix();
2466
+ }
2467
+
2468
+ if (includedTables.length > excludedTables.length) {
2469
+ includedTables = '';
2470
+ } else if (excludedTables.length > includedTables.length) {
2471
+ excludedTables = '';
2472
+ }
2473
+
2474
  resetClone(clone, {
2475
+ includedTables: includedTables,
2476
+ excludedTables: excludedTables,
2477
+ selectedTablesWithoutPrefix: selectedTablesWithoutPrefix,
2478
  excludeSizeRules: encodeURIComponent(exclFilters.sizes),
2479
  excludeGlobRules: encodeURIComponent(exclFilters.globs),
2480
  excludedDirectories: dirNavigator.getExcludedDirectories(),
2636
  loadOverview();
2637
  });
2638
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
2639
  /**
2640
  * Get Excluded (Unchecked) Database Tables
2641
  * Not used anymore!
2744
  that.data.cloneID = $('#wpstg-new-clone-id').data('clone');
2745
  }
2746
 
2747
+ that.data.cloneName = $('#wpstg-new-clone-id').val() || that.data.cloneID;
 
2748
 
2749
  if (that.directoryNavigator !== null) {
2750
  that.data.excludedDirectories = encodeURIComponent(that.directoryNavigator.getExcludedDirectories());
2760
  that.data.excludeSizeRules = encodeURIComponent(rules.sizes);
2761
  }
2762
 
2763
+ that.data.includedTables = '';
2764
+ that.data.excludedTables = '';
2765
+
2766
+ if (that.tableSelector !== null) {
2767
+ that.data.includedTables = that.tableSelector.getIncludedTables();
2768
+ that.data.excludedTables = that.tableSelector.getExcludedTables();
2769
+ that.data.selectedTablesWithoutPrefix = that.tableSelector.getSelectedTablesWithoutPrefix();
2770
+ }
2771
+
2772
+ if (that.data.includedTables.length > that.data.excludedTables.length) {
2773
+ that.data.includedTables = '';
2774
+ } else if (that.data.excludedTables.length > that.data.includedTables.length) {
2775
+ that.data.excludedTables = '';
2776
+ }
2777
+
2778
  that.data.databaseServer = $('#wpstg_db_server').val();
2779
  that.data.databaseUser = $('#wpstg_db_username').val();
2780
  that.data.databasePassword = $('#wpstg_db_password').val();
2830
 
2831
  if (that.data.action === 'wpstg_scanning') {
2832
  that.areAllTablesChecked = true;
2833
+ that.directoryNavigator = new WpstgDirectoryNavigation('#wpstg-directories-listing', '#wpstg-workflow', wpstg, that.notyf);
2834
+ that.tableSelector = new WpstgTableSelection('#wpstg-scanning-db', '#wpstg-workflow', '#wpstg_network_clone', wpstg, that.notyf);
2835
  that.switchStep(2);
2836
  that.cloneExcludeFilters = new WpstgExcludeFilters();
2837
  } else if (that.data.action === 'wpstg_cloning' || that.data.action === 'wpstg_update' || that.data.action === 'wpstg_reset') {
assets/js/dist/wpstg-admin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"wpstg-admin.js","sources":["../src/modules/wpstg-polyfill.js","../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 * Polyfills the `Element.prototype.closest` function if not available in the browser.\n *\n * @return {Function} A function that will return the closest element, by selector, to this element.\n */\nfunction polyfillClosest() {\n if (Element.prototype.closest) {\n if (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n }\n\n Element.prototype.closest = function(s) {\n let el = this;\n\n do {\n if (Element.prototype.matches.call(el, s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n }\n\n return function(element, selector) {\n return element instanceof Element ? element.closest(selector) : null;\n };\n}\n\nexport const closest = polyfillClosest();\n","import {closest} from './wpstg-polyfill';\n\n/**\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 if (!parent instanceof Element) {\n return;\n }\n\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\n/**\n * Dispatches a change on an element that will trigger, depending on the element type,\n * cascading changes on elements dependant on the one that triggered the change and that\n * belong in the same container.\n *\n * @param {Element} element A reference to the Element the change was triggered from.\n *\n * @return {void} The function does not return any value and will have the side-effect of\n * hiding or showing dependant elements.\n */\nexport function handleDisplayDependencies(element) {\n if (!element instanceof Element || !element.id) {\n return;\n }\n\n const containerSelector = '.wpstg-container';\n // Use the default WordPress CSS class to hide and show the objects.\n const hiddenClass = 'hidden';\n const elementType = element.getAttribute('type');\n\n switch (elementType) {\n case 'checkbox':\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n const showIfChecked = container.querySelectorAll(`[data-show-if-checked=\"${element.id}\"]`);\n const showIfUnchecked = container.querySelectorAll(`[data-show-if-unchecked=\"${element.id}\"]`);\n const checked = element.checked;\n\n if (showIfChecked.length) {\n for (const el of showIfChecked) {\n if (checked) {\n el.classList.remove(hiddenClass);\n } else {\n el.classList.add(hiddenClass);\n }\n }\n }\n\n if (showIfUnchecked.length) {\n for (const el of showIfUnchecked) {\n if (checked) {\n el.classList.add(hiddenClass);\n } else {\n el.classList.remove(hiddenClass);\n }\n }\n }\n\n return;\n default:\n // Not a type we handle.\n return;\n }\n}\n\n/**\n * Initializes the display status of any element that depends on the status of another to\n * either hide or show.\n *\n * @return {void} The function will have the side-effect to toggle the hide/show class from\n * elements dependant on another to hide or show.\n */\nexport function initDependantDisplay() {\n const displayControllerSelector = '[onchange^=\"WPStaging.handleDisplayDependencies\"]';\n const displayControllers = document.querySelectorAll(displayControllerSelector);\n for (const displayController of displayControllers) {\n handleDisplayDependencies(displayController);\n }\n}\n\n/**\n * Toggle target element set in data-wpstg-target of the given element\n *\n * @param {Element} element A reference to the Element the change was triggered from.\n *\n * @return {void} The function does not return any value and will have the side-effect of\n * hiding or showing dependant elements.\n */\nexport function handleToggleElement(element) {\n if (!element instanceof Element || !element.getAttribute('data-wpstg-target')) {\n return;\n }\n\n const containerSelector = '.wpstg_admin';\n // Use the default WordPress CSS class to hide and show the objects.\n const hiddenClass = 'hidden';\n\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n const elements = container.querySelectorAll(element.getAttribute('data-wpstg-target'));\n\n if (elements.length) {\n for (const el of elements) {\n el.classList.toggle(hiddenClass);\n }\n }\n}\n\n/**\n * Copy text in data-wpstg-copy to element(s) in data-wpstg-target\n *\n * @param {Element} element\n *\n * @return {void}\n */\nexport function handleCopyPaste(element) {\n if (!element instanceof Element || !element.getAttribute('data-wpstg-target') || !element.getAttribute('data-wpstg-copy')) {\n return;\n }\n\n const containerSelector = '.wpstg_admin';\n\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n navigator.clipboard.writeText(element.getAttribute('data-wpstg-copy'));\n const elements = container.querySelectorAll(element.getAttribute('data-wpstg-target'));\n\n if (elements.length) {\n for (const el of elements) {\n el.value = element.getAttribute('data-wpstg-copy', '');\n }\n }\n}\n\n/**\n * Copy text in data-wpstg-source to clipboard\n *\n * @param {Element} element\n *\n * @return {void}\n */\nexport function handleCopyToClipboard(element) {\n if (!element instanceof Element || !element.getAttribute('data-wpstg-source')) {\n return;\n }\n\n const containerSelector = '.wpstg_admin';\n\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n const el = container.querySelector(element.getAttribute('data-wpstg-source'));\n\n if (el) {\n navigator.clipboard.writeText(el.value);\n }\n}\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, 'change', this.dirCheckboxSelector, (element, event) => {\n event.preventDefault();\n console.log(this.getExcludedDirectories());\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.isScanned(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 return;\n }\n\n if (this.existingExcludes.length === 0) {\n this.existingExcludes = [];\n return;\n }\n\n const existingExcludes = this.existingExcludes.split(',');\n this.existingExcludes = existingExcludes.map((exclude) => {\n if (exclude.substr(0, 1) === '/') {\n return exclude.slice(1);\n }\n\n return exclude;\n });\n }\n\n isScanned(exclude) {\n let scanned = false;\n this.directoryListingContainer.querySelectorAll('.wpstg-dir>input').forEach((element) => {\n if (element.value == exclude) {\n scanned = true;\n }\n });\n\n return scanned;\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 * @return {string}\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 {function} 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';\nimport {handleDisplayDependencies, handleToggleElement, handleCopyPaste, handleCopyToClipboard} from './modules/wpstg-dom-utils.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 handleDisplayDependencies: handleDisplayDependencies,\n handleToggleElement: handleToggleElement,\n handleCopyPaste: handleCopyPaste,\n handleCopyToClipboard: handleCopyToClipboard,\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>&nbsp;</td><td><p id=\"wpstg_clone_hostname_error\" style=\"color: red;\">&nbsp;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'] + (response.message !== undefined ? ('<br/>' + response.message) : ''),\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":["polyfillClosest","Element","prototype","closest","matches","msMatchesSelector","webkitMatchesSelector","s","el","call","parentElement","parentNode","nodeType","element","selector","qs","document","querySelector","all","querySelectorAll","addEvent","parent","evt","handler","addEventListener","event","target","slideDown","duration","style","display","overflow","height","offsetHeight","transitionProperty","transitionDuration","setTimeout","window","removeProperty","slideUp","getNextSibling","sibling","nextElementSibling","getParents","result","push","handleDisplayDependencies","id","containerSelector","hiddenClass","elementType","getAttribute","container","showIfChecked","showIfUnchecked","checked","length","classList","remove","add","handleToggleElement","elements","toggle","handleCopyPaste","navigator","clipboard","writeText","value","handleCopyToClipboard","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","getExcludedDirectories","toggleDirExpand","unselectAll","selectDefault","parseExcludes","previousSibling","dirPath","isChecked","forceDefault","setAttribute","dirContainer","createElement","innerHTML","JSON","parse","directoryListing","appendChild","alert","forEach","isParentExcluded","exclude","isScanned","join","settings","directorySeparator","path","isParentAlreadyExcluded","dir","startsWith","getExtraDirectoriesRootOnly","extraDirectories","extraDirectoriesTextArea","extraCustomDirectories","split","concat","map","substr","slice","scanned","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","clearTimeout","undefined","tracker","clientX","clientY","compare","Math","abs","opt","focusOptionChanged","addFocus","removeFocus","dispatchOver","removeEventListener","onMouseOver","dispatchOut","onMouseOut","dispatchFocus","onFocus","dispatchBlur","onBlur","$","WPStagingCommon","continueErrorHandle","cache","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","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","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;EACA;EACA;EACA,SAASA,eAAT,GAA2B;EACzB,MAAIC,OAAO,CAACC,SAAR,CAAkBC,OAAtB,EAA+B;EAC7B,QAAI,CAACF,OAAO,CAACC,SAAR,CAAkBE,OAAvB,EAAgC;EAC9BH,MAAAA,OAAO,CAACC,SAAR,CAAkBE,OAAlB,GAA4BH,OAAO,CAACC,SAAR,CAAkBG,iBAAlB,IAAuCJ,OAAO,CAACC,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xB,EAAoD,UAASqiB,WAAT,EAAsB;EACxEtT,IAAAA,CAAC,CAACsE,IAAF,CAAO;EACLjB,MAAAA,GAAG,EAAE2B,OADA;EAELnQ,MAAAA,IAAI,EAAE,MAFD;EAGL0P,MAAAA,QAAQ,EAAE,MAHL;EAILpO,MAAAA,IAAI,EAAE;EACJ,kBAAU,iBADN;EAEJ,uBAAelC,KAAK,CAACyB,WAFjB;EAGJ,iBAASzB,KAAK,CAAC0B,KAHX;EAIJ,yBAAiB2d,WAAW,CAACC,MAAZ,CAAmB/c,KAJhC;EAKJ,kBAAUyJ,eAAe,CAACU,QAAhB;EALN;EAJD,KAAP;EAYD,GAbD;EAcD,CAxJD;;;;;;"}
1
+ {"version":3,"file":"wpstg-admin.js","sources":["../src/modules/wpstg-polyfill.js","../src/modules/wpstg-dom-utils.js","../src/modules/wpstg-clone-staging.js","../src/modules/wpstg-directory-navigation.js","../src/modules/wpstg-table-selection.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 * Polyfills the `Element.prototype.closest` function if not available in the browser.\n *\n * @return {Function} A function that will return the closest element, by selector, to this element.\n */\nfunction polyfillClosest() {\n if (Element.prototype.closest) {\n if (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n }\n\n Element.prototype.closest = function(s) {\n let el = this;\n\n do {\n if (Element.prototype.matches.call(el, s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n }\n\n return function(element, selector) {\n return element instanceof Element ? element.closest(selector) : null;\n };\n}\n\nexport const closest = polyfillClosest();\n","import {closest} from './wpstg-polyfill';\n\n/**\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 if (!parent instanceof Element) {\n return;\n }\n\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\n/**\n * Dispatches a change on an element that will trigger, depending on the element type,\n * cascading changes on elements dependant on the one that triggered the change and that\n * belong in the same container.\n *\n * @param {Element} element A reference to the Element the change was triggered from.\n *\n * @return {void} The function does not return any value and will have the side-effect of\n * hiding or showing dependant elements.\n */\nexport function handleDisplayDependencies(element) {\n if (!element instanceof Element || !element.id) {\n return;\n }\n\n const containerSelector = '.wpstg-container';\n // Use the default WordPress CSS class to hide and show the objects.\n const hiddenClass = 'hidden';\n const elementType = element.getAttribute('type');\n\n switch (elementType) {\n case 'checkbox':\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n const showIfChecked = container.querySelectorAll(`[data-show-if-checked=\"${element.id}\"]`);\n const showIfUnchecked = container.querySelectorAll(`[data-show-if-unchecked=\"${element.id}\"]`);\n const checked = element.checked;\n\n if (showIfChecked.length) {\n for (const el of showIfChecked) {\n if (checked) {\n el.classList.remove(hiddenClass);\n } else {\n el.classList.add(hiddenClass);\n }\n }\n }\n\n if (showIfUnchecked.length) {\n for (const el of showIfUnchecked) {\n if (checked) {\n el.classList.add(hiddenClass);\n } else {\n el.classList.remove(hiddenClass);\n }\n }\n }\n\n return;\n default:\n // Not a type we handle.\n return;\n }\n}\n\n/**\n * Initializes the display status of any element that depends on the status of another to\n * either hide or show.\n *\n * @return {void} The function will have the side-effect to toggle the hide/show class from\n * elements dependant on another to hide or show.\n */\nexport function initDependantDisplay() {\n const displayControllerSelector = '[onchange^=\"WPStaging.handleDisplayDependencies\"]';\n const displayControllers = document.querySelectorAll(displayControllerSelector);\n for (const displayController of displayControllers) {\n handleDisplayDependencies(displayController);\n }\n}\n\n/**\n * Toggle target element set in data-wpstg-target of the given element\n *\n * @param {Element} element A reference to the Element the change was triggered from.\n *\n * @return {void} The function does not return any value and will have the side-effect of\n * hiding or showing dependant elements.\n */\nexport function handleToggleElement(element) {\n if (!element instanceof Element || !element.getAttribute('data-wpstg-target')) {\n return;\n }\n\n const containerSelector = '.wpstg_admin';\n // Use the default WordPress CSS class to hide and show the objects.\n const hiddenClass = 'hidden';\n\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n const elements = container.querySelectorAll(element.getAttribute('data-wpstg-target'));\n\n if (elements.length) {\n for (const el of elements) {\n el.classList.toggle(hiddenClass);\n }\n }\n}\n\n/**\n * Copy text in data-wpstg-copy to element(s) in data-wpstg-target\n *\n * @param {Element} element\n *\n * @return {void}\n */\nexport function handleCopyPaste(element) {\n if (!element instanceof Element || !element.getAttribute('data-wpstg-target') || !element.getAttribute('data-wpstg-copy')) {\n return;\n }\n\n const containerSelector = '.wpstg_admin';\n\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n navigator.clipboard.writeText(element.getAttribute('data-wpstg-copy'));\n const elements = container.querySelectorAll(element.getAttribute('data-wpstg-target'));\n\n if (elements.length) {\n for (const el of elements) {\n el.value = element.getAttribute('data-wpstg-copy', '');\n }\n }\n}\n\n/**\n * Copy text in data-wpstg-source to clipboard\n *\n * @param {Element} element\n *\n * @return {void}\n */\nexport function handleCopyToClipboard(element) {\n if (!element instanceof Element || !element.getAttribute('data-wpstg-source')) {\n return;\n }\n\n const containerSelector = '.wpstg_admin';\n\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n const el = container.querySelector(element.getAttribute('data-wpstg-source'));\n\n if (el) {\n navigator.clipboard.writeText(el.value);\n }\n}\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 workflowSelector = '#wpstg-workflow',\n wpstgObject = wpstg,\n notyf = null,\n ) {\n this.directoryListingContainer = dom.qs(directoryListingSelector);\n this.workflow = dom.qs(workflowSelector);\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, 'change', this.dirCheckboxSelector, (element, event) => {\n event.preventDefault();\n console.log(this.getExcludedDirectories());\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 dom.addEvent(this.directoryListingContainer, 'click', '.wpstg-expand-dirs', (target, event) => {\n event.preventDefault();\n this.toggleDirectoryNavigation(target);\n });\n\n dom.addEvent(this.directoryListingContainer, 'change', 'input.wpstg-check-dir', (target) => {\n this.updateDirectorySelection(target);\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.isScanned(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 return;\n }\n\n if (this.existingExcludes.length === 0) {\n this.existingExcludes = [];\n return;\n }\n\n const existingExcludes = this.existingExcludes.split(',');\n this.existingExcludes = existingExcludes.map((exclude) => {\n if (exclude.substr(0, 1) === '/') {\n return exclude.slice(1);\n }\n\n return exclude;\n });\n }\n\n isScanned(exclude) {\n let scanned = false;\n this.directoryListingContainer.querySelectorAll('.wpstg-dir>input').forEach((element) => {\n if (element.value == exclude) {\n scanned = true;\n }\n });\n\n return scanned;\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","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Database tables selection\n */\nexport default class WpstgTableSelection {\n constructor(\n databaseTableSectionSelector = '#wpstg-scanning-db',\n workflowSelector = '#wpstg-workflow',\n networkCloneSelector = '#wpstg_network_clone',\n wpstgObject = wpstg,\n ) {\n this.databaseTableSection = dom.qs(databaseTableSectionSelector);\n this.workflow = dom.qs(workflowSelector);\n this.networkCloneSelector = networkCloneSelector;\n this.networkCloneCheckbox = dom.qs(networkCloneSelector);\n this.wpstgObject = wpstgObject;\n this.isAllTablesChecked = true;\n this.isMultisite = this.wpstgObject.isMultisite === '1';\n this.isNetworkClone = false;\n\n this.init();\n }\n\n setNetworkClone(isNetworkClone) {\n this.isNetworkClone = isNetworkClone;\n }\n\n addEvents() {\n if (this.workflow === null) {\n console.log('Error: database table section is null. Cannot register events');\n return;\n }\n\n dom.addEvent(this.workflow, 'change', this.networkCloneSelector, () => {\n this.selectDefaultTables();\n });\n\n dom.addEvent(this.workflow, 'click', '.wpstg-button-select', (target, event) => {\n event.preventDefault();\n this.selectDefaultTables();\n });\n\n dom.addEvent(this.workflow, 'click', '.wpstg-button-unselect', (target, event) => {\n event.preventDefault();\n this.toggleTableSelection();\n });\n }\n\n init() {\n this.addEvents();\n }\n\n getRegexPattern() {\n let pattern = '^' + this.wpstgObject.tblprefix;\n let isNetwork = false;\n if (this.networkCloneCheckbox !== undefined && this.networkCloneCheckbox !== null) {\n isNetwork = this.networkCloneCheckbox.checked;\n }\n\n // Force network clone true if set explicitly\n if (this.isNetworkClone) {\n isNetwork = true;\n }\n\n if (this.isMultisite && !isNetwork) {\n pattern += '([^0-9])_*';\n }\n\n return pattern;\n }\n\n selectDefaultTables() {\n const options = this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table');\n const regexPattern = this.getRegexPattern();\n options.forEach((option) => {\n const name = option.getAttribute('name', '');\n if (name.match(regexPattern)) {\n option.selected = true;\n } else {\n option.selected = false;\n }\n });\n }\n\n toggleTableSelection() {\n if (false === this.isAllTablesChecked) {\n this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach((option) => {\n option.selected = true;\n });\n this.databaseTableSection.querySelector('.wpstg-button-unselect').innerHTML = 'Unselect All';\n // cache.get('.wpstg-db-table-checkboxes').prop('checked', true);\n this.isAllTablesChecked = true;\n } else {\n this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach((option) => {\n option.selected = false;\n });\n this.databaseTableSection.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 getSelectedTablesWithoutPrefix() {\n const selectedTablesWithoutPrefix = [];\n const options = this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning option:checked');\n const regexPattern = this.getRegexPattern();\n options.forEach((option) => {\n const name = option.getAttribute('name', '');\n if (!name.match(regexPattern)) {\n selectedTablesWithoutPrefix.push(option.value);\n }\n });\n\n return selectedTablesWithoutPrefix.join(this.wpstgObject.settings.directorySeparator);\n }\n\n getIncludedTables() {\n const includedTables = [];\n const options = this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning option:checked');\n const regexPattern = this.getRegexPattern();\n options.forEach((option) => {\n const name = option.getAttribute('name', '');\n if (name.match(regexPattern)) {\n includedTables.push(option.value);\n }\n });\n\n return includedTables.join(this.wpstgObject.settings.directorySeparator);\n }\n\n getExcludedTables() {\n const excludedTables = [];\n const options = this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning option:not(:checked)');\n const regexPattern = this.getRegexPattern();\n options.forEach((option) => {\n const name = option.getAttribute('name', '');\n if (name.match(regexPattern)) {\n excludedTables.push(option.value);\n }\n });\n\n return excludedTables.join(this.wpstgObject.settings.directorySeparator);\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 * @return {string}\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 {function} 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 WpstgTableSelection from './wpstg-table-selection';\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.tableSelector = null;\n this.isNetworkClone = false;\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\n init() {\n this.addEvents();\n }\n\n setNetworkClone(isNetworkClone) {\n this.isNetworkClone = isNetworkClone;\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 this.tableSelector = new WpstgTableSelection('#wpstg-reset-excluded-tables', '.' + this.resetModalContainerClass);\n this.tableSelector.setNetworkClone(this.isNetworkClone);\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 getTableSelector() {\n return this.tableSelector;\n }\n\n getAjaxLoader() {\n return '<div class=\"wpstg-swal2-ajax-loader\"><img src=\"' + this.wpstgObject.wpstgIcon + '\" /></div>';\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 WpstgTableSelection from './modules/wpstg-table-selection.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';\nimport {handleDisplayDependencies, handleToggleElement, handleCopyPaste, handleCopyToClipboard} from './modules/wpstg-dom-utils.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 tableSelector: null,\n notyf: null,\n areAllTablesChecked: true,\n handleDisplayDependencies: handleDisplayDependencies,\n handleToggleElement: handleToggleElement,\n handleCopyPaste: handleCopyPaste,\n handleCopyToClipboard: handleCopyToClipboard,\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 /**\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 /**\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\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 */\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>&nbsp;</td><td><p id=\"wpstg_clone_hostname_error\" style=\"color: red;\">&nbsp;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-workflow', wpstg, that.notyf);\n that.tableSelector = new WpstgTableSelection('#wpstg-scanning-db', '#wpstg-workflow', '#wpstg_network_clone', 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 resetModal.setNetworkClone($(this).data('network') === 'yes');\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 tableSelector = resetModal.getTableSelector();\n const exclFilters = resetModal.getExcludeFilters().getExcludeFilters();\n\n let includedTables = '';\n let excludedTables = '';\n let selectedTablesWithoutPrefix = '';\n\n if (tableSelector !== null) {\n includedTables = tableSelector.getIncludedTables();\n excludedTables = tableSelector.getExcludedTables();\n selectedTablesWithoutPrefix = tableSelector.getSelectedTablesWithoutPrefix();\n }\n\n if (includedTables.length > excludedTables.length) {\n includedTables = '';\n } else if (excludedTables.length > includedTables.length) {\n excludedTables = '';\n }\n\n resetClone(clone, {\n includedTables: includedTables,\n excludedTables: excludedTables,\n selectedTablesWithoutPrefix: selectedTablesWithoutPrefix,\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 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 = '';\n that.data.excludedTables = '';\n if (that.tableSelector !== null) {\n that.data.includedTables = that.tableSelector.getIncludedTables();\n that.data.excludedTables = that.tableSelector.getExcludedTables();\n that.data.selectedTablesWithoutPrefix = that.tableSelector.getSelectedTablesWithoutPrefix();\n }\n\n if (that.data.includedTables.length > that.data.excludedTables.length) {\n that.data.includedTables = '';\n } else if (that.data.excludedTables.length > that.data.includedTables.length) {\n that.data.excludedTables = '';\n }\n\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-workflow', wpstg, that.notyf);\n that.tableSelector = new WpstgTableSelection('#wpstg-scanning-db', '#wpstg-workflow', '#wpstg_network_clone', 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'] + (response.message !== undefined ? ('<br/>' + response.message) : ''),\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":["polyfillClosest","Element","prototype","closest","matches","msMatchesSelector","webkitMatchesSelector","s","el","call","parentElement","parentNode","nodeType","element","selector","qs","document","querySelector","all","querySelectorAll","addEvent","parent","evt","handler","addEventListener","event","target","slideDown","duration","style","display","overflow","height","offsetHeight","transitionProperty","transitionDuration","setTimeout","window","removeProperty","slideUp","getNextSibling","sibling","nextElementSibling","getParents","result","push","handleDisplayDependencies","id","containerSelector","hiddenClass","elementType","getAttribute","container","showIfChecked","showIfUnchecked","checked","length","classList","remove","add","handleToggleElement","elements","toggle","handleCopyPaste","navigator","clipboard","writeText","value","handleCopyToClipboard","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","workflowSelector","directoryListingContainer","workflow","dirCheckboxSelector","dirExpandSelector","unselectAllDirsSelector","selectDefaultDirsSelector","fetchChildrenAction","currentCheckboxElement","currentParentDiv","currentLoader","existingExcludes","excludedDirectories","isDefaultSelected","log","preventDefault","getExcludedDirectories","toggleDirExpand","unselectAll","selectDefault","toggleDirectoryNavigation","updateDirectorySelection","parseExcludes","previousSibling","dirPath","isChecked","forceDefault","setAttribute","dirContainer","createElement","innerHTML","JSON","parse","directoryListing","appendChild","alert","forEach","isParentExcluded","exclude","isScanned","join","settings","directorySeparator","path","isParentAlreadyExcluded","dir","startsWith","getExtraDirectoriesRootOnly","extraDirectories","extraDirectoriesTextArea","extraCustomDirectories","split","concat","map","substr","slice","scanned","cbElement","subDirectories","parElem","i","children","WpstgTableSelection","databaseTableSectionSelector","networkCloneSelector","databaseTableSection","networkCloneCheckbox","isAllTablesChecked","isMultisite","isNetworkClone","setNetworkClone","selectDefaultTables","toggleTableSelection","getRegexPattern","pattern","tblprefix","isNetwork","undefined","options","regexPattern","option","name","match","selected","getSelectedTablesWithoutPrefix","selectedTablesWithoutPrefix","getIncludedTables","includedTables","getExcludedTables","excludedTables","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","sensitivity","interval","timeout","handleFocus","delay","clearTimeout","tracker","clientX","clientY","compare","Math","abs","opt","focusOptionChanged","addFocus","removeFocus","dispatchOver","removeEventListener","onMouseOver","dispatchOut","onMouseOut","dispatchFocus","onFocus","dispatchBlur","onBlur","$","WPStagingCommon","continueErrorHandle","cache","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","fetchExcludeSettingsAction","modalErrorAction","resetButtonClass","resetModalContainerClass","resetTabSelector","directoryNavigator","excludeFilters","tableSelector","resetModalContainer","toggleContent","contentId","tabTriangle","isCollapsed","contains","transform","showModal","swalPromise","loadModal","fetchCloneExcludes","getAjaxLoader","width","focusConfirm","confirmButtonText","resetClone","job","errorModal","modal","renderError","getDirectoryNavigator","getTableSelector","wpstgIcon","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","getElementById","clearInterval","removeAttr","cloneDirectoryName","directoryName","addClass","slug","substring","$targetDir","$targetUri","uri","attr","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","excludeSizeRules","encodeURIComponent","sizes","excludeGlobRules","globs","stepButtons","focus","onlyUpdateMessage","is","verifyExternalDatabase","proceedCloning","loadOverview","each","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","slideToggle","find","hasClass","deleteDir","logscroll","$div","scrollHeight","constructor","date","requiredSpace","errorMessage","convertSeconds","setInterval","seconds","setSeconds","toISOString","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","trigger","isClickInside","dropDown","getElementsByClassName","customEvent","detail"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA,SAASA,eAAT,GAA2B;EACzB,MAAIC,OAAO,CAACC,SAAR,CAAkBC,OAAtB,EAA+B;EAC7B,QAAI,CAACF,OAAO,CAACC,SAAR,CAAkBE,OAAvB,EAAgC;EAC9BH,MAAAA,OAAO,CAACC,SAAR,CAAkBE,OAAlB,GAA4BH,OAAO,CAACC,SAAR,CAAkBG,iBAAlB,IAAuCJ,OAAO,CAACC,SAAR,CAAkBI,qBAArF;EACD;;EAEDL,IAAAA,OAAO,CAACC,SAAR,CAAkBC,OAAlB,GAA4B,UAASI,CAAT,EAAY;EACtC,UAAIC,EAAE,GAAG,IAAT;;EAEA,SAAG;EACD,YAAIP,OAAO,CAACC,SAAR,CAAkBE,OAAlB,CAA0BK,IAA1B,CAA+BD,EAA/B,EAAmCD,CAAnC,CAAJ,EAA2C,OAAOC,EAAP;EAC3CA,QAAAA,EAAE,GAAGA,EAAE,CAACE,aAAH,IAAoBF,EAAE,CAACG,UAA5B;EACD,OAHD,QAGSH,EAAE,KAAK,IAAP,IAAeA,EAAE,CAACI,QAAH,KAAgB,CAHxC;;EAIA,aAAO,IAAP;EACD,KARD;EASD;;EA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AQ,CAACqjB,sBAAT,CAAgC,qBAAhC,CAAjB;;EACA,WAAK,IAAIpZ,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGmZ,QAAQ,CAAC5gB,MAA7B,EAAqCyH,CAAC,EAAtC,EAA0C;EACxCmZ,QAAAA,QAAQ,CAACnZ,CAAD,CAAR,CAAYxH,SAAZ,CAAsBC,MAAtB,CAA6B,OAA7B;EACD;;EACDgP,MAAAA,CAAC,CAAC,cAAD,CAAD,CAAkBoE,WAAlB,CAA8B,gBAA9B;EACD;EACF,GATD,EA9HiC;;EA0IjCzU,EAAAA,MAAM,CAACb,gBAAP,CAAwB,0BAAxB,EAAoD,UAAS8iB,WAAT,EAAsB;EACxE5R,IAAAA,CAAC,CAACsE,IAAF,CAAO;EACLjB,MAAAA,GAAG,EAAE2B,OADA;EAELtS,MAAAA,IAAI,EAAE,MAFD;EAGL6R,MAAAA,QAAQ,EAAE,MAHL;EAILvQ,MAAAA,IAAI,EAAE;EACJ,kBAAU,iBADN;EAEJ,uBAAelC,KAAK,CAACyB,WAFjB;EAGJ,iBAASzB,KAAK,CAAC0B,KAHX;EAIJ,yBAAiBoe,WAAW,CAACC,MAAZ,CAAmBxd,KAJhC;EAKJ,kBAAU4L,eAAe,CAACU,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,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,n=new Array(t);s<t;s++)n[s]=e[s];return n}function s(e,s){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,s){if(e){if("string"==typeof e)return t(e,s);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,s):void 0}}(e))||s&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}var n=(Element.prototype.closest&&(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}),function(e,t){return e instanceof Element?e.closest(t):null});function r(e){return document.querySelector(e)}function o(e){return document.querySelectorAll(e)}function i(e,t,s,n){!e instanceof Element||e.addEventListener(t,(function(e){e.target.matches(s+", "+s+" *")&&n(e.target.closest(s),e)}),!1)}function a(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 c(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)}function l(e){if(!(!e instanceof Element)&&e.id){var t="hidden";switch(e.getAttribute("type")){case"checkbox":var r=n(e,".wpstg-container");if(null===r)return;var o=r.querySelectorAll('[data-show-if-checked="'+e.id+'"]'),i=r.querySelectorAll('[data-show-if-unchecked="'+e.id+'"]'),a=e.checked;if(o.length)for(var c,l=s(o);!(c=l()).done;){var g=c.value;a?g.classList.remove(t):g.classList.add(t)}if(i.length)for(var p,d=s(i);!(p=d()).done;){var u=p.value;a?u.classList.add(t):u.classList.remove(t)}return;default:return}}}function g(e){if(!(!e instanceof Element)&&e.getAttribute("data-wpstg-target")){var t=n(e,".wpstg_admin");if(null!==t){var r=t.querySelectorAll(e.getAttribute("data-wpstg-target"));if(r.length)for(var o,i=s(r);!(o=i()).done;){o.value.classList.toggle("hidden")}}}}function p(e){if(!(!e instanceof Element)&&e.getAttribute("data-wpstg-target")&&e.getAttribute("data-wpstg-copy")){var t=n(e,".wpstg_admin");if(null!==t){navigator.clipboard.writeText(e.getAttribute("data-wpstg-copy"));var r=t.querySelectorAll(e.getAttribute("data-wpstg-target"));if(r.length)for(var o,i=s(r);!(o=i()).done;){o.value.value=e.getAttribute("data-wpstg-copy","")}}}}function d(e){if(!(!e instanceof Element)&&e.getAttribute("data-wpstg-source")){var t=n(e,".wpstg_admin");if(null!==t){var s=t.querySelector(e.getAttribute("data-wpstg-source"));s&&navigator.clipboard.writeText(s.value)}}}var u=function(){function e(e,t){void 0===e&&(e="#wpstg-clonepage-wrapper"),void 0===t&&(t=wpstg),this.pageWrapper=r(e),this.wpstgObject=t,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 t=e.prototype;return t.addEvents=function(){var e=this;null!==this.pageWrapper&&i(this.pageWrapper,"click",this.enableButtonId,(function(){e.sendRequest(e.enableAction)}))},t.init=function(){this.addEvents()},t.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}(),w=function(){function e(e,t,s){void 0===e&&(e="#wpstg-directories-listing"),void 0===t&&(t=wpstg),void 0===s&&(s=null),this.directoryListingContainer=r(e),this.wpstgObject=t,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=s,this.init()}var t=e.prototype;return t.addEvents=function(){var e=this;null!==this.directoryListingContainer?(i(this.directoryListingContainer,"change",this.dirCheckboxSelector,(function(t,s){s.preventDefault(),console.log(e.getExcludedDirectories())})),i(this.directoryListingContainer,"click",this.dirExpandSelector,(function(t,s){s.preventDefault(),e.toggleDirExpand(t)&&e.sendRequest(e.fetchChildrenAction,t)})),i(this.directoryListingContainer,"click",this.unselectAllDirsSelector,(function(){e.unselectAll()})),i(this.directoryListingContainer,"click",this.selectDefaultDirsSelector,(function(){e.selectDefault()}))):console.log("Error: directory navigation add events")},t.init=function(){this.addEvents(),this.parseExcludes()},t.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")},t.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 a(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)}))},t.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.isScanned(t)||e.excludedDirectories.push(t)})),this.excludedDirectories.join(this.wpstgObject.settings.directorySeparator)},t.isParentExcluded=function(e){var t=!1;return this.excludedDirectories.forEach((function(s){e.startsWith(s+"/")&&(t=!0)})),t},t.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 t=r("#wpstg_extraDirectories");if(null===t||""===t.value)return e.join(this.wpstgObject.settings.directorySeparator);var s=t.value.split(/\r?\n/);return e.concat(s).join(this.wpstgObject.settings.directorySeparator)},t.unselectAll=function(){this.directoryListingContainer.querySelectorAll(".wpstg-dir input").forEach((function(e){e.checked=!1}))},t.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},t.parseExcludes=function(){if(this.existingExcludes=this.directoryListingContainer.getAttribute("data-existing-excludes",[]),""!==this.existingExcludes)if(0!==this.existingExcludes.length){var e=this.existingExcludes.split(",");this.existingExcludes=e.map((function(e){return"/"===e.substr(0,1)?e.slice(1):e}))}else this.existingExcludes=[];else this.existingExcludes=[]},t.isScanned=function(e){var t=!1;return this.directoryListingContainer.querySelectorAll(".wpstg-dir>input").forEach((function(s){s.value==e&&(t=!0)})),t},e}(),h=function(){function e(e,t){void 0===e&&(e="#wpstg-exclude-filters-container"),void 0===t&&(t=wpstg),this.excludeContainer=r(e),this.excludeTableBody=r(e+" tbody"),this.wpstgObject=t,this.init()}var t=e.prototype;return t.addEvents=function(){var e=this;i(this.excludeContainer,"click",".wpstg-file-size-rule",(function(){e.addFileSizeExclude()})),i(this.excludeContainer,"click",".wpstg-file-ext-rule",(function(){e.addFileExtExclude()})),i(this.excludeContainer,"click",".wpstg-file-name-rule",(function(){e.addFileNameExclude()})),i(this.excludeContainer,"click",".wpstg-dir-name-rule",(function(){e.addDirNameExclude()})),i(this.excludeContainer,"click",".wpstg-clear-all-rules",(function(){e.clearExcludes()})),i(this.excludeContainer,"click",".wpstg-remove-exclude-rule",(function(t){e.removeExclude(t)}))},t.init=function(){null!==this.excludeContainer?this.addEvents():console.log("Error: Given table selector not found!")},t.addFileSizeExclude=function(){this.addExcludeRuleRow("#wpstg-file-size-exclude-filter-template")},t.addFileExtExclude=function(){this.addExcludeRuleRow("#wpstg-file-ext-exclude-filter-template")},t.addFileNameExclude=function(){this.addExcludeRuleRow("#wpstg-file-name-exclude-filter-template")},t.addDirNameExclude=function(){this.addExcludeRuleRow("#wpstg-dir-name-exclude-filter-template")},t.addExcludeRuleRow=function(e){var t=r(e);if(null!==t){var s=t.content.cloneNode(!0).querySelector("tr");this.excludeTableBody.appendChild(s),o(".wpstg-has-exclude-rules").forEach((function(e){e.style.display="inherit"}))}},t.clearExcludes=function(){this.excludeTableBody.innerHTML="",o(".wpstg-has-exclude-rules").forEach((function(e){e.style.display="none"}))},t.removeExclude=function(e){null!==e.parentElement&&null!==e.parentElement.parentElement&&this.excludeTableBody.removeChild(e.parentElement.parentElement),""===this.excludeTableBody.innerHTML.trim()&&o(".wpstg-has-exclude-rules").forEach((function(e){e.style.display="none"}))},t.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(",")}},t.onlyUnique=function(e,t,s){return s.indexOf(e)===t},t.cleanStringForGlob=function(e){return e.replace(/[*^//!\.[?]/g,"")},e}(),f=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 m(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 v=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(){m(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),b=function(){function e(e,t,s,n,o){void 0===t&&(t="#wpstg-workflow"),void 0===s&&(s="wpstg_clone_excludes_settings"),void 0===n&&(n="wpstg_modal_error"),void 0===o&&(o=wpstg),this.cloneID=e,this.workflow=r(t),this.wpstgObject=o,this.fetchExcludeSettingsAction=s,this.modalErrorAction=n,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 t=e.prototype;return t.addEvents=function(){var e=this,t=r("."+this.resetModalContainerClass);null!==t?(i(t,"click",this.resetTabSelector,(function(t){e.toggleContent(t)})),i(t,"click",".wpstg-button-select",(function(){e.selectDefaultTables()})),i(t,"click",".wpstg-button-unselect",(function(){e.toggleTableSelection()})),i(t,"click",".wpstg-expand-dirs",(function(t,s){s.preventDefault(),e.toggleDirectoryNavigation(t)})),i(t,"change","input.wpstg-check-dir",(function(t){e.updateDirectorySelection(t)}))):console.log("Exit")},t.init=function(){this.addEvents()},t.toggleContent=function(e){var t=r("."+this.resetModalContainerClass),s=e.getAttribute("data-id"),n=e.querySelector(".wpstg-tab-triangle"),o=e.getAttribute("data-collapsed","true"),i=r(s);"true"===o?(t.classList.contains("has-collapsible-open")?t.classList.add("has-collapsible-open-2"):t.classList.add("has-collapsible-open"),a(i),n.style.transform="rotate(90deg)",e.setAttribute("data-collapsed","false")):(t.classList.contains("has-collapsible-open-2")?t.classList.remove("has-collapsible-open-2"):t.classList.remove("has-collapsible-open"),c(i),n.style.removeProperty("transform"),e.setAttribute("data-collapsed","true"))},t.showModal=function(){var e=this.loadModal();return this.init(),this.fetchCloneExcludes(),e},t.loadModal=function(){return v.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})},t.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(t){if(t.success){var s=r(".wpstg-reset-confirmation");s.classList.remove("wpstg-swal2-loading"),s.querySelector(".wpstg--swal2-popup").style.width="500px",s.querySelector(".wpstg--swal2-content").innerHTML=t.html,e.directoryNavigator=new w,e.excludeFilters=new h}else{new f(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},t.swalOptions),{type:t.type})}})).catch((function(t){e.renderError({html:e.wpstgObject.i18n.somethingWentWrong+" "+t})}))},t.getDirectoryNavigator=function(){return this.directoryNavigator},t.getExcludeFilters=function(){return this.excludeFilters},t.getAjaxLoader=function(){return'<div class="wpstg-swal2-ajax-loader"><img src="'+this.wpstgObject.wpstgIcon+'" /></div>'},t.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?a(s):c(s)}},t.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})))},t.selectDefaultTables=function(){var e=this,t=r("."+this.resetModalContainerClass).querySelectorAll("#wpstg_select_tables_cloning .wpstg-db-table"),s="^"+this.wpstgObject.tblprefix+"([^0-9])_*",n="^"+this.wpstgObject.tblprefix;t.forEach((function(t){var r=t.getAttribute("name","");"1"===e.wpstgObject.isMultisite&&r.match(s)||""===e.wpstgObject.isMultisite&&r.match(n)?t.setAttribute("selected","selected"):t.removeAttribute("selected")}))},t.toggleTableSelection=function(){var e=r("."+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}(),y=function(){function e(e){void 0===e&&(e="#wpstg-clonepage-wrapper"),this.baseContainer=r(e),this.checkBoxSettingTogglerSelector=".wpstg-toggle-advance-settings-section",this.init()}var t=e.prototype;return t.addEvents=function(){var e=this;null!==this.baseContainer&&i(this.baseContainer,"change",this.checkBoxSettingTogglerSelector,(function(t){e.toggleSettings(t)}))},t.init=function(){this.addEvents()},t.toggleSettings=function(e){var t=r("#"+e.getAttribute("data-id"));e.checked?a(t):c(t)},e}(),x=function(){function e(){this.activeTabClass="wpstg--tab--active",this.mainMenu()}return e.prototype.mainMenu=function(){var e=this;null!==r(".wpstg--tab--header")&&i(r(".wpstg--tab--header"),"click",".wpstg-button",(function(t){var s=t,n=s.getAttribute("data-target"),r=o(n),i=o(".wpstg--tab--header a[data-target]");o(".wpstg--tab--contents > .wpstg--tab--content").forEach((function(t){t.matches("."+e.activeTabClass+":not("+n+")")&&t.classList.remove(e.activeTabClass)})),i.forEach((function(t){t!==s&&t.classList.remove(e.activeTabClass)})),s.classList.add(e.activeTabClass),r.forEach((function(t){t.classList.add(e.activeTabClass)})),"#wpstg--tab--backup"===n&&window.dispatchEvent(new Event("backups-tab"))}))},e}(),k=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,handleDisplayDependencies:l,handleToggleElement:g,handleCopyPaste:p,handleCopyToClipboard:d},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 i=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",k.warnIfClosingDuringProcess)):void 0!==e.error&&e.error?(console.error(e.message),o(t+" Error: "+e.message+s),void window.removeEventListener("beforeunload",k.warnIfClosingDuringProcess)):void 0},a=function(){r.get("#wpstg-error-details").hide().html("")},c=function(){var e=t("#wpstg_clone_hostname").val();if(""===e)return!0;return!1!==/^http(s)?:\/\/.*$/.test(e)},m=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),O()})).on("click","#wpstg-resume-cloning",(function(){a();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(){a();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),R()})).on("click","#wpstg-restart-cloning",(function(){a();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),B()})).on("click",".wpstg-remove-clone[data-clone]",(function(s){a(),s.preventDefault();var n=r.get("#wpstg-existing-clones");e.removeClass("active"),r.get(".wpstg-loader").show(),S({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){a(),e.preventDefault(),r.get("#wpstg-removing-clone").addClass("loading"),r.get(".wpstg-loader").show(),I(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,S({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=j(t);if(!1!==s&&!1===s.success)return e.removeClass("loading"),void P(s);e.removeClass("loading").html(t),F(),n.directoryNavigator=new w("#wpstg-directories-listing",wpstg,n.notyf),n.cloneExcludeFilters=new h,n.switchStep(2)}),"HTML")})).on("click",".wpstg-reset-clone",(function(e){e.preventDefault();var s=t(this).data("clone"),r=new b(s),o=r.showModal();n.areAllTablesChecked=!0,o.then((function(e){if(e.value){var t=r.getDirectoryNavigator(),n=r.getExcludeFilters().getExcludeFilters();A(s,{includedTables:E(),excludeSizeRules:encodeURIComponent(n.sizes),excludeGlobRules:encodeURIComponent(n.globs),excludedDirectories:t.getExcludedDirectories(),extraDirectories:t.getExtraDirectoriesRootOnly()})}}))}))},S=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 ")}}})},E=function(){var e=[];return t("#wpstg_select_tables_cloning option:selected").each((function(){e.push(this.value)})),e},C=function(){var e=[];return t(".wpstg-db-table input:not(:checked)").each((function(){e.push(this.name)})),e},_=function(e,t){r.get(".wpstg-loader").show(),S({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 T(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 v.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&&T(e,t)}))}v.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)},T=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 h){var e=n.cloneExcludeFilters.getExcludeFilters();n.data.excludeGlobRules=encodeURIComponent(e.globs),n.data.excludeSizeRules=encodeURIComponent(e.sizes)}n.data.includedTables=E(),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")}}(),D(s)},D=function(e){S(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=j(t);if(!1!==s&&!1===s.success)return e.removeClass("loading"),void P(s);e.removeClass("loading").html(t),n.cloneExcludeFilters=null,"wpstg_scanning"===n.data.action?(n.areAllTablesChecked=!0,n.directoryNavigator=new w("#wpstg-directories-listing",wpstg,n.notyf),n.switchStep(2),n.cloneExcludeFilters=new h):"wpstg_cloning"!==n.data.action&&"wpstg_update"!==n.data.action&&"wpstg_reset"!==n.data.action||n.switchStep(3),n.startCloning()}),"HTML")},P=function(e){new f("wpstg_modal_error",wpstg).show(Object.assign({title:"Error",icon:"error",html:wpstg.i18n.somethingWentWrong+(void 0!==e.message?"<br/>"+e.message:""),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})},j=function(e){if(!e)return!1;try{var t=JSON.parse(e);if(t&&"object"==typeof t)return t}catch(e){}return!1},A=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");D(o)},L=function(){var e=r.get("#wpstg-workflow");e.addClass("loading"),S({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()},I=function e(s){var n=t("#deleteDirectory:checked").data("deletepath");S({action:"wpstg_delete_clone",clone:s,accessToken:wpstg.accessToken,nonce:wpstg.nonce,excludedTables:C(),deleteDir:n},(function(n){if(n&&(i(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)}))},O=function e(){if(n.timer("stop"),!0===n.isFinished)return!0;S({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 L();!0===t?L():e()}))},R=function e(){if(!0===n.isFinished)return!0;S({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?L():e()}))},B=function(){if(!0===n.isFinished)return!0;S({action:"wpstg_restart",accessToken:wpstg.accessToken,nonce:wpstg.nonce},(function(e){e&&void 0!==e.delete&&"finished"===e.delete||!0===e?L():R()}))},q=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)},F=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());S({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(a(),F(),"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",k.warnIfClosingDuringProcess),e()}),wpstg.delayReq),n.timer("start");var e=function e(){if(!0===n.isCancelled)return window.removeEventListener("beforeunload",k.warnIfClosingDuringProcess),!1;var o;(o=!0)&&!1!==o?r.get(".wpstg-loader").show():r.get(".wpstg-loader").hide();var a="",c="";null!==n.directoryNavigator&&(a=n.directoryNavigator.getExcludedDirectories(),c=n.directoryNavigator.getExtraDirectoriesRootOnly()),r.get(".wpstg-log-details").show(),k.ajax({action:"wpstg_processing",accessToken:wpstg.accessToken,nonce:wpstg.nonce,excludedTables:C(),excludedDirectories:encodeURIComponent(a),extraDirectories:encodeURIComponent(c)},(function(o){i(o),void 0!==o.last_msg&&o.last_msg&&q(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",k.warnIfClosingDuringProcess),function(e){!0===n.getLogs&&q();s(e),void 0!==e.last_msg&&q(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(),v.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,i;L(),o=r.get("#wpstg-workflow"),i=ajaxurl.replace("/admin-ajax.php","")+"/images/spinner",2<window.devicePixelRatio&&(i+="-2x"),s="<img src=''"+(i+=".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=v.slugify(this.value);e=setTimeout((function(){S({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(){a(),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=v.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()||c()?t("#wpstg_clone_hostname_error").remove():c()||t("#wpstg_clone_hostname_error").length||t("#wpstg-clone-directory tr:last-of-type").after('<tr><td>&nbsp;</td><td><p id="wpstg_clone_hostname_error" style="color: red;">&nbsp;Invalid host name. Please provide it in a format like http://example.com</p></td></tr>')})),m(),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&&!c())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")?_(n,e):T(n,e)})).on("click",".wpstg-prev-step-link",(function(e){e.preventDefault(),r.get(".wpstg-loader").removeClass("wpstg-finished"),r.get(".wpstg-loader").hide(),L()}))}(),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")})),v.listenTooltip(),new x,new u,new y,n.notyf=new Notyf({duration:1e4,position:{x:"center",y:"bottom"},dismissible:!0,types:[{type:"warning",background:"orange",icon:!1}]})},n.ajax=S,n.showError=o,n.getLogs=q,n.loadOverview=L,n}(jQuery);jQuery(document).ready((function(){k.init(),window.WPStaging=k})),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="",v.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:v.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,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,n=new Array(t);s<t;s++)n[s]=e[s];return n}function s(e,s){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,s){if(e){if("string"==typeof e)return t(e,s);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,s):void 0}}(e))||s&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}var n=(Element.prototype.closest&&(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}),function(e,t){return e instanceof Element?e.closest(t):null});function r(e){return document.querySelector(e)}function o(e){return document.querySelectorAll(e)}function i(e,t,s,n){!e instanceof Element||e.addEventListener(t,(function(e){e.target.matches(s+", "+s+" *")&&n(e.target.closest(s),e)}),!1)}function a(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 l(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)}function c(e){if(!(!e instanceof Element)&&e.id){var t="hidden";switch(e.getAttribute("type")){case"checkbox":var r=n(e,".wpstg-container");if(null===r)return;var o=r.querySelectorAll('[data-show-if-checked="'+e.id+'"]'),i=r.querySelectorAll('[data-show-if-unchecked="'+e.id+'"]'),a=e.checked;if(o.length)for(var l,c=s(o);!(l=c()).done;){var g=l.value;a?g.classList.remove(t):g.classList.add(t)}if(i.length)for(var d,p=s(i);!(d=p()).done;){var u=d.value;a?u.classList.add(t):u.classList.remove(t)}return;default:return}}}function g(e){if(!(!e instanceof Element)&&e.getAttribute("data-wpstg-target")){var t=n(e,".wpstg_admin");if(null!==t){var r=t.querySelectorAll(e.getAttribute("data-wpstg-target"));if(r.length)for(var o,i=s(r);!(o=i()).done;){o.value.classList.toggle("hidden")}}}}function d(e){if(!(!e instanceof Element)&&e.getAttribute("data-wpstg-target")&&e.getAttribute("data-wpstg-copy")){var t=n(e,".wpstg_admin");if(null!==t){navigator.clipboard.writeText(e.getAttribute("data-wpstg-copy"));var r=t.querySelectorAll(e.getAttribute("data-wpstg-target"));if(r.length)for(var o,i=s(r);!(o=i()).done;){o.value.value=e.getAttribute("data-wpstg-copy","")}}}}function p(e){if(!(!e instanceof Element)&&e.getAttribute("data-wpstg-source")){var t=n(e,".wpstg_admin");if(null!==t){var s=t.querySelector(e.getAttribute("data-wpstg-source"));s&&navigator.clipboard.writeText(s.value)}}}var u=function(){function e(e,t){void 0===e&&(e="#wpstg-clonepage-wrapper"),void 0===t&&(t=wpstg),this.pageWrapper=r(e),this.wpstgObject=t,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 t=e.prototype;return t.addEvents=function(){var e=this;null!==this.pageWrapper&&i(this.pageWrapper,"click",this.enableButtonId,(function(){e.sendRequest(e.enableAction)}))},t.init=function(){this.addEvents()},t.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}(),w=function(){function e(e,t,s,n){void 0===e&&(e="#wpstg-directories-listing"),void 0===t&&(t="#wpstg-workflow"),void 0===s&&(s=wpstg),void 0===n&&(n=null),this.directoryListingContainer=r(e),this.workflow=r(t),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 t=e.prototype;return t.addEvents=function(){var e=this;null!==this.directoryListingContainer?(i(this.directoryListingContainer,"change",this.dirCheckboxSelector,(function(t,s){s.preventDefault(),console.log(e.getExcludedDirectories())})),i(this.directoryListingContainer,"click",this.dirExpandSelector,(function(t,s){s.preventDefault(),e.toggleDirExpand(t)&&e.sendRequest(e.fetchChildrenAction,t)})),i(this.directoryListingContainer,"click",this.unselectAllDirsSelector,(function(){e.unselectAll()})),i(this.directoryListingContainer,"click",this.selectDefaultDirsSelector,(function(){e.selectDefault()})),i(this.directoryListingContainer,"click",".wpstg-expand-dirs",(function(t,s){s.preventDefault(),e.toggleDirectoryNavigation(t)})),i(this.directoryListingContainer,"change","input.wpstg-check-dir",(function(t){e.updateDirectorySelection(t)}))):console.log("Error: directory navigation add events")},t.init=function(){this.addEvents(),this.parseExcludes()},t.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")},t.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 a(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)}))},t.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.isScanned(t)||e.excludedDirectories.push(t)})),this.excludedDirectories.join(this.wpstgObject.settings.directorySeparator)},t.isParentExcluded=function(e){var t=!1;return this.excludedDirectories.forEach((function(s){e.startsWith(s+"/")&&(t=!0)})),t},t.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 t=r("#wpstg_extraDirectories");if(null===t||""===t.value)return e.join(this.wpstgObject.settings.directorySeparator);var s=t.value.split(/\r?\n/);return e.concat(s).join(this.wpstgObject.settings.directorySeparator)},t.unselectAll=function(){this.directoryListingContainer.querySelectorAll(".wpstg-dir input").forEach((function(e){e.checked=!1}))},t.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},t.parseExcludes=function(){if(this.existingExcludes=this.directoryListingContainer.getAttribute("data-existing-excludes",[]),""!==this.existingExcludes)if(0!==this.existingExcludes.length){var e=this.existingExcludes.split(",");this.existingExcludes=e.map((function(e){return"/"===e.substr(0,1)?e.slice(1):e}))}else this.existingExcludes=[];else this.existingExcludes=[]},t.isScanned=function(e){var t=!1;return this.directoryListingContainer.querySelectorAll(".wpstg-dir>input").forEach((function(s){s.value==e&&(t=!0)})),t},t.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?a(s):l(s)}},t.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})))},e}(),h=function(){function e(e,t,s,n){void 0===e&&(e="#wpstg-scanning-db"),void 0===t&&(t="#wpstg-workflow"),void 0===s&&(s="#wpstg_network_clone"),void 0===n&&(n=wpstg),this.databaseTableSection=r(e),this.workflow=r(t),this.networkCloneSelector=s,this.networkCloneCheckbox=r(s),this.wpstgObject=n,this.isAllTablesChecked=!0,this.isMultisite="1"===this.wpstgObject.isMultisite,this.isNetworkClone=!1,this.init()}var t=e.prototype;return t.setNetworkClone=function(e){this.isNetworkClone=e},t.addEvents=function(){var e=this;null!==this.workflow?(i(this.workflow,"change",this.networkCloneSelector,(function(){e.selectDefaultTables()})),i(this.workflow,"click",".wpstg-button-select",(function(t,s){s.preventDefault(),e.selectDefaultTables()})),i(this.workflow,"click",".wpstg-button-unselect",(function(t,s){s.preventDefault(),e.toggleTableSelection()}))):console.log("Error: database table section is null. Cannot register events")},t.init=function(){this.addEvents()},t.getRegexPattern=function(){var e="^"+this.wpstgObject.tblprefix,t=!1;return void 0!==this.networkCloneCheckbox&&null!==this.networkCloneCheckbox&&(t=this.networkCloneCheckbox.checked),this.isNetworkClone&&(t=!0),this.isMultisite&&!t&&(e+="([^0-9])_*"),e},t.selectDefaultTables=function(){var e=this.databaseTableSection.querySelectorAll("#wpstg_select_tables_cloning .wpstg-db-table"),t=this.getRegexPattern();e.forEach((function(e){e.getAttribute("name","").match(t)?e.selected=!0:e.selected=!1}))},t.toggleTableSelection=function(){!1===this.isAllTablesChecked?(this.databaseTableSection.querySelectorAll("#wpstg_select_tables_cloning .wpstg-db-table").forEach((function(e){e.selected=!0})),this.databaseTableSection.querySelector(".wpstg-button-unselect").innerHTML="Unselect All",this.isAllTablesChecked=!0):(this.databaseTableSection.querySelectorAll("#wpstg_select_tables_cloning .wpstg-db-table").forEach((function(e){e.selected=!1})),this.databaseTableSection.querySelector(".wpstg-button-unselect").innerHTML="Select All",this.isAllTablesChecked=!1)},t.getSelectedTablesWithoutPrefix=function(){var e=[],t=this.databaseTableSection.querySelectorAll("#wpstg_select_tables_cloning option:checked"),s=this.getRegexPattern();return t.forEach((function(t){t.getAttribute("name","").match(s)||e.push(t.value)})),e.join(this.wpstgObject.settings.directorySeparator)},t.getIncludedTables=function(){var e=[],t=this.databaseTableSection.querySelectorAll("#wpstg_select_tables_cloning option:checked"),s=this.getRegexPattern();return t.forEach((function(t){t.getAttribute("name","").match(s)&&e.push(t.value)})),e.join(this.wpstgObject.settings.directorySeparator)},t.getExcludedTables=function(){var e=[],t=this.databaseTableSection.querySelectorAll("#wpstg_select_tables_cloning option:not(:checked)"),s=this.getRegexPattern();return t.forEach((function(t){t.getAttribute("name","").match(s)&&e.push(t.value)})),e.join(this.wpstgObject.settings.directorySeparator)},e}(),f=function(){function e(e,t){void 0===e&&(e="#wpstg-exclude-filters-container"),void 0===t&&(t=wpstg),this.excludeContainer=r(e),this.excludeTableBody=r(e+" tbody"),this.wpstgObject=t,this.init()}var t=e.prototype;return t.addEvents=function(){var e=this;i(this.excludeContainer,"click",".wpstg-file-size-rule",(function(){e.addFileSizeExclude()})),i(this.excludeContainer,"click",".wpstg-file-ext-rule",(function(){e.addFileExtExclude()})),i(this.excludeContainer,"click",".wpstg-file-name-rule",(function(){e.addFileNameExclude()})),i(this.excludeContainer,"click",".wpstg-dir-name-rule",(function(){e.addDirNameExclude()})),i(this.excludeContainer,"click",".wpstg-clear-all-rules",(function(){e.clearExcludes()})),i(this.excludeContainer,"click",".wpstg-remove-exclude-rule",(function(t){e.removeExclude(t)}))},t.init=function(){null!==this.excludeContainer?this.addEvents():console.log("Error: Given table selector not found!")},t.addFileSizeExclude=function(){this.addExcludeRuleRow("#wpstg-file-size-exclude-filter-template")},t.addFileExtExclude=function(){this.addExcludeRuleRow("#wpstg-file-ext-exclude-filter-template")},t.addFileNameExclude=function(){this.addExcludeRuleRow("#wpstg-file-name-exclude-filter-template")},t.addDirNameExclude=function(){this.addExcludeRuleRow("#wpstg-dir-name-exclude-filter-template")},t.addExcludeRuleRow=function(e){var t=r(e);if(null!==t){var s=t.content.cloneNode(!0).querySelector("tr");this.excludeTableBody.appendChild(s),o(".wpstg-has-exclude-rules").forEach((function(e){e.style.display="inherit"}))}},t.clearExcludes=function(){this.excludeTableBody.innerHTML="",o(".wpstg-has-exclude-rules").forEach((function(e){e.style.display="none"}))},t.removeExclude=function(e){null!==e.parentElement&&null!==e.parentElement.parentElement&&this.excludeTableBody.removeChild(e.parentElement.parentElement),""===this.excludeTableBody.innerHTML.trim()&&o(".wpstg-has-exclude-rules").forEach((function(e){e.style.display="none"}))},t.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 l=a[i],c=l[0],g=l[1];""!==g.value&&s.push(n[c].value+" "+g.value+o[c].value)}this.excludeTableBody.querySelectorAll('input[name="wpstgFileExtExcludeRule[]"]').forEach((function(s){var n=e.cleanStringForGlob(s.value);""!==n&&t.push("ext:"+n.trim())}));for(var d=this.excludeTableBody.querySelectorAll('select[name="wpstgFileNameExcludeRulePos[]"]'),p=this.excludeTableBody.querySelectorAll('input[name="wpstgFileNameExcludeRulePath[]"]'),u=0,w=Object.entries(p);u<w.length;u++){var h=w[u],f=h[0],m=h[1],v=this.cleanStringForGlob(m.value);""!==v&&t.push("file:"+d[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],T=this.cleanStringForGlob(C.value);""!==T&&t.push("dir:"+b[E].value+" "+T.trim())}return{sizes:s.filter(this.onlyUnique).join(","),globs:t.filter(this.onlyUnique).join(",")}},t.onlyUnique=function(e,t,s){return s.indexOf(e)===t},t.cleanStringForGlob=function(e){return e.replace(/[*^//!\.[?]/g,"")},e}(),m=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 v(e,t,s,n){var r,o,i,a,l=!1,c=!1,g={},d=0,p=0,u={sensitivity:7,interval:100,timeout:0,handleFocus:!1};function w(e){r=e.clientX,o=e.clientY}function h(e,t){if(p&&(p=clearTimeout(p)),Math.abs(i-r)+Math.abs(a-o)<u.sensitivity)return d=1,c?void 0:s(e,t);i=r,a=o,p=setTimeout((function(){h(e,t)}),u.interval)}function f(e,t){return l=!0,p&&(p=clearTimeout(p)),e.removeEventListener("mousemove",w,!1),1!==d&&(i=t.clientX,a=t.clientY,e.addEventListener("mousemove",w,!1),p=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 l=!1,p&&(p=clearTimeout(p)),e.removeEventListener("mousemove",w,!1),1===d&&(p=setTimeout((function(){!function(e,t){p&&(p=clearTimeout(p)),d=0,c||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,l||(c=!0,s(n,r)))}function x(e){var s,r;e.target.matches(t+", "+t+" *")&&(s=e.target.closest(t),r=e,!l&&c&&(c=!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 b=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(){v(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,l){void 0===a&&(a=null),void 0===l&&(l=null),void 0===r&&(r="json"),!1!==o&&(o=!0);var c=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,d,p){if(console.log(e.status+" "+e.statusText+"---"+d),"function"!=typeof l||(l(e,d,p),t.continueErrorHandle))if(++i<=c)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>=c&&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>=c&&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>c&&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>=c&&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>=c&&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>=c&&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>=c&&t.showError("Refresh page or login again! The process should be finished successfully. \n ")}}})}};return t}(jQuery),y=function(){function e(e,t,s,n,o){void 0===t&&(t="#wpstg-workflow"),void 0===s&&(s="wpstg_clone_excludes_settings"),void 0===n&&(n="wpstg_modal_error"),void 0===o&&(o=wpstg),this.cloneID=e,this.workflow=r(t),this.wpstgObject=o,this.fetchExcludeSettingsAction=s,this.modalErrorAction=n,this.resetButtonClass="wpstg-confirm-reset-clone",this.resetModalContainerClass="wpstg-reset-confirmation",this.resetTabSelector=".wpstg-reset-exclude-tab",this.directoryNavigator=null,this.excludeFilters=null,this.tableSelector=null,this.isNetworkClone=!1}var t=e.prototype;return t.addEvents=function(){var e=this,t=r("."+this.resetModalContainerClass);null!==t?i(t,"click",this.resetTabSelector,(function(t){e.toggleContent(t)})):console.log("Exit")},t.init=function(){this.addEvents()},t.setNetworkClone=function(e){this.isNetworkClone=e},t.toggleContent=function(e){var t=r("."+this.resetModalContainerClass),s=e.getAttribute("data-id"),n=e.querySelector(".wpstg-tab-triangle"),o=e.getAttribute("data-collapsed","true"),i=r(s);"true"===o?(t.classList.contains("has-collapsible-open")?t.classList.add("has-collapsible-open-2"):t.classList.add("has-collapsible-open"),a(i),n.style.transform="rotate(90deg)",e.setAttribute("data-collapsed","false")):(t.classList.contains("has-collapsible-open-2")?t.classList.remove("has-collapsible-open-2"):t.classList.remove("has-collapsible-open"),l(i),n.style.removeProperty("transform"),e.setAttribute("data-collapsed","true"))},t.showModal=function(){var e=this.loadModal();return this.init(),this.fetchCloneExcludes(),e},t.loadModal=function(){return b.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})},t.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(t){if(t.success){var s=r(".wpstg-reset-confirmation");s.classList.remove("wpstg-swal2-loading"),s.querySelector(".wpstg--swal2-popup").style.width="500px",s.querySelector(".wpstg--swal2-content").innerHTML=t.html,e.directoryNavigator=new w,e.excludeFilters=new f,e.tableSelector=new h("#wpstg-reset-excluded-tables","."+e.resetModalContainerClass),e.tableSelector.setNetworkClone(e.isNetworkClone)}else{new m(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},t.swalOptions),{type:t.type})}})).catch((function(t){e.renderError({html:e.wpstgObject.i18n.somethingWentWrong+" "+t})}))},t.getDirectoryNavigator=function(){return this.directoryNavigator},t.getExcludeFilters=function(){return this.excludeFilters},t.getTableSelector=function(){return this.tableSelector},t.getAjaxLoader=function(){return'<div class="wpstg-swal2-ajax-loader"><img src="'+this.wpstgObject.wpstgIcon+'" /></div>'},e}(),x=function(){function e(e){void 0===e&&(e="#wpstg-clonepage-wrapper"),this.baseContainer=r(e),this.checkBoxSettingTogglerSelector=".wpstg-toggle-advance-settings-section",this.init()}var t=e.prototype;return t.addEvents=function(){var e=this;null!==this.baseContainer&&i(this.baseContainer,"change",this.checkBoxSettingTogglerSelector,(function(t){e.toggleSettings(t)}))},t.init=function(){this.addEvents()},t.toggleSettings=function(e){var t=r("#"+e.getAttribute("data-id"));e.checked?a(t):l(t)},e}(),k=function(){function e(){this.activeTabClass="wpstg--tab--active",this.mainMenu()}return e.prototype.mainMenu=function(){var e=this;null!==r(".wpstg--tab--header")&&i(r(".wpstg--tab--header"),"click",".wpstg-button",(function(t){var s=t,n=s.getAttribute("data-target"),r=o(n),i=o(".wpstg--tab--header a[data-target]");o(".wpstg--tab--contents > .wpstg--tab--content").forEach((function(t){t.matches("."+e.activeTabClass+":not("+n+")")&&t.classList.remove(e.activeTabClass)})),i.forEach((function(t){t!==s&&t.classList.remove(e.activeTabClass)})),s.classList.add(e.activeTabClass),r.forEach((function(t){t.classList.add(e.activeTabClass)})),"#wpstg--tab--backup"===n&&window.dispatchEvent(new Event("backups-tab"))}))},e}(),S=function(t){var s,n={isCancelled:!1,isFinished:!1,getLogs:!1,time:1,executionTime:!1,progressBar:0,cloneExcludeFilters:null,directoryNavigator:null,tableSelector:null,notyf:null,areAllTablesChecked:!0,handleDisplayDependencies:c,handleToggleElement:g,handleCopyPaste:d,handleCopyToClipboard:p},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 i=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",S.warnIfClosingDuringProcess)):void 0!==e.error&&e.error?(console.error(e.message),o(t+" Error: "+e.message+s),void window.removeEventListener("beforeunload",S.warnIfClosingDuringProcess)):void 0},a=function(){r.get("#wpstg-error-details").hide().html("")},l=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),O()})).on("click","#wpstg-resume-cloning",(function(){a();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(){a();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),R()})).on("click","#wpstg-restart-cloning",(function(){a();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),B()})).on("click",".wpstg-remove-clone[data-clone]",(function(s){a(),s.preventDefault();var n=r.get("#wpstg-existing-clones");e.removeClass("active"),r.get(".wpstg-loader").show(),E({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){a(),e.preventDefault(),r.get("#wpstg-removing-clone").addClass("loading"),r.get(".wpstg-loader").show(),I(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,E({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=D(t);if(!1!==s&&!1===s.success)return e.removeClass("loading"),void j(s);e.removeClass("loading").html(t),N(),n.directoryNavigator=new w("#wpstg-directories-listing","#wpstg-workflow",wpstg,n.notyf),n.tableSelector=new h("#wpstg-scanning-db","#wpstg-workflow","#wpstg_network_clone",wpstg,n.notyf),n.cloneExcludeFilters=new f,n.switchStep(2)}),"HTML")})).on("click",".wpstg-reset-clone",(function(e){e.preventDefault();var s=t(this).data("clone"),r=new y(s);r.setNetworkClone("yes"===t(this).data("network"));var o=r.showModal();n.areAllTablesChecked=!0,o.then((function(e){if(e.value){var t=r.getDirectoryNavigator(),n=r.getTableSelector(),o=r.getExcludeFilters().getExcludeFilters(),i="",a="",l="";null!==n&&(i=n.getIncludedTables(),a=n.getExcludedTables(),l=n.getSelectedTablesWithoutPrefix()),i.length>a.length?i="":a.length>i.length&&(a=""),A(s,{includedTables:i,excludedTables:a,selectedTablesWithoutPrefix:l,excludeSizeRules:encodeURIComponent(o.sizes),excludeGlobRules:encodeURIComponent(o.globs),excludedDirectories:t.getExcludedDirectories(),extraDirectories:t.getExtraDirectoriesRootOnly()})}}))}))},E=function e(s,n,r,i,a,l){void 0===l&&(l=null),void 0===r&&(r="json"),!1!==i&&(i=!0);var c=1e4*(a=void 0===a?0:a);l=parseInt(l),isNaN(l)||(c*=l),t.ajax({url:ajaxurl+"?action=wpstg_processing&_="+Date.now()/1e3,type:"POST",dataType:r,cache:!1,data:s,error:function(t,g,d){if(++a<=5)console.log("RETRYING "+a+"/5"),setTimeout((function(){e(s,n,r,i,a,l)}),c);else{console.log("RETRYING LIMIT");var p=void 0===t.status?"Unknown":t.status;o("Fatal Error: "+p+" 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 ")}}})},C=function(){var e=[];return t(".wpstg-db-table input:not(:checked)").each((function(){e.push(this.name)})),e},T=function(e,t){r.get(".wpstg-loader").show(),E({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 _(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 b.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&&_(e,t)}))}b.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)},_=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 f){var e=n.cloneExcludeFilters.getExcludeFilters();n.data.excludeGlobRules=encodeURIComponent(e.globs),n.data.excludeSizeRules=encodeURIComponent(e.sizes)}n.data.includedTables="",n.data.excludedTables="",null!==n.tableSelector&&(n.data.includedTables=n.tableSelector.getIncludedTables(),n.data.excludedTables=n.tableSelector.getExcludedTables(),n.data.selectedTablesWithoutPrefix=n.tableSelector.getSelectedTablesWithoutPrefix()),n.data.includedTables.length>n.data.excludedTables.length?n.data.includedTables="":n.data.excludedTables.length>n.data.includedTables.length&&(n.data.excludedTables=""),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")}}(),P(s)},P=function(e){E(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=D(t);if(!1!==s&&!1===s.success)return e.removeClass("loading"),void j(s);e.removeClass("loading").html(t),n.cloneExcludeFilters=null,"wpstg_scanning"===n.data.action?(n.areAllTablesChecked=!0,n.directoryNavigator=new w("#wpstg-directories-listing","#wpstg-workflow",wpstg,n.notyf),n.tableSelector=new h("#wpstg-scanning-db","#wpstg-workflow","#wpstg_network_clone",wpstg,n.notyf),n.switchStep(2),n.cloneExcludeFilters=new f):"wpstg_cloning"!==n.data.action&&"wpstg_update"!==n.data.action&&"wpstg_reset"!==n.data.action||n.switchStep(3),n.startCloning()}),"HTML")},j=function(e){new m("wpstg_modal_error",wpstg).show(Object.assign({title:"Error",icon:"error",html:wpstg.i18n.somethingWentWrong+(void 0!==e.message?"<br/>"+e.message:""),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})},D=function(e){if(!e)return!1;try{var t=JSON.parse(e);if(t&&"object"==typeof t)return t}catch(e){}return!1},A=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");P(o)},L=function(){var e=r.get("#wpstg-workflow");e.addClass("loading"),E({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()},I=function e(s){var n=t("#deleteDirectory:checked").data("deletepath");E({action:"wpstg_delete_clone",clone:s,accessToken:wpstg.accessToken,nonce:wpstg.nonce,excludedTables:C(),deleteDir:n},(function(n){if(n&&(i(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)}))},O=function e(){if(n.timer("stop"),!0===n.isFinished)return!0;E({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 L();!0===t?L():e()}))},R=function e(){if(!0===n.isFinished)return!0;E({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?L():e()}))},B=function(){if(!0===n.isFinished)return!0;E({action:"wpstg_restart",accessToken:wpstg.accessToken,nonce:wpstg.nonce},(function(e){e&&void 0!==e.delete&&"finished"===e.delete||!0===e?L():R()}))},q=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)},N=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());E({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(a(),N(),"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",S.warnIfClosingDuringProcess),e()}),wpstg.delayReq),n.timer("start");var e=function e(){if(!0===n.isCancelled)return window.removeEventListener("beforeunload",S.warnIfClosingDuringProcess),!1;var o;(o=!0)&&!1!==o?r.get(".wpstg-loader").show():r.get(".wpstg-loader").hide();var a="",l="";null!==n.directoryNavigator&&(a=n.directoryNavigator.getExcludedDirectories(),l=n.directoryNavigator.getExtraDirectoriesRootOnly()),r.get(".wpstg-log-details").show(),S.ajax({action:"wpstg_processing",accessToken:wpstg.accessToken,nonce:wpstg.nonce,excludedTables:C(),excludedDirectories:encodeURIComponent(a),extraDirectories:encodeURIComponent(l)},(function(o){i(o),void 0!==o.last_msg&&o.last_msg&&q(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",S.warnIfClosingDuringProcess),function(e){!0===n.getLogs&&q();s(e),void 0!==e.last_msg&&q(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(),b.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,i;L(),o=r.get("#wpstg-workflow"),i=ajaxurl.replace("/admin-ajax.php","")+"/images/spinner",2<window.devicePixelRatio&&(i+="-2x"),s="<img src=''"+(i+=".gif")+"' alt='' class='ajax-spinner general-spinner' />",o.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=b.slugify(this.value);e=setTimeout((function(){E({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(){a(),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=b.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()||l()?t("#wpstg_clone_hostname_error").remove():l()||t("#wpstg_clone_hostname_error").length||t("#wpstg-clone-directory tr:last-of-type").after('<tr><td>&nbsp;</td><td><p id="wpstg_clone_hostname_error" style="color: red;">&nbsp;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&&!l())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")?T(n,e):_(n,e)})).on("click",".wpstg-prev-step-link",(function(e){e.preventDefault(),r.get(".wpstg-loader").removeClass("wpstg-finished"),r.get(".wpstg-loader").hide(),L()}))}(),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")})),b.listenTooltip(),new k,new u,new x,n.notyf=new Notyf({duration:1e4,position:{x:"center",y:"bottom"},dismissible:!0,types:[{type:"warning",background:"orange",icon:!1}]})},n.ajax=E,n.showError=o,n.getLogs=q,n.loadOverview=L,n}(jQuery);jQuery(document).ready((function(){S.init(),window.WPStaging=S})),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(),l=e(".wpstg--tab--active .wpstg-report-syslog").is(":checked"),c=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:+l,wpstg_terms:+c,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="",b.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:b.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-polyfill.js","../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 * Polyfills the `Element.prototype.closest` function if not available in the browser.\n *\n * @return {Function} A function that will return the closest element, by selector, to this element.\n */\nfunction polyfillClosest() {\n if (Element.prototype.closest) {\n if (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n }\n\n Element.prototype.closest = function(s) {\n let el = this;\n\n do {\n if (Element.prototype.matches.call(el, s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n }\n\n return function(element, selector) {\n return element instanceof Element ? element.closest(selector) : null;\n };\n}\n\nexport const closest = polyfillClosest();\n","import {closest} from './wpstg-polyfill';\n\n/**\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 if (!parent instanceof Element) {\n return;\n }\n\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\n/**\n * Dispatches a change on an element that will trigger, depending on the element type,\n * cascading changes on elements dependant on the one that triggered the change and that\n * belong in the same container.\n *\n * @param {Element} element A reference to the Element the change was triggered from.\n *\n * @return {void} The function does not return any value and will have the side-effect of\n * hiding or showing dependant elements.\n */\nexport function handleDisplayDependencies(element) {\n if (!element instanceof Element || !element.id) {\n return;\n }\n\n const containerSelector = '.wpstg-container';\n // Use the default WordPress CSS class to hide and show the objects.\n const hiddenClass = 'hidden';\n const elementType = element.getAttribute('type');\n\n switch (elementType) {\n case 'checkbox':\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n const showIfChecked = container.querySelectorAll(`[data-show-if-checked=\"${element.id}\"]`);\n const showIfUnchecked = container.querySelectorAll(`[data-show-if-unchecked=\"${element.id}\"]`);\n const checked = element.checked;\n\n if (showIfChecked.length) {\n for (const el of showIfChecked) {\n if (checked) {\n el.classList.remove(hiddenClass);\n } else {\n el.classList.add(hiddenClass);\n }\n }\n }\n\n if (showIfUnchecked.length) {\n for (const el of showIfUnchecked) {\n if (checked) {\n el.classList.add(hiddenClass);\n } else {\n el.classList.remove(hiddenClass);\n }\n }\n }\n\n return;\n default:\n // Not a type we handle.\n return;\n }\n}\n\n/**\n * Initializes the display status of any element that depends on the status of another to\n * either hide or show.\n *\n * @return {void} The function will have the side-effect to toggle the hide/show class from\n * elements dependant on another to hide or show.\n */\nexport function initDependantDisplay() {\n const displayControllerSelector = '[onchange^=\"WPStaging.handleDisplayDependencies\"]';\n const displayControllers = document.querySelectorAll(displayControllerSelector);\n for (const displayController of displayControllers) {\n handleDisplayDependencies(displayController);\n }\n}\n\n/**\n * Toggle target element set in data-wpstg-target of the given element\n *\n * @param {Element} element A reference to the Element the change was triggered from.\n *\n * @return {void} The function does not return any value and will have the side-effect of\n * hiding or showing dependant elements.\n */\nexport function handleToggleElement(element) {\n if (!element instanceof Element || !element.getAttribute('data-wpstg-target')) {\n return;\n }\n\n const containerSelector = '.wpstg_admin';\n // Use the default WordPress CSS class to hide and show the objects.\n const hiddenClass = 'hidden';\n\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n const elements = container.querySelectorAll(element.getAttribute('data-wpstg-target'));\n\n if (elements.length) {\n for (const el of elements) {\n el.classList.toggle(hiddenClass);\n }\n }\n}\n\n/**\n * Copy text in data-wpstg-copy to element(s) in data-wpstg-target\n *\n * @param {Element} element\n *\n * @return {void}\n */\nexport function handleCopyPaste(element) {\n if (!element instanceof Element || !element.getAttribute('data-wpstg-target') || !element.getAttribute('data-wpstg-copy')) {\n return;\n }\n\n const containerSelector = '.wpstg_admin';\n\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n navigator.clipboard.writeText(element.getAttribute('data-wpstg-copy'));\n const elements = container.querySelectorAll(element.getAttribute('data-wpstg-target'));\n\n if (elements.length) {\n for (const el of elements) {\n el.value = element.getAttribute('data-wpstg-copy', '');\n }\n }\n}\n\n/**\n * Copy text in data-wpstg-source to clipboard\n *\n * @param {Element} element\n *\n * @return {void}\n */\nexport function handleCopyToClipboard(element) {\n if (!element instanceof Element || !element.getAttribute('data-wpstg-source')) {\n return;\n }\n\n const containerSelector = '.wpstg_admin';\n\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n const el = container.querySelector(element.getAttribute('data-wpstg-source'));\n\n if (el) {\n navigator.clipboard.writeText(el.value);\n }\n}\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, 'change', this.dirCheckboxSelector, (element, event) => {\n event.preventDefault();\n console.log(this.getExcludedDirectories());\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.isScanned(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 return;\n }\n\n if (this.existingExcludes.length === 0) {\n this.existingExcludes = [];\n return;\n }\n\n const existingExcludes = this.existingExcludes.split(',');\n this.existingExcludes = existingExcludes.map((exclude) => {\n if (exclude.substr(0, 1) === '/') {\n return exclude.slice(1);\n }\n\n return exclude;\n });\n }\n\n isScanned(exclude) {\n let scanned = false;\n this.directoryListingContainer.querySelectorAll('.wpstg-dir>input').forEach((element) => {\n if (element.value == exclude) {\n scanned = true;\n }\n });\n\n return scanned;\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 * @return {string}\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 {function} 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';\nimport {handleDisplayDependencies, handleToggleElement, handleCopyPaste, handleCopyToClipboard} from './modules/wpstg-dom-utils.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 handleDisplayDependencies: handleDisplayDependencies,\n handleToggleElement: handleToggleElement,\n handleCopyPaste: handleCopyPaste,\n handleCopyToClipboard: handleCopyToClipboard,\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>&nbsp;</td><td><p id=\"wpstg_clone_hostname_error\" style=\"color: red;\">&nbsp;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'] + (response.message !== undefined ? ('<br/>' + response.message) : ''),\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":["closest","Element","prototype","matches","msMatchesSelector","webkitMatchesSelector","s","el","this","call","parentElement","parentNode","nodeType","element","selector","qs","document","querySelector","all","querySelectorAll","addEvent","parent","evt","handler","addEventListener","event","target","slideDown","duration","style","display","overflow","height","offsetHeight","transitionProperty","transitionDuration","setTimeout","window","removeProperty","slideUp","handleDisplayDependencies","id","hiddenClass","getAttribute","container","showIfChecked","showIfUnchecked","checked","length","classList","remove","add","handleToggleElement","elements","toggle","handleCopyPaste","navigator","clipboard","writeText","value","handleCopyToClipboard","WpstgCloneStaging","pageWrapperId","wpstgObject","wpstg","pageWrapper","dom","enableButtonId","enableAction","notyf","Notyf","position","x","y","dismissible","types","type","background","icon","init","addEvents","_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","log","getExcludedDirectories","toggleDirExpand","unselectAll","selectDefault","parseExcludes","previousSibling","dirPath","isChecked","forceDefault","setAttribute","dirContainer","createElement","innerHTML","JSON","parse","directoryListing","appendChild","alert","forEach","_this3","isParentExcluded","push","exclude","isScanned","join","settings","directorySeparator","path","isParentAlreadyExcluded","dir","startsWith","getExtraDirectoriesRootOnly","extraDirectories","extraDirectoriesTextArea","extraCustomDirectories","split","concat","map","substr","slice","scanned","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","clearTimeout","Math","abs","undefined","dispatchOver","removeEventListener","onMouseOver","dispatchOut","delay","onMouseOut","onFocus","onBlur","removeFocus","opt","focusOptionChanged","$","WPStagingCommon","continueErrorHandle","cache","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","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","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":"6hCA2BO,IAAMA,GArBPC,QAAQC,UAAUF,UACfC,QAAQC,UAAUC,UACrBF,QAAQC,UAAUC,QAAUF,QAAQC,UAAUE,mBAAqBH,QAAQC,UAAUG,uBAGvFJ,QAAQC,UAAUF,QAAU,SAASM,OAC/BC,EAAKC,OAEN,IACGP,Q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AK,gBAAgBiD,YAAY,qBAG/C5R,EAAE/O,UAAU6Z,GAAG,QAAS,gBAAgB,SAASvP,GAC/CA,EAAE3D,qBAEIkb,EAAU9S,EAAEzE,EAAE5J,QAAQ1B,QAAQ,2BAEhC6iB,GACFA,EAAQrC,QAAQ,YAKpBxf,SAASQ,iBAAiB,SAAS,SAASC,OACpBA,EAAMC,OAAO1B,QAAQ,2BACvB,SACZ8iB,EAAW9hB,SAAS+hB,uBAAuB,uBACxC5K,EAAI,EAAGA,EAAI2K,EAAS9f,OAAQmV,IACnC2K,EAAS3K,GAAGlV,UAAUC,OAAO,SAE/B6M,EAAE,gBAAgBoE,YAAY,sBAKlC9R,OAAOb,iBAAiB,4BAA4B,SAASwhB,GAC3DjT,EAAEsE,KAAK,CACLjB,IAAK2B,QACLnQ,KAAM,OACN0P,SAAU,OACVnO,KAAM,QACM,8BACKnC,MAAM0B,kBACZ1B,MAAM2B,oBACEqd,EAAYC,OAAOxc,aAC1BuJ,EAAgBU"}
1
+ {"version":3,"file":"wpstg-admin.min.js","sources":["../src/modules/wpstg-polyfill.js","../src/modules/wpstg-dom-utils.js","../src/modules/wpstg-clone-staging.js","../src/modules/wpstg-directory-navigation.js","../src/modules/wpstg-table-selection.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 * Polyfills the `Element.prototype.closest` function if not available in the browser.\n *\n * @return {Function} A function that will return the closest element, by selector, to this element.\n */\nfunction polyfillClosest() {\n if (Element.prototype.closest) {\n if (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n }\n\n Element.prototype.closest = function(s) {\n let el = this;\n\n do {\n if (Element.prototype.matches.call(el, s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n }\n\n return function(element, selector) {\n return element instanceof Element ? element.closest(selector) : null;\n };\n}\n\nexport const closest = polyfillClosest();\n","import {closest} from './wpstg-polyfill';\n\n/**\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 if (!parent instanceof Element) {\n return;\n }\n\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\n/**\n * Dispatches a change on an element that will trigger, depending on the element type,\n * cascading changes on elements dependant on the one that triggered the change and that\n * belong in the same container.\n *\n * @param {Element} element A reference to the Element the change was triggered from.\n *\n * @return {void} The function does not return any value and will have the side-effect of\n * hiding or showing dependant elements.\n */\nexport function handleDisplayDependencies(element) {\n if (!element instanceof Element || !element.id) {\n return;\n }\n\n const containerSelector = '.wpstg-container';\n // Use the default WordPress CSS class to hide and show the objects.\n const hiddenClass = 'hidden';\n const elementType = element.getAttribute('type');\n\n switch (elementType) {\n case 'checkbox':\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n const showIfChecked = container.querySelectorAll(`[data-show-if-checked=\"${element.id}\"]`);\n const showIfUnchecked = container.querySelectorAll(`[data-show-if-unchecked=\"${element.id}\"]`);\n const checked = element.checked;\n\n if (showIfChecked.length) {\n for (const el of showIfChecked) {\n if (checked) {\n el.classList.remove(hiddenClass);\n } else {\n el.classList.add(hiddenClass);\n }\n }\n }\n\n if (showIfUnchecked.length) {\n for (const el of showIfUnchecked) {\n if (checked) {\n el.classList.add(hiddenClass);\n } else {\n el.classList.remove(hiddenClass);\n }\n }\n }\n\n return;\n default:\n // Not a type we handle.\n return;\n }\n}\n\n/**\n * Initializes the display status of any element that depends on the status of another to\n * either hide or show.\n *\n * @return {void} The function will have the side-effect to toggle the hide/show class from\n * elements dependant on another to hide or show.\n */\nexport function initDependantDisplay() {\n const displayControllerSelector = '[onchange^=\"WPStaging.handleDisplayDependencies\"]';\n const displayControllers = document.querySelectorAll(displayControllerSelector);\n for (const displayController of displayControllers) {\n handleDisplayDependencies(displayController);\n }\n}\n\n/**\n * Toggle target element set in data-wpstg-target of the given element\n *\n * @param {Element} element A reference to the Element the change was triggered from.\n *\n * @return {void} The function does not return any value and will have the side-effect of\n * hiding or showing dependant elements.\n */\nexport function handleToggleElement(element) {\n if (!element instanceof Element || !element.getAttribute('data-wpstg-target')) {\n return;\n }\n\n const containerSelector = '.wpstg_admin';\n // Use the default WordPress CSS class to hide and show the objects.\n const hiddenClass = 'hidden';\n\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n const elements = container.querySelectorAll(element.getAttribute('data-wpstg-target'));\n\n if (elements.length) {\n for (const el of elements) {\n el.classList.toggle(hiddenClass);\n }\n }\n}\n\n/**\n * Copy text in data-wpstg-copy to element(s) in data-wpstg-target\n *\n * @param {Element} element\n *\n * @return {void}\n */\nexport function handleCopyPaste(element) {\n if (!element instanceof Element || !element.getAttribute('data-wpstg-target') || !element.getAttribute('data-wpstg-copy')) {\n return;\n }\n\n const containerSelector = '.wpstg_admin';\n\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n navigator.clipboard.writeText(element.getAttribute('data-wpstg-copy'));\n const elements = container.querySelectorAll(element.getAttribute('data-wpstg-target'));\n\n if (elements.length) {\n for (const el of elements) {\n el.value = element.getAttribute('data-wpstg-copy', '');\n }\n }\n}\n\n/**\n * Copy text in data-wpstg-source to clipboard\n *\n * @param {Element} element\n *\n * @return {void}\n */\nexport function handleCopyToClipboard(element) {\n if (!element instanceof Element || !element.getAttribute('data-wpstg-source')) {\n return;\n }\n\n const containerSelector = '.wpstg_admin';\n\n // Go as high as the container that contains this element.\n const container = closest(element, containerSelector);\n\n if (container === null) {\n return;\n }\n\n const el = container.querySelector(element.getAttribute('data-wpstg-source'));\n\n if (el) {\n navigator.clipboard.writeText(el.value);\n }\n}\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 workflowSelector = '#wpstg-workflow',\n wpstgObject = wpstg,\n notyf = null,\n ) {\n this.directoryListingContainer = dom.qs(directoryListingSelector);\n this.workflow = dom.qs(workflowSelector);\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, 'change', this.dirCheckboxSelector, (element, event) => {\n event.preventDefault();\n console.log(this.getExcludedDirectories());\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 dom.addEvent(this.directoryListingContainer, 'click', '.wpstg-expand-dirs', (target, event) => {\n event.preventDefault();\n this.toggleDirectoryNavigation(target);\n });\n\n dom.addEvent(this.directoryListingContainer, 'change', 'input.wpstg-check-dir', (target) => {\n this.updateDirectorySelection(target);\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.isScanned(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 return;\n }\n\n if (this.existingExcludes.length === 0) {\n this.existingExcludes = [];\n return;\n }\n\n const existingExcludes = this.existingExcludes.split(',');\n this.existingExcludes = existingExcludes.map((exclude) => {\n if (exclude.substr(0, 1) === '/') {\n return exclude.slice(1);\n }\n\n return exclude;\n });\n }\n\n isScanned(exclude) {\n let scanned = false;\n this.directoryListingContainer.querySelectorAll('.wpstg-dir>input').forEach((element) => {\n if (element.value == exclude) {\n scanned = true;\n }\n });\n\n return scanned;\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","import * as dom from './wpstg-dom-utils.js';\n\n/**\n * Database tables selection\n */\nexport default class WpstgTableSelection {\n constructor(\n databaseTableSectionSelector = '#wpstg-scanning-db',\n workflowSelector = '#wpstg-workflow',\n networkCloneSelector = '#wpstg_network_clone',\n wpstgObject = wpstg,\n ) {\n this.databaseTableSection = dom.qs(databaseTableSectionSelector);\n this.workflow = dom.qs(workflowSelector);\n this.networkCloneSelector = networkCloneSelector;\n this.networkCloneCheckbox = dom.qs(networkCloneSelector);\n this.wpstgObject = wpstgObject;\n this.isAllTablesChecked = true;\n this.isMultisite = this.wpstgObject.isMultisite === '1';\n this.isNetworkClone = false;\n\n this.init();\n }\n\n setNetworkClone(isNetworkClone) {\n this.isNetworkClone = isNetworkClone;\n }\n\n addEvents() {\n if (this.workflow === null) {\n console.log('Error: database table section is null. Cannot register events');\n return;\n }\n\n dom.addEvent(this.workflow, 'change', this.networkCloneSelector, () => {\n this.selectDefaultTables();\n });\n\n dom.addEvent(this.workflow, 'click', '.wpstg-button-select', (target, event) => {\n event.preventDefault();\n this.selectDefaultTables();\n });\n\n dom.addEvent(this.workflow, 'click', '.wpstg-button-unselect', (target, event) => {\n event.preventDefault();\n this.toggleTableSelection();\n });\n }\n\n init() {\n this.addEvents();\n }\n\n getRegexPattern() {\n let pattern = '^' + this.wpstgObject.tblprefix;\n let isNetwork = false;\n if (this.networkCloneCheckbox !== undefined && this.networkCloneCheckbox !== null) {\n isNetwork = this.networkCloneCheckbox.checked;\n }\n\n // Force network clone true if set explicitly\n if (this.isNetworkClone) {\n isNetwork = true;\n }\n\n if (this.isMultisite && !isNetwork) {\n pattern += '([^0-9])_*';\n }\n\n return pattern;\n }\n\n selectDefaultTables() {\n const options = this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table');\n const regexPattern = this.getRegexPattern();\n options.forEach((option) => {\n const name = option.getAttribute('name', '');\n if (name.match(regexPattern)) {\n option.selected = true;\n } else {\n option.selected = false;\n }\n });\n }\n\n toggleTableSelection() {\n if (false === this.isAllTablesChecked) {\n this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach((option) => {\n option.selected = true;\n });\n this.databaseTableSection.querySelector('.wpstg-button-unselect').innerHTML = 'Unselect All';\n // cache.get('.wpstg-db-table-checkboxes').prop('checked', true);\n this.isAllTablesChecked = true;\n } else {\n this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning .wpstg-db-table').forEach((option) => {\n option.selected = false;\n });\n this.databaseTableSection.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 getSelectedTablesWithoutPrefix() {\n const selectedTablesWithoutPrefix = [];\n const options = this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning option:checked');\n const regexPattern = this.getRegexPattern();\n options.forEach((option) => {\n const name = option.getAttribute('name', '');\n if (!name.match(regexPattern)) {\n selectedTablesWithoutPrefix.push(option.value);\n }\n });\n\n return selectedTablesWithoutPrefix.join(this.wpstgObject.settings.directorySeparator);\n }\n\n getIncludedTables() {\n const includedTables = [];\n const options = this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning option:checked');\n const regexPattern = this.getRegexPattern();\n options.forEach((option) => {\n const name = option.getAttribute('name', '');\n if (name.match(regexPattern)) {\n includedTables.push(option.value);\n }\n });\n\n return includedTables.join(this.wpstgObject.settings.directorySeparator);\n }\n\n getExcludedTables() {\n const excludedTables = [];\n const options = this.databaseTableSection.querySelectorAll('#wpstg_select_tables_cloning option:not(:checked)');\n const regexPattern = this.getRegexPattern();\n options.forEach((option) => {\n const name = option.getAttribute('name', '');\n if (name.match(regexPattern)) {\n excludedTables.push(option.value);\n }\n });\n\n return excludedTables.join(this.wpstgObject.settings.directorySeparator);\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 * @return {string}\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 {function} 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 WpstgTableSelection from './wpstg-table-selection';\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.tableSelector = null;\n this.isNetworkClone = false;\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\n init() {\n this.addEvents();\n }\n\n setNetworkClone(isNetworkClone) {\n this.isNetworkClone = isNetworkClone;\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 this.tableSelector = new WpstgTableSelection('#wpstg-reset-excluded-tables', '.' + this.resetModalContainerClass);\n this.tableSelector.setNetworkClone(this.isNetworkClone);\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 getTableSelector() {\n return this.tableSelector;\n }\n\n getAjaxLoader() {\n return '<div class=\"wpstg-swal2-ajax-loader\"><img src=\"' + this.wpstgObject.wpstgIcon + '\" /></div>';\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 WpstgTableSelection from './modules/wpstg-table-selection.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';\nimport {handleDisplayDependencies, handleToggleElement, handleCopyPaste, handleCopyToClipboard} from './modules/wpstg-dom-utils.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 tableSelector: null,\n notyf: null,\n areAllTablesChecked: true,\n handleDisplayDependencies: handleDisplayDependencies,\n handleToggleElement: handleToggleElement,\n handleCopyPaste: handleCopyPaste,\n handleCopyToClipboard: handleCopyToClipboard,\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 /**\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 /**\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\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 */\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>&nbsp;</td><td><p id=\"wpstg_clone_hostname_error\" style=\"color: red;\">&nbsp;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-workflow', wpstg, that.notyf);\n that.tableSelector = new WpstgTableSelection('#wpstg-scanning-db', '#wpstg-workflow', '#wpstg_network_clone', 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 resetModal.setNetworkClone($(this).data('network') === 'yes');\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 tableSelector = resetModal.getTableSelector();\n const exclFilters = resetModal.getExcludeFilters().getExcludeFilters();\n\n let includedTables = '';\n let excludedTables = '';\n let selectedTablesWithoutPrefix = '';\n\n if (tableSelector !== null) {\n includedTables = tableSelector.getIncludedTables();\n excludedTables = tableSelector.getExcludedTables();\n selectedTablesWithoutPrefix = tableSelector.getSelectedTablesWithoutPrefix();\n }\n\n if (includedTables.length > excludedTables.length) {\n includedTables = '';\n } else if (excludedTables.length > includedTables.length) {\n excludedTables = '';\n }\n\n resetClone(clone, {\n includedTables: includedTables,\n excludedTables: excludedTables,\n selectedTablesWithoutPrefix: selectedTablesWithoutPrefix,\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 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 = '';\n that.data.excludedTables = '';\n if (that.tableSelector !== null) {\n that.data.includedTables = that.tableSelector.getIncludedTables();\n that.data.excludedTables = that.tableSelector.getExcludedTables();\n that.data.selectedTablesWithoutPrefix = that.tableSelector.getSelectedTablesWithoutPrefix();\n }\n\n if (that.data.includedTables.length > that.data.excludedTables.length) {\n that.data.includedTables = '';\n } else if (that.data.excludedTables.length > that.data.includedTables.length) {\n that.data.excludedTables = '';\n }\n\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-workflow', wpstg, that.notyf);\n that.tableSelector = new WpstgTableSelection('#wpstg-scanning-db', '#wpstg-workflow', '#wpstg_network_clone', 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'] + (response.message !== undefined ? ('<br/>' + response.message) : ''),\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":["closest","Element","prototype","matches","msMatchesSelector","webkitMatchesSelector","s","el","this","call","parentElement","parentNode","nodeType","element","selector","qs","document","querySelector","all","querySelectorAll","addEvent","parent","evt","handler","addEventListener","event","target","slideDown","duration","style","display","overflow","height","offsetHeight","transitionProperty","transitionDuration","setTimeout","window","removeProperty","slideUp","handleDisplayDependencies","id","hiddenClass","getAttribute","container","showIfChecked","showIfUnchecked","checked","length","classList","remove","add","handleToggleElement","elements","toggle","handleCopyPaste","navigator","clipboard","writeText","value","handleCopyToClipboard","WpstgCloneStaging","pageWrapperId","wpstgObject","wpstg","pageWrapper","dom","enableButtonId","enableAction","notyf","Notyf","position","x","y","dismissible","types","type","background","icon","init","addEvents","_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","workflowSelector","directoryListingContainer","workflow","dirCheckboxSelector","dirExpandSelector","unselectAllDirsSelector","selectDefaultDirsSelector","fetchChildrenAction","currentCheckboxElement","currentParentDiv","currentLoader","existingExcludes","excludedDirectories","isDefaultSelected","preventDefault","log","getExcludedDirectories","toggleDirExpand","unselectAll","selectDefault","toggleDirectoryNavigation","updateDirectorySelection","parseExcludes","previousSibling","dirPath","isChecked","forceDefault","setAttribute","dirContainer","createElement","innerHTML","JSON","parse","directoryListing","appendChild","alert","forEach","_this3","isParentExcluded","push","exclude","isScanned","join","settings","directorySeparator","path","isParentAlreadyExcluded","dir","startsWith","getExtraDirectoriesRootOnly","extraDirectories","extraDirectoriesTextArea","extraCustomDirectories","split","concat","map","substr","slice","scanned","cbElement","subDirectories","sibling","nextElementSibling","result","parElem","i","children","WpstgTableSelection","databaseTableSectionSelector","networkCloneSelector","databaseTableSection","networkCloneCheckbox","isAllTablesChecked","isMultisite","isNetworkClone","setNetworkClone","selectDefaultTables","toggleTableSelection","getRegexPattern","pattern","tblprefix","isNetwork","undefined","options","regexPattern","option","match","selected","getSelectedTablesWithoutPrefix","selectedTablesWithoutPrefix","getIncludedTables","includedTables","getExcludedTables","excludedTables","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","triggerConfirmAction","assign","onOver","onOut","pX","pY","mouseOver","focused","h","state","timer","sensitivity","interval","timeout","handleFocus","tracker","clientX","clientY","compare","clearTimeout","Math","abs","dispatchOver","removeEventListener","onMouseOver","dispatchOut","delay","onMouseOut","onFocus","onBlur","removeFocus","opt","focusOptionChanged","$","WPStagingCommon","continueErrorHandle","cache","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","fetchExcludeSettingsAction","modalErrorAction","resetButtonClass","resetModalContainerClass","resetTabSelector","directoryNavigator","excludeFilters","tableSelector","resetModalContainer","toggleContent","contentId","tabTriangle","isCollapsed","contains","transform","showModal","swalPromise","loadModal","fetchCloneExcludes","getAjaxLoader","width","focusConfirm","confirmButtonText","resetClone","clone","job","modal","renderError","getDirectoryNavigator","getTableSelector","wpstgIcon","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","excludeSizeRules","encodeURIComponent","sizes","excludeGlobRules","globs","each","name","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","processing","delayReq","last_msg","job_done","$link1","$link","attr","msg","cloneResetComplete","cloneUpdateComplete","finish","percentage","toFixed","step","urlSpinner","devicePixelRatio","removeAttr","cloneDirectoryName","directoryName","slug","substring","$targetDir","$targetUri","uri","after","focus","onlyUpdateMessage","stepButtons","$section","toggleClass","slideToggle","hasClass","ready","sendIssueReport","button","forceSend","spinner","next","email","hosting_provider","syslog","terms","async","done","errors","isConfirmed","prepend","successMessage","toggler","trigger","dropDown","getElementsByClassName","customEvent","detail"],"mappings":"6hCA2BO,IAAMA,GArBPC,QAAQC,UAAUF,UACfC,QAAQC,UAAUC,UACrBF,QAAQC,UAAUC,QAAUF,QAAQC,UAAUE,mBAAqBH,QAAQC,UAAUG,uBAGvFJ,QAAQC,UAAUF,QAAU,SAASM,OAC/BC,EAAKC,OAEN,IACGP,QAAQC,UAAUC,QAAQM,KAAKF,EAAID,GAAI,OAAOC,EAClDA,EAAKA,EAAGG,eAAiBH,EAAGI,iBACd,OAAPJ,GAA+B,IAAhBA,EAAGK,iBACpB,OAIJ,SAASC,EAASC,UAChBD,aAAmBZ,QAAUY,EAAQb,QAAQc,GAAY,OCb7D,SAASC,EAAGD,UACVE,SAASC,cAAcH,GAOzB,SAASI,EAAIJ,UACXE,SAASG,iBAAiBL,GAM5B,SAASM,EAASC,EAAQC,EAAKR,EAAUS,IACzCF,aAAkBpB,SAIvBoB,EAAOG,iBAAiBF,GAAK,SAASG,GAChCA,EAAMC,OAAOvB,QAAQW,EAAW,KAAOA,EAAW,OACpDS,EAAQE,EAAMC,OAAO1B,QAAQc,GAAWW,MAEzC,GAGE,SAASE,EAAUd,EAASe,YAAAA,IAAAA,EAAW,KAC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Compatible up to WordPress Version
2
 
3
  // WP STAGING version number
4
  if (!defined('WPSTG_VERSION')) {
5
+ define('WPSTG_VERSION', '2.9.14');
6
  }
7
 
8
  // Compatible up to WordPress Version
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.9.13';
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.14';
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, backup plugin, database backup, wordpress backup plugin, migrate, backup wordpress, backups
10
  Requires at least: 3.6+
11
  Tested up to: 6.0
12
- Stable tag: 2.9.13
13
  Requires PHP: 5.6
14
 
15
  Backup & Duplicator Plugin - Clone, backup, move, duplicate & migrate websites to staging, backup, and development sites for authorized users only.
@@ -259,6 +259,16 @@ please open a [support request](https://wp-staging.com/support/ "Support Request
259
 
260
  == Changelog ==
261
 
 
 
 
 
 
 
 
 
 
 
262
  = 2.9.13 =
263
  * New: Support up to WordPress 6.0
264
  * Fix: Don't load mbstring polyfill file at all if iconv extension isn't loaded #1734
@@ -554,6 +564,16 @@ WP STAGING Backup & Cloning | Full changelog:
554
 
555
  == Upgrade Notice ==
556
 
 
 
 
 
 
 
 
 
 
 
557
  = 2.9.13 =
558
  * Fix: Don't load mbstring polyfill file at all if iconv extension isn't loaded #1734
559
  * Enh: Increasing Backup Filescanner Performance. Lower backup directory and file scanner request time #1714
9
  Tags: backup, backup plugin, database backup, wordpress backup plugin, migrate, backup wordpress, backups
10
  Requires at least: 3.6+
11
  Tested up to: 6.0
12
+ Stable tag: 2.9.14
13
  Requires PHP: 5.6
14
 
15
  Backup & Duplicator Plugin - Clone, backup, move, duplicate & migrate websites to staging, backup, and development sites for authorized users only.
259
 
260
  == Changelog ==
261
 
262
+ = 2.9.14 =
263
+ * Fix: Certain default plugins like wps-hide are not excluded anymore during cloning #1742
264
+ * Fix: Scheduled backup not always executed #1754
265
+ * Fix: Backup folder is deleted during backup restore on Windows OS #1737
266
+ * Fix: On backup restore retry deleting an item again in next request instead of re adding it at the end of queue, if item isn't completely deleted in current request #1758
267
+ * Enh: Refactor normalizePath() #1751
268
+ * Enh: Optimize table selection to reduce POST characters. Send either selected tables or excluded tables whichever is smaller along to reduce the POST size for cloning and pushing #1727
269
+ * Enh: Allow automatic update of WP STAGING | PRO on the staging site. It can still be disabled using the filter wpstg.notices.disable.plugin-update-notice #1749
270
+ * Enh: Add filter wpstg.backup.restore.extended-search-replace. The extended search replace allow properly replacing to destination URL for some plugins like rev-sliders in backup restore #1741
271
+
272
  = 2.9.13 =
273
  * New: Support up to WordPress 6.0
274
  * Fix: Don't load mbstring polyfill file at all if iconv extension isn't loaded #1734
564
 
565
  == Upgrade Notice ==
566
 
567
+ = 2.9.14 =
568
+ * Fix: Certain default plugins like wps-hide are not excluded anymore during cloning #1742
569
+ * Fix: Scheduled backup not always executed #1754
570
+ * Fix: Backup folder is deleted during backup restore on Windows OS #1737
571
+ * Fix: On backup restore retry deleting an item again in next request instead of re adding it at the end of queue, if item isn't completely deleted in current request #1758
572
+ * Enh: Refactor normalizePath() #1751
573
+ * Enh: Optimize table selection to reduce POST characters. Send either selected tables or excluded tables whichever is smaller along to reduce the POST size for cloning and pushing #1727
574
+ * Enh: Allow automatic update of WP STAGING | PRO on the staging site. It can still be disabled using the filter wpstg.notices.disable.plugin-update-notice #1749
575
+ * Enh: Add filter wpstg.backup.restore.extended-search-replace. The extended search replace allow properly replacing to destination URL for some plugins like rev-sliders in backup restore #1741
576
+
577
  = 2.9.13 =
578
  * Fix: Don't load mbstring polyfill file at all if iconv extension isn't loaded #1734
579
  * Enh: Increasing Backup Filescanner Performance. Lower backup directory and file scanner request time #1714
vendor_wpstg/autoload/src.php CHANGED
@@ -870,6 +870,7 @@ return array(
870
  'WPStaging\\Framework\\Database\\ExcludedTables' => $baseDir . '/Framework/Database/ExcludedTables.php',
871
  'WPStaging\\Framework\\Database\\QueryBuilder\\SelectQuery' => $baseDir . '/Framework/Database/QueryBuilder/SelectQuery.php',
872
  'WPStaging\\Framework\\Database\\SearchReplace' => $baseDir . '/Framework/Database/SearchReplace.php',
 
873
  'WPStaging\\Framework\\Database\\TableDto' => $baseDir . '/Framework/Database/TableDto.php',
874
  'WPStaging\\Framework\\Database\\TableService' => $baseDir . '/Framework/Database/TableService.php',
875
  'WPStaging\\Framework\\Database\\WpDbInfo' => $baseDir . '/Framework/Database/WpDbInfo.php',
870
  'WPStaging\\Framework\\Database\\ExcludedTables' => $baseDir . '/Framework/Database/ExcludedTables.php',
871
  'WPStaging\\Framework\\Database\\QueryBuilder\\SelectQuery' => $baseDir . '/Framework/Database/QueryBuilder/SelectQuery.php',
872
  'WPStaging\\Framework\\Database\\SearchReplace' => $baseDir . '/Framework/Database/SearchReplace.php',
873
+ 'WPStaging\\Framework\\Database\\SelectedTables' => $baseDir . '/Framework/Database/SelectedTables.php',
874
  'WPStaging\\Framework\\Database\\TableDto' => $baseDir . '/Framework/Database/TableDto.php',
875
  'WPStaging\\Framework\\Database\\TableService' => $baseDir . '/Framework/Database/TableService.php',
876
  'WPStaging\\Framework\\Database\\WpDbInfo' => $baseDir . '/Framework/Database/WpDbInfo.php',
wp-staging.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Backup Duplicator & Migration - WP STAGING
5
  * Plugin URI: https://wordpress.org/plugins/wp-staging
6
  * Description: Backup & Duplicator Plugin - Clone, backup, move, duplicate & migrate websites to staging, backup, and development sites for authorized users only.
7
- * Version: 2.9.13
8
  * Requires at least: 3.6+
9
  * Requires PHP: 5.6
10
  * Author: WP-STAGING, WPStagingBackup
4
  * Plugin Name: Backup Duplicator & Migration - WP STAGING
5
  * Plugin URI: https://wordpress.org/plugins/wp-staging
6
  * Description: Backup & Duplicator Plugin - Clone, backup, move, duplicate & migrate websites to staging, backup, and development sites for authorized users only.
7
+ * Version: 2.9.14
8
  * Requires at least: 3.6+
9
  * Requires PHP: 5.6
10
  * Author: WP-STAGING, WPStagingBackup