Duplicator – WordPress Migration Plugin - Version 1.3.8

Version Description

Download this release

Release Info

Developer cory@lamle.org
Plugin Icon 128x128 Duplicator – WordPress Migration Plugin
Version 1.3.8
Comparing to
See all releases

Code changes from version 1.3.6 to 1.3.8

define.php CHANGED
@@ -2,8 +2,8 @@
2
  //Prevent directly browsing to the file
3
  if (function_exists('plugin_dir_url'))
4
  {
5
- define('DUPLICATOR_VERSION', '1.3.6');
6
- define('DUPLICATOR_VERSION_BUILD', '2019-02-20_8:40');
7
  define('DUPLICATOR_PLUGIN_URL', plugin_dir_url(__FILE__));
8
  define('DUPLICATOR_SITE_URL', get_site_url());
9
 
2
  //Prevent directly browsing to the file
3
  if (function_exists('plugin_dir_url'))
4
  {
5
+ define('DUPLICATOR_VERSION', '1.3.8');
6
+ define('DUPLICATOR_VERSION_BUILD', '2019-02-22_12:20');
7
  define('DUPLICATOR_PLUGIN_URL', plugin_dir_url(__FILE__));
8
  define('DUPLICATOR_SITE_URL', get_site_url());
9
 
duplicator.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Duplicator
4
  Plugin URI: https://snapcreek.com/duplicator/duplicator-free/
5
  Description: Migrate and backup a copy of your WordPress files and database. Duplicate and move a site from one location to another quickly.
6
- Version: 1.3.6
7
  Author: Snap Creek
8
  Author URI: http://www.snapcreek.com/duplicator/
9
  Text Domain: duplicator
3
  Plugin Name: Duplicator
4
  Plugin URI: https://snapcreek.com/duplicator/duplicator-free/
5
  Description: Migrate and backup a copy of your WordPress files and database. Duplicate and move a site from one location to another quickly.
6
+ Version: 1.3.8
7
  Author: Snap Creek
8
  Author URI: http://www.snapcreek.com/duplicator/
9
  Text Domain: duplicator
installer/dup-installer/classes/class.csrf.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
  class DUPX_CSRF {
3
 
4
  /** Session var name
1
  <?php
2
+ defined("ABSPATH") or die("");
3
+
4
  class DUPX_CSRF {
5
 
6
  /** Session var name
installer/dup-installer/ctrls/ctrl.s2.base.php CHANGED
@@ -21,7 +21,7 @@ if (isset($_POST['dbname'])) {
21
  }
22
 
23
  $_POST['dbuser'] = isset($_POST['dbuser']) ? DUPX_U::sanitize_text_field($_POST['dbuser']) : null;
24
- $_POST['dbpass'] = isset($_POST['dbpass']) ? trim(DUPX_U::wp_unslash($_POST['dbpass'])) : null;
25
 
26
  if (isset($_POST['dbhost'])) {
27
  $post_db_host = DUPX_U::sanitize_text_field($_POST['dbhost']);
@@ -74,7 +74,7 @@ $dbTestIn->mode = DUPX_U::sanitize_text_field($_POST['view_mode']);
74
  $dbTestIn->dbaction = DUPX_U::sanitize_text_field($_POST['dbaction']);
75
  $dbTestIn->dbhost = DUPX_U::sanitize_text_field($_POST['dbhost']);
76
  $dbTestIn->dbuser = DUPX_U::sanitize_text_field($_POST['dbuser']);
77
- $dbTestIn->dbpass = trim(DUPX_U::wp_unslash($_POST['dbpass']));
78
  $dbTestIn->dbname = DUPX_U::sanitize_text_field($_POST['dbname']);
79
  $dbTestIn->dbport = DUPX_U::sanitize_text_field($_POST['dbport']);
80
  $dbTestIn->dbcollatefb = DUPX_U::sanitize_text_field($_POST['dbcollatefb']);
21
  }
22
 
23
  $_POST['dbuser'] = isset($_POST['dbuser']) ? DUPX_U::sanitize_text_field($_POST['dbuser']) : null;
24
+ $_POST['dbpass'] = isset($_POST['dbpass']) ? trim($_POST['dbpass']) : null;
25
 
26
  if (isset($_POST['dbhost'])) {
27
  $post_db_host = DUPX_U::sanitize_text_field($_POST['dbhost']);
74
  $dbTestIn->dbaction = DUPX_U::sanitize_text_field($_POST['dbaction']);
75
  $dbTestIn->dbhost = DUPX_U::sanitize_text_field($_POST['dbhost']);
76
  $dbTestIn->dbuser = DUPX_U::sanitize_text_field($_POST['dbuser']);
77
+ $dbTestIn->dbpass = trim($_POST['dbpass']);
78
  $dbTestIn->dbname = DUPX_U::sanitize_text_field($_POST['dbname']);
79
  $dbTestIn->dbport = DUPX_U::sanitize_text_field($_POST['dbport']);
80
  $dbTestIn->dbcollatefb = DUPX_U::sanitize_text_field($_POST['dbcollatefb']);
installer/dup-installer/ctrls/ctrl.s3.php CHANGED
@@ -41,7 +41,7 @@ $_POST['exe_safe_mode'] = isset($_POST['exe_safe_mode']) ? $_POST['exe_safe_mode
41
  $_POST['config_mode'] = (isset($_POST['config_mode'])) ? $_POST['config_mode'] : 'NEW';
42
 
43
  //MYSQL CONNECTION
44
- $dbh = DUPX_DB::connect($_POST['dbhost'], $_POST['dbuser'], html_entity_decode($_POST['dbpass']), $_POST['dbname']);
45
  $dbConnError = (mysqli_connect_error()) ? 'Error: '.mysqli_connect_error() : 'Unable to Connect';
46
 
47
  if (!$dbh) {
@@ -435,7 +435,7 @@ if (file_exists($wpconfig_ark_path)) {
435
  $db_host = isset($_POST['dbhost']) ? DUPX_U::sanitize_text_field($_POST['dbhost']) : '';
436
  $db_name = isset($_POST['dbname']) ? DUPX_U::sanitize_text_field($_POST['dbname']) : '';
437
  $db_user = isset($_POST['dbuser']) ? DUPX_U::sanitize_text_field($_POST['dbuser']) : '';
438
- $db_pass = isset($_POST['dbpass']) ? trim(DUPX_U::wp_unslash($_POST['dbpass'])) : '';
439
 
440
  $config_transformer->update('constant', 'DB_NAME', $db_name);
441
  $config_transformer->update('constant', 'DB_USER', $db_user);
41
  $_POST['config_mode'] = (isset($_POST['config_mode'])) ? $_POST['config_mode'] : 'NEW';
42
 
43
  //MYSQL CONNECTION
44
+ $dbh = DUPX_DB::connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname']);
45
  $dbConnError = (mysqli_connect_error()) ? 'Error: '.mysqli_connect_error() : 'Unable to Connect';
46
 
47
  if (!$dbh) {
435
  $db_host = isset($_POST['dbhost']) ? DUPX_U::sanitize_text_field($_POST['dbhost']) : '';
436
  $db_name = isset($_POST['dbname']) ? DUPX_U::sanitize_text_field($_POST['dbname']) : '';
437
  $db_user = isset($_POST['dbuser']) ? DUPX_U::sanitize_text_field($_POST['dbuser']) : '';
438
+ $db_pass = isset($_POST['dbpass']) ? trim($_POST['dbpass']) : '';
439
 
440
  $config_transformer->update('constant', 'DB_NAME', $db_name);
441
  $config_transformer->update('constant', 'DB_USER', $db_user);
installer/dup-installer/main.installer.php CHANGED
@@ -48,6 +48,7 @@ try {
48
  $GLOBALS['DUPX_ROOT'] = str_replace("\\", '/', (realpath(dirname(__FILE__) . '/..')));
49
  $GLOBALS['DUPX_INIT'] = "{$GLOBALS['DUPX_ROOT']}/dup-installer";
50
  $GLOBALS['DUPX_ENFORCE_PHP_INI'] = false;
 
51
 
52
  // ?view=help
53
  if (!empty($_GET['view']) && 'help' == $_GET['view']) {
@@ -59,6 +60,15 @@ try {
59
  // RSR TODO: Fail gracefully
60
  die("Bootloader parameter not specified");
61
  }
 
 
 
 
 
 
 
 
 
62
  } else {
63
  if (!isset($_POST['archive'])) {
64
  if (isset($_COOKIE['archive'])) {
@@ -83,7 +93,6 @@ try {
83
  require_once($GLOBALS['DUPX_INIT'].'/classes/config/class.archive.config.php');
84
  require_once($GLOBALS['DUPX_INIT'].'/classes/class.installer.state.php');
85
  require_once($GLOBALS['DUPX_INIT'].'/classes/class.password.php');
86
- require_once($GLOBALS['DUPX_INIT'].'/classes/class.csrf.php');
87
 
88
  $GLOBALS['DUPX_AC'] = DUPX_ArchiveConfig::getInstance();
89
  if ($GLOBALS['DUPX_AC'] == null) {
48
  $GLOBALS['DUPX_ROOT'] = str_replace("\\", '/', (realpath(dirname(__FILE__) . '/..')));
49
  $GLOBALS['DUPX_INIT'] = "{$GLOBALS['DUPX_ROOT']}/dup-installer";
50
  $GLOBALS['DUPX_ENFORCE_PHP_INI'] = false;
51
+ require_once($GLOBALS['DUPX_INIT'].'/classes/class.csrf.php');
52
 
53
  // ?view=help
54
  if (!empty($_GET['view']) && 'help' == $_GET['view']) {
60
  // RSR TODO: Fail gracefully
61
  die("Bootloader parameter not specified");
62
  }
63
+ } else if (isset($_GET['is_daws']) && 1 == $_GET['is_daws']) { // For daws action
64
+ $post_ctrl_csrf_token = isset($_GET['daws_csrf_token']) ? $_GET['daws_csrf_token'] : '';
65
+ if (DUPX_CSRF::check($post_ctrl_csrf_token, 'daws')) {
66
+ require_once($GLOBALS['DUPX_INIT'].'/lib/dup_archive/daws/daws.php');
67
+ die();
68
+ } else {
69
+ die("An invalid request was made to 'daws'. In order to protect this request from unauthorized access please "
70
+ . "<a href='../{$GLOBALS['BOOTLOADER_NAME']}'>restart this install process</a>.");
71
+ }
72
  } else {
73
  if (!isset($_POST['archive'])) {
74
  if (isset($_COOKIE['archive'])) {
93
  require_once($GLOBALS['DUPX_INIT'].'/classes/config/class.archive.config.php');
94
  require_once($GLOBALS['DUPX_INIT'].'/classes/class.installer.state.php');
95
  require_once($GLOBALS['DUPX_INIT'].'/classes/class.password.php');
 
96
 
97
  $GLOBALS['DUPX_AC'] = DUPX_ArchiveConfig::getInstance();
98
  if ($GLOBALS['DUPX_AC'] == null) {
installer/dup-installer/views/view.s1.base.php CHANGED
@@ -909,7 +909,6 @@ DUPX.pingDAWS = function ()
909
  }
910
 
911
  console.log("pingDAWS:action=" + request.action);
912
- console.log("daws url=" + DUPX.DAWS.Url);
913
 
914
  $.ajax({
915
  type: "POST",
@@ -1349,15 +1348,9 @@ DUPX.onSafeModeSwitch = function ()
1349
  };
1350
 
1351
  //DOCUMENT LOAD
1352
- $(document).ready(function ()
1353
- {
1354
- DUPX.FILEOPS = new Object();
1355
-
1356
- DUPX.FILEOPS.url = document.URL.substr(0, document.URL.lastIndexOf('/')) + '/lib/fileops/fileops.php';
1357
- DUPX.FILEOPS.standardTimeoutInSec = 25;
1358
-
1359
  DUPX.DAWS = new Object();
1360
- DUPX.DAWS.Url = document.URL.substr(0,document.URL.lastIndexOf('/')) + '/lib/dup_archive/daws/daws.php';
1361
  DUPX.DAWS.StatusPeriodInMS = 5000;
1362
  DUPX.DAWS.PingWorkerTimeInSec = 9;
1363
  DUPX.DAWS.KickoffWorkerTimeInSec = 6; // Want the initial progress % to come back quicker
909
  }
910
 
911
  console.log("pingDAWS:action=" + request.action);
 
912
 
913
  $.ajax({
914
  type: "POST",
1348
  };
1349
 
1350
  //DOCUMENT LOAD
1351
+ $(document).ready(function() {
 
 
 
 
 
 
1352
  DUPX.DAWS = new Object();
1353
+ DUPX.DAWS.Url = window.location.href + '?is_daws=1&daws_csrf_token=<?php echo DUPX_CSRF::generate('daws');?>';
1354
  DUPX.DAWS.StatusPeriodInMS = 5000;
1355
  DUPX.DAWS.PingWorkerTimeInSec = 9;
1356
  DUPX.DAWS.KickoffWorkerTimeInSec = 6; // Want the initial progress % to come back quicker
installer/dup-installer/views/view.s3.php CHANGED
@@ -28,8 +28,7 @@ defined("ABSPATH") or die("");
28
  }
29
 
30
  if (isset($_POST['dbpass'])) {
31
- $post_db_pass = DUPX_U::wp_unslash($_POST['dbpass']);
32
- $_POST['dbpass'] = trim($post_db_pass);
33
  } else {
34
  $_POST['dbpass'] = null;
35
  }
28
  }
29
 
30
  if (isset($_POST['dbpass'])) {
31
+ $_POST['dbpass'] = trim($_POST['dbpass']);
 
32
  } else {
33
  $_POST['dbpass'] = null;
34
  }
lib/dup_archive/daws/daws.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /** Absolute path to the DAWS directory. - necessary for php protection */
3
  if ( !defined('ABSPATH') )
4
  define('ABSPATH', dirname(__FILE__) . '/');
1
  <?php
2
+ defined("ABSPATH") or die("");
3
  /** Absolute path to the DAWS directory. - necessary for php protection */
4
  if ( !defined('ABSPATH') )
5
  define('ABSPATH', dirname(__FILE__) . '/');
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: corylamleorg, bobriley
3
  Tags: migration, backup, restore, move, migrate, duplicate, transfer, clone, automate, copy site
4
  Requires at least: 4.0
5
- Tested up to: 5.0
6
  Requires PHP: 5.2.17
7
- Stable tag: 1.3.6
8
  License: GPLv2
9
 
10
  WordPress migration and backups are much easier with Duplicator! Clone, backup, move and transfer an entire site from one location to another.
2
  Contributors: corylamleorg, bobriley
3
  Tags: migration, backup, restore, move, migrate, duplicate, transfer, clone, automate, copy site
4
  Requires at least: 4.0
5
+ Tested up to: 5.1
6
  Requires PHP: 5.2.17
7
+ Stable tag: 1.3.8
8
  License: GPLv2
9
 
10
  WordPress migration and backups are much easier with Duplicator! Clone, backup, move and transfer an entire site from one location to another.
uninstall.php CHANGED
@@ -55,6 +55,10 @@ if (DUP_Settings::Get('uninstall_files')) {
55
  if (strstr($file, '.log'))
56
  @unlink("{$file}");
57
  }
 
 
 
 
58
 
59
  //Check for core files and only continue removing data if the snapshots directory
60
  //has not been edited by 3rd party sources, this helps to keep the system stable
55
  if (strstr($file, '.log'))
56
  @unlink("{$file}");
57
  }
58
+ foreach (glob("{$ssdir}/*.log1") as $file) {
59
+ if (strstr($file, '.log1'))
60
+ @unlink("{$file}");
61
+ }
62
 
63
  //Check for core files and only continue removing data if the snapshots directory
64
  //has not been edited by 3rd party sources, this helps to keep the system stable
views/packages/main/packages.php CHANGED
@@ -57,7 +57,8 @@
57
 
58
  /* Building package */
59
 
60
- .dup-pack-info .building-info {display: none;}
 
61
  .dup-pack-info.is-running .building-info {display: inline;}
62
  .dup-pack-info.is-running .get-btns button {display: none;}
63
 
@@ -225,8 +226,13 @@ TOOL-BAR -->
225
  </td>
226
  <td class="pack-size"><?php echo DUP_Util::byteSize($pack_archive_size); ?></td>
227
  <td class='pack-name'>
228
- <?php echo ($pack_dbonly) ? "{$pack_name} <sup title='".esc_attr($txt_dbonly)."'>DB</sup>" : esc_html($pack_name); ?>
229
- <span class="building-info" ><i class="fa fa-gear fa-spin"></i> <b>Building Package</b> <span class="perc"><?php echo $pack_perc; ?></span>%</span>
 
 
 
 
 
230
  </td>
231
  <td class="get-btns">
232
  <button id="<?php echo esc_attr("{$uniqueid}_installer.php"); ?>" class="button no-select" onclick="Duplicator.Pack.DownloadPackageFile(0, <?php echo absint($Package->ID); ?>); return false;">
57
 
58
  /* Building package */
59
 
60
+ .dup-pack-info .building-info {display: none; color: #2C8021; font-style: italic}
61
+ .dup-pack-info .building-info .perc {font-weight: bold}
62
  .dup-pack-info.is-running .building-info {display: inline;}
63
  .dup-pack-info.is-running .get-btns button {display: none;}
64
 
226
  </td>
227
  <td class="pack-size"><?php echo DUP_Util::byteSize($pack_archive_size); ?></td>
228
  <td class='pack-name'>
229
+ <?php echo ($pack_dbonly) ? "{$pack_name} <sup title='".esc_attr($txt_dbonly)."'>DB</sup>" : esc_html($pack_name); ?><br/>
230
+ <span class="building-info" >
231
+ <i class="fa fa-gear fa-spin"></i> <b>Building Package</b> <span class="perc"><?php echo $pack_perc; ?></span>%
232
+ &nbsp; <i class="fa fa-question-circle" style="color:#2C8021"
233
+ data-tooltip-title="<?php esc_attr_e("Package Build Running", 'duplicator'); ?>"
234
+ data-tooltip="<?php esc_attr_e('To stop or reset this package build goto Settings > Advanced > Reset Packages', 'duplicator'); ?>"></i>
235
+ </span>
236
  </td>
237
  <td class="get-btns">
238
  <button id="<?php echo esc_attr("{$uniqueid}_installer.php"); ?>" class="button no-select" onclick="Duplicator.Pack.DownloadPackageFile(0, <?php echo absint($Package->ID); ?>); return false;">