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

Version Description

  • New: Support up to WordPress 6.0.1
  • Fix: Important update! Deselecting all tables does not lead to exclusion of tables as expected, but leads to selection of all tables. Thus all tables are copied and possibly overwritten instead of deselected. Applies to new cloning, UPDATE and RESET of a staging page. That can lead to data loss in the staging site. An update is strongly recommended!. #1814
  • Fix: Can not upload backup file to google drive if the google api returns incorrect value for available storage size (negative value). This sometimes happens for Google workspace accounts and does not affect all users. #1799
  • Fix: Plugin wps-hide-login could not be excluded during cloning process, preventing users from log in to the staging site #1812
Download this release

Release Info

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

Code changes from version 2.9.16 to 2.9.17

Backend/Modules/Jobs/Cloning.php CHANGED
@@ -133,6 +133,7 @@ class Cloning extends Job
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
133
 
134
  // Included Tables / Prefixed Table - Excluded Tables
135
  $selectedTables = new SelectedTables($_POST['includedTables'], $_POST['excludedTables'], $_POST['selectedTablesWithoutPrefix']);
136
+ $selectedTables->setAllTablesExcluded(empty($_POST['allTablesExcluded']) ? false : $_POST['allTablesExcluded'] === 'true');
137
  $this->options->tables = $selectedTables->getSelectedTables($this->options->networkClone);
138
 
139
  // Exclude File Size Rules
Backend/Modules/Jobs/Directories.php CHANGED
@@ -134,8 +134,10 @@ class Directories extends JobExecutable
134
  * Scan plugins, mu-plugins, themes or uploads dir depending upon the input
135
  *
136
  * @param string $directory
 
 
137
  */
138
- private function getWpContentSubDirectory($directory)
139
  {
140
  // Skip if scanning uploads directory and symlink option selected
141
  if ($this->wpDirectories->getUploadsPath() === $directory && $this->options->uploadsSymlinked) {
@@ -167,7 +169,7 @@ class Directories extends JobExecutable
167
  ];
168
 
169
  // Exclude predefined plugins if given directory is plugins dir
170
- if ($this->filesystem->normalizePath(WP_PLUGIN_DIR) === $directory) {
171
  $excludePaths[] = '**/wp-staging*/**/node_modules'; // only exclude node modules in WP Staging's plugins
172
  // add excluded plugins defined by WP Staging
173
  $excludePaths = array_merge((new ExcludedPlugins())->getPluginsToExcludeWithRelativePath(), $excludePaths);
@@ -176,7 +178,7 @@ class Directories extends JobExecutable
176
  $excludePaths = array_merge($this->getFilteredExcludedPaths(), $excludePaths);
177
 
178
  try {
179
- $this->options->totalFiles += $this->scanToCacheFile($files, $directory, true, $excludePaths, $this->getFilteredExcludedFileSizes());
180
  } catch (Exception $e) {
181
  $this->returnException('Error: ' . $e->getMessage());
182
  }
@@ -517,7 +519,7 @@ class Directories extends JobExecutable
517
  * Return List of all user defined file size excludes from hooks and through UI
518
  * @return array
519
  */
520
- private function getFilteredExcludedFileSizes()
521
  {
522
  return apply_filters('wpstg_clone_file_size_exclude', $this->options->excludeSizeRules);
523
  }
@@ -528,7 +530,7 @@ class Directories extends JobExecutable
528
  * Defined by WP Staging i.e. cache or some plugins.
529
  * @return array
530
  */
531
- private function getFilteredExcludedPaths()
532
  {
533
  $excludePaths = [];
534
  $abspath = $this->strUtils->sanitizeDirectorySeparator(ABSPATH);
134
  * Scan plugins, mu-plugins, themes or uploads dir depending upon the input
135
  *
136
  * @param string $directory
137
+ * @param string $pluginDir - default const WP_PLUGIN_DIR - testing purpose only
138
+ * @param string $wpRoot - default const ABSPATH - testing purpose only
139
  */
140
+ protected function getWpContentSubDirectory($directory, $pluginDir = WP_PLUGIN_DIR, $wpRoot = ABSPATH)
141
  {
142
  // Skip if scanning uploads directory and symlink option selected
143
  if ($this->wpDirectories->getUploadsPath() === $directory && $this->options->uploadsSymlinked) {
169
  ];
170
 
171
  // Exclude predefined plugins if given directory is plugins dir
172
+ if ($this->filesystem->normalizePath($pluginDir, true) === $directory) {
173
  $excludePaths[] = '**/wp-staging*/**/node_modules'; // only exclude node modules in WP Staging's plugins
174
  // add excluded plugins defined by WP Staging
175
  $excludePaths = array_merge((new ExcludedPlugins())->getPluginsToExcludeWithRelativePath(), $excludePaths);
178
  $excludePaths = array_merge($this->getFilteredExcludedPaths(), $excludePaths);
179
 
180
  try {
181
+ $this->options->totalFiles += $this->scanToCacheFile($files, $directory, true, $excludePaths, $this->getFilteredExcludedFileSizes(), $wpRoot);
182
  } catch (Exception $e) {
183
  $this->returnException('Error: ' . $e->getMessage());
184
  }
519
  * Return List of all user defined file size excludes from hooks and through UI
520
  * @return array
521
  */
522
+ protected function getFilteredExcludedFileSizes()
523
  {
524
  return apply_filters('wpstg_clone_file_size_exclude', $this->options->excludeSizeRules);
525
  }
530
  * Defined by WP Staging i.e. cache or some plugins.
531
  * @return array
532
  */
533
+ protected function getFilteredExcludedPaths()
534
  {
535
  $excludePaths = [];
536
  $abspath = $this->strUtils->sanitizeDirectorySeparator(ABSPATH);
Backend/Modules/Jobs/Updating.php CHANGED
@@ -4,10 +4,8 @@ namespace WPStaging\Backend\Modules\Jobs;
4
 
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;
12
  use WPStaging\Framework\Utils\WpDefaultDirectories;
13
 
@@ -240,6 +238,7 @@ class Updating extends Job
240
  {
241
  // Included Tables / Prefixed Table - Excluded Tables
242
  $selectedTables = new SelectedTables($_POST['includedTables'], $_POST['excludedTables'], $_POST['selectedTablesWithoutPrefix']);
 
243
  $this->options->tables = $selectedTables->getSelectedTables($this->options->networkClone);
244
  }
245
 
4
 
5
  use WPStaging\Core\WPStaging;
6
  use WPStaging\Core\Utils\Helper;
 
7
  use WPStaging\Framework\Database\SelectedTables;
8
  use WPStaging\Framework\Filesystem\Scanning\ScanConst;
 
9
  use WPStaging\Framework\Utils\SlashMode;
10
  use WPStaging\Framework\Utils\WpDefaultDirectories;
11
 
238
  {
239
  // Included Tables / Prefixed Table - Excluded Tables
240
  $selectedTables = new SelectedTables($_POST['includedTables'], $_POST['excludedTables'], $_POST['selectedTablesWithoutPrefix']);
241
+ $selectedTables->setAllTablesExcluded(empty($_POST['allTablesExcluded']) ? false : $_POST['allTablesExcluded'] === 'true');
242
  $this->options->tables = $selectedTables->getSelectedTables($this->options->networkClone);
243
  }
244
 
Backend/views/backup/free-version.php CHANGED
@@ -10,7 +10,23 @@
10
  <ul>
11
  <li class="wpstg-clone wpstg-dark-alert">
12
  <p><strong><?php esc_html_e('Backup & Migration is a PRO feature!', 'wp-staging'); ?></strong></p>
13
- <p><?php _e('<a href="https://wp-staging.com/?utm_source=wp-admin&utm_medium=wp-admin&utm_campaign=backup-restore&utm_term=backup-restore" target="_blank" id="wpstg-button-backup-upgrade" class="wpstg-button--primary wpstg-button--cta-red wpstg-border--violet">Get Started</a>', 'wp-staging'); ?></p>
14
  </li>
15
  </ul>
16
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  <ul>
11
  <li class="wpstg-clone wpstg-dark-alert">
12
  <p><strong><?php esc_html_e('Backup & Migration is a PRO feature!', 'wp-staging'); ?></strong></p>
13
+ <p><?php _e('<a href="https://wp-staging.com/?utm_source=wp-admin&utm_medium=wp-admin&utm_campaign=backup-restore&utm_term=backup-restore" target="_blank" id="wpstg-button-backup-upgrade" class="wpstg-button--primary wpstg-button--cta-red wpstg-border--violet">Unlock</a>', 'wp-staging'); ?></p>
14
  </li>
15
  </ul>
16
  </div>
17
+
18
+ <div id="wpstg-did-you-know" style="margin-bottom:12px">
19
+ <strong><?php echo sprintf(__('Did you know? You can upload backup files to another website to transfer it. <a href="%s" target="_blank">Read more</a>', 'wp-staging'), 'https://wp-staging.com/docs/how-to-migrate-your-wordpress-site-to-a-new-host/'); ?></strong>
20
+ </div>
21
+
22
+ <div id="wpstg-step-1">
23
+ <button id="wpstg-new-backup" class="wpstg-next-step-link wpstg-blue-primary wpstg-button" disabled>
24
+ <?php esc_html_e('Create New Backup', 'wp-staging') ?>
25
+ </button>
26
+ <button id="wpstg-upload-backup" class="wpstg-next-step-link wpstg-blue-primary wpstg-button wpstg-ml-4" disabled>
27
+ <?php esc_html_e('Upload Backup', 'wp-staging') ?>
28
+ </button>
29
+ <button id="wpstg-manage-backup-schedules" class="wpstg-next-step-link wpstg-blue-primary wpstg-button wpstg-ml-4" disabled>
30
+ <?php esc_html_e('Edit Backup Plans', 'wp-staging') ?>
31
+ </button>
32
+ </div>
assets/js/dist/wpstg-admin.js CHANGED
@@ -2477,6 +2477,7 @@
2477
  var includedTables = '';
2478
  var excludedTables = '';
2479
  var selectedTablesWithoutPrefix = '';
 
2480
 
2481
  if (tableSelector !== null) {
2482
  includedTables = tableSelector.getIncludedTables();
@@ -2488,11 +2489,13 @@
2488
  includedTables = '';
2489
  } else if (excludedTables.length > includedTables.length) {
2490
  excludedTables = '';
 
2491
  }
2492
 
2493
  resetClone(clone, {
2494
  includedTables: includedTables,
2495
  excludedTables: excludedTables,
 
2496
  selectedTablesWithoutPrefix: selectedTablesWithoutPrefix,
2497
  excludeSizeRules: encodeURIComponent(exclFilters.sizes),
2498
  excludeGlobRules: encodeURIComponent(exclFilters.globs),
@@ -2781,6 +2784,7 @@
2781
 
2782
  that.data.includedTables = '';
2783
  that.data.excludedTables = '';
 
2784
 
2785
  if (that.tableSelector !== null) {
2786
  that.data.includedTables = that.tableSelector.getIncludedTables();
@@ -2792,6 +2796,7 @@
2792
  that.data.includedTables = '';
2793
  } else if (that.data.excludedTables.length > that.data.includedTables.length) {
2794
  that.data.excludedTables = '';
 
2795
  }
2796
 
2797
  that.data.databaseServer = $('#wpstg_db_server').val();
2477
  var includedTables = '';
2478
  var excludedTables = '';
2479
  var selectedTablesWithoutPrefix = '';
2480
+ var allTablesExcluded = false;
2481
 
2482
  if (tableSelector !== null) {
2483
  includedTables = tableSelector.getIncludedTables();
2489
  includedTables = '';
2490
  } else if (excludedTables.length > includedTables.length) {
2491
  excludedTables = '';
2492
+ allTablesExcluded = includedTables === '';
2493
  }
2494
 
2495
  resetClone(clone, {
2496
  includedTables: includedTables,
2497
  excludedTables: excludedTables,
2498
+ allTablesExcluded: allTablesExcluded,
2499
  selectedTablesWithoutPrefix: selectedTablesWithoutPrefix,
2500
  excludeSizeRules: encodeURIComponent(exclFilters.sizes),
2501
  excludeGlobRules: encodeURIComponent(exclFilters.globs),
2784
 
2785
  that.data.includedTables = '';
2786
  that.data.excludedTables = '';
2787
+ that.data.allTablesExcluded = false;
2788
 
2789
  if (that.tableSelector !== null) {
2790
  that.data.includedTables = that.tableSelector.getIncludedTables();
2796
  that.data.includedTables = '';
2797
  } else if (that.data.excludedTables.length > that.data.includedTables.length) {
2798
  that.data.excludedTables = '';
2799
+ that.data.allTablesExcluded = that.data.includedTables === '';
2800
  }
2801
 
2802
  that.data.databaseServer = $('#wpstg_db_server').val();
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-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 let fileName = '';\n if ('name_exact_matches' === fileNamesPos[key].value) {\n fileName = this.cleanStringForGlobExactMatches(fileInput.value);\n } else {\n fileName = this.cleanStringForGlob(fileInput.value);\n }\n\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 * Remove most of the comment glob characters from the string except . to allow input of extensions\n * @param {String} value\n * @return {String}\n */\n cleanStringForGlobExactMatches(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 */\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","cleanStringForGlobExactMatches","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,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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 let fileName = '';\n if ('name_exact_matches' === fileNamesPos[key].value) {\n fileName = this.cleanStringForGlobExactMatches(fileInput.value);\n } else {\n fileName = this.cleanStringForGlob(fileInput.value);\n }\n\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 * Remove most of the comment glob characters from the string except . to allow input of extensions\n * @param {String} value\n * @return {String}\n */\n cleanStringForGlobExactMatches(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 */\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 let allTablesExcluded = false;\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 allTablesExcluded = includedTables === '';\n }\n\n resetClone(clone, {\n includedTables: includedTables,\n excludedTables: excludedTables,\n allTablesExcluded: allTablesExcluded,\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 that.data.allTablesExcluded = false;\n\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 that.data.allTablesExcluded = that.data.includedTables === '';\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","cleanStringForGlobExactMatches","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","allTablesExcluded","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;;EAED,SAAO,UAASC,OAAT,EAAkBC,QAAlB,EAA4B;EACjC,WAAOD,OAA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,CAACC,MAAN,CAAavB,OAAb,CAAqB,yBAArB,CAAtB;;EACA,QAAI,CAACkkB,aAAL,EAAoB;EAClB,UAAMC,QAAQ,GAAGtjB,QAAQ,CAACujB,sBAAT,CAAgC,qBAAhC,CAAjB;;EACA,WAAK,IAAItZ,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGqZ,QAAQ,CAAC9gB,MAA7B,EAAqCyH,CAAC,EAAtC,EAA0C;EACxCqZ,QAAAA,QAAQ,CAACrZ,CAAD,CAAR,CAAYxH,SAAZ,CAAsBC,MAAtB,CAA6B,OAA7B;EACD;;EACDiP,MAAAA,CAAC,CAAC,cAAD,CAAD,CAAkBoE,WAAlB,CAA8B,gBAA9B;EACD;EACF,GATD,EA9HiC;;EA0IjC1U,EAAAA,MAAM,CAACb,gBAAP,CAAwB,0BAAxB,EAAoD,UAASgjB,WAAT,EAAsB;EACxE7R,IAAAA,CAAC,CAACsE,IAAF,CAAO;EACLjB,MAAAA,GAAG,EAAE2B,OADA;EAELvS,MAAAA,IAAI,EAAE,MAFD;EAGL8R,MAAAA,QAAQ,EAAE,MAHL;EAILxQ,MAAAA,IAAI,EAAE;EACJ,kBAAU,iBADN;EAEJ,uBAAelC,KAAK,CAACyB,WAFjB;EAGJ,iBAASzB,KAAK,CAAC0B,KAHX;EAIJ,yBAAiBse,WAAW,CAACC,MAAZ,CAAmB1d,KAJhC;EAKJ,kBAAU6L,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 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="";""!==(v="name_exact_matches"===d[f].value?this.cleanStringForGlobExactMatches(m.value):this.cleanStringForGlob(m.value))&&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,"")},t.cleanStringForGlobExactMatches=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),F(),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)},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());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(),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",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("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("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
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="";""!==(v="name_exact_matches"===d[f].value?this.cleanStringForGlobExactMatches(m.value):this.cleanStringForGlob(m.value))&&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,"")},t.cleanStringForGlobExactMatches=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),F(),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="",c=!1;null!==n&&(i=n.getIncludedTables(),a=n.getExcludedTables(),l=n.getSelectedTablesWithoutPrefix()),i.length>a.length?i="":a.length>i.length&&(a="",c=""===i),A(s,{includedTables:i,excludedTables:a,allTablesExcluded:c,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="",n.data.allTablesExcluded=!1,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.allTablesExcluded=""===n.data.includedTables),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)},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());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(),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",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("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("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-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 let fileName = '';\n if ('name_exact_matches' === fileNamesPos[key].value) {\n fileName = this.cleanStringForGlobExactMatches(fileInput.value);\n } else {\n fileName = this.cleanStringForGlob(fileInput.value);\n }\n\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 * Remove most of the comment glob characters from the string except . to allow input of extensions\n * @param {String} value\n * @return {String}\n */\n cleanStringForGlobExactMatches(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 */\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","cleanStringForGlobExactMatches","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,KAC5Cf,EAAQgB,MAAMC,QAAU,Q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,OACpBA,EAAMC,OAAO1B,QAAQ,2BACvB,SACZwjB,EAAWxiB,SAASyiB,uBAAuB,uBACxCzY,EAAI,EAAGA,EAAIwY,EAASxgB,OAAQgI,IACnCwY,EAASxY,GAAG/H,UAAUC,OAAO,SAE/BkP,EAAE,gBAAgBoE,YAAY,sBAKlCnU,OAAOb,iBAAiB,4BAA4B,SAASkiB,GAC3DtR,EAAEsE,KAAK,CACLjB,IAAK2B,QACLxS,KAAM,OACN+R,SAAU,OACVxQ,KAAM,QACM,8BACKnC,MAAM0B,kBACZ1B,MAAM2B,oBACE+d,EAAYC,OAAOld,aAC1B4L,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 let fileName = '';\n if ('name_exact_matches' === fileNamesPos[key].value) {\n fileName = this.cleanStringForGlobExactMatches(fileInput.value);\n } else {\n fileName = this.cleanStringForGlob(fileInput.value);\n }\n\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 * Remove most of the comment glob characters from the string except . to allow input of extensions\n * @param {String} value\n * @return {String}\n */\n cleanStringForGlobExactMatches(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 */\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 let allTablesExcluded = false;\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 allTablesExcluded = includedTables === '';\n }\n\n resetClone(clone, {\n includedTables: includedTables,\n excludedTables: excludedTables,\n allTablesExcluded: allTablesExcluded,\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 that.data.allTablesExcluded = false;\n\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 that.data.allTablesExcluded = that.data.includedTables === '';\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","cleanStringForGlobExactMatches","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","allTablesExcluded","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,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AS,2CAA2C,SAASjO,GAC1EA,EAAEhG,iBACFuK,EAAEvE,EAAEnM,QAAQkhB,KAAK,wBAAwBR,YAAY,SAErDhQ,EAAEvE,EAAEnM,QAAQ+d,KAAK,gBAAgB2C,YAAY,qBAG/ChQ,EAAEpR,UAAU8a,GAAG,QAAS,gBAAgB,SAASjO,GAC/CA,EAAEhG,qBAEI0b,EAAUnR,EAAEvE,EAAEnM,QAAQ1B,QAAQ,2BAEhCujB,GACFA,EAAQC,QAAQ,YAKpBxiB,SAASQ,iBAAiB,SAAS,SAASC,OACpBA,EAAMC,OAAO1B,QAAQ,2BACvB,SACZyjB,EAAWziB,SAAS0iB,uBAAuB,uBACxC1Y,EAAI,EAAGA,EAAIyY,EAASzgB,OAAQgI,IACnCyY,EAASzY,GAAG/H,UAAUC,OAAO,SAE/BkP,EAAE,gBAAgBoE,YAAY,sBAKlCnU,OAAOb,iBAAiB,4BAA4B,SAASmiB,GAC3DvR,EAAEsE,KAAK,CACLjB,IAAK2B,QACLxS,KAAM,OACN+R,SAAU,OACVxQ,KAAM,QACM,8BACKnC,MAAM0B,kBACZ1B,MAAM2B,oBACEge,EAAYC,OAAOnd,aAC1B4L,EAAgBU"}
constantsFree.php CHANGED
@@ -2,10 +2,10 @@
2
 
3
  // WP STAGING version number
4
  if (!defined('WPSTG_VERSION')) {
5
- define('WPSTG_VERSION', '2.9.16');
6
  }
7
 
8
  // Compatible up to WordPress Version
9
  if (!defined('WPSTG_COMPATIBLE')) {
10
- define('WPSTG_COMPATIBLE', '6.0.0');
11
  }
2
 
3
  // WP STAGING version number
4
  if (!defined('WPSTG_VERSION')) {
5
+ define('WPSTG_VERSION', '2.9.17');
6
  }
7
 
8
  // Compatible up to WordPress Version
9
  if (!defined('WPSTG_COMPATIBLE')) {
10
+ define('WPSTG_COMPATIBLE', '6.0.1');
11
  }
opcacheBootstrap.php CHANGED
@@ -45,7 +45,7 @@ if (!$canInvalidate) {
45
  *
46
  * We use the "Version" from the headers of the main file of the plugin to compare.
47
  */
48
- $runtimeVersionDifferentFromBuildVersion = get_file_data($pluginFilePath, ['Version' => 'Version'])['Version'] !== '2.9.16';
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.17';
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, migrate, backup wordpress, backups
10
  Requires at least: 3.6+
11
  Tested up to: 6.0
12
- Stable tag: 2.9.16
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.
@@ -69,7 +69,7 @@ The backup & cloning features below are Premium. You need WP STAGING | PRO to us
69
  * Backup of WordPress multisites
70
  * Backup to Google Drive
71
  * Backup to Amazon S3
72
- * Backup to (s)FTP (Released soon)
73
  * Backup to Dropbox (Released soon)
74
  * Specify custom backup folder destination for backup cloud storage providers
75
  * Priority Support for backup & cloning or if something does not work as expected for you.
@@ -259,6 +259,12 @@ please open a [support request](https://wp-staging.com/support/ "Support Request
259
 
260
  == Changelog ==
261
 
 
 
 
 
 
 
262
  = 2.9.16 =
263
  * Fix: On some servers, autoloader tries to load Composer\InstalledVersions although this doesn't exist. We fix this by only loading classes that exist #1801
264
  * Enh: Some shared hosting servers like DreamHost doesn't allow sending large data through URL which resulted in interval server error 500 when fetching the backup list. We changed the way of sending data now through request body which allow listing backups on such shared hosting servers #1788
@@ -527,67 +533,13 @@ please open a [support request](https://wp-staging.com/support/ "Support Request
527
  * Fix: Skip scanning the root directory if all other directories are are unselected #1256
528
  * Dev: fix the version of Selenium containers to 3.141.59-20210713 to avoid issues with broken latest version #1234
529
 
530
- = 2.8.6 =
531
- * New: Support WordPress 5.8
532
- * New: Show notice if uploads dir is outside WP Root #1138
533
- * Enh: Refactor our wp_login action hook to work with custom calls to this action with different parameter count than the one in WordPress Core #1223
534
- * Enh: Also show disabled permalink message in disabled items notice on the staging site and show a page builder (DIVI, Elementor etc) not working help link in wpstg page footer #1150
535
- * Enh: Decouple clone name and clone ID for better usage #1158
536
- * Enh: Show issue notice if backups is created on version >= 4.0.2 #1198
537
- * Enh: Remove deprecated hooks call #1209
538
- * Fix: Fix staging site when site has freemius script #1112
539
- * Fix: Prefix 'wpstg' to sweetalerts Swal to avoid conflict with its other versions #1125
540
- * Fix: Set default values for wpstg settings on plugin activate event if wpstg settings not already set #1135
541
- * Fix: Fix the problem when unable to access the staging site because production site have different siteurl or home url and either one of them is having www. prefix #1136
542
- * Fix: Restore a backup with VIEWs or TABLEs if there are special MySQL SQL statements such as DEFINER #1139
543
- * Fix: Fix issue where graphical tab triangle was inconsistent by using css based tab triangle #1148
544
- * Fix: Reduce time to query INFORMATION_SCHEMA table on some shared hosts from ~10s to one millisecond #1154
545
- * Fix: Check available free disk space on large disks on 32-bit PHP #1179
546
- * Fix: Fix a bug where a PHP memory_limit of -1 (Unlimited) would be interpreted as 64MB, now it's interpreted as 512MB #1178
547
- * Fix: Remove usages of `abstract static` methods that would violate `strict` PHP checks #1185
548
- * Fix: Cloning a site resets the settings to the default ones #1183
549
- * Fix: Fix Clone RESET and Clone DELETE when unable to delete file due to permission error #1196
550
- * Fix: Fix an issue when canceling a push confirm redirects to empty page #1206
551
- * Fix: Add missing back button and hide cancel button after clone UPDATE and clone RESET #1207
552
- * Fix: Fix Error in JS console related to registering of main-menu in page where it was not available #1205
553
- * Dev: Add wrapper methods for deprecated hooks functions to support WordPress < 4.6 #1209
554
-
555
- = 2.8.5 =
556
- * Enh: Preview of the new backup & migration feature in WP STAGING | PRO
557
- * Enh: Replace CSS based hover with pure js hoverintent for tooltips #1106
558
- * Enh: Cleanup logs older than 7 days automatically #1116
559
- * Enh: Update the version to check in Outdated WP Staging Hooks notice #1118
560
- * Enh: Schedule the uploads backup to be deleted after one week if that option was selected during push #980
561
- * Enh: Allow copying of only that symlink whose source is a directory #979
562
- * Enh: Show notice only to user who can manage_options if wp_options table is missing primary key #1009
563
- * Enh: Delete Optimizer Plugin on WP Staging plugins deactivate instead of uninstall #1096
564
- * Fix: Fixed conflict with Rank Math Seo PRO when Rank Math Seo PRO is activated network wide in multisites #1111
565
- * Fix: Make Scan::hasFreeDiskSpace() return other info even if disk_free_space is unavailable #1093
566
- * Fix: Replace the deprecated of calling a non-static method in daily version check hooks #1092
567
- * Fix: Try catch all instance of directory iterators #1101
568
- * Fix: Handle error properly for Filesystem::delete() method #974
569
- * Fix: Remove loading wpstg scripts as ESM to allow loading them as asynchronous #1007
570
- * Fix: Properly handle exception while cleaning themes and plugins bak and tmp directories #1017
571
- * Fix: Delete the clone even if in any case a corrupted delete job cache file existed for delete job #1033
572
- * Fix: No cloning/pushing logs were written to file. Now fixed. #1040
573
- * Fix: Wrap wp_doing_ajax in a adapter and use that adapter to call it to make it usable in WP < 4.7 #1047
574
- * Fix: Fix typo and wrap up text in i18n for src/Backend/views/clone/ajax/start.php #1051
575
- * Fix: Fix missing clone options warning during scanning process for old clones for UPDATE and RESET #1058
576
- * Fix: Make isExcludedDirectories condition works for relative directories path too #1054
577
- * Fix: Set donation link to redirect to WP Staging pricing page #1080
578
- * Dev: Add a shortcut to allow to use the DI container as a Service Locator easier under some circumstances #1039
579
- * Dev: Add trait to allow for easier use of the `uopz` extension in tests #1053
580
- * Dev: Replace const related tests logic with UOPZ for better readability and control #1079
581
-
582
  WP STAGING Backup & Cloning | Full changelog:
583
  [https://wp-staging.com/wp-staging-changelog](https://wp-staging.com/wp-staging-changelog)
584
 
585
  == Upgrade Notice ==
586
 
587
- = 2.9.16 =
588
- * Fix: On some servers, autoloader tries to load Composer\InstalledVersions although this doesn't exist. We fix this by only loading classes that exist #1801
589
- * Enh: Some shared hosting servers like DreamHost doesn't allow sending large data through URL which resulted in interval server error 500 when fetching the backup list. We changed the way of sending data now through request body which allow listing backups on such shared hosting servers #1788
590
- * Enh: Improve workflow to support tables with long name exceeding the 64 characters MySQL limit when a tmp prefix during restore is added. Those tables are now temporarily renamed to temporary short names during the restore process and after successful restore renamed back to their original names #1784
591
- * Fix: Restoring a backup, site language is not properly imported, resulting in switching the imported site back to site default language. Reason: Language files are imported before importing other files during backup restore. This led to cleaning the restored language files while cleaning other files. Now language directory is skipped during the cleaning of existing "other" files #1794
592
- * Fix: Check/Uncheck of the plugins and themes checkbox in the PUSH UI didn't affect the children checkboxes. This issue is fixed and children checkboxes are properly toggled #1797
593
- * Fix: If all tables were excluded during PUSH, it was treated as if all tables were selected. Now tables selection is properly handled during the PUSH #1797
9
  Tags: backup, backup plugin, database backup, wordpress backup, migrate, backup wordpress, backups
10
  Requires at least: 3.6+
11
  Tested up to: 6.0
12
+ Stable tag: 2.9.17
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.
69
  * Backup of WordPress multisites
70
  * Backup to Google Drive
71
  * Backup to Amazon S3
72
+ * Backup to (s)FTP
73
  * Backup to Dropbox (Released soon)
74
  * Specify custom backup folder destination for backup cloud storage providers
75
  * Priority Support for backup & cloning or if something does not work as expected for you.
259
 
260
  == Changelog ==
261
 
262
+ = 2.9.17 =
263
+ * New: Support up to WordPress 6.0.1
264
+ * Fix: Important update! Deselecting all tables does not lead to exclusion of tables as expected, but leads to selection of all tables. Thus all tables are copied and possibly overwritten instead of deselected. Applies to new cloning, UPDATE and RESET of a staging page. That can lead to data loss in the staging site. An update is strongly recommended!. #1814
265
+ * Fix: Can not upload backup file to google drive if the google api returns incorrect value for available storage size (negative value). This sometimes happens for Google workspace accounts and does not affect all users. #1799
266
+ * Fix: Plugin wps-hide-login could not be excluded during cloning process, preventing users from log in to the staging site #1812
267
+
268
  = 2.9.16 =
269
  * Fix: On some servers, autoloader tries to load Composer\InstalledVersions although this doesn't exist. We fix this by only loading classes that exist #1801
270
  * Enh: Some shared hosting servers like DreamHost doesn't allow sending large data through URL which resulted in interval server error 500 when fetching the backup list. We changed the way of sending data now through request body which allow listing backups on such shared hosting servers #1788
533
  * Fix: Skip scanning the root directory if all other directories are are unselected #1256
534
  * Dev: fix the version of Selenium containers to 3.141.59-20210713 to avoid issues with broken latest version #1234
535
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
536
  WP STAGING Backup & Cloning | Full changelog:
537
  [https://wp-staging.com/wp-staging-changelog](https://wp-staging.com/wp-staging-changelog)
538
 
539
  == Upgrade Notice ==
540
 
541
+ = 2.9.17 =
542
+ * New: Support up to WordPress 6.0.1
543
+ * Fix: Important update! Deselecting all tables does not lead to exclusion of tables as expected, but leads to selection of all tables. Thus all tables are copied and possibly overwritten instead of deselected. Applies to new cloning, UPDATE and RESET of a staging page. That can lead to data loss in the staging site. An update is strongly recommended!. #1814
544
+ * Fix: Can not upload backup file to google drive if the google api returns incorrect value for available storage size (negative value). This sometimes happens for Google workspace accounts and does not affect all users. #1799
545
+ * Fix: Plugin wps-hide-login could not be excluded during cloning process, preventing users from log in to the staging site #1812
 
 
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.16
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.17
8
  * Requires at least: 3.6+
9
  * Requires PHP: 5.6
10
  * Author: WP-STAGING, WPStagingBackup