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

Version Description

  • New: Compatible up to WordPres 6.0.2
  • Security: Further improve sanitization and escaping of variables to prevent potential XSS attacks with high privileges #1836
  • Enh: Show better response from remote when license can not be activated #1818
  • Fix: Fatal error Uncaught TypeError on google drive backup upload settings page under rare circumstances when site is translated #1849
  • Fix: Fatal error on Windows OS when pushing a staging site and activating the backup option. It deletes the WP Staging content directory including its cache files file during files copying process, resulting in a failed push #1851
Download this release

Release Info

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

Code changes from version 2.9.18 to 2.9.19

Files changed (103) hide show
  1. Backend/Administrator.php +78 -52
  2. Backend/Feedback/Feedback.php +1 -1
  3. Backend/Modules/Jobs/Cloning.php +29 -24
  4. Backend/Modules/Jobs/Delete.php +9 -3
  5. Backend/Modules/Jobs/Files.php +2 -0
  6. Backend/Modules/Jobs/Logs.php +3 -1
  7. Backend/Modules/Jobs/ProcessLock.php +2 -2
  8. Backend/Modules/Jobs/Scan.php +13 -3
  9. Backend/Modules/Jobs/Updating.php +14 -11
  10. Backend/Modules/SystemInfo.php +2 -1
  11. Backend/Notices/Notices.php +9 -2
  12. Backend/Optimizer/wp-staging-optimizer.php +3 -3
  13. Backend/views/_main/footer.php +15 -15
  14. Backend/views/_main/header.php +4 -4
  15. Backend/views/_main/report-issue.php +5 -5
  16. Backend/views/backup/free-version.php +1 -1
  17. Backend/views/backup/listing-backups-no-results.php +12 -3
  18. Backend/views/backup/listing-single-backup.php +6 -5
  19. Backend/views/backup/listing.php +12 -8
  20. Backend/views/backup/modal/confirm-restore.php +10 -10
  21. Backend/views/backup/modal/export.php +15 -11
  22. Backend/views/backup/modal/partials/backup-contains.php +6 -6
  23. Backend/views/backup/modal/partials/import-introduction.php +5 -1
  24. Backend/views/backup/modal/progress.php +1 -1
  25. Backend/views/backup/modal/upload.php +15 -14
  26. Backend/views/backup/multisite-disabled.php +1 -1
  27. Backend/views/backup/restore-wait.php +3 -3
  28. Backend/views/clone/ajax/custom-directory.php +19 -15
  29. Backend/views/clone/ajax/delete-confirmation.php +20 -21
  30. Backend/views/clone/ajax/exclude-settings.php +6 -6
  31. Backend/views/clone/ajax/external-database.php +15 -15
  32. Backend/views/clone/ajax/mail-setting.php +6 -6
  33. Backend/views/clone/ajax/process-lock.php +2 -2
  34. Backend/views/clone/ajax/scan.php +22 -21
  35. Backend/views/clone/ajax/single-overview.php +46 -28
  36. Backend/views/clone/ajax/start.php +29 -19
  37. Backend/views/clone/ajax/update.php +5 -5
  38. Backend/views/clone/index.php +7 -7
  39. Backend/views/clone/multi-site/index.php +10 -2
  40. Backend/views/clone/single-site/index.php +5 -5
  41. Backend/views/clone/staging-site/index.php +12 -4
  42. Backend/views/feedback/deactivate-feedback.php +13 -13
  43. Backend/views/notices/_partial/notice_dismiss_action.php +6 -6
  44. Backend/views/notices/beta.php +5 -5
  45. Backend/views/notices/cache-directory-permission-problem.php +2 -2
  46. Backend/views/notices/directory-listing-could-not-be-prevented.php +2 -2
  47. Backend/views/notices/disabled-items-notice.php +6 -6
  48. Backend/views/notices/logs-directory-permission-problem.php +2 -2
  49. Backend/views/notices/outdated-wp-staging-hooks.php +1 -1
  50. Backend/views/notices/outdated-wp-staging-version.php +11 -2
  51. Backend/views/notices/poll.php +11 -11
  52. Backend/views/notices/rating.php +10 -11
  53. Backend/views/notices/settings_option_corrupt.php +10 -5
  54. Backend/views/notices/staging-directory-permission-problem.php +16 -7
  55. Backend/views/notices/uploads-outside-wp-root.php +1 -1
  56. Backend/views/notices/vars-directory-permission-problem.php +2 -2
  57. Backend/views/notices/warnings-notice.php +2 -2
  58. Backend/views/notices/wordfence-userini-renamed.php +3 -3
  59. Backend/views/notices/wp-options-missing-pk.php +3 -3
  60. Backend/views/notices/wp-version-compatible-message.php +16 -7
  61. Backend/views/notices/wrong-scheme.php +12 -4
  62. Backend/views/selections/database-tables.php +7 -7
  63. Backend/views/selections/files.php +28 -22
  64. Backend/views/settings/main-settings.php +8 -4
  65. Backend/views/settings/tabs/general.php +78 -67
  66. Backend/views/settings/tabs/mail-settings.php +5 -5
  67. Backend/views/settings/tabs/remote-storages.php +3 -3
  68. Backend/views/settings/tabs/storages/amazons3-settings.php +31 -21
  69. Backend/views/settings/tabs/storages/googledrive-settings.php +33 -26
  70. Backend/views/settings/tabs/storages/sftp-settings.php +32 -32
  71. Backend/views/templates/exclude-filters/dir-name-exclude-filter.php +6 -6
  72. Backend/views/templates/exclude-filters/file-ext-exclude-filter.php +2 -2
  73. Backend/views/templates/exclude-filters/file-name-exclude-filter.php +6 -6
  74. Backend/views/templates/exclude-filters/file-size-exclude-filter.php +5 -5
  75. Backend/views/tools/index.php +10 -3
  76. Backend/views/tools/tabs/import_export.php +8 -8
  77. Backend/views/tools/tabs/system_info.php +1 -1
  78. Backend/views/welcome/welcome.php +22 -13
  79. Core/Forms/Elements.php +1 -1
  80. Core/Forms/Form.php +12 -0
  81. Core/Utils/Browser.php +3 -1
  82. Core/Utils/functions.php +3 -3
  83. Framework/AnalyticsServiceProvider.php +9 -6
  84. Framework/Facades/Escape.php +16 -0
  85. Framework/Facades/Facade.php +7 -7
  86. Framework/Facades/Sanitize.php +13 -4
  87. Framework/Queue/FileSeekableQueue.php +13 -7
  88. Framework/Rest/Rest.php +11 -1
  89. Framework/Security/AccessToken.php +1 -1
  90. Framework/Security/Nonce.php +1 -1
  91. Framework/Utils/Escape.php +56 -0
  92. Framework/Utils/Sanitize.php +226 -3
  93. Framework/Utils/Strings.php +0 -16
  94. Frontend/Frontend.php +5 -1
  95. Frontend/LoginAfterImport.php +4 -2
  96. Frontend/LoginForm.php +18 -7
  97. Frontend/views/loginForm.php +4 -4
  98. constantsFree.php +2 -2
  99. opcacheBootstrap.php +4 -2
  100. readme.txt +14 -3
  101. runtimeRequirements.php +2 -2
  102. vendor_wpstg/autoload/src.php +2 -0
  103. wp-staging.php +1 -1
Backend/Administrator.php CHANGED
@@ -39,7 +39,8 @@ use WPStaging\Backend\Pro\Modules\Jobs\Processing;
39
  use WPStaging\Backend\Pro\Modules\Jobs\Backups\BackupUploadsDir;
40
  use WPStaging\Backend\Pluginmeta\Pluginmeta;
41
  use WPStaging\Framework\Database\SelectedTables;
42
- use WPStaging\Framework\Facades\Sanitize;
 
43
 
44
  /**
45
  * Class Administrator
@@ -80,6 +81,9 @@ class Administrator
80
  */
81
  private $siteInfo;
82
 
 
 
 
83
  public function __construct()
84
  {
85
  // TODO: Inject using DI
@@ -90,11 +94,15 @@ class Administrator
90
  // Todo: Inject using DI
91
  $this->siteInfo = new SiteInfo();
92
 
 
 
93
  $this->defineHooks();
94
 
95
  // Path to backend
96
  $this->path = plugin_dir_path(__FILE__);
97
 
 
 
98
  // Load plugins meta data
99
  $this->loadMeta();
100
  }
@@ -391,7 +399,7 @@ class Administrator
391
  nocache_headers();
392
  header("Content-Type: text/plain");
393
  header('Content-Disposition: attachment; filename="wpstg-system-info.txt"');
394
- echo wp_strip_all_tags(new SystemInfo());
395
  }
396
 
397
  /**
@@ -411,17 +419,22 @@ class Administrator
411
  return;
412
  }
413
 
414
- $fileExtension = explode('.', $_FILES["import_file"]["name"]);
 
 
 
 
 
415
  $fileExtension = end($fileExtension);
416
  if ($fileExtension !== "json") {
417
  wp_die("Please upload a valid .json file", "wp-staging");
418
  }
419
 
420
 
421
- $importFile = $_FILES["import_file"]["tmp_name"];
422
 
423
  if (empty($importFile)) {
424
- wp_die(__("Please upload a file to import", "wp-staging"));
425
  }
426
 
427
  update_option("wpstg_settings", json_decode(file_get_contents($importFile, true)));
@@ -560,7 +573,7 @@ class Administrator
560
  $response = (new ProcessLock())->ajaxIsRunning();
561
  if ($response !== false)
562
  {
563
- echo $response;
564
 
565
  exit();
566
  }
@@ -592,9 +605,9 @@ class Administrator
592
  return;
593
  }
594
 
595
- $isChecked = isset($_POST['isChecked']) ? $_POST['isChecked'] === 'true' : false;
596
- $forceDefault = isset($_POST['forceDefault']) ? $_POST['forceDefault'] === 'true' : false;
597
- $path = isset($_POST['dirPath']) ? $_POST['dirPath'] : "";
598
  $path = ABSPATH . $path;
599
  $scan = new Scan($path);
600
  $scan->setGifLoaderPath($this->assets->getAssetsUrl('img/spinner.gif'));
@@ -613,8 +626,9 @@ class Administrator
613
  return;
614
  }
615
 
 
616
  $sitesHelper = new Sites();
617
- $cloneDirectoryName = $sitesHelper->sanitizeDirectoryName($_POST["directoryName"]);
618
 
619
  if (strlen($cloneDirectoryName) < 1) {
620
  return;
@@ -622,11 +636,11 @@ class Administrator
622
 
623
  $result = $sitesHelper->isCloneExists($cloneDirectoryName);
624
  if ($result === false) {
625
- echo wp_send_json(["status" => "success"]);
626
  return;
627
  }
628
 
629
- echo wp_send_json([
630
  "status" => "failed",
631
  "message" => $result
632
  ]);
@@ -899,7 +913,7 @@ class Administrator
899
 
900
  /** @var DismissNotice */
901
  $dismissNotice = WPStaging::make(DismissNotice::class);
902
- $dismissNotice->dismiss($_POST['wpstg_notice']);
903
  }
904
 
905
  /**
@@ -923,8 +937,8 @@ class Administrator
923
  return false;
924
  }
925
 
926
- $excludedDirectories = isset($_POST["excludedDirectories"]) ? $_POST["excludedDirectories"] : '';
927
- $extraDirectories = isset($_POST["extraDirectories"]) ? $_POST["extraDirectories"] : '';
928
 
929
  $scan = new Scan();
930
  return $scan->hasFreeDiskSpace($excludedDirectories, $extraDirectories);
@@ -941,10 +955,10 @@ class Administrator
941
 
942
  $existingClones = get_option(Sites::STAGING_SITES_OPTION, []);
943
  if (isset($_POST["clone"]) && array_key_exists($_POST["clone"], $existingClones)) {
944
- $clone = $existingClones[$_POST["clone"]];
945
  require_once "{$this->path}Pro/views/edit-clone-data.php";
946
  } else {
947
- echo __("Unknown error. Please reload the page and try again", "wp-staging");
948
  }
949
 
950
  wp_die();
@@ -962,31 +976,31 @@ class Administrator
962
  $existingClones = get_option(Sites::STAGING_SITES_OPTION, []);
963
  if (isset($_POST["clone"]) && array_key_exists($_POST["clone"], $existingClones)) {
964
  if (empty($_POST['directoryName'])) {
965
- echo __("Site name is required!");
966
  wp_die();
967
  }
968
 
969
- $cloneId = $_POST["clone"];
970
- $cloneName = Sanitize::sanitizeString(wpstg_urldecode($_POST["cloneName"]));
971
- $cloneDirectoryName = wpstg_urldecode($_POST["directoryName"]);
972
  $cloneDirectoryName = preg_replace("#\W+#", '-', strtolower($cloneDirectoryName));
973
 
974
- $existingClones[$cloneId]["cloneName"] = Sanitize::sanitizeString($cloneName);
975
- $existingClones[$cloneId]["directoryName"] = Sanitize::sanitizeString($cloneDirectoryName);
976
- $existingClones[$cloneId]["path"] = Sanitize::sanitizeString($_POST["path"]);
977
- $existingClones[$cloneId]["url"] = Sanitize::sanitizeString($_POST["url"]);
978
- $existingClones[$cloneId]["prefix"] = Sanitize::sanitizeString($_POST["prefix"]);
979
- $existingClones[$cloneId]["databaseUser"] = Sanitize::sanitizeString($_POST["externalDBUser"]);
980
- $existingClones[$cloneId]["databasePassword"] = Sanitize::sanitizeString($_POST["externalDBPassword"]);
981
- $existingClones[$cloneId]["databaseDatabase"] = Sanitize::sanitizeString($_POST["externalDBDatabase"]);
982
- $existingClones[$cloneId]["databaseServer"] = Sanitize::sanitizeString($_POST["externalDBHost"]);
983
- $existingClones[$cloneId]["databasePrefix"] = Sanitize::sanitizeString($_POST["externalDBPrefix"]);
984
 
985
  update_option(Sites::STAGING_SITES_OPTION, $existingClones);
986
 
987
- echo __("Success");
988
  } else {
989
- echo __("Unknown error. Please reload the page and try again", "wp-staging");
990
  }
991
 
992
  wp_die();
@@ -1043,7 +1057,10 @@ class Administrator
1043
  $scan->start();
1044
  $options = $scan->getOptions();
1045
 
1046
- $selectedTables = new SelectedTables($_POST['includedTables'], $_POST['excludedTables'], $_POST['selectedTablesWithoutPrefix']);
 
 
 
1047
  $selectedTables->setDatabaseInfo($options->databaseServer, $options->databaseUser, $options->databasePassword, $options->databaseDatabase, empty($options->databasePrefix) ? $options->prefix : $options->databasePrefix);
1048
  $tables = $selectedTables->getSelectedTables($options->networkClone);
1049
 
@@ -1109,35 +1126,35 @@ class Administrator
1109
  // Set e-mail
1110
  $email = null;
1111
  if (isset($args['wpstg_email'])) {
1112
- $email = trim($args['wpstg_email']);
1113
  }
1114
 
1115
  // Set hosting provider
1116
  $provider = null;
1117
  if (isset($args['wpstg_provider'])) {
1118
- $provider = trim($args['wpstg_provider']);
1119
  }
1120
 
1121
  // Set message
1122
  $message = null;
1123
  if (isset($args['wpstg_message'])) {
1124
- $message = trim($args['wpstg_message']);
1125
  }
1126
 
1127
  // Set syslog
1128
  $syslog = false;
1129
  if (isset($args['wpstg_syslog'])) {
1130
- $syslog = (bool)$args['wpstg_syslog'];
1131
  }
1132
 
1133
  // Set terms
1134
  $terms = false;
1135
  if (isset($args['wpstg_terms'])) {
1136
- $terms = (bool)$args['wpstg_terms'];
1137
  }
1138
 
1139
  // Set forceSend
1140
- $forceSend = isset($_POST['wpstg_force_send']) && $_POST['wpstg_force_send'] !== "false";
1141
 
1142
  $report = new Report();
1143
  $errors = $report->send($email, $message, $terms, $syslog, $provider, $forceSend);
@@ -1158,11 +1175,11 @@ class Administrator
1158
  global $wpdb;
1159
 
1160
  $args = $_POST;
1161
- $user = !empty($args['databaseUser']) ? $args['databaseUser'] : '';
1162
- $password = !empty($args['databasePassword']) ? $args['databasePassword'] : '';
1163
- $database = !empty($args['databaseDatabase']) ? $args['databaseDatabase'] : '';
1164
- $server = !empty($args['databaseServer']) ? $args['databaseServer'] : 'localhost';
1165
- $prefix = !empty($args['databasePrefix']) ? $args['databasePrefix'] : $wpdb->prefix;
1166
  // make sure prefix doesn't contains any invalid character
1167
  // same condition as in WordPress wpdb::set_prefix() method
1168
  if (preg_match('|[^a-z0-9_]|i', $prefix)) {
@@ -1171,7 +1188,7 @@ class Administrator
1171
  }
1172
 
1173
  // ensure tables with the given prefix exist, default false
1174
- $ensurePrefixTableExist = !empty($args['databaseEnsurePrefixTableExist']) ? filter_var($args['databaseEnsurePrefixTableExist'], FILTER_VALIDATE_BOOLEAN) : false;
1175
 
1176
  $dbInfo = new DbInfo($server, $user, stripslashes($password), $database);
1177
  $wpdb = $dbInfo->connect();
@@ -1241,7 +1258,7 @@ class Administrator
1241
  return;
1242
  }
1243
 
1244
- $type = isset($_POST['type']) ? $_POST['type'] : null;
1245
  if ($type === 'processLock') {
1246
  $process = new ProcessLock();
1247
  $process->restart();
@@ -1262,7 +1279,7 @@ class Administrator
1262
  $response = (new ProcessLock())->ajaxIsRunning();
1263
  if ($response !== false)
1264
  {
1265
- echo $response;
1266
 
1267
  exit();
1268
  }
@@ -1299,10 +1316,10 @@ class Administrator
1299
  return;
1300
  }
1301
 
1302
- $user = !empty($_POST['databaseUser']) ? $_POST['databaseUser'] : '';
1303
- $password = !empty($_POST['databasePassword']) ? $_POST['databasePassword'] : '';
1304
- $database = !empty($_POST['databaseDatabase']) ? $_POST['databaseDatabase'] : '';
1305
- $server = !empty($_POST['databaseServer']) ? $_POST['databaseServer'] : 'localhost';
1306
 
1307
  $comparison = new CompareExternalDatabase($server, $user, stripslashes($password), $database);
1308
  $results = $comparison->maybeGetComparison();
@@ -1352,6 +1369,15 @@ class Administrator
1352
  $backup->removeUploadsBackup();
1353
  }
1354
 
 
 
 
 
 
 
 
 
 
1355
  /**
1356
  * Check if Plugin is Pro version
1357
  * @return bool
39
  use WPStaging\Backend\Pro\Modules\Jobs\Backups\BackupUploadsDir;
40
  use WPStaging\Backend\Pluginmeta\Pluginmeta;
41
  use WPStaging\Framework\Database\SelectedTables;
42
+ use WPStaging\Framework\Facades\Escape;
43
+ use WPStaging\Framework\Utils\Sanitize;
44
 
45
  /**
46
  * Class Administrator
81
  */
82
  private $siteInfo;
83
 
84
+ /** @var Sanitize */
85
+ private $sanitize;
86
+
87
  public function __construct()
88
  {
89
  // TODO: Inject using DI
94
  // Todo: Inject using DI
95
  $this->siteInfo = new SiteInfo();
96
 
97
+ add_filter('wpstg.escape.allowedHtmls', [$this, 'htmlAllowedDuringEscape']);
98
+
99
  $this->defineHooks();
100
 
101
  // Path to backend
102
  $this->path = plugin_dir_path(__FILE__);
103
 
104
+ $this->sanitize = WPStaging::make(Sanitize::class);
105
+
106
  // Load plugins meta data
107
  $this->loadMeta();
108
  }
399
  nocache_headers();
400
  header("Content-Type: text/plain");
401
  header('Content-Disposition: attachment; filename="wpstg-system-info.txt"');
402
+ echo esc_html(wp_strip_all_tags(new SystemInfo()));
403
  }
404
 
405
  /**
419
  return;
420
  }
421
 
422
+ $importFile = isset($_FILES["import_file"]) ? $this->sanitize->sanitizeFileUpload($_FILES["import_file"]) : null;
423
+ if ($importFile === null) {
424
+ wp_die("Please upload a valid .json file", "wp-staging");
425
+ }
426
+
427
+ $fileExtension = explode('.', $importFile["name"]);
428
  $fileExtension = end($fileExtension);
429
  if ($fileExtension !== "json") {
430
  wp_die("Please upload a valid .json file", "wp-staging");
431
  }
432
 
433
 
434
+ $importFile = $importFile["tmp_name"];
435
 
436
  if (empty($importFile)) {
437
+ wp_die(esc_html__("Please upload a file to import", "wp-staging"));
438
  }
439
 
440
  update_option("wpstg_settings", json_decode(file_get_contents($importFile, true)));
573
  $response = (new ProcessLock())->ajaxIsRunning();
574
  if ($response !== false)
575
  {
576
+ echo json_encode($response);
577
 
578
  exit();
579
  }
605
  return;
606
  }
607
 
608
+ $isChecked = isset($_POST['isChecked']) ? $this->sanitize->sanitizeBool($_POST['isChecked']) : false;
609
+ $forceDefault = isset($_POST['forceDefault']) ? $this->sanitize->sanitizeBool($_POST['forceDefault']) : false;
610
+ $path = isset($_POST['dirPath']) ? $this->sanitize->sanitizePath($_POST['dirPath']) : "";
611
  $path = ABSPATH . $path;
612
  $scan = new Scan($path);
613
  $scan->setGifLoaderPath($this->assets->getAssetsUrl('img/spinner.gif'));
626
  return;
627
  }
628
 
629
+ /** @var Sites $sitesHelper */
630
  $sitesHelper = new Sites();
631
+ $cloneDirectoryName = isset($_POST["directoryName"]) ? $sitesHelper->sanitizeDirectoryName($_POST["directoryName"]) : '';
632
 
633
  if (strlen($cloneDirectoryName) < 1) {
634
  return;
636
 
637
  $result = $sitesHelper->isCloneExists($cloneDirectoryName);
638
  if ($result === false) {
639
+ wp_send_json(["status" => "success"]);
640
  return;
641
  }
642
 
643
+ wp_send_json([
644
  "status" => "failed",
645
  "message" => $result
646
  ]);
913
 
914
  /** @var DismissNotice */
915
  $dismissNotice = WPStaging::make(DismissNotice::class);
916
+ $dismissNotice->dismiss($this->sanitize->sanitizeString($_POST['wpstg_notice']));
917
  }
918
 
919
  /**
937
  return false;
938
  }
939
 
940
+ $excludedDirectories = isset($_POST["excludedDirectories"]) ? $this->sanitize->sanitizeString($_POST["excludedDirectories"]) : '';
941
+ $extraDirectories = isset($_POST["extraDirectories"]) ? $this->sanitize->sanitizeString($_POST["extraDirectories"]) : '';
942
 
943
  $scan = new Scan();
944
  return $scan->hasFreeDiskSpace($excludedDirectories, $extraDirectories);
955
 
956
  $existingClones = get_option(Sites::STAGING_SITES_OPTION, []);
957
  if (isset($_POST["clone"]) && array_key_exists($_POST["clone"], $existingClones)) {
958
+ $clone = $existingClones[$this->sanitize->sanitizeString($_POST["clone"])];
959
  require_once "{$this->path}Pro/views/edit-clone-data.php";
960
  } else {
961
+ echo esc_html__("Unknown error. Please reload the page and try again", "wp-staging");
962
  }
963
 
964
  wp_die();
976
  $existingClones = get_option(Sites::STAGING_SITES_OPTION, []);
977
  if (isset($_POST["clone"]) && array_key_exists($_POST["clone"], $existingClones)) {
978
  if (empty($_POST['directoryName'])) {
979
+ echo esc_html__("Site name is required!", "wp-staging");
980
  wp_die();
981
  }
982
 
983
+ $cloneId = $this->sanitize->sanitizeString($_POST["clone"]);
984
+ $cloneName = isset($_POST["cloneName"]) ? $this->sanitize->sanitizeString($_POST["cloneName"]) : '';
985
+ $cloneDirectoryName = $this->sanitize->sanitizeString($_POST["directoryName"]);
986
  $cloneDirectoryName = preg_replace("#\W+#", '-', strtolower($cloneDirectoryName));
987
 
988
+ $existingClones[$cloneId]["cloneName"] = $this->sanitize->sanitizeString($cloneName);
989
+ $existingClones[$cloneId]["directoryName"] = $this->sanitize->sanitizeString($cloneDirectoryName);
990
+ $existingClones[$cloneId]["path"] = isset($_POST["path"]) ? $this->sanitize->sanitizeString($_POST["path"]) : '';
991
+ $existingClones[$cloneId]["url"] = isset($_POST["url"]) ? $this->sanitize->sanitizeString($_POST["url"]) : '';
992
+ $existingClones[$cloneId]["prefix"] = isset($_POST["prefix"]) ? $this->sanitize->sanitizeString($_POST["prefix"]) : '';
993
+ $existingClones[$cloneId]["databaseUser"] = isset($_POST["externalDBUser"]) ? $this->sanitize->sanitizeString($_POST["externalDBUser"]) : '';
994
+ $existingClones[$cloneId]["databasePassword"] = isset($_POST["externalDBPassword"]) ? $this->sanitize->sanitizeString($_POST["externalDBPassword"]) : '';
995
+ $existingClones[$cloneId]["databaseDatabase"] = isset($_POST["externalDBDatabase"]) ? $this->sanitize->sanitizeString($_POST["externalDBDatabase"]) : '';
996
+ $existingClones[$cloneId]["databaseServer"] = isset($_POST["externalDBHost"]) ? $this->sanitize->sanitizeString($_POST["externalDBHost"]) : 'localhost';
997
+ $existingClones[$cloneId]["databasePrefix"] = isset($_POST["externalDBPrefix"]) ? $this->sanitize->sanitizeString($_POST["externalDBPrefix"]) : 'wp_';
998
 
999
  update_option(Sites::STAGING_SITES_OPTION, $existingClones);
1000
 
1001
+ echo esc_html__("Success", "wp-staging");
1002
  } else {
1003
+ echo esc_html__("Unknown error. Please reload the page and try again", "wp-staging");
1004
  }
1005
 
1006
  wp_die();
1057
  $scan->start();
1058
  $options = $scan->getOptions();
1059
 
1060
+ $includedTables = isset($_POST['includedTables']) ? $this->sanitize->sanitizeString($_POST['includedTables']) : '';
1061
+ $excludedTables = isset($_POST['excludedTables']) ? $this->sanitize->sanitizeString($_POST['excludedTables']) : '';
1062
+ $selectedTablesWithoutPrefix = isset($_POST['selectedTablesWithoutPrefix']) ? $this->sanitize->sanitizeString($_POST['selectedTablesWithoutPrefix']) : '';
1063
+ $selectedTables = new SelectedTables($includedTables, $excludedTables, $selectedTablesWithoutPrefix);
1064
  $selectedTables->setDatabaseInfo($options->databaseServer, $options->databaseUser, $options->databasePassword, $options->databaseDatabase, empty($options->databasePrefix) ? $options->prefix : $options->databasePrefix);
1065
  $tables = $selectedTables->getSelectedTables($options->networkClone);
1066
 
1126
  // Set e-mail
1127
  $email = null;
1128
  if (isset($args['wpstg_email'])) {
1129
+ $email = trim($this->sanitize->sanitizeString($args['wpstg_email']));
1130
  }
1131
 
1132
  // Set hosting provider
1133
  $provider = null;
1134
  if (isset($args['wpstg_provider'])) {
1135
+ $provider = trim($this->sanitize->sanitizeString($args['wpstg_provider']));
1136
  }
1137
 
1138
  // Set message
1139
  $message = null;
1140
  if (isset($args['wpstg_message'])) {
1141
+ $message = trim($this->sanitize->sanitizeString($args['wpstg_message']));
1142
  }
1143
 
1144
  // Set syslog
1145
  $syslog = false;
1146
  if (isset($args['wpstg_syslog'])) {
1147
+ $syslog = $this->sanitize->sanitizeBool($args['wpstg_syslog']);
1148
  }
1149
 
1150
  // Set terms
1151
  $terms = false;
1152
  if (isset($args['wpstg_terms'])) {
1153
+ $terms = $this->sanitize->sanitizeBool($args['wpstg_terms']);
1154
  }
1155
 
1156
  // Set forceSend
1157
+ $forceSend = isset($_POST['wpstg_force_send']) && $this->sanitize->sanitizeBool($_POST['wpstg_force_send']);
1158
 
1159
  $report = new Report();
1160
  $errors = $report->send($email, $message, $terms, $syslog, $provider, $forceSend);
1175
  global $wpdb;
1176
 
1177
  $args = $_POST;
1178
+ $user = !empty($args['databaseUser']) ? $this->sanitize->sanitizeString($args['databaseUser']) : '';
1179
+ $password = !empty($args['databasePassword']) ? $this->sanitize->sanitizeString($args['databasePassword']) : '';
1180
+ $database = !empty($args['databaseDatabase']) ? $this->sanitize->sanitizeString($args['databaseDatabase']) : '';
1181
+ $server = !empty($args['databaseServer']) ? $this->sanitize->sanitizeString($args['databaseServer']) : 'localhost';
1182
+ $prefix = !empty($args['databasePrefix']) ? $this->sanitize->sanitizeString($args['databasePrefix']) : $wpdb->prefix;
1183
  // make sure prefix doesn't contains any invalid character
1184
  // same condition as in WordPress wpdb::set_prefix() method
1185
  if (preg_match('|[^a-z0-9_]|i', $prefix)) {
1188
  }
1189
 
1190
  // ensure tables with the given prefix exist, default false
1191
+ $ensurePrefixTableExist = !empty($args['databaseEnsurePrefixTableExist']) ? $this->sanitize->sanitizeBool($args['databaseEnsurePrefixTableExist']) : false;
1192
 
1193
  $dbInfo = new DbInfo($server, $user, stripslashes($password), $database);
1194
  $wpdb = $dbInfo->connect();
1258
  return;
1259
  }
1260
 
1261
+ $type = isset($_POST['type']) ? $this->sanitize->sanitizeString($_POST['type']) : null;
1262
  if ($type === 'processLock') {
1263
  $process = new ProcessLock();
1264
  $process->restart();
1279
  $response = (new ProcessLock())->ajaxIsRunning();
1280
  if ($response !== false)
1281
  {
1282
+ echo json_encode($response);
1283
 
1284
  exit();
1285
  }
1316
  return;
1317
  }
1318
 
1319
+ $user = !empty($_POST['databaseUser']) ? $this->sanitize->sanitizeString($_POST['databaseUser']) : '';
1320
+ $password = !empty($_POST['databasePassword']) ? $this->sanitize->sanitizeString($_POST['databasePassword']) : '';
1321
+ $database = !empty($_POST['databaseDatabase']) ? $this->sanitize->sanitizeString($_POST['databaseDatabase']) : '';
1322
+ $server = !empty($_POST['databaseServer']) ? $this->sanitize->sanitizeString($_POST['databaseServer']) : 'localhost';
1323
 
1324
  $comparison = new CompareExternalDatabase($server, $user, stripslashes($password), $database);
1325
  $results = $comparison->maybeGetComparison();
1369
  $backup->removeUploadsBackup();
1370
  }
1371
 
1372
+ /**
1373
+ * @param array $array
1374
+ * @return array
1375
+ */
1376
+ public function htmlAllowedDuringEscape($array)
1377
+ {
1378
+ return Escape::htmlAllowedDuringEscape($array);
1379
+ }
1380
+
1381
  /**
1382
  * Check if Plugin is Pro version
1383
  * @return bool
Backend/Feedback/Feedback.php CHANGED
@@ -45,7 +45,7 @@ class Feedback
45
  {
46
 
47
  if (isset($_POST['data'])) {
48
- parse_str($_POST['data'], $form);
49
  }
50
 
51
  $text = '';
45
  {
46
 
47
  if (isset($_POST['data'])) {
48
+ parse_str(sanitize_text_field($_POST['data']), $form);
49
  }
50
 
51
  $text = '';
Backend/Modules/Jobs/Cloning.php CHANGED
@@ -81,9 +81,9 @@ class Cloning extends Job
81
 
82
  // Generate Options
83
  // Clone ID -> timestamp (time at which this clone creation initiated)
84
- $this->options->clone = preg_replace("#\W+#", '-', strtolower($_POST["cloneID"]));
85
  // Clone Name -> Site name that user input, if user left it empty it will be Clone ID
86
- $this->options->cloneName = $this->sanitize->sanitizeString((wpstg_urldecode($_POST["cloneName"])));
87
  // The slugified version of Clone Name (to use in directory creation)
88
  $this->options->cloneDirectoryName = $this->sitesHelper->sanitizeDirectoryName($this->options->cloneName);
89
  $result = $this->sitesHelper->isCloneExists($this->options->cloneDirectoryName);
@@ -136,27 +136,30 @@ class Cloning extends Job
136
 
137
  $this->options->networkClone = false;
138
  if ($this->isMultisiteAndPro() && is_main_site()) {
139
- $this->options->networkClone = isset($_POST['networkClone']) && $_POST['networkClone'] !== "false";
140
  }
141
 
142
  // Included Tables / Prefixed Table - Excluded Tables
143
- $selectedTables = new SelectedTables($_POST['includedTables'], $_POST['excludedTables'], $_POST['selectedTablesWithoutPrefix']);
144
- $selectedTables->setAllTablesExcluded(empty($_POST['allTablesExcluded']) ? false : $_POST['allTablesExcluded'] === 'true');
 
 
 
145
  $this->options->tables = $selectedTables->getSelectedTables($this->options->networkClone);
146
 
147
  // Exclude File Size Rules
148
- $this->options->excludeSizeRules = [];
149
- if (!empty($_POST["excludeSizeRules"])) {
150
- $this->options->excludeSizeRules = array_map([$this->sanitize, 'sanitizeString'], explode(',', wpstg_urldecode($_POST["excludeSizeRules"])));
151
  }
152
 
153
  // Exclude Glob Rules
154
- $this->options->excludeGlobRules = [];
155
- if (!empty($_POST["excludeGlobRules"])) {
156
- $this->options->excludeGlobRules = array_map([$this->sanitize, 'sanitizeString'], explode(',', wpstg_urldecode($_POST["excludeGlobRules"])));
157
  }
158
 
159
- $this->options->uploadsSymlinked = isset($_POST['uploadsSymlinked']) && $_POST['uploadsSymlinked'] === 'true';
160
 
161
  /**
162
  * @see /WPStaging/Framework/CloningProcess/ExcludedPlugins.php to exclude plugins
@@ -171,51 +174,51 @@ class Cloning extends Job
171
  $excludedDirectories[] = $this->dirUtils->getRelativeUploadPath(SlashMode::LEADING_SLASH);
172
  }
173
 
174
- $excludedDirectoriesRequest = isset($_POST["excludedDirectories"]) ? $_POST["excludedDirectories"] : '';
175
  $excludedDirectoriesRequest = $this->dirUtils->getExcludedDirectories($excludedDirectoriesRequest);
176
 
177
  $this->options->excludedDirectories = array_merge($excludedDirectories, $excludedDirectoriesRequest);
178
 
179
  // Extra Directories
180
  if (isset($_POST["extraDirectories"])) {
181
- $this->options->extraDirectories = explode(ScanConst::DIRECTORIES_SEPARATOR, wpstg_urldecode($_POST["extraDirectories"]));
182
  }
183
 
184
  $this->options->databaseServer = 'localhost';
185
  if (!empty($_POST["databaseServer"])) {
186
- $this->options->databaseServer = $_POST["databaseServer"];
187
  }
188
 
189
  $this->options->databaseUser = '';
190
  if (!empty($_POST["databaseUser"])) {
191
- $this->options->databaseUser = $_POST["databaseUser"];
192
  }
193
 
194
  $this->options->databasePassword = '';
195
  if (!empty($_POST["databasePassword"])) {
196
- $this->options->databasePassword = stripslashes($_POST["databasePassword"]);
197
  }
198
 
199
  $this->options->databaseDatabase = '';
200
  if (!empty($_POST["databaseDatabase"])) {
201
- $this->options->databaseDatabase = $_POST["databaseDatabase"];
202
  }
203
 
204
  // isExternalDatabase() depends upon databaseUser and databasePassword,
205
  // Make sure they are set before calling this.
206
  $this->options->databasePrefix = $this->isExternalDatabase() ? $this->db->prefix : '';
207
  if (!empty($_POST["databasePrefix"])) {
208
- $this->options->databasePrefix = $this->maybeAppendUnderscorePrefix($_POST["databasePrefix"]);
209
  }
210
 
211
  $this->options->cloneDir = '';
212
  if (!empty($_POST["cloneDir"])) {
213
- $this->options->cloneDir = trailingslashit(wpstg_urldecode($_POST["cloneDir"]));
214
  }
215
 
216
  $this->options->cloneHostname = '';
217
  if (!empty($_POST["cloneHostname"])) {
218
- $this->options->cloneHostname = trim($_POST["cloneHostname"]);
219
  }
220
 
221
  // Make sure it is always enabled for free version
@@ -223,7 +226,7 @@ class Cloning extends Job
223
  if (defined('WPSTGPRO_VERSION')) {
224
  $this->options->emailsAllowed = apply_filters(
225
  'wpstg_cloning_email_allowed',
226
- isset($_POST['emailsAllowed']) && $_POST['emailsAllowed'] !== "false"
227
  );
228
  }
229
 
@@ -387,8 +390,10 @@ class Cloning extends Job
387
  return $this->options->prefix;
388
  }
389
  }
390
- $this->returnException("Fatal Error: Can not create staging prefix. '{$this->options->prefix}' already exists! Stopping for security reasons. Contact support@wp-staging.com");
391
- wp_die("Fatal Error: Can not create staging prefix. Prefix '{$this->options->prefix}' already exists! Stopping for security reasons. Contact support@wp-staging.com");
 
 
392
  }
393
 
394
 
81
 
82
  // Generate Options
83
  // Clone ID -> timestamp (time at which this clone creation initiated)
84
+ $this->options->clone = preg_replace("#\W+#", '-', strtolower($this->sanitize->sanitizeString($_POST["cloneID"])));
85
  // Clone Name -> Site name that user input, if user left it empty it will be Clone ID
86
+ $this->options->cloneName = isset($_POST["cloneName"]) ? $this->sanitize->sanitizeString($_POST["cloneName"]) : '';
87
  // The slugified version of Clone Name (to use in directory creation)
88
  $this->options->cloneDirectoryName = $this->sitesHelper->sanitizeDirectoryName($this->options->cloneName);
89
  $result = $this->sitesHelper->isCloneExists($this->options->cloneDirectoryName);
136
 
137
  $this->options->networkClone = false;
138
  if ($this->isMultisiteAndPro() && is_main_site()) {
139
+ $this->options->networkClone = isset($_POST['networkClone']) && $this->sanitize->sanitizeBool($_POST['networkClone']);
140
  }
141
 
142
  // Included Tables / Prefixed Table - Excluded Tables
143
+ $includedTables = isset($_POST['includedTables']) ? $this->sanitize->sanitizeString($_POST['includedTables']) : '';
144
+ $excludedTables = isset($_POST['excludedTables']) ? $this->sanitize->sanitizeString($_POST['excludedTables']) : '';
145
+ $selectedTablesWithoutPrefix = isset($_POST['selectedTablesWithoutPrefix']) ? $this->sanitize->sanitizeString($_POST['selectedTablesWithoutPrefix']) : '';
146
+ $selectedTables = new SelectedTables($includedTables, $excludedTables, $selectedTablesWithoutPrefix);
147
+ $selectedTables->setAllTablesExcluded(empty($_POST['allTablesExcluded']) ? false : $this->sanitize->sanitizeBool($_POST['allTablesExcluded']));
148
  $this->options->tables = $selectedTables->getSelectedTables($this->options->networkClone);
149
 
150
  // Exclude File Size Rules
151
+ $this->options->excludeGlobRules = [];
152
+ if (!empty($_POST["excludeGlobRules"])) {
153
+ $this->options->excludeGlobRules = $this->sanitize->sanitizeExcludeRules($_POST["excludeGlobRules"]);
154
  }
155
 
156
  // Exclude Glob Rules
157
+ $this->options->excludeSizeRules = [];
158
+ if (!empty($_POST["excludeSizeRules"])) {
159
+ $this->options->excludeSizeRules = $this->sanitize->sanitizeExcludeRules($_POST["excludeSizeRules"]);
160
  }
161
 
162
+ $this->options->uploadsSymlinked = isset($_POST['uploadsSymlinked']) && $this->sanitize->sanitizeBool($_POST['uploadsSymlinked']);
163
 
164
  /**
165
  * @see /WPStaging/Framework/CloningProcess/ExcludedPlugins.php to exclude plugins
174
  $excludedDirectories[] = $this->dirUtils->getRelativeUploadPath(SlashMode::LEADING_SLASH);
175
  }
176
 
177
+ $excludedDirectoriesRequest = isset($_POST["excludedDirectories"]) ? $this->sanitize->sanitizeString($_POST["excludedDirectories"]) : '';
178
  $excludedDirectoriesRequest = $this->dirUtils->getExcludedDirectories($excludedDirectoriesRequest);
179
 
180
  $this->options->excludedDirectories = array_merge($excludedDirectories, $excludedDirectoriesRequest);
181
 
182
  // Extra Directories
183
  if (isset($_POST["extraDirectories"])) {
184
+ $this->options->extraDirectories = explode(ScanConst::DIRECTORIES_SEPARATOR, $this->sanitize->sanitizeString($_POST["extraDirectories"]));
185
  }
186
 
187
  $this->options->databaseServer = 'localhost';
188
  if (!empty($_POST["databaseServer"])) {
189
+ $this->options->databaseServer = $this->sanitize->sanitizeString($_POST["databaseServer"]);
190
  }
191
 
192
  $this->options->databaseUser = '';
193
  if (!empty($_POST["databaseUser"])) {
194
+ $this->options->databaseUser = $this->sanitize->sanitizeString($_POST["databaseUser"]);
195
  }
196
 
197
  $this->options->databasePassword = '';
198
  if (!empty($_POST["databasePassword"])) {
199
+ $this->options->databasePassword = stripslashes($this->sanitize->sanitizeString($_POST["databasePassword"]));
200
  }
201
 
202
  $this->options->databaseDatabase = '';
203
  if (!empty($_POST["databaseDatabase"])) {
204
+ $this->options->databaseDatabase = $this->sanitize->sanitizeString($_POST["databaseDatabase"]);
205
  }
206
 
207
  // isExternalDatabase() depends upon databaseUser and databasePassword,
208
  // Make sure they are set before calling this.
209
  $this->options->databasePrefix = $this->isExternalDatabase() ? $this->db->prefix : '';
210
  if (!empty($_POST["databasePrefix"])) {
211
+ $this->options->databasePrefix = $this->maybeAppendUnderscorePrefix($this->sanitize->sanitizeString($_POST["databasePrefix"]));
212
  }
213
 
214
  $this->options->cloneDir = '';
215
  if (!empty($_POST["cloneDir"])) {
216
+ $this->options->cloneDir = trailingslashit(wpstg_urldecode($this->sanitize->sanitizeString($_POST["cloneDir"])));
217
  }
218
 
219
  $this->options->cloneHostname = '';
220
  if (!empty($_POST["cloneHostname"])) {
221
+ $this->options->cloneHostname = trim($this->sanitize->sanitizeString($_POST["cloneHostname"]));
222
  }
223
 
224
  // Make sure it is always enabled for free version
226
  if (defined('WPSTGPRO_VERSION')) {
227
  $this->options->emailsAllowed = apply_filters(
228
  'wpstg_cloning_email_allowed',
229
+ isset($_POST['emailsAllowed']) && $this->sanitize->sanitizeBool($_POST['emailsAllowed'])
230
  );
231
  }
232
 
390
  return $this->options->prefix;
391
  }
392
  }
393
+
394
+ $message = sprintf("Fatal Error: Can not create staging prefix. '%s' already exists! Stopping for security reasons. Contact support@wp-staging.com", $this->options->prefix);
395
+ $this->returnException($message);
396
+ wp_die(esc_html($message));
397
  }
398
 
399
 
Backend/Modules/Jobs/Delete.php CHANGED
@@ -13,6 +13,7 @@ use WPStaging\Core\WPStaging;
13
  use WPStaging\Framework\Filesystem\Filesystem;
14
  use WPStaging\Framework\Filesystem\FilesystemExceptions;
15
  use WPStaging\Framework\Staging\Sites;
 
16
  use WPStaging\Framework\Utils\Strings;
17
 
18
  /**
@@ -63,12 +64,17 @@ class Delete extends Job
63
  /** @var Strings */
64
  private $strings;
65
 
 
 
 
66
  public function __construct($isExternal = false)
67
  {
68
  parent::__construct();
69
 
 
 
70
  $this->isExternalDb = $isExternal;
71
- $this->deleteDir = !empty($_POST['deleteDir']) ? urldecode($_POST['deleteDir']) : '';
72
  $this->strings = new Strings();
73
  }
74
 
@@ -147,7 +153,7 @@ class Delete extends Job
147
  }
148
 
149
  if ($name === null) {
150
- $name = (string)$_POST["clone"];
151
  }
152
 
153
  $clones = get_option(Sites::STAGING_SITES_OPTION, []);
@@ -324,7 +330,7 @@ class Delete extends Job
324
  return $tables;
325
  }
326
 
327
- return array_diff($tables, $_POST["excludedTables"]);
328
  }
329
 
330
  /**
13
  use WPStaging\Framework\Filesystem\Filesystem;
14
  use WPStaging\Framework\Filesystem\FilesystemExceptions;
15
  use WPStaging\Framework\Staging\Sites;
16
+ use WPStaging\Framework\Utils\Sanitize;
17
  use WPStaging\Framework\Utils\Strings;
18
 
19
  /**
64
  /** @var Strings */
65
  private $strings;
66
 
67
+ /** @var Sanitize */
68
+ private $sanitize;
69
+
70
  public function __construct($isExternal = false)
71
  {
72
  parent::__construct();
73
 
74
+ /** @var Sanitize */
75
+ $this->sanitize = WPStaging::make(Sanitize::class);
76
  $this->isExternalDb = $isExternal;
77
+ $this->deleteDir = !empty($_POST['deleteDir']) ? $this->sanitize->sanitizePath($_POST['deleteDir']) : '';
78
  $this->strings = new Strings();
79
  }
80
 
153
  }
154
 
155
  if ($name === null) {
156
+ $name = $this->sanitize->sanitizeString($_POST["clone"]);
157
  }
158
 
159
  $clones = get_option(Sites::STAGING_SITES_OPTION, []);
330
  return $tables;
331
  }
332
 
333
+ return array_diff($tables, $this->sanitize->sanitizeString($_POST["excludedTables"]));
334
  }
335
 
336
  /**
Backend/Modules/Jobs/Files.php CHANGED
@@ -71,6 +71,8 @@ class Files extends JobExecutable
71
 
72
  if (is_file($filePath)) {
73
  $this->file = new FileObject($filePath, 'r');
 
 
74
  }
75
 
76
  $logStep = 0;
71
 
72
  if (is_file($filePath)) {
73
  $this->file = new FileObject($filePath, 'r');
74
+ } else {
75
+ $this->returnException(sprintf('Fatal Error: Files - File: %s is missing! Either the file was deleted after directory scanning or there is a permission issue with the file system.', $filePath));
76
  }
77
 
78
  $logStep = 0;
Backend/Modules/Jobs/Logs.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  namespace WPStaging\Backend\Modules\Jobs;
4
 
 
 
5
  /**
6
  * Class Logs
7
  * @package WPStaging\Backend\Modules\Jobs
@@ -16,7 +18,7 @@ class Logs extends Job
16
  public function initialize()
17
  {
18
  if (isset($_POST["clone"])) {
19
- $this->clone = $_POST["clone"];
20
  }
21
  }
22
 
2
 
3
  namespace WPStaging\Backend\Modules\Jobs;
4
 
5
+ use WPStaging\Framework\Facades\Sanitize;
6
+
7
  /**
8
  * Class Logs
9
  * @package WPStaging\Backend\Modules\Jobs
18
  public function initialize()
19
  {
20
  if (isset($_POST["clone"])) {
21
+ $this->clone = Sanitize::sanitizeString($_POST["clone"]);
22
  }
23
  }
24
 
Backend/Modules/Jobs/ProcessLock.php CHANGED
@@ -43,7 +43,7 @@ class ProcessLock extends JobExecutable
43
  public function ajaxIsRunning()
44
  {
45
  if (parent::isRunning()) {
46
- return json_encode([
47
  'success' => false,
48
  'type' => 'processLock',
49
  // TODO: Create a Swal Response Class and Js library to handle that response or, Implement own Swal alternative
@@ -53,7 +53,7 @@ class ProcessLock extends JobExecutable
53
  'confirmButtonText' => __('Stop other process', 'wp-staging'),
54
  'showCancelButton' => true,
55
  ],
56
- ]);
57
  }
58
 
59
  return false;
43
  public function ajaxIsRunning()
44
  {
45
  if (parent::isRunning()) {
46
+ return [
47
  'success' => false,
48
  'type' => 'processLock',
49
  // TODO: Create a Swal Response Class and Js library to handle that response or, Implement own Swal alternative
53
  'confirmButtonText' => __('Stop other process', 'wp-staging'),
54
  'showCancelButton' => true,
55
  ],
56
+ ];
57
  }
58
 
59
  return false;
Backend/Modules/Jobs/Scan.php CHANGED
@@ -14,6 +14,7 @@ use WPStaging\Framework\Adapter\Directory;
14
  use WPStaging\Framework\Filesystem\DiskWriteCheck;
15
  use WPStaging\Framework\Filesystem\Scanning\ScanConst;
16
  use WPStaging\Framework\Staging\Sites;
 
17
  use WPStaging\Framework\Utils\Strings;
18
  use WPStaging\Framework\Utils\WpDefaultDirectories;
19
  use WPStaging\Pro\Backup\Exceptions\DiskNotWritableException;
@@ -72,6 +73,12 @@ class Scan extends Job
72
  */
73
  private $diskWriteCheck;
74
 
 
 
 
 
 
 
75
  /**
76
  * @var string Path to the info icon
77
  */
@@ -90,6 +97,7 @@ class Scan extends Job
90
  $this->strUtils = new Strings();
91
  $this->dirAdapter = WPStaging::make(Directory::class);
92
  $this->diskWriteCheck = WPStaging::make(DiskWriteCheck::class);
 
93
  parent::__construct();
94
  }
95
 
@@ -151,8 +159,10 @@ class Scan extends Job
151
  $this->options->existingClones = is_array($this->options->existingClones) ? $this->options->existingClones : [];
152
  $this->options->current = null;
153
 
154
- if (isset($_POST["clone"]) && array_key_exists($_POST["clone"], $this->options->existingClones)) {
155
- $this->options->current = $_POST["clone"];
 
 
156
  $this->options->currentClone = $this->options->existingClones[$this->options->current];
157
  // Make sure no warning is shown when updating/resetting an old clone having no exclude rules options
158
  $this->options->currentClone['excludeSizeRules'] = isset($this->options->currentClone['excludeSizeRules']) ? $this->options->currentClone['excludeSizeRules'] : [];
@@ -186,7 +196,7 @@ class Scan extends Job
186
  $this->options->mainJob = 'cloning';
187
  $job = '';
188
  if (isset($_POST["job"])) {
189
- $job = $_POST['job'];
190
  }
191
 
192
  if ($this->options->current !== null && $job === 'resetting') {
14
  use WPStaging\Framework\Filesystem\DiskWriteCheck;
15
  use WPStaging\Framework\Filesystem\Scanning\ScanConst;
16
  use WPStaging\Framework\Staging\Sites;
17
+ use WPStaging\Framework\Utils\Sanitize;
18
  use WPStaging\Framework\Utils\Strings;
19
  use WPStaging\Framework\Utils\WpDefaultDirectories;
20
  use WPStaging\Pro\Backup\Exceptions\DiskNotWritableException;
73
  */
74
  private $diskWriteCheck;
75
 
76
+ /**
77
+ * @var Sanitize
78
+ */
79
+ private $sanitize;
80
+
81
+
82
  /**
83
  * @var string Path to the info icon
84
  */
97
  $this->strUtils = new Strings();
98
  $this->dirAdapter = WPStaging::make(Directory::class);
99
  $this->diskWriteCheck = WPStaging::make(DiskWriteCheck::class);
100
+ $this->sanitize = WPStaging::make(Sanitize::class);
101
  parent::__construct();
102
  }
103
 
159
  $this->options->existingClones = is_array($this->options->existingClones) ? $this->options->existingClones : [];
160
  $this->options->current = null;
161
 
162
+ $cloneID = isset($_POST["clone"]) ? $this->sanitize->sanitizeString($_POST['clone']) : '';
163
+
164
+ if (array_key_exists($cloneID, $this->options->existingClones)) {
165
+ $this->options->current = $cloneID;
166
  $this->options->currentClone = $this->options->existingClones[$this->options->current];
167
  // Make sure no warning is shown when updating/resetting an old clone having no exclude rules options
168
  $this->options->currentClone['excludeSizeRules'] = isset($this->options->currentClone['excludeSizeRules']) ? $this->options->currentClone['excludeSizeRules'] : [];
196
  $this->options->mainJob = 'cloning';
197
  $job = '';
198
  if (isset($_POST["job"])) {
199
+ $job = $this->sanitize->sanitizeString($_POST['job']);
200
  }
201
 
202
  if ($this->options->current !== null && $job === 'resetting') {
Backend/Modules/Jobs/Updating.php CHANGED
@@ -94,7 +94,7 @@ class Updating extends Job
94
  $this->cache->delete("files_to_copy");
95
 
96
  // Generate Options
97
- $this->options->clone = preg_replace("#\W+#", '-', strtolower($_POST["cloneID"]));
98
  $this->options->cloneNumber = 1;
99
  $this->options->includedDirectories = [];
100
  $this->options->excludedDirectories = [];
@@ -157,7 +157,7 @@ class Updating extends Job
157
  $job = 'reset';
158
  }
159
 
160
- wp_die("Fatal Error: Can not {$job} clone because there is no clone data.");
161
  }
162
 
163
  $this->isExternalDb = !(empty($this->options->databaseUser) && empty($this->options->databasePassword));
@@ -183,7 +183,7 @@ class Updating extends Job
183
  // Make sure it is always enabled for free version
184
  $this->options->emailsAllowed = true;
185
  if (defined('WPSTGPRO_VERSION')) {
186
- $this->options->emailsAllowed = isset($_POST['emailsAllowed']) && $_POST['emailsAllowed'] !== "false";
187
  }
188
 
189
  $this->options->cloneDir = $this->options->existingClones[$this->options->clone]['path'];
@@ -213,29 +213,29 @@ class Updating extends Job
213
  // Exclude Glob Rules
214
  $this->options->excludeGlobRules = [];
215
  if (!empty($_POST["excludeGlobRules"])) {
216
- $this->options->excludeGlobRules = array_map([$this->sanitize, 'sanitizeString'], explode(',', wpstg_urldecode($_POST["excludeGlobRules"])));
217
  }
218
 
219
  $this->options->excludeSizeRules = [];
220
  if (!empty($_POST["excludeSizeRules"])) {
221
- $this->options->excludeSizeRules = array_map([$this->sanitize, 'sanitizeString'], explode(',', wpstg_urldecode($_POST["excludeSizeRules"])));
222
  }
223
 
224
  // Excluded Directories
225
- $excludedDirectoriesRequest = isset($_POST["excludedDirectories"]) ? $_POST["excludedDirectories"] : '';
226
  $excludedDirectoriesRequest = $this->dirUtils->getExcludedDirectories($excludedDirectoriesRequest);
227
  $this->options->excludedDirectories = array_merge($this->options->excludedDirectories, $excludedDirectoriesRequest);
228
  // Extra Directories
229
  if (isset($_POST["extraDirectories"])) {
230
- $this->options->extraDirectories = explode(ScanConst::DIRECTORIES_SEPARATOR, wpstg_urldecode($_POST["extraDirectories"]));
231
  }
232
 
233
  // delete uploads folder before copying if uploads is not symlinked
234
- $this->options->deleteUploadsFolder = !$this->options->uploadsSymlinked && isset($_POST['cleanUploadsDir']) && $_POST['cleanUploadsDir'] === 'true';
235
  // should not backup uploads during update process
236
  $this->options->backupUploadsFolder = false;
237
  // clean plugins and themes dir before updating
238
- $this->options->deletePluginsAndThemes = isset($_POST['cleanPluginsThemes']) && $_POST['cleanPluginsThemes'] === 'true';
239
  // set default statuses for backup of uploads dir and cleaning of uploads, themes and plugins dirs
240
  $this->options->statusBackupUploadsDir = 'skipped';
241
  $this->options->statusContentCleaner = 'pending';
@@ -244,8 +244,11 @@ class Updating extends Job
244
  private function setTablesForUpdateJob()
245
  {
246
  // Included Tables / Prefixed Table - Excluded Tables
247
- $selectedTables = new SelectedTables($_POST['includedTables'], $_POST['excludedTables'], $_POST['selectedTablesWithoutPrefix']);
248
- $selectedTables->setAllTablesExcluded(empty($_POST['allTablesExcluded']) ? false : $_POST['allTablesExcluded'] === 'true');
 
 
 
249
  $this->options->tables = $selectedTables->getSelectedTables($this->options->networkClone);
250
  }
251
 
94
  $this->cache->delete("files_to_copy");
95
 
96
  // Generate Options
97
+ $this->options->clone = preg_replace("#\W+#", '-', strtolower($this->sanitize->sanitizeString($_POST["cloneID"])));
98
  $this->options->cloneNumber = 1;
99
  $this->options->includedDirectories = [];
100
  $this->options->excludedDirectories = [];
157
  $job = 'reset';
158
  }
159
 
160
+ wp_die(sprintf("Fatal Error: Can not %s clone because there is no clone data.", esc_html($job)));
161
  }
162
 
163
  $this->isExternalDb = !(empty($this->options->databaseUser) && empty($this->options->databasePassword));
183
  // Make sure it is always enabled for free version
184
  $this->options->emailsAllowed = true;
185
  if (defined('WPSTGPRO_VERSION')) {
186
+ $this->options->emailsAllowed = isset($_POST['emailsAllowed']) && $this->sanitize->sanitizeBool($_POST['emailsAllowed']);
187
  }
188
 
189
  $this->options->cloneDir = $this->options->existingClones[$this->options->clone]['path'];
213
  // Exclude Glob Rules
214
  $this->options->excludeGlobRules = [];
215
  if (!empty($_POST["excludeGlobRules"])) {
216
+ $this->options->excludeGlobRules = $this->sanitize->sanitizeExcludeRules($_POST["excludeGlobRules"]);
217
  }
218
 
219
  $this->options->excludeSizeRules = [];
220
  if (!empty($_POST["excludeSizeRules"])) {
221
+ $this->options->excludeSizeRules = $this->sanitize->sanitizeExcludeRules($_POST["excludeSizeRules"]);
222
  }
223
 
224
  // Excluded Directories
225
+ $excludedDirectoriesRequest = isset($_POST["excludedDirectories"]) ? $this->sanitize->sanitizeString($_POST["excludedDirectories"]) : '';
226
  $excludedDirectoriesRequest = $this->dirUtils->getExcludedDirectories($excludedDirectoriesRequest);
227
  $this->options->excludedDirectories = array_merge($this->options->excludedDirectories, $excludedDirectoriesRequest);
228
  // Extra Directories
229
  if (isset($_POST["extraDirectories"])) {
230
+ $this->options->extraDirectories = explode(ScanConst::DIRECTORIES_SEPARATOR, $this->sanitize->sanitizeString($_POST["extraDirectories"]));
231
  }
232
 
233
  // delete uploads folder before copying if uploads is not symlinked
234
+ $this->options->deleteUploadsFolder = !$this->options->uploadsSymlinked && isset($_POST['cleanUploadsDir']) && $this->sanitize->sanitizeBool($_POST['cleanUploadsDir']);
235
  // should not backup uploads during update process
236
  $this->options->backupUploadsFolder = false;
237
  // clean plugins and themes dir before updating
238
+ $this->options->deletePluginsAndThemes = isset($_POST['cleanPluginsThemes']) && $this->sanitize->sanitizeBool($_POST['cleanPluginsThemes']);
239
  // set default statuses for backup of uploads dir and cleaning of uploads, themes and plugins dirs
240
  $this->options->statusBackupUploadsDir = 'skipped';
241
  $this->options->statusContentCleaner = 'pending';
244
  private function setTablesForUpdateJob()
245
  {
246
  // Included Tables / Prefixed Table - Excluded Tables
247
+ $includedTables = isset($_POST['includedTables']) ? $this->sanitize->sanitizeString($_POST['includedTables']) : '';
248
+ $excludedTables = isset($_POST['excludedTables']) ? $this->sanitize->sanitizeString($_POST['excludedTables']) : '';
249
+ $selectedTablesWithoutPrefix = isset($_POST['selectedTablesWithoutPrefix']) ? $this->sanitize->sanitizeString($_POST['selectedTablesWithoutPrefix']) : '';
250
+ $selectedTables = new SelectedTables($includedTables, $excludedTables, $selectedTablesWithoutPrefix);
251
+ $selectedTables->setAllTablesExcluded(empty($_POST['allTablesExcluded']) ? false : $this->sanitize->sanitizeBool($_POST['allTablesExcluded']));
252
  $this->options->tables = $selectedTables->getSelectedTables($this->options->networkClone);
253
  }
254
 
Backend/Modules/SystemInfo.php CHANGED
@@ -6,6 +6,7 @@ use WPStaging\Core\Utils\Browser;
6
  use WPStaging\Core\WPStaging;
7
  use WPStaging\Core\Utils;
8
  use WPStaging\Core\Utils\Multisite;
 
9
  use WPStaging\Framework\Staging\Sites;
10
  use WPStaging\Framework\SiteInfo;
11
 
@@ -436,7 +437,7 @@ class SystemInfo
436
 
437
  $output .= $this->info("PHP Version:", PHP_VERSION);
438
  $output .= $this->info("MySQL Version:", WPStaging::getInstance()->get("wpdb")->db_version());
439
- $output .= $this->info("Webserver Info:", $_SERVER["SERVER_SOFTWARE"]);
440
 
441
  return apply_filters("wpstg_sysinfo_after_webserver_config", $output);
442
  }
6
  use WPStaging\Core\WPStaging;
7
  use WPStaging\Core\Utils;
8
  use WPStaging\Core\Utils\Multisite;
9
+ use WPStaging\Framework\Facades\Sanitize;
10
  use WPStaging\Framework\Staging\Sites;
11
  use WPStaging\Framework\SiteInfo;
12
 
437
 
438
  $output .= $this->info("PHP Version:", PHP_VERSION);
439
  $output .= $this->info("MySQL Version:", WPStaging::getInstance()->get("wpdb")->db_version());
440
+ $output .= $this->info("Webserver Info:", isset($_SERVER["SERVER_SOFTWARE"]) ? Sanitize::sanitizeString($_SERVER["SERVER_SOFTWARE"]) : '');
441
 
442
  return apply_filters("wpstg_sysinfo_after_webserver_config", $output);
443
  }
Backend/Notices/Notices.php CHANGED
@@ -21,6 +21,7 @@ use WPStaging\Framework\Staging\FirstRun;
21
  use WPStaging\Framework\Support\ThirdParty\FreemiusScript;
22
  use WPStaging\Framework\Support\ThirdParty\Jetpack;
23
  use WPStaging\Framework\Support\ThirdParty\WordFence;
 
24
 
25
  /**
26
  * Class Notices
@@ -40,6 +41,9 @@ class Notices
40
  */
41
  private $assets;
42
 
 
 
 
43
  //** For testing all notices */
44
  const SHOW_ALL_NOTICES = false;
45
 
@@ -48,9 +52,10 @@ class Notices
48
  */
49
  public static $directoryListingErrors = 'directoryListingErrors';
50
 
51
- public function __construct(Assets $assets)
52
  {
53
  $this->assets = $assets;
 
54
  }
55
 
56
  /**
@@ -59,7 +64,7 @@ class Notices
59
  */
60
  public function isAdminPage()
61
  {
62
- $currentPage = (isset($_GET["page"])) ? $_GET["page"] : null;
63
 
64
  $availablePages = [
65
  "wpstg-settings", "wpstg-addons", "wpstg-tools", "wpstg-clone", "wpstg_clone", "wpstg_backup"
@@ -383,6 +388,8 @@ class Notices
383
  * @param string $wpstgNotice
384
  * @param string $cssClassSelectorDismiss
385
  * @param string $cssClassSelectorNotice
 
 
386
  */
387
  public static function renderNoticeDismissAction($viewsNoticesPath, $wpstgNotice, $cssClassSelectorDismiss, $cssClassSelectorNotice)
388
  {
21
  use WPStaging\Framework\Support\ThirdParty\FreemiusScript;
22
  use WPStaging\Framework\Support\ThirdParty\Jetpack;
23
  use WPStaging\Framework\Support\ThirdParty\WordFence;
24
+ use WPStaging\Framework\Utils\Sanitize;
25
 
26
  /**
27
  * Class Notices
41
  */
42
  private $assets;
43
 
44
+ /** @var Sanitize */
45
+ private $sanitize;
46
+
47
  //** For testing all notices */
48
  const SHOW_ALL_NOTICES = false;
49
 
52
  */
53
  public static $directoryListingErrors = 'directoryListingErrors';
54
 
55
+ public function __construct(Assets $assets, Sanitize $sanitize)
56
  {
57
  $this->assets = $assets;
58
+ $this->sanitize = $sanitize;
59
  }
60
 
61
  /**
64
  */
65
  public function isAdminPage()
66
  {
67
+ $currentPage = (isset($_GET["page"])) ? $this->sanitize->sanitizeString($_GET["page"]) : null;
68
 
69
  $availablePages = [
70
  "wpstg-settings", "wpstg-addons", "wpstg-tools", "wpstg-clone", "wpstg_clone", "wpstg_backup"
388
  * @param string $wpstgNotice
389
  * @param string $cssClassSelectorDismiss
390
  * @param string $cssClassSelectorNotice
391
+ *
392
+ * @todo Convert to Facade for testability?
393
  */
394
  public static function renderNoticeDismissAction($viewsNoticesPath, $wpstgNotice, $cssClassSelectorDismiss, $cssClassSelectorNotice)
395
  {
Backend/Optimizer/wp-staging-optimizer.php CHANGED
@@ -188,8 +188,8 @@ function wpstgIsOptimizerRequest()
188
  defined('DOING_AJAX') &&
189
  DOING_AJAX &&
190
  isset($_REQUEST['action']) &&
191
- strpos($_REQUEST['action'], 'wpstg_send_report') === false &&
192
- strpos($_REQUEST['action'], 'wpstg') === 0
193
  ) {
194
  return true;
195
  }
@@ -211,7 +211,7 @@ function wpstgTgmpaCompatibility()
211
  $remove_function = true;
212
  }
213
  // run on wpstg ajax requests
214
- if (defined('DOING_AJAX') && DOING_AJAX && isset($_POST['action']) && strpos($_POST['action'], 'wpstg') !== false) {
215
  $remove_function = true;
216
  }
217
 
188
  defined('DOING_AJAX') &&
189
  DOING_AJAX &&
190
  isset($_REQUEST['action']) &&
191
+ strpos(sanitize_text_field($_REQUEST['action']), 'wpstg_send_report') === false &&
192
+ strpos(sanitize_text_field($_REQUEST['action']), 'wpstg') === 0
193
  ) {
194
  return true;
195
  }
211
  $remove_function = true;
212
  }
213
  // run on wpstg ajax requests
214
+ if (defined('DOING_AJAX') && DOING_AJAX && isset($_POST['action']) && strpos(sanitize_text_field($_POST['action']), 'wpstg') !== false) {
215
  $remove_function = true;
216
  }
217
 
Backend/views/_main/footer.php CHANGED
@@ -2,35 +2,35 @@
2
  <div id="wpstg-error-details"></div>
3
  </div>
4
  <div id='wpstg-footer'>
5
- <strong class="wpstg-footer--title"><?php _e("Knowledgebase", "wp-staging") ?></strong>
6
  <ul>
7
- <li><a href="https://wp-staging.com/docs/how-to-migrate-your-wordpress-site-to-a-new-host/" target="_blank" rel="external"><?php _e("Migrate Website to Another Server or Domain", "wp-staging") ?></a></li>
8
- <li><a href="https://wp-staging.com/docs/staging-site-redirects-live-site/" target="_blank" rel="external"><?php _e("Can not login to staging site", "wp-staging") ?></a></li>
9
- <li><a href="https://wp-staging.com/docs/staging-site-redirects-live-site/" target="_blank" rel="external"><?php _e("Staging site redirects to production site", "wp-staging") ?></a></li>
10
- <li><a href="https://wp-staging.com/docs/fix-white-or-blank-page-after-pushing-fatal-error-500/" target="_blank" rel="external"><?php _e("Staging site returns blank white page", "wp-staging") ?></a></li>
11
- <li><a href="https://wp-staging.com/docs/css-layout-broken-after-push/" target="_blank" rel="external"><?php _e("CSS & layout broken after push", "wp-staging") ?></a></li>
12
- <li><a href="https://wp-staging.com/docs/skip-woocommerce-orders-and-products/" target="_blank" rel="external"><?php _e("Skip WooCommerce Orders and Products", "wp-staging") ?></a></li>
13
- <li><a href="https://wp-staging.com/docs/can-not-update-wp-staging-staging-site/" target="_blank" rel="external"><?php _e("Can not update WP STAGING plugin", "wp-staging") ?></a></li>
14
- <li><a href="https://wp-staging.com/docs/page-not-found-error-404-after-pushing/" target="_blank" rel="external"><?php _e("Page not found – Error 404 after Pushing", "wp-staging") ?></a></li>
15
- <li><a href="https://wp-staging.com/docs/pagebuilders-do-not-work/" target="_blank" rel="external"><?php _e("Pagebuilders like DIVI or Elementor do not work", "wp-staging") ?></a></li>
16
- <li><a href="https://wp-staging.com/docs/troubleshooting-try-this-first/" target="_blank" rel="external"><?php _e("All articles", "wp-staging") ?></a></li>
17
  </ul>
18
  <br>
19
- <?php echo __('Still questions?', 'wp-staging'); ?><br>
20
- <?php echo sprintf(__('Open a <a href="%s" target="_blank" rel="external nofollow">support ticket</a> and get in contact with us.', 'wp-staging'), 'https://wp-staging.com/support'); ?>
21
  </div>
22
  <div class='wpstg-share-button-container'>
23
  <div class='wpstg-share-button wpstg-share-button-twitter' data-share-url="https://wordpress.org/plugins/wp-staging">
24
  <div class='box'>
25
  <a href="https://twitter.com/intent/tweet?button_hashtag=wpstaging&text=Check%20out%20this%20plugin%20for%20creating%20a%20one-click%20WordPress%20testing%20site&via=wpstg" target='_blank'>
26
- <span class='wpstg-share'><?php echo __('Tweet #wpstaging', 'wp-staging'); ?></span>
27
  </a>
28
  </div>
29
  </div>
30
  <div class="wpstg-share-button wpstg-share-button-twitter">
31
  <div class="box">
32
  <a href="https://twitter.com/intent/follow?original_referer=http%3A%2F%2Fsrc.wordpress-develop.dev%2Fwp-admin%2Fadmin.php%3Fpage%3Dwpstg-settings&ref_src=twsrc%5Etfw&region=follow_link&screen_name=wpstg&tw_p=followbutton" target="_blank">
33
- <span class='wpstg-share'><?php echo __('Follow @wpstg', 'wp-staging'); ?></span>
34
  </a>
35
  </div>
36
  </div>
2
  <div id="wpstg-error-details"></div>
3
  </div>
4
  <div id='wpstg-footer'>
5
+ <strong class="wpstg-footer--title"><?php esc_html_e("Knowledgebase", "wp-staging") ?></strong>
6
  <ul>
7
+ <li><a href="https://wp-staging.com/docs/how-to-migrate-your-wordpress-site-to-a-new-host/" target="_blank" rel="external"><?php esc_html_e("Migrate Website to Another Server or Domain", "wp-staging") ?></a></li>
8
+ <li><a href="https://wp-staging.com/docs/staging-site-redirects-live-site/" target="_blank" rel="external"><?php esc_html_e("Can not login to staging site", "wp-staging") ?></a></li>
9
+ <li><a href="https://wp-staging.com/docs/staging-site-redirects-live-site/" target="_blank" rel="external"><?php esc_html_e("Staging site redirects to production site", "wp-staging") ?></a></li>
10
+ <li><a href="https://wp-staging.com/docs/fix-white-or-blank-page-after-pushing-fatal-error-500/" target="_blank" rel="external"><?php esc_html_e("Staging site returns blank white page", "wp-staging") ?></a></li>
11
+ <li><a href="https://wp-staging.com/docs/css-layout-broken-after-push/" target="_blank" rel="external"><?php esc_html_e("CSS & layout broken after push", "wp-staging") ?></a></li>
12
+ <li><a href="https://wp-staging.com/docs/skip-woocommerce-orders-and-products/" target="_blank" rel="external"><?php esc_html_e("Skip WooCommerce Orders and Products", "wp-staging") ?></a></li>
13
+ <li><a href="https://wp-staging.com/docs/can-not-update-wp-staging-staging-site/" target="_blank" rel="external"><?php esc_html_e("Can not update WP STAGING plugin", "wp-staging") ?></a></li>
14
+ <li><a href="https://wp-staging.com/docs/page-not-found-error-404-after-pushing/" target="_blank" rel="external"><?php esc_html_e("Page not found – Error 404 after Pushing", "wp-staging") ?></a></li>
15
+ <li><a href="https://wp-staging.com/docs/pagebuilders-do-not-work/" target="_blank" rel="external"><?php esc_html_e("Pagebuilders like DIVI or Elementor do not work", "wp-staging") ?></a></li>
16
+ <li><a href="https://wp-staging.com/docs/troubleshooting-try-this-first/" target="_blank" rel="external"><?php esc_html_e("All articles", "wp-staging") ?></a></li>
17
  </ul>
18
  <br>
19
+ <?php esc_html_e('Still questions?', 'wp-staging'); ?><br>
20
+ <?php echo wp_kses_post(sprintf(__('Open a <a href="%s" target="_blank" rel="external nofollow">support ticket</a> and get in contact with us.', 'wp-staging'), 'https://wp-staging.com/support')); ?>
21
  </div>
22
  <div class='wpstg-share-button-container'>
23
  <div class='wpstg-share-button wpstg-share-button-twitter' data-share-url="https://wordpress.org/plugins/wp-staging">
24
  <div class='box'>
25
  <a href="https://twitter.com/intent/tweet?button_hashtag=wpstaging&text=Check%20out%20this%20plugin%20for%20creating%20a%20one-click%20WordPress%20testing%20site&via=wpstg" target='_blank'>
26
+ <span class='wpstg-share'><?php esc_html_e('Tweet #wpstaging', 'wp-staging'); ?></span>
27
  </a>
28
  </div>
29
  </div>
30
  <div class="wpstg-share-button wpstg-share-button-twitter">
31
  <div class="box">
32
  <a href="https://twitter.com/intent/follow?original_referer=http%3A%2F%2Fsrc.wordpress-develop.dev%2Fwp-admin%2Fadmin.php%3Fpage%3Dwpstg-settings&ref_src=twsrc%5Etfw&region=follow_link&screen_name=wpstg&tw_p=followbutton" target="_blank">
33
+ <span class='wpstg-share'><?php esc_html_e('Follow @wpstg', 'wp-staging'); ?></span>
34
  </a>
35
  </div>
36
  </div>
Backend/views/_main/header.php CHANGED
@@ -2,17 +2,17 @@
2
 
3
  <div>
4
  <span class="wpstg-logo">
5
- <img src="<?php echo $this->assets->getAssetsUrl("img/logo.svg") ?>" width="212">
6
  </span>
7
 
8
  <span class="wpstg-version">
9
  <?php if (defined('WPSTGPRO_VERSION')) {
10
  echo "PRO";
11
- } ?> v. <?php echo WPStaging\Core\WPStaging::getVersion() ?>
12
  </span>
13
  </div>
14
  <div class="wpstg-header">
15
- <?php if ($_GET['page'] === 'wpstg_clone') { ?>
16
  <?php
17
  $latestReleasedVersion = get_option('wpstg_version_latest');
18
  $display = 'none;';
@@ -26,7 +26,7 @@
26
  }
27
  ?>
28
 
29
- <div id="wpstg-update-notify" style="display:<?php echo $display; ?>">
30
  <strong><?php echo sprintf(__("New: WP STAGING PRO v. %s is available.", 'wp-staging'), esc_html($latestReleasedVersion)); ?></strong><br/>
31
  <?php echo sprintf(__('Important: Please update the plugin before pushing the staging site to production site. <a href="%s" target="_blank">What\'s New?</a>', 'wp-staging'), 'https://wp-staging.com/wp-staging-pro-changelog'); ?>
32
  </div>
2
 
3
  <div>
4
  <span class="wpstg-logo">
5
+ <img src="<?php echo esc_url($this->assets->getAssetsUrl("img/logo.svg")) ?>" width="212">
6
  </span>
7
 
8
  <span class="wpstg-version">
9
  <?php if (defined('WPSTGPRO_VERSION')) {
10
  echo "PRO";
11
+ } ?> v. <?php echo esc_html(WPStaging\Core\WPStaging::getVersion()) ?>
12
  </span>
13
  </div>
14
  <div class="wpstg-header">
15
+ <?php if (isset($_GET['page']) && $_GET['page'] === 'wpstg_clone') { ?>
16
  <?php
17
  $latestReleasedVersion = get_option('wpstg_version_latest');
18
  $display = 'none;';
26
  }
27
  ?>
28
 
29
+ <div id="wpstg-update-notify" style="display:<?php echo esc_attr($display); ?>">
30
  <strong><?php echo sprintf(__("New: WP STAGING PRO v. %s is available.", 'wp-staging'), esc_html($latestReleasedVersion)); ?></strong><br/>
31
  <?php echo sprintf(__('Important: Please update the plugin before pushing the staging site to production site. <a href="%s" target="_blank">What\'s New?</a>', 'wp-staging'), 'https://wp-staging.com/wp-staging-pro-changelog'); ?>
32
  </div>
Backend/views/_main/report-issue.php CHANGED
@@ -12,22 +12,22 @@
12
  <div class="wpstg-field wpstg-report-privacy-policy">
13
  <label for="wpstg-report-syslog">
14
  <input type="checkbox" class="wpstg-report-syslog" id="wpstg-report-syslog">
15
- <?php echo sprintf(
16
  __('Optional: Submit the <a href="%s" target="_blank">System Log</a> and your WordPress debug log. This helps us to resolve your technical issues.', 'wp-staging'),
17
- admin_url() . 'admin.php?page=wpstg-tools&tab=system_info'
18
- ); ?>
19
  </label>
20
  </div>
21
  <div class="wpstg-field wpstg-report-privacy-policy">
22
  <label for="wpstg-report-terms">
23
  <input type="checkbox" class="wpstg-report-terms" id="wpstg-report-terms">
24
- <?php _e('By submitting, I accept the <a href="https://wp-staging.com/privacy-policy/" target="_blank">Privacy Policy</a> and consent that my email will be stored and processed for the purposes of proving support.', 'wp-staging'); ?>
25
  </label>
26
  </div>
27
  <div class="wpstg-field">
28
  <div class="wpstg-buttons">
29
  <button type="submit" id="wpstg-report-submit" class="wpstg-form-submit button-primary wpstg-button">
30
- <?php _e('Submit', 'wp-staging'); ?>
31
  </button>
32
  <span class="spinner"></span>
33
  <a href="#" id="wpstg-report-cancel" class="wpstg-report-cancel wpstg--red">CLOSE [X]</a>
12
  <div class="wpstg-field wpstg-report-privacy-policy">
13
  <label for="wpstg-report-syslog">
14
  <input type="checkbox" class="wpstg-report-syslog" id="wpstg-report-syslog">
15
+ <?php echo wp_kses_post(sprintf(
16
  __('Optional: Submit the <a href="%s" target="_blank">System Log</a> and your WordPress debug log. This helps us to resolve your technical issues.', 'wp-staging'),
17
+ esc_url(admin_url()) . 'admin.php?page=wpstg-tools&tab=system_info'
18
+ )); ?>
19
  </label>
20
  </div>
21
  <div class="wpstg-field wpstg-report-privacy-policy">
22
  <label for="wpstg-report-terms">
23
  <input type="checkbox" class="wpstg-report-terms" id="wpstg-report-terms">
24
+ <?php echo sprintf(esc_html__('By submitting, I accept the %s and consent that my email will be stored and processed for the purposes of proving support.', 'wp-staging'), '<a href="https://wp-staging.com/privacy-policy/" target="_blank">' . esc_html__('Privacy Policy', 'wp-staging') . '</a>'); ?>
25
  </label>
26
  </div>
27
  <div class="wpstg-field">
28
  <div class="wpstg-buttons">
29
  <button type="submit" id="wpstg-report-submit" class="wpstg-form-submit button-primary wpstg-button">
30
+ <?php esc_html_e('Submit', 'wp-staging'); ?>
31
  </button>
32
  <span class="spinner"></span>
33
  <a href="#" id="wpstg-report-cancel" class="wpstg-report-cancel wpstg--red">CLOSE [X]</a>
Backend/views/backup/free-version.php CHANGED
@@ -10,7 +10,7 @@
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><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"><?php esc_html_e('Get Started', 'wp-staging'); ?></a></p>
14
  </li>
15
  </ul>
16
  </div>
Backend/views/backup/listing-backups-no-results.php CHANGED
@@ -1,18 +1,27 @@
1
  <?php
 
2
  /**
3
  * @var WPStaging\Framework\TemplateEngine\TemplateEngine $this
4
  * @var string $urlAssets
5
  * @var string $isValidLicenseKey
6
  * @see \WPStaging\Pro\Backup\Ajax\FileList::render()
7
  */
 
 
 
8
  ?>
9
  <li id="wpstg-backup-no-results" class="wpstg-clone">
10
- <img class="wpstg--dashicons" src="<?php echo $urlAssets; ?>svg/vendor/dashicons/cloud.svg" alt="cloud">
11
  <div class="no-backups-found-text">
12
  <?php if ($isValidLicenseKey) : ?>
13
- <?php _e('No Backups found. Create your first Backup above!', 'wp-staging'); ?>
14
  <?php else :?>
15
- <strong id="wpstg-invalid-license-message" class="wpstg--red"><?php echo sprintf(__('Please<a href="%s">enter your license key</a> to create and restore your backup files.', 'wp-staging'), admin_url() . 'admin.php?page=wpstg-license'); ?></strong>
 
 
 
 
 
16
  <?php endif; ?>
17
  </div>
18
  </li>
1
  <?php
2
+
3
  /**
4
  * @var WPStaging\Framework\TemplateEngine\TemplateEngine $this
5
  * @var string $urlAssets
6
  * @var string $isValidLicenseKey
7
  * @see \WPStaging\Pro\Backup\Ajax\FileList::render()
8
  */
9
+
10
+ use WPStaging\Framework\Facades\Escape;
11
+
12
  ?>
13
  <li id="wpstg-backup-no-results" class="wpstg-clone">
14
+ <img class="wpstg--dashicons" src="<?php echo esc_url($urlAssets); ?>svg/vendor/dashicons/cloud.svg" alt="cloud">
15
  <div class="no-backups-found-text">
16
  <?php if ($isValidLicenseKey) : ?>
17
+ <?php esc_html_e('No Backups found. Create your first Backup above!', 'wp-staging'); ?>
18
  <?php else :?>
19
+ <strong id="wpstg-invalid-license-message" class="wpstg--red">
20
+ <?php echo sprintf(
21
+ Escape::escapeHtml(__('Please<a href="%s">enter your license key</a> to create and restore your backup files.', 'wp-staging')),
22
+ esc_url(admin_url() . 'admin.php?page=wpstg-license')
23
+ ); ?>
24
+ </strong>
25
  <?php endif; ?>
26
  </div>
27
  </li>
Backend/views/backup/listing-single-backup.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
 
 
3
  use WPStaging\Pro\Backup\Task\Tasks\JobImport\RestoreRequirementsCheckTask;
4
 
5
  /**
@@ -38,13 +39,13 @@ if (defined('WPSTG_DOWNLOAD_BACKUP_USING_PHP') && WPSTG_DOWNLOAD_BACKUP_USING_PH
38
  </span>
39
  <?php if (!$corrupt) : ?>
40
  <div class="wpstg-clone-labels">
41
- <span class="wpstg-clone-label"><?php echo $backup->type === 'single' ? __('Single Site', 'wp-staging') : __('Multisite', 'wp-staging') ?></span>
42
  </div>
43
  <?php endif ?>
44
  <div class="wpstg-clone-actions">
45
  <div class="wpstg-dropdown wpstg-action-dropdown">
46
  <a href="#" class="wpstg-dropdown-toggler transparent">
47
- <?php _e("Actions", "wp-staging"); ?>
48
  <span class="wpstg-caret"></span>
49
  </a>
50
  <div class="wpstg-dropdown-menu">
@@ -109,7 +110,7 @@ if (defined('WPSTG_DOWNLOAD_BACKUP_USING_PHP') && WPSTG_DOWNLOAD_BACKUP_USING_PH
109
  <li>
110
  <strong><?php esc_html_e('Notes:', 'wp-staging') ?></strong><br/>
111
  <div class="backup-notes">
112
- <?php echo nl2br(esc_html($notes)); ?>
113
  </div>
114
  </li>
115
  <?php endif ?>
@@ -132,12 +133,12 @@ if (defined('WPSTG_DOWNLOAD_BACKUP_USING_PHP') && WPSTG_DOWNLOAD_BACKUP_USING_PH
132
  </li>
133
  <?php if ($automatedBackup) : ?>
134
  <li style="font-style: italic">
135
- <img class="wpstg--dashicons wpstg-dashicons-19 wpstg-dashicons-grey wpstg--backup-automated" src="<?php echo $urlAssets; ?>svg/vendor/dashicons/update.svg" /> <?php esc_html_e('Backup created automatically.', 'wp-staging') ?>
136
  </li>
137
  <?php endif ?>
138
  <?php if ($legacy) : ?>
139
  <li style="font-style: italic">
140
- <img class="wpstg--dashicons wpstg-dashicons-19 wpstg-dashicons-grey" src="<?php echo $urlAssets; ?>svg/vendor/dashicons/cloud-saved.svg" /> <?php esc_html_e('This database backup was generated from an existing legacy WP STAGING Database export in the .SQL format.', 'wp-staging') ?>
141
  </li>
142
  <?php endif ?>
143
  <?php endif ?>
1
  <?php
2
 
3
+ use WPStaging\Framework\Facades\Escape;
4
  use WPStaging\Pro\Backup\Task\Tasks\JobImport\RestoreRequirementsCheckTask;
5
 
6
  /**
39
  </span>
40
  <?php if (!$corrupt) : ?>
41
  <div class="wpstg-clone-labels">
42
+ <span class="wpstg-clone-label"><?php echo $backup->type === 'single' ? esc_html__('Single Site', 'wp-staging') : esc_html__('Multisite', 'wp-staging') ?></span>
43
  </div>
44
  <?php endif ?>
45
  <div class="wpstg-clone-actions">
46
  <div class="wpstg-dropdown wpstg-action-dropdown">
47
  <a href="#" class="wpstg-dropdown-toggler transparent">
48
+ <?php esc_html_e("Actions", "wp-staging"); ?>
49
  <span class="wpstg-caret"></span>
50
  </a>
51
  <div class="wpstg-dropdown-menu">
110
  <li>
111
  <strong><?php esc_html_e('Notes:', 'wp-staging') ?></strong><br/>
112
  <div class="backup-notes">
113
+ <?php echo Escape::escapeHtml(__(nl2br($notes, 'wp-staging'))); ?>
114
  </div>
115
  </li>
116
  <?php endif ?>
133
  </li>
134
  <?php if ($automatedBackup) : ?>
135
  <li style="font-style: italic">
136
+ <img class="wpstg--dashicons wpstg-dashicons-19 wpstg-dashicons-grey wpstg--backup-automated" src="<?php echo esc_url($urlAssets); ?>svg/vendor/dashicons/update.svg" /> <?php esc_html_e('Backup created automatically.', 'wp-staging') ?>
137
  </li>
138
  <?php endif ?>
139
  <?php if ($legacy) : ?>
140
  <li style="font-style: italic">
141
+ <img class="wpstg--dashicons wpstg-dashicons-19 wpstg-dashicons-grey" src="<?php echo esc_url($urlAssets); ?>svg/vendor/dashicons/cloud-saved.svg" /> <?php esc_html_e('This database backup was generated from an existing legacy WP STAGING Database export in the .SQL format.', 'wp-staging') ?>
142
  </li>
143
  <?php endif ?>
144
  <?php endif ?>
Backend/views/backup/listing.php CHANGED
@@ -3,6 +3,7 @@
3
  use WPStaging\Core\WPStaging;
4
  use WPStaging\Framework\TemplateEngine\TemplateEngine;
5
  use WPStaging\Framework\Adapter\Directory;
 
6
  use WPStaging\Pro\Backup\Ajax\ScheduleList;
7
  use WPStaging\Pro\Backup\BackupProcessLock;
8
  use WPStaging\Pro\Backup\BackupScheduler;
@@ -40,33 +41,36 @@ $cronMessage = $backupScheduler->getCronMessage();
40
  if ($cronMessage !== '') { ?>
41
  <div class="notice <?php echo $cronStatus === true ? 'notice-warning' : 'notice-error'; ?>" style="margin-bottom: 10px;">
42
  <p><strong><?php esc_html_e('WP STAGING:', 'wp-staging') ?></strong></p>
43
- <p><?php echo $cronMessage; ?></p>
44
  </div>
45
  <?php } ?>
46
 
47
  <?php if ($isLocked) : ?>
48
  <div id="wpstg-backup-locked">
49
- <div class="icon"><img width="20" src="<?php echo WPSTG_PLUGIN_URL . "assets/img/wpstaging-icon.png"; ?>"></div>
50
  <div class="text"><?php esc_html_e('There is a backup work in progress...', 'wp-staging'); ?></div>
51
  </div>
52
  <?php endif; ?>
53
  <div id="wpstg-did-you-know" style="margin-bottom:12px">
54
- <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>
 
 
 
55
  </div>
56
 
57
  <div id="wpstg-step-1">
58
- <button id="wpstg-new-backup" class="wpstg-next-step-link wpstg-blue-primary wpstg-button" <?php echo $disabledProperty; ?> <?php echo $disabledPropertyCreateBackup ?>>
59
  <?php esc_html_e('Create New Backup', 'wp-staging') ?>
60
  </button>
61
- <button id="wpstg-upload-backup" class="wpstg-next-step-link wpstg-blue-primary wpstg-button wpstg-ml-4" <?php echo $disabledProperty ?>>
62
  <?php esc_html_e('Upload Backup', 'wp-staging') ?>
63
  </button>
64
- <button id="wpstg-manage-backup-schedules" class="wpstg-next-step-link wpstg-blue-primary wpstg-button wpstg-ml-4" <?php echo $disabledProperty ?>>
65
  <?php esc_html_e('Edit Backup Plans', 'wp-staging') ?>
66
  </button>
67
  <div id="wpstg-report-issue-wrapper">
68
  <button type="button" id="wpstg-report-issue-button" class="wpstg-button">
69
- <i class="wpstg-icon-issue"></i><?php echo __("Report Issue", "wp-staging"); ?>
70
  </button>
71
  <?php require_once($this->views . '_main/report-issue.php'); ?>
72
  </div>
@@ -80,7 +84,7 @@ if ($cronMessage !== '') { ?>
80
  <div id="backup-messages"></div>
81
  <div class="wpstg-backup-list">
82
  <ul>
83
- <li><?php _e('Searching for existing backups...', 'wp-staging') ?></li>
84
  </ul>
85
  </div>
86
  </div>
3
  use WPStaging\Core\WPStaging;
4
  use WPStaging\Framework\TemplateEngine\TemplateEngine;
5
  use WPStaging\Framework\Adapter\Directory;
6
+ use WPStaging\Framework\Facades\Escape;
7
  use WPStaging\Pro\Backup\Ajax\ScheduleList;
8
  use WPStaging\Pro\Backup\BackupProcessLock;
9
  use WPStaging\Pro\Backup\BackupScheduler;
41
  if ($cronMessage !== '') { ?>
42
  <div class="notice <?php echo $cronStatus === true ? 'notice-warning' : 'notice-error'; ?>" style="margin-bottom: 10px;">
43
  <p><strong><?php esc_html_e('WP STAGING:', 'wp-staging') ?></strong></p>
44
+ <p><?php echo Escape::escapeHtml(__($cronMessage, 'wp-staging')); ?></p>
45
  </div>
46
  <?php } ?>
47
 
48
  <?php if ($isLocked) : ?>
49
  <div id="wpstg-backup-locked">
50
+ <div class="icon"><img width="20" src="<?php echo esc_url(WPSTG_PLUGIN_URL . "assets/img/wpstaging-icon.png"); ?>"></div>
51
  <div class="text"><?php esc_html_e('There is a backup work in progress...', 'wp-staging'); ?></div>
52
  </div>
53
  <?php endif; ?>
54
  <div id="wpstg-did-you-know" style="margin-bottom:12px">
55
+ <strong><?php echo sprintf(
56
+ Escape::escapeHtml(__('Did you know? You can upload backup files to another website to transfer it. <a href="%s" target="_blank">Read more</a>', 'wp-staging')),
57
+ 'https://wp-staging.com/docs/how-to-migrate-your-wordpress-site-to-a-new-host/'
58
+ ); ?></strong>
59
  </div>
60
 
61
  <div id="wpstg-step-1">
62
+ <button id="wpstg-new-backup" class="wpstg-next-step-link wpstg-blue-primary wpstg-button" <?php echo esc_attr($disabledProperty); ?> <?php echo esc_attr($disabledPropertyCreateBackup) ?>>
63
  <?php esc_html_e('Create New Backup', 'wp-staging') ?>
64
  </button>
65
+ <button id="wpstg-upload-backup" class="wpstg-next-step-link wpstg-blue-primary wpstg-button wpstg-ml-4" <?php echo esc_attr($disabledProperty) ?>>
66
  <?php esc_html_e('Upload Backup', 'wp-staging') ?>
67
  </button>
68
+ <button id="wpstg-manage-backup-schedules" class="wpstg-next-step-link wpstg-blue-primary wpstg-button wpstg-ml-4" <?php echo esc_attr($disabledProperty) ?>>
69
  <?php esc_html_e('Edit Backup Plans', 'wp-staging') ?>
70
  </button>
71
  <div id="wpstg-report-issue-wrapper">
72
  <button type="button" id="wpstg-report-issue-button" class="wpstg-button">
73
+ <i class="wpstg-icon-issue"></i><?php echo esc_html__("Report Issue", "wp-staging"); ?>
74
  </button>
75
  <?php require_once($this->views . '_main/report-issue.php'); ?>
76
  </div>
84
  <div id="backup-messages"></div>
85
  <div class="wpstg-backup-list">
86
  <ul>
87
+ <li><?php esc_html_e('Searching for existing backups...', 'wp-staging') ?></li>
88
  </ul>
89
  </div>
90
  </div>
Backend/views/backup/modal/confirm-restore.php CHANGED
@@ -20,33 +20,33 @@ $isDatabaseOnlyBackup = $info->getIsExportingDatabase()
20
  ?>
21
  <div id="wpstg-confirm-backup-restore-wrapper">
22
  <div class="wpstg-confirm-backup-restore-header">
23
- <h3 class="wpstg--swal2-title" style="text-align: center;"><?php _e('This will restore your website! </br> Are you sure?', 'wp-staging'); ?></h3>
24
  </div>
25
  <div id="wpstg-confirm-backup-restore-data">
26
  <ul>
27
  <?php if ($info->getIsExportingDatabase()) : ?>
28
- <li style="list-style-type: square;"><?php _e('Database will be replaced.', 'wp-staging'); ?></li>
29
  <?php endif; ?>
30
  <?php if ($info->getIsExportingPlugins()) : ?>
31
- <li style="list-style-type: square;"><?php _e('Plugins will be added.', 'wp-staging') ?></li>
32
  <?php endif; ?>
33
  <?php if ($info->getIsExportingThemes()) : ?>
34
- <li style="list-style-type: square;"><?php _e('Themes will be added.', 'wp-staging') ?></li>
35
  <?php endif; ?>
36
  <?php if ($info->getIsExportingMuPlugins()) : ?>
37
- <li style="list-style-type: square;"><?php _e('Mu-plugins will be added.', 'wp-staging') ?></li>
38
  <?php endif; ?>
39
  <?php if ($info->getIsExportingUploads()) : ?>
40
- <li style="list-style-type: square;"><?php _e('Media files and images will be added. ', 'wp-staging') ?></li>
41
  <?php endif; ?>
42
  <?php if ($info->getIsExportingOtherWpContentFiles()) : ?>
43
- <li style="list-style-type: square;"><?php _e('Other files in wp-content folder will be added. ', 'wp-staging') ?></li>
44
  <?php endif; ?>
45
  </ul>
46
  <?php if (!$isDatabaseOnlyBackup && !empty($info->getTotalFiles())) : ?>
47
  <div class="wpstg-db-table" style="margin-top:5px;">
48
- <strong><?php _e('Total Files:', 'wp-staging') ?></strong>
49
- <span class=""><?php echo $info->getTotalFiles() ?></span>
50
  </div>
51
  <?php endif; ?>
52
  <div class="wpstg-db-table" style="margin-top:5px;display:none;">
@@ -55,7 +55,7 @@ $isDatabaseOnlyBackup = $info->getIsExportingDatabase()
55
  $thisVersion = \WPStaging\Core\WPStaging::getVersion();
56
  // Use this in the future if we need to warn the user about compatibility issues between export version and current version.
57
  ?>
58
- <small><?php _e(sprintf('This backup was generated on WP STAGING %s. You are running WP STAGING %s.', $info->getVersion(), \WPStaging\Core\WPStaging::getVersion()), 'wp-staging') ?></small>
59
  </div>
60
  </div>
61
  </div>
20
  ?>
21
  <div id="wpstg-confirm-backup-restore-wrapper">
22
  <div class="wpstg-confirm-backup-restore-header">
23
+ <h3 class="wpstg--swal2-title" style="text-align: center;"><?php echo wp_kses_post(__('This will restore your website! </br> Are you sure?', 'wp-staging')); ?></h3>
24
  </div>
25
  <div id="wpstg-confirm-backup-restore-data">
26
  <ul>
27
  <?php if ($info->getIsExportingDatabase()) : ?>
28
+ <li style="list-style-type: square;"><?php esc_html_e('Database will be replaced.', 'wp-staging'); ?></li>
29
  <?php endif; ?>
30
  <?php if ($info->getIsExportingPlugins()) : ?>
31
+ <li style="list-style-type: square;"><?php esc_html_e('Plugins will be added.', 'wp-staging') ?></li>
32
  <?php endif; ?>
33
  <?php if ($info->getIsExportingThemes()) : ?>
34
+ <li style="list-style-type: square;"><?php esc_html_e('Themes will be added.', 'wp-staging') ?></li>
35
  <?php endif; ?>
36
  <?php if ($info->getIsExportingMuPlugins()) : ?>
37
+ <li style="list-style-type: square;"><?php esc_html_e('Mu-plugins will be added.', 'wp-staging') ?></li>
38
  <?php endif; ?>
39
  <?php if ($info->getIsExportingUploads()) : ?>
40
+ <li style="list-style-type: square;"><?php esc_html_e('Media files and images will be added. ', 'wp-staging') ?></li>
41
  <?php endif; ?>
42
  <?php if ($info->getIsExportingOtherWpContentFiles()) : ?>
43
+ <li style="list-style-type: square;"><?php esc_html_e('Other files in wp-content folder will be added. ', 'wp-staging') ?></li>
44
  <?php endif; ?>
45
  </ul>
46
  <?php if (!$isDatabaseOnlyBackup && !empty($info->getTotalFiles())) : ?>
47
  <div class="wpstg-db-table" style="margin-top:5px;">
48
+ <strong><?php esc_html_e('Total Files:', 'wp-staging') ?></strong>
49
+ <span class=""><?php echo esc_html($info->getTotalFiles()) ?></span>
50
  </div>
51
  <?php endif; ?>
52
  <div class="wpstg-db-table" style="margin-top:5px;display:none;">
55
  $thisVersion = \WPStaging\Core\WPStaging::getVersion();
56
  // Use this in the future if we need to warn the user about compatibility issues between export version and current version.
57
  ?>
58
+ <small><?php echo sprintf(wp_kses_post('This backup was generated on WP STAGING %s. </br> You are running WP STAGING %s.', 'wp-staging'), esc_html($backupGeneratedInVersion), esc_html($thisVersion)) ?></small>
59
  </div>
60
  </div>
61
  </div>
Backend/views/backup/modal/export.php CHANGED
@@ -6,6 +6,7 @@
6
  */
7
 
8
  use WPStaging\Core\Cron\Cron;
 
9
 
10
  $timeFormatOption = get_option('time_format');
11
 
@@ -48,7 +49,7 @@ $recurrenceTimes = $time->range('midnight', 'tomorrow - 1 minutes', $recurInterv
48
  <input type="checkbox" name="includeOtherFilesInWpContent" id="includeOtherFilesInWpContent" value="true" checked/>
49
  <?php esc_html_e('Backup Other Files In wp-content', 'wp-staging') ?>
50
  <div class="wpstg--tooltip" style="position: absolute;">
51
- <img class="wpstg--dashicons wpstg-dashicons-19 wpstg--grey" src="<?php echo $urlAssets; ?>svg/vendor/dashicons/info-outline.svg" alt="info" />
52
  <span class="wpstg--tooltiptext wpstg--tooltiptext-backups">
53
  <?php esc_html_e('All files in folder wp-content that are not plugins, themes, mu-plugins and uploads. Recommended for full-site backups.', 'wp-staging') ?>
54
  </span>
@@ -97,14 +98,17 @@ $recurrenceTimes = $time->range('midnight', 'tomorrow - 1 minutes', $recurInterv
97
  <label for="backupScheduleTime">
98
  <?php esc_html_e('At what time should it start?', 'wp-staging'); ?>
99
  <div class="wpstg--tooltip" style="position: absolute;">
100
- <img class="wpstg--dashicons wpstg-dashicons-19 wpstg--grey" src="<?php echo $urlAssets; ?>svg/vendor/dashicons/info-outline.svg" alt="info" />
101
  <span class="wpstg--tooltiptext wpstg--tooltiptext-backups">
102
- <?php _e(sprintf('Relative to current server time, which you can change in <a href="%s">WordPress Settings</a>.', admin_url('options-general.php#timezone_string'))); ?>
 
 
 
103
  <br>
104
  <br>
105
- <?php _e(sprintf('Current Server Time: %s', (new DateTime('now', $time->getSiteTimezoneObject()))->format($timeFormatOption)), 'wp-staging'); ?>
106
  <br>
107
- <?php _e(sprintf('Site Timezone: %s', $time->getSiteTimezoneString()), 'wp-staging'); ?>
108
  </span>
109
  </div>
110
  </label>
@@ -116,11 +120,11 @@ $recurrenceTimes = $time->range('midnight', 'tomorrow - 1 minutes', $recurInterv
116
  </option>
117
  <?php endforeach; ?>
118
  </select>
119
- <span id="backup-schedule-current-time"><?php _e(sprintf('Current Time: %s', $currentTime), 'wp-staging'); ?></span>
120
  <label for="backupScheduleRotation">
121
  <?php esc_html_e('How many backups to keep?', 'wp-staging'); ?>
122
  <div class="wpstg--tooltip" style="position: absolute;">
123
- <img class="wpstg--dashicons wpstg-dashicons-19 wpstg--grey" src="<?php echo $urlAssets; ?>svg/vendor/dashicons/info-outline.svg" alt="info" />
124
  <span class="wpstg--tooltiptext wpstg--tooltiptext-backups">
125
  <?php esc_html_e('Choose how many backups you want to keep before old ones are deleted to free up disk space.', 'wp-staging') ?>
126
  </span>
@@ -128,7 +132,7 @@ $recurrenceTimes = $time->range('midnight', 'tomorrow - 1 minutes', $recurInterv
128
  </label>
129
  <select name="backupScheduleRotation" id="backupScheduleRotation">
130
  <?php for ($i = 1; $i <= 10; $i++) : ?>
131
- <option value="<?php echo $i ?>">
132
  <?php esc_html_e(sprintf('Keep last %d backup%s', $i, ($i > 1 ? 's' : ''))); ?>
133
  </option>
134
  <?php endfor; ?>
@@ -160,9 +164,9 @@ $recurrenceTimes = $time->range('midnight', 'tomorrow - 1 minutes', $recurInterv
160
  <?php
161
  $isActivated = $storage['activated'];
162
  ?>
163
- <input type="checkbox" name="storages" id="storage-<?php echo $storage['id']?>" value="<?php echo $storage['id']?>" <?php echo $isActivated === false ? 'disabled' : '' ?> />
164
- <span><?php echo $storage['name']; ?></span>
165
- <span class="wpstg-storage-settings"><a class="<?php echo $isActivated === false ? 'wpstg-storage-settings-disabled' : ''; ?>" href="<?php echo $storage['settingsPath']; ?>" target="_blank"><?php echo $isActivated ? esc_html('Settings', 'wp-staging') : esc_html('Activate', 'wp-staging'); ?></a></span>
166
  </label>
167
  <?php endforeach; ?>
168
  </div>
6
  */
7
 
8
  use WPStaging\Core\Cron\Cron;
9
+ use WPStaging\Framework\Facades\Escape;
10
 
11
  $timeFormatOption = get_option('time_format');
12
 
49
  <input type="checkbox" name="includeOtherFilesInWpContent" id="includeOtherFilesInWpContent" value="true" checked/>
50
  <?php esc_html_e('Backup Other Files In wp-content', 'wp-staging') ?>
51
  <div class="wpstg--tooltip" style="position: absolute;">
52
+ <img class="wpstg--dashicons wpstg-dashicons-19 wpstg--grey" src="<?php echo esc_url($urlAssets); ?>svg/vendor/dashicons/info-outline.svg" alt="info" />
53
  <span class="wpstg--tooltiptext wpstg--tooltiptext-backups">
54
  <?php esc_html_e('All files in folder wp-content that are not plugins, themes, mu-plugins and uploads. Recommended for full-site backups.', 'wp-staging') ?>
55
  </span>
98
  <label for="backupScheduleTime">
99
  <?php esc_html_e('At what time should it start?', 'wp-staging'); ?>
100
  <div class="wpstg--tooltip" style="position: absolute;">
101
+ <img class="wpstg--dashicons wpstg-dashicons-19 wpstg--grey" src="<?php echo esc_url($urlAssets); ?>svg/vendor/dashicons/info-outline.svg" alt="info" />
102
  <span class="wpstg--tooltiptext wpstg--tooltiptext-backups">
103
+ <?php echo sprintf(
104
+ Escape::escapeHtml(__('Relative to current server time, which you can change in <a href="%s">WordPress Settings</a>.', 'wp-staging')),
105
+ esc_url(admin_url('options-general.php#timezone_string'))
106
+ ); ?>
107
  <br>
108
  <br>
109
+ <?php echo sprintf(esc_html__('Current Server Time: %s', 'wp-staging'), esc_html((new DateTime('now', $time->getSiteTimezoneObject()))->format($timeFormatOption))); ?>
110
  <br>
111
+ <?php echo sprintf(esc_html__('Site Timezone: %s', 'wp-staging'), esc_html($time->getSiteTimezoneString())); ?>
112
  </span>
113
  </div>
114
  </label>
120
  </option>
121
  <?php endforeach; ?>
122
  </select>
123
+ <span id="backup-schedule-current-time"><?php echo sprintf(esc_html__('Current Time: %s', 'wp-staging'), esc_html($currentTime)); ?></span>
124
  <label for="backupScheduleRotation">
125
  <?php esc_html_e('How many backups to keep?', 'wp-staging'); ?>
126
  <div class="wpstg--tooltip" style="position: absolute;">
127
+ <img class="wpstg--dashicons wpstg-dashicons-19 wpstg--grey" src="<?php echo esc_url($urlAssets); ?>svg/vendor/dashicons/info-outline.svg" alt="info" />
128
  <span class="wpstg--tooltiptext wpstg--tooltiptext-backups">
129
  <?php esc_html_e('Choose how many backups you want to keep before old ones are deleted to free up disk space.', 'wp-staging') ?>
130
  </span>
132
  </label>
133
  <select name="backupScheduleRotation" id="backupScheduleRotation">
134
  <?php for ($i = 1; $i <= 10; $i++) : ?>
135
+ <option value="<?php echo esc_attr($i) ?>">
136
  <?php esc_html_e(sprintf('Keep last %d backup%s', $i, ($i > 1 ? 's' : ''))); ?>
137
  </option>
138
  <?php endfor; ?>
164
  <?php
165
  $isActivated = $storage['activated'];
166
  ?>
167
+ <input type="checkbox" name="storages" id="storage-<?php echo esc_attr($storage['id'])?>" value="<?php echo esc_attr($storage['id'])?>" <?php echo $isActivated === false ? 'disabled' : '' ?> />
168
+ <span><?php echo esc_html($storage['name']); ?></span>
169
+ <span class="wpstg-storage-settings"><a class="<?php echo $isActivated === false ? 'wpstg-storage-settings-disabled' : ''; ?>" href="<?php echo esc_url($storage['settingsPath']); ?>" target="_blank"><?php echo $isActivated ? esc_html('Settings', 'wp-staging') : esc_html('Activate', 'wp-staging'); ?></a></span>
170
  </label>
171
  <?php endforeach; ?>
172
  </div>
Backend/views/backup/modal/partials/backup-contains.php CHANGED
@@ -20,7 +20,7 @@ if (!isset($urlAssets)) {
20
  <?php if ($isExportingDatabase) : ?>
21
  <li>
22
  <span class="wpstg--tooltip wpstg-backups-contains">
23
- <img class="wpstg--dashicons" src="<?php echo $urlAssets; ?>svg/vendor/dashicons/database.svg"/>
24
  <div class='wpstg--tooltiptext'>Database</div>
25
  </span>
26
  </li>
@@ -28,7 +28,7 @@ if (!isset($urlAssets)) {
28
  <?php if ($isExportingPlugins) : ?>
29
  <li>
30
  <span class="wpstg--tooltip wpstg-backups-contains">
31
- <img class="wpstg--dashicons" src="<?php echo $urlAssets; ?>svg/vendor/dashicons/admin-plugins.svg"/>
32
  <div class='wpstg--tooltiptext'>Plugins</div>
33
  </span>
34
  </li>
@@ -36,7 +36,7 @@ if (!isset($urlAssets)) {
36
  <?php if ($isExportingMuPlugins) : ?>
37
  <li>
38
  <span class="wpstg--tooltip wpstg-backups-contains">
39
- <img class="wpstg--dashicons" src="<?php echo $urlAssets; ?>svg/vendor/dashicons/plugins-checked.svg"/>
40
  <div class='wpstg--tooltiptext'>Must-Use Plugins</div>
41
  </span>
42
  </li>
@@ -44,7 +44,7 @@ if (!isset($urlAssets)) {
44
  <?php if ($isExportingThemes) : ?>
45
  <li>
46
  <span class="wpstg--tooltip wpstg-backups-contains">
47
- <img class="wpstg--dashicons" src="<?php echo $urlAssets; ?>svg/vendor/dashicons/layout.svg"/>
48
  <div class='wpstg--tooltiptext'>Themes</div>
49
  </span>
50
  </li>
@@ -52,7 +52,7 @@ if (!isset($urlAssets)) {
52
  <?php if ($isExportingUploads) : ?>
53
  <li>
54
  <span class="wpstg--tooltip wpstg-backups-contains">
55
- <img class="wpstg--dashicons" src="<?php echo $urlAssets; ?>svg/vendor/dashicons/images-alt.svg"/>
56
  <div class='wpstg--tooltiptext'>Uploads</div>
57
  </span>
58
  </li>
@@ -60,7 +60,7 @@ if (!isset($urlAssets)) {
60
  <?php if ($isExportingOtherWpContentFiles) : ?>
61
  <li>
62
  <span class="wpstg--tooltip wpstg-backups-contains">
63
- <img class="wpstg--dashicons" src="<?php echo $urlAssets; ?>svg/vendor/dashicons/admin-generic.svg"/>
64
  <div class='wpstg--tooltiptext'>Other files in wp-content</div>
65
  </span>
66
  </li>
20
  <?php if ($isExportingDatabase) : ?>
21
  <li>
22
  <span class="wpstg--tooltip wpstg-backups-contains">
23
+ <img class="wpstg--dashicons" src="<?php echo esc_url($urlAssets); ?>svg/vendor/dashicons/database.svg"/>
24
  <div class='wpstg--tooltiptext'>Database</div>
25
  </span>
26
  </li>
28
  <?php if ($isExportingPlugins) : ?>
29
  <li>
30
  <span class="wpstg--tooltip wpstg-backups-contains">
31
+ <img class="wpstg--dashicons" src="<?php echo esc_url($urlAssets); ?>svg/vendor/dashicons/admin-plugins.svg"/>
32
  <div class='wpstg--tooltiptext'>Plugins</div>
33
  </span>
34
  </li>
36
  <?php if ($isExportingMuPlugins) : ?>
37
  <li>
38
  <span class="wpstg--tooltip wpstg-backups-contains">
39
+ <img class="wpstg--dashicons" src="<?php echo esc_url($urlAssets); ?>svg/vendor/dashicons/plugins-checked.svg"/>
40
  <div class='wpstg--tooltiptext'>Must-Use Plugins</div>
41
  </span>
42
  </li>
44
  <?php if ($isExportingThemes) : ?>
45
  <li>
46
  <span class="wpstg--tooltip wpstg-backups-contains">
47
+ <img class="wpstg--dashicons" src="<?php echo esc_url($urlAssets); ?>svg/vendor/dashicons/layout.svg"/>
48
  <div class='wpstg--tooltiptext'>Themes</div>
49
  </span>
50
  </li>
52
  <?php if ($isExportingUploads) : ?>
53
  <li>
54
  <span class="wpstg--tooltip wpstg-backups-contains">
55
+ <img class="wpstg--dashicons" src="<?php echo esc_url($urlAssets); ?>svg/vendor/dashicons/images-alt.svg"/>
56
  <div class='wpstg--tooltiptext'>Uploads</div>
57
  </span>
58
  </li>
60
  <?php if ($isExportingOtherWpContentFiles) : ?>
61
  <li>
62
  <span class="wpstg--tooltip wpstg-backups-contains">
63
+ <img class="wpstg--dashicons" src="<?php echo esc_url($urlAssets); ?>svg/vendor/dashicons/admin-generic.svg"/>
64
  <div class='wpstg--tooltiptext'>Other files in wp-content</div>
65
  </span>
66
  </li>
Backend/views/backup/modal/partials/import-introduction.php CHANGED
@@ -1,13 +1,17 @@
1
  <?php
 
2
  /**
3
  * @var string $urlPublic
4
  */
 
 
 
5
  ?>
6
  <div class="wpstg--modal--backup--import--introduction">
7
  <div class="wpstg--modal--backup--import--wrapper">
8
  <div style="text-align: left; padding-left: 8px; padding-right: 8px;">
9
  <h4 class="wpstg--swal2-title"><strong><?php esc_html_e('Read First', 'wp-staging') ?></strong></h4>
10
- <?php echo wp_kses_post(__(<<<HTML
11
  <p>Back up your current website before you proceed!</p>
12
  <p class="wpstg-backup-restore-contains-database">This backup restore will replace entirely your website's database. You will be required to log in again with the user/password combination that exists in the backup.</p>
13
  <p class="wpstg-backup-restore-contains-database-multisite">If you restore a multisite backup, all existing network sites will be completely replaced by the network sites from the backup.</p>
1
  <?php
2
+
3
  /**
4
  * @var string $urlPublic
5
  */
6
+
7
+ use WPStaging\Framework\Facades\Escape;
8
+
9
  ?>
10
  <div class="wpstg--modal--backup--import--introduction">
11
  <div class="wpstg--modal--backup--import--wrapper">
12
  <div style="text-align: left; padding-left: 8px; padding-right: 8px;">
13
  <h4 class="wpstg--swal2-title"><strong><?php esc_html_e('Read First', 'wp-staging') ?></strong></h4>
14
+ <?php echo Escape::escapeHtml(__(<<<HTML
15
  <p>Back up your current website before you proceed!</p>
16
  <p class="wpstg-backup-restore-contains-database">This backup restore will replace entirely your website's database. You will be required to log in again with the user/password combination that exists in the backup.</p>
17
  <p class="wpstg-backup-restore-contains-database-multisite">If you restore a multisite backup, all existing network sites will be completely replaced by the network sites from the backup.</p>
Backend/views/backup/modal/progress.php CHANGED
@@ -22,7 +22,7 @@
22
  '<span class=\'wpstg--modal--logs--warning-count\'>0</span>'
23
  ) ?>"
24
  >
25
- <span style="text-decoration: underline"><?php _e('Show Logs', 'wp-staging') ?></span>
26
  </button>
27
  <div class="wpstg--modal--process--logs"></div>
28
  </div>
22
  '<span class=\'wpstg--modal--logs--warning-count\'>0</span>'
23
  ) ?>"
24
  >
25
+ <span style="text-decoration: underline"><?php esc_html_e('Show Logs', 'wp-staging') ?></span>
26
  </button>
27
  <div class="wpstg--modal--process--logs"></div>
28
  </div>
Backend/views/backup/modal/upload.php CHANGED
@@ -5,6 +5,7 @@
5
  */
6
 
7
  use WPStaging\Core\WPStaging;
 
8
  use WPStaging\Pro\Backup\Service\BackupsFinder;
9
 
10
  $uploadDirectory = str_replace(wp_normalize_path(ABSPATH), '', WPStaging::make(BackupsFinder::class)->getBackupsDirectory());
@@ -18,15 +19,21 @@ $uploadDirectory = str_replace(wp_normalize_path(ABSPATH), '', WPStaging::make(B
18
  <h2 class="wpstg--modal--backup--import--upload--title">
19
  <?php esc_html_e('Uploading Backup', 'wp-staging') ?>
20
  <div class="wpstg--tooltip">
21
- <img class="wpstg--dashicons wpstg-dashicons-19" src="<?php echo $urlAssets; ?>svg/vendor/dashicons/info-outline.svg"></img>
22
  <p class="wpstg--tooltiptext wpstg--tooltiptext-backups">
23
- <?php _e("Upload a WP STAGING backup file (*.wpstg) and restore your site to it at any time. This backup can have been created from this site, or even created on another website. So you can migrate the other site to this one.", "wp-staging")?>
24
  <br><br>
25
- <?php _e("Videos:", "wp-staging")?>
26
  <br>
27
- <?php echo sprintf(__('&#8226; <a href="%s" target="_blank">How to backup WordPress</a>', 'wp-staging'), 'https://www.youtube.com/watch?v=q352aYduOUY'); ?>
 
 
 
28
  <br>
29
- <?php echo sprintf(__('&#8226; <a href="%s" target="_blank">How to migrate WordPress</a>', 'wp-staging'), 'https://www.youtube.com/watch?v=DBaZQg1Efq4'); ?>
 
 
 
30
  </p>
31
  </div>
32
  </h2>
@@ -53,21 +60,15 @@ $uploadDirectory = str_replace(wp_normalize_path(ABSPATH), '', WPStaging::make(B
53
  <img src="<?php echo esc_url($urlAssets . 'img/upload.svg'); ?>" alt="Upload Image"/>
54
  <div class="wpstg-upload-text">
55
  <?php
56
- echo wp_kses(
57
- __(sprintf('Drop the backup file here to upload or <br><a>select from your computer</a>'), 'wp-staging'),
58
- [
59
- // Allowed HTML
60
- 'a' => [],
61
- 'br' => []
62
- ]
63
- ) ?>
64
  </div>
65
  <div class="wpstg-dragover-text">
66
  <strong><?php echo esc_html('Drop here to start the upload!') ?></strong>
67
  </div>
68
  </div>
69
  <p class="wpstg-backup-direct-upload-notice">
70
- <?php _e('<strong>Did you know?</strong>', 'wp-staging') ?><br>
71
  <?php esc_html_e('You can upload backups directly to the directory:', 'wp-staging') ?><br>
72
  <strong><?php echo esc_html($uploadDirectory) ?></strong>
73
  </p>
5
  */
6
 
7
  use WPStaging\Core\WPStaging;
8
+ use WPStaging\Framework\Facades\Escape;
9
  use WPStaging\Pro\Backup\Service\BackupsFinder;
10
 
11
  $uploadDirectory = str_replace(wp_normalize_path(ABSPATH), '', WPStaging::make(BackupsFinder::class)->getBackupsDirectory());
19
  <h2 class="wpstg--modal--backup--import--upload--title">
20
  <?php esc_html_e('Uploading Backup', 'wp-staging') ?>
21
  <div class="wpstg--tooltip">
22
+ <img class="wpstg--dashicons wpstg-dashicons-19" src="<?php echo esc_url($urlAssets); ?>svg/vendor/dashicons/info-outline.svg"></img>
23
  <p class="wpstg--tooltiptext wpstg--tooltiptext-backups">
24
+ <?php esc_html_e("Upload a WP STAGING backup file (*.wpstg) and restore your site to it at any time. This backup can have been created from this site, or even created on another website. So you can migrate the other site to this one.", "wp-staging")?>
25
  <br><br>
26
+ <?php esc_html_e("Videos:", "wp-staging")?>
27
  <br>
28
+ <?php echo sprintf(
29
+ Escape::escapeHtml(__('&#8226; <a href="%s" target="_blank">How to backup WordPress</a>', 'wp-staging')),
30
+ 'https://www.youtube.com/watch?v=q352aYduOUY'
31
+ ); ?>
32
  <br>
33
+ <?php echo sprintf(
34
+ Escape::escapeHtml(__('&#8226; <a href="%s" target="_blank">How to migrate WordPress</a>', 'wp-staging')),
35
+ 'https://www.youtube.com/watch?v=DBaZQg1Efq4'
36
+ ); ?>
37
  </p>
38
  </div>
39
  </h2>
60
  <img src="<?php echo esc_url($urlAssets . 'img/upload.svg'); ?>" alt="Upload Image"/>
61
  <div class="wpstg-upload-text">
62
  <?php
63
+ echo Escape::escapeHtml(__('Drop the backup file here to upload or <br><a>select from your computer</a>', 'wp-staging'));
64
+ ?>
 
 
 
 
 
 
65
  </div>
66
  <div class="wpstg-dragover-text">
67
  <strong><?php echo esc_html('Drop here to start the upload!') ?></strong>
68
  </div>
69
  </div>
70
  <p class="wpstg-backup-direct-upload-notice">
71
+ <strong><?php esc_html_e('Did you know?', 'wp-staging') ?></strong><br>
72
  <?php esc_html_e('You can upload backups directly to the directory:', 'wp-staging') ?><br>
73
  <strong><?php echo esc_html($uploadDirectory) ?></strong>
74
  </p>
Backend/views/backup/multisite-disabled.php CHANGED
@@ -11,7 +11,7 @@
11
  <ul>
12
  <li class="wpstg-clone">
13
  <p><strong><?php esc_html_e('Coming soon!', 'wp-staging'); ?></strong></p>
14
- <p><?php echo sprintf(__('Please go to the %s to create a backup of the entire multisite network including all network sub-sites. With one of the next releases, you will be able to backup network sub-sites separately.', 'wp-staging'), '<a href="' . $mainsiteWpstgURL . '">main multisite</a>'); ?></p>
15
  </li>
16
  </ul>
17
  </div>
11
  <ul>
12
  <li class="wpstg-clone">
13
  <p><strong><?php esc_html_e('Coming soon!', 'wp-staging'); ?></strong></p>
14
+ <p><?php echo sprintf(esc_html__('Please go to the %s to create a backup of the entire multisite network including all network sub-sites. With one of the next releases, you will be able to backup network sub-sites separately.', 'wp-staging'), '<a href="' . esc_url($mainsiteWpstgURL) . '">main multisite</a>'); ?></p>
15
  </li>
16
  </ul>
17
  </div>
Backend/views/backup/restore-wait.php CHANGED
@@ -7,7 +7,7 @@
7
  ?>
8
 
9
  <div id="wpstg-restore-wait">
10
- <div class="wpstg-logo"><img width="220" src="<?php echo WPSTG_PLUGIN_URL . "assets/img/logo.svg"; ?>"></div>
11
- <div class="wpstg-title"><?php _e('Backup Restore Successful!', 'wp-staging') ?></div>
12
- <div class="wpstg-text"><?php _e('You are being redirected to the login page...', 'wp-staging') ?></div>
13
  </div>
7
  ?>
8
 
9
  <div id="wpstg-restore-wait">
10
+ <div class="wpstg-logo"><img width="220" src="<?php echo esc_url(WPSTG_PLUGIN_URL . "assets/img/logo.svg"); ?>"></div>
11
+ <div class="wpstg-title"><?php esc_html_e('Backup Restore Successful!', 'wp-staging') ?></div>
12
+ <div class="wpstg-text"><?php esc_html_e('You are being redirected to the login page...', 'wp-staging') ?></div>
13
  </div>
Backend/views/clone/ajax/custom-directory.php CHANGED
@@ -3,6 +3,7 @@
3
  use WPStaging\Core\WPStaging;
4
  use WPStaging\Backend\Modules\SystemInfo;
5
  use WPStaging\Backend\Modules\Jobs\Scan;
 
6
  use WPStaging\Framework\Facades\Sanitize;
7
 
8
  /**
@@ -60,30 +61,33 @@ if ($isPro && !empty($options->current) && $options->current !== null) {
60
  ?>
61
 
62
  <p class="wpstg--advance-settings--checkbox">
63
- <label for="wpstg-change-dest"><?php _e('Change Destination'); ?></label>
64
  <input type="checkbox" id="wpstg-change-dest" name="wpstg-change-dest" value="true" class="wpstg-toggle-advance-settings-section" data-id="wpstg-clone-directory" <?php echo $isPro === true ? '' : 'disabled' ?> >
65
  <span class="wpstg--tooltip">
66
  <img class="wpstg--dashicons" src="<?php echo esc_url($scan->getInfoIcon()); ?>" alt="info" />
67
  <span class="wpstg--tooltiptext">
68
- <strong> <?php _e('You can copy the staging site to a custom directory and can use a different hostname.', 'wp-staging'); ?></strong>
69
  <br /> <br />
70
- <?php echo sprintf(__('<strong>Target Directory:</strong> An absolute path like <code>/www/public_html/dev</code>. File permissions should be 755 and it must be writeable by php user <code>%s</code>', 'wp-staging'), esc_html((new SystemInfo())->getPHPUser())); ?>
 
 
 
71
  <br /> <br />
72
- <?php _e('<strong>Taget Hostname:</strong> The hostname of the target site, for instance <code>https://subdomain.example.com</code> or <code>https://example.com/staging</code>', 'wp-staging'); ?>
73
  <br /> <br />
74
- <?php _e('Make sure the hostname points to the target directory from above.', 'wp-staging'); ?>
75
  </span>
76
  </span>
77
  </p>
78
  <div id="wpstg-clone-directory" <?php echo $isPro === true ? 'style="display: none;"' : '' ?> >
79
  <div class="wpstg-form-group wpstg-text-field">
80
- <label><?php _e('Target Directory: ', 'wp-staging') ?> </label>
81
  <input type="text" class="wpstg-textbox" name="wpstg_clone_dir" id="wpstg_clone_dir" value="<?php echo esc_attr($customDir); ?>" title="wpstg_clone_dir" placeholder="<?php echo esc_attr($directory); ?>" autocapitalize="off" <?php echo $proSettingsDisabled === true ? 'disabled' : '' ?> />
82
  <?php if (!$proSettingsDisabled) : ?>
83
  <span class="wpstg-code-segment">
84
  <code>
85
  <a id="wpstg-use-target-dir" data-base-path="<?php echo esc_attr($directory) ?>" data-path="<?php echo esc_attr($directory) ?>" class="wpstg-pointer">
86
- <?php _e('Set Default: ', 'wp-staging') ?>
87
  </a>
88
  <span class="wpstg-use-target-dir--value"><?php echo esc_attr($directory); ?></span>
89
  </code>
@@ -91,15 +95,15 @@ if ($isPro && !empty($options->current) && $options->current !== null) {
91
  <?php endif; ?>
92
  </div>
93
  <div class="wpstg-form-group wpstg-text-field">
94
- <label><?php _e('Target Hostname: ') ?> </label>
95
  <input type="text" class="wpstg-textbox" name="wpstg_clone_hostname" id="wpstg_clone_hostname" value="<?php echo esc_attr($customHostname); ?>" title="wpstg_clone_hostname" placeholder="<?php echo esc_attr($hostname); ?>" autocapitalize="off" <?php echo $proSettingsDisabled === true ? 'disabled' : '' ?> />
96
  <?php if (!$proSettingsDisabled) : ?>
97
  <span class="wpstg-code-segment">
98
  <code>
99
  <a id="wpstg-use-target-hostname" data-base-uri="<?php echo esc_attr($hostname) ?>" data-uri="<?php echo esc_attr($hostname) ?>" class="wpstg-pointer">
100
- <?php _e('Set Default: ', 'wp-staging') ?>
101
  </a>
102
- <span class="wpstg-use-target-hostname--value"><?php echo get_site_url(); ?></span>
103
  </code>
104
  </span>
105
  <?php endif; ?>
@@ -108,18 +112,18 @@ if ($isPro && !empty($options->current) && $options->current !== null) {
108
  </div>
109
 
110
  <p class="wpstg--advance-settings--checkbox">
111
- <label for="wpstg_symlink_upload"><?php _e('Symlink Uploads Folder'); ?></label>
112
  <input type="checkbox" id="wpstg_symlink_upload" name="wpstg_symlink_upload" value="true"
113
  <?php echo $proSettingsDisabled === true ? 'disabled' : '' ?>
114
  <?php echo $uploadsSymlinked === true ? 'checked' : '' ?> />
115
  <span class="wpstg--tooltip">
116
- <img class="wpstg--dashicons" src="<?php echo esc_attr($scan->getInfoIcon()); ?>" alt="info" />
117
  <span class="wpstg--tooltiptext">
118
- <?php echo sprintf(__('Activate to symlink the folder %s%s%s to the production site. %s All files including images on the production site\'s uploads folder will be linked to the staging site uploads folder. This will speed up the cloning and pushing process tremendously as no files from the uploads folder are copied between both sites. %s Note: this can lead to mixed and shared content issues if both site loads (custom) stylesheet files from the same uploads folder. %s Using this option means changing images on the staging site will change images on the production site as well. Use this with care! %s', 'wp-staging'), '<code>', $wpDefaultDirectories->getRelativeUploadPath(), '</code>', '<br><br>', '<br><br>', '<br><br><strong>', '</strong>');?>
119
  <br/>
120
  <br/>
121
- <?php _e('<strong>This feature only works if the staging site is on the same hosting as the production site.</strong>', 'wp-staging'); ?>
122
- <?php echo $proSettingsDisabled === true ? '<br/>' . __('(Create a new staging site if you want to change this setting.)', 'wp-staging') : '' ?>
123
  </span>
124
  </span>
125
  </p>
3
  use WPStaging\Core\WPStaging;
4
  use WPStaging\Backend\Modules\SystemInfo;
5
  use WPStaging\Backend\Modules\Jobs\Scan;
6
+ use WPStaging\Framework\Facades\Escape;
7
  use WPStaging\Framework\Facades\Sanitize;
8
 
9
  /**
61
  ?>
62
 
63
  <p class="wpstg--advance-settings--checkbox">
64
+ <label for="wpstg-change-dest"><?php esc_html_e('Change Destination'); ?></label>
65
  <input type="checkbox" id="wpstg-change-dest" name="wpstg-change-dest" value="true" class="wpstg-toggle-advance-settings-section" data-id="wpstg-clone-directory" <?php echo $isPro === true ? '' : 'disabled' ?> >
66
  <span class="wpstg--tooltip">
67
  <img class="wpstg--dashicons" src="<?php echo esc_url($scan->getInfoIcon()); ?>" alt="info" />
68
  <span class="wpstg--tooltiptext">
69
+ <strong> <?php esc_html_e('You can copy the staging site to a custom directory and can use a different hostname.', 'wp-staging'); ?></strong>
70
  <br /> <br />
71
+ <?php echo sprintf(
72
+ Escape::escapeHtml(__('<strong>Target Directory:</strong> An absolute path like <code>/www/public_html/dev</code>. File permissions should be 755 and it must be writeable by php user <code>%s</code>', 'wp-staging')),
73
+ esc_html((new SystemInfo())->getPHPUser())
74
+ ); ?>
75
  <br /> <br />
76
+ <?php echo Escape::escapeHtml(__('<strong>Taget Hostname:</strong> The hostname of the target site, for instance <code>https://subdomain.example.com</code> or <code>https://example.com/staging</code>', 'wp-staging')) ?>
77
  <br /> <br />
78
+ <?php esc_html_e('Make sure the hostname points to the target directory from above.', 'wp-staging'); ?>
79
  </span>
80
  </span>
81
  </p>
82
  <div id="wpstg-clone-directory" <?php echo $isPro === true ? 'style="display: none;"' : '' ?> >
83
  <div class="wpstg-form-group wpstg-text-field">
84
+ <label><?php esc_html_e('Target Directory: ', 'wp-staging') ?> </label>
85
  <input type="text" class="wpstg-textbox" name="wpstg_clone_dir" id="wpstg_clone_dir" value="<?php echo esc_attr($customDir); ?>" title="wpstg_clone_dir" placeholder="<?php echo esc_attr($directory); ?>" autocapitalize="off" <?php echo $proSettingsDisabled === true ? 'disabled' : '' ?> />
86
  <?php if (!$proSettingsDisabled) : ?>
87
  <span class="wpstg-code-segment">
88
  <code>
89
  <a id="wpstg-use-target-dir" data-base-path="<?php echo esc_attr($directory) ?>" data-path="<?php echo esc_attr($directory) ?>" class="wpstg-pointer">
90
+ <?php esc_html_e('Set Default: ', 'wp-staging') ?>
91
  </a>
92
  <span class="wpstg-use-target-dir--value"><?php echo esc_attr($directory); ?></span>
93
  </code>
95
  <?php endif; ?>
96
  </div>
97
  <div class="wpstg-form-group wpstg-text-field">
98
+ <label><?php esc_html_e('Target Hostname: ') ?> </label>
99
  <input type="text" class="wpstg-textbox" name="wpstg_clone_hostname" id="wpstg_clone_hostname" value="<?php echo esc_attr($customHostname); ?>" title="wpstg_clone_hostname" placeholder="<?php echo esc_attr($hostname); ?>" autocapitalize="off" <?php echo $proSettingsDisabled === true ? 'disabled' : '' ?> />
100
  <?php if (!$proSettingsDisabled) : ?>
101
  <span class="wpstg-code-segment">
102
  <code>
103
  <a id="wpstg-use-target-hostname" data-base-uri="<?php echo esc_attr($hostname) ?>" data-uri="<?php echo esc_attr($hostname) ?>" class="wpstg-pointer">
104
+ <?php esc_html_e('Set Default: ', 'wp-staging') ?>
105
  </a>
106
+ <span class="wpstg-use-target-hostname--value"><?php echo esc_url(get_site_url()); ?></span>
107
  </code>
108
  </span>
109
  <?php endif; ?>
112
  </div>
113
 
114
  <p class="wpstg--advance-settings--checkbox">
115
+ <label for="wpstg_symlink_upload"><?php esc_html_e('Symlink Uploads Folder'); ?></label>
116
  <input type="checkbox" id="wpstg_symlink_upload" name="wpstg_symlink_upload" value="true"
117
  <?php echo $proSettingsDisabled === true ? 'disabled' : '' ?>
118
  <?php echo $uploadsSymlinked === true ? 'checked' : '' ?> />
119
  <span class="wpstg--tooltip">
120
+ <img class="wpstg--dashicons" src="<?php echo esc_url($scan->getInfoIcon()); ?>" alt="info" />
121
  <span class="wpstg--tooltiptext">
122
+ <?php echo sprintf(esc_html__('Activate to symlink the folder %s%s%s to the production site. %s All files including images on the production site\'s uploads folder will be linked to the staging site uploads folder. This will speed up the cloning and pushing process tremendously as no files from the uploads folder are copied between both sites. %s Note: this can lead to mixed and shared content issues if both site loads (custom) stylesheet files from the same uploads folder. %s Using this option means changing images on the staging site will change images on the production site as well. Use this with care! %s', 'wp-staging'), '<code>', esc_html($wpDefaultDirectories->getRelativeUploadPath()), '</code>', '<br><br>', '<br><br>', '<br><br><strong>', '</strong>');?>
123
  <br/>
124
  <br/>
125
+ <strong><?php esc_html_e('This feature only works if the staging site is on the same hosting as the production site.', 'wp-staging'); ?></strong>
126
+ <?php echo $proSettingsDisabled === true ? '<br/>' . esc_html__('(Create a new staging site if you want to change this setting.)', 'wp-staging') : '' ?>
127
  </span>
128
  </span>
129
  </p>
Backend/views/clone/ajax/delete-confirmation.php CHANGED
@@ -13,25 +13,24 @@ if ($isDatabaseConnected) { ?>
13
  <div class="wpstg-notice-alert">
14
  <h3 class="wpstg-m-0 wpstg-pb-5px">
15
  <?php
16
- _e("Do you want to delete the staging site?", "wp-staging")
17
  ?>
18
  </h3>
19
 
20
  <p>
21
- <?php _e('Staging Site Name:', 'wp-staging'); ?>
22
  <code>
23
  <?php
24
- echo $clone->directoryName;
25
  ?>
26
  </code>
27
  </p>
28
  <p>
29
- <?php _e('Database Location:', 'wp-staging'); ?>
30
  <code>
31
- <?php
32
- $database = empty($clone->databaseDatabase) ? esc_html($dbname) . "</code> (Production Database)" : esc_html($clone->databaseDatabase) . "</code> (Separate Database)";
33
- echo $database;
34
- ?>
35
 
36
  </p>
37
  </div>
@@ -39,11 +38,11 @@ if ($isDatabaseConnected) { ?>
39
 
40
  <?php if (!$isDatabaseConnected) { ?>
41
  <div class="wpstg-notice-alert wpstg-failed">
42
- <h4 class="wpstg-mb-0"><?php _e('Error: Can not connect to external database: ', 'wp-staging');
43
  echo esc_html($clone->databaseDatabase); ?></h4>
44
  <ul class="wpstg-mb-0">
45
- <li><?php _e('This can happen if the password of the external database has been changed or if the database was deleted', 'wp-staging') ?></li>
46
- <li><?php _e('You can still delete this staging site but deleting this site will not delete any table or database. You will have to delete them manually if they exist.', 'wp-staging') ?></li>
47
  </ul>
48
  </div>
49
  <?php } ?>
@@ -53,17 +52,17 @@ if ($isDatabaseConnected) { ?>
53
  <?php if ($isDatabaseConnected) { ?>
54
  <a href="#" class="wpstg-tab-header active" data-id="#wpstg-scanning-db">
55
  <span class="wpstg-tab-triangle"></span>
56
- <?php echo __("Database tables to delete", "wp-staging")?>
57
  </a>
58
 
59
  <!-- Database -->
60
  <div class="wpstg-tab-section" id="wpstg-scanning-db">
61
  <h4 class="wpstg-m-0">
62
- <?php _e("Select all database tables you want to delete:", "wp-staging")?>
63
  </h4>
64
  <div class="wpstg-my-6px">
65
  <a href="#" class="wpstg-button-unselect">
66
- <?php _e("Unselect All", "wp-staging") ?>
67
  </a>
68
  </div>
69
 
@@ -71,8 +70,8 @@ if ($isDatabaseConnected) { ?>
71
  <div class="wpstg-db-table">
72
  <label>
73
  <?php $checkedProperty = (strpos($table->name, $clone->prefix) === 0) ? 'checked' : ''; ?>
74
- <input class="wpstg-db-table-checkboxes" type="checkbox" name="<?php echo esc_attr($table->name); ?>" <?php echo $checkedProperty ?>>
75
- <?php echo $table->name?>
76
  </label>
77
  <span class="wpstg-size-info">
78
  <?php echo isset($table->size) ? esc_html($table->size) : '';?>
@@ -81,7 +80,7 @@ if ($isDatabaseConnected) { ?>
81
  <?php endforeach ?>
82
  <div class="wpstg-my-6px">
83
  <a href="#" class="wpstg-button-unselect">
84
- <?php _e("Unselect All", "wp-staging") ?>
85
  </a>
86
  </div>
87
  </div>
@@ -90,13 +89,13 @@ if ($isDatabaseConnected) { ?>
90
 
91
  <a href="#" class="wpstg-tab-header" data-id="#wpstg-scanning-files">
92
  <span class="wpstg-tab-triangle"></span>
93
- <?php echo __("Files to delete", "wp-staging")?>
94
  </a>
95
 
96
  <!-- Files -->
97
  <div class="wpstg-tab-section" id="wpstg-scanning-files">
98
  <h4 class="wpstg-m-0 wpstg-mb-10px">
99
- <?php _e("Selected folder and all of its subfolders and files will be deleted. <br/>Unselect it if you want to keep the staging site file data.", "wp-staging") ?>
100
  </h4>
101
 
102
  <div class="wpstg-dir">
@@ -111,9 +110,9 @@ if ($isDatabaseConnected) { ?>
111
  </div>
112
 
113
  <a href="#" class="wpstg-button--primary" id="wpstg-cancel-removing">
114
- <?php _e("Cancel", "wp-staging")?>
115
  </a>
116
 
117
  <a href="#" class="wpstg-button--primary wpstg-button--red" style="margin-left:5px;" id="wpstg-remove-clone" data-clone="<?php echo esc_attr($clone->name); ?>">
118
- <?php echo __("Delete", "wp-staging")?>
119
  </a>
13
  <div class="wpstg-notice-alert">
14
  <h3 class="wpstg-m-0 wpstg-pb-5px">
15
  <?php
16
+ esc_html_e("Do you want to delete the staging site?", "wp-staging")
17
  ?>
18
  </h3>
19
 
20
  <p>
21
+ <?php esc_html_e('Staging Site Name:', 'wp-staging'); ?>
22
  <code>
23
  <?php
24
+ echo esc_html($clone->directoryName);
25
  ?>
26
  </code>
27
  </p>
28
  <p>
29
+ <?php esc_html_e('Database Location:', 'wp-staging'); ?>
30
  <code>
31
+ <?php echo empty($clone->databaseDatabase) ? esc_html($dbname) : esc_html($clone->databaseDatabase); ?>
32
+ </code>
33
+ <?php echo empty($clone->databaseDatabase) ? "(Production Database)" : "(Separate Database)"; ?>
 
34
 
35
  </p>
36
  </div>
38
 
39
  <?php if (!$isDatabaseConnected) { ?>
40
  <div class="wpstg-notice-alert wpstg-failed">
41
+ <h4 class="wpstg-mb-0"><?php esc_html_e('Error: Can not connect to external database: ', 'wp-staging');
42
  echo esc_html($clone->databaseDatabase); ?></h4>
43
  <ul class="wpstg-mb-0">
44
+ <li><?php esc_html_e('This can happen if the password of the external database has been changed or if the database was deleted', 'wp-staging') ?></li>
45
+ <li><?php esc_html_e('You can still delete this staging site but deleting this site will not delete any table or database. You will have to delete them manually if they exist.', 'wp-staging') ?></li>
46
  </ul>
47
  </div>
48
  <?php } ?>
52
  <?php if ($isDatabaseConnected) { ?>
53
  <a href="#" class="wpstg-tab-header active" data-id="#wpstg-scanning-db">
54
  <span class="wpstg-tab-triangle"></span>
55
+ <?php echo esc_html__("Database tables to delete", "wp-staging")?>
56
  </a>
57
 
58
  <!-- Database -->
59
  <div class="wpstg-tab-section" id="wpstg-scanning-db">
60
  <h4 class="wpstg-m-0">
61
+ <?php esc_html_e("Select all database tables you want to delete:", "wp-staging")?>
62
  </h4>
63
  <div class="wpstg-my-6px">
64
  <a href="#" class="wpstg-button-unselect">
65
+ <?php esc_html_e("Unselect All", "wp-staging") ?>
66
  </a>
67
  </div>
68
 
70
  <div class="wpstg-db-table">
71
  <label>
72
  <?php $checkedProperty = (strpos($table->name, $clone->prefix) === 0) ? 'checked' : ''; ?>
73
+ <input class="wpstg-db-table-checkboxes" type="checkbox" name="<?php echo esc_attr($table->name); ?>" <?php echo esc_attr($checkedProperty) ?>>
74
+ <?php echo esc_html($table->name) ?>
75
  </label>
76
  <span class="wpstg-size-info">
77
  <?php echo isset($table->size) ? esc_html($table->size) : '';?>
80
  <?php endforeach ?>
81
  <div class="wpstg-my-6px">
82
  <a href="#" class="wpstg-button-unselect">
83
+ <?php esc_html_e("Unselect All", "wp-staging") ?>
84
  </a>
85
  </div>
86
  </div>
89
 
90
  <a href="#" class="wpstg-tab-header" data-id="#wpstg-scanning-files">
91
  <span class="wpstg-tab-triangle"></span>
92
+ <?php echo esc_html__("Files to delete", "wp-staging")?>
93
  </a>
94
 
95
  <!-- Files -->
96
  <div class="wpstg-tab-section" id="wpstg-scanning-files">
97
  <h4 class="wpstg-m-0 wpstg-mb-10px">
98
+ <?php echo wp_kses_post(__("Selected folder and all of its subfolders and files will be deleted. <br/>Unselect it if you want to keep the staging site file data.", "wp-staging")) ?>
99
  </h4>
100
 
101
  <div class="wpstg-dir">
110
  </div>
111
 
112
  <a href="#" class="wpstg-button--primary" id="wpstg-cancel-removing">
113
+ <?php esc_html_e("Cancel", "wp-staging")?>
114
  </a>
115
 
116
  <a href="#" class="wpstg-button--primary wpstg-button--red" style="margin-left:5px;" id="wpstg-remove-clone" data-clone="<?php echo esc_attr($clone->name); ?>">
117
+ <?php echo esc_html__("Delete", "wp-staging")?>
118
  </a>
Backend/views/clone/ajax/exclude-settings.php CHANGED
@@ -11,14 +11,14 @@
11
 
12
 
13
  <div>
14
- <h1 class="wpstg-m-0 wpstg-mt-10px wpstg--swal2-title"><?php _e('Reset Staging Site'); ?></h1>
15
- <p style="text-align: justify;"><?php _e('Do you really want to reset this staging site with the current state of the production site?', 'wp-staging'); ?></p>
16
- <p style="color: #e01e5a; font-size: 18px;"><?php _e('This will delete your modifications!', 'wp-staging'); ?></p>
17
- <p style="text-align: justify;"><?php _e('The original selection for tables and files have been preselected. You can adjust and verify them before starting the reset.', 'wp-staging'); ?></p>
18
  <div class="wpstg-tabs-wrapper" style="text-align: left;">
19
  <a href="#" class="wpstg-tab-header wpstg-reset-exclude-tab" data-id="#wpstg-reset-excluded-tables" data-collapsed="true">
20
  <span class="wpstg-tab-triangle"></span>
21
- <?php _e("Selected Tables", "wp-staging") ?>
22
  </a>
23
 
24
  <fieldset class="wpstg-tab-section" id="wpstg-reset-excluded-tables">
@@ -27,7 +27,7 @@
27
 
28
  <a href="#" class="wpstg-tab-header wpstg-reset-exclude-tab" data-id="#wpstg-reset-excluded-files" data-collapsed="true">
29
  <span class="wpstg-tab-triangle"></span>
30
- <?php _e("Selected Files", "wp-staging") ?>
31
  </a>
32
 
33
  <fieldset class="wpstg-tab-section" id="wpstg-reset-excluded-files">
11
 
12
 
13
  <div>
14
+ <h1 class="wpstg-m-0 wpstg-mt-10px wpstg--swal2-title"><?php esc_html_e('Reset Staging Site'); ?></h1>
15
+ <p style="text-align: justify;"><?php esc_html_e('Do you really want to reset this staging site with the current state of the production site?', 'wp-staging'); ?></p>
16
+ <p style="color: #e01e5a; font-size: 18px;"><?php esc_html_e('This will delete your modifications!', 'wp-staging'); ?></p>
17
+ <p style="text-align: justify;"><?php esc_html_e('The original selection for tables and files have been preselected. You can adjust and verify them before starting the reset.', 'wp-staging'); ?></p>
18
  <div class="wpstg-tabs-wrapper" style="text-align: left;">
19
  <a href="#" class="wpstg-tab-header wpstg-reset-exclude-tab" data-id="#wpstg-reset-excluded-tables" data-collapsed="true">
20
  <span class="wpstg-tab-triangle"></span>
21
+ <?php esc_html_e("Selected Tables", "wp-staging") ?>
22
  </a>
23
 
24
  <fieldset class="wpstg-tab-section" id="wpstg-reset-excluded-tables">
27
 
28
  <a href="#" class="wpstg-tab-header wpstg-reset-exclude-tab" data-id="#wpstg-reset-excluded-files" data-collapsed="true">
29
  <span class="wpstg-tab-triangle"></span>
30
+ <?php esc_html_e("Selected Files", "wp-staging") ?>
31
  </a>
32
 
33
  <fieldset class="wpstg-tab-section" id="wpstg-reset-excluded-files">
Backend/views/clone/ajax/external-database.php CHANGED
@@ -37,43 +37,43 @@ if ($isPro && !empty($options->current) && $options->current !== null) {
37
  <p class="wpstg--advance-settings--checkbox">
38
 
39
  <?php if (!$isPro) { // Show this on only FREE version ?>
40
- <p class="wpstg-dark-alert"><?php _e('These are Pro Features ', 'wp-staging'); ?>
41
- <a href="https://wp-staging.com/?utm_source=wp-admin&utm_medium=wp-admin&utm_campaign=db-external&utm_term=db-external" target="_blank" class="wpstg-button--primary wpstg-button--cta-red wpstg-border--violet"><?php _e("Get Started", "wp-staging"); ?></a>
42
  </p>
43
  <?php } ?>
44
 
45
- <label for="wpstg-ext-db"><?php _e('Change Database'); ?></label>
46
  <input type="checkbox" id="wpstg-ext-db" name="wpstg-ext-db" value="true" class="wpstg-toggle-advance-settings-section" data-id="wpstg-external-db-section" <?php echo $isPro === true ? '' : 'disabled' ?> >
47
  <span class="wpstg--tooltip">
48
  <img class="wpstg--dashicons" src="<?php echo esc_attr($scan->getInfoIcon()); ?>" alt="info" />
49
  <span class="wpstg--tooltiptext">
50
- <?php _e('You can clone the staging site into a separate database. The Database must be created manually in advance before starting the cloning proccess.<br/><br/><strong>Note:</strong> If there are already tables with the same database prefix and name in this database, the cloning process will be aborted without any further asking!', 'wp-staging'); ?>
51
  </span>
52
  </span>
53
  </p>
54
  <div id="wpstg-external-db-section" <?php echo $isPro === true ? 'style="display: none;"' : '' ?> >
55
  <div class="wpstg-form-group wpstg-text-field">
56
- <label><?php _e('Server: ', 'wp-staging'); ?> </label>
57
- <input type="text" class="wpstg-textbox" name="wpstg_db_server" id="wpstg_db_server" value="<?php echo $server; ?>" title="wpstg_db_server" placeholder="localhost" autocapitalize="off" <?php echo $isDisabled ? 'disabled' : '' ?> readonly>
58
  </div>
59
  <div class="wpstg-form-group wpstg-text-field">
60
- <label for="wpstg_db_username"><?php _e('User: ', 'wp-staging'); ?></label>
61
- <input type="text" class="wpstg-textbox" name="wpstg_db_username" id="wpstg_db_username" value="<?php echo $username; ?>" autocapitalize="off" <?php echo $isDisabled ? 'disabled' : '' ?> readonly />
62
  </div>
63
  <div class="wpstg-form-group wpstg-text-field">
64
- <label for="wpstg_db_password"><?php _e('Password: ', 'wp-staging'); ?></label>
65
- <input type="password" class="wpstg-textbox" name="wpstg_db_password" id="wpstg_db_password" value="<?php echo $password; ?>" <?php echo $isDisabled ? 'disabled' : '' ?> readonly />
66
  </div>
67
  <div class="wpstg-form-group wpstg-text-field">
68
- <label for="wpstg_db_database"><?php _e('Database: ', 'wp-staging'); ?></label>
69
- <input type="text" class="wpstg-textbox" name="wpstg_db_database" id="wpstg_db_database" value="<?php echo $database; ?>" autocapitalize="off" <?php echo $isDisabled ? 'disabled' : '' ?> readonly />
70
  </div>
71
  <div class="wpstg-form-group wpstg-text-field">
72
- <label for="wpstg_db_prefix"><?php _e('Database Prefix: ', 'wp-staging'); ?></label>
73
- <input type="text" class="wpstg-textbox" name="wpstg_db_prefix" id="wpstg_db_prefix" value="<?php echo $prefix; ?>" placeholder="<?php echo $db->prefix; ?>" autocapitalize="off" <?php echo $isDisabled ? 'disabled' : '' ?> readonly />
74
  </div>
75
  <div class="wpstg-form-group wpstg-text-field">
76
- <a href="#" id="wpstg-db-connect"><?php _e("Test Database Connection", "wp-staging"); ?></a>
77
  </div>
78
  <hr />
79
  </div>
37
  <p class="wpstg--advance-settings--checkbox">
38
 
39
  <?php if (!$isPro) { // Show this on only FREE version ?>
40
+ <p class="wpstg-dark-alert"><?php esc_html_e('These are Pro Features ', 'wp-staging'); ?>
41
+ <a href="https://wp-staging.com/?utm_source=wp-admin&utm_medium=wp-admin&utm_campaign=db-external&utm_term=db-external" target="_blank" class="wpstg-button--primary wpstg-button--cta-red wpstg-border--violet"><?php esc_html_e("Get Started", "wp-staging"); ?></a>
42
  </p>
43
  <?php } ?>
44
 
45
+ <label for="wpstg-ext-db"><?php esc_html_e('Change Database'); ?></label>
46
  <input type="checkbox" id="wpstg-ext-db" name="wpstg-ext-db" value="true" class="wpstg-toggle-advance-settings-section" data-id="wpstg-external-db-section" <?php echo $isPro === true ? '' : 'disabled' ?> >
47
  <span class="wpstg--tooltip">
48
  <img class="wpstg--dashicons" src="<?php echo esc_attr($scan->getInfoIcon()); ?>" alt="info" />
49
  <span class="wpstg--tooltiptext">
50
+ <?php wp_kses_post(__('You can clone the staging site into a separate database. The Database must be created manually in advance before starting the cloning proccess.<br/><br/><strong>Note:</strong> If there are already tables with the same database prefix and name in this database, the cloning process will be aborted without any further asking!', 'wp-staging')); ?>
51
  </span>
52
  </span>
53
  </p>
54
  <div id="wpstg-external-db-section" <?php echo $isPro === true ? 'style="display: none;"' : '' ?> >
55
  <div class="wpstg-form-group wpstg-text-field">
56
+ <label><?php esc_html_e('Server: ', 'wp-staging'); ?> </label>
57
+ <input type="text" class="wpstg-textbox" name="wpstg_db_server" id="wpstg_db_server" value="<?php echo esc_attr($server); ?>" title="wpstg_db_server" placeholder="localhost" autocapitalize="off" <?php echo $isDisabled ? 'disabled' : '' ?> readonly>
58
  </div>
59
  <div class="wpstg-form-group wpstg-text-field">
60
+ <label for="wpstg_db_username"><?php esc_html_e('User: ', 'wp-staging'); ?></label>
61
+ <input type="text" class="wpstg-textbox" name="wpstg_db_username" id="wpstg_db_username" value="<?php echo esc_attr($username); ?>" autocapitalize="off" <?php echo $isDisabled ? 'disabled' : '' ?> readonly />
62
  </div>
63
  <div class="wpstg-form-group wpstg-text-field">
64
+ <label for="wpstg_db_password"><?php esc_html_e('Password: ', 'wp-staging'); ?></label>
65
+ <input type="password" class="wpstg-textbox" name="wpstg_db_password" id="wpstg_db_password" value="<?php echo esc_attr($password); ?>" <?php echo $isDisabled ? 'disabled' : '' ?> readonly />
66
  </div>
67
  <div class="wpstg-form-group wpstg-text-field">
68
+ <label for="wpstg_db_database"><?php esc_html_e('Database: ', 'wp-staging'); ?></label>
69
+ <input type="text" class="wpstg-textbox" name="wpstg_db_database" id="wpstg_db_database" value="<?php echo esc_attr($database); ?>" autocapitalize="off" <?php echo $isDisabled ? 'disabled' : '' ?> readonly />
70
  </div>
71
  <div class="wpstg-form-group wpstg-text-field">
72
+ <label for="wpstg_db_prefix"><?php esc_html_e('Database Prefix: ', 'wp-staging'); ?></label>
73
+ <input type="text" class="wpstg-textbox" name="wpstg_db_prefix" id="wpstg_db_prefix" value="<?php echo esc_attr($prefix); ?>" placeholder="<?php echo $db->prefix; ?>" autocapitalize="off" <?php echo $isDisabled ? 'disabled' : '' ?> readonly />
74
  </div>
75
  <div class="wpstg-form-group wpstg-text-field">
76
+ <a href="#" id="wpstg-db-connect"><?php esc_html_e("Test Database Connection", "wp-staging"); ?></a>
77
  </div>
78
  <hr />
79
  </div>
Backend/views/clone/ajax/mail-setting.php CHANGED
@@ -37,20 +37,20 @@ if ($isPro && !empty($options->current)) {
37
  $emailsAllowed = isset($options->existingClones[$options->current]['emailsAllowed']) ? (bool) $options->existingClones[$options->current]['emailsAllowed'] : $defaultEmailsSending;
38
  } ?>
39
  <p class="wpstg--advance-settings--checkbox">
40
- <label for="wpstg_allow_emails"><?php _e('Allow Emails Sending'); ?></label>
41
  <input type="checkbox" id="wpstg_allow_emails" name="wpstg_allow_emails" value="true" <?php echo $emailsAllowed === true ? 'checked' : '' ?> <?php echo $settingsEnabled === false ? 'disabled' : '' ?> />
42
  <span class="wpstg--tooltip">
43
- <img class="wpstg--dashicons" src="<?php echo esc_attr($scan->getInfoIcon()); ?>" alt="info" />
44
  <span class="wpstg--tooltiptext">
45
- <?php _e('Allow emails sending for this staging site.', 'wp-staging'); ?>
46
  <br /> <br />
47
- <b><?php _e('Note', 'wp-staging') ?>: </b> <?php echo sprintf(__('Even if email sendings is disabled, some plugins might still be able to send out mails if they don\'t depend upon %s.', 'wp-staging'), '<code>wp_mail()</code>'); ?>
48
  </span>
49
  </span>
50
  </p>
51
 
52
  <?php if (!$isPro) { // Show this on only FREE version ?>
53
- <p class="wpstg-dark-alert"><?php _e('These are Pro Features ', 'wp-staging'); ?>
54
- <a href="https://wp-staging.com/?utm_source=wp-admin&utm_medium=wp-admin&utm_campaign=db-external&utm_term=db-external" target="_blank" class="wpstg-button--primary wpstg-button--cta-red wpstg-border--violet"><?php _e("Get Started", "wp-staging"); ?></a>
55
  </p>
56
  <?php } ?>
37
  $emailsAllowed = isset($options->existingClones[$options->current]['emailsAllowed']) ? (bool) $options->existingClones[$options->current]['emailsAllowed'] : $defaultEmailsSending;
38
  } ?>
39
  <p class="wpstg--advance-settings--checkbox">
40
+ <label for="wpstg_allow_emails"><?php esc_html_e('Allow Emails Sending'); ?></label>
41
  <input type="checkbox" id="wpstg_allow_emails" name="wpstg_allow_emails" value="true" <?php echo $emailsAllowed === true ? 'checked' : '' ?> <?php echo $settingsEnabled === false ? 'disabled' : '' ?> />
42
  <span class="wpstg--tooltip">
43
+ <img class="wpstg--dashicons" src="<?php echo esc_url($scan->getInfoIcon()); ?>" alt="info" />
44
  <span class="wpstg--tooltiptext">
45
+ <?php esc_html_e('Allow emails sending for this staging site.', 'wp-staging'); ?>
46
  <br /> <br />
47
+ <b><?php esc_html_e('Note', 'wp-staging') ?>: </b> <?php echo sprintf(esc_html__('Even if email sendings is disabled, some plugins might still be able to send out mails if they don\'t depend upon %s.', 'wp-staging'), '<code>wp_mail()</code>'); ?>
48
  </span>
49
  </span>
50
  </p>
51
 
52
  <?php if (!$isPro) { // Show this on only FREE version ?>
53
+ <p class="wpstg-dark-alert"><?php esc_html_e('These are Pro Features ', 'wp-staging'); ?>
54
+ <a href="https://wp-staging.com/?utm_source=wp-admin&utm_medium=wp-admin&utm_campaign=db-external&utm_term=db-external" target="_blank" class="wpstg-button--primary wpstg-button--cta-red wpstg-border--violet"><?php esc_html_e("Get Started", "wp-staging"); ?></a>
55
  </p>
56
  <?php } ?>
Backend/views/clone/ajax/process-lock.php CHANGED
@@ -2,9 +2,9 @@
2
  <h3><?php echo esc_html($message); ?></h3>
3
 
4
  <button type="button" class="wpstg-prev-step-link wpstg-link-btn button-primary wpstg-button">
5
- <?php _e("Back", "wp-staging") ?>
6
  </button>
7
 
8
  <button type="button" id="wpstg-restart-cloning" class="wpstg-link-btn button-primary wpstg-button">
9
- <?php echo __("Stop other process", "wp-staging")?>
10
  </button>
2
  <h3><?php echo esc_html($message); ?></h3>
3
 
4
  <button type="button" class="wpstg-prev-step-link wpstg-link-btn button-primary wpstg-button">
5
+ <?php esc_html_e("Back", "wp-staging") ?>
6
  </button>
7
 
8
  <button type="button" id="wpstg-restart-cloning" class="wpstg-link-btn button-primary wpstg-button">
9
+ <?php echo esc_html__("Stop other process", "wp-staging")?>
10
  </button>
Backend/views/clone/ajax/scan.php CHANGED
@@ -10,28 +10,29 @@
10
  * @see \WPStaging\Backend\Modules\Jobs\Scan::start For details on $options.
11
  */
12
 
 
13
  use WPStaging\Framework\Facades\Sanitize;
14
 
15
  $isPro = defined('WPSTGPRO_VERSION');
16
  ?>
17
  <label id="wpstg-clone-label" for="wpstg-new-clone">
18
  <input type="text" id="wpstg-new-clone-id" class="wpstg-textbox"
19
- placeholder="<?php _e('Enter Site Name (Optional)', 'wp-staging') ?>"
20
- data-clone="<?php echo $options->current; ?>"
21
  <?php if ($options->current !== null) {
22
  $siteName = isset($options->currentClone['cloneName']) ? Sanitize::sanitizeString(wpstg_urldecode($options->currentClone['cloneName'])) : $options->currentClone['directoryName'];
23
- echo ' value="' . $siteName . '"';
24
  echo " disabled='disabled'";
25
  } ?> />
26
  </label>
27
 
28
  <span class="wpstg-error-msg" id="wpstg-clone-id-error" style="display:none;">
29
  <?php
30
- echo __(
31
  "<br>Probably not enough free disk space to create a staging site. " .
32
  "<br> You can continue but its likely that the copying process will fail.",
33
  "wp-staging"
34
- )
35
  ?>
36
  </span>
37
 
@@ -39,7 +40,7 @@ $isPro = defined('WPSTGPRO_VERSION');
39
  <?php if ($isPro && is_multisite() && is_main_site()) : ?>
40
  <a href="#" class="wpstg-tab-header active expand" data-id="#wpstg-network-options">
41
  <span class="wpstg-tab-triangle wpstg-rotate-90"></span>
42
- <?php echo __("Network Options", "wp-staging") ?>
43
  </a>
44
 
45
  <fieldset class="wpstg-tab-section" id="wpstg-network-options" style="display: block;">
@@ -49,7 +50,7 @@ $isPro = defined('WPSTGPRO_VERSION');
49
 
50
  <a href="#" class="wpstg-tab-header active" data-id="#wpstg-scanning-db">
51
  <span class="wpstg-tab-triangle"></span>
52
- <?php echo __("Database Tables", "wp-staging") ?>
53
  </a>
54
 
55
  <fieldset class="wpstg-tab-section" id="wpstg-scanning-db">
@@ -58,7 +59,7 @@ $isPro = defined('WPSTGPRO_VERSION');
58
 
59
  <a href="#" class="wpstg-tab-header" data-id="#wpstg-scanning-files">
60
  <span class="wpstg-tab-triangle"></span>
61
- <?php echo __("Files", "wp-staging") ?>
62
  </a>
63
 
64
  <fieldset class="wpstg-tab-section" id="wpstg-scanning-files">
@@ -68,8 +69,8 @@ $isPro = defined('WPSTGPRO_VERSION');
68
  <a href="#" class="wpstg-tab-header" data-id="#wpstg-advanced-settings">
69
  <span class="wpstg-tab-triangle wpstg-no-icon"><input type="checkbox" name="wpstg-advanced" value="true"></span>
70
  <?php
71
- $pro = $isPro ? ' ' : ' (Requires Pro Version)';
72
- echo __("Advanced Settings " . $pro, "wp-staging"); ?>
73
  </a>
74
 
75
  <div class="wpstg-tab-section" id="wpstg-advanced-settings">
@@ -89,23 +90,23 @@ if ($options->current !== null && $options->mainJob === 'updating') {
89
  ?>
90
  <fieldset class="wpstg-fieldset" style="margin-left: 16px;">
91
  <p class="wpstg--advance-settings--checkbox">
92
- <label for="wpstg-clean-plugins-themes"><?php _e('Clean Plugins/Themes'); ?></label>
93
  <input type="checkbox" id="wpstg-clean-plugins-themes" name="wpstg-clean-plugins-themes" value="true">
94
  <span class="wpstg--tooltip">
95
- <img class="wpstg--dashicons" src="<?php echo esc_attr($scan->getInfoIcon()); ?>" alt="info" />
96
  <span class="wpstg--tooltiptext">
97
- <?php _e('Delete all plugins & themes on staging site before starting copy process.', 'wp-staging'); ?>
98
  </span>
99
  </span>
100
  </p>
101
  <p class="wpstg--advance-settings--checkbox">
102
- <label for="wpstg-clean-uploads"><?php _e('Clean Uploads'); ?></label>
103
  <input type="checkbox" id="wpstg-clean-uploads" name="wpstg-clean-uploads" value="true">
104
  <span class="wpstg--tooltip">
105
- <img class="wpstg--dashicons" src="<?php echo esc_attr($scan->getInfoIcon()); ?>" alt="info" />
106
  <span class="wpstg--tooltiptext">
107
- <?php _e('Delete entire folder wp-content/uploads on staging site including all images before starting copy process.', 'wp-staging'); ?>
108
- <?php echo ($uploadsSymlinked ? "<br/><br/><b>" . __("Note: This option is disabled as uploads directory is symlinked", "wp-staging") . "</b>" : '') ?>
109
  </span>
110
  </span>
111
  </p>
@@ -116,15 +117,15 @@ if ($options->current !== null && $options->mainJob === 'updating') {
116
  ?>
117
 
118
  <button type="button" class="wpstg-prev-step-link wpstg-button--primary">
119
- <?php _e("Back", "wp-staging") ?>
120
  </button>
121
 
122
  <?php
123
- $label = __("Start Cloning", "wp-staging");
124
  $action = 'wpstg_cloning';
125
  $btnId = 'wpstg-start-cloning';
126
  if ($options->current !== null && $options->mainJob === 'updating') {
127
- $label = __("Update Clone", "wp-staging");
128
  $action = 'wpstg_update';
129
  $btnId = 'wpstg-start-updating';
130
  }
@@ -132,4 +133,4 @@ if ($options->current !== null && $options->mainJob === 'updating') {
132
 
133
  <button type="button" id="<?php echo esc_attr($btnId); ?>" class="wpstg-next-step-link wpstg-button--primary wpstg-button--blue" data-action="<?php echo esc_attr($action); ?>"><?php echo esc_html($label); ?></button>
134
 
135
- <a href="#" id="wpstg-check-space"><?php _e('Check required disk space', 'wp-staging'); ?></a>
10
  * @see \WPStaging\Backend\Modules\Jobs\Scan::start For details on $options.
11
  */
12
 
13
+ use WPStaging\Framework\Facades\Escape;
14
  use WPStaging\Framework\Facades\Sanitize;
15
 
16
  $isPro = defined('WPSTGPRO_VERSION');
17
  ?>
18
  <label id="wpstg-clone-label" for="wpstg-new-clone">
19
  <input type="text" id="wpstg-new-clone-id" class="wpstg-textbox"
20
+ placeholder="<?php esc_html_e('Enter Site Name (Optional)', 'wp-staging') ?>"
21
+ data-clone="<?php echo esc_attr($options->current); ?>"
22
  <?php if ($options->current !== null) {
23
  $siteName = isset($options->currentClone['cloneName']) ? Sanitize::sanitizeString(wpstg_urldecode($options->currentClone['cloneName'])) : $options->currentClone['directoryName'];
24
+ echo ' value="' . esc_attr($siteName) . '"';
25
  echo " disabled='disabled'";
26
  } ?> />
27
  </label>
28
 
29
  <span class="wpstg-error-msg" id="wpstg-clone-id-error" style="display:none;">
30
  <?php
31
+ echo Escape::escapeHtml(__(
32
  "<br>Probably not enough free disk space to create a staging site. " .
33
  "<br> You can continue but its likely that the copying process will fail.",
34
  "wp-staging"
35
+ ))
36
  ?>
37
  </span>
38
 
40
  <?php if ($isPro && is_multisite() && is_main_site()) : ?>
41
  <a href="#" class="wpstg-tab-header active expand" data-id="#wpstg-network-options">
42
  <span class="wpstg-tab-triangle wpstg-rotate-90"></span>
43
+ <?php echo esc_html__("Network Options", "wp-staging") ?>
44
  </a>
45
 
46
  <fieldset class="wpstg-tab-section" id="wpstg-network-options" style="display: block;">
50
 
51
  <a href="#" class="wpstg-tab-header active" data-id="#wpstg-scanning-db">
52
  <span class="wpstg-tab-triangle"></span>
53
+ <?php echo esc_html__("Database Tables", "wp-staging") ?>
54
  </a>
55
 
56
  <fieldset class="wpstg-tab-section" id="wpstg-scanning-db">
59
 
60
  <a href="#" class="wpstg-tab-header" data-id="#wpstg-scanning-files">
61
  <span class="wpstg-tab-triangle"></span>
62
+ <?php echo esc_html__("Files", "wp-staging") ?>
63
  </a>
64
 
65
  <fieldset class="wpstg-tab-section" id="wpstg-scanning-files">
69
  <a href="#" class="wpstg-tab-header" data-id="#wpstg-advanced-settings">
70
  <span class="wpstg-tab-triangle wpstg-no-icon"><input type="checkbox" name="wpstg-advanced" value="true"></span>
71
  <?php
72
+ $advanceSettingsTitle = $isPro ? esc_html__("Advanced Settings ", "wp-staging") : esc_html__('Advanced Settings (Requires Pro Version)', "wp-staging");
73
+ echo esc_html($advanceSettingsTitle); ?>
74
  </a>
75
 
76
  <div class="wpstg-tab-section" id="wpstg-advanced-settings">
90
  ?>
91
  <fieldset class="wpstg-fieldset" style="margin-left: 16px;">
92
  <p class="wpstg--advance-settings--checkbox">
93
+ <label for="wpstg-clean-plugins-themes"><?php esc_html_e('Clean Plugins/Themes'); ?></label>
94
  <input type="checkbox" id="wpstg-clean-plugins-themes" name="wpstg-clean-plugins-themes" value="true">
95
  <span class="wpstg--tooltip">
96
+ <img class="wpstg--dashicons" src="<?php echo esc_url($scan->getInfoIcon()); ?>" alt="info" />
97
  <span class="wpstg--tooltiptext">
98
+ <?php esc_html_e('Delete all plugins & themes on staging site before starting copy process.', 'wp-staging'); ?>
99
  </span>
100
  </span>
101
  </p>
102
  <p class="wpstg--advance-settings--checkbox">
103
+ <label for="wpstg-clean-uploads"><?php esc_html_e('Clean Uploads'); ?></label>
104
  <input type="checkbox" id="wpstg-clean-uploads" name="wpstg-clean-uploads" value="true">
105
  <span class="wpstg--tooltip">
106
+ <img class="wpstg--dashicons" src="<?php echo esc_url($scan->getInfoIcon()); ?>" alt="info" />
107
  <span class="wpstg--tooltiptext">
108
+ <?php esc_html_e('Delete entire folder wp-content/uploads on staging site including all images before starting copy process.', 'wp-staging'); ?>
109
+ <?php echo $uploadsSymlinked ? "<br/><br/><b>" . esc_html__("Note: This option is disabled as uploads directory is symlinked", "wp-staging") . "</b>" : '' ?>
110
  </span>
111
  </span>
112
  </p>
117
  ?>
118
 
119
  <button type="button" class="wpstg-prev-step-link wpstg-button--primary">
120
+ <?php esc_html_e("Back", "wp-staging") ?>
121
  </button>
122
 
123
  <?php
124
+ $label = esc_html__("Start Cloning", "wp-staging");
125
  $action = 'wpstg_cloning';
126
  $btnId = 'wpstg-start-cloning';
127
  if ($options->current !== null && $options->mainJob === 'updating') {
128
+ $label = esc_html__("Update Clone", "wp-staging");
129
  $action = 'wpstg_update';
130
  $btnId = 'wpstg-start-updating';
131
  }
133
 
134
  <button type="button" id="<?php echo esc_attr($btnId); ?>" class="wpstg-next-step-link wpstg-button--primary wpstg-button--blue" data-action="<?php echo esc_attr($action); ?>"><?php echo esc_html($label); ?></button>
135
 
136
+ <a href="#" id="wpstg-check-space"><?php esc_html_e('Check required disk space', 'wp-staging'); ?></a>
Backend/views/clone/ajax/single-overview.php CHANGED
@@ -8,12 +8,12 @@
8
  * @var $license
9
  */
10
 
11
- use WPStaging\Framework\Facades\Sanitize;
12
 
13
  ?>
14
  <div id="wpstg-step-1">
15
  <button id="wpstg-new-clone" class="wpstg-next-step-link wpstg-blue-primary wpstg-button" data-action="wpstg_scanning">
16
- <?php echo __("Create new staging site", "wp-staging") ?>
17
  </button>
18
  </div>
19
 
@@ -21,41 +21,41 @@ use WPStaging\Framework\Facades\Sanitize;
21
  <!-- Existing Clones -->
22
  <div id="wpstg-existing-clones">
23
  <h3>
24
- <?php _e("Your Staging Sites:", "wp-staging") ?>
25
  </h3>
26
  <?php foreach ($availableClones as $cloneID => $data) : ?>
27
- <div id="<?php echo Sanitize::sanitizeString($data['directoryName']); ?>" data-clone-id="<?php echo esc_attr($cloneID); ?>" class="wpstg-clone">
28
  <?php $urlLogin = esc_url($data["url"]); ?>
29
  <div class="wpstg-clone-header">
30
- <a href="<?php echo $urlLogin ?>" class="wpstg-clone-title" target="_blank">
31
- <?php echo isset($data["cloneName"]) ? Sanitize::sanitizeString($data["cloneName"]) : Sanitize::sanitizeString($data["directoryName"]); ?>
32
  </a>
33
  <?php if (is_multisite()) { ?>
34
  <div class="wpstg-clone-labels">
35
- <span class="wpstg-clone-label"><?php echo Sanitize::sanitizeString($data['networkClone']) ? __('Network', 'wp-staging') : __('Site', 'wp-staging') ?></span>
36
  </div>
37
  <?php } ?>
38
  <div class="wpstg-clone-actions">
39
  <div class="wpstg-dropdown wpstg-action-dropdown">
40
  <a href="#" class="wpstg-dropdown-toggler transparent">
41
- <?php _e("Actions", "wp-staging"); ?>
42
  <span class="wpstg-caret"></span>
43
  </a>
44
  <div class="wpstg-dropdown-menu">
45
  <?php
46
  do_action('wpstg.views.single_overview.before_existing_clones_actions', $cloneID, $data, $license);
47
  ?>
48
- <a href="<?php echo $urlLogin ?>" class="wpstg-open-clone wpstg-clone-action" target="_blank" title="<?php echo __("Open the staging site in a new tab", "wp-staging") ?>">
49
- <?php _e("Open", "wp-staging"); ?>
50
  </a>
51
- <a href="#" class="wpstg-execute-clone wpstg-clone-action" data-clone="<?php echo esc_attr($cloneID) ?>" title="<?php echo __("Update and overwrite this clone with files and database tables selected on the next page. This will not replace nor modify the wp-config.php on the staging site!", "wp-staging") ?>">
52
- <?php _e("Update", "wp-staging"); ?>
53
  </a>
54
- <a href="#" class="wpstg-reset-clone wpstg-clone-action" data-clone="<?php echo esc_attr($cloneID) ?>" data-network="<?php echo is_multisite() && $data['networkClone'] ? 'yes' : 'no' ?>" title="<?php echo __("Replace this clone with the production site completely. This includes replacing the wp-config.php and all files and data. Confirm to proceed on the next page.", "wp-staging") ?>">
55
- <?php _e("Reset", "wp-staging"); ?>
56
  </a>
57
- <a href="#" class="wpstg-remove-clone wpstg-clone-action" data-clone="<?php echo esc_attr($cloneID) ?>" title="<?php echo __("Delete this clone. Select specific folders and database tables in the next step.", "wp-staging") ?>">
58
- <?php _e("Delete", "wp-staging"); ?>
59
  </a>
60
  <?php
61
  do_action('wpstg.views.single_overview.after_existing_clones_actions', $cloneID, $data, $license);
@@ -83,7 +83,7 @@ use WPStaging\Framework\Facades\Sanitize;
83
 
84
  if (!empty($data['status']) && $data['status'] !== 'finished') {
85
  $status = sprintf(
86
- __('Status: <span class="wpstg-staging-status wpstg-bold" title="%s">%s</span>', 'wp-staging'),
87
  $statusTooltip,
88
  $data['status']
89
  );
@@ -92,31 +92,49 @@ use WPStaging\Framework\Facades\Sanitize;
92
  }
93
 
94
 
95
- echo sprintf(__('Database: <span class="wpstg-bold">%s</span>', 'wp-staging'), esc_html($dbname));
 
 
 
96
  echo '</br>';
97
- echo sprintf(__('Database Prefix: <span class="wpstg-bold">%s</span>', 'wp-staging'), esc_html($prefix));
 
 
 
98
  echo '</br>';
99
- echo sprintf(__('Directory: <span class="wpstg-bold">%s</span>', 'wp-staging'), esc_html($cloneDir));
 
 
 
100
  echo '</br>';
101
- echo sprintf(__('URL: <span class="wpstg-bold">%s</span>', 'wp-staging'), $url);
 
 
 
102
  echo '</br>';
103
- echo sprintf(__('Created By: <span class="wpstg-bold">%s</span>', 'wp-staging'), esc_html($ownerName));
 
 
 
104
  echo '</br>';
105
- echo $status;
106
  echo '</br>';
107
- echo sprintf(__('Updated: <span>%s</span>', 'wp-staging'), esc_html($datetime));
 
 
 
108
 
109
  // Todo: Remove in future versions
110
  if (function_exists('do_action_deprecated')) {
111
  // do_action_deprecated exists since WP 4.6
112
- echo do_action_deprecated("wpstg.views.single_overview.after_existing_clones_details", [$cloneID, $data, $license], '2.7.6', '', 'This will be removed from the future update');
113
  }
114
  ?>
115
  </div>
116
  </div>
117
  <?php endforeach ?>
118
  <div class="wpstg-fs-14">
119
- <?php _e("How to:", "wp-staging") ?> <a href="https://wp-staging.com/docs/copy-staging-site-to-live-site/" target="_blank"><?php _e("Push staging site to production", "wp-staging") ?></a>
120
  </div>
121
  </div>
122
  <!-- /Existing Clones -->
@@ -125,9 +143,9 @@ use WPStaging\Framework\Facades\Sanitize;
125
  <div id="wpstg-no-staging-site-results" class="wpstg-clone" <?php echo $availableClones !== [] ? 'style="display: none;"' : '' ?> >
126
  <img class="wpstg--dashicons" src="<?php echo esc_url($iconPath); ?>" alt="cloud">
127
  <div class="no-staging-site-found-text">
128
- <?php _e('No Staging Site found. Create your first Staging Site above!', 'wp-staging'); ?>
129
  </div>
130
- </div>
131
 
132
  <!-- Remove Clone -->
133
  <div id="wpstg-removing-clone">
8
  * @var $license
9
  */
10
 
11
+ use WPStaging\Framework\Facades\Escape;
12
 
13
  ?>
14
  <div id="wpstg-step-1">
15
  <button id="wpstg-new-clone" class="wpstg-next-step-link wpstg-blue-primary wpstg-button" data-action="wpstg_scanning">
16
+ <?php echo esc_html__("Create new staging site", "wp-staging") ?>
17
  </button>
18
  </div>
19
 
21
  <!-- Existing Clones -->
22
  <div id="wpstg-existing-clones">
23
  <h3>
24
+ <?php esc_html_e("Your Staging Sites:", "wp-staging") ?>
25
  </h3>
26
  <?php foreach ($availableClones as $cloneID => $data) : ?>
27
+ <div id="<?php echo esc_attr($data['directoryName']); ?>" data-clone-id="<?php echo esc_attr($cloneID); ?>" class="wpstg-clone">
28
  <?php $urlLogin = esc_url($data["url"]); ?>
29
  <div class="wpstg-clone-header">
30
+ <a href="<?php echo esc_url($urlLogin) ?>" class="wpstg-clone-title" target="_blank">
31
+ <?php echo isset($data["cloneName"]) ? esc_html($data["cloneName"]) : esc_html($data["directoryName"]); ?>
32
  </a>
33
  <?php if (is_multisite()) { ?>
34
  <div class="wpstg-clone-labels">
35
+ <span class="wpstg-clone-label"><?php echo !empty($data['networkClone']) ? esc_html__('Network Site', 'wp-staging') : esc_html__('Single Site', 'wp-staging') ?></span>
36
  </div>
37
  <?php } ?>
38
  <div class="wpstg-clone-actions">
39
  <div class="wpstg-dropdown wpstg-action-dropdown">
40
  <a href="#" class="wpstg-dropdown-toggler transparent">
41
+ <?php esc_html_e("Actions", "wp-staging"); ?>
42
  <span class="wpstg-caret"></span>
43
  </a>
44
  <div class="wpstg-dropdown-menu">
45
  <?php
46
  do_action('wpstg.views.single_overview.before_existing_clones_actions', $cloneID, $data, $license);
47
  ?>
48
+ <a href="<?php echo esc_url($urlLogin) ?>" class="wpstg-open-clone wpstg-clone-action" target="_blank" title="<?php echo esc_html__("Open the staging site in a new tab", "wp-staging") ?>">
49
+ <?php esc_html_e("Open", "wp-staging"); ?>
50
  </a>
51
+ <a href="#" class="wpstg-execute-clone wpstg-clone-action" data-clone="<?php echo esc_attr($cloneID) ?>" title="<?php echo esc_html__("Update and overwrite this clone with files and database tables selected on the next page. This will not replace nor modify the wp-config.php on the staging site!", "wp-staging") ?>">
52
+ <?php esc_html_e("Update", "wp-staging"); ?>
53
  </a>
54
+ <a href="#" class="wpstg-reset-clone wpstg-clone-action" data-clone="<?php echo esc_attr($cloneID) ?>" data-network="<?php echo is_multisite() && $data['networkClone'] ? 'yes' : 'no' ?>" title="<?php echo esc_attr__("Replace this clone with the production site completely. This includes replacing the wp-config.php and all files and data. Confirm to proceed on the next page.", "wp-staging") ?>">
55
+ <?php esc_html_e("Reset", "wp-staging"); ?>
56
  </a>
57
+ <a href="#" class="wpstg-remove-clone wpstg-clone-action" data-clone="<?php echo esc_attr($cloneID) ?>" title="<?php echo esc_html__("Delete this clone. Select specific folders and database tables in the next step.", "wp-staging") ?>">
58
+ <?php esc_html_e("Delete", "wp-staging"); ?>
59
  </a>
60
  <?php
61
  do_action('wpstg.views.single_overview.after_existing_clones_actions', $cloneID, $data, $license);
83
 
84
  if (!empty($data['status']) && $data['status'] !== 'finished') {
85
  $status = sprintf(
86
+ Escape::escapeHtml(__('Status: <span class="wpstg-staging-status wpstg-bold" title="%s">%s</span>', 'wp-staging')),
87
  $statusTooltip,
88
  $data['status']
89
  );
92
  }
93
 
94
 
95
+ echo sprintf(
96
+ Escape::escapeHtml(__('Database: <span class="wpstg-bold">%s</span>', 'wp-staging')),
97
+ esc_html($dbname)
98
+ );
99
  echo '</br>';
100
+ echo sprintf(
101
+ Escape::escapeHtml(__('Database Prefix: <span class="wpstg-bold">%s</span>', 'wp-staging')),
102
+ esc_html($prefix)
103
+ );
104
  echo '</br>';
105
+ echo sprintf(
106
+ Escape::escapeHtml(__('Directory: <span class="wpstg-bold">%s</span>', 'wp-staging')),
107
+ esc_html($cloneDir)
108
+ );
109
  echo '</br>';
110
+ echo sprintf(
111
+ Escape::escapeHtml(__('URL: <span class="wpstg-bold">%s</span>', 'wp-staging')),
112
+ Escape::escapeHtml(__($url, 'wp-staging'))
113
+ );
114
  echo '</br>';
115
+ echo sprintf(
116
+ Escape::escapeHtml(__('Created By: <span class="wpstg-bold">%s</span>', 'wp-staging')),
117
+ esc_html($ownerName)
118
+ );
119
  echo '</br>';
120
+ echo Escape::escapeHtml(__($status, 'wp-staging'));
121
  echo '</br>';
122
+ echo sprintf(
123
+ Escape::escapeHtml(__('Updated: <span>%s</span>', 'wp-staging')),
124
+ esc_html($datetime)
125
+ );
126
 
127
  // Todo: Remove in future versions
128
  if (function_exists('do_action_deprecated')) {
129
  // do_action_deprecated exists since WP 4.6
130
+ do_action_deprecated("wpstg.views.single_overview.after_existing_clones_details", [$cloneID, $data, $license], '2.7.6', '', 'This will be removed from the future update');
131
  }
132
  ?>
133
  </div>
134
  </div>
135
  <?php endforeach ?>
136
  <div class="wpstg-fs-14">
137
+ <?php esc_html_e("How to:", "wp-staging") ?> <a href="https://wp-staging.com/docs/copy-staging-site-to-live-site/" target="_blank"><?php esc_html_e("Push staging site to production", "wp-staging") ?></a>
138
  </div>
139
  </div>
140
  <!-- /Existing Clones -->
143
  <div id="wpstg-no-staging-site-results" class="wpstg-clone" <?php echo $availableClones !== [] ? 'style="display: none;"' : '' ?> >
144
  <img class="wpstg--dashicons" src="<?php echo esc_url($iconPath); ?>" alt="cloud">
145
  <div class="no-staging-site-found-text">
146
+ <?php esc_html_e('No Staging Site found. Create your first Staging Site above!', 'wp-staging'); ?>
147
  </div>
148
+ </div>
149
 
150
  <!-- Remove Clone -->
151
  <div id="wpstg-removing-clone">
Backend/views/clone/ajax/start.php CHANGED
@@ -1,11 +1,15 @@
1
  <?php
 
2
  /**
3
  * @see \WPStaging\Backend\Administrator::ajaxStartClone A place where this view is being called.
4
  * @var \WPStaging\Backend\Modules\Jobs\Cloning $cloning
5
  */
 
 
 
6
  ?>
7
  <div class="successfullying-section">
8
- <h2 id="wpstg-processing-header"><?php echo __("Processing, please wait...", "wp-staging")?></h2>
9
  <div class="wpstg-progress-bar">
10
  <div class="wpstg-progress" id="wpstg-progress-db"></div>
11
  <div class="wpstg-progress" id="wpstg-progress-sr"></div>
@@ -20,15 +24,15 @@
20
  </div>
21
 
22
  <button type="button" id="wpstg-cancel-cloning" class="wpstg-button--primary wpstg-button--red">
23
- <?php echo __("Cancel", "wp-staging")?>
24
  </button>
25
 
26
  <button type="button" id="wpstg-resume-cloning" class="wpstg-link-btn wpstg-button--primary wpstg-button--blue">
27
- <?php echo __("Resume", "wp-staging")?>
28
  </button>
29
 
30
  <button type="button" id="wpstg-show-log-button" class="button" data-clone="<?php echo esc_attr($cloning->getOptions()->clone) ?>" style="margin-top: 5px;display:none;">
31
- <?php _e('Display working log', 'wp-staging')?>
32
  </button>
33
 
34
  <div>
@@ -36,52 +40,58 @@
36
  </div>
37
 
38
  <div id="wpstg-finished-result" class="wpstg--grey">
39
- <h3><?php _e('Congratulations', 'wp-staing') ?></h3>
40
  <?php
41
  $subDirectory = str_replace(get_home_path(), '', ABSPATH);
42
  $helper = new \WPStaging\Core\Utils\Helper();
43
  $url = $helper->getHomeUrl() . str_replace('/', '', $subDirectory);
44
- echo sprintf(__('WP STAGING successfully created a staging site in a sub-directory of your main site accessable from:<br><strong><a href="%1$s" target="_blank" id="wpstg-clone-url-1">%1$s</a></strong>', 'wp-staging'), esc_attr($url));
 
 
 
45
  ?>
46
  <br>
47
  <br>
48
  <a href="" class="wpstg-button--primary" id="wpstg-home-link">
49
- <?php echo __("BACK", "wp-staging")?>
50
  </a>
51
- <a href="<?php echo $url; ?>" id="wpstg-clone-url" target="_blank" class="wpstg-link-btn wpstg-blue-primary">
52
- <?php _e('Open Staging Site', 'wp-staging') ?>
53
  </a>
54
  <div id="wpstg-success-notice">
55
  <h3>
56
- <?php _e("Please read this first:", "wp-staging")?>
57
  </h3>
58
  <ul>
59
  <li>
60
- <strong><?php echo sprintf(__('1. Post name permalinks on your %s have been disabled for technical reasons. ', 'wp-staging'), '<span class="wpstg-font-italic">' . __('staging site', 'wp-staging') . '</span>') ?></strong>
61
  <br>
62
- <?php _e('Usually this will not affect your staging website. In 99% of all cases you do not need to activate permalinks.', 'wp-staging') ?>
63
  <br>
64
  <p>
65
- <?php _e('If Apache is the webserver there is a good chance that permalinks can be activated without further modifications. Try to activate them from', 'wp-staging') ?> <br/>
66
  <br>
67
  <strong>Staging Site > wp-admin > Settings > Permalinks</strong></a>
68
  <br/><br/>
69
- <?php _e('If this does not work or Nginx webserver is used there might be some modifications needed in the files .htaccess (Apache) or *.conf (Nginx).', 'wp-staging') ?>
70
  </p>
71
  <p>
72
- <strong><?php echo sprintf(__('<a href="%s" target="_blank">Read this tutorial</a> to learn how to enable permalinks on the staging site.', 'wp-staging'), 'https://wp-staging.com/docs/activate-permalinks-staging-site/?utm_source=wpstg_admin&utm_medium=finish_screen&utm_campaign=tutorial') ?></strong>
 
 
 
73
  </p>
74
  </li>
75
  <li>
76
- <strong><?php _e('2. Verify that you are REALLY working on your staging site and NOT on your production site if you are not 100% sure!', 'wp-staging') ?> </strong>
77
  <br>
78
- <?php _e('Your main and your staging site are both reachable under the same domain so <br> this can be confusing.', 'wp-staging') ?>
79
  <p>
80
- <?php _e('To make it more clear when you work on the staging site WP Staging changed the color of the admin bar:', 'wp-staging') ?>
81
  <br><br>
82
  <img src="<?php echo esc_url($this->assets->getAssetsUrl("img/admin_dashboard.png")) ?>">
83
  <br>
84
- <?php _e('On the front page the site name also changed to', 'wp-staging') ?> <br>
85
  <strong class="wpstg-font-italic">
86
  "STAGING - <span class="wpstg-clone-name"><?php echo esc_html(get_bloginfo("name")) ?></span>"
87
  </strong>.
1
  <?php
2
+
3
  /**
4
  * @see \WPStaging\Backend\Administrator::ajaxStartClone A place where this view is being called.
5
  * @var \WPStaging\Backend\Modules\Jobs\Cloning $cloning
6
  */
7
+
8
+ use WPStaging\Framework\Facades\Escape;
9
+
10
  ?>
11
  <div class="successfullying-section">
12
+ <h2 id="wpstg-processing-header"><?php echo esc_html__("Processing, please wait...", "wp-staging")?></h2>
13
  <div class="wpstg-progress-bar">
14
  <div class="wpstg-progress" id="wpstg-progress-db"></div>
15
  <div class="wpstg-progress" id="wpstg-progress-sr"></div>
24
  </div>
25
 
26
  <button type="button" id="wpstg-cancel-cloning" class="wpstg-button--primary wpstg-button--red">
27
+ <?php echo esc_html__("Cancel", "wp-staging")?>
28
  </button>
29
 
30
  <button type="button" id="wpstg-resume-cloning" class="wpstg-link-btn wpstg-button--primary wpstg-button--blue">
31
+ <?php echo esc_html__("Resume", "wp-staging")?>
32
  </button>
33
 
34
  <button type="button" id="wpstg-show-log-button" class="button" data-clone="<?php echo esc_attr($cloning->getOptions()->clone) ?>" style="margin-top: 5px;display:none;">
35
+ <?php esc_html_e('Display working log', 'wp-staging')?>
36
  </button>
37
 
38
  <div>
40
  </div>
41
 
42
  <div id="wpstg-finished-result" class="wpstg--grey">
43
+ <h3><?php esc_html_e('Congratulations', 'wp-staing') ?></h3>
44
  <?php
45
  $subDirectory = str_replace(get_home_path(), '', ABSPATH);
46
  $helper = new \WPStaging\Core\Utils\Helper();
47
  $url = $helper->getHomeUrl() . str_replace('/', '', $subDirectory);
48
+ echo sprintf(
49
+ Escape::escapeHtml(__('WP STAGING successfully created a staging site in a sub-directory of your main site accessable from:<br><strong><a href="%1$s" target="_blank" id="wpstg-clone-url-1">%1$s</a></strong>', 'wp-staging')),
50
+ esc_url($url)
51
+ );
52
  ?>
53
  <br>
54
  <br>
55
  <a href="" class="wpstg-button--primary" id="wpstg-home-link">
56
+ <?php echo esc_html__("BACK", "wp-staging")?>
57
  </a>
58
+ <a href="<?php echo esc_url($url); ?>" id="wpstg-clone-url" target="_blank" class="wpstg-link-btn wpstg-blue-primary">
59
+ <?php esc_html_e('Open Staging Site', 'wp-staging') ?>
60
  </a>
61
  <div id="wpstg-success-notice">
62
  <h3>
63
+ <?php esc_html_e("Please read this first:", "wp-staging")?>
64
  </h3>
65
  <ul>
66
  <li>
67
+ <strong><?php echo sprintf(esc_html__('1. Post name permalinks on your %s have been disabled for technical reasons. ', 'wp-staging'), '<span class="wpstg-font-italic">' . esc_html__('staging site', 'wp-staging') . '</span>') ?></strong>
68
  <br>
69
+ <?php esc_html_e('Usually this will not affect your staging website. In 99% of all cases you do not need to activate permalinks.', 'wp-staging') ?>
70
  <br>
71
  <p>
72
+ <?php esc_html_e('If Apache is the webserver there is a good chance that permalinks can be activated without further modifications. Try to activate them from', 'wp-staging') ?> <br/>
73
  <br>
74
  <strong>Staging Site > wp-admin > Settings > Permalinks</strong></a>
75
  <br/><br/>
76
+ <?php esc_html_e('If this does not work or Nginx webserver is used there might be some modifications needed in the files .htaccess (Apache) or *.conf (Nginx).', 'wp-staging') ?>
77
  </p>
78
  <p>
79
+ <strong><?php echo sprintf(
80
+ Escape::escapeHtml(__('<a href="%s" target="_blank">Read this tutorial</a> to learn how to enable permalinks on the staging site.', 'wp-staging')),
81
+ 'https://wp-staging.com/docs/activate-permalinks-staging-site/?utm_source=wpstg_admin&utm_medium=finish_screen&utm_campaign=tutorial'
82
+ ) ?></strong>
83
  </p>
84
  </li>
85
  <li>
86
+ <strong><?php esc_html_e('2. Verify that you are REALLY working on your staging site and NOT on your production site if you are not 100% sure!', 'wp-staging') ?> </strong>
87
  <br>
88
+ <?php esc_html_e('Your main and your staging site are both reachable under the same domain so <br> this can be confusing.', 'wp-staging') ?>
89
  <p>
90
+ <?php esc_html_e('To make it more clear when you work on the staging site WP Staging changed the color of the admin bar:', 'wp-staging') ?>
91
  <br><br>
92
  <img src="<?php echo esc_url($this->assets->getAssetsUrl("img/admin_dashboard.png")) ?>">
93
  <br>
94
+ <?php esc_html_e('On the front page the site name also changed to', 'wp-staging') ?> <br>
95
  <strong class="wpstg-font-italic">
96
  "STAGING - <span class="wpstg-clone-name"><?php echo esc_html(get_bloginfo("name")) ?></span>"
97
  </strong>.
Backend/views/clone/ajax/update.php CHANGED
@@ -6,7 +6,7 @@
6
  */
7
  ?>
8
  <div class=successfullying-section">
9
- <h2 id="wpstg-processing-header"><?php echo __("Processing, please wait...", "wp-staging")?></h2>
10
  <div class="wpstg-progress-bar">
11
  <div class="wpstg-progress" id="wpstg-progress-db"></div>
12
  <div class="wpstg-progress" id="wpstg-progress-sr"></div>
@@ -21,21 +21,21 @@
21
  </div>
22
 
23
  <button type="button" class="wpstg-prev-step-link wpstg-button--primary wpstg-mt-10px" style="display: none;">
24
- <?php _e("Back", "wp-staging") ?>
25
  </button>
26
 
27
  <button type="button" id="wpstg-cancel-cloning-update" data-job="<?php echo esc_attr($cloning->getOptions()->mainJob); ?>" class="wpstg-link-btn wpstg-button--primary wpstg-button--red">
28
  <?php
29
  if ($cloning->getOptions()->mainJob === 'resetting') {
30
- _e("Cancel Reset", "wp-staging");
31
  } else {
32
- _e("Cancel Update", "wp-staging");
33
  }
34
  ?>
35
  </button>
36
 
37
  <button type="button" id="wpstg-show-log-button" class="button" data-clone="<?php echo esc_attr($cloning->getOptions()->clone) ?>" style="margin-top: 5px;display:none;">
38
- <?php _e('Display working log', 'wp-staging')?>
39
  </button>
40
 
41
  <div>
6
  */
7
  ?>
8
  <div class=successfullying-section">
9
+ <h2 id="wpstg-processing-header"><?php echo esc_html__("Processing, please wait...", "wp-staging")?></h2>
10
  <div class="wpstg-progress-bar">
11
  <div class="wpstg-progress" id="wpstg-progress-db"></div>
12
  <div class="wpstg-progress" id="wpstg-progress-sr"></div>
21
  </div>
22
 
23
  <button type="button" class="wpstg-prev-step-link wpstg-button--primary wpstg-mt-10px" style="display: none;">
24
+ <?php esc_html_e("Back", "wp-staging") ?>
25
  </button>
26
 
27
  <button type="button" id="wpstg-cancel-cloning-update" data-job="<?php echo esc_attr($cloning->getOptions()->mainJob); ?>" class="wpstg-link-btn wpstg-button--primary wpstg-button--red">
28
  <?php
29
  if ($cloning->getOptions()->mainJob === 'resetting') {
30
+ esc_html_e("Cancel Reset", "wp-staging");
31
  } else {
32
+ esc_html_e("Cancel Update", "wp-staging");
33
  }
34
  ?>
35
  </button>
36
 
37
  <button type="button" id="wpstg-show-log-button" class="button" data-clone="<?php echo esc_attr($cloning->getOptions()->clone) ?>" style="margin-top: 5px;display:none;">
38
+ <?php esc_html_e('Display working log', 'wp-staging')?>
39
  </button>
40
 
41
  <div>
Backend/views/clone/index.php CHANGED
@@ -27,13 +27,13 @@
27
  <div class="wpstg--tab--header">
28
  <ul>
29
  <li>
30
- <a class="wpstg--tab--content <?php echo $classStagingPageActive; ?> wpstg-button" data-target="#wpstg--tab--staging">
31
- <?php _e('Staging', 'wp-staging') ?>
32
  </a>
33
  </li>
34
  <li>
35
- <a class="wpstg-button <?php echo $classBackupPageActive; ?>" data-target="#wpstg--tab--backup" id="wpstg--tab--toggle--backup">
36
- <?php _e('Backup & Migration', 'wp-staging') ?>
37
  </a>
38
  </li>
39
  <li class="wpstg-tab-item--vert-center">
@@ -42,7 +42,7 @@
42
  </ul>
43
  </div>
44
  <div class="wpstg--tab--contents">
45
- <div id="wpstg--tab--staging" class="wpstg--tab--content <?php echo $classStagingPageActive; ?>">
46
  <?php
47
  if (!$this->siteInfo->isCloneable()) {
48
  // Staging site but not cloneable
@@ -55,10 +55,10 @@
55
  }
56
  ?>
57
  </div>
58
- <div id="wpstg--tab--backup" class="wpstg--tab--content <?php echo $classBackupPageActive; ?>">
59
  <?php
60
  if (defined('WPSTGPRO_VERSION')) {
61
- _e('Loading...', 'wp-staging');
62
  } else {
63
  require_once($this->path . "views/backup/free-version.php");
64
  }
27
  <div class="wpstg--tab--header">
28
  <ul>
29
  <li>
30
+ <a class="wpstg--tab--content <?php echo esc_attr($classStagingPageActive); ?> wpstg-button" data-target="#wpstg--tab--staging">
31
+ <?php esc_html_e('Staging', 'wp-staging') ?>
32
  </a>
33
  </li>
34
  <li>
35
+ <a class="wpstg-button <?php echo esc_attr($classBackupPageActive); ?>" data-target="#wpstg--tab--backup" id="wpstg--tab--toggle--backup">
36
+ <?php esc_html_e('Backup & Migration', 'wp-staging') ?>
37
  </a>
38
  </li>
39
  <li class="wpstg-tab-item--vert-center">
42
  </ul>
43
  </div>
44
  <div class="wpstg--tab--contents">
45
+ <div id="wpstg--tab--staging" class="wpstg--tab--content <?php echo esc_attr($classStagingPageActive); ?>">
46
  <?php
47
  if (!$this->siteInfo->isCloneable()) {
48
  // Staging site but not cloneable
55
  }
56
  ?>
57
  </div>
58
+ <div id="wpstg--tab--backup" class="wpstg--tab--content <?php echo esc_attr($classBackupPageActive); ?>">
59
  <?php
60
  if (defined('WPSTGPRO_VERSION')) {
61
+ esc_html_e('Loading...', 'wp-staging');
62
  } else {
63
  require_once($this->path . "views/backup/free-version.php");
64
  }
Backend/views/clone/multi-site/index.php CHANGED
@@ -1,3 +1,11 @@
 
 
 
 
 
1
  <span class="wpstg-notice-alert wpstg-mt-20px">
2
- <?php echo sprintf(__('WordPress Multisite is not supported! Upgrade to <a href="%s" target="_blank">WP STAGING | PRO</a>', 'wp-staging'), 'https://wp-staging.com/')?>
3
- </span>
 
 
 
1
+ <?php
2
+
3
+ use WPStaging\Framework\Facades\Escape;
4
+
5
+ ?>
6
  <span class="wpstg-notice-alert wpstg-mt-20px">
7
+ <?php echo sprintf(
8
+ Escape::escapeHtml(__('WordPress Multisite is not supported! Upgrade to <a href="%s" target="_blank">WP STAGING | PRO</a>', 'wp-staging')),
9
+ 'https://wp-staging.com/'
10
+ )?>
11
+ </span>
Backend/views/clone/single-site/index.php CHANGED
@@ -1,24 +1,24 @@
1
  <ul id="wpstg-steps">
2
  <li class="wpstg-current-step wpstg-step1">
3
  <span class="wpstg-step-num">1</span>
4
- <?php echo __("Overview", "wp-staging") ?>
5
  </li>
6
  <li class="wpstg-step2">
7
  <span class="wpstg-step-num">2</span>
8
- <?php echo __("Scanning", "wp-staging") ?>
9
  </li>
10
  <li class="wpstg-step3 wpstg-step3-cloning">
11
  <span class="wpstg-step-num">3</span>
12
- <?php echo __("Cloning", "wp-staging") ?>
13
  </li>
14
  <li class="wpstg-step3 wpstg-step3-pushing" style="display: none;">
15
  <span class="wpstg-step-num">3</span>
16
- <?php echo __("Pushing", "wp-staging") ?>
17
  </li>
18
  <li>
19
  <div id="wpstg-report-issue-wrapper">
20
  <button type="button" id="wpstg-report-issue-button" class="wpstg-button">
21
- <i class="wpstg-icon-issue"></i><?php echo __("Report Issue", "wp-staging"); ?>
22
  </button>
23
  <?php require_once($this->path . 'views/_main/report-issue.php'); ?>
24
  </div>
1
  <ul id="wpstg-steps">
2
  <li class="wpstg-current-step wpstg-step1">
3
  <span class="wpstg-step-num">1</span>
4
+ <?php echo esc_html__("Overview", "wp-staging") ?>
5
  </li>
6
  <li class="wpstg-step2">
7
  <span class="wpstg-step-num">2</span>
8
+ <?php echo esc_html__("Scanning", "wp-staging") ?>
9
  </li>
10
  <li class="wpstg-step3 wpstg-step3-cloning">
11
  <span class="wpstg-step-num">3</span>
12
+ <?php echo esc_html__("Cloning", "wp-staging") ?>
13
  </li>
14
  <li class="wpstg-step3 wpstg-step3-pushing" style="display: none;">
15
  <span class="wpstg-step-num">3</span>
16
+ <?php echo esc_html__("Pushing", "wp-staging") ?>
17
  </li>
18
  <li>
19
  <div id="wpstg-report-issue-wrapper">
20
  <button type="button" id="wpstg-report-issue-button" class="wpstg-button">
21
+ <i class="wpstg-icon-issue"></i><?php echo esc_html__("Report Issue", "wp-staging"); ?>
22
  </button>
23
  <?php require_once($this->path . 'views/_main/report-issue.php'); ?>
24
  </div>
Backend/views/clone/staging-site/index.php CHANGED
@@ -5,14 +5,22 @@
5
  * @see /Backend/views/clone/index.php
6
  */
7
 
 
 
8
  ?>
9
 
10
  <span class="wpstg-notice--white wpstg-mt-20px">
11
- <?php echo __("If you want to transfer this staging site to the production site,", "wp-staging") ?>
12
  <br/>
13
- <?php echo sprintf(__("<a href='%s' target='_new'>Open WP STAGING on Live Site</a> and start the push process from there.", 'wp-staging'), (new WPStaging\Framework\Utils\Urls())->getProductionHostname() . '/wp-admin/admin.php?page=wpstg_clone'); ?>
 
 
 
14
  <br/> <br/>
15
- <?php _e("If you want to clone this staging site, you can <a href='#' id='wpstg-enable-staging-cloning'>click here</a>!", 'wp-staging'); ?>
16
  <br/> <br/>
17
- <?php echo sprintf(__("<a href='%s' target='_new'>Read this article</a> if you would like to know more about cloning a staging site.", 'wp-staging'), 'https://wp-staging.com/docs/cloning-a-staging-site-testing-push-method/'); ?>
 
 
 
18
  </span>
5
  * @see /Backend/views/clone/index.php
6
  */
7
 
8
+ use WPStaging\Framework\Facades\Escape;
9
+
10
  ?>
11
 
12
  <span class="wpstg-notice--white wpstg-mt-20px">
13
+ <?php echo esc_html__("If you want to transfer this staging site to the production site,", "wp-staging") ?>
14
  <br/>
15
+ <?php echo sprintf(
16
+ Escape::escapeHtml(__("<a href='%s' target='_new'>Open WP STAGING on Live Site</a> and start the push process from there.", 'wp-staging', 'wp-staging')),
17
+ esc_url((new WPStaging\Framework\Utils\Urls())->getProductionHostname() . '/wp-admin/admin.php?page=wpstg_clone')
18
+ ); ?>
19
  <br/> <br/>
20
+ <?php echo Escape::escapeHtml(__("If you want to clone this staging site, you can <a href='#' id='wpstg-enable-staging-cloning'>click here</a>!", 'wp-staging')); ?>
21
  <br/> <br/>
22
+ <?php echo sprintf(
23
+ Escape::escapeHtml(__("<a href='%s' target='_new'>Read this article</a> if you would like to know more about cloning a staging site.", 'wp-staging', 'wp-staging')),
24
+ 'https://wp-staging.com/docs/cloning-a-staging-site-testing-push-method/'
25
+ ); ?>
26
  </span>
Backend/views/feedback/deactivate-feedback.php CHANGED
@@ -1,15 +1,15 @@
1
  <?php
2
  $reasons = [
3
- 1 => '<li><label><input type="radio" name="wpstg_disable_reason" value="temporary"/>' . __('Only temporary', 'wp-staging') . '</label></li>',
4
  //2 => '<li><label><input type="radio" name="wpstg_disable_reason" value="stopped showing social buttons"/>' . __('I do not use it any longer ', 'wp-staging') . '</label></li>',
5
- 3 => '<li><label><input type="radio" name="wpstg_disable_reason" value="missing feature"/>' . __('Miss a feature', 'wp-staging') . '</label></li>
6
  <li><input type="text" name="wpstg_disable_text[]" value="" placeholder="Please describe the feature"/></li>',
7
- 4 => '<li><label><input type="radio" name="wpstg_disable_reason" value="technical issue"/>' . __('Technical Issue', 'wp-staging') . '</label></li>
8
- <li><textarea name="wpstg_disable_text[]" placeholder="' . __('Can we help? Please describe your problem', 'wp-staging') . '"></textarea></li>',
9
- 5 => '<li><label><input type="radio" name="wpstg_disable_reason" value="other plugin"/>' . __('Switched to another plugin/staging solution', 'wp-staging') . '</label></li>
10
  <li><input type="text" name="wpstg_disable_text[]" value="" placeholder="Name of the plugin"/></li>',
11
- 6 => '<li><label><input type="radio" name="wpstg_disable_reason" value="other"/>' . __('Other reason', 'wp-staging') . '</label></li>
12
- <li><textarea name="wpstg_disable_text[]" placeholder="' . __('Please specify, if possible', 'wp-staging') . '"></textarea></li>',
13
  ];
14
  shuffle($reasons);
15
  ?>
@@ -18,20 +18,20 @@ shuffle($reasons);
18
  <div id="wpstg-feedback-overlay" style="display: none;">
19
  <div id="wpstg-feedback-content">
20
  <form action="" method="post">
21
- <h3><strong><?php _e('Please let us know why you are deactivating:', 'wp-staging'); ?></strong></h3>
22
  <ul>
23
  <?php
24
  foreach ($reasons as $reason) {
25
- echo $reason;
26
  }
27
  ?>
28
  </ul>
29
  <?php if ($email) : ?>
30
- <input type="hidden" name="wpstg_disable_from" value="<?php echo $email; ?>"/>
31
  <?php endif; ?>
32
- <input id="wpstg-feedback-submit" class="button button-primary" type="submit" name="wpstg_disable_submit" value="<?php _e('Submit & Deactivate', 'wp-staging'); ?>"/>
33
- <a class="button"><?php _e('Only Deactivate', 'wp-staging'); ?></a>
34
- <a class="wpstg-feedback-not-deactivate" href="#"><?php _e('Don\'t deactivate', 'wp-staging'); ?></a>
35
  </form>
36
  </div>
37
  </div>
1
  <?php
2
  $reasons = [
3
+ 1 => '<li><label><input type="radio" name="wpstg_disable_reason" value="temporary"/>' . esc_html__('Only temporary', 'wp-staging') . '</label></li>',
4
  //2 => '<li><label><input type="radio" name="wpstg_disable_reason" value="stopped showing social buttons"/>' . __('I do not use it any longer ', 'wp-staging') . '</label></li>',
5
+ 3 => '<li><label><input type="radio" name="wpstg_disable_reason" value="missing feature"/>' . esc_html__('Miss a feature', 'wp-staging') . '</label></li>
6
  <li><input type="text" name="wpstg_disable_text[]" value="" placeholder="Please describe the feature"/></li>',
7
+ 4 => '<li><label><input type="radio" name="wpstg_disable_reason" value="technical issue"/>' . esc_html__('Technical Issue', 'wp-staging') . '</label></li>
8
+ <li><textarea name="wpstg_disable_text[]" placeholder="' . esc_html__('Can we help? Please describe your problem', 'wp-staging') . '"></textarea></li>',
9
+ 5 => '<li><label><input type="radio" name="wpstg_disable_reason" value="other plugin"/>' . esc_html__('Switched to another plugin/staging solution', 'wp-staging') . '</label></li>
10
  <li><input type="text" name="wpstg_disable_text[]" value="" placeholder="Name of the plugin"/></li>',
11
+ 6 => '<li><label><input type="radio" name="wpstg_disable_reason" value="other"/>' . esc_html__('Other reason', 'wp-staging') . '</label></li>
12
+ <li><textarea name="wpstg_disable_text[]" placeholder="' . esc_html__('Please specify, if possible', 'wp-staging') . '"></textarea></li>',
13
  ];
14
  shuffle($reasons);
15
  ?>
18
  <div id="wpstg-feedback-overlay" style="display: none;">
19
  <div id="wpstg-feedback-content">
20
  <form action="" method="post">
21
+ <h3><strong><?php esc_html_e('Please let us know why you are deactivating:', 'wp-staging'); ?></strong></h3>
22
  <ul>
23
  <?php
24
  foreach ($reasons as $reason) {
25
+ echo $reason; //phpcs:ignore
26
  }
27
  ?>
28
  </ul>
29
  <?php if ($email) : ?>
30
+ <input type="hidden" name="wpstg_disable_from" value="<?php echo esc_attr($email); ?>"/>
31
  <?php endif; ?>
32
+ <input id="wpstg-feedback-submit" class="button button-primary" type="submit" name="wpstg_disable_submit" value="<?php esc_html_e('Submit & Deactivate', 'wp-staging'); ?>"/>
33
+ <a class="button"><?php esc_html_e('Only Deactivate', 'wp-staging'); ?></a>
34
+ <a class="wpstg-feedback-not-deactivate" href="#"><?php esc_html_e('Don\'t deactivate', 'wp-staging'); ?></a>
35
  </form>
36
  </div>
37
  </div>
Backend/views/notices/_partial/notice_dismiss_action.php CHANGED
@@ -7,21 +7,21 @@
7
  */
8
  ?>
9
  <a href="javascript:void(0);"
10
- class="<?php echo substr($cssClassSelectorDismiss, 1) ?>"
11
- title="<?php _e('Close this message', 'wp-staging') ?>"
12
  style="font-weight:bold;">
13
- <?php _e('Close this message', 'wp-staging') ?>
14
  </a>
15
  <script>
16
  jQuery(document).ready(function ($) {
17
- jQuery(document).on('click', '<?php echo $cssClassSelectorDismiss ?>', function (e) {
18
  e.preventDefault();
19
  jQuery.ajax({
20
  url: ajaxurl,
21
  type: 'POST',
22
  data: {
23
  action: 'wpstg_dismiss_notice',
24
- wpstg_notice: '<?php echo $wpstgNotice ?>',
25
  },
26
  error: function error(xhr, textStatus, errorThrown) {
27
  console.log(xhr.status + ' ' + xhr.statusText + '---' + textStatus);
@@ -29,7 +29,7 @@
29
  alert('Unknown error. Please get in contact with us to solve it support@wp-staging.com');
30
  },
31
  success: function success(data) {
32
- jQuery('<?php echo $cssClassSelectorNotice ?>').slideUp('fast');
33
  return true;
34
  },
35
  statusCode: {
7
  */
8
  ?>
9
  <a href="javascript:void(0);"
10
+ class="<?php echo esc_attr(substr($cssClassSelectorDismiss, 1)) ?>"
11
+ title="<?php esc_html_e('Close this message', 'wp-staging') ?>"
12
  style="font-weight:bold;">
13
+ <?php esc_html_e('Close this message', 'wp-staging') ?>
14
  </a>
15
  <script>
16
  jQuery(document).ready(function ($) {
17
+ jQuery(document).on('click', '<?php echo esc_attr($cssClassSelectorDismiss) ?>', function (e) {
18
  e.preventDefault();
19
  jQuery.ajax({
20
  url: ajaxurl,
21
  type: 'POST',
22
  data: {
23
  action: 'wpstg_dismiss_notice',
24
+ wpstg_notice: '<?php echo esc_html($wpstgNotice) ?>',
25
  },
26
  error: function error(xhr, textStatus, errorThrown) {
27
  console.log(xhr.status + ' ' + xhr.statusText + '---' + textStatus);
29
  alert('Unknown error. Please get in contact with us to solve it support@wp-staging.com');
30
  },
31
  success: function success(data) {
32
+ jQuery('<?php echo esc_attr($cssClassSelectorNotice) ?>').slideUp('fast');
33
  return true;
34
  },
35
  statusCode: {
Backend/views/notices/beta.php CHANGED
@@ -1,21 +1,21 @@
1
  <!-- Not used any longer. So can be used for other purposes in the future //-->
2
  <div class="wpstg_beta_notice wpstg-box-shadow wpstg-error">
3
  <p>
4
- <?php _e("WP Staging is well tested and we did a lot to catch every possible error but
5
  we can not handle all possible combinations of server, plugins and themes. <br>
6
  <strong>BEFORE</strong> you create your first staging site it´s highly recommended
7
  <strong>to make a full backup of your website</strong> first!", "wp-staging") ?>
8
  </p>
9
  <p>
10
- <?php _e("A good plugin for an entire WordPress backup is the free one", "wp-staging") ?>
11
  <a href="https://wordpress.org/plugins/backwpup/" target="_blank">BackWPup</a>
12
  </p>
13
  <ul>
14
  <li>
15
- <a href="javascript:void(0);" class="wpstg_hide_beta" title="I understand" data-url="<?php echo admin_url("admin-ajax.php")?>" style="font-weight:bold;">
16
- <?php _e("I understand! (Do not show this again)", "wp-staging") ?>
17
  </a>
18
  </li>
19
  </ul>
20
  </div>
21
- <script type="text/javascript" src="<?php echo $this->assets->getAssetUrl("js/dist/wpstg-admin-beta.js") ?>"></script>
1
  <!-- Not used any longer. So can be used for other purposes in the future //-->
2
  <div class="wpstg_beta_notice wpstg-box-shadow wpstg-error">
3
  <p>
4
+ <?php esc_html_e("WP Staging is well tested and we did a lot to catch every possible error but
5
  we can not handle all possible combinations of server, plugins and themes. <br>
6
  <strong>BEFORE</strong> you create your first staging site it´s highly recommended
7
  <strong>to make a full backup of your website</strong> first!", "wp-staging") ?>
8
  </p>
9
  <p>
10
+ <?php esc_html_e("A good plugin for an entire WordPress backup is the free one", "wp-staging") ?>
11
  <a href="https://wordpress.org/plugins/backwpup/" target="_blank">BackWPup</a>
12
  </p>
13
  <ul>
14
  <li>
15
+ <a href="javascript:void(0);" class="wpstg_hide_beta" title="I understand" data-url="<?php echo esc_url(admin_url("admin-ajax.php"))?>" style="font-weight:bold;">
16
+ <?php esc_html_e("I understand! (Do not show this again)", "wp-staging") ?>
17
  </a>
18
  </li>
19
  </ul>
20
  </div>
21
+ <script type="text/javascript" src="<?php echo esc_url($this->assets->getAssetUrl("js/dist/wpstg-admin-beta.js")) ?>"></script>
Backend/views/notices/cache-directory-permission-problem.php CHANGED
@@ -5,10 +5,10 @@
5
  */
6
  ?>
7
  <div class="notice notice-error">
8
- <p><strong><?php _e('WP STAGING - Folder Permission error.', 'wp-staging'); ?></strong>
9
  <br>
10
  <?php echo sprintf(esc_html__('The folder %s is not write and/or readable.', 'wp-staging'), '<code>' . esc_html($cacheDir) . '</code>'); ?>
11
  <br>
12
- <?php _e('Check if this folder exists! Folder permissions should be chmod 755 or higher.', 'wp-staging'); ?>
13
  </p>
14
  </div>
5
  */
6
  ?>
7
  <div class="notice notice-error">
8
+ <p><strong><?php esc_html_e('WP STAGING - Folder Permission error.', 'wp-staging'); ?></strong>
9
  <br>
10
  <?php echo sprintf(esc_html__('The folder %s is not write and/or readable.', 'wp-staging'), '<code>' . esc_html($cacheDir) . '</code>'); ?>
11
  <br>
12
+ <?php esc_html_e('Check if this folder exists! Folder permissions should be chmod 755 or higher.', 'wp-staging'); ?>
13
  </p>
14
  </div>
Backend/views/notices/directory-listing-could-not-be-prevented.php CHANGED
@@ -6,9 +6,9 @@
6
  ?>
7
 
8
  <div class='notice-warning notice is-dismissible'>
9
- <p><strong><?php _e('WP STAGING - Failed to prevent directory listing', 'wp-staging'); ?></strong>
10
  <br>
11
- <?php _e('Following the best development practices, WP STAGING tries to prevent directory listing on it\'s own directories
12
  that might contain sensitive data. This warning tells you that we could not prevent directory listing on one
13
  of the directories.'); ?>
14
  <?php echo !empty($directoryListingErrors) ? wp_kses(implode('<br>', $directoryListingErrors), ['br']) : ''; ?></p>
6
  ?>
7
 
8
  <div class='notice-warning notice is-dismissible'>
9
+ <p><strong><?php esc_html_e('WP STAGING - Failed to prevent directory listing', 'wp-staging'); ?></strong>
10
  <br>
11
+ <?php esc_html_e('Following the best development practices, WP STAGING tries to prevent directory listing on it\'s own directories
12
  that might contain sensitive data. This warning tells you that we could not prevent directory listing on one
13
  of the directories.'); ?>
14
  <?php echo !empty($directoryListingErrors) ? wp_kses(implode('<br>', $directoryListingErrors), ['br']) : ''; ?></p>
Backend/views/notices/disabled-items-notice.php CHANGED
@@ -14,7 +14,7 @@ use WPStaging\Backend\Notices\Notices;
14
 
15
  ?>
16
  <div class="notice notice-warning wpstg-disabled-items-notice">
17
- <p><strong><?php _e('WP STAGING - Notes:', 'wp-staging'); ?></strong></p>
18
  <ol style="margin-left: 12px;">
19
  <li> <?php echo sprintf(__('WP STAGING Disabled the cache by setting the constant <code>WP_CACHE</code> to <code>FALSE</code>in the file <code>wp-config.php</code>. <a href="%s" target="_blank"> You can revert this easily</a>', 'wp-staging'), 'https://wp-staging.com/docs/how-to-activate-caching-on-staging-site/') ?></li>
20
  <li> <?php echo sprintf(__('Permalinks are disabled. <a href="%s" target="_blank">How to activate permalinks</a>', 'wp-staging'), 'https://wp-staging.com/docs/activate-permalinks-staging-site/') ?></li>
@@ -23,19 +23,19 @@ use WPStaging\Backend\Notices\Notices;
23
  <?php endif; ?>
24
  <?php if ($freemiusOptionsCleared) : ?>
25
  <li>
26
- <?php _e('You may need to consider to reactivate your Freemius license to make sure that Freemius integration does not act slightly differently in your staging site.', 'wp-staging') ?>
27
- <a href="https://wp-staging.com/docs/freemius-integration-how-its-handled-by-wp-staging/"><?php _e('Read more here', 'wp-staging') ?>
28
  </li>
29
  <?php endif; ?>
30
  <?php if ($isJetpackStagingModeActive) : ?>
31
  <li>
32
- <?php _e('You have Jetpack plugin active on this staging site, so we have enabled Jetpack staging mode.', 'wp-staging') ?>
33
- <a href="https://wp-staging.com/docs/make-jetpack-working-on-staging-site/"><?php _e('Read more here', 'wp-staging') ?>
34
  </li>
35
  <?php endif; ?>
36
  <?php if (count($excludedPlugins) > 0) : ?>
37
  <li>
38
- <?php _e('Excluded the following plugins:', 'wp-staging') ?>
39
  <ul style="margin-left: 0px; margin-top: 4px;">
40
  <?php foreach ($excludedPlugins as $excludedPlugin) : ?>
41
  <li> <span style="font-size: 13px;">➜</span> <?php echo esc_html($excludedPlugin); ?></li>
14
 
15
  ?>
16
  <div class="notice notice-warning wpstg-disabled-items-notice">
17
+ <p><strong><?php esc_html_e('WP STAGING - Notes:', 'wp-staging'); ?></strong></p>
18
  <ol style="margin-left: 12px;">
19
  <li> <?php echo sprintf(__('WP STAGING Disabled the cache by setting the constant <code>WP_CACHE</code> to <code>FALSE</code>in the file <code>wp-config.php</code>. <a href="%s" target="_blank"> You can revert this easily</a>', 'wp-staging'), 'https://wp-staging.com/docs/how-to-activate-caching-on-staging-site/') ?></li>
20
  <li> <?php echo sprintf(__('Permalinks are disabled. <a href="%s" target="_blank">How to activate permalinks</a>', 'wp-staging'), 'https://wp-staging.com/docs/activate-permalinks-staging-site/') ?></li>
23
  <?php endif; ?>
24
  <?php if ($freemiusOptionsCleared) : ?>
25
  <li>
26
+ <?php esc_html_e('You may need to consider to reactivate your Freemius license to make sure that Freemius integration does not act slightly differently in your staging site.', 'wp-staging') ?>
27
+ <a href="https://wp-staging.com/docs/freemius-integration-how-its-handled-by-wp-staging/"><?php esc_html_e('Read more here', 'wp-staging') ?>
28
  </li>
29
  <?php endif; ?>
30
  <?php if ($isJetpackStagingModeActive) : ?>
31
  <li>
32
+ <?php esc_html_e('You have Jetpack plugin active on this staging site, so we have enabled Jetpack staging mode.', 'wp-staging') ?>
33
+ <a href="https://wp-staging.com/docs/make-jetpack-working-on-staging-site/"><?php esc_html_e('Read more here', 'wp-staging') ?>
34
  </li>
35
  <?php endif; ?>
36
  <?php if (count($excludedPlugins) > 0) : ?>
37
  <li>
38
+ <?php esc_html_e('Excluded the following plugins:', 'wp-staging') ?>
39
  <ul style="margin-left: 0px; margin-top: 4px;">
40
  <?php foreach ($excludedPlugins as $excludedPlugin) : ?>
41
  <li> <span style="font-size: 13px;">➜</span> <?php echo esc_html($excludedPlugin); ?></li>
Backend/views/notices/logs-directory-permission-problem.php CHANGED
@@ -5,10 +5,10 @@
5
  */
6
  ?>
7
  <div class="notice notice-error">
8
- <p><strong><?php _e('WP STAGING - Folder Permission error.', 'wp-staging'); ?></strong>
9
  <br>
10
  <?php echo sprintf(esc_html__('The folder %s is not write and/or readable.', 'wp-staging'), '<code>' . esc_html($logsDir) . '</code>'); ?>
11
  <br>
12
- <?php _e('Check if this folder exists! Folder permissions should be chmod 755 or higher.', 'wp-staging'); ?>
13
  </p>
14
  </div>
5
  */
6
  ?>
7
  <div class="notice notice-error">
8
+ <p><strong><?php esc_html_e('WP STAGING - Folder Permission error.', 'wp-staging'); ?></strong>
9
  <br>
10
  <?php echo sprintf(esc_html__('The folder %s is not write and/or readable.', 'wp-staging'), '<code>' . esc_html($logsDir) . '</code>'); ?>
11
  <br>
12
+ <?php esc_html_e('Check if this folder exists! Folder permissions should be chmod 755 or higher.', 'wp-staging'); ?>
13
  </p>
14
  </div>
Backend/views/notices/outdated-wp-staging-hooks.php CHANGED
@@ -6,7 +6,7 @@
6
  ?>
7
  <div class="wpstg-hooks-outdated-notice notice notice-error">
8
  <p>
9
- <strong><?php _e('WP STAGING - Hooks Outdated.', 'wp-staging'); ?></strong> <br/>
10
  <?php echo sprintf(__('You are using an outdated version of the WP STAGING hooks plugin. The filters for <code>wpstg_clone_excl_folders</code> and <code>wpstg_clone_mu_excl_folders</code> have been changed. Download the latest version from <a href="%s" target="_blank">here</a> and adjust your filters.', 'wp-staging'), 'https://github.com/wp-staging/wp-staging-hooks'); ?>
11
  </p>
12
  </div>
6
  ?>
7
  <div class="wpstg-hooks-outdated-notice notice notice-error">
8
  <p>
9
+ <strong><?php esc_html_e('WP STAGING - Hooks Outdated.', 'wp-staging'); ?></strong> <br/>
10
  <?php echo sprintf(__('You are using an outdated version of the WP STAGING hooks plugin. The filters for <code>wpstg_clone_excl_folders</code> and <code>wpstg_clone_mu_excl_folders</code> have been changed. Download the latest version from <a href="%s" target="_blank">here</a> and adjust your filters.', 'wp-staging'), 'https://github.com/wp-staging/wp-staging-hooks'); ?>
11
  </p>
12
  </div>
Backend/views/notices/outdated-wp-staging-version.php CHANGED
@@ -1,12 +1,21 @@
1
  <?php
 
2
  /**
3
  * @var $this \WPStaging\Backend\Notices\OutdatedWpStagingNotice
4
  * @see \WPStaging\Backend\Notices\OutdatedWpStagingNotice::showNotice
5
  */
 
 
 
6
  ?>
7
  <div class="wpstg-version-outdated-notice notice notice-error">
8
  <p>
9
- <strong><?php _e('WP STAGING - Version Outdated.', 'wp-staging'); ?></strong> <br/>
10
- <?php echo sprintf(__('WP STAGING v%s is outdated. Please <a href="%s">update</a> to latest version %s to make sure the plugin works with your WordPress version.', 'wp-staging'), esc_html($this->getCurrentWpstgVersion()), admin_url('plugins.php'), esc_html($this->getLatestWpstgVersion())); ?>
 
 
 
 
 
11
  </p>
12
  </div>
1
  <?php
2
+
3
  /**
4
  * @var $this \WPStaging\Backend\Notices\OutdatedWpStagingNotice
5
  * @see \WPStaging\Backend\Notices\OutdatedWpStagingNotice::showNotice
6
  */
7
+
8
+ use WPStaging\Framework\Facades\Escape;
9
+
10
  ?>
11
  <div class="wpstg-version-outdated-notice notice notice-error">
12
  <p>
13
+ <strong><?php esc_html_e('WP STAGING - Version Outdated.', 'wp-staging'); ?></strong> <br/>
14
+ <?php echo sprintf(
15
+ Escape::escapeHtml(__('WP STAGING v%s is outdated. Please <a href="%s">update</a> to latest version %s to make sure the plugin works with your WordPress version.', 'wp-staging')),
16
+ esc_html($this->getCurrentWpstgVersion()),
17
+ esc_url(admin_url('plugins.php')),
18
+ esc_html($this->getLatestWpstgVersion())
19
+ ); ?>
20
  </p>
21
  </div>
Backend/views/notices/poll.php CHANGED
@@ -1,39 +1,39 @@
1
  <div class="wpstg_poll update-nag wpstg-box-shadow">
2
  <p>
3
- <?php sprintf(__('Great, You are using %s for a while.', 'wp-staging'), "<strong>WP Staging</strong>"); ?>
4
- <?php _e('Hope you are happy with it.', 'wp-staging'); ?>
5
 
6
  <br><br>
7
 
8
- <?php _e('Are you interested in copying changes from WPStaging staging site back to your live site?', 'wp-staging'); ?>
9
 
10
  <br><br>
11
 
12
- <?php sprintf(__('Click on the %s Button and fill out the poll!', 'wp-staging'), "<a href='https://docs.google.com/forms/d/e/1FAIpQLScZ-dO5WffV3xObn16LwG05tr1HrADD_8L4wbTxPHqoPssVcg/viewform?c=0&w=1&usp=mail_form_link' target='_blank'><i>" . __('Yes, i am interested', 'wp-staging') . "</i></a>"); ?>
13
 
14
  <br>
15
 
16
- <?php _e('It only takes one (1) minute of your time - I promise!', 'wp-staging'); ?>
17
 
18
  <br><br>
19
 
20
- <?php _e('Cheers,', 'wp-staging'); ?>
21
 
22
  <br>
23
 
24
- <?php _e('René', 'wp-staging'); ?>
25
  <ul>
26
  <li class="wpstg-float-left">
27
  <a href="https://docs.google.com/forms/d/e/1FAIpQLScZ-dO5WffV3xObn16LwG05tr1HrADD_8L4wbTxPHqoPssVcg/viewform?c=0&w=1&usp=mail_form_link" class="thankyou button button-primary" target="_new" title="Yes, i am interested" style="color: #ffffff;font-weight: normal;margin-right:10px;float:left;">
28
- <?php _e('Yes, i am interested', 'wp-staging'); ?>
29
  </a>
30
  </li>
31
  <li>
32
- <a href="javascript:void(0);" data-url="<?php echo admin_url("admin-ajax.php")?>" class="wpstg_hide_poll" title="Close It" style="vertical-align:middle;">
33
- <?php _e('Do Not Ask Again', 'wp-staging'); ?>
34
  </a>
35
  </li>
36
  </ul>
37
  </div>
38
 
39
- <script type="text/javascript" src="<?php echo $this->assets->getAssetUrl("js/wpstg-admin-poll.js") ?>"></script>
1
  <div class="wpstg_poll update-nag wpstg-box-shadow">
2
  <p>
3
+ <?php echo sprintf(esc_html__('Great, You are using %s for a while.', 'wp-staging'), "<strong>WP Staging</strong>"); ?>
4
+ <?php esc_html_e('Hope you are happy with it.', 'wp-staging'); ?>
5
 
6
  <br><br>
7
 
8
+ <?php esc_html_e('Are you interested in copying changes from WPStaging staging site back to your live site?', 'wp-staging'); ?>
9
 
10
  <br><br>
11
 
12
+ <?php echo sprintf(esc_html__('Click on the %s Button and fill out the poll!', 'wp-staging'), "<a href='https://docs.google.com/forms/d/e/1FAIpQLScZ-dO5WffV3xObn16LwG05tr1HrADD_8L4wbTxPHqoPssVcg/viewform?c=0&w=1&usp=mail_form_link' target='_blank'><i>" . esc_html__('Yes, i am interested', 'wp-staging') . "</i></a>"); ?>
13
 
14
  <br>
15
 
16
+ <?php esc_html_e('It only takes one (1) minute of your time - I promise!', 'wp-staging'); ?>
17
 
18
  <br><br>
19
 
20
+ <?php esc_html_e('Cheers,', 'wp-staging'); ?>
21
 
22
  <br>
23
 
24
+ <?php esc_html_e('René', 'wp-staging'); ?>
25
  <ul>
26
  <li class="wpstg-float-left">
27
  <a href="https://docs.google.com/forms/d/e/1FAIpQLScZ-dO5WffV3xObn16LwG05tr1HrADD_8L4wbTxPHqoPssVcg/viewform?c=0&w=1&usp=mail_form_link" class="thankyou button button-primary" target="_new" title="Yes, i am interested" style="color: #ffffff;font-weight: normal;margin-right:10px;float:left;">
28
+ <?php esc_html_e('Yes, i am interested', 'wp-staging'); ?>
29
  </a>
30
  </li>
31
  <li>
32
+ <a href="javascript:void(0);" data-url="<?php echo esc_url(admin_url("admin-ajax.php"))?>" class="wpstg_hide_poll" title="Close It" style="vertical-align:middle;">
33
+ <?php esc_html_e('Do Not Ask Again', 'wp-staging'); ?>
34
  </a>
35
  </li>
36
  </ul>
37
  </div>
38
 
39
+ <script type="text/javascript" src="<?php echo esc_url($this->assets->getAssetUrl("js/wpstg-admin-poll.js")) ?>"></script>
Backend/views/notices/rating.php CHANGED
@@ -20,13 +20,12 @@
20
  </div>
21
  </div>
22
  <div class="wpstg-welcome-text" style="padding: 0px; padding-left: 20px; padding-right: 8px;">
23
- <p><?php _e('You are using <strong>WP STAGING </strong> for more than 1 week.
24
- May we ask you to give it a <strong>5-star</strong> rating on wordpress.org?', 'wp-staging'); ?>
25
  <?php if (!defined('WPSTGPRO_VERSION')) { ?>
26
  <br><br>
27
- <?php echo sprintf(__('P.S. Do you like to migrate this staging site to production site?
28
- Try out <a href="%1$s" target="_blank" style="color:white;font-weight:bold;">WP STAGING | PRO</a>
29
- ', 'wp-staging'), 'https://wp-staging.com/?utm_source=wpstg_admin&utm_medium=rating_screen&utm_campaign=admin_notice'); ?>
30
  <br>
31
  <?php } ?>
32
  </p>
@@ -34,25 +33,25 @@
34
  <li>
35
  <a href="https://wordpress.org/support/plugin/wp-staging/reviews/?filter=5#new-post" target="_blank" style="background-color:#d10f83;border-color:transparent;margin-bottom:10px;color:white;font-weight:bold;-webkit-box-shadow: 1px 1px 8px -7px rgba(0,0,0,0.75);-moz-box-shadow: 1px 1px 8px -7px rgba(0,0,0,0.75);box-shadow: 1px 1px 8px -7px rgba(0,0,0,0.75);" id="wpstg_clicked_deserved_it" class="thankyou button"
36
  title="Sure, I like your plugin" style="font-weight:bold;">
37
- <?php _e('- Yes, I like WP STAGING! Rate & Close this Message', 'wp-staging') ?>
38
  </a>
39
  </li>
40
  <li>
41
  <a href="javascript:void(0);" class="wpstg_hide_rating" title="I already rated"
42
  style="font-weight:normal;color:white;text-decoration: none;">
43
- <?php _e('- I already rated - Close ', 'wp-staging') ?>
44
  </a>
45
  </li>
46
  <li>
47
  <a href="javascript:void(0);" class="wpstg_hide_rating" title="No, not good enough"
48
  style="font-weight:normal;color:white;">
49
- <?php _e('', 'wp-staging') ?>
50
  </a>
51
  </li>
52
  <li>
53
  <a href="javascript:void(0);" class="wpstg_rate_later" title="Ask me again in a week"
54
  style="font-weight:normal;color:white;text-decoration: none;">
55
- <?php _e('- Ask me again in a week - Close', 'wp-staging') ?>
56
  </a>
57
  </li>
58
  </ul>
@@ -64,8 +63,8 @@
64
  <script>
65
  var wpstgYouTubeConfig = {
66
  'accepted': false,
67
- 'message': "<?php _e("This video is hosted on YouTube. Please click on the OK button to play this video. We don't load any external data without your explicit consent.") ?>",
68
- 'regards': "<?php _e("Your WP STAGING Team") ?>"
69
  };
70
  </script>
71
  <script src="<?php echo esc_url($this->assets->getAssetsUrlWithVersion("js/dist/wpstg-admin-rating.js", '2.7.6')) ?>"></script>
20
  </div>
21
  </div>
22
  <div class="wpstg-welcome-text" style="padding: 0px; padding-left: 20px; padding-right: 8px;">
23
+ <p><?php echo sprintf(esc_html__('You are using %s for more than 1 week.
24
+ May we ask you to give it a %s rating on wordpress.org?', 'wp-staging'), "<strong>WP STAGING</strong>", "<strong>5-star</strong>"); ?>
25
  <?php if (!defined('WPSTGPRO_VERSION')) { ?>
26
  <br><br>
27
+ <?php esc_html_e('P.S. Do you like to migrate this staging site to production site?
28
+ Try out', 'wp-staging') ?> <a href="https://wp-staging.com/?utm_source=wpstg_admin&utm_medium=rating_screen&utm_campaign=admin_notice" target="_blank" style="color:white;font-weight:bold;">WP STAGING | PRO</a>
 
29
  <br>
30
  <?php } ?>
31
  </p>
33
  <li>
34
  <a href="https://wordpress.org/support/plugin/wp-staging/reviews/?filter=5#new-post" target="_blank" style="background-color:#d10f83;border-color:transparent;margin-bottom:10px;color:white;font-weight:bold;-webkit-box-shadow: 1px 1px 8px -7px rgba(0,0,0,0.75);-moz-box-shadow: 1px 1px 8px -7px rgba(0,0,0,0.75);box-shadow: 1px 1px 8px -7px rgba(0,0,0,0.75);" id="wpstg_clicked_deserved_it" class="thankyou button"
35
  title="Sure, I like your plugin" style="font-weight:bold;">
36
+ <?php esc_html_e('- Yes, I like WP STAGING! Rate & Close this Message', 'wp-staging') ?>
37
  </a>
38
  </li>
39
  <li>
40
  <a href="javascript:void(0);" class="wpstg_hide_rating" title="I already rated"
41
  style="font-weight:normal;color:white;text-decoration: none;">
42
+ <?php esc_html_e('- I already rated - Close ', 'wp-staging') ?>
43
  </a>
44
  </li>
45
  <li>
46
  <a href="javascript:void(0);" class="wpstg_hide_rating" title="No, not good enough"
47
  style="font-weight:normal;color:white;">
48
+ <?php esc_html_e('', 'wp-staging') ?>
49
  </a>
50
  </li>
51
  <li>
52
  <a href="javascript:void(0);" class="wpstg_rate_later" title="Ask me again in a week"
53
  style="font-weight:normal;color:white;text-decoration: none;">
54
+ <?php esc_html_e('- Ask me again in a week - Close', 'wp-staging') ?>
55
  </a>
56
  </li>
57
  </ul>
63
  <script>
64
  var wpstgYouTubeConfig = {
65
  'accepted': false,
66
+ 'message': "<?php esc_html_e("This video is hosted on YouTube. Please click on the OK button to play this video. We don't load any external data without your explicit consent.") ?>",
67
+ 'regards': "<?php esc_html_e("Your WP STAGING Team") ?>"
68
  };
69
  </script>
70
  <script src="<?php echo esc_url($this->assets->getAssetsUrlWithVersion("js/dist/wpstg-admin-rating.js", '2.7.6')) ?>"></script>
Backend/views/notices/settings_option_corrupt.php CHANGED
@@ -1,12 +1,17 @@
 
 
 
 
 
1
  <div class="notice notice-error" id="wpstg-corrupt-settings-notice">
2
  <p>
3
- <strong><?php _e('WP STAGING - Settings Error.', 'wp-staging'); ?></strong>
4
  <br>
5
- <?php echo __('The WP STAGING settings are broken! Use the link below to restore the default settings. <strong>Note:</strong> This will remove all entries from the list of staging sites but the staging sites will still be available and not physically deleted. If you are unsure about this, please contact us at support@wp-staging.com before restoring the settings.', 'wp-staging'); ?>
6
  <br>
7
- <a href="javascript:void(0);" id="wpstg-link-restore-settings" title="<?php _e('Restore Settings', 'wp-staging') ?>">
8
- <?php _e('Restore Settings', 'wp-staging') ?>
9
  </a>
10
  </p>
11
  </div>
12
- <script type="text/javascript" src="<?php echo $this->assets->getAssetsUrlWithVersion("js/dist/wpstg-admin-corrupt-settings.js") ?>"></script>
1
+ <?php
2
+
3
+ use WPStaging\Framework\Facades\Escape;
4
+
5
+ ?>
6
  <div class="notice notice-error" id="wpstg-corrupt-settings-notice">
7
  <p>
8
+ <strong><?php esc_html_e('WP STAGING - Settings Error.', 'wp-staging'); ?></strong>
9
  <br>
10
+ <?php echo Escape::escapeHtml(__('The WP STAGING settings are broken! Use the link below to restore the default settings. <strong>Note:</strong> This will remove all entries from the list of staging sites but the staging sites will still be available and not physically deleted. If you are unsure about this, please contact us at support@wp-staging.com before restoring the settings.', 'wp-staging')); ?>
11
  <br>
12
+ <a href="javascript:void(0);" id="wpstg-link-restore-settings" title="<?php esc_html_e('Restore Settings', 'wp-staging') ?>">
13
+ <?php esc_html_e('Restore Settings', 'wp-staging') ?>
14
  </a>
15
  </p>
16
  </div>
17
+ <script type="text/javascript" src="<?php echo esc_url($this->assets->getAssetsUrlWithVersion("js/dist/wpstg-admin-corrupt-settings.js")) ?>"></script>
Backend/views/notices/staging-directory-permission-problem.php CHANGED
@@ -1,13 +1,22 @@
 
 
 
 
 
1
  <div class="notice notice-error">
2
  <p>
3
  <strong>
4
  <?php
5
- echo sprintf(__('WP STAGING - Folder Permission error.</strong>
6
- <br>
7
- The folder <code>%1$s</code> is not write and/or readable.
8
- <br>
9
- Check if this folder is writeable by php user %2$s or www-data .
10
- File permissions should be chmod 755 or 777.', 'wp-staging'), ABSPATH, getenv('USERNAME') ?: getenv('USER'));
 
 
 
 
11
  ?>
12
  </p>
13
- </div>
1
+ <?php
2
+
3
+ use WPStaging\Framework\Facades\Escape;
4
+
5
+ ?>
6
  <div class="notice notice-error">
7
  <p>
8
  <strong>
9
  <?php
10
+ echo sprintf(
11
+ Escape::escapeHtml(__('WP STAGING - Folder Permission error.</strong>
12
+ <br>
13
+ The folder <code>%1$s</code> is not write and/or readable.
14
+ <br>
15
+ Check if this folder is writeable by php user %2$s or www-data .
16
+ File permissions should be chmod 755 or 777.'), 'wp-staging'),
17
+ esc_html(ABSPATH),
18
+ esc_html(getenv('USERNAME')) ?: esc_html(getenv('USER'))
19
+ );
20
  ?>
21
  </p>
22
+ </div>
Backend/views/notices/uploads-outside-wp-root.php CHANGED
@@ -6,7 +6,7 @@
6
  ?>
7
  <div class="notice notice-error">
8
  <p>
9
- <strong><?php _e('WP STAGING - Customized Uploads Folder.', 'wp-staging'); ?></strong> <br/>
10
  <?php echo sprintf(__('You have a customized uploads folder which is located outside the WordPress root folder. This will lead to missing images when creating a staging site. <a href="%s" target="_blank">How to fix this</a>', 'wp-staging'), 'https://wp-staging.com/docs/no-images-are-visible-on-staging-site/'); ?>
11
  </p>
12
  </div>
6
  ?>
7
  <div class="notice notice-error">
8
  <p>
9
+ <strong><?php esc_html_e('WP STAGING - Customized Uploads Folder.', 'wp-staging'); ?></strong> <br/>
10
  <?php echo sprintf(__('You have a customized uploads folder which is located outside the WordPress root folder. This will lead to missing images when creating a staging site. <a href="%s" target="_blank">How to fix this</a>', 'wp-staging'), 'https://wp-staging.com/docs/no-images-are-visible-on-staging-site/'); ?>
11
  </p>
12
  </div>
Backend/views/notices/vars-directory-permission-problem.php CHANGED
@@ -5,10 +5,10 @@
5
  */
6
  ?>
7
  <div class="notice notice-error">
8
- <p><strong><?php _e('WP STAGING - Folder Permission error.', 'wp-staging'); ?></strong>
9
  <br>
10
  <?php echo sprintf(esc_html__('The folder %s is not write and/or readable.', 'wp-staging'), '<code>' . esc_html($varsDirectory) . '</code>'); ?>
11
  <br>
12
- <?php _e('Check if this folder exists! Folder permissions should be chmod 755 or 777.', 'wp-staging'); ?>
13
  </p>
14
  </div>
5
  */
6
  ?>
7
  <div class="notice notice-error">
8
+ <p><strong><?php esc_html_e('WP STAGING - Folder Permission error.', 'wp-staging'); ?></strong>
9
  <br>
10
  <?php echo sprintf(esc_html__('The folder %s is not write and/or readable.', 'wp-staging'), '<code>' . esc_html($varsDirectory) . '</code>'); ?>
11
  <br>
12
+ <?php esc_html_e('Check if this folder exists! Folder permissions should be chmod 755 or 777.', 'wp-staging'); ?>
13
  </p>
14
  </div>
Backend/views/notices/warnings-notice.php CHANGED
@@ -10,9 +10,9 @@ use WPStaging\Backend\Notices\Notices;
10
 
11
  ?>
12
  <div class="notice notice-warning wpstg-warning-notice">
13
- <p><strong><?php _e('WP STAGING:', 'wp-staging'); ?></strong></p>
14
  <p>
15
- <?php _e('Renaming the folder <code>wp-content</code> or the <code>uploads</code> path can lead to missing images after the push process. If not absolutely necessary don\'t rename the default WordPress folders.', 'wp-staging') ?>
16
  </p>
17
  <p>
18
  <?php Notices::renderNoticeDismissAction(
10
 
11
  ?>
12
  <div class="notice notice-warning wpstg-warning-notice">
13
+ <p><strong><?php esc_html_e('WP STAGING:', 'wp-staging'); ?></strong></p>
14
  <p>
15
+ <?php echo sprintf(esc_html__('Renaming the folder %s or the %s path can lead to missing images after the push process. If not absolutely necessary don\'t rename the default WordPress folders.', 'wp-staging'), "<code>wp-content</code>", "<code>uploads</code>") ?>
16
  </p>
17
  <p>
18
  <?php Notices::renderNoticeDismissAction(
Backend/views/notices/wordfence-userini-renamed.php CHANGED
@@ -11,9 +11,9 @@ use WPStaging\Framework\Support\ThirdParty\WordFence;
11
  ?>
12
  <div class="notice notice-warning wpstg-wordfence-userini-renamed-notice">
13
  <p>
14
- <strong><?php _e('WP STAGING - Wordfence firewall deactivated', 'wp-staging'); ?></strong> <br/>
15
- <?php _e('We`ve disabled the WordFence Web Application Firewall on this site by renaming the WordFence file user.ini to make sure this staging site will work perfectly fine.', 'wp-staging'); ?> <br/>
16
- <?php _e('When you push this site to live, your WordFence firewall settings on the live site will not be affected by this step.', 'wp-staging'); ?> <br/>
17
  </p>
18
  <ul>
19
  <li>- <?php echo sprintf(__('<a href="%s" target="_blank">Read this</a> why we had to disable the firewall and how you can activate it if you like to.', 'wp-staging'), 'https://wp-staging.com/docs/wordfence-fatal-error-after-migration/'); ?></li>
11
  ?>
12
  <div class="notice notice-warning wpstg-wordfence-userini-renamed-notice">
13
  <p>
14
+ <strong><?php esc_html_e('WP STAGING - Wordfence firewall deactivated', 'wp-staging'); ?></strong> <br/>
15
+ <?php esc_html_e('We`ve disabled the WordFence Web Application Firewall on this site by renaming the WordFence file user.ini to make sure this staging site will work perfectly fine.', 'wp-staging'); ?> <br/>
16
+ <?php esc_html_e('When you push this site to live, your WordFence firewall settings on the live site will not be affected by this step.', 'wp-staging'); ?> <br/>
17
  </p>
18
  <ul>
19
  <li>- <?php echo sprintf(__('<a href="%s" target="_blank">Read this</a> why we had to disable the firewall and how you can activate it if you like to.', 'wp-staging'), 'https://wp-staging.com/docs/wordfence-fatal-error-after-migration/'); ?></li>
Backend/views/notices/wp-options-missing-pk.php CHANGED
@@ -6,9 +6,9 @@
6
  ?>
7
  <div class="notice notice-error">
8
  <p>
9
- <strong><?php echo sprintf(__('WP STAGING - The table %s has no primary key index.', 'wp-staging'), $optionTable)?></strong>
10
  <br>
11
- <?php _e('This is a serious issue and needs to be fixed as soon as possible. The longer you wait, the harder it gets to repair it and can make your site inaccessible at worst. We recommend fixing it right now! This error has either been caused by a person with access to the database or by another plugin. You should not do any changes to your site until this is fixed.', 'wp-staging') ?>
12
  </p>
13
- <p><a href="https://wp-staging.com/docs/missing-primary-key-in-table-wp-options" target="_blank"><strong><?php _e('How to fix this.', 'wp-staging') ?></strong></a></p>
14
  </div>
6
  ?>
7
  <div class="notice notice-error">
8
  <p>
9
+ <strong><?php echo sprintf(esc_html__('WP STAGING - The table %s has no primary key index.', 'wp-staging'), esc_html($optionTable))?></strong>
10
  <br>
11
+ <?php esc_html_e('This is a serious issue and needs to be fixed as soon as possible. The longer you wait, the harder it gets to repair it and can make your site inaccessible at worst. We recommend fixing it right now! This error has either been caused by a person with access to the database or by another plugin. You should not do any changes to your site until this is fixed.', 'wp-staging') ?>
12
  </p>
13
+ <p><a href="https://wp-staging.com/docs/missing-primary-key-in-table-wp-options" target="_blank"><strong><?php esc_html_e('How to fix this.', 'wp-staging') ?></strong></a></p>
14
  </div>
Backend/views/notices/wp-version-compatible-message.php CHANGED
@@ -1,13 +1,22 @@
 
 
 
 
 
1
  <div class="notice notice-warning">
2
  <p>
3
  <?php
4
- echo sprintf(__(
5
- '<strong>This version of WP STAGING has not been tested with WordPress %2$s.</strong>' .
6
- '<br/><br/>WP STAGING has an enterprise-level quality control that performs a compatibility audit on every new WordPress release.' .
7
- '<br/>We prioritize testing the Pro version of the plugin first, which receives the compatibility audit earlier than the Free version. If you are in a rush, upgrade to Pro today to get the latest compatible version of WP STAGING or wait a few days until we update the free version.' .
8
- '<p><a href="%1$s" target="_blank"><strong>Get the Latest Pro Version Now</strong></a>.',
9
- 'wp-staging'
10
- ), 'https://wp-staging.com?utm_source=free-plugin&utm_medium=backend&utm_campaign=compatible-message', get_bloginfo('version'));
 
 
 
 
11
  ?>
12
  </p>
13
  </div>
1
+ <?php
2
+
3
+ use WPStaging\Framework\Facades\Escape;
4
+
5
+ ?>
6
  <div class="notice notice-warning">
7
  <p>
8
  <?php
9
+
10
+ echo sprintf(
11
+ Escape::escapeHtml(__(
12
+ '<strong>This version of WP STAGING has not been tested with WordPress %2$s.</strong>' .
13
+ '<br/><br/>WP STAGING has an enterprise-level quality control that performs a compatibility audit on every new WordPress release.' .
14
+ '<br/>We prioritize testing the Pro version of the plugin first, which receives the compatibility audit earlier than the Free version. If you are in a rush, upgrade to Pro today to get the latest compatible version of WP STAGING or wait a few days until we update the free version.' .
15
+ '<a href="%1$s" target="_blank"><strong>Get the Latest Pro Version Now</strong></a>.'
16
+ ), 'wp-staging'),
17
+ 'https://wp-staging.com?utm_source=free-plugin&utm_medium=backend&utm_campaign=compatible-message',
18
+ esc_html(get_bloginfo('version'))
19
+ );
20
  ?>
21
  </p>
22
  </div>
Backend/views/notices/wrong-scheme.php CHANGED
@@ -1,8 +1,16 @@
 
 
 
 
 
1
  <div class="notice notice-error">
2
  <p>
3
- <strong><?php _e('WP STAGING - HTTP/HTTPS Scheme Error.', 'wp-staging'); ?></strong>
4
  <br>
5
- <?php echo sprintf(__('Go to <a href="%s" target="_blank">Settings > General</a> and make sure that WordPress Address (URL) and Site Address (URL) both start wth either http or https scheme.', 'wp-staging'), admin_url() . 'options-general.php'); ?>
 
 
 
6
  <br>
7
- <?php _e('Otherwise your staging site will not be reachable after creation.', 'wp-staging'); ?></p>
8
- </div>
1
+ <?php
2
+
3
+ use WPStaging\Framework\Facades\Escape;
4
+
5
+ ?>
6
  <div class="notice notice-error">
7
  <p>
8
+ <strong><?php esc_html_e('WP STAGING - HTTP/HTTPS Scheme Error.', 'wp-staging'); ?></strong>
9
  <br>
10
+ <?php echo sprintf(
11
+ Escape::escapeHtml(__('Go to <a href="%s" target="_blank">Settings > General</a> and make sure that WordPress Address (URL) and Site Address (URL) both start wth either http or https scheme.'), 'wp-staging'),
12
+ esc_url(admin_url()) . 'options-general.php'
13
+ ); ?>
14
  <br>
15
+ <?php esc_html_e('Otherwise your staging site will not be reachable after creation.', 'wp-staging'); ?></p>
16
+ </div>
Backend/views/selections/database-tables.php CHANGED
@@ -10,15 +10,15 @@
10
  $dbPrefix = WPStaging\Core\WPStaging::getTablePrefix();
11
  ?>
12
  <p>
13
- <strong><?php _e("Select Tables to Copy", "wp-staging"); ?></strong>
14
  <br>
15
- <?php printf(__("Tables with the production prefix <code>%s</code> have been selected.", "wp-staging"), $dbPrefix); ?>
16
  </p>
17
  <p style="display: none;">
18
- <?php _e("Selected tables will be copied/replaced with the tables from the production site.", "wp-staging"); ?>
19
  </p>
20
  <div class="wpstg-my-10px">
21
- <a href="#" class="wpstg-button-unselect button"><?php _e('Unselect All', 'wp-staging'); ?></a>
22
  <a href="#" class="wpstg-button-select button"> <?php echo esc_html($dbPrefix) ?> </a>
23
  </div>
24
  <select multiple="multiple" id="wpstg_select_tables_cloning">
@@ -31,15 +31,15 @@
31
 
32
  $attributes .= in_array($table->name, $options->clonedTables) ? "disabled" : '';
33
  ?>
34
- <option class="wpstg-db-table" value="<?php echo esc_attr($table->name) ?>" name="<?php echo esc_attr($table->name) ?>" <?php echo $attributes ?>>
35
  <?php echo esc_html($table->name) ?> - <?php echo esc_html(size_format($table->size, 2)) ?>
36
  </option>
37
  <?php endforeach ?>
38
  </select>
39
  <div class="wpstg-mt-10px">
40
- <a href="#" class="wpstg-button-unselect button"> <?php _e('Unselect All', 'wp-staging'); ?> </a>
41
  <a href="#" class="wpstg-button-select button"> <?php echo esc_html($dbPrefix); ?> </a>
42
  </div>
43
  <p>
44
- <?php _e("You can select multiple tables. Press left mouse button & move or press STRG+Left mouse button. (Apple: ⌘+Left Mouse Button)", "wp-staging"); ?>
45
  </p>
10
  $dbPrefix = WPStaging\Core\WPStaging::getTablePrefix();
11
  ?>
12
  <p>
13
+ <strong><?php esc_html_e("Select Tables to Copy", "wp-staging"); ?></strong>
14
  <br>
15
+ <?php echo sprintf(esc_html__("Tables with the production prefix %s have been selected.", "wp-staging"), "<code>" . esc_html($dbPrefix) . "</code>"); ?>
16
  </p>
17
  <p style="display: none;">
18
+ <?php esc_html_e("Selected tables will be copied/replaced with the tables from the production site.", "wp-staging"); ?>
19
  </p>
20
  <div class="wpstg-my-10px">
21
+ <a href="#" class="wpstg-button-unselect button"><?php esc_html_e('Unselect All', 'wp-staging'); ?></a>
22
  <a href="#" class="wpstg-button-select button"> <?php echo esc_html($dbPrefix) ?> </a>
23
  </div>
24
  <select multiple="multiple" id="wpstg_select_tables_cloning">
31
 
32
  $attributes .= in_array($table->name, $options->clonedTables) ? "disabled" : '';
33
  ?>
34
+ <option class="wpstg-db-table" value="<?php echo esc_attr($table->name) ?>" name="<?php echo esc_attr($table->name) ?>" <?php echo esc_html($attributes) ?>>
35
  <?php echo esc_html($table->name) ?> - <?php echo esc_html(size_format($table->size, 2)) ?>
36
  </option>
37
  <?php endforeach ?>
38
  </select>
39
  <div class="wpstg-mt-10px">
40
+ <a href="#" class="wpstg-button-unselect button"> <?php esc_html_e('Unselect All', 'wp-staging'); ?> </a>
41
  <a href="#" class="wpstg-button-select button"> <?php echo esc_html($dbPrefix); ?> </a>
42
  </div>
43
  <p>
44
+ <?php esc_html_e("You can select multiple tables. Press left mouse button & move or press STRG+Left mouse button. (Apple: ⌘+Left Mouse Button)", "wp-staging"); ?>
45
  </p>
Backend/views/selections/files.php CHANGED
@@ -1,21 +1,25 @@
1
  <?php
 
2
  /**
3
  * @var stdClass $options
4
  *
5
  * @see \WPStaging\Backend\Modules\Jobs\Scan::start For details on $options.
6
  */
 
 
 
7
  ?>
8
  <p>
9
- <strong><?php _e("Select Folders to Copy", "wp-staging") ?></strong>
10
  <br>
11
- <?php _e("Click on a folder name to expand it.", "wp-staging") ?>
12
  </p>
13
  <div id="wpstg-directories-listing" data-existing-excludes="<?php echo (($options->mainJob === 'updating' || $options->mainJob === 'resetting') && isset($options->currentClone['excludedDirectories'])) ? esc_html(implode(',', $options->currentClone['excludedDirectories'])) : '' ?>">
14
  <div class="wpstg-mb-8px">
15
- <button type="button" class="wpstg-unselect-dirs button"><?php _e('Unselect All', 'wp-staging'); ?></button>
16
- <button type="button" class="wpstg-select-dirs-default button"> <?php _e('Select Default', 'wp-staging'); ?></button>
17
  </div>
18
- <?php echo $scan->directoryListing() ?>
19
  </div>
20
  <!-- Exclusion Rules Table -->
21
  <div class="wpstg-excluded-filters-container" id="wpstg-exclude-filters-container">
@@ -26,36 +30,36 @@
26
  if ($options->mainJob === 'updating' || $options->mainJob === 'resetting') :
27
  foreach ($options->currentClone['excludeSizeRules'] as $rule) :
28
  $hasRules = true;
29
- echo $excludeUtils->renderSizeExclude($rule);
30
  endforeach;
31
  foreach ($options->currentClone['excludeGlobRules'] as $rule) :
32
  $hasRules = true;
33
- echo $excludeUtils->renderGlobExclude($rule);
34
  endforeach;
35
  endif; ?>
36
  </tbody>
37
  </table>
38
- <p <?php echo !$hasRules ? 'style="display: none;"' : '' ?> class="wpstg-has-exclude-rules"><b><?php _e('Note', 'wp-staging'); ?>:</b> <?php _e('These rules will not affect wp-admin and wp-includes directories!', 'wp-staging')?></p>
39
  <div class="wpstg-exclude-filters-foot">
40
  <div class="wpstg-dropdown wpstg-exclude-filter-dropdown">
41
  <button class="wpstg-dropdown-toggler wpstg-button--secondary wpstg-button--blue">
42
- <?php _e("Add Exclude Rule + ", "wp-staging"); ?>
43
  </button>
44
  <div class="wpstg-dropdown-menu wpstg-menu-dropup">
45
- <button class="wpstg-dropdown-action wpstg-file-size-rule"><?php _e('File Size', 'wp-staging'); ?></button>
46
- <button class="wpstg-dropdown-action wpstg-file-ext-rule"><?php _e('File Extension', 'wp-staging'); ?></button>
47
- <button class="wpstg-dropdown-action wpstg-file-name-rule"><?php _e('File Name', 'wp-staging'); ?></button>
48
- <button class="wpstg-dropdown-action wpstg-dir-name-rule"><?php _e('Folder Name', 'wp-staging'); ?></button>
49
  </div>
50
  </div>
51
  <button <?php echo !$hasRules ? 'style="display: none;"' : '' ?> class="wpstg-ml-8px wpstg-button--secondary wpstg-clear-all-rules wpstg-has-exclude-rules wpstg-button--red">
52
- <?php _e("Clear All Rules", "wp-staging"); ?>
53
  </button>
54
  </div>
55
  </div>
56
  <?php
57
  if ($options->current !== null && $options->mainJob === 'updating') {
58
- echo '<p>' . __("Applying an exclude rule will not effect existing files on the staging site if you don't clean up the wp-content folder before updating. Existing files will not be deleted afterwards automatically!", 'wp-staging') . '</p>';
59
  }
60
  ?>
61
  <!-- End Exclusion Rules Table -->
@@ -78,18 +82,20 @@ if ($options->current !== null && $options->mainJob === 'updating') {
78
 
79
  <?php if (defined('WPSTG_ALLOW_EXTRA_DIRECTORIES') && WPSTG_ALLOW_EXTRA_DIRECTORIES) { ?>
80
  <h4 style="margin:10px 0 10px 0">
81
- <?php echo __("Extra directories to copy", "wp-staging") ?>
82
  </h4>
83
 
84
  <textarea id="wpstg_extraDirectories" name="wpstg_extraDirectories" style="width:100%;height:100px;"></textarea>
85
  <p>
86
  <span>
87
  <?php
88
- echo __(
89
- "Enter one folder path per line.<br>" .
90
- "Folders must be relative to the path: " . $options->root,
91
- "wp-staging"
92
- )
 
 
93
  ?>
94
  </span>
95
  </p>
@@ -100,7 +106,7 @@ if ($options->current !== null && $options->mainJob === 'updating') {
100
  <?php
101
  if (isset($options->current)) {
102
  $destination = isset($options->currentClone['cloneDir']) ? $options->currentClone['cloneDir'] : $options->currentClone['path'];
103
- echo __("All files will be copied to: ", "wp-staging") . "<code>" . $destination . "</code>";
104
  }
105
  ?>
106
  </span>
1
  <?php
2
+
3
  /**
4
  * @var stdClass $options
5
  *
6
  * @see \WPStaging\Backend\Modules\Jobs\Scan::start For details on $options.
7
  */
8
+
9
+ use WPStaging\Framework\Facades\Escape;
10
+
11
  ?>
12
  <p>
13
+ <strong><?php esc_html_e("Select Folders to Copy", "wp-staging") ?></strong>
14
  <br>
15
+ <?php esc_html_e("Click on a folder name to expand it.", "wp-staging") ?>
16
  </p>
17
  <div id="wpstg-directories-listing" data-existing-excludes="<?php echo (($options->mainJob === 'updating' || $options->mainJob === 'resetting') && isset($options->currentClone['excludedDirectories'])) ? esc_html(implode(',', $options->currentClone['excludedDirectories'])) : '' ?>">
18
  <div class="wpstg-mb-8px">
19
+ <button type="button" class="wpstg-unselect-dirs button"><?php esc_html_e('Unselect All', 'wp-staging'); ?></button>
20
+ <button type="button" class="wpstg-select-dirs-default button"> <?php esc_html_e('Select Default', 'wp-staging'); ?></button>
21
  </div>
22
+ <?php echo $scan->directoryListing(); // phpcs:ignore ?>
23
  </div>
24
  <!-- Exclusion Rules Table -->
25
  <div class="wpstg-excluded-filters-container" id="wpstg-exclude-filters-container">
30
  if ($options->mainJob === 'updating' || $options->mainJob === 'resetting') :
31
  foreach ($options->currentClone['excludeSizeRules'] as $rule) :
32
  $hasRules = true;
33
+ echo $excludeUtils->renderSizeExclude($rule); // phpcs:ignore
34
  endforeach;
35
  foreach ($options->currentClone['excludeGlobRules'] as $rule) :
36
  $hasRules = true;
37
+ echo $excludeUtils->renderGlobExclude($rule); // phpcs:ignore
38
  endforeach;
39
  endif; ?>
40
  </tbody>
41
  </table>
42
+ <p <?php echo !$hasRules ? 'style="display: none;"' : '' ?> class="wpstg-has-exclude-rules"><b><?php esc_html_e('Note', 'wp-staging'); ?>:</b> <?php esc_html_e('These rules will not affect wp-admin and wp-includes directories!', 'wp-staging')?></p>
43
  <div class="wpstg-exclude-filters-foot">
44
  <div class="wpstg-dropdown wpstg-exclude-filter-dropdown">
45
  <button class="wpstg-dropdown-toggler wpstg-button--secondary wpstg-button--blue">
46
+ <?php esc_html_e("Add Exclude Rule + ", "wp-staging"); ?>
47
  </button>
48
  <div class="wpstg-dropdown-menu wpstg-menu-dropup">
49
+ <button class="wpstg-dropdown-action wpstg-file-size-rule"><?php esc_html_e('File Size', 'wp-staging'); ?></button>
50
+ <button class="wpstg-dropdown-action wpstg-file-ext-rule"><?php esc_html_e('File Extension', 'wp-staging'); ?></button>
51
+ <button class="wpstg-dropdown-action wpstg-file-name-rule"><?php esc_html_e('File Name', 'wp-staging'); ?></button>
52
+ <button class="wpstg-dropdown-action wpstg-dir-name-rule"><?php esc_html_e('Folder Name', 'wp-staging'); ?></button>
53
  </div>
54
  </div>
55
  <button <?php echo !$hasRules ? 'style="display: none;"' : '' ?> class="wpstg-ml-8px wpstg-button--secondary wpstg-clear-all-rules wpstg-has-exclude-rules wpstg-button--red">
56
+ <?php esc_html_e("Clear All Rules", "wp-staging"); ?>
57
  </button>
58
  </div>
59
  </div>
60
  <?php
61
  if ($options->current !== null && $options->mainJob === 'updating') {
62
+ echo '<p>' . esc_html__("Applying an exclude rule will not effect existing files on the staging site if you don't clean up the wp-content folder before updating. Existing files will not be deleted afterwards automatically!", 'wp-staging') . '</p>';
63
  }
64
  ?>
65
  <!-- End Exclusion Rules Table -->
82
 
83
  <?php if (defined('WPSTG_ALLOW_EXTRA_DIRECTORIES') && WPSTG_ALLOW_EXTRA_DIRECTORIES) { ?>
84
  <h4 style="margin:10px 0 10px 0">
85
+ <?php echo esc_html__("Extra directories to copy", "wp-staging") ?>
86
  </h4>
87
 
88
  <textarea id="wpstg_extraDirectories" name="wpstg_extraDirectories" style="width:100%;height:100px;"></textarea>
89
  <p>
90
  <span>
91
  <?php
92
+ echo sprintf(
93
+ Escape::escapeHtml(__(
94
+ "Enter one folder path per line.<br>" .
95
+ "Folders must be relative to the path: %s"
96
+ ), 'wp-staging'),
97
+ esc_html($options->root)
98
+ );
99
  ?>
100
  </span>
101
  </p>
106
  <?php
107
  if (isset($options->current)) {
108
  $destination = isset($options->currentClone['cloneDir']) ? $options->currentClone['cloneDir'] : $options->currentClone['path'];
109
+ echo esc_html__("All files will be copied to: ", "wp-staging") . "<code>" . esc_html($destination) . "</code>";
110
  }
111
  ?>
112
  </span>
Backend/views/settings/main-settings.php CHANGED
@@ -1,4 +1,8 @@
1
- <?php settings_errors(); ?>
 
 
 
 
2
  <div class="wpstg_admin">
3
  <?php require_once(WPSTG_PLUGIN_DIR . 'Backend/views/_main/header.php'); ?>
4
 
@@ -6,7 +10,7 @@
6
  <ul class="wpstg-nav-tab-wrapper">
7
  <?php
8
  $tabs = \WPStaging\Core\WPStaging::getInstance()->get("tabs")->get();
9
- $activeTab = (isset($_GET["tab"]) && array_key_exists($_GET["tab"], $tabs)) ? $_GET["tab"] : "general";
10
 
11
  # Loop through tabs
12
  foreach ($tabs as $id => $name) :
@@ -23,9 +27,9 @@
23
  ?>
24
  <li>
25
  <a href="<?php
26
- echo $url ?>" title="<?php
27
  echo esc_attr($name) ?>" class="wpstg-nav-tab<?php
28
- echo $activeClass ?>">
29
  <?php
30
  echo esc_html($name) ?>
31
  </a>
1
+ <?php
2
+
3
+ use WPStaging\Framework\Facades\Sanitize;
4
+
5
+ settings_errors(); ?>
6
  <div class="wpstg_admin">
7
  <?php require_once(WPSTG_PLUGIN_DIR . 'Backend/views/_main/header.php'); ?>
8
 
10
  <ul class="wpstg-nav-tab-wrapper">
11
  <?php
12
  $tabs = \WPStaging\Core\WPStaging::getInstance()->get("tabs")->get();
13
+ $activeTab = (isset($_GET["tab"]) && array_key_exists($_GET["tab"], $tabs)) ? Sanitize::sanitizeString($_GET["tab"]) : "general";
14
 
15
  # Loop through tabs
16
  foreach ($tabs as $id => $name) :
27
  ?>
28
  <li>
29
  <a href="<?php
30
+ echo esc_url($url) ?>" title="<?php
31
  echo esc_attr($name) ?>" class="wpstg-nav-tab<?php
32
+ echo esc_attr($activeClass) ?>">
33
  <?php
34
  echo esc_html($name) ?>
35
  </a>
Backend/views/settings/tabs/general.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <!-- General Settings -->
2
  <div id="wpstg-tab-container" class="tab_container">
3
  <form class="wpstg-settings-panel" method="post" action="options.php">
@@ -9,20 +15,21 @@
9
  continue;
10
  }
11
 
 
12
  $form = \WPStaging\Core\WPStaging::getInstance()->get("forms")->get($id);
13
 
14
  if ($form === null) {
15
  continue;
16
  }
17
  ?>
18
- <div id="<?php echo $id ?>__wpstg_header">
19
  <table class="wpstg-form-table">
20
  <thead>
21
  <tr class="wpstg-settings-row">
22
  <th class="wpstg-settings-row th" colspan="2">
23
  <div class="col-title">
24
  <strong><?php
25
- echo $name ?></strong>
26
  <span class="description"></span>
27
  </div>
28
  </th>
@@ -34,11 +41,11 @@
34
  <td class="wpstg-settings-row th">
35
  <div class="col-title">
36
  <?php
37
- echo $form->label("wpstg_settings[queryLimit]")
38
  ?>
39
  <span class="description">
40
  <?php
41
- _e(
42
  "Number of DB rows, that are queried within one request.
43
  The higher the value the faster the database copy process.
44
  To find out the highest possible values try a high value like 10.000 or more. If you get timeout issues, lower it
@@ -52,18 +59,18 @@
52
  </td>
53
  <td>
54
  <?php
55
- echo $form->render("wpstg_settings[queryLimit]") ?>
56
  </td>
57
  </tr>
58
  <tr class="wpstg-settings-row">
59
  <td class="wpstg-settings-row th">
60
  <div class="col-title">
61
  <?php
62
- echo $form->label("wpstg_settings[querySRLimit]")
63
  ?>
64
  <span class="description">
65
  <?php
66
- _e(
67
  "Number of DB rows, that are processed within one request.
68
  The higher the value the faster the database search & replace process.
69
  This is a high memory consumptive process. If you get timeouts lower this value!",
@@ -76,7 +83,7 @@
76
  </td>
77
  <td>
78
  <?php
79
- echo $form->render("wpstg_settings[querySRLimit]") ?>
80
  </td>
81
  </tr>
82
 
@@ -84,11 +91,11 @@
84
  <td class="wpstg-settings-row th">
85
  <div class="col-title">
86
  <?php
87
- echo $form->label("wpstg_settings[fileLimit]")
88
  ?>
89
  <span class="description">
90
  <?php
91
- _e(
92
  "Number of files to copy that will be copied within one request.
93
  The higher the value the faster the file copy process.
94
  To find out the highest possible values try a high value like 500 or more. If you get timeout issues, lower it
@@ -97,9 +104,10 @@
97
  ); ?>
98
  <br>
99
  <br>
 
100
  <?php
101
- _e(
102
- "<strong>Important:</strong> If CPU Load Priority is <strong>Low</strong>, set a file copy limit value of 50 or higher! Otherwise file copying process takes a lot of time.",
103
  "wp-staging"
104
  ); ?>
105
  <br>
@@ -110,7 +118,7 @@
110
  </td>
111
  <td>
112
  <?php
113
- echo $form->render("wpstg_settings[fileLimit]") ?>
114
  </td>
115
  </tr>
116
 
@@ -118,10 +126,10 @@
118
  <td class="wpstg-settings-row th">
119
  <div class="col-title">
120
  <?php
121
- echo $form->label("wpstg_settings[maxFileSize]") ?>
122
  <span class="description">
123
  <?php
124
- _e(
125
  "Maximum size of the files which are allowed to copy. All files larger than this value will be skipped.
126
  Note: Increase this option only if you have a good reason. Files larger than a few megabytes are in 99% of all cases log and backup files which are not needed on a staging site.",
127
  "wp-staging"
@@ -133,17 +141,17 @@
133
  </td>
134
  <td>
135
  <?php
136
- echo $form->render("wpstg_settings[maxFileSize]") ?>
137
  </td>
138
  </tr>
139
  <tr class="wpstg-settings-row">
140
  <td class="wpstg-settings-row th">
141
  <div class="col-title">
142
  <?php
143
- echo $form->label("wpstg_settings[batchSize]") ?>
144
  <span class="description">
145
  <?php
146
- _e(
147
  "Buffer size for the file copy process in megabyte.
148
  The higher the value the faster large files are copied.
149
  To find out the highest possible values try a high one and lower it until
@@ -159,7 +167,7 @@
159
  </td>
160
  <td>
161
  <?php
162
- echo $form->render("wpstg_settings[batchSize]") ?>
163
  </td>
164
  </tr>
165
 
@@ -167,16 +175,16 @@
167
  <td class="wpstg-settings-row th">
168
  <div class="col-title">
169
  <?php
170
- echo $form->label("wpstg_settings[cpuLoad]") ?>
171
  <span class="description">
172
  <?php
173
- _e(
174
  "Using high will result in fast as possible processing but the cpu load
175
  increases and it's also possible that staging process gets interrupted because of too many ajax requests
176
- (e.g. <strong>authorization error</strong>).
177
  Using a lower value results in lower cpu load on your server but also slower staging site creation.",
178
  "wp-staging"
179
- ); ?>
180
  <br>
181
  <strong>Default: </strong> Low
182
  </span>
@@ -184,7 +192,7 @@
184
  </td>
185
  <td>
186
  <?php
187
- echo $form->render("wpstg_settings[cpuLoad]") ?>
188
  </td>
189
  </tr>
190
  <?php
@@ -194,7 +202,7 @@
194
  <td class="wpstg-settings-row th">
195
  <div class="col-title">
196
  <?php
197
- echo $form->label("wpstg_settings[disableAdminLogin]") ?>
198
  <span class="description">
199
  If you want to remove the requirement to login to the staging site you can deactivate it here.
200
  <strong>Note:</strong> The staging site discourages search engines from indexing the site by setting the 'noindex' tag into header of the staging site.
@@ -203,7 +211,7 @@
203
  </td>
204
  <td>
205
  <?php
206
- echo $form->render("wpstg_settings[disableAdminLogin]") ?>
207
  </td>
208
  </tr>
209
  <?php
@@ -216,22 +224,22 @@
216
  <td class="wpstg-settings-row th">
217
  <div class="col-title">
218
  <?php
219
- echo $form->label("wpstg_settings[keepPermalinks]") ?>
220
  <span class="description">
221
  <?php
222
- echo sprintf(
223
  __(
224
  'Use on the staging site the same permalink structure and do not set permalinks to plain structure. <br/>Read more: <a href="%1$s" target="_blank">Permalink Settings</a> ',
225
  'wp-staging'
226
  ),
227
  'https://wp-staging.com/docs/activate-permalinks-staging-site/'
228
- ); ?>
229
  </span>
230
  </div>
231
  </td>
232
  <td>
233
  <?php
234
- echo $form->render("wpstg_settings[keepPermalinks]") ?>
235
  </td>
236
  </tr>
237
  <?php
@@ -241,30 +249,33 @@
241
  <td class="wpstg-settings-row th">
242
  <div class="col-title">
243
  <?php
244
- echo $form->label("wpstg_settings[debugMode]") ?>
245
  <span class="description">
246
  <?php
247
- _e(
248
- "Enable an extended debug mode that creates additional log entries in wp-content/uploads/wp-staging/logs/logfile.log.
249
- <strong>Do NOT activate this until we ask you to do so!</strong>",
250
  "wp-staging"
251
- ); ?>
 
 
 
 
252
  </span>
253
  </div>
254
  </td>
255
  <td>
256
  <?php
257
- echo $form->render("wpstg_settings[debugMode]") ?>
258
  </td>
259
  </tr>
260
  <tr class="wpstg-settings-row">
261
  <td class="wpstg-settings-row th">
262
  <div class="col-title">
263
  <?php
264
- echo $form->label("wpstg_settings[optimizer]") ?>
265
  <span class="description">
266
  <?php
267
- _e(
268
  "The Optimizer is a mu plugin that disables all other plugins during WP STAGING processing. This lowers memory consumption and speeds up processing. This should always be enabled!",
269
  "wp-staging"
270
  ); ?>
@@ -273,17 +284,17 @@
273
  </td>
274
  <td>
275
  <?php
276
- echo $form->render("wpstg_settings[optimizer]") ?>
277
  </td>
278
  </tr>
279
  <tr class="wpstg-settings-row">
280
  <td class="wpstg-settings-row th">
281
  <div class="col-title">
282
  <?php
283
- echo $form->label("wpstg_settings[unInstallOnDelete]") ?>
284
  <span class="description">
285
  <?php
286
- _e(
287
  "Check this box if you like to remove all data when the plugin is deleted.
288
  This will not remove staging sites files or database tables.",
289
  "wp-staging"
@@ -293,7 +304,7 @@
293
  </td>
294
  <td>
295
  <?php
296
- echo $form->render("wpstg_settings[unInstallOnDelete]") ?>
297
  </td>
298
  </tr>
299
 
@@ -301,21 +312,21 @@
301
  <td class="wpstg-settings-row th">
302
  <div class="col-title">
303
  <?php
304
- echo $form->label("wpstg_settings[checkDirectorySize]") ?>
305
  <span class="description">
306
  <?php
307
- _e(
308
  "Check this box if you like WP Staging to check sizes of each directory on scanning process.
309
- <br>
310
  Warning this may cause timeout problems in big directory / file structures.",
311
  "wp-staging"
312
- ); ?>
313
  </span>
314
  </div>
315
  </td>
316
  <td>
317
  <?php
318
- echo $form->render("wpstg_settings[checkDirectorySize]") ?>
319
  </td>
320
  </tr>
321
  <?php
@@ -325,66 +336,66 @@
325
  <td class="wpstg-settings-row th">
326
  <div class="col-title">
327
  <?php
328
- echo $form->label("wpstg_settings[userRoles][]") ?>
329
  <span class="description">
330
  <?php
331
- _e(
332
  'Select the user role you want to give access to the staging site. You can select multiple roles by holding CTRL or ⌘ Cmd key while clicking. <strong>Change this option on the staging site if you want to change the authentication behavior there.</strong>',
333
  'wp-staging'
334
- ); ?>
335
  </span>
336
  </div>
337
  </td>
338
  <td>
339
  <?php
340
- echo $form->render("wpstg_settings[userRoles][]") ?>
341
  </td>
342
  </tr>
343
  <tr class="wpstg-settings-row">
344
  <td class="wpstg-settings-row th">
345
  <div class="col-title">
346
  <?php
347
- echo $form->label("wpstg_settings[usersWithStagingAccess]") ?>
348
  <span class="description">
349
  <?php
350
- _e(
351
  'Specify users who will have access to the staging site regardless of their role. You can enter multiple user names separated by a comma. <strong>Change this option on the staging site if you want to change the authentication behavior there.</strong>',
352
  'wp-staging'
353
- ); ?>
354
  </span>
355
  </div>
356
  </td>
357
  <td>
358
  <?php
359
- echo $form->render("wpstg_settings[usersWithStagingAccess]") ?>
360
  </td>
361
  </tr>
362
  <tr class="wpstg-settings-row">
363
  <td class="wpstg-settings-row th">
364
  <div class="col-title">
365
  <?php
366
- echo $form->label("wpstg_settings[adminBarColor]") ?>
367
  <span class="description">
368
  </span>
369
  </div>
370
  </td>
371
  <td>
372
  <?php
373
- echo $form->render("wpstg_settings[adminBarColor]") ?>
374
  </td>
375
  </tr>
376
  <tr class="wpstg-settings-row">
377
  <td class="wpstg-settings-row th">
378
  <div class="col-title">
379
- <strong><?php echo __('Send Usage Information', 'wp-staging') ?></strong>
380
  <span class="description">
381
  <?php
382
- _e(
383
  'Send usage information to wp-staging.com.',
384
  'wp-staging'
385
  );
386
  echo '<br>';
387
- echo wp_kses_post(__(sprintf('<i>See the data we collect <a href="%s" target="_blank">here</a></i>', 'https://wp-staging.com/what-data-do-we-collect/')), 'wp-staging');
388
  ?>
389
  </span>
390
  </div>
@@ -407,9 +418,9 @@
407
  ?>
408
  <tr class="wpstg-settings-row">
409
  <td class="wpstg-settings-row th">
410
- <b class="wpstg-settings-title"><?php _e('Send Email Error Report', 'wp-staging') ?></b>
411
  <p class="wpstg-settings-message">
412
- <?php _e('If a scheduled backup fails, send an email.', 'wp-staging') ?>
413
  </p>
414
  </td>
415
  <td>
@@ -418,13 +429,13 @@
418
  </tr>
419
  <tr class="wpstg-settings-row">
420
  <td>
421
- <b class="wpstg-settings-title"><?php _e('Email Address', 'wp-staging') ?></b>
422
  <p class="wpstg-settings-message">
423
- <?php _e('Send emails to this address', 'wp-staging') ?>
424
  </p>
425
  </td>
426
  <td>
427
- <input type="text" id="wpstg-send-schedules-report-email" name="wpstg_settings[schedulesReportEmail]" class="wpstg-checkbox wpstg-settings-field" value="<?php echo get_option(WPStaging\Pro\Backup\BackupScheduler::BACKUP_SCHEDULE_REPORT_EMAIL_OPTION) ?>"/>
428
  </td>
429
  </tr>
430
  <?php
@@ -434,9 +445,9 @@
434
  ?>
435
  <tr>
436
  <td>
437
- <b class="wpstg-settings-title"><?php _e('Allow Cloning (Staging Site Only)', 'wp-staging') ?></b>
438
  <p class="wpstg-settings-message">
439
- <?php _e('Check this box to make this staging site cloneable.', 'wp-staging') ?>
440
  <?php echo sprintf(__("If you would like to know more about cloning staging sites check out <a href='%s' target='_new'>this article</a>.", 'wp-staging'), 'https://wp-staging.com/docs/cloning-a-staging-site-testing-push-method/'); ?>
441
  </p>
442
  </td>
1
+ <?php
2
+
3
+ use WPStaging\Framework\Facades\Escape;
4
+
5
+ ?>
6
+
7
  <!-- General Settings -->
8
  <div id="wpstg-tab-container" class="tab_container">
9
  <form class="wpstg-settings-panel" method="post" action="options.php">
15
  continue;
16
  }
17
 
18
+ /** @var WPStaging\Core\Forms\Form */
19
  $form = \WPStaging\Core\WPStaging::getInstance()->get("forms")->get($id);
20
 
21
  if ($form === null) {
22
  continue;
23
  }
24
  ?>
25
+ <div id="<?php echo esc_attr($id) ?>__wpstg_header">
26
  <table class="wpstg-form-table">
27
  <thead>
28
  <tr class="wpstg-settings-row">
29
  <th class="wpstg-settings-row th" colspan="2">
30
  <div class="col-title">
31
  <strong><?php
32
+ echo esc_html($name) ?></strong>
33
  <span class="description"></span>
34
  </div>
35
  </th>
41
  <td class="wpstg-settings-row th">
42
  <div class="col-title">
43
  <?php
44
+ $form->renderLabel("wpstg_settings[queryLimit]")
45
  ?>
46
  <span class="description">
47
  <?php
48
+ esc_html_e(
49
  "Number of DB rows, that are queried within one request.
50
  The higher the value the faster the database copy process.
51
  To find out the highest possible values try a high value like 10.000 or more. If you get timeout issues, lower it
59
  </td>
60
  <td>
61
  <?php
62
+ $form->renderInput("wpstg_settings[queryLimit]") ?>
63
  </td>
64
  </tr>
65
  <tr class="wpstg-settings-row">
66
  <td class="wpstg-settings-row th">
67
  <div class="col-title">
68
  <?php
69
+ $form->renderLabel("wpstg_settings[querySRLimit]")
70
  ?>
71
  <span class="description">
72
  <?php
73
+ esc_html_e(
74
  "Number of DB rows, that are processed within one request.
75
  The higher the value the faster the database search & replace process.
76
  This is a high memory consumptive process. If you get timeouts lower this value!",
83
  </td>
84
  <td>
85
  <?php
86
+ $form->renderInput("wpstg_settings[querySRLimit]") ?>
87
  </td>
88
  </tr>
89
 
91
  <td class="wpstg-settings-row th">
92
  <div class="col-title">
93
  <?php
94
+ $form->renderLabel("wpstg_settings[fileLimit]")
95
  ?>
96
  <span class="description">
97
  <?php
98
+ esc_html_e(
99
  "Number of files to copy that will be copied within one request.
100
  The higher the value the faster the file copy process.
101
  To find out the highest possible values try a high value like 500 or more. If you get timeout issues, lower it
104
  ); ?>
105
  <br>
106
  <br>
107
+ <strong><?php esc_html_e("Important:", "wp-staging") ?></strong>
108
  <?php
109
+ esc_html_e(
110
+ "If CPU Load Priority is <strong>Low</strong>, set a file copy limit value of 50 or higher! Otherwise file copying process takes a lot of time.",
111
  "wp-staging"
112
  ); ?>
113
  <br>
118
  </td>
119
  <td>
120
  <?php
121
+ $form->renderInput("wpstg_settings[fileLimit]") ?>
122
  </td>
123
  </tr>
124
 
126
  <td class="wpstg-settings-row th">
127
  <div class="col-title">
128
  <?php
129
+ $form->renderLabel("wpstg_settings[maxFileSize]") ?>
130
  <span class="description">
131
  <?php
132
+ esc_html_e(
133
  "Maximum size of the files which are allowed to copy. All files larger than this value will be skipped.
134
  Note: Increase this option only if you have a good reason. Files larger than a few megabytes are in 99% of all cases log and backup files which are not needed on a staging site.",
135
  "wp-staging"
141
  </td>
142
  <td>
143
  <?php
144
+ $form->renderInput("wpstg_settings[maxFileSize]") ?>
145
  </td>
146
  </tr>
147
  <tr class="wpstg-settings-row">
148
  <td class="wpstg-settings-row th">
149
  <div class="col-title">
150
  <?php
151
+ $form->renderLabel("wpstg_settings[batchSize]") ?>
152
  <span class="description">
153
  <?php
154
+ esc_html_e(
155
  "Buffer size for the file copy process in megabyte.
156
  The higher the value the faster large files are copied.
157
  To find out the highest possible values try a high one and lower it until
167
  </td>
168
  <td>
169
  <?php
170
+ $form->renderInput("wpstg_settings[batchSize]") ?>
171
  </td>
172
  </tr>
173
 
175
  <td class="wpstg-settings-row th">
176
  <div class="col-title">
177
  <?php
178
+ $form->renderLabel("wpstg_settings[cpuLoad]") ?>
179
  <span class="description">
180
  <?php
181
+ echo sprintf(esc_html__(
182
  "Using high will result in fast as possible processing but the cpu load
183
  increases and it's also possible that staging process gets interrupted because of too many ajax requests
184
+ (e.g. %s).
185
  Using a lower value results in lower cpu load on your server but also slower staging site creation.",
186
  "wp-staging"
187
+ ), "<strong>authorization error</strong>"); ?>
188
  <br>
189
  <strong>Default: </strong> Low
190
  </span>
192
  </td>
193
  <td>
194
  <?php
195
+ $form->renderInput("wpstg_settings[cpuLoad]") ?>
196
  </td>
197
  </tr>
198
  <?php
202
  <td class="wpstg-settings-row th">
203
  <div class="col-title">
204
  <?php
205
+ $form->renderLabel("wpstg_settings[disableAdminLogin]") ?>
206
  <span class="description">
207
  If you want to remove the requirement to login to the staging site you can deactivate it here.
208
  <strong>Note:</strong> The staging site discourages search engines from indexing the site by setting the 'noindex' tag into header of the staging site.
211
  </td>
212
  <td>
213
  <?php
214
+ $form->renderInput("wpstg_settings[disableAdminLogin]") ?>
215
  </td>
216
  </tr>
217
  <?php
224
  <td class="wpstg-settings-row th">
225
  <div class="col-title">
226
  <?php
227
+ $form->renderLabel("wpstg_settings[keepPermalinks]") ?>
228
  <span class="description">
229
  <?php
230
+ echo wp_kses_post(sprintf(
231
  __(
232
  'Use on the staging site the same permalink structure and do not set permalinks to plain structure. <br/>Read more: <a href="%1$s" target="_blank">Permalink Settings</a> ',
233
  'wp-staging'
234
  ),
235
  'https://wp-staging.com/docs/activate-permalinks-staging-site/'
236
+ )); ?>
237
  </span>
238
  </div>
239
  </td>
240
  <td>
241
  <?php
242
+ $form->renderInput("wpstg_settings[keepPermalinks]") ?>
243
  </td>
244
  </tr>
245
  <?php
249
  <td class="wpstg-settings-row th">
250
  <div class="col-title">
251
  <?php
252
+ $form->renderLabel("wpstg_settings[debugMode]") ?>
253
  <span class="description">
254
  <?php
255
+ esc_html_e(
256
+ "Enable an extended debug mode that creates additional log entries in wp-content/uploads/wp-staging/logs/logfile.log.",
 
257
  "wp-staging"
258
+ );
259
+ ?>
260
+ <strong>
261
+ <?php esc_attr_e('Do NOT activate this until we ask you to do so!', 'wp-staging') ?>
262
+ </strong>
263
  </span>
264
  </div>
265
  </td>
266
  <td>
267
  <?php
268
+ $form->renderInput("wpstg_settings[debugMode]") ?>
269
  </td>
270
  </tr>
271
  <tr class="wpstg-settings-row">
272
  <td class="wpstg-settings-row th">
273
  <div class="col-title">
274
  <?php
275
+ $form->renderLabel("wpstg_settings[optimizer]") ?>
276
  <span class="description">
277
  <?php
278
+ esc_html_e(
279
  "The Optimizer is a mu plugin that disables all other plugins during WP STAGING processing. This lowers memory consumption and speeds up processing. This should always be enabled!",
280
  "wp-staging"
281
  ); ?>
284
  </td>
285
  <td>
286
  <?php
287
+ $form->renderInput("wpstg_settings[optimizer]") ?>
288
  </td>
289
  </tr>
290
  <tr class="wpstg-settings-row">
291
  <td class="wpstg-settings-row th">
292
  <div class="col-title">
293
  <?php
294
+ $form->renderLabel("wpstg_settings[unInstallOnDelete]") ?>
295
  <span class="description">
296
  <?php
297
+ esc_html_e(
298
  "Check this box if you like to remove all data when the plugin is deleted.
299
  This will not remove staging sites files or database tables.",
300
  "wp-staging"
304
  </td>
305
  <td>
306
  <?php
307
+ $form->renderInput("wpstg_settings[unInstallOnDelete]") ?>
308
  </td>
309
  </tr>
310
 
312
  <td class="wpstg-settings-row th">
313
  <div class="col-title">
314
  <?php
315
+ $form->renderLabel("wpstg_settings[checkDirectorySize]") ?>
316
  <span class="description">
317
  <?php
318
+ echo sprintf(esc_html__(
319
  "Check this box if you like WP Staging to check sizes of each directory on scanning process.
320
+ %s
321
  Warning this may cause timeout problems in big directory / file structures.",
322
  "wp-staging"
323
+ ), "<br>"); ?>
324
  </span>
325
  </div>
326
  </td>
327
  <td>
328
  <?php
329
+ $form->renderInput("wpstg_settings[checkDirectorySize]") ?>
330
  </td>
331
  </tr>
332
  <?php
336
  <td class="wpstg-settings-row th">
337
  <div class="col-title">
338
  <?php
339
+ $form->renderLabel("wpstg_settings[userRoles][]") ?>
340
  <span class="description">
341
  <?php
342
+ echo Escape::escapeHtml(__(
343
  'Select the user role you want to give access to the staging site. You can select multiple roles by holding CTRL or ⌘ Cmd key while clicking. <strong>Change this option on the staging site if you want to change the authentication behavior there.</strong>',
344
  'wp-staging'
345
+ )); ?>
346
  </span>
347
  </div>
348
  </td>
349
  <td>
350
  <?php
351
+ $form->renderInput("wpstg_settings[userRoles][]") ?>
352
  </td>
353
  </tr>
354
  <tr class="wpstg-settings-row">
355
  <td class="wpstg-settings-row th">
356
  <div class="col-title">
357
  <?php
358
+ $form->renderLabel("wpstg_settings[usersWithStagingAccess]") ?>
359
  <span class="description">
360
  <?php
361
+ echo Escape::escapeHtml(__(
362
  'Specify users who will have access to the staging site regardless of their role. You can enter multiple user names separated by a comma. <strong>Change this option on the staging site if you want to change the authentication behavior there.</strong>',
363
  'wp-staging'
364
+ )); ?>
365
  </span>
366
  </div>
367
  </td>
368
  <td>
369
  <?php
370
+ $form->renderInput("wpstg_settings[usersWithStagingAccess]") ?>
371
  </td>
372
  </tr>
373
  <tr class="wpstg-settings-row">
374
  <td class="wpstg-settings-row th">
375
  <div class="col-title">
376
  <?php
377
+ $form->renderLabel("wpstg_settings[adminBarColor]") ?>
378
  <span class="description">
379
  </span>
380
  </div>
381
  </td>
382
  <td>
383
  <?php
384
+ $form->renderInput("wpstg_settings[adminBarColor]") ?>
385
  </td>
386
  </tr>
387
  <tr class="wpstg-settings-row">
388
  <td class="wpstg-settings-row th">
389
  <div class="col-title">
390
+ <strong><?php esc_html_e('Send Usage Information', 'wp-staging') ?></strong>
391
  <span class="description">
392
  <?php
393
+ esc_html_e(
394
  'Send usage information to wp-staging.com.',
395
  'wp-staging'
396
  );
397
  echo '<br>';
398
+ echo wp_kses_post(sprintf(__('<i>See the data we collect <a href="%s" target="_blank">here</a></i>', 'wp-staging'), 'https://wp-staging.com/what-data-do-we-collect/'));
399
  ?>
400
  </span>
401
  </div>
418
  ?>
419
  <tr class="wpstg-settings-row">
420
  <td class="wpstg-settings-row th">
421
+ <b class="wpstg-settings-title"><?php esc_html_e('Send Email Error Report', 'wp-staging') ?></b>
422
  <p class="wpstg-settings-message">
423
+ <?php esc_html_e('If a scheduled backup fails, send an email.', 'wp-staging') ?>
424
  </p>
425
  </td>
426
  <td>
429
  </tr>
430
  <tr class="wpstg-settings-row">
431
  <td>
432
+ <b class="wpstg-settings-title"><?php esc_html_e('Email Address', 'wp-staging') ?></b>
433
  <p class="wpstg-settings-message">
434
+ <?php esc_html_e('Send emails to this address', 'wp-staging') ?>
435
  </p>
436
  </td>
437
  <td>
438
+ <input type="text" id="wpstg-send-schedules-report-email" name="wpstg_settings[schedulesReportEmail]" class="wpstg-checkbox wpstg-settings-field" value="<?php echo esc_attr(get_option(WPStaging\Pro\Backup\BackupScheduler::BACKUP_SCHEDULE_REPORT_EMAIL_OPTION)) ?>"/>
439
  </td>
440
  </tr>
441
  <?php
445
  ?>
446
  <tr>
447
  <td>
448
+ <b class="wpstg-settings-title"><?php esc_html_e('Allow Cloning (Staging Site Only)', 'wp-staging') ?></b>
449
  <p class="wpstg-settings-message">
450
+ <?php esc_html_e('Check this box to make this staging site cloneable.', 'wp-staging') ?>
451
  <?php echo sprintf(__("If you would like to know more about cloning staging sites check out <a href='%s' target='_new'>this article</a>.", 'wp-staging'), 'https://wp-staging.com/docs/cloning-a-staging-site-testing-push-method/'); ?>
452
  </p>
453
  </td>
Backend/views/settings/tabs/mail-settings.php CHANGED
@@ -1,17 +1,17 @@
1
  <form class="wpstg-mail-settings-form" method="post">
2
  <?php $emailsAllowed = !((bool)(new \WPStaging\Framework\Staging\CloneOptions())->get((\WPStaging\Framework\Staging\FirstRun::MAILS_DISABLED_KEY))); ?>
3
  <p>
4
- <strong class="wpstg-fs-14"> <?php _e('Mail Delivery Setting', 'wp-staging'); ?></strong>
5
  <br/>
6
- <?php _e('Toggle mails sending for this staging site', 'wp-staging'); ?>
7
  </p>
8
  <div class="wpstg-form-group">
9
  <label class="wpstg-checkbox" for="wpstg_allow_emails">
10
- <?php _e('Allow Mails Sending:', 'wp-staging'); ?> <input type="checkbox" name="wpstg_allow_emails" id="wpstg_allow_emails" <?php echo $emailsAllowed === true ? 'checked' : '' ?>>
11
  </label>
12
  </div>
13
  <p>
14
- <b><?php _e('Note', 'wp-staging') ?>: </b> <?php echo sprintf(__('Some plugins might still be able to send out mails if they don\'t depend upon %s.', 'wp-staging'), '<code>wp_mail()</code>'); ?>
15
  </p>
16
- <button type="button" id="wpstg-update-mail-settings" class="wpstg-link-btn wpstg-blue-primary"><?php _e("Update Settings", "wp-staging") ?></button>
17
  </form>
1
  <form class="wpstg-mail-settings-form" method="post">
2
  <?php $emailsAllowed = !((bool)(new \WPStaging\Framework\Staging\CloneOptions())->get((\WPStaging\Framework\Staging\FirstRun::MAILS_DISABLED_KEY))); ?>
3
  <p>
4
+ <strong class="wpstg-fs-14"> <?php esc_html_e('Mail Delivery Setting', 'wp-staging'); ?></strong>
5
  <br/>
6
+ <?php esc_html_e('Toggle mails sending for this staging site', 'wp-staging'); ?>
7
  </p>
8
  <div class="wpstg-form-group">
9
  <label class="wpstg-checkbox" for="wpstg_allow_emails">
10
+ <?php esc_html_e('Allow Mails Sending:', 'wp-staging'); ?> <input type="checkbox" name="wpstg_allow_emails" id="wpstg_allow_emails" <?php echo $emailsAllowed === true ? 'checked' : '' ?>>
11
  </label>
12
  </div>
13
  <p>
14
+ <b><?php esc_html_e('Note', 'wp-staging') ?>: </b> <?php echo sprintf(__('Some plugins might still be able to send out mails if they don\'t depend upon %s.', 'wp-staging'), '<code>wp_mail()</code>'); ?>
15
  </p>
16
+ <button type="button" id="wpstg-update-mail-settings" class="wpstg-link-btn wpstg-blue-primary"><?php esc_html_e("Update Settings", "wp-staging") ?></button>
17
  </form>
Backend/views/settings/tabs/remote-storages.php CHANGED
@@ -3,7 +3,7 @@ $storages = WPStaging\Core\WPStaging::make(\WPStaging\Pro\Backup\Storage\Provide
3
  $provider = 'googledrive';
4
  $providerId = '';
5
  if (isset($_REQUEST['sub'])) {
6
- $provider = strtolower($_REQUEST['sub']);
7
  }
8
 
9
  ?>
@@ -15,8 +15,8 @@ if (isset($_REQUEST['sub'])) {
15
  $providerId = $storage['id'];
16
  }
17
  ?>
18
- <a class="wpstg-storage-provider <?php echo $isActive ? 'wpstg-storage-provider-active' : '' ?>" href="<?php echo $isActive ? 'javascript:void(0);' : $storage['settingsPath']; ?>">
19
- <?php echo $storage['name']; ?>
20
  </a>
21
  <?php endforeach; ?>
22
  </div>
3
  $provider = 'googledrive';
4
  $providerId = '';
5
  if (isset($_REQUEST['sub'])) {
6
+ $provider = strtolower(sanitize_text_field($_REQUEST['sub']));
7
  }
8
 
9
  ?>
15
  $providerId = $storage['id'];
16
  }
17
  ?>
18
+ <a class="wpstg-storage-provider <?php echo $isActive ? 'wpstg-storage-provider-active' : '' ?>" href="<?php echo $isActive ? 'javascript:void(0);' : esc_url($storage['settingsPath']); ?>">
19
+ <?php echo esc_html($storage['name']); ?>
20
  </a>
21
  <?php endforeach; ?>
22
  </div>
Backend/views/settings/tabs/storages/amazons3-settings.php CHANGED
@@ -4,6 +4,7 @@
4
  * @var string $providerId
5
  */
6
 
 
7
  use WPStaging\Framework\Facades\Sanitize;
8
 
9
  ?>
@@ -20,61 +21,70 @@ use WPStaging\Framework\Facades\Sanitize;
20
  $location = empty($options['location']) ? '' : Sanitize::sanitizeString($options['location']);
21
  ?>
22
  <p>
23
- <strong class="wpstg-fs-14"><?php _e('Amazon S3', 'wp-staging'); ?></strong>
24
  <br/>
25
  <br/>
26
- <?php echo __('Upload backup files to your personal Amazon S3 account.', 'wp-staging'); ?>
27
  <br>
28
- <?php echo sprintf(__('None of your backup data is sent to any other party! <a href="%s" target="_blank">Our privacy policy</a>.', 'wp-staging'), 'https://wp-staging.com/privacy-policy/#'); ?>
 
 
 
29
  <br/>
30
  </p>
31
  <div class="wpstg-form-group">
32
  <form class="wpstg-provider-settings-form" id="wpstg-provider-settings-form" method="post">
33
  <div id="wpstg-provider-test-connection-fields">
34
- <strong><?php _e('API Keys', 'wp-staging') ?></strong>
35
 
36
- <input type="hidden" name="provider" value="<?php echo $providerId; ?>" />
37
 
38
  <p>
39
- <?php echo sprintf(__('<a href="%s" target="_blank">How to create Amazon API keys and S3 bucket</a>.', 'wp-staging'), 'https://wp-staging.com/docs/how-to-backup-website-to-amazon-s3-bucket/'); ?>
 
 
 
40
  </p>
41
 
42
  <fieldset class="wpstg-fieldset">
43
- <label><?php _e('Access Key', 'wp-staging') ?></label>
44
- <input class="wpstg-form-control" type="text" name="access_key" value="<?php echo $accessKey; ?>" />
45
  </fieldset>
46
 
47
  <fieldset class="wpstg-fieldset">
48
- <label><?php _e('Secret Key', 'wp-staging') ?></label>
49
- <input class="wpstg-form-control" type="text" name="secret_key" value="<?php echo $secretKey; ?>" />
50
  </fieldset>
51
 
52
  <fieldset class="wpstg-fieldset">
53
- <label><?php _e('Region', 'wp-staging') ?></label>
54
- <input class="wpstg-form-control" type="text" name="region" value="<?php echo $region; ?>" />
55
  </fieldset>
56
  </div>
57
- <button type="button" id="wpstg-btn-provider-test-connection" class="wpstg-link-btn wpstg-blue-primary"><?php _e("Test Connection", "wp-staging") ?></button>
58
 
59
  <hr/>
60
- <strong><?php _e('Upload Settings', 'wp-staging') ?></strong>
61
  <fieldset class="wpstg-fieldset">
62
- <label><?php _e('Max Backups to Keep', 'wp-staging') ?></label>
63
- <input class="wpstg-form-control" type="number" name="max_backups_to_keep" value="<?php echo $maxBackupsToKeep; ?>" style="max-width: 60px" />
64
- <p><?php _e("Leave empty or zero for no limit", 'wp-staging') ?></p>
65
  </fieldset>
66
 
67
  <fieldset class="wpstg-fieldset">
68
- <label><?php _e('Amazon S3 Bucket Location', 'wp-staging') ?></label>
69
- <span>s3:</span><input class="wpstg-form-control" type="text" name="location" value="<?php echo $location; ?>" />
70
  <p>
71
- <?php echo sprintf(__("Create the bucket beforhand in your Amazon S3 account and add it here! %s To add a subdirectory you can write <code>s3:[bucket-name]/[directory-name]</code>. <br>The directory will be created by WP STAGING automatically during backup upload. ", 'wp-staging'), '<br>'); ?>
 
 
 
72
  </p>
73
  </fieldset>
74
 
75
  <hr/>
76
 
77
- <button type="button" id="wpstg-btn-save-provider-settings" class="wpstg-link-btn wpstg-blue-primary"><?php _e("Save Settings", "wp-staging") ?></button>
78
  </form>
79
  </div>
80
  </fieldset>
4
  * @var string $providerId
5
  */
6
 
7
+ use WPStaging\Framework\Facades\Escape;
8
  use WPStaging\Framework\Facades\Sanitize;
9
 
10
  ?>
21
  $location = empty($options['location']) ? '' : Sanitize::sanitizeString($options['location']);
22
  ?>
23
  <p>
24
+ <strong class="wpstg-fs-14"><?php esc_html_e('Amazon S3', 'wp-staging'); ?></strong>
25
  <br/>
26
  <br/>
27
+ <?php echo esc_html__('Upload backup files to your personal Amazon S3 account.', 'wp-staging'); ?>
28
  <br>
29
+ <?php echo sprintf(
30
+ Escape::escapeHtml(__('None of your backup data is sent to any other party! <a href="%s" target="_blank">Our privacy policy</a>.', 'wp-staging')),
31
+ 'https://wp-staging.com/privacy-policy/#'
32
+ ); ?>
33
  <br/>
34
  </p>
35
  <div class="wpstg-form-group">
36
  <form class="wpstg-provider-settings-form" id="wpstg-provider-settings-form" method="post">
37
  <div id="wpstg-provider-test-connection-fields">
38
+ <strong><?php esc_html_e('API Keys', 'wp-staging') ?></strong>
39
 
40
+ <input type="hidden" name="provider" value="<?php echo esc_attr($providerId); ?>" />
41
 
42
  <p>
43
+ <?php echo sprintf(
44
+ Escape::escapeHtml(__('<a href="%s" target="_blank">How to create Amazon API keys and S3 bucket</a>.', 'wp-staging')),
45
+ 'https://wp-staging.com/docs/how-to-backup-website-to-amazon-s3-bucket/'
46
+ ); ?>
47
  </p>
48
 
49
  <fieldset class="wpstg-fieldset">
50
+ <label><?php esc_html_e('Access Key', 'wp-staging') ?></label>
51
+ <input class="wpstg-form-control" type="text" name="access_key" value="<?php echo esc_attr($accessKey); ?>" />
52
  </fieldset>
53
 
54
  <fieldset class="wpstg-fieldset">
55
+ <label><?php esc_html_e('Secret Key', 'wp-staging') ?></label>
56
+ <input class="wpstg-form-control" type="text" name="secret_key" value="<?php echo esc_attr($secretKey); ?>" />
57
  </fieldset>
58
 
59
  <fieldset class="wpstg-fieldset">
60
+ <label><?php esc_html_e('Region', 'wp-staging') ?></label>
61
+ <input class="wpstg-form-control" type="text" name="region" value="<?php echo esc_attr($region); ?>" />
62
  </fieldset>
63
  </div>
64
+ <button type="button" id="wpstg-btn-provider-test-connection" class="wpstg-link-btn wpstg-blue-primary"><?php esc_html_e("Test Connection", "wp-staging") ?></button>
65
 
66
  <hr/>
67
+ <strong><?php esc_html_e('Upload Settings', 'wp-staging') ?></strong>
68
  <fieldset class="wpstg-fieldset">
69
+ <label><?php esc_html_e('Max Backups to Keep', 'wp-staging') ?></label>
70
+ <input class="wpstg-form-control" type="number" name="max_backups_to_keep" value="<?php echo esc_attr($maxBackupsToKeep); ?>" style="max-width: 60px" />
71
+ <p><?php esc_html_e("Leave empty or zero for no limit", 'wp-staging') ?></p>
72
  </fieldset>
73
 
74
  <fieldset class="wpstg-fieldset">
75
+ <label><?php esc_html_e('Amazon S3 Bucket Location', 'wp-staging') ?></label>
76
+ <span>s3:</span><input class="wpstg-form-control" type="text" name="location" value="<?php echo esc_attr($location); ?>" />
77
  <p>
78
+ <?php echo sprintf(
79
+ esc_html__("Create the bucket beforhand in your Amazon S3 account and add it here! %s To add a subdirectory you can write <code>s3:[bucket-name]/[directory-name]</code>. <br>The directory will be created by WP STAGING automatically during backup upload. ", 'wp-staging'),
80
+ '<br>'
81
+ ); ?>
82
  </p>
83
  </fieldset>
84
 
85
  <hr/>
86
 
87
+ <button type="button" id="wpstg-btn-save-provider-settings" class="wpstg-link-btn wpstg-blue-primary"><?php esc_html_e("Save Settings", "wp-staging") ?></button>
88
  </form>
89
  </div>
90
  </fieldset>
Backend/views/settings/tabs/storages/googledrive-settings.php CHANGED
@@ -4,6 +4,7 @@
4
  * @var string $providerId
5
  */
6
 
 
7
  use WPStaging\Framework\Facades\Sanitize;
8
 
9
  ?>
@@ -29,11 +30,14 @@ use WPStaging\Framework\Facades\Sanitize;
29
  $googleRedirectURI = isset($options['googleRedirectURI']) ? Sanitize::sanitizeString($options['googleRedirectURI']) : $defaultApiAuthorizeURL;
30
  ?>
31
  <p>
32
- <strong class="wpstg-fs-14"> <?php _e('Google Drive', 'wp-staging'); ?></strong>
33
  <br/>
34
- <?php echo __('Upload backup files to your personal Google Drive account.', 'wp-staging'); ?>
35
  <br>
36
- <?php echo sprintf(__('None of your backup data is sent to any other party! <a href="%s" target="_blank">Our privacy policy</a>.', 'wp-staging'), 'https://wp-staging.com/privacy-policy/#Google_Drive'); ?>
 
 
 
37
  </p>
38
  <div class="wpstg-form-group">
39
  <?php
@@ -41,13 +45,13 @@ use WPStaging\Framework\Facades\Sanitize;
41
  ?>
42
  <strong class="wpstg-mr-10px">
43
  <?php
44
- _e('You are authenticated to Google Drive.', 'wp-staging');
45
  ?>
46
  </strong>
47
  <br>
48
  <form class="wpstg-provider-revoke-form" id="wpstg-provider-revoke-form" method="post">
49
- <input type="hidden" name="provider" value="<?php echo $providerId; ?>" />
50
- <button type="button" id="wpstg-btn-provider-revoke" class="wpstg-link-btn wpstg-btn-danger"><?php _e("Logout from Google", "wp-staging") ?></button>
51
  </form>
52
  <br/>
53
  <?php
@@ -55,62 +59,65 @@ use WPStaging\Framework\Facades\Sanitize;
55
  $authURL = $googleDriveStorage->getAuthenticationURL();
56
  if ($authURL === false) {
57
  ?>
58
- <b class="wpstg-error"><?php _e('Unable to generate Google Authentication URL. Google API keys are not correct!', 'wp-staging'); ?></b>
59
  <?php
60
  } else {
61
  ?>
62
- <a href="<?php echo esc_url($authURL); ?>" id="wpstg_google_drive_connect" class="wpstg-btn-google"> <img src="<?php echo esc_url(WPSTG_PLUGIN_URL . 'assets/img/google-g.png'); ?>" /> <?php _e("Sign in with Google", "wp-staging") ?></a>
63
- <span><?php _e("OR", "wp-staging") ?></span> &nbsp; <a onclick="WPStaging.handleToggleElement(this)" data-wpstg-target="#wpstg-custom-google-credentials" href="javascript:void(0);"><?php _e("Connect with API Credentials", "wp-staging") ?></a>
64
  <?php
65
  }
66
  }
67
  ?>
68
  <form class="wpstg-provider-settings-form" id="wpstg-provider-settings-form" method="post">
69
- <input type="hidden" name="provider" value="<?php echo $providerId; ?>" />
70
 
71
  <div class="hidden" id="wpstg-custom-google-credentials">
72
- <strong><?php _e('API Keys', 'wp-staging') ?></strong>
73
 
74
  <p>
75
- <?php echo sprintf(__('You can use your own Google API keys. This is optional. <a href="%s" target="_blank">How to create your own Google API keys</a>.', 'wp-staging'), 'https://wp-staging.com/docs/create-google-api-credentials-to-authenticate-to-google-drive/'); ?>
 
 
 
76
  </p>
77
 
78
  <fieldset class="wpstg-fieldset">
79
- <label><?php _e('Google Client Id', 'wp-staging') ?></label>
80
- <input class="wpstg-form-control" type="text" name="google_client_id" value="<?php echo $googleClientId; ?>" />
81
  </fieldset>
82
 
83
  <fieldset class="wpstg-fieldset">
84
- <label><?php _e('Google Client Secret', 'wp-staging') ?></label>
85
- <input class="wpstg-form-control" type="text" name="google_client_secret" value="<?php echo $googleClientSecret; ?>" />
86
  </fieldset>
87
 
88
  <fieldset class="wpstg-fieldset">
89
- <label><?php _e('Google Redirect URI', 'wp-staging') ?></label>
90
  <div class="wpstg-with-icon">
91
- <input class="wpstg-form-control" type="text" name="google_redirect_uri" id="google-redirect-uri" value="<?php echo $googleRedirectURI; ?>" />
92
  <a href="javascript:void(0);" class="wpstg-fieldset-icon" onclick="WPStaging.handleCopyToClipboard(this)" data-wpstg-source="#google-redirect-uri">
93
- <img src="<?php echo esc_url(WPSTG_PLUGIN_URL . 'assets/svg/copy.svg'); ?>" alt="<?php _e("Copy to Clipboard", 'wp-staging') ?>" title="<?php _e("Copy to Clipboard", 'wp-staging') ?>" />
94
  </a>
95
  </div>
96
  </fieldset>
97
  </div>
98
  <hr/>
99
- <strong><?php _e('Upload Settings', 'wp-staging') ?></strong>
100
  <fieldset class="wpstg-fieldset">
101
- <label><?php _e('Max Backups to Keep', 'wp-staging') ?></label>
102
- <input class="wpstg-form-control" type="number" name="max_backups_to_keep" value="<?php echo $maxBackupsToKeep; ?>" style="max-width: 60px" />
103
- <p><?php _e("Leave empty or zero for no limit", 'wp-staging') ?></p>
104
  </fieldset>
105
 
106
  <fieldset class="wpstg-fieldset">
107
- <label><?php _e('Backup Folder Name', 'wp-staging') ?></label>
108
- <input class="wpstg-form-control" type="text" name="folder_name" value="<?php echo $folderName; ?>" />
109
  </fieldset>
110
 
111
  <hr/>
112
 
113
- <button type="button" id="wpstg-btn-save-provider-settings" class="wpstg-link-btn wpstg-blue-primary"><?php _e("Save Settings", "wp-staging") ?></button>
114
  </form>
115
  </div>
116
  </fieldset>
4
  * @var string $providerId
5
  */
6
 
7
+ use WPStaging\Framework\Facades\Escape;
8
  use WPStaging\Framework\Facades\Sanitize;
9
 
10
  ?>
30
  $googleRedirectURI = isset($options['googleRedirectURI']) ? Sanitize::sanitizeString($options['googleRedirectURI']) : $defaultApiAuthorizeURL;
31
  ?>
32
  <p>
33
+ <strong class="wpstg-fs-14"> <?php esc_html_e('Google Drive', 'wp-staging'); ?></strong>
34
  <br/>
35
+ <?php echo esc_html__('Upload backup files to your personal Google Drive account.', 'wp-staging'); ?>
36
  <br>
37
+ <?php echo sprintf(
38
+ Escape::escapeHtml(__('None of your backup data is sent to any other party! <a href="%s" target="_blank">Our privacy policy</a>.', 'wp-staging')),
39
+ 'https://wp-staging.com/privacy-policy/#Google_Drive'
40
+ ); ?>
41
  </p>
42
  <div class="wpstg-form-group">
43
  <?php
45
  ?>
46
  <strong class="wpstg-mr-10px">
47
  <?php
48
+ esc_html_e('You are authenticated to Google Drive.', 'wp-staging');
49
  ?>
50
  </strong>
51
  <br>
52
  <form class="wpstg-provider-revoke-form" id="wpstg-provider-revoke-form" method="post">
53
+ <input type="hidden" name="provider" value="<?php echo esc_attr($providerId); ?>" />
54
+ <button type="button" id="wpstg-btn-provider-revoke" class="wpstg-link-btn wpstg-btn-danger"><?php esc_html_e("Logout from Google", "wp-staging") ?></button>
55
  </form>
56
  <br/>
57
  <?php
59
  $authURL = $googleDriveStorage->getAuthenticationURL();
60
  if ($authURL === false) {
61
  ?>
62
+ <b class="wpstg-error"><?php esc_html_e('Unable to generate Google Authentication URL. Google API keys are not correct!', 'wp-staging'); ?></b>
63
  <?php
64
  } else {
65
  ?>
66
+ <a href="<?php echo esc_url($authURL); ?>" id="wpstg_google_drive_connect" class="wpstg-btn-google"> <img src="<?php echo esc_url(WPSTG_PLUGIN_URL . 'assets/img/google-g.png'); ?>" /> <?php esc_html_e("Sign in with Google", "wp-staging") ?></a>
67
+ <span><?php esc_html_e("OR", "wp-staging") ?></span> &nbsp; <a onclick="WPStaging.handleToggleElement(this)" data-wpstg-target="#wpstg-custom-google-credentials" href="javascript:void(0);"><?php esc_html_e("Connect with API Credentials", "wp-staging") ?></a>
68
  <?php
69
  }
70
  }
71
  ?>
72
  <form class="wpstg-provider-settings-form" id="wpstg-provider-settings-form" method="post">
73
+ <input type="hidden" name="provider" value="<?php echo esc_attr($providerId); ?>" />
74
 
75
  <div class="hidden" id="wpstg-custom-google-credentials">
76
+ <strong><?php esc_html_e('API Keys', 'wp-staging') ?></strong>
77
 
78
  <p>
79
+ <?php echo sprintf(
80
+ Escape::escapeHtml(__('You can use your own Google API keys. This is optional. <a href="%s" target="_blank">How to create your own Google API keys</a>.', 'wp-staging', 'wp-staging')),
81
+ 'https://wp-staging.com/docs/create-google-api-credentials-to-authenticate-to-google-drive/'
82
+ ); ?>
83
  </p>
84
 
85
  <fieldset class="wpstg-fieldset">
86
+ <label><?php esc_html_e('Google Client Id', 'wp-staging') ?></label>
87
+ <input class="wpstg-form-control" type="text" name="google_client_id" value="<?php echo esc_attr($googleClientId); ?>" />
88
  </fieldset>
89
 
90
  <fieldset class="wpstg-fieldset">
91
+ <label><?php esc_html_e('Google Client Secret', 'wp-staging') ?></label>
92
+ <input class="wpstg-form-control" type="text" name="google_client_secret" value="<?php echo esc_attr($googleClientSecret); ?>" />
93
  </fieldset>
94
 
95
  <fieldset class="wpstg-fieldset">
96
+ <label><?php esc_html_e('Google Redirect URI', 'wp-staging') ?></label>
97
  <div class="wpstg-with-icon">
98
+ <input class="wpstg-form-control" type="text" name="google_redirect_uri" id="google-redirect-uri" value="<?php echo esc_url($googleRedirectURI); ?>" />
99
  <a href="javascript:void(0);" class="wpstg-fieldset-icon" onclick="WPStaging.handleCopyToClipboard(this)" data-wpstg-source="#google-redirect-uri">
100
+ <img src="<?php echo esc_url(WPSTG_PLUGIN_URL . 'assets/svg/copy.svg'); ?>" alt="<?php esc_html_e("Copy to Clipboard", 'wp-staging') ?>" title="<?php esc_html_e("Copy to Clipboard", 'wp-staging') ?>" />
101
  </a>
102
  </div>
103
  </fieldset>
104
  </div>
105
  <hr/>
106
+ <strong><?php esc_html_e('Upload Settings', 'wp-staging') ?></strong>
107
  <fieldset class="wpstg-fieldset">
108
+ <label><?php esc_html_e('Max Backups to Keep', 'wp-staging') ?></label>
109
+ <input class="wpstg-form-control" type="number" name="max_backups_to_keep" value="<?php echo esc_attr($maxBackupsToKeep); ?>" style="max-width: 60px" />
110
+ <p><?php esc_html_e("Leave empty or zero for no limit", 'wp-staging') ?></p>
111
  </fieldset>
112
 
113
  <fieldset class="wpstg-fieldset">
114
+ <label><?php esc_html_e('Backup Folder Name', 'wp-staging') ?></label>
115
+ <input class="wpstg-form-control" type="text" name="folder_name" value="<?php echo esc_attr($folderName); ?>" />
116
  </fieldset>
117
 
118
  <hr/>
119
 
120
+ <button type="button" id="wpstg-btn-save-provider-settings" class="wpstg-link-btn wpstg-blue-primary"><?php esc_html_e("Save Settings", "wp-staging") ?></button>
121
  </form>
122
  </div>
123
  </fieldset>
Backend/views/settings/tabs/storages/sftp-settings.php CHANGED
@@ -25,85 +25,85 @@ use WPStaging\Framework\Facades\Sanitize;
25
  $location = isset($options['location']) ? Sanitize::sanitizeString($options['location']) : '';
26
  ?>
27
  <p>
28
- <strong class="wpstg-fs-14"> <?php _e('FTP/SFTP', 'wp-staging'); ?></strong>
29
  </p>
30
  <div class="wpstg-form-group">
31
  <form class="wpstg-provider-settings-form" id="wpstg-provider-settings-form" method="post">
32
  <div id="wpstg-provider-test-connection-fields">
33
- <strong><?php _e('Connection Detail', 'wp-staging') ?></strong>
34
 
35
- <input type="hidden" name="provider" value="<?php echo $providerId; ?>" />
36
 
37
  <fieldset class="wpstg-fieldset">
38
- <label><?php _e('FTP/SFTP', 'wp-staging') ?></label>
39
  <select class="wpstg-form-control" name="ftp_type">
40
- <option value="ftp"<?php echo $ftpType === 'ftp' ? ' selected' : '' ?>><?php _e('FTP', 'wp-staging') ?></option>
41
- <option value="sftp"<?php echo $ftpType === 'sftp' ? ' selected' : '' ?>><?php _e('SFTP', 'wp-staging') ?></option>
42
  </select>
43
  </fieldset>
44
 
45
  <fieldset class="wpstg-fieldset">
46
- <label><?php _e('Host', 'wp-staging') ?></label>
47
- <input class="wpstg-form-control" type="text" name="host" value="<?php echo $host; ?>" />
48
  </fieldset>
49
 
50
  <fieldset class="wpstg-fieldset">
51
- <label><?php _e('Port', 'wp-staging') ?></label>
52
- <input class="wpstg-form-control" type="number" name="port" value="<?php echo $port; ?>" style="max-width: 60px" />
53
  </fieldset>
54
 
55
  <fieldset class="wpstg-fieldset">
56
- <label><?php _e('Username', 'wp-staging') ?></label>
57
- <input class="wpstg-form-control" type="text" name="username" value="<?php echo $username; ?>" />
58
  </fieldset>
59
 
60
  <fieldset class="wpstg-fieldset">
61
- <label><?php _e('Password', 'wp-staging') ?></label>
62
- <input class="wpstg-form-control" type="password" name="password" autocomplete="new-password" value="<?php echo $password; ?>" />
63
- <p class="only-sftp<?php echo $ftpType === 'sftp' ? '' : ' hidden' ?>"><?php _e("Your login may be either password or key-based - you only need to enter one, not both.", 'wp-staging') ?></p>
64
  </fieldset>
65
 
66
  <fieldset class="wpstg-fieldset only-ftp<?php echo $ftpType === 'ftp' ? '' : ' hidden' ?>">
67
- <label><?php _e('SSL', 'wp-staging') ?></label>
68
  <input type="checkbox" name="ssl" value="true" <?php echo $ssl === true ? 'checked ' : '' ?>/>
69
  </fieldset>
70
 
71
  <fieldset class="wpstg-fieldset only-ftp<?php echo $ftpType === 'ftp' ? '' : ' hidden' ?>">
72
- <label><?php _e('Passive', 'wp-staging') ?></label>
73
  <input type="checkbox" name="passive" value="true" <?php echo $passive === true ? 'checked ' : '' ?>/>
74
  </fieldset>
75
 
76
  <fieldset class="wpstg-fieldset only-sftp<?php echo $ftpType === 'sftp' ? '' : ' hidden' ?>">
77
- <label><?php _e('Key', 'wp-staging') ?></label>
78
- <textarea class="wpstg-form-control" name="key" style="width:350px;height:200px;"><?php echo $privateKey; ?></textarea>
79
- <p><?php _e("PKCS1 (PEM header: BEGIN RSA PRIVATE KEY), XML and PuTTY format keys are accepted.", 'wp-staging') ?></p>
80
  </fieldset>
81
 
82
  <fieldset class="wpstg-fieldset only-sftp<?php echo $ftpType === 'sftp' ? '' : ' hidden' ?>">
83
- <label><?php _e('Passphrase', 'wp-staging') ?></label>
84
- <input class="wpstg-form-control" type="text" name="passphrase" value="<?php echo $passphrase; ?>" />
85
- <p><?php _e("Passphrase for the key.", 'wp-staging') ?></p>
86
  </fieldset>
87
  </div>
88
- <button type="button" id="wpstg-btn-provider-test-connection" class="wpstg-link-btn wpstg-blue-primary"><?php _e("Test Connection", "wp-staging") ?></button>
89
 
90
  <hr/>
91
- <strong><?php _e('Upload Settings', 'wp-staging') ?></strong>
92
  <fieldset class="wpstg-fieldset">
93
- <label><?php _e('Max Backups to Keep', 'wp-staging') ?></label>
94
- <input class="wpstg-form-control" type="number" name="max_backups_to_keep" value="<?php echo $maxBackupsToKeep; ?>" style="max-width: 60px" />
95
- <p><?php _e("Leave empty or zero for no limit", 'wp-staging') ?></p>
96
  </fieldset>
97
 
98
  <fieldset class="wpstg-fieldset">
99
- <label><?php _e('Location', 'wp-staging') ?></label>
100
- <input class="wpstg-form-control" type="text" name="location" value="<?php echo $location; ?>" />
101
- <p><?php _e("Where to change directory to after logging in - often this is relative to your home directory. Needs to already exist", 'wp-staging') ?></p>
102
  </fieldset>
103
 
104
  <hr/>
105
 
106
- <button type="button" id="wpstg-btn-save-provider-settings" class="wpstg-link-btn wpstg-blue-primary"><?php _e("Save Settings", "wp-staging") ?></button>
107
  </form>
108
  </div>
109
  </fieldset>
25
  $location = isset($options['location']) ? Sanitize::sanitizeString($options['location']) : '';
26
  ?>
27
  <p>
28
+ <strong class="wpstg-fs-14"> <?php esc_html_e('FTP/SFTP', 'wp-staging'); ?></strong>
29
  </p>
30
  <div class="wpstg-form-group">
31
  <form class="wpstg-provider-settings-form" id="wpstg-provider-settings-form" method="post">
32
  <div id="wpstg-provider-test-connection-fields">
33
+ <strong><?php esc_html_e('Connection Detail', 'wp-staging') ?></strong>
34
 
35
+ <input type="hidden" name="provider" value="<?php echo esc_attr($providerId); ?>" />
36
 
37
  <fieldset class="wpstg-fieldset">
38
+ <label><?php esc_html_e('FTP/SFTP', 'wp-staging') ?></label>
39
  <select class="wpstg-form-control" name="ftp_type">
40
+ <option value="ftp"<?php echo $ftpType === 'ftp' ? ' selected' : '' ?>><?php esc_html_e('FTP', 'wp-staging') ?></option>
41
+ <option value="sftp"<?php echo $ftpType === 'sftp' ? ' selected' : '' ?>><?php esc_html_e('SFTP', 'wp-staging') ?></option>
42
  </select>
43
  </fieldset>
44
 
45
  <fieldset class="wpstg-fieldset">
46
+ <label><?php esc_html_e('Host', 'wp-staging') ?></label>
47
+ <input class="wpstg-form-control" type="text" name="host" value="<?php echo esc_attr($host); ?>" />
48
  </fieldset>
49
 
50
  <fieldset class="wpstg-fieldset">
51
+ <label><?php esc_html_e('Port', 'wp-staging') ?></label>
52
+ <input class="wpstg-form-control" type="number" name="port" value="<?php echo esc_attr($port); ?>" style="max-width: 60px" />
53
  </fieldset>
54
 
55
  <fieldset class="wpstg-fieldset">
56
+ <label><?php esc_html_e('Username', 'wp-staging') ?></label>
57
+ <input class="wpstg-form-control" type="text" name="username" value="<?php echo esc_attr($username); ?>" />
58
  </fieldset>
59
 
60
  <fieldset class="wpstg-fieldset">
61
+ <label><?php esc_html_e('Password', 'wp-staging') ?></label>
62
+ <input class="wpstg-form-control" type="password" name="password" autocomplete="new-password" value="<?php echo esc_attr($password); ?>" />
63
+ <p class="only-sftp<?php echo $ftpType === 'sftp' ? '' : ' hidden' ?>"><?php esc_html_e("Your login may be either password or key-based - you only need to enter one, not both.", 'wp-staging') ?></p>
64
  </fieldset>
65
 
66
  <fieldset class="wpstg-fieldset only-ftp<?php echo $ftpType === 'ftp' ? '' : ' hidden' ?>">
67
+ <label><?php esc_html_e('SSL', 'wp-staging') ?></label>
68
  <input type="checkbox" name="ssl" value="true" <?php echo $ssl === true ? 'checked ' : '' ?>/>
69
  </fieldset>
70
 
71
  <fieldset class="wpstg-fieldset only-ftp<?php echo $ftpType === 'ftp' ? '' : ' hidden' ?>">
72
+ <label><?php esc_html_e('Passive', 'wp-staging') ?></label>
73
  <input type="checkbox" name="passive" value="true" <?php echo $passive === true ? 'checked ' : '' ?>/>
74
  </fieldset>
75
 
76
  <fieldset class="wpstg-fieldset only-sftp<?php echo $ftpType === 'sftp' ? '' : ' hidden' ?>">
77
+ <label><?php esc_html_e('Key', 'wp-staging') ?></label>
78
+ <textarea class="wpstg-form-control" name="key" style="width:350px;height:200px;"><?php echo esc_textarea($privateKey); ?></textarea>
79
+ <p><?php esc_html_e("PKCS1 (PEM header: BEGIN RSA PRIVATE KEY), XML and PuTTY format keys are accepted.", 'wp-staging') ?></p>
80
  </fieldset>
81
 
82
  <fieldset class="wpstg-fieldset only-sftp<?php echo $ftpType === 'sftp' ? '' : ' hidden' ?>">
83
+ <label><?php esc_html_e('Passphrase', 'wp-staging') ?></label>
84
+ <input class="wpstg-form-control" type="text" name="passphrase" value="<?php echo esc_attr($passphrase); ?>" />
85
+ <p><?php esc_html_e("Passphrase for the key.", 'wp-staging') ?></p>
86
  </fieldset>
87
  </div>
88
+ <button type="button" id="wpstg-btn-provider-test-connection" class="wpstg-link-btn wpstg-blue-primary"><?php esc_html_e("Test Connection", "wp-staging") ?></button>
89
 
90
  <hr/>
91
+ <strong><?php esc_html_e('Upload Settings', 'wp-staging') ?></strong>
92
  <fieldset class="wpstg-fieldset">
93
+ <label><?php esc_html_e('Max Backups to Keep', 'wp-staging') ?></label>
94
+ <input class="wpstg-form-control" type="number" name="max_backups_to_keep" value="<?php echo esc_attr($maxBackupsToKeep); ?>" style="max-width: 60px" />
95
+ <p><?php esc_html_e("Leave empty or zero for no limit", 'wp-staging') ?></p>
96
  </fieldset>
97
 
98
  <fieldset class="wpstg-fieldset">
99
+ <label><?php esc_html_e('Location', 'wp-staging') ?></label>
100
+ <input class="wpstg-form-control" type="text" name="location" value="<?php echo esc_attr($location); ?>" />
101
+ <p><?php esc_html_e("Where to change directory to after logging in - often this is relative to your home directory. Needs to already exist", 'wp-staging') ?></p>
102
  </fieldset>
103
 
104
  <hr/>
105
 
106
+ <button type="button" id="wpstg-btn-save-provider-settings" class="wpstg-link-btn wpstg-blue-primary"><?php esc_html_e("Save Settings", "wp-staging") ?></button>
107
  </form>
108
  </div>
109
  </fieldset>
Backend/views/templates/exclude-filters/dir-name-exclude-filter.php CHANGED
@@ -11,18 +11,18 @@ use WPStaging\Framework\Filesystem\Filters\ExcludeFilter;
11
  */
12
  ?>
13
  <tr>
14
- <td class="wpstg-exclude-filter-name-column"><?php _e('Folder Name', 'wp-staging') ?></td>
15
  <td class="wpstg-exclude-filter-exclusion-column">
16
  <select class="wpstg-exclude-rule-input wpstg-path-exclude-select" name="wpstgDirNameExcludeRulePos[]">
17
- <option value="<?php echo ExcludeFilter::NAME_BEGINS_WITH ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_BEGINS_WITH ? 'selected' : '' ?>><?php _e('BEGINS WITH', 'wp-staging') ?></option>
18
- <option value="<?php echo ExcludeFilter::NAME_ENDS_WITH ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_ENDS_WITH ? 'selected' : '' ?>><?php _e('ENDS WITH', 'wp-staging') ?></option>
19
- <option value="<?php echo ExcludeFilter::NAME_EXACT_MATCHES ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_EXACT_MATCHES ? 'selected' : '' ?>><?php _e('EXACT MATCHES', 'wp-staging') ?></option>
20
- <option value="<?php echo ExcludeFilter::NAME_CONTAINS ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_CONTAINS ? 'selected' : '' ?>><?php _e('CONTAINS', 'wp-staging') ?></option>
21
  </select>
22
  <input type="text" class="wpstg-exclude-rule-input" name="wpstgDirNameExcludeRulePath[]" value="<?php echo isset($name) ? Sanitize::sanitizeString($name) : '' ?>" />
23
  <div class="wpstg--tooltip wpstg--exclude-rules--tooltip">
24
  <button class="wpstg-exclusion-rule-info" type="button">i</button>
25
- <p class="wpstg--tooltiptext has-top-arrow"><?php echo sprintf(__('Exclude folders by name. For example to exclude all folder with name node_modules, select %s and type %s in the input box.', 'wp-staging'), '<code class="wpstg-code">' . __('EXACT MATCHES', 'wp-staging') . '</code>', '<code class="wpstg-code">node_modules</code>') ?>
26
  </p>
27
  </div>
28
  </td>
11
  */
12
  ?>
13
  <tr>
14
+ <td class="wpstg-exclude-filter-name-column"><?php esc_html_e('Folder Name', 'wp-staging') ?></td>
15
  <td class="wpstg-exclude-filter-exclusion-column">
16
  <select class="wpstg-exclude-rule-input wpstg-path-exclude-select" name="wpstgDirNameExcludeRulePos[]">
17
+ <option value="<?php echo ExcludeFilter::NAME_BEGINS_WITH ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_BEGINS_WITH ? 'selected' : '' ?>><?php esc_html_e('BEGINS WITH', 'wp-staging') ?></option>
18
+ <option value="<?php echo ExcludeFilter::NAME_ENDS_WITH ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_ENDS_WITH ? 'selected' : '' ?>><?php esc_html_e('ENDS WITH', 'wp-staging') ?></option>
19
+ <option value="<?php echo ExcludeFilter::NAME_EXACT_MATCHES ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_EXACT_MATCHES ? 'selected' : '' ?>><?php esc_html_e('EXACT MATCHES', 'wp-staging') ?></option>
20
+ <option value="<?php echo ExcludeFilter::NAME_CONTAINS ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_CONTAINS ? 'selected' : '' ?>><?php esc_html_e('CONTAINS', 'wp-staging') ?></option>
21
  </select>
22
  <input type="text" class="wpstg-exclude-rule-input" name="wpstgDirNameExcludeRulePath[]" value="<?php echo isset($name) ? Sanitize::sanitizeString($name) : '' ?>" />
23
  <div class="wpstg--tooltip wpstg--exclude-rules--tooltip">
24
  <button class="wpstg-exclusion-rule-info" type="button">i</button>
25
+ <p class="wpstg--tooltiptext has-top-arrow"><?php echo sprintf(esc_html__('Exclude folders by name. For example to exclude all folder with name node_modules, select %s and type %s in the input box.', 'wp-staging'), '<code class="wpstg-code">' . esc_html__('EXACT MATCHES', 'wp-staging') . '</code>', '<code class="wpstg-code">node_modules</code>') ?>
26
  </p>
27
  </div>
28
  </td>
Backend/views/templates/exclude-filters/file-ext-exclude-filter.php CHANGED
@@ -10,12 +10,12 @@ use WPStaging\Framework\Facades\Sanitize;
10
 
11
  ?>
12
  <tr>
13
- <td class="wpstg-exclude-filter-name-column"><?php _e('File Extension', 'wp-staging') ?></td>
14
  <td class="wpstg-exclude-filter-exclusion-column">
15
  <input type="text" name='wpstgFileExtExcludeRule[]' class="wpstg-exclude-rule-input file-ext" value="<?php echo isset($extension) ? Sanitize::sanitizeString($extension) : '' ?>" />
16
  <div class="wpstg--tooltip wpstg--exclude-rules--tooltip">
17
  <button class="wpstg-exclusion-rule-info" type="button">i</button>
18
- <p class="wpstg--tooltiptext has-top-arrow"><?php echo sprintf(__('Exclude files by extension. For example to exclude zip files, type %s to exclude all zip files.', 'wp-staging'), '<code class="wpstg-code">zip</code>') ?> </p>
19
  </div>
20
  </td>
21
  <td class="wpstg-exclude-filter-action-column"><button class="wpstg-remove-exclude-rule">×</button></td>
10
 
11
  ?>
12
  <tr>
13
+ <td class="wpstg-exclude-filter-name-column"><?php esc_html_e('File Extension', 'wp-staging') ?></td>
14
  <td class="wpstg-exclude-filter-exclusion-column">
15
  <input type="text" name='wpstgFileExtExcludeRule[]' class="wpstg-exclude-rule-input file-ext" value="<?php echo isset($extension) ? Sanitize::sanitizeString($extension) : '' ?>" />
16
  <div class="wpstg--tooltip wpstg--exclude-rules--tooltip">
17
  <button class="wpstg-exclusion-rule-info" type="button">i</button>
18
+ <p class="wpstg--tooltiptext has-top-arrow"><?php echo sprintf(esc_html__('Exclude files by extension. For example to exclude zip files, type %s to exclude all zip files.', 'wp-staging'), '<code class="wpstg-code">zip</code>') ?> </p>
19
  </div>
20
  </td>
21
  <td class="wpstg-exclude-filter-action-column"><button class="wpstg-remove-exclude-rule">×</button></td>
Backend/views/templates/exclude-filters/file-name-exclude-filter.php CHANGED
@@ -11,18 +11,18 @@ use WPStaging\Framework\Filesystem\Filters\ExcludeFilter;
11
  */
12
  ?>
13
  <tr>
14
- <td class="wpstg-exclude-filter-name-column"><?php _e('File Name', 'wp-staging') ?></td>
15
  <td class="wpstg-exclude-filter-exclusion-column">
16
  <select class="wpstg-exclude-rule-input wpstg-path-exclude-select" name="wpstgFileNameExcludeRulePos[]">
17
- <option value="<?php echo ExcludeFilter::NAME_BEGINS_WITH ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_BEGINS_WITH ? 'selected' : '' ?>><?php _e('BEGINS WITH', 'wp-staging') ?></option>
18
- <option value="<?php echo ExcludeFilter::NAME_ENDS_WITH ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_ENDS_WITH ? 'selected' : '' ?>><?php _e('ENDS WITH', 'wp-staging') ?></option>
19
- <option value="<?php echo ExcludeFilter::NAME_EXACT_MATCHES ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_EXACT_MATCHES ? 'selected' : '' ?>><?php _e('EXACT MATCHES', 'wp-staging') ?></option>
20
- <option value="<?php echo ExcludeFilter::NAME_CONTAINS ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_CONTAINS ? 'selected' : '' ?>><?php _e('CONTAINS', 'wp-staging') ?></option>
21
  </select>
22
  <input type="text" class="wpstg-exclude-rule-input" name="wpstgFileNameExcludeRulePath[]" value="<?php echo isset($name) ? Sanitize::sanitizeString($name) : '' ?>" />
23
  <div class="wpstg--tooltip wpstg--exclude-rules--tooltip">
24
  <button class="wpstg-exclusion-rule-info" type="button">i</button>
25
- <p class="wpstg--tooltiptext has-top-arrow"><?php echo sprintf(__('Exclude files by name. For example to exclude all files which have %s at the end of the name, select %s and type %s in the input box.', 'wp-staging'), '<code class="wpstg-code">-class</code>', '<code class="wpstg-code">' . __('ENDS WITH', 'wp-staging') . '</code>', '<code class="wpstg-code">-class</code>') ?>
26
  </p>
27
  </div>
28
  </td>
11
  */
12
  ?>
13
  <tr>
14
+ <td class="wpstg-exclude-filter-name-column"><?php esc_html_e('File Name', 'wp-staging') ?></td>
15
  <td class="wpstg-exclude-filter-exclusion-column">
16
  <select class="wpstg-exclude-rule-input wpstg-path-exclude-select" name="wpstgFileNameExcludeRulePos[]">
17
+ <option value="<?php echo ExcludeFilter::NAME_BEGINS_WITH ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_BEGINS_WITH ? 'selected' : '' ?>><?php esc_html_e('BEGINS WITH', 'wp-staging') ?></option>
18
+ <option value="<?php echo ExcludeFilter::NAME_ENDS_WITH ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_ENDS_WITH ? 'selected' : '' ?>><?php esc_html_e('ENDS WITH', 'wp-staging') ?></option>
19
+ <option value="<?php echo ExcludeFilter::NAME_EXACT_MATCHES ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_EXACT_MATCHES ? 'selected' : '' ?>><?php esc_html_e('EXACT MATCHES', 'wp-staging') ?></option>
20
+ <option value="<?php echo ExcludeFilter::NAME_CONTAINS ?>" <?php echo isset($rule) && $rule === ExcludeFilter::NAME_CONTAINS ? 'selected' : '' ?>><?php esc_html_e('CONTAINS', 'wp-staging') ?></option>
21
  </select>
22
  <input type="text" class="wpstg-exclude-rule-input" name="wpstgFileNameExcludeRulePath[]" value="<?php echo isset($name) ? Sanitize::sanitizeString($name) : '' ?>" />
23
  <div class="wpstg--tooltip wpstg--exclude-rules--tooltip">
24
  <button class="wpstg-exclusion-rule-info" type="button">i</button>
25
+ <p class="wpstg--tooltiptext has-top-arrow"><?php echo sprintf(esc_html__('Exclude files by name. For example to exclude all files which have %s at the end of the name, select %s and type %s in the input box.', 'wp-staging'), '<code class="wpstg-code">-class</code>', '<code class="wpstg-code">' . esc_html__('ENDS WITH', 'wp-staging') . '</code>', '<code class="wpstg-code">-class</code>') ?>
26
  </p>
27
  </div>
28
  </td>
Backend/views/templates/exclude-filters/file-size-exclude-filter.php CHANGED
@@ -12,12 +12,12 @@ use WPStaging\Framework\Filesystem\Filters\ExcludeFilter;
12
  */
13
  ?>
14
  <tr>
15
- <td class="wpstg-exclude-filter-name-column"><?php _e('File Size', 'wp-staging') ?></td>
16
  <td class="wpstg-exclude-filter-exclusion-column">
17
  <select class="wpstg-exclude-rule-input wpstg-file-size-exclude-select" name="wpstgFileSizeExcludeRuleCompare[]">
18
- <option value="<?php echo ExcludeFilter::SIZE_LESS_THAN ?>" <?php echo isset($comparison) && $comparison === ExcludeFilter::SIZE_LESS_THAN ? "selected" : '' ?>><?php _e('LESS THAN', 'wp-staging') ?></option>
19
- <option value="<?php echo ExcludeFilter::SIZE_GREATER_THAN ?>" <?php echo isset($comparison) && $comparison === ExcludeFilter::SIZE_GREATER_THAN ? "selected" : '' ?>><?php _e('GREATER THAN', 'wp-staging') ?></option>
20
- <option value="<?php echo ExcludeFilter::SIZE_EQUAL_TO ?>" <?php echo isset($comparison) && $comparison === ExcludeFilter::SIZE_EQUAL_TO ? "selected" : '' ?>><?php _e('EXACT', 'wp-staging') ?></option>
21
  </select>
22
  <input type="number" class="wpstg-exclude-rule-input wpstg-file-size-exclude-input" name="wpstgFileSizeExcludeRuleSize[]" value="<?php echo isset($bytes) ? Sanitize::sanitizeInt($bytes) : '0' ?>" />
23
  <select class="wpstg-exclude-rule-input wpstg-file-size-exclude-select-small" name="wpstgFileSizeExcludeRuleByte[]">
@@ -27,7 +27,7 @@ use WPStaging\Framework\Filesystem\Filters\ExcludeFilter;
27
  </select>
28
  <div class="wpstg--tooltip wpstg--exclude-rules--tooltip">
29
  <button class="wpstg-exclusion-rule-info" type="button">i</button>
30
- <p class="wpstg--tooltiptext has-top-arrow"><?php echo sprintf(__('Exclude files by size. For example to exclude files greater than 10 MB, select %s and type %s in next input box and select %s.', 'wp-staging'), '<code class="wpstg-code">' . __('GREATER THAN', 'wp-staging') . '</code>', '<code class="wpstg-code">10</code>', '<code class="wpstg-code">MB</code>') ?>
31
  </p>
32
  </div>
33
  </td>
12
  */
13
  ?>
14
  <tr>
15
+ <td class="wpstg-exclude-filter-name-column"><?php esc_html_e('File Size', 'wp-staging') ?></td>
16
  <td class="wpstg-exclude-filter-exclusion-column">
17
  <select class="wpstg-exclude-rule-input wpstg-file-size-exclude-select" name="wpstgFileSizeExcludeRuleCompare[]">
18
+ <option value="<?php echo ExcludeFilter::SIZE_LESS_THAN ?>" <?php echo isset($comparison) && $comparison === ExcludeFilter::SIZE_LESS_THAN ? "selected" : '' ?>><?php esc_html_e('LESS THAN', 'wp-staging') ?></option>
19
+ <option value="<?php echo ExcludeFilter::SIZE_GREATER_THAN ?>" <?php echo isset($comparison) && $comparison === ExcludeFilter::SIZE_GREATER_THAN ? "selected" : '' ?>><?php esc_html_e('GREATER THAN', 'wp-staging') ?></option>
20
+ <option value="<?php echo ExcludeFilter::SIZE_EQUAL_TO ?>" <?php echo isset($comparison) && $comparison === ExcludeFilter::SIZE_EQUAL_TO ? "selected" : '' ?>><?php esc_html_e('EXACT', 'wp-staging') ?></option>
21
  </select>
22
  <input type="number" class="wpstg-exclude-rule-input wpstg-file-size-exclude-input" name="wpstgFileSizeExcludeRuleSize[]" value="<?php echo isset($bytes) ? Sanitize::sanitizeInt($bytes) : '0' ?>" />
23
  <select class="wpstg-exclude-rule-input wpstg-file-size-exclude-select-small" name="wpstgFileSizeExcludeRuleByte[]">
27
  </select>
28
  <div class="wpstg--tooltip wpstg--exclude-rules--tooltip">
29
  <button class="wpstg-exclusion-rule-info" type="button">i</button>
30
+ <p class="wpstg--tooltiptext has-top-arrow"><?php echo sprintf(esc_html__('Exclude files by size. For example to exclude files greater than 10 MB, select %s and type %s in next input box and select %s.', 'wp-staging'), '<code class="wpstg-code">' . esc_html__('GREATER THAN', 'wp-staging') . '</code>', '<code class="wpstg-code">10</code>', '<code class="wpstg-code">MB</code>') ?>
31
  </p>
32
  </div>
33
  </td>
Backend/views/tools/index.php CHANGED
@@ -1,11 +1,18 @@
 
 
 
 
 
1
  <div class="wpstg_admin">
2
- <?php require_once(WPSTG_PLUGIN_DIR . 'Backend/views/_main/header.php'); ?>
 
 
3
 
4
  <div class="wpstg-tabs-container" id="wpstg-tools">
5
  <ul class="wpstg-nav-tab-wrapper">
6
  <?php
7
  $tabs = \WPStaging\Core\WPStaging::getInstance()->get("tabs")->get();
8
- $activeTab = (isset($_GET["tab"]) && array_key_exists($_GET["tab"], $tabs)) ? $_GET["tab"] : "system_info";
9
 
10
  # Loop through tabs
11
  foreach ($tabs as $id => $name) :
@@ -17,7 +24,7 @@
17
  $activeClass = ($activeTab === $id) ? " wpstg-nav-tab-active" : '';
18
  ?>
19
  <li>
20
- <a href="<?php echo $url?>" title="<?php echo esc_attr($name)?>" class="nav-tab<?php echo $activeClass?>">
21
  <?php echo esc_html($name)?>
22
  </a>
23
  </li>
1
+ <?php
2
+
3
+ use WPStaging\Framework\Facades\Sanitize;
4
+
5
+ ?>
6
  <div class="wpstg_admin">
7
+ <?php
8
+
9
+ require_once(WPSTG_PLUGIN_DIR . 'Backend/views/_main/header.php'); ?>
10
 
11
  <div class="wpstg-tabs-container" id="wpstg-tools">
12
  <ul class="wpstg-nav-tab-wrapper">
13
  <?php
14
  $tabs = \WPStaging\Core\WPStaging::getInstance()->get("tabs")->get();
15
+ $activeTab = (isset($_GET["tab"]) && array_key_exists($_GET["tab"], $tabs)) ? Sanitize::sanitizeString($_GET["tab"]) : "system_info";
16
 
17
  # Loop through tabs
18
  foreach ($tabs as $id => $name) :
24
  $activeClass = ($activeTab === $id) ? " wpstg-nav-tab-active" : '';
25
  ?>
26
  <li>
27
+ <a href="<?php echo esc_url($url) ?>" title="<?php echo esc_attr($name)?>" class="nav-tab<?php echo esc_attr($activeClass) ?>">
28
  <?php echo esc_html($name)?>
29
  </a>
30
  </li>
Backend/views/tools/tabs/import_export.php CHANGED
@@ -2,24 +2,24 @@
2
  <div>
3
  <p>
4
  <strong class="wpstg-fs-14">
5
- <?php _e("Export Settings", "wp-staging")?>
6
  </strong>
7
  </p>
8
 
9
  <div class="inside">
10
  <p>
11
- <?php _e(
12
  "Export the WP-Staging settings for this site as a .json file. " .
13
  "This allows you to easily import the configuration into another site.",
14
  "wp-staging"
15
  )?>
16
  </p>
17
 
18
- <form method="post" action="<?php echo admin_url("admin-post.php?action=wpstg_export")?>">
19
  <p><input type="hidden" name="wpstg-action" value="export_settings" /></p>
20
  <p>
21
  <?php wp_nonce_field("wpstg_export_nonce", "wpstg_export_nonce")?>
22
- <?php submit_button(__("Export", "wp-staging"), "primary", "submit", false)?>
23
  </p>
24
  </form>
25
  </div>
@@ -30,26 +30,26 @@
30
  <div class="">
31
  <h3>
32
  <strong class="wpstg-fs-14">
33
- <?php _e("Import Settings", "wp-staging")?>
34
  </strong>
35
  </h3>
36
 
37
  <div class="inside">
38
  <p>
39
- <?php _e(
40
  "Import the WP-Staging settings from a .json file. This file can be obtained " .
41
  "by exporting the settings on another site using the form above.",
42
  "wp-staging"
43
  )?>
44
  </p>
45
- <form method="post" enctype="multipart/form-data" action="<?php echo admin_url("admin-post.php?action=wpstg_import_settings")?>">
46
  <p>
47
  <input type="file" name="import_file"/>
48
  </p>
49
  <p>
50
  <input type="hidden" name="wpstg-action" value="import_settings" />
51
  <?php wp_nonce_field("wpstg_import_nonce", "wpstg_import_nonce")?>
52
- <?php submit_button(__("Import", "wp-staging"), "secondary", "submit", false)?>
53
  </p>
54
  </form>
55
  </div>
2
  <div>
3
  <p>
4
  <strong class="wpstg-fs-14">
5
+ <?php esc_html_e("Export Settings", "wp-staging")?>
6
  </strong>
7
  </p>
8
 
9
  <div class="inside">
10
  <p>
11
+ <?php esc_html_e(
12
  "Export the WP-Staging settings for this site as a .json file. " .
13
  "This allows you to easily import the configuration into another site.",
14
  "wp-staging"
15
  )?>
16
  </p>
17
 
18
+ <form method="post" action="<?php echo esc_url(admin_url("admin-post.php?action=wpstg_export")) ?>">
19
  <p><input type="hidden" name="wpstg-action" value="export_settings" /></p>
20
  <p>
21
  <?php wp_nonce_field("wpstg_export_nonce", "wpstg_export_nonce")?>
22
+ <?php submit_button(esc_html__("Export", "wp-staging"), "primary", "submit", false)?>
23
  </p>
24
  </form>
25
  </div>
30
  <div class="">
31
  <h3>
32
  <strong class="wpstg-fs-14">
33
+ <?php esc_html_e("Import Settings", "wp-staging")?>
34
  </strong>
35
  </h3>
36
 
37
  <div class="inside">
38
  <p>
39
+ <?php esc_html_e(
40
  "Import the WP-Staging settings from a .json file. This file can be obtained " .
41
  "by exporting the settings on another site using the form above.",
42
  "wp-staging"
43
  )?>
44
  </p>
45
+ <form method="post" enctype="multipart/form-data" action="<?php echo esc_url(admin_url("admin-post.php?action=wpstg_import_settings")) ?>">
46
  <p>
47
  <input type="file" name="import_file"/>
48
  </p>
49
  <p>
50
  <input type="hidden" name="wpstg-action" value="import_settings" />
51
  <?php wp_nonce_field("wpstg_import_nonce", "wpstg_import_nonce")?>
52
+ <?php submit_button(esc_html__("Import", "wp-staging"), "secondary", "submit", false)?>
53
  </p>
54
  </form>
55
  </div>
Backend/views/tools/tabs/system_info.php CHANGED
@@ -6,7 +6,7 @@ use WPStaging\Framework\Filesystem\DebugLogReader;
6
  ?>
7
 
8
  <form action="<?php echo esc_url(admin_url("admin-post.php?action=wpstg_download_sysinfo"))?>" method="post" dir="ltr">
9
- <textarea class="wpstg-sysinfo" readonly="readonly" id="system-info-textarea" name="wpstg-sysinfo" title="To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac)."><?php echo \WPStaging\Core\WPStaging::getInstance()->get("systemInfo")?></textarea>
10
  <p class="submit">
11
  <?php submit_button("Download System Info File", "primary", "wpstg-download-sysinfo", false)?>
12
  </p>
6
  ?>
7
 
8
  <form action="<?php echo esc_url(admin_url("admin-post.php?action=wpstg_download_sysinfo"))?>" method="post" dir="ltr">
9
+ <textarea class="wpstg-sysinfo" readonly="readonly" id="system-info-textarea" name="wpstg-sysinfo" title="To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac)."><?php echo esc_textarea(\WPStaging\Core\WPStaging::getInstance()->get("systemInfo")) ?></textarea>
10
  <p class="submit">
11
  <?php submit_button("Download System Info File", "primary", "wpstg-download-sysinfo", false)?>
12
  </p>
Backend/views/welcome/welcome.php CHANGED
@@ -1,21 +1,30 @@
 
 
 
 
 
1
  <div class="" id="wpstg-welcome">
2
  <div class="wpstg-welcome-container wpstg--grey">
3
  <h2 class="wpstg-h2 wpstg--grey">
4
- <span class="wpstg-heading-pro wpstg--blue"><?php _e('WP STAGING | PRO', 'wp-staging'); ?></span><?php _e(' - Enterprise Level Backup, Cloning & Migration Tool', 'wp-staging'); ?>
 
5
  </h2>
6
  <h3 class="wpstg--grey">Is this the best backup & migration plugin?</h3>
7
- <li><strong>Enterprise Reliability</strong> - <?php echo sprintf(__('Your data is crucial so we run <a href="%s" target="_blank" style="text-decoration: underline;">thousands</a> of automated tests before every release.', 'wp-staging'), 'https://www.youtube.com/watch?v=Tf9C9Pgu7Bs&t=5s'); ?></li>
8
- <li><strong>German Engineering</strong> - <?php _e('Our headquarter is located in Germany with a small team of highly skilled developers.', 'wp-staging'); ?></li>
9
- <li><strong>Cloning</strong> - <?php _e('Clone your entire website with one click.', 'wp-staging'); ?></li>
10
- <li><strong>Push Changes</strong> - <?php _e('Push a staging site to the production site. (Pro)', 'wp-staging'); ?></li>
11
- <li><strong>Backup & Restore</strong> - <?php _e('Backup and Restore WordPress. Easy, fast, and secure. (Pro)', 'wp-staging'); ?></li>
12
- <li><strong>Move WordPress</strong> - <?php _e('Migrate & move your website from one domain to another, even to a separate server. (Pro)', 'wp-staging'); ?></li>
13
- <li><strong>Support Multisites</strong> - <?php _e('Clone and push Multisites. (Pro)', 'wp-staging'); ?></li>
14
- <li><strong>Authentication</strong> - <?php _e('Cloned sites are available to authenticated users only.', 'wp-staging'); ?></li>
15
- <li><strong>High Performance</strong> - <?php _e('WP STAGING is one of the fastest backup and migration plugins. Compare yourself.', 'wp-staging'); ?></li>
16
- <li><strong>Secure</strong> - <?php _e('WP STAGING is no cloud service. Your data belongs to you only.', 'wp-staging'); ?></li>
 
 
 
17
  <a href="http://wp-staging.com/?utm_source=wpstg&utm_medium=addon_page&utm_term=click-wpstaging-pro&utm_campaign=wpstaging" target="_blank" class="wpstg-button--big wpstg-button--blue">Buy WP STAGING Pro</a>
18
- <a href="<?php echo admin_url(); ?>admin.php?page=wpstg_clone" target="_self" class="wpstg-ml-30px">Skip & Start Cloning</a>
19
- <div class="wpstg-footer"> <?php _e('Comes with our money back guarantee * You need to give us chance to resolve your issue first.', 'wp-staging'); ?></div>
20
  </div>
21
  </div>
1
+ <?php
2
+
3
+ use WPStaging\Framework\Facades\Escape;
4
+
5
+ ?>
6
  <div class="" id="wpstg-welcome">
7
  <div class="wpstg-welcome-container wpstg--grey">
8
  <h2 class="wpstg-h2 wpstg--grey">
9
+ <span class="wpstg-heading-pro wpstg--blue"><?php esc_html_e('WP STAGING | PRO', 'wp-staging'); ?></span>
10
+ <?php esc_html_e(' - Enterprise Level Backup, Cloning & Migration Tool', 'wp-staging'); ?>
11
  </h2>
12
  <h3 class="wpstg--grey">Is this the best backup & migration plugin?</h3>
13
+ <li><strong>Enterprise Reliability</strong> - <?php echo sprintf(
14
+ Escape::escapeHtml(__('Your data is crucial so we run <a href="%s" target="_blank" style="text-decoration: underline;">thousands</a> of automated tests before every release.', 'wp-staging')),
15
+ 'https://www.youtube.com/watch?v=Tf9C9Pgu7Bs&t=5s'
16
+ ); ?></li>
17
+ <li><strong>German Engineering</strong> - <?php esc_html_e('Our headquarter is located in Germany with a small team of highly skilled developers.', 'wp-staging'); ?></li>
18
+ <li><strong>Cloning</strong> - <?php esc_html_e('Clone your entire website with one click.', 'wp-staging'); ?></li>
19
+ <li><strong>Push Changes</strong> - <?php esc_html_e('Push a staging site to the production site. (Pro)', 'wp-staging'); ?></li>
20
+ <li><strong>Backup & Restore</strong> - <?php esc_html_e('Backup and Restore WordPress. Easy, fast, and secure. (Pro)', 'wp-staging'); ?></li>
21
+ <li><strong>Move WordPress</strong> - <?php esc_html_e('Migrate & move your website from one domain to another, even to a separate server. (Pro)', 'wp-staging'); ?></li>
22
+ <li><strong>Support Multisites</strong> - <?php esc_html_e('Clone and push Multisites. (Pro)', 'wp-staging'); ?></li>
23
+ <li><strong>Authentication</strong> - <?php esc_html_e('Cloned sites are available to authenticated users only.', 'wp-staging'); ?></li>
24
+ <li><strong>High Performance</strong> - <?php esc_html_e('WP STAGING is one of the fastest backup and migration plugins. Compare yourself.', 'wp-staging'); ?></li>
25
+ <li><strong>Secure</strong> - <?php esc_html_e('WP STAGING is no cloud service. Your data belongs to you only.', 'wp-staging'); ?></li>
26
  <a href="http://wp-staging.com/?utm_source=wpstg&utm_medium=addon_page&utm_term=click-wpstaging-pro&utm_campaign=wpstaging" target="_blank" class="wpstg-button--big wpstg-button--blue">Buy WP STAGING Pro</a>
27
+ <a href="<?php echo esc_url(admin_url()); ?>admin.php?page=wpstg_clone" target="_self" class="wpstg-ml-30px">Skip & Start Cloning</a>
28
+ <div class="wpstg-footer"> <?php esc_html_e('Comes with our money back guarantee * You need to give us chance to resolve your issue first.', 'wp-staging'); ?></div>
29
  </div>
30
  </div>
Core/Forms/Elements.php CHANGED
@@ -178,7 +178,7 @@ abstract class Elements implements InterfaceElement
178
  */
179
  public function setDefault($value)
180
  {
181
- $this->default = esc_attr__($value);
182
 
183
  return $this;
184
  }
178
  */
179
  public function setDefault($value)
180
  {
181
+ $this->default = $value;
182
 
183
  return $this;
184
  }
Core/Forms/Form.php CHANGED
@@ -44,4 +44,16 @@ class Form
44
 
45
  return $this->elements[$name]->prepareLabel();
46
  }
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
44
 
45
  return $this->elements[$name]->prepareLabel();
46
  }
47
+
48
+ /** @param string $name */
49
+ public function renderLabel($name)
50
+ {
51
+ echo wp_kses($this->label($name), ['label' => []]);
52
+ }
53
+
54
+ /** @param string $name */
55
+ public function renderInput($name)
56
+ {
57
+ echo $this->render($name);
58
+ }
59
  }
Core/Utils/Browser.php CHANGED
@@ -1,6 +1,8 @@
1
  <?php
2
  namespace WPStaging\Core\Utils;
3
 
 
 
4
  /**
5
  * Modified to remove var
6
  * Chris Christoff on 12/26/2012
@@ -233,7 +235,7 @@ namespace WPStaging\Core\Utils;
233
  * Reset all properties
234
  */
235
  function reset() {
236
- $this->_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "";
237
  $this->_browser_name = $this->BROWSER_UNKNOWN;
238
  $this->_version = $this->VERSION_UNKNOWN;
239
  $this->_platform = $this->PLATFORM_UNKNOWN;
1
  <?php
2
  namespace WPStaging\Core\Utils;
3
 
4
+ use WPStaging\Framework\Facades\Sanitize;
5
+
6
  /**
7
  * Modified to remove var
8
  * Chris Christoff on 12/26/2012
235
  * Reset all properties
236
  */
237
  function reset() {
238
+ $this->_agent = isset($_SERVER['HTTP_USER_AGENT']) ? Sanitize::sanitizeString($_SERVER['HTTP_USER_AGENT']) : "";
239
  $this->_browser_name = $this->BROWSER_UNKNOWN;
240
  $this->_version = $this->VERSION_UNKNOWN;
241
  $this->_platform = $this->PLATFORM_UNKNOWN;
Core/Utils/functions.php CHANGED
@@ -96,8 +96,8 @@ function wpstg_is_valid_date($date, $format = 'Y-m-d')
96
  /**
97
  * Convert all values of a string or an array into url decoded values
98
  * Main use for preventing Wordfence firewall rule 'local file inclusion'
99
- * @param mixed string | array $data
100
- * @return mixed string | array
101
  */
102
  function wpstg_urldecode($data)
103
  {
@@ -112,7 +112,7 @@ function wpstg_urldecode($data)
112
  if (is_array($data)) {
113
  $array = [];
114
  foreach ($data as $string) {
115
- $array[] = urldecode($string);
116
  }
117
  return $array;
118
  }
96
  /**
97
  * Convert all values of a string or an array into url decoded values
98
  * Main use for preventing Wordfence firewall rule 'local file inclusion'
99
+ * @param mixed string|array
100
+ * @return mixed string|array
101
  */
102
  function wpstg_urldecode($data)
103
  {
112
  if (is_array($data)) {
113
  $array = [];
114
  foreach ($data as $string) {
115
+ $array[] = is_string($string) ? urldecode($string) : $string;
116
  }
117
  return $array;
118
  }
Framework/AnalyticsServiceProvider.php CHANGED
@@ -8,9 +8,13 @@ use WPStaging\Framework\Analytics\AnalyticsConsent;
8
  use WPStaging\Framework\Analytics\AnalyticsEventDto;
9
  use WPStaging\Framework\Analytics\AnalyticsSender;
10
  use WPStaging\Framework\DI\FeatureServiceProvider;
 
11
 
12
  class AnalyticsServiceProvider extends FeatureServiceProvider
13
  {
 
 
 
14
  public static function getFeatureTrigger()
15
  {
16
  return 'WPSTG_FEATURE_ANALYTICS';
@@ -28,6 +32,8 @@ class AnalyticsServiceProvider extends FeatureServiceProvider
28
  add_action('admin_notices', $this->container->callback(AnalyticsConsent::class, 'maybeShowConsentFailureNotice'));
29
  add_action('admin_init', $this->container->callback(AnalyticsConsent::class, 'listenForConsent'));
30
 
 
 
31
  /*
32
  * Analytics error detection for Backup actions
33
  *
@@ -47,11 +53,9 @@ class AnalyticsServiceProvider extends FeatureServiceProvider
47
  }
48
  }
49
 
50
- $errorMessage = html_entity_decode($_POST['error_message']);
51
- $errorMessage = sanitize_text_field($errorMessage);
52
 
53
- $jobId = html_entity_decode($_POST['job_id']);
54
- $jobId = sanitize_text_field($jobId);
55
 
56
  AnalyticsEventDto::enqueueErrorEvent($jobId, $errorMessage);
57
  });
@@ -68,9 +72,8 @@ class AnalyticsServiceProvider extends FeatureServiceProvider
68
  }
69
  }
70
 
71
- $errorMessage = html_entity_decode($_POST['error_message']);
72
  // prevent emptying HTML string, as Staging errors might be returned in HTML (?)
73
- $errorMessage = wp_kses_post($errorMessage);
74
 
75
  /**
76
  * Get the "options" object from cache
8
  use WPStaging\Framework\Analytics\AnalyticsEventDto;
9
  use WPStaging\Framework\Analytics\AnalyticsSender;
10
  use WPStaging\Framework\DI\FeatureServiceProvider;
11
+ use WPStaging\Framework\Utils\Sanitize;
12
 
13
  class AnalyticsServiceProvider extends FeatureServiceProvider
14
  {
15
+ /** @var Sanitize */
16
+ private $sanitize;
17
+
18
  public static function getFeatureTrigger()
19
  {
20
  return 'WPSTG_FEATURE_ANALYTICS';
32
  add_action('admin_notices', $this->container->callback(AnalyticsConsent::class, 'maybeShowConsentFailureNotice'));
33
  add_action('admin_init', $this->container->callback(AnalyticsConsent::class, 'listenForConsent'));
34
 
35
+ $this->sanitize = WPStaging::make(Sanitize::class);
36
+
37
  /*
38
  * Analytics error detection for Backup actions
39
  *
53
  }
54
  }
55
 
56
+ $errorMessage = isset($_POST['error_message']) ? $this->sanitize->htmlDecodeAndSanitize($_POST['error_message']) : '';
 
57
 
58
+ $jobId = isset($_POST['job_id']) ? $this->sanitize->htmlDecodeAndSanitize($_POST['job_id']) : '';
 
59
 
60
  AnalyticsEventDto::enqueueErrorEvent($jobId, $errorMessage);
61
  });
72
  }
73
  }
74
 
 
75
  // prevent emptying HTML string, as Staging errors might be returned in HTML (?)
76
+ $errorMessage = isset($_POST['error_message']) ? $this->sanitize->htmlDecodeAndSanitize($_POST['error_message']) : '';
77
 
78
  /**
79
  * Get the "options" object from cache
Framework/Facades/Escape.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPStaging\Framework\Facades;
4
+
5
+ use WPStaging\Framework\Utils\Escape as UtilsEscape;
6
+
7
+ /**
8
+ * @method static string escapeHtml(string $content, string $domain)
9
+ */
10
+ class Escape extends Facade
11
+ {
12
+ protected static function getFacadeAccessor()
13
+ {
14
+ return UtilsEscape::class;
15
+ }
16
+ }
Framework/Facades/Facade.php CHANGED
@@ -17,7 +17,7 @@ use WPStaging\Core\WPStaging;
17
  */
18
  abstract class Facade
19
  {
20
- protected static $facadeInstance = null;
21
 
22
  /**
23
  * Caution: Use in testing Only
@@ -28,7 +28,7 @@ abstract class Facade
28
  */
29
  public static function swapInstance($instance)
30
  {
31
- $oldInstance = static::$facadeInstance;
32
  static::setInstance($instance);
33
  return $oldInstance;
34
  }
@@ -42,7 +42,7 @@ abstract class Facade
42
  {
43
  $class = static::getFacadeAccessor();
44
  if ($instance instanceof $class) {
45
- static::$facadeInstance = $instance;
46
  return;
47
  }
48
 
@@ -77,20 +77,20 @@ abstract class Facade
77
  protected static function createInstance()
78
  {
79
  try {
80
- static::$facadeInstance = WPStaging::make(static::getFacadeAccessor());
81
  } catch (Exception $ex) {
82
- static::$facadeInstance = null;
83
  }
84
  }
85
 
86
  /** @return self */
87
  protected static function getInstance()
88
  {
89
- if (static::$facadeInstance === null) {
90
  static::createInstance();
91
  }
92
 
93
- return static::$facadeInstance;
94
  }
95
 
96
  /**
17
  */
18
  abstract class Facade
19
  {
20
+ protected static $facadeInstances = [];
21
 
22
  /**
23
  * Caution: Use in testing Only
28
  */
29
  public static function swapInstance($instance)
30
  {
31
+ $oldInstance = static::$facadeInstances[static::getFacadeAccessor()];
32
  static::setInstance($instance);
33
  return $oldInstance;
34
  }
42
  {
43
  $class = static::getFacadeAccessor();
44
  if ($instance instanceof $class) {
45
+ static::$facadeInstances[static::getFacadeAccessor()] = $instance;
46
  return;
47
  }
48
 
77
  protected static function createInstance()
78
  {
79
  try {
80
+ static::$facadeInstances[static::getFacadeAccessor()] = WPStaging::make(static::getFacadeAccessor());
81
  } catch (Exception $ex) {
82
+ static::$facadeInstances[static::getFacadeAccessor()] = null;
83
  }
84
  }
85
 
86
  /** @return self */
87
  protected static function getInstance()
88
  {
89
+ if (!isset(static::$facadeInstances[static::getFacadeAccessor()]) || static::$facadeInstances[static::getFacadeAccessor()] === null) {
90
  static::createInstance();
91
  }
92
 
93
+ return static::$facadeInstances[static::getFacadeAccessor()];
94
  }
95
 
96
  /**
Framework/Facades/Sanitize.php CHANGED
@@ -5,10 +5,19 @@ namespace WPStaging\Framework\Facades;
5
  use WPStaging\Framework\Utils\Sanitize as UtilsSanitize;
6
 
7
  /**
8
- * @method static string sanitizeString(mixed $value)
9
- * @method static int|string sanitizeInt(mixed $value)
10
- * @method static bool sanitizeBool(mixed $value)
11
- * @method static string sanitizeEmail(mixed $value)
 
 
 
 
 
 
 
 
 
12
  */
13
  class Sanitize extends Facade
14
  {
5
  use WPStaging\Framework\Utils\Sanitize as UtilsSanitize;
6
 
7
  /**
8
+ * @method static array|string sanitizeString(array|string $value)
9
+ * @method static int sanitizeInt(string $value)
10
+ * @method static bool sanitizeBool(int|bool|string $value)
11
+ * @method static string sanitizeEmail(string $value)
12
+ * @method static string sanitizeURL(string $value)
13
+ * @method static string sanitizePath(string $value)
14
+ * @method static string sanitizeTextareaField(string $value)
15
+ * @method static string htmlDecodeAndSanitize(string $value)
16
+ * @method static array sanitizeFileUpload(array $value)
17
+ * @method static array sanitizeExcludeRules(string $value)
18
+ * @method static array sanitizeArrayInt(array $value)
19
+ * @method static array sanitizeArray(array $value)
20
+ * @method static string decodeBase64AndSanitize(string $value)
21
  */
22
  class Sanitize extends Facade
23
  {
Framework/Queue/FileSeekableQueue.php CHANGED
@@ -210,13 +210,19 @@ class FileSeekableQueue implements SeekableQueueInterface, \SeekableIterator
210
  public function shutdown()
211
  {
212
  if ($this->needsUnlock && $this->handle instanceof FileObject) {
213
- try {
214
- $this->handle->flock(LOCK_UN);
215
- } catch (\Exception $e) {
216
- $message = $e->getMessage();
217
- if ($message !== 'Object not initialized') {
218
- debug_log("Unable to unlock handle " . $this->taskName . '.task : ' . $message, Logger::TYPE_DEBUG);
219
- }
 
 
 
 
 
 
220
  }
221
  }
222
  }
210
  public function shutdown()
211
  {
212
  if ($this->needsUnlock && $this->handle instanceof FileObject) {
213
+ $this->unlockObject();
214
+ return;
215
+ }
216
+ }
217
+
218
+ protected function unlockObject()
219
+ {
220
+ try {
221
+ $this->handle->flock(LOCK_UN);
222
+ } catch (\Exception $e) {
223
+ $message = $e->getMessage();
224
+ if ($message !== 'Object not initialized') {
225
+ debug_log("Unable to unlock handle " . $this->taskName . '.task : ' . $message, Logger::TYPE_DEBUG);
226
  }
227
  }
228
  }
Framework/Rest/Rest.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  namespace WPStaging\Framework\Rest;
4
 
 
 
5
  /**
6
  * Class Rest
7
  *
@@ -9,6 +11,14 @@ namespace WPStaging\Framework\Rest;
9
  */
10
  class Rest
11
  {
 
 
 
 
 
 
 
 
12
  // Is Rest URL
13
  public function isRestUrl()
14
  {
@@ -17,7 +27,7 @@ class Rest
17
  return false;
18
  }
19
 
20
- $requestPath = trim($_SERVER['REQUEST_URI'], '/');
21
 
22
  $url = trailingslashit(get_home_url(get_current_blog_id(), ''));
23
  // nginx only allows HTTP/1.0 methods when redirecting from / to /index.php.
2
 
3
  namespace WPStaging\Framework\Rest;
4
 
5
+ use WPStaging\Framework\Utils\Sanitize;
6
+
7
  /**
8
  * Class Rest
9
  *
11
  */
12
  class Rest
13
  {
14
+ /** @var Sanitize */
15
+ private $sanitize;
16
+
17
+ public function __construct(Sanitize $sanitize)
18
+ {
19
+ $this->sanitize = $sanitize;
20
+ }
21
+
22
  // Is Rest URL
23
  public function isRestUrl()
24
  {
27
  return false;
28
  }
29
 
30
+ $requestPath = trim($this->sanitize->sanitizeURL($_SERVER['REQUEST_URI']), '/');
31
 
32
  $url = trailingslashit(get_home_url(get_current_blog_id(), ''));
33
  // nginx only allows HTTP/1.0 methods when redirecting from / to /index.php.
Framework/Security/AccessToken.php CHANGED
@@ -28,7 +28,7 @@ class AccessToken
28
  */
29
  public function requestHasValidToken()
30
  {
31
- return isset($_REQUEST[self::REQUEST_KEY]) && $this->isValidToken($_REQUEST[self::REQUEST_KEY]);
32
  }
33
 
34
  /**
28
  */
29
  public function requestHasValidToken()
30
  {
31
+ return isset($_REQUEST[self::REQUEST_KEY]) && $this->isValidToken(sanitize_text_field($_REQUEST[self::REQUEST_KEY]));
32
  }
33
 
34
  /**
Framework/Security/Nonce.php CHANGED
@@ -27,6 +27,6 @@ class Nonce
27
  */
28
  public function requestHasValidNonce($action)
29
  {
30
- return isset($_REQUEST['nonce']) && wp_verify_nonce($_REQUEST['nonce'], $action) !== false;
31
  }
32
  }
27
  */
28
  public function requestHasValidNonce($action)
29
  {
30
+ return isset($_REQUEST['nonce']) && wp_verify_nonce(sanitize_text_field($_REQUEST['nonce']), $action) !== false;
31
  }
32
  }
Framework/Utils/Escape.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPStaging\Framework\Utils;
4
+
5
+ class Escape
6
+ {
7
+ /**
8
+ * Escape html with allowed html tags
9
+ *
10
+ * @param string $content
11
+ * @param string $domain
12
+ *
13
+ * @return string
14
+ */
15
+ public function escapeHtml($content)
16
+ {
17
+ return wp_kses($content, $this->htmlAllowedDuringEscape([]));
18
+ }
19
+
20
+ /**
21
+ * Html decode and then wp_kses_post
22
+ *
23
+ * @param string $text
24
+ * @return string
25
+ */
26
+ public function decodeKsesPost($text)
27
+ {
28
+ return wp_kses_post(html_entity_decode($text));
29
+ }
30
+
31
+ /**
32
+ * @param array $array
33
+ * @return array
34
+ */
35
+ public function htmlAllowedDuringEscape($array)
36
+ {
37
+ return [
38
+ 'a' => [
39
+ 'id' => [],
40
+ 'href' => [],
41
+ 'title' => [],
42
+ 'target' => [],
43
+ 'rel' => [],
44
+ ],
45
+ 'span' => [
46
+ 'class' => [],
47
+ 'title' => [],
48
+ ],
49
+ 'p' => [],
50
+ 'br' => [],
51
+ 'code' => [],
52
+ 'em' => [],
53
+ 'strong' => [],
54
+ ];
55
+ }
56
+ }
Framework/Utils/Sanitize.php CHANGED
@@ -2,18 +2,57 @@
2
 
3
  namespace WPStaging\Framework\Utils;
4
 
 
 
5
  class Sanitize
6
  {
 
 
 
 
 
 
 
 
7
  public function sanitizeString($value)
8
  {
9
- return htmlspecialchars($value);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  }
11
 
12
- public function sanitizeInt($value)
 
 
 
 
 
 
13
  {
14
- return filter_var($value, FILTER_VALIDATE_INT);
 
 
 
 
 
15
  }
16
 
 
 
 
 
17
  public function sanitizeBool($value)
18
  {
19
  // FILTER_VALIDATE_BOOL is alias of FILTER_VALIDATE_BOOLEAN and was introduced in PHP 8.0 but php.net say that we use the BOOL variant,
@@ -21,8 +60,192 @@ class Sanitize
21
  return filter_var($value, defined('FILTER_VALIDATE_BOOL') ? FILTER_VALIDATE_BOOL : FILTER_VALIDATE_BOOLEAN);
22
  }
23
 
 
 
 
 
24
  public function sanitizeEmail($value)
25
  {
26
  return filter_var($value, FILTER_VALIDATE_EMAIL);
27
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  }
2
 
3
  namespace WPStaging\Framework\Utils;
4
 
5
+ use WPStaging\Core\WPStaging;
6
+
7
  class Sanitize
8
  {
9
+ protected $config = [];
10
+
11
+ /**
12
+ * Sanitize string and array. Automatically urldecode
13
+ *
14
+ * @param array|string $value
15
+ * @return array|string
16
+ */
17
  public function sanitizeString($value)
18
  {
19
+ if (is_object($value)) {
20
+ return $value;
21
+ }
22
+
23
+ $value = wpstg_urldecode($value);
24
+ if (!is_array($value)) {
25
+ return htmlspecialchars($value);
26
+ }
27
+
28
+ $sanitized = [];
29
+ foreach ($value as $string) {
30
+ $sanitized[] = is_string($string) ? htmlspecialchars($string) : $string;
31
+ }
32
+
33
+ return $sanitized;
34
  }
35
 
36
+ /**
37
+ * Sanitize integer. Optionally use abs flag
38
+ * @param int|string $value
39
+ * @param bool $useAbsValue
40
+ * @return int
41
+ */
42
+ public function sanitizeInt($value, $useAbsValue = false)
43
  {
44
+ $integer = filter_var($value, FILTER_VALIDATE_INT);
45
+ if ($useAbsValue) {
46
+ return absint($integer);
47
+ }
48
+
49
+ return $integer;
50
  }
51
 
52
+ /**
53
+ * @param int|bool|string $value
54
+ * @return bool
55
+ */
56
  public function sanitizeBool($value)
57
  {
58
  // FILTER_VALIDATE_BOOL is alias of FILTER_VALIDATE_BOOLEAN and was introduced in PHP 8.0 but php.net say that we use the BOOL variant,
60
  return filter_var($value, defined('FILTER_VALIDATE_BOOL') ? FILTER_VALIDATE_BOOL : FILTER_VALIDATE_BOOLEAN);
61
  }
62
 
63
+ /**
64
+ * @param string $value
65
+ * @return string
66
+ */
67
  public function sanitizeEmail($value)
68
  {
69
  return filter_var($value, FILTER_VALIDATE_EMAIL);
70
  }
71
+
72
+ /**
73
+ * @param string $value
74
+ * @return string
75
+ */
76
+ public function sanitizeURL($value)
77
+ {
78
+ return sanitize_url($value);
79
+ }
80
+
81
+ /**
82
+ * Sanitize the path, remove spaces and trailing slashes
83
+ * @param string $value
84
+ * @return string
85
+ */
86
+ public function sanitizePath($value)
87
+ {
88
+ if (is_array($value) || is_object($value)) {
89
+ return false;
90
+ }
91
+
92
+ $value = $this->sanitizeString($value);
93
+
94
+ // Remove trailing slashes
95
+ $path = rtrim($value, '/\\');
96
+
97
+ // To support network path on windows
98
+ if (WPStaging::isWindowsOs()) {
99
+ return $path;
100
+ }
101
+
102
+ // Remove whitespace and spaces
103
+ $path = preg_replace('/\s+/', '', $path);
104
+
105
+ // Convert all invalid slashes to one single forward slash
106
+ $replacements = [
107
+ '//' => '/',
108
+ ];
109
+
110
+ return strtr($path, $replacements);
111
+ }
112
+
113
+ /**
114
+ * This function ensures backwards compatibility with Wordpress prior to the 4.7 release. sanitize_textarea_field
115
+ * was introduced with that version.
116
+ * @param $str
117
+ *
118
+ * @return string
119
+ */
120
+ public function sanitizeTextareaField($str)
121
+ {
122
+ if (function_exists('sanitize_textarea_field')) {
123
+ return sanitize_textarea_field($str);
124
+ } else {
125
+ return sanitize_text_field($str);
126
+ }
127
+ }
128
+
129
+ /**
130
+ * Html decode and then sanitize
131
+ *
132
+ * @param string $text
133
+ * @return string
134
+ */
135
+ public function htmlDecodeAndSanitize($text)
136
+ {
137
+ return sanitize_text_field(html_entity_decode($text));
138
+ }
139
+
140
+ /**
141
+ * @param array $file
142
+ * @param array
143
+ */
144
+ public function sanitizeFileUpload($file)
145
+ {
146
+ if (!is_array($file)) {
147
+ return null;
148
+ }
149
+
150
+ if (!isset($file['tmp_name'])) {
151
+ return null;
152
+ }
153
+
154
+ return $file;
155
+ }
156
+
157
+ /**
158
+ * @param array|string $htmlPost
159
+ * @return array
160
+ */
161
+ public function sanitizeExcludeRules($htmlPost)
162
+ {
163
+ if (is_object($htmlPost)) {
164
+ return [];
165
+ }
166
+
167
+ $decoded = wpstg_urldecode($htmlPost);
168
+
169
+ if (!is_array($decoded)) {
170
+ $items = explode(',', $decoded);
171
+ } else {
172
+ $items = $decoded;
173
+ }
174
+
175
+ $sanitized = [];
176
+ foreach ($items as $item) {
177
+ $sanitized[] = $this->sanitizeString($item);
178
+ }
179
+
180
+ return $sanitized;
181
+ }
182
+
183
+ /**
184
+ * @param array $items
185
+ * @return array
186
+ */
187
+ public function sanitizeArrayInt($items)
188
+ {
189
+ // Early bail if not array
190
+ if (!is_array($items) || empty($items)) {
191
+ return [];
192
+ }
193
+
194
+ $sanitized = [];
195
+ foreach ($items as $item) {
196
+ $sanitized[] = $this->sanitizeInt($item);
197
+ }
198
+
199
+ return $sanitized;
200
+ }
201
+
202
+ /**
203
+ * @param array $items
204
+ * @param array $config
205
+ * @return array
206
+ */
207
+ public function sanitizeArray($items, $config = [])
208
+ {
209
+ // Early bail if not array
210
+ if (!is_array($items) || empty($items)) {
211
+ return [];
212
+ }
213
+
214
+ $sanitized = [];
215
+ if (!is_array($config) || empty($config)) {
216
+ $config = $this->config;
217
+ } else {
218
+ $this->config = $config;
219
+ }
220
+
221
+ foreach ($items as $key => $value) {
222
+ $sanitized[$key] = isset($config[$key]) ? $this->sanitize($value, $config[$key]) : $this->sanitizeString($value);
223
+ }
224
+
225
+ return $sanitized;
226
+ }
227
+
228
+ /**
229
+ * @param string $text
230
+ * @return string
231
+ */
232
+ public function decodeBase64AndSanitize($text)
233
+ {
234
+ return $this->sanitizeString(base64_decode($text));
235
+ }
236
+
237
+ /**
238
+ * @param int|bool|string|array $value
239
+ * @param string $method
240
+ * @return int|bool|string|array
241
+ */
242
+ protected function sanitize($value, $method)
243
+ {
244
+ $methodName = 'sanitize' . ucfirst($method);
245
+ if (!method_exists($this, $methodName)) {
246
+ return $this->sanitizeString($value);
247
+ }
248
+
249
+ return $this->{$methodName}($value);
250
+ }
251
  }
Framework/Utils/Strings.php CHANGED
@@ -8,22 +8,6 @@ namespace WPStaging\Framework\Utils;
8
  */
9
  class Strings
10
  {
11
- /**
12
- * This function ensures backwards compatibility with Wordpress prior to the 4.7 release. sanitize_textarea_field
13
- * was introduced with that version.
14
- * @param $str
15
- *
16
- * @return string
17
- */
18
- public function sanitizeTextareaField($str)
19
- {
20
- if (function_exists('sanitize_textarea_field')) {
21
- return sanitize_textarea_field($str);
22
- } else {
23
- return sanitize_text_field($str);
24
- }
25
- }
26
-
27
  /**
28
  * Replace first occurrence of certain string
29
  * @param string $search
8
  */
9
  class Strings
10
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  /**
12
  * Replace first occurrence of certain string
13
  * @param string $search
Frontend/Frontend.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  namespace WPStaging\Frontend;
4
 
 
5
  use WPStaging\Framework\Rest\Rest;
6
  use WPStaging\Framework\SiteInfo;
7
 
@@ -96,7 +97,10 @@ class Frontend
96
  }
97
 
98
  // Don't show login form for rest requests
99
- if ((new Rest())->isRestUrl()) {
 
 
 
100
  return false;
101
  }
102
 
2
 
3
  namespace WPStaging\Frontend;
4
 
5
+ use WPStaging\Core\WPStaging;
6
  use WPStaging\Framework\Rest\Rest;
7
  use WPStaging\Framework\SiteInfo;
8
 
97
  }
98
 
99
  // Don't show login form for rest requests
100
+
101
+ /** @var Rest */
102
+ $rest = WPStaging::make(Rest::class);
103
+ if ($rest->isRestUrl()) {
104
  return false;
105
  }
106
 
Frontend/LoginAfterImport.php CHANGED
@@ -3,6 +3,7 @@
3
  namespace WPStaging\Frontend;
4
 
5
  use WPStaging\Core\WPStaging;
 
6
  use WPStaging\Framework\Security\AccessToken;
7
 
8
  class LoginAfterImport
@@ -13,7 +14,7 @@ class LoginAfterImport
13
  public function showMessage()
14
  {
15
  // Early bail: Not after Import
16
- if (!isset($_GET['wpstgAfterImport']) || $_GET['wpstgAfterImport'] !== 'yes') {
17
  return;
18
  }
19
 
@@ -23,7 +24,8 @@ class LoginAfterImport
23
  }
24
 
25
  // Late instantiation, since this runs on the FE on every request
26
- $auth = WPStaging::getInstance()->getContainer()->make(AccessToken::class);
 
27
 
28
  // Early bail: Invalid access token
29
  if (!$auth->isValidToken($_GET['accessToken'])) {
3
  namespace WPStaging\Frontend;
4
 
5
  use WPStaging\Core\WPStaging;
6
+ use WPStaging\Framework\Facades\Sanitize;
7
  use WPStaging\Framework\Security\AccessToken;
8
 
9
  class LoginAfterImport
14
  public function showMessage()
15
  {
16
  // Early bail: Not after Import
17
+ if (!isset($_GET['wpstgAfterImport']) || !Sanitize::sanitizeBool($_GET['wpstgAfterImport'])) {
18
  return;
19
  }
20
 
24
  }
25
 
26
  // Late instantiation, since this runs on the FE on every request
27
+ /** @var AccessToken $auth */
28
+ $auth = WPStaging::make(AccessToken::class);
29
 
30
  // Early bail: Invalid access token
31
  if (!$auth->isValidToken($_GET['accessToken'])) {
Frontend/LoginForm.php CHANGED
@@ -2,6 +2,9 @@
2
 
3
  namespace WPStaging\Frontend;
4
 
 
 
 
5
  class LoginForm
6
  {
7
 
@@ -11,8 +14,12 @@ class LoginForm
11
  /** @var string */
12
  private $error;
13
 
 
 
 
14
  function __construct()
15
  {
 
16
  $this->login();
17
  }
18
 
@@ -36,12 +43,13 @@ class LoginForm
36
  return false;
37
  }
38
 
 
39
  // Try to find user by username
40
- $user_data = get_user_by('login', $_POST['wpstg-username']);
41
 
42
  // Try to find user by email address
43
  if (!$user_data) {
44
- $user_data = get_user_by('email', $_POST['wpstg-username']);
45
  }
46
 
47
  if (!$user_data) {
@@ -50,15 +58,16 @@ class LoginForm
50
  }
51
 
52
  // Validate provided password and login
53
- if (wp_check_password($_POST['wpstg-pass'], $user_data->user_pass, $user_data->ID)) {
 
54
  $rememberme = isset($_POST['rememberme']) ? true : false;
55
 
56
  wp_set_auth_cookie($user_data->ID, $rememberme);
57
- wp_set_current_user($user_data->ID, $_POST['wpstg-username']);
58
- do_action('wp_login', $_POST['wpstg-username'], get_userdata($user_data->ID));
59
 
60
  if (!empty($_POST['redirect_to'])) {
61
- $redirectTo = $_POST['redirect_to'];
62
  }
63
 
64
  header('Location:' . $redirectTo);
@@ -161,7 +170,9 @@ class LoginForm
161
  public function getDefaultArguments(array $overrides = [])
162
  {
163
  // Default 'redirect' value takes the user back to the request URI.
164
- $redirect = (is_ssl() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
 
 
165
  $lostPasswordUrl = wp_lostpassword_url($redirect);
166
  $arguments = wp_parse_args(
167
  $overrides,
2
 
3
  namespace WPStaging\Frontend;
4
 
5
+ use WPStaging\Core\WPStaging;
6
+ use WPStaging\Framework\Utils\Sanitize;
7
+
8
  class LoginForm
9
  {
10
 
14
  /** @var string */
15
  private $error;
16
 
17
+ /** @var Sanitize */
18
+ private $sanitize;
19
+
20
  function __construct()
21
  {
22
+ $this->sanitize = WPStaging::make(Sanitize::class);
23
  $this->login();
24
  }
25
 
43
  return false;
44
  }
45
 
46
+ $username = $this->sanitize->sanitizeString($_POST['wpstg-username']);
47
  // Try to find user by username
48
+ $user_data = get_user_by('login', $username);
49
 
50
  // Try to find user by email address
51
  if (!$user_data) {
52
+ $user_data = get_user_by('email', $username);
53
  }
54
 
55
  if (!$user_data) {
58
  }
59
 
60
  // Validate provided password and login
61
+ $password = isset($_POST['wpstg-pass']) ? $this->sanitize->sanitizeString($_POST['wpstg-pass']) : '';
62
+ if (wp_check_password($password, $user_data->user_pass, $user_data->ID)) {
63
  $rememberme = isset($_POST['rememberme']) ? true : false;
64
 
65
  wp_set_auth_cookie($user_data->ID, $rememberme);
66
+ wp_set_current_user($user_data->ID, $username);
67
+ do_action('wp_login', $username, get_userdata($user_data->ID));
68
 
69
  if (!empty($_POST['redirect_to'])) {
70
+ $redirectTo = $this->sanitize->sanitizeURL($_POST['redirect_to']);
71
  }
72
 
73
  header('Location:' . $redirectTo);
170
  public function getDefaultArguments(array $overrides = [])
171
  {
172
  // Default 'redirect' value takes the user back to the request URI.
173
+ $httpHost = !empty($_SERVER['HTTP_HOST']) ? $this->sanitize->sanitizeString($_SERVER['HTTP_HOST']) : '';
174
+ $requestURI = !empty($_SERVER['REQUEST_URI']) ? $this->sanitize->sanitizeString($_SERVER['REQUEST_URI']) : '';
175
+ $redirect = $this->sanitize->sanitizeURL((is_ssl() ? 'https://' : 'http://') . $httpHost . $requestURI);
176
  $lostPasswordUrl = wp_lostpassword_url($redirect);
177
  $arguments = wp_parse_args(
178
  $overrides,
Frontend/views/loginForm.php CHANGED
@@ -2,7 +2,7 @@
2
  <div class="wpstg-text-center">
3
  <img width="220" src="<?php echo esc_url(WPSTG_PLUGIN_URL . 'assets/img/logo.svg'); ?>" alt="WP Staging Login" />
4
  </div>
5
- <form class="wp-staging-form" name="<?php echo $args['form_id']; ?>" id="<?php echo $args['form_id']; ?>" action="" method="post">
6
  <?php if ($showNotice) { ?>
7
  <div class="wpstg-alert wpstg-alert-info wpstg-text-justify">
8
  <p><?php echo esc_html($notice); ?></p>
@@ -22,15 +22,15 @@
22
  <?php } ?>
23
 
24
  <div class="login-submit">
25
- <button type="submit" name="wpstg-submit" id="<?php echo esc_attr($args['id_submit']); ?>" class="btn" value="<?php echo esc_attr($args['label_log_in']); ?>">Login</button>
26
  <input type="hidden" name="redirect_to" value="<?php echo esc_url($args['redirect']); ?>" />
27
  </div>
28
  <div class="password-lost">
29
- <a href="<?php echo esc_url($args['lost_password_url']); ?>">Lost your password?</a>
30
  </div>
31
 
32
  <p class="error-msg">
33
- <?php echo $this->error; ?>
34
  </p>
35
  </form>
36
  </main>
2
  <div class="wpstg-text-center">
3
  <img width="220" src="<?php echo esc_url(WPSTG_PLUGIN_URL . 'assets/img/logo.svg'); ?>" alt="WP Staging Login" />
4
  </div>
5
+ <form class="wp-staging-form" name="<?php echo esc_attr($args['form_id']); ?>" id="<?php echo esc_attr($args['form_id']); ?>" action="" method="post">
6
  <?php if ($showNotice) { ?>
7
  <div class="wpstg-alert wpstg-alert-info wpstg-text-justify">
8
  <p><?php echo esc_html($notice); ?></p>
22
  <?php } ?>
23
 
24
  <div class="login-submit">
25
+ <button type="submit" name="wpstg-submit" id="<?php echo esc_attr($args['id_submit']); ?>" class="btn" value="<?php echo esc_attr($args['label_log_in']); ?>"><?php esc_html_e('Login', 'wp-staging') ?></button>
26
  <input type="hidden" name="redirect_to" value="<?php echo esc_url($args['redirect']); ?>" />
27
  </div>
28
  <div class="password-lost">
29
+ <a href="<?php echo esc_url($args['lost_password_url']); ?>"><?php esc_html_e('Lost your password?', 'wp-staging') ?></a>
30
  </div>
31
 
32
  <p class="error-msg">
33
+ <?php echo esc_html($this->error); ?>
34
  </p>
35
  </form>
36
  </main>
constantsFree.php CHANGED
@@ -2,10 +2,10 @@
2
 
3
  // WP STAGING version number
4
  if (!defined('WPSTG_VERSION')) {
5
- define('WPSTG_VERSION', '2.9.18');
6
  }
7
 
8
  // Compatible up to WordPress Version
9
  if (!defined('WPSTG_COMPATIBLE')) {
10
- define('WPSTG_COMPATIBLE', '6.0.1');
11
  }
2
 
3
  // WP STAGING version number
4
  if (!defined('WPSTG_VERSION')) {
5
+ define('WPSTG_VERSION', '2.9.19');
6
  }
7
 
8
  // Compatible up to WordPress Version
9
  if (!defined('WPSTG_COMPATIBLE')) {
10
+ define('WPSTG_COMPATIBLE', '6.0.2');
11
  }
opcacheBootstrap.php CHANGED
@@ -20,9 +20,11 @@ if (version_compare($wp_version, '5.5', '>=')) {
20
  return;
21
  }
22
 
 
 
23
  // Ported from WordPress 5.5 wp_opcache_invalidate
24
  $canInvalidate = function_exists('opcache_invalidate')
25
- && (!ini_get('opcache.restrict_api') || stripos(realpath($_SERVER['SCRIPT_FILENAME']), ini_get('opcache.restrict_api')) === 0);
26
 
27
  // Early bail: OPCache not enabled, or we can't clear it.
28
  if (!$canInvalidate) {
@@ -45,7 +47,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.18';
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);
20
  return;
21
  }
22
 
23
+ $filename = isset($_SERVER['SCRIPT_FILENAME']) ? sanitize_text_field($_SERVER['SCRIPT_FILENAME']) : '';
24
+
25
  // Ported from WordPress 5.5 wp_opcache_invalidate
26
  $canInvalidate = function_exists('opcache_invalidate')
27
+ && (!ini_get('opcache.restrict_api') || stripos(realpath($filename), ini_get('opcache.restrict_api')) === 0);
28
 
29
  // Early bail: OPCache not enabled, or we can't clear it.
30
  if (!$canInvalidate) {
47
  *
48
  * We use the "Version" from the headers of the main file of the plugin to compare.
49
  */
50
+ $runtimeVersionDifferentFromBuildVersion = get_file_data($pluginFilePath, ['Version' => 'Version'])['Version'] !== '2.9.19';
51
  $lastCheckHappenedAfterInterval = current_time('timestamp') > (int)get_site_transient('wpstg.bootstrap.opcache.lastCleared') + 5 * MINUTE_IN_SECONDS;
52
 
53
  $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.18
13
  Requires PHP: 5.6
14
 
15
  Backup & Duplicator Plugin - Clone, backup, move, duplicate & migrate websites to staging, backup, and development sites for authorized users only.
@@ -259,6 +259,13 @@ please open a [support request](https://wp-staging.com/support/ "Support Request
259
 
260
  == Changelog ==
261
 
 
 
 
 
 
 
 
262
  = 2.9.18 =
263
  * Fix: Does not sanitise and escape some of its backup settings, which could allow high privilege users such as admin to perform Stored Cross-Site Scripting attacks (XSS) even when the unfiltered_html capability is disallowed (for example in multisite setup) #1825
264
 
@@ -541,5 +548,9 @@ WP STAGING Backup & Cloning | Full changelog:
541
 
542
  == Upgrade Notice ==
543
 
544
- = 2.9.18 =
545
- * Fix: Does not sanitise and escape some of its backup settings, which could allow high privilege users such as admin to perform Stored Cross-Site Scripting attacks (XSS) even when the unfiltered_html capability is disallowed (for example in multisite setup) #1825
 
 
 
 
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.19
13
  Requires PHP: 5.6
14
 
15
  Backup & Duplicator Plugin - Clone, backup, move, duplicate & migrate websites to staging, backup, and development sites for authorized users only.
259
 
260
  == Changelog ==
261
 
262
+ = 2.9.19 =
263
+ * New: Compatible up to WordPres 6.0.2
264
+ * Security: Further improve sanitization and escaping of variables to prevent potential XSS attacks with high privileges #1836
265
+ * Enh: Show better response from remote when license can not be activated #1818
266
+ * Fix: Fatal error Uncaught TypeError on google drive backup upload settings page under rare circumstances when site is translated #1849
267
+ * Fix: Fatal error on Windows OS when pushing a staging site and activating the backup option. It deletes the WP Staging content directory including its cache files file during files copying process, resulting in a failed push #1851
268
+
269
  = 2.9.18 =
270
  * Fix: Does not sanitise and escape some of its backup settings, which could allow high privilege users such as admin to perform Stored Cross-Site Scripting attacks (XSS) even when the unfiltered_html capability is disallowed (for example in multisite setup) #1825
271
 
548
 
549
  == Upgrade Notice ==
550
 
551
+ = 2.9.19 =
552
+ * New: Compatible up to WordPres 6.0.2
553
+ * Security: Further improve sanitization and escaping of variables to prevent potential XSS attacks with high privileges #1836
554
+ * Enh: Show better response from remote when license can not be activated #1818
555
+ * Fix: Fatal error Uncaught TypeError on google drive backup upload settings page under rare circumstances when site is translated #1849
556
+ * Fix: Fatal error on Windows OS when pushing a staging site and activating the backup option. It deletes the WP Staging content directory including its cache files file during files copying process, resulting in a failed push #1851
runtimeRequirements.php CHANGED
@@ -18,7 +18,7 @@ if (isset($_REQUEST['action'])) {
18
  case 'activate':
19
  case 'error_scrape':
20
  if (isset($_REQUEST['plugin'])) {
21
- $plugin = (string)wp_unslash($_REQUEST['plugin']);
22
 
23
  $isActivatingWpStaging = strpos($plugin, 'wp-staging.php') || strpos($plugin, 'wp-staging-pro.php');
24
  $isActivatingAnotherWpStaging = plugin_basename($plugin) !== plugin_basename($pluginFilePath);
@@ -31,7 +31,7 @@ if (isset($_REQUEST['action'])) {
31
  case 'activate-selected':
32
  case 'activate-multi':
33
  if (isset($_REQUEST['checked'])) {
34
- $plugins = (array)wp_unslash($_REQUEST['checked']);
35
 
36
  foreach ($plugins as $i => $plugin) {
37
  $isActivatingWpStaging = strpos($plugin, 'wp-staging.php') || strpos($plugin, 'wp-staging-pro.php');
18
  case 'activate':
19
  case 'error_scrape':
20
  if (isset($_REQUEST['plugin'])) {
21
+ $plugin = (string)wp_unslash(sanitize_text_field($_REQUEST['plugin']));
22
 
23
  $isActivatingWpStaging = strpos($plugin, 'wp-staging.php') || strpos($plugin, 'wp-staging-pro.php');
24
  $isActivatingAnotherWpStaging = plugin_basename($plugin) !== plugin_basename($pluginFilePath);
31
  case 'activate-selected':
32
  case 'activate-multi':
33
  if (isset($_REQUEST['checked'])) {
34
+ $plugins = array_map('sanitize_text_field', (array)wp_unslash($_REQUEST['checked']));
35
 
36
  foreach ($plugins as $i => $plugin) {
37
  $isActivatingWpStaging = strpos($plugin, 'wp-staging.php') || strpos($plugin, 'wp-staging-pro.php');
vendor_wpstg/autoload/src.php CHANGED
@@ -884,6 +884,7 @@ return array(
884
  'WPStaging\\Framework\\Exceptions\\IOException' => $baseDir . '/Framework/Exceptions/IOException.php',
885
  'WPStaging\\Framework\\Exceptions\\LabelOutOfBoundsException' => $baseDir . '/Framework/Exceptions/LabelOutOfBoundsException.php',
886
  'WPStaging\\Framework\\Exceptions\\WPStagingException' => $baseDir . '/Framework/Exceptions/WPStagingException.php',
 
887
  'WPStaging\\Framework\\Facades\\Facade' => $baseDir . '/Framework/Facades/Facade.php',
888
  'WPStaging\\Framework\\Facades\\Sanitize' => $baseDir . '/Framework/Facades/Sanitize.php',
889
  'WPStaging\\Framework\\Filesystem\\DebugLogReader' => $baseDir . '/Framework/Filesystem/DebugLogReader.php',
@@ -957,6 +958,7 @@ return array(
957
  'WPStaging\\Framework\\Utils\\Cache\\AbstractCache' => $baseDir . '/Framework/Utils/Cache/AbstractCache.php',
958
  'WPStaging\\Framework\\Utils\\Cache\\BufferedCache' => $baseDir . '/Framework/Utils/Cache/BufferedCache.php',
959
  'WPStaging\\Framework\\Utils\\Cache\\Cache' => $baseDir . '/Framework/Utils/Cache/Cache.php',
 
960
  'WPStaging\\Framework\\Utils\\Math' => $baseDir . '/Framework/Utils/Math.php',
961
  'WPStaging\\Framework\\Utils\\Sanitize' => $baseDir . '/Framework/Utils/Sanitize.php',
962
  'WPStaging\\Framework\\Utils\\SlashMode' => $baseDir . '/Framework/Utils/SlashMode.php',
884
  'WPStaging\\Framework\\Exceptions\\IOException' => $baseDir . '/Framework/Exceptions/IOException.php',
885
  'WPStaging\\Framework\\Exceptions\\LabelOutOfBoundsException' => $baseDir . '/Framework/Exceptions/LabelOutOfBoundsException.php',
886
  'WPStaging\\Framework\\Exceptions\\WPStagingException' => $baseDir . '/Framework/Exceptions/WPStagingException.php',
887
+ 'WPStaging\\Framework\\Facades\\Escape' => $baseDir . '/Framework/Facades/Escape.php',
888
  'WPStaging\\Framework\\Facades\\Facade' => $baseDir . '/Framework/Facades/Facade.php',
889
  'WPStaging\\Framework\\Facades\\Sanitize' => $baseDir . '/Framework/Facades/Sanitize.php',
890
  'WPStaging\\Framework\\Filesystem\\DebugLogReader' => $baseDir . '/Framework/Filesystem/DebugLogReader.php',
958
  'WPStaging\\Framework\\Utils\\Cache\\AbstractCache' => $baseDir . '/Framework/Utils/Cache/AbstractCache.php',
959
  'WPStaging\\Framework\\Utils\\Cache\\BufferedCache' => $baseDir . '/Framework/Utils/Cache/BufferedCache.php',
960
  'WPStaging\\Framework\\Utils\\Cache\\Cache' => $baseDir . '/Framework/Utils/Cache/Cache.php',
961
+ 'WPStaging\\Framework\\Utils\\Escape' => $baseDir . '/Framework/Utils/Escape.php',
962
  'WPStaging\\Framework\\Utils\\Math' => $baseDir . '/Framework/Utils/Math.php',
963
  'WPStaging\\Framework\\Utils\\Sanitize' => $baseDir . '/Framework/Utils/Sanitize.php',
964
  'WPStaging\\Framework\\Utils\\SlashMode' => $baseDir . '/Framework/Utils/SlashMode.php',
wp-staging.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Backup Duplicator & Migration - WP STAGING
5
  * Plugin URI: https://wordpress.org/plugins/wp-staging
6
  * Description: Backup & Duplicator Plugin - Clone, backup, move, duplicate & migrate websites to staging, backup, and development sites for authorized users only.
7
- * Version: 2.9.18
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.19
8
  * Requires at least: 3.6+
9
  * Requires PHP: 5.6
10
  * Author: WP-STAGING, WPStagingBackup