Duplicator – WordPress Migration Plugin - Version 1.2.24

Version Description

Download this release

Release Info

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

Code changes from version 1.2.22 to 1.2.24

classes/package/class.pack.php CHANGED
@@ -319,20 +319,20 @@ class DUP_Package
319
  $this->Hash = $this->makeHash();
320
  $this->NameHash = "{$this->Name}_{$this->Hash}";
321
 
322
- $this->Notes = esc_html(sanitize_textarea_field($post['package-notes']));
323
  //ARCHIVE
324
  $this->Archive->PackDir = rtrim(DUPLICATOR_WPROOTPATH, '/');
325
  $this->Archive->Format = 'ZIP';
326
  $this->Archive->FilterOn = isset($post['filter-on']) ? 1 : 0;
327
  $this->Archive->ExportOnlyDB = isset($post['export-onlydb']) ? 1 : 0;
328
- $this->Archive->FilterDirs = esc_html(sanitize_textarea_field($filter_dirs));
329
- $this->Archive->FilterFiles = esc_html(sanitize_textarea_field($filter_files));
330
- $this->Archive->FilterExts = str_replace(array('.', ' '), '', esc_html(sanitize_textarea_field($filter_exts)));
331
  //INSTALLER
332
- $this->Installer->OptsDBHost = esc_html(sanitize_text_field($post['dbhost']));
333
- $this->Installer->OptsDBPort = esc_html(sanitize_text_field($post['dbport']));
334
- $this->Installer->OptsDBName = esc_html(sanitize_text_field($post['dbname']));
335
- $this->Installer->OptsDBUser = esc_html(sanitize_text_field($post['dbuser']));
336
  //DATABASE
337
  $this->Database->FilterOn = isset($post['dbfilter-on']) ? 1 : 0;
338
  $this->Database->FilterTables = esc_html($tablelist);
319
  $this->Hash = $this->makeHash();
320
  $this->NameHash = "{$this->Name}_{$this->Hash}";
321
 
322
+ $this->Notes = DUP_Util::escSanitizeTextAreaField($post['package-notes']);
323
  //ARCHIVE
324
  $this->Archive->PackDir = rtrim(DUPLICATOR_WPROOTPATH, '/');
325
  $this->Archive->Format = 'ZIP';
326
  $this->Archive->FilterOn = isset($post['filter-on']) ? 1 : 0;
327
  $this->Archive->ExportOnlyDB = isset($post['export-onlydb']) ? 1 : 0;
328
+ $this->Archive->FilterDirs = DUP_Util::escSanitizeTextAreaField($filter_dirs);
329
+ $this->Archive->FilterFiles = DUP_Util::escSanitizeTextAreaField($filter_files);
330
+ $this->Archive->FilterExts = str_replace(array('.', ' '), '', DUP_Util::escSanitizeTextAreaField($filter_exts));
331
  //INSTALLER
332
+ $this->Installer->OptsDBHost = DUP_Util::escSanitizeTextField($post['dbhost']);
333
+ $this->Installer->OptsDBPort = DUP_Util::escSanitizeTextField($post['dbport']);
334
+ $this->Installer->OptsDBName = DUP_Util::escSanitizeTextField($post['dbname']);
335
+ $this->Installer->OptsDBUser = DUP_Util::escSanitizeTextField($post['dbuser']);
336
  //DATABASE
337
  $this->Database->FilterOn = isset($post['dbfilter-on']) ? 1 : 0;
338
  $this->Database->FilterTables = esc_html($tablelist);
classes/utilities/class.u.php CHANGED
@@ -628,6 +628,33 @@ class DUP_Util
628
  "{$wpdb->prefix}usermeta",
629
  "{$wpdb->prefix}users");
630
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
631
  }
632
- DUP_Util::init();
633
- ?>
628
  "{$wpdb->prefix}usermeta",
629
  "{$wpdb->prefix}users");
630
  }
631
+
632
+ /**
633
+ * Runs esc_html and sanitize_textarea_field on a string
634
+ *
635
+ * @param string The string to process
636
+ *
637
+ * @return string Returns and escaped and sanitized string
638
+ */
639
+ public static function escSanitizeTextAreaField($string)
640
+ {
641
+ if (!function_exists('sanitize_textarea_field')) {
642
+ return esc_html(sanitize_text_field($string));
643
+ } else {
644
+ return esc_html(sanitize_textarea_field($string));
645
+ }
646
+ }
647
+
648
+ /**
649
+ * Runs esc_html and sanitize_text_field on a string
650
+ *
651
+ * @param string The string to process
652
+ *
653
+ * @return string Returns and escaped and sanitized string
654
+ */
655
+ public static function escSanitizeTextField($string)
656
+ {
657
+ return esc_html(sanitize_text_field($string));
658
+ }
659
  }
660
+ DUP_Util::init();
 
define.php CHANGED
@@ -2,7 +2,7 @@
2
  //Prevent directly browsing to the file
3
  if (function_exists('plugin_dir_url'))
4
  {
5
- define('DUPLICATOR_VERSION', '1.2.22');
6
  define('DUPLICATOR_HOMEPAGE', 'http://lifeinthegrid.com/labs/duplicator');
7
  define('DUPLICATOR_PLUGIN_URL', plugin_dir_url(__FILE__));
8
  define('DUPLICATOR_SITE_URL', get_site_url());
2
  //Prevent directly browsing to the file
3
  if (function_exists('plugin_dir_url'))
4
  {
5
+ define('DUPLICATOR_VERSION', '1.2.24');
6
  define('DUPLICATOR_HOMEPAGE', 'http://lifeinthegrid.com/labs/duplicator');
7
  define('DUPLICATOR_PLUGIN_URL', plugin_dir_url(__FILE__));
8
  define('DUPLICATOR_SITE_URL', get_site_url());
duplicator.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Duplicator
4
  Plugin URI: http://www.lifeinthegrid.com/duplicator/
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.2.22
7
  Author: Snap Creek
8
  Author URI: http://www.snapcreek.com/duplicator/
9
  Text Domain: duplicator
3
  Plugin Name: Duplicator
4
  Plugin URI: http://www.lifeinthegrid.com/duplicator/
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.2.24
7
  Author: Snap Creek
8
  Author URI: http://www.snapcreek.com/duplicator/
9
  Text Domain: duplicator
installer/build/ctrls/ctrl.step3.php CHANGED
@@ -107,51 +107,44 @@ array_push($GLOBALS['REPLACE_LIST'],
107
  );
108
 
109
 
110
- //URL PATHS
111
- //SEARCH ONLY HTTP(S)
112
- array_push($GLOBALS['REPLACE_LIST'],
113
- array('search' => $_POST['url_old'], 'replace' => $_POST['url_new']),
114
- array('search' => $url_old_json, 'replace' => $url_new_json),
115
- array('search' => urlencode($_POST['url_old']), 'replace' => urlencode($_POST['url_new']))
116
- );
117
-
118
- //INVERSE: Apply a search for the inverse of the orginal http vs https
119
- if (stristr($_POST['url_old'], 'http:')) {
120
- //Search for https urls
121
- $url_old_diff = str_ireplace('http:', 'https:', $_POST['url_old']);
122
- $url_new_diff = str_ireplace('http:', 'https:', $_POST['url_new']);
123
- $url_old_diff_json = str_replace('"', "", json_encode($url_old_diff));
124
- $url_new_diff_json = str_replace('"', "", json_encode($url_new_diff));
125
-
126
- } else {
127
- //Search for http urls
128
- $url_old_diff = str_ireplace('https:', 'http:', $_POST['url_old']);
129
- $url_new_diff = str_ireplace('https:', 'http:', $_POST['url_new']);
130
- $url_old_diff_json = str_replace('"', "", json_encode($url_old_diff));
131
- $url_new_diff_json = str_replace('"', "", json_encode($url_new_diff));
132
- }
133
-
134
- array_push($GLOBALS['REPLACE_LIST'],
135
- //INVERSE
136
- array('search' => $url_old_diff, 'replace' => $url_new_diff),
137
- array('search' => $url_old_diff_json, 'replace' => $url_new_diff_json),
138
- array('search' => urlencode($url_old_diff), 'replace' => urlencode($url_new_diff))
139
- );
140
-
141
-
142
  //SEARCH WITH NO PROTOCAL: RAW "//"
143
  $url_old_raw = str_ireplace(array('http://', 'https://'), '//', $_POST['url_old']);
144
  $url_new_raw = str_ireplace(array('http://', 'https://'), '//', $_POST['url_new']);
145
  $url_old_raw_json = str_replace('"', "", json_encode($url_old_raw));
146
  $url_new_raw_json = str_replace('"', "", json_encode($url_new_raw));
147
-
148
  array_push($GLOBALS['REPLACE_LIST'],
149
- //RAW
150
- array('search' => $url_old_raw, 'replace' => $url_new_raw),
151
- array('search' => $url_old_raw_json, 'replace' => $url_new_raw_json),
152
- array('search' => urlencode($url_old_raw), 'replace' => urlencode($url_new_raw))
153
- );
 
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
 
156
  //Remove trailing slashes
157
  function _dupx_array_rtrim(&$value) {
107
  );
108
 
109
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  //SEARCH WITH NO PROTOCAL: RAW "//"
111
  $url_old_raw = str_ireplace(array('http://', 'https://'), '//', $_POST['url_old']);
112
  $url_new_raw = str_ireplace(array('http://', 'https://'), '//', $_POST['url_new']);
113
  $url_old_raw_json = str_replace('"', "", json_encode($url_old_raw));
114
  $url_new_raw_json = str_replace('"', "", json_encode($url_new_raw));
 
115
  array_push($GLOBALS['REPLACE_LIST'],
116
+ //RAW
117
+ array('search' => $url_old_raw, 'replace' => $url_new_raw),
118
+ array('search' => $url_old_raw_json, 'replace' => $url_new_raw_json),
119
+ array('search' => urlencode($url_old_raw), 'replace' => urlencode($url_new_raw))
120
+ );
121
+
122
 
123
+ //SEARCH HTTP(S) EXPLICIT REQUEST
124
+ //Because the raw replace above has already changed all urls just fix https/http issue
125
+ //if the user has explicitly asked other-wise word boundary issues will occur:
126
+ //Old site: http://mydomain.com/somename/
127
+ //New site: http://mydomain.com/somename-dup/
128
+ //Result: http://mydomain.com/somename-dup-dup/
129
+ if (stristr($_POST['url_old'], 'http:') && stristr($_POST['url_new'], 'https:') ) {
130
+ $url_old_http = str_ireplace('https:', 'http:', $_POST['url_new']);
131
+ $url_new_http = $_POST['url_new'];
132
+ $url_old_http_json = str_replace('"', "", json_encode($url_old_http));
133
+ $url_new_http_json = str_replace('"', "", json_encode($url_new_http));
134
+
135
+ } elseif(stristr($_POST['url_old'], 'https:') && stristr($_POST['url_new'], 'http:')) {
136
+ $url_old_http = str_ireplace('http:', 'https:', $_POST['url_new']);
137
+ $url_new_http = $_POST['url_new'];
138
+ $url_old_http_json = str_replace('"', "", json_encode($url_old_http));
139
+ $url_new_http_json = str_replace('"', "", json_encode($url_new_http));
140
+ }
141
+ if(isset($url_old_http)){
142
+ array_push($GLOBALS['REPLACE_LIST'],
143
+ array('search' => $url_old_http, 'replace' => $url_new_http),
144
+ array('search' => $url_old_http_json, 'replace' => $url_new_http_json),
145
+ array('search' => urlencode($url_old_http), 'replace' => urlencode($url_new_http))
146
+ );
147
+ }
148
 
149
  //Remove trailing slashes
150
  function _dupx_array_rtrim(&$value) {
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: corylamleorg, bobriley
3
  Donate link: www.lifeinthegrid.com/partner
4
  Tags: migration, backup, restore, move, migrate, duplicate, transfer, clone, automate, copy site
5
- Requires at least: 4.0
6
  Tested up to: 4.8
7
- Stable tag: 1.2.22
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
  Donate link: www.lifeinthegrid.com/partner
4
  Tags: migration, backup, restore, move, migrate, duplicate, transfer, clone, automate, copy site
5
+ Requires at least: 4.5
6
  Tested up to: 4.8
7
+ Stable tag: 1.2.24
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.
views/packages/main/s1.setup2.php CHANGED
@@ -50,7 +50,7 @@
50
 
51
  <form id="dup-form-opts" method="post" action="?page=duplicator&tab=new2<?php echo $retry_enabled ? '&retry=1' : '';?>" data-validate="parsley">
52
  <input type="hidden" id="dup-form-opts-action" name="action" value="">
53
- <?php wp_nonce_field('dup_form_opts', 'dup_form_opts_nonce_field'); ?>
54
 
55
  <div>
56
  <label for="package-name" class="lbl-larger"><b>&nbsp;<?php _e('Name', 'duplicator') ?>:</b> </label>
50
 
51
  <form id="dup-form-opts" method="post" action="?page=duplicator&tab=new2<?php echo $retry_enabled ? '&retry=1' : '';?>" data-validate="parsley">
52
  <input type="hidden" id="dup-form-opts-action" name="action" value="">
53
+ <?php wp_nonce_field('dup_form_opts', 'dup_form_opts_nonce_field', false); ?>
54
 
55
  <div>
56
  <label for="package-name" class="lbl-larger"><b>&nbsp;<?php _e('Name', 'duplicator') ?>:</b> </label>
views/packages/main/s2.scan1.php CHANGED
@@ -148,7 +148,7 @@ TOOL BAR:STEPS -->
148
 
149
 
150
  <form id="form-duplicator" method="post" action="?page=duplicator&tab=new3">
151
- <?php wp_nonce_field('dup_form_opts', 'dup_form_opts_nonce_field'); ?>
152
 
153
  <!-- PROGRESS BAR -->
154
  <div id="dup-progress-bar-area">
148
 
149
 
150
  <form id="form-duplicator" method="post" action="?page=duplicator&tab=new3">
151
+ <?php wp_nonce_field('dup_form_opts', 'dup_form_opts_nonce_field', false); ?>
152
 
153
  <!-- PROGRESS BAR -->
154
  <div id="dup-progress-bar-area">
views/packages/main/s3.build.php CHANGED
@@ -84,7 +84,7 @@ TOOL BAR: STEPS -->
84
 
85
 
86
  <form id="form-duplicator" method="post" action="?page=duplicator">
87
- <?php wp_nonce_field('dup_form_opts', 'dup_form_opts_nonce_field'); ?>
88
 
89
  <!-- PROGRESS BAR -->
90
  <div id="dup-progress-bar-area">
84
 
85
 
86
  <form id="form-duplicator" method="post" action="?page=duplicator">
87
+ <?php wp_nonce_field('dup_form_opts', 'dup_form_opts_nonce_field', false); ?>
88
 
89
  <!-- PROGRESS BAR -->
90
  <div id="dup-progress-bar-area">
views/settings/general.php CHANGED
@@ -45,7 +45,7 @@ $package_debug = DUP_Settings::Get('package_debug');
45
 
46
  <form id="dup-settings-form" action="<?php echo admin_url('admin.php?page=duplicator-settings&tab=general'); ?>" method="post">
47
 
48
- <?php wp_nonce_field('dup_settings_save', 'dup_settings_save_nonce_field'); ?>
49
  <input type="hidden" name="action" value="save">
50
  <input type="hidden" name="page" value="duplicator-settings">
51
 
45
 
46
  <form id="dup-settings-form" action="<?php echo admin_url('admin.php?page=duplicator-settings&tab=general'); ?>" method="post">
47
 
48
+ <?php wp_nonce_field('dup_settings_save', 'dup_settings_save_nonce_field', false); ?>
49
  <input type="hidden" name="action" value="save">
50
  <input type="hidden" name="page" value="duplicator-settings">
51
 
views/settings/packages.php CHANGED
@@ -51,7 +51,7 @@ $mysqlDumpFound = ($mysqlDumpPath) ? true : false;
51
  </style>
52
 
53
  <form id="dup-settings-form" action="<?php echo admin_url('admin.php?page=duplicator-settings&tab=package'); ?>" method="post">
54
- <?php wp_nonce_field('dup_settings_save', 'dup_settings_save_nonce_field'); ?>
55
  <input type="hidden" name="action" value="save">
56
  <input type="hidden" name="page" value="duplicator-settings">
57
 
51
  </style>
52
 
53
  <form id="dup-settings-form" action="<?php echo admin_url('admin.php?page=duplicator-settings&tab=package'); ?>" method="post">
54
+ <?php wp_nonce_field('dup_settings_save', 'dup_settings_save_nonce_field', false); ?>
55
  <input type="hidden" name="action" value="save">
56
  <input type="hidden" name="page" value="duplicator-settings">
57
 
views/tools/diagnostics/main.php CHANGED
@@ -51,7 +51,7 @@
51
  </style>
52
 
53
  <form id="dup-settings-form" action="<?php echo admin_url( 'admin.php?page=duplicator-tools&tab=diagnostics' ); ?>" method="post">
54
- <?php wp_nonce_field( 'duplicator_settings_page' ); ?>
55
  <input type="hidden" id="dup-settings-form-action" name="action" value="">
56
  <br/>
57
 
51
  </style>
52
 
53
  <form id="dup-settings-form" action="<?php echo admin_url( 'admin.php?page=duplicator-tools&tab=diagnostics' ); ?>" method="post">
54
+ <?php wp_nonce_field( 'duplicator_settings_page', '_wpnonce', false ); ?>
55
  <input type="hidden" id="dup-settings-form-action" name="action" value="">
56
  <br/>
57