Duplicator – WordPress Migration Plugin - Version 1.2.28

Version Description

Download this release

Release Info

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

Code changes from version 1.2.26 to 1.2.28

assets/css/style.css CHANGED
@@ -54,6 +54,7 @@ div#dup-global-error-reserved-files p {font-size:14px}
54
  div#dup-global-error-reserved-files b.pass-msg {color:green; font-size:20px}
55
  div#dup-global-error-reserved-files p.pass-lnks {line-height:24px; margin:-7px 0 0 5px}
56
  div#dup-global-error-reserved-files div.pass-msg {padding:5px 0 0 10px; font-size:11px; color:#999; font-style: italic}
 
57
 
58
  /*================================================
59
  PARSLEY:Overrides*/
@@ -64,3 +65,5 @@ input.parsley-error, textarea.parsley-error {
64
  }
65
  div.qtip-content {line-height:16px}
66
  ul.parsley-error-list {margin:1px 0px -7px 0px}
 
 
54
  div#dup-global-error-reserved-files b.pass-msg {color:green; font-size:20px}
55
  div#dup-global-error-reserved-files p.pass-lnks {line-height:24px; margin:-7px 0 0 5px}
56
  div#dup-global-error-reserved-files div.pass-msg {padding:5px 0 0 10px; font-size:11px; color:#999; font-style: italic}
57
+ div.dup-wpnotice-box {display:none;}
58
 
59
  /*================================================
60
  PARSLEY:Overrides*/
65
  }
66
  div.qtip-content {line-height:16px}
67
  ul.parsley-error-list {margin:1px 0px -7px 0px}
68
+ div.notice-safemode {color: maroon;}
69
+ div.cleanup-notice b.title {color: green;font-size: 20px;}
assets/js/javascript.php CHANGED
@@ -234,5 +234,8 @@ jQuery(document).ready(function($)
234
  Handlebars.registerHelper('if_neq', function(a, b, opts) { return (a != b) ? opts.fn(this) : opts.inverse(this);});
235
  }
236
 
 
 
 
237
  });
238
  </script>
234
  Handlebars.registerHelper('if_neq', function(a, b, opts) { return (a != b) ? opts.fn(this) : opts.inverse(this);});
235
  }
236
 
237
+ //Prevent notice boxes from flashing as its re-positioned in DOM
238
+ $('div.dup-wpnotice-box').show(300);
239
+
240
  });
241
  </script>
classes/class.db.php CHANGED
@@ -20,6 +20,15 @@ if (!defined('DUPLICATOR_VERSION')) {
20
  class DUP_DB extends wpdb
21
  {
22
 
 
 
 
 
 
 
 
 
 
23
  /**
24
  * Get the requested MySQL system variable
25
  *
@@ -126,4 +135,27 @@ class DUP_DB extends wpdb
126
  return false;
127
  }
128
 
129
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  class DUP_DB extends wpdb
21
  {
22
 
23
+ public static $remove_placeholder_escape_exists = null;
24
+
25
+ public static function init()
26
+ {
27
+ global $wpdb;
28
+
29
+ self::$remove_placeholder_escape_exists = method_exists($wpdb, 'remove_placeholder_escape');
30
+ }
31
+
32
  /**
33
  * Get the requested MySQL system variable
34
  *
135
  return false;
136
  }
137
 
138
+ /**
139
+ * Returns an escaped SQL string
140
+ *
141
+ * @param string $sql The SQL to escape
142
+ * @param bool $removePlaceholderEscape Patch for how the default WP function works.
143
+ *
144
+ * @return boolean|string
145
+ * @also see: https://make.wordpress.org/core/2017/10/31/changed-behaviour-of-esc_sql-in-wordpress-4-8-3/
146
+ */
147
+ public static function escSQL($sql, $removePlaceholderEscape = false)
148
+ {
149
+ global $wpdb;
150
+
151
+ $removePlaceholderEscape = $removePlaceholderEscape && self::$remove_placeholder_escape_exists;
152
+
153
+ if ($removePlaceholderEscape) {
154
+ return $wpdb->remove_placeholder_escape(@esc_sql($sql));
155
+ } else {
156
+ return @esc_sql($sql);
157
+ }
158
+ }
159
+ }
160
+
161
+ DUP_DB::init();
classes/class.server.php CHANGED
@@ -42,16 +42,11 @@ class DUP_Server
42
  $dup_tests['PHP']['ALL'] = !in_array('Fail', $dup_tests['PHP']) ? 'Pass' : 'Fail';
43
 
44
  //REQUIRED PATHS
45
- if (file_exists(DUPLICATOR_SSDIR_PATH) && is_writeable(DUPLICATOR_SSDIR_PATH)) {
46
- $dup_tests['IO']['SSDIR'] = 'Pass';
47
- $dup_tests['IO']['WPROOT'] = 'Pass';
48
- } else {
49
- $handle_test = @opendir(DUPLICATOR_WPROOTPATH);
50
- $dup_tests['IO']['WPROOT'] = is_writeable(DUPLICATOR_WPROOTPATH) && $handle_test ? 'Pass' : 'Fail';
51
- $dup_tests['IO']['SSDIR'] = 'Fail';
52
- @closedir($handle_test);
53
- }
54
 
 
55
  $dup_tests['IO']['SSTMP'] = is_writeable(DUPLICATOR_SSDIR_PATH_TMP) ? 'Pass' : 'Fail';
56
  $dup_tests['IO']['ALL'] = !in_array('Fail', $dup_tests['IO']) ? 'Pass' : 'Fail';
57
 
@@ -66,6 +61,8 @@ class DUP_Server
66
  && $dup_tests['IO']['ALL'] == 'Pass'
67
  && $dup_tests['SRV']['ALL'] == 'Pass'
68
  && $dup_tests['RES']['INSTALL'] == 'Pass';
 
 
69
 
70
  return $dup_tests;
71
  }
42
  $dup_tests['PHP']['ALL'] = !in_array('Fail', $dup_tests['PHP']) ? 'Pass' : 'Fail';
43
 
44
  //REQUIRED PATHS
45
+ $handle_test = @opendir(DUPLICATOR_WPROOTPATH);
46
+ $dup_tests['IO']['WPROOT'] = is_writeable(DUPLICATOR_WPROOTPATH) && $handle_test ? 'Pass' : 'Warn';
47
+ @closedir($handle_test);
 
 
 
 
 
 
48
 
49
+ $dup_tests['IO']['SSDIR'] = (file_exists(DUPLICATOR_SSDIR_PATH) && is_writeable(DUPLICATOR_SSDIR_PATH)) ? 'Pass' : 'Fail';
50
  $dup_tests['IO']['SSTMP'] = is_writeable(DUPLICATOR_SSDIR_PATH_TMP) ? 'Pass' : 'Fail';
51
  $dup_tests['IO']['ALL'] = !in_array('Fail', $dup_tests['IO']) ? 'Pass' : 'Fail';
52
 
61
  && $dup_tests['IO']['ALL'] == 'Pass'
62
  && $dup_tests['SRV']['ALL'] == 'Pass'
63
  && $dup_tests['RES']['INSTALL'] == 'Pass';
64
+
65
+ $dup_tests['Warning'] = $dup_tests['IO']['WPROOT'] == 'Warn';
66
 
67
  return $dup_tests;
68
  }
classes/package/class.pack.archive.php CHANGED
@@ -297,6 +297,7 @@ class DUP_Archive
297
  {
298
  $this->FilterInfo->Dirs->Warning = array();
299
  $this->FilterInfo->Dirs->Unreadable = array();
 
300
 
301
  $utf8_key_list = array();
302
  $unset_key_list = array();
@@ -327,6 +328,22 @@ class DUP_Archive
327
  $this->FilterInfo->Dirs->Warning[] = DUP_Encoding::toUTF8($val);
328
  }
329
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
330
  }
331
 
332
  //Try to repair utf8 paths
297
  {
298
  $this->FilterInfo->Dirs->Warning = array();
299
  $this->FilterInfo->Dirs->Unreadable = array();
300
+ $this->FilterInfo->Dirs->AddonSites = array();
301
 
302
  $utf8_key_list = array();
303
  $unset_key_list = array();
328
  $this->FilterInfo->Dirs->Warning[] = DUP_Encoding::toUTF8($val);
329
  }
330
 
331
+ //Check for other WordPress installs
332
+ if ($name === 'wp-admin') {
333
+ $parent_dir = realpath(dirname($this->Dirs[$key]));
334
+ if ($parent_dir != realpath(DUPLICATOR_WPROOTPATH)) {
335
+ if (file_exists("$parent_dir/wp-includes")) {
336
+ if (file_exists("$parent_dir/wp-config.php")) {
337
+ // Ensure we aren't adding any critical directories
338
+ $parent_name = basename($parent_dir);
339
+ if (($parent_name != 'wp-includes') && ($parent_name != 'wp-content') && ($parent_name != 'wp-admin')) {
340
+ $this->FilterInfo->Dirs->AddonSites[] = str_replace("\\", '/',$parent_dir);
341
+ }
342
+ }
343
+ }
344
+ }
345
+ }
346
+
347
  }
348
 
349
  //Try to repair utf8 paths
classes/package/class.pack.database.php CHANGED
@@ -353,7 +353,9 @@ class DUP_Database
353
  if (is_null($value) || !isset($value)) {
354
  ($num_values == $num_counter) ? $sql .= 'NULL' : $sql .= 'NULL, ';
355
  } else {
356
- ($num_values == $num_counter) ? $sql .= '"'.@esc_sql($value).'"' : $sql .= '"'.@esc_sql($value).'", ';
 
 
357
  }
358
  $num_counter++;
359
  }
353
  if (is_null($value) || !isset($value)) {
354
  ($num_values == $num_counter) ? $sql .= 'NULL' : $sql .= 'NULL, ';
355
  } else {
356
+ ($num_values == $num_counter)
357
+ ? $sql .= '"' . DUP_DB::escSQL($value, true) . '"'
358
+ : $sql .= '"' . DUP_DB::escSQL($value, true) . '", ';
359
  }
360
  $num_counter++;
361
  }
classes/package/class.pack.php CHANGED
@@ -122,6 +122,8 @@ class DUP_Package
122
  //$report['ARC']['Status']['Big'] = count($this->Archive->FilterInfo->Files->Size) ? 'Warn' : 'Good';
123
  $report['ARC']['Dirs'] = $this->Archive->Dirs;
124
  $report['ARC']['Files'] = $this->Archive->Files;
 
 
125
 
126
 
127
  //DATABASE
@@ -183,7 +185,7 @@ class DUP_Package
183
  $php_max_memory = ($php_max_memory === false) ? "Unabled to set php memory_limit" : DUPLICATOR_PHP_MAX_MEMORY." ({$php_max_memory} default)";
184
 
185
  $info = "********************************************************************************\n";
186
- $info .= "DUPLICATOR-LITE PACKAGE-LOG: ".@date("Y-m-d H:i:s")."\n";
187
  $info .= "NOTICE: Do NOT post to public sites or forums \n";
188
  $info .= "********************************************************************************\n";
189
  $info .= "VERSION:\t".DUPLICATOR_VERSION."\n";
@@ -268,7 +270,7 @@ class DUP_Package
268
  $info .= "RECORD ID:[{$this->ID}]\n";
269
  $info .= "TOTAL PROCESS RUNTIME: {$timerSum}\n";
270
  $info .= "PEAK PHP MEMORY USED: ".DUP_Server::getPHPMemory(true)."\n";
271
- $info .= "DONE PROCESSING => {$this->Name} ".@date("Y-m-d H:i:s")."\n";
272
 
273
  DUP_Log::Info($info);
274
  DUP_Log::Close();
122
  //$report['ARC']['Status']['Big'] = count($this->Archive->FilterInfo->Files->Size) ? 'Warn' : 'Good';
123
  $report['ARC']['Dirs'] = $this->Archive->Dirs;
124
  $report['ARC']['Files'] = $this->Archive->Files;
125
+ $report['ARC']['Status']['AddonSites'] = count($this->Archive->FilterInfo->Dirs->AddonSites) ? 'Warn' : 'Good';
126
+
127
 
128
 
129
  //DATABASE
185
  $php_max_memory = ($php_max_memory === false) ? "Unabled to set php memory_limit" : DUPLICATOR_PHP_MAX_MEMORY." ({$php_max_memory} default)";
186
 
187
  $info = "********************************************************************************\n";
188
+ $info .= "DUPLICATOR-LITE PACKAGE-LOG: ".@date(get_option('date_format')." ".get_option('time_format'))."\n";
189
  $info .= "NOTICE: Do NOT post to public sites or forums \n";
190
  $info .= "********************************************************************************\n";
191
  $info .= "VERSION:\t".DUPLICATOR_VERSION."\n";
270
  $info .= "RECORD ID:[{$this->ID}]\n";
271
  $info .= "TOTAL PROCESS RUNTIME: {$timerSum}\n";
272
  $info .= "PEAK PHP MEMORY USED: ".DUP_Server::getPHPMemory(true)."\n";
273
+ $info .= "DONE PROCESSING => {$this->Name} ".@date(get_option('date_format')." ".get_option('time_format'))."\n";
274
 
275
  DUP_Log::Info($info);
276
  DUP_Log::Close();
classes/ui/class.ui.notice.php CHANGED
@@ -36,41 +36,48 @@ class DUP_UI_Notice
36
  $screen = get_current_screen();
37
  if (!isset($screen))
38
  return;
39
-
40
  if (DUP_Server::hasInstallerFiles()) {
41
 
42
- $screen = get_current_screen();
43
- $on_active_tab = isset($_GET['tab']) && $_GET['tab'] == 'cleanup' ? true : false;
44
- $dup_nonce = wp_create_nonce('duplicator_cleanup_page');
45
- $msg1 = __('This site has been successfully migrated!', 'duplicator');
46
- $msg2 = __('Migration Almost Complete!', 'duplicator');
47
- $msg3 = __('Please complete these final steps:', 'duplicator');
48
- $msg4 = __('This message will be removed after all installer files are removed. Installer files must be removed to maintain a secure site.<br/>'
49
- . 'Click the link above or button below to remove all installer files and complete the migration.', 'duplicator');
50
 
51
- echo '<div class="updated notice" id="dup-global-error-reserved-files"><p>';
52
-
53
- //On Cleanup Page
54
- if ($screen->id == 'duplicator_page_duplicator-tools' && $on_active_tab) {
55
- echo "<b class='pass-msg'><i class='fa fa-check-circle'></i> {$msg1}</b> <br/>";
56
- echo "{$msg3}";
57
- echo '<p class="pass-lnks">';
58
- @printf("1. <a href='https://wordpress.org/support/plugin/duplicator/reviews/?filter=5' target='wporg'>%s</a> <br/> ", __('Optionally, Review Duplicator at WordPress.org...', 'duplicator'));
59
- @printf("2. <a href='javascript:void(0)' onclick='jQuery(\"#dup-remove-installer-files-btn\").click()'>%s</a><br/>", __('Remove Installation Files Now!', 'duplicator'));
60
- echo '</p>';
61
- echo "<div class='pass-msg'>{$msg4}</div>";
 
 
 
 
 
 
 
 
 
 
62
 
63
  //All other Pages
64
- } else {
65
- echo "<b>{$msg2}</b> <br/>";
66
- echo '<p class="pass-lnks">';
67
- _e('Reserved Duplicator installation still exist in the root directory. Please remove these installation files to complete setup and avoid security issues. <br/>', 'duplicator');
68
- _e('Go to: Duplicator > Tools > Cleanup > and click the "Remove Installation Files" button.', 'duplicator');
69
- @printf("<br/><a href='admin.php?page=duplicator-tools&tab=cleanup&_wpnonce={$dup_nonce}'>%s</a> <br/>", __('Take me there now!', 'duplicator'));
70
- echo '</p>';
71
- }
 
 
72
 
73
- echo "</p></div>";
 
74
  }
75
  }
76
 
@@ -82,9 +89,9 @@ class DUP_UI_Notice
82
  public static function redirect($location)
83
  {
84
  echo '<div class="dup-redirect"><i class="fa fa-circle-o-notch fa-spin fa-fw"></i>';
85
- _e('Redirecting Please Wait...', 'duplicator');
86
  echo '</div>';
87
  echo "<script>window.location = '{$location}';</script>";
88
- die(_e('Invalid token permissions to perform this request.', 'duplicator'));
89
  }
90
  }
36
  $screen = get_current_screen();
37
  if (!isset($screen))
38
  return;
39
+
40
  if (DUP_Server::hasInstallerFiles()) {
41
 
42
+ $on_active_tab = isset($_GET['section'])? $_GET['section']: '';
43
+ echo '<div class="updated notice-success" id="dup-global-error-reserved-files"><p>';
 
 
 
 
 
 
44
 
45
+ //Safe Mode Notice
46
+ $safe_html = '';
47
+ if(get_option("duplicator_exe_safe_mode", 0) > 0 ){
48
+ $safe_msg1 = __('Safe Mode:', 'duplicator');
49
+ $safe_msg2 = __('During the install safe mode was enabled deactivating all plugins.<br/> Please be sure to ', 'duplicator');
50
+ $safe_msg3 = __('re-activate the plugins', 'duplicator');
51
+ $safe_html = "<div class='notice-safemode'><b>{$safe_msg1}</b><br/>{$safe_msg2} <a href='plugins.php'>{$safe_msg3}</a>!</div><br/>";
52
+ }
53
+
54
+ //On Tools > Cleanup Page
55
+ if ($screen->id == 'duplicator_page_duplicator-tools' && ($on_active_tab == "info" || $on_active_tab == '') ) {
56
+
57
+ $title = __('This site has been successfully migrated!', 'duplicator');
58
+ $msg1 = __('Final step(s):', 'duplicator');
59
+ $msg2 = __('This message will be removed after all installer files are removed. Installer files must be removed to maintain a secure site.<br/>'
60
+ . 'Click the link above or button below to remove all installer files and complete the migration.', 'duplicator');
61
+
62
+ echo "<b class='pass-msg'><i class='fa fa-check-circle'></i> {$title}</b> <br/> {$safe_html} <b>{$msg1}</b> <br/>";
63
+ printf("1. <a href='https://wordpress.org/support/plugin/duplicator/reviews/?filter=5' target='wporg'>%s</a> <br/> ", __('Optionally, Review Duplicator at WordPress.org...', 'duplicator'));
64
+ printf("2. <a href='javascript:void(0)' onclick='jQuery(\"#dup-remove-installer-files-btn\").click()'>%s</a><br/>", __('Remove Installation Files Now!', 'duplicator'));
65
+ echo "<div class='pass-msg'>{$msg2}</div>";
66
 
67
  //All other Pages
68
+ } else {
69
+
70
+ $title = __('Migration Almost Complete!', 'duplicator');
71
+ $msg = __('Reserved Duplicator installation files have been detected in the root directory. Please delete these installation files to '
72
+ . 'avoid security issues. <br/> Go to:Duplicator > Tools > Information >Stored Data and click the "Remove Installation Files" button', 'duplicator');
73
+
74
+ $nonce = wp_create_nonce('duplicator_cleanup_page');
75
+ $url = self_admin_url('admin.php?page=duplicator-tools&tab=diagnostics&section=info&_wpnonce='.$nonce);
76
+ echo "<b>{$title}</b><br/> {$safe_html} {$msg}";
77
+ @printf("<br/><a href='{$url}'>%s</a>", __('Take me there now!', 'duplicator'));
78
 
79
+ }
80
+ echo "</p></div>";
81
  }
82
  }
83
 
89
  public static function redirect($location)
90
  {
91
  echo '<div class="dup-redirect"><i class="fa fa-circle-o-notch fa-spin fa-fw"></i>';
92
+ __('Redirecting Please Wait...', 'duplicator');
93
  echo '</div>';
94
  echo "<script>window.location = '{$location}';</script>";
95
+ die(__('Invalid token permissions to perform this request.', 'duplicator'));
96
  }
97
  }
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.26');
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.28');
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.26
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.28
7
  Author: Snap Creek
8
  Author URI: http://www.snapcreek.com/duplicator/
9
  Text Domain: duplicator
installer/build/assets/inc.css.php CHANGED
@@ -148,6 +148,8 @@
148
  table.s3-table-inputs td:first-child{font-weight: bold; width:125px}
149
  div#s3-adv-opts {margin-top:5px; }
150
  div.s3-allnonelinks {font-size:11px; float:right;}
 
 
151
 
152
  /* password indicator */
153
  .top_testresult{font-weight:bold; font-size:11px; color:#222; padding:1px 1px 1px 4px; margin:4px 0 0 0px; width:495px; dislay:inline-block}
@@ -177,8 +179,8 @@
177
  table.s4-final-step {width:100%;}
178
  table.s4-final-step td {padding:5px 15px 5px 5px}
179
  table.s4-final-step td:first-child {white-space:nowrap;}
180
- div.s4-go-back {border-top:1px solid #dfdfdf; margin:auto; font-style:italic; font-size:10px; color:#333}
181
- a.s4-final-btns {display: block; width:135; padding:5px; line-height: 1.4; background-color:#F1F1F1; border:1px solid silver;
182
  color: #000; box-shadow: 5px 5px 5px -5px #949494; text-decoration: none; text-align: center; border-radius: 4px;
183
  }
184
  a.s4-final-btns:hover {background-color: #dfdfdf;}
@@ -220,5 +222,7 @@
220
  <?php else : ?>
221
  .dupx-debug {display:none}
222
  <?php endif; ?>
 
 
223
 
224
  </style>
148
  table.s3-table-inputs td:first-child{font-weight: bold; width:125px}
149
  div#s3-adv-opts {margin-top:5px; }
150
  div.s3-allnonelinks {font-size:11px; float:right;}
151
+ select#plugins {width:330px; height:100px}
152
+ select#tables {width:330px; height:100px}
153
 
154
  /* password indicator */
155
  .top_testresult{font-weight:bold; font-size:11px; color:#222; padding:1px 1px 1px 4px; margin:4px 0 0 0px; width:495px; dislay:inline-block}
179
  table.s4-final-step {width:100%;}
180
  table.s4-final-step td {padding:5px 15px 5px 5px}
181
  table.s4-final-step td:first-child {white-space:nowrap;}
182
+ div.s4-go-back {border-top:1px dotted #dfdfdf; margin:auto; font-style:italic; font-size:10px; color:#333}
183
+ a.s4-final-btns {display: block; width:145px; padding:5px; line-height: 1.4; background-color:#F1F1F1; border:1px solid silver;
184
  color: #000; box-shadow: 5px 5px 5px -5px #949494; text-decoration: none; text-align: center; border-radius: 4px;
185
  }
186
  a.s4-final-btns:hover {background-color: #dfdfdf;}
222
  <?php else : ?>
223
  .dupx-debug {display:none}
224
  <?php endif; ?>
225
+ small.s3-warn {color: maroon;font-style: italic;}
226
+ div.s4-warn {color: maroon;}
227
 
228
  </style>
installer/build/classes/class.engine.php CHANGED
@@ -123,7 +123,7 @@ class DUPX_UpdateEngine
123
  * @param mysql $dbh The db connection object
124
  * @param array $list Key value pair of 'search' and 'replace' arrays
125
  * @param array $tables The tables we want to look at
126
- * @param array $fullsearch Search every column reguardless of its data type
127
  *
128
  * @return array Collection of information gathered during the run.
129
  */
@@ -222,14 +222,14 @@ class DUPX_UpdateEngine
222
  //Loops every cell
223
  foreach ($columns as $column => $primary_key) {
224
  $report['scan_cells'] ++;
225
- $edited_data = $data_to_fix = $row[$column];
226
- $base64converted = false;
227
- $txt_found = false;
228
 
229
  //Unkeyed table code
230
  //Added this here to add all columns to $where_sql
231
  //The if statement with $txt_found would skip additional columns
232
- if($is_unkeyed){
233
  $where_sql[] = $column.' = "'.mysqli_real_escape_string($dbh, $data_to_fix).'"';
234
  }
235
 
@@ -288,16 +288,22 @@ class DUPX_UpdateEngine
288
 
289
  //PERFORM ROW UPDATE
290
  if ($upd && !empty($where_sql)) {
291
- $sql = "UPDATE `{$table}` SET ".implode(', ', $upd_sql).' WHERE '.implode(' AND ', array_filter($where_sql));
292
- $result = mysqli_query($dbh, $sql) or $report['errsql'][] = mysqli_error($dbh);
293
- //DEBUG ONLY:
294
- DUPX_Log::info("\t{$sql}\n", 3);
295
  if ($result) {
296
  if ($serial_err > 0) {
297
- $report['errser'][] = "SELECT ".implode(', ', $upd_col)." FROM `{$table}` WHERE ".implode(' AND ', array_filter($where_sql)).';';
298
  }
299
- $report['updt_rows'] ++;
 
 
 
 
300
  }
 
 
 
 
301
  } elseif ($upd) {
302
  $report['errkey'][] = sprintf("Row [%s] on Table [%s] requires a manual update.", $current_row, $table);
303
  }
123
  * @param mysql $dbh The db connection object
124
  * @param array $list Key value pair of 'search' and 'replace' arrays
125
  * @param array $tables The tables we want to look at
126
+ * @param array $fullsearch Search every column regardless of its data type
127
  *
128
  * @return array Collection of information gathered during the run.
129
  */
222
  //Loops every cell
223
  foreach ($columns as $column => $primary_key) {
224
  $report['scan_cells'] ++;
225
+ $edited_data = $data_to_fix = $row[$column];
226
+ $base64converted = false;
227
+ $txt_found = false;
228
 
229
  //Unkeyed table code
230
  //Added this here to add all columns to $where_sql
231
  //The if statement with $txt_found would skip additional columns
232
+ if($is_unkeyed && ! empty($data_to_fix)) {
233
  $where_sql[] = $column.' = "'.mysqli_real_escape_string($dbh, $data_to_fix).'"';
234
  }
235
 
288
 
289
  //PERFORM ROW UPDATE
290
  if ($upd && !empty($where_sql)) {
291
+ $sql = "UPDATE `{$table}` SET ".implode(', ', $upd_sql).' WHERE '.implode(' AND ', array_filter($where_sql));
292
+ $result = mysqli_query($dbh, $sql);
 
 
293
  if ($result) {
294
  if ($serial_err > 0) {
295
+ $report['errser'][] = "SELECT " . implode(', ', $upd_col) . " FROM `{$table}` WHERE " . implode(' AND ', array_filter($where_sql)) . ';';
296
  }
297
+ $report['updt_rows']++;
298
+ } else {
299
+ $report['errsql'][] = ($GLOBALS["LOGGING"] == 1)
300
+ ? 'DB ERROR: ' . mysqli_error($dbh)
301
+ : 'DB ERROR: ' . mysqli_error($dbh) . "\nSQL: [{$sql}]\n";
302
  }
303
+
304
+ //DEBUG ONLY:
305
+ DUPX_Log::info("\t{$sql}\n", 3);
306
+
307
  } elseif ($upd) {
308
  $report['errkey'][] = sprintf("Row [%s] on Table [%s] requires a manual update.", $current_row, $table);
309
  }
installer/build/ctrls/ctrl.step1.php CHANGED
@@ -5,7 +5,7 @@ $_POST['archive_name'] = isset($_POST['archive_name']) ? $_POST['archive_name'
5
  $_POST['archive_engine'] = isset($_POST['archive_engine']) ? $_POST['archive_engine'] : 'manual';
6
  $_POST['archive_filetime'] = (isset($_POST['archive_filetime'])) ? $_POST['archive_filetime'] : 'current';
7
  $_POST['retain_config'] = (isset($_POST['retain_config']) && $_POST['retain_config'] == '1') ? true : false;
8
-
9
  //LOGGING
10
  $POST_LOG = $_POST;
11
  unset($POST_LOG['dbpass']);
@@ -66,6 +66,7 @@ DUPX_Log::info("DOC ROOT:\t{$root_path}");
66
  DUPX_Log::info("DOC ROOT 755:\t".var_export($GLOBALS['CHOWN_ROOT_PATH'], true));
67
  DUPX_Log::info("LOG FILE 644:\t".var_export($GLOBALS['CHOWN_LOG_PATH'], true));
68
  DUPX_Log::info("REQUEST URL:\t{$GLOBALS['URL_PATH']}");
 
69
 
70
  $log = "--------------------------------------\n";
71
  $log .= "POST DATA\n";
5
  $_POST['archive_engine'] = isset($_POST['archive_engine']) ? $_POST['archive_engine'] : 'manual';
6
  $_POST['archive_filetime'] = (isset($_POST['archive_filetime'])) ? $_POST['archive_filetime'] : 'current';
7
  $_POST['retain_config'] = (isset($_POST['retain_config']) && $_POST['retain_config'] == '1') ? true : false;
8
+ $_POST['exe_safe_mode'] = (isset($_POST['exe_safe_mode'])) ? $_POST['exe_safe_mode'] : 0;
9
  //LOGGING
10
  $POST_LOG = $_POST;
11
  unset($POST_LOG['dbpass']);
66
  DUPX_Log::info("DOC ROOT 755:\t".var_export($GLOBALS['CHOWN_ROOT_PATH'], true));
67
  DUPX_Log::info("LOG FILE 644:\t".var_export($GLOBALS['CHOWN_LOG_PATH'], true));
68
  DUPX_Log::info("REQUEST URL:\t{$GLOBALS['URL_PATH']}");
69
+ DUPX_Log::info("SAFE MODE :\t{$_POST['exe_safe_mode']}");
70
 
71
  $log = "--------------------------------------\n";
72
  $log .= "POST DATA\n";
installer/build/ctrls/ctrl.step2.php CHANGED
@@ -367,7 +367,7 @@ while ($counter < $sql_result_file_length) {
367
 
368
  if ($dbvar_maxpacks < $query_strlen) {
369
 
370
- DUPX_Log::info("**ERROR** Query size limit [length={$query_strlen}] [sql=" . substr($sql_result_file_data[$counter], 75) . "...]");
371
  $dbquery_errs++;
372
 
373
  } elseif ($query_strlen > 0) {
367
 
368
  if ($dbvar_maxpacks < $query_strlen) {
369
 
370
+ DUPX_Log::info("**ERROR** Query size limit [length={$query_strlen}] [sql=" . substr($sql_result_file_data[$counter], 0, 75) . "...]");
371
  $dbquery_errs++;
372
 
373
  } elseif ($query_strlen > 0) {
installer/build/ctrls/ctrl.step3.php CHANGED
@@ -32,7 +32,7 @@ $_POST['tables'] = isset($_POST['tables']) && is_array($_POST['tables']) ? arra
32
  $_POST['url_old'] = isset($_POST['url_old']) ? trim($_POST['url_old']) : null;
33
  $_POST['url_new'] = isset($_POST['url_new']) ? rtrim(trim($_POST['url_new']), '/') : null;
34
  $_POST['retain_config'] = (isset($_POST['retain_config']) && $_POST['retain_config'] == '1') ? true : false;
35
-
36
  //LOGGING
37
  $POST_LOG = $_POST;
38
  unset($POST_LOG['tables']);
@@ -179,7 +179,7 @@ if ($_POST['postguid']) {
179
  http://xyz.com/abc01 will become http://xyz.com/abc0101 with trailing data */
180
  mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$_POST['url_new']}' WHERE option_name = 'home' ");
181
  mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$_POST['siteurl']}' WHERE option_name = 'siteurl' ");
182
-
183
  //===============================================
184
  //CONFIGURATION FILE UPDATES
185
  //===============================================
32
  $_POST['url_old'] = isset($_POST['url_old']) ? trim($_POST['url_old']) : null;
33
  $_POST['url_new'] = isset($_POST['url_new']) ? rtrim(trim($_POST['url_new']), '/') : null;
34
  $_POST['retain_config'] = (isset($_POST['retain_config']) && $_POST['retain_config'] == '1') ? true : false;
35
+ $_POST['exe_safe_mode'] = isset($_POST['exe_safe_mode']) ? $_POST['exe_safe_mode'] : 0;
36
  //LOGGING
37
  $POST_LOG = $_POST;
38
  unset($POST_LOG['tables']);
179
  http://xyz.com/abc01 will become http://xyz.com/abc0101 with trailing data */
180
  mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$_POST['url_new']}' WHERE option_name = 'home' ");
181
  mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$_POST['siteurl']}' WHERE option_name = 'siteurl' ");
182
+ mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}options` (option_value, option_name) VALUES('{$_POST['exe_safe_mode']}','duplicator_exe_safe_mode')");
183
  //===============================================
184
  //CONFIGURATION FILE UPDATES
185
  //===============================================
installer/build/view.help.php CHANGED
@@ -57,6 +57,9 @@ STEP 1
57
  <th>Option</th>
58
  <th>Details</th>
59
  </tr>
 
 
 
60
  <tr>
61
  <td>Extraction</td>
62
  <td>
@@ -88,6 +91,23 @@ STEP 1
88
  to recursively set octal value on all the directories being extracted. Typically this value is 755 on most servers and hosts.
89
  </td>
90
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  <tr>
92
  <td>Config Files <sup>pro</sup></td>
93
  <td>
@@ -124,6 +144,7 @@ STEP 1
124
  <br/><br/>
125
 
126
  </div>
 
127
 
128
 
129
  <!-- ============================================
@@ -257,7 +278,7 @@ STEP 2
257
  use 'utf8mb4_unicode_520', then 'utf8mb4', then 'utf8' and so on until it runs out of options.
258
  <br/><br/>
259
  For more information about this feature see the online FAQ question titled
260
- <a href="https://snapcreek.com/duplicator/docs/faqs-tech/#faq-installer-110-q" target="_blank">"What is Compatibility mode & ' collation' errors"</a>
261
  </td>
262
  </tr>
263
  <tr>
@@ -314,10 +335,7 @@ STEP 2
314
  </tr>
315
  </table>
316
  <br/><br/>
317
-
318
-
319
-
320
- </div>
321
 
322
 
323
  <!-- ============================================
@@ -347,7 +365,7 @@ STEP 3
347
  </tr>
348
  <tr>
349
  <td colspan="2" class="section">New Admin Account</td>
350
- </td>
351
  <tr>
352
  <td>Username</td>
353
  <td>A new WordPress username to create. This will create a new WordPress administrator account. Please note that usernames are not changeable from the within the UI.</td>
@@ -358,7 +376,7 @@ STEP 3
358
  </tr>
359
  <tr>
360
  <td colspan="2" class="section">Scan Options</td>
361
- </td>
362
  <tr>
363
  <td>Cleanup <sup>pro</sup></td>
364
  <td>The checkbox labeled Remove schedules &amp; storage endpoints will empty the Duplicator schedule and storage settings. This is recommended to keep enabled so that you do not have unwanted schedules and storage options enabled.</td>
@@ -407,7 +425,7 @@ STEP 3
407
  </tr>
408
  </table>
409
  <br/><br/>
410
- </div>
411
 
412
 
413
  <!-- ============================================
57
  <th>Option</th>
58
  <th>Details</th>
59
  </tr>
60
+ <tr>
61
+ <td colspan="2" class="section">General Options</td>
62
+ </tr>
63
  <tr>
64
  <td>Extraction</td>
65
  <td>
91
  to recursively set octal value on all the directories being extracted. Typically this value is 755 on most servers and hosts.
92
  </td>
93
  </tr>
94
+ <tr>
95
+ <td colspan="2" class="section">Advanced Options</td>
96
+ </tr>
97
+ <tr>
98
+ <td>Safe Mode</td>
99
+ <td>
100
+ Safe mode is designed to configure the site with specific options at install time to help over come issues that may happen during the install were the site
101
+ is having issues. These options should only be used if you run into issues after you have tried to run an install.
102
+ <br/><br/>
103
+ <b>Basic:</b> This safe mode option will disable all the plugins at install time. When this option is set you will need to re-enable all plugins after the
104
+ install has full ran.
105
+ <br/><br/>
106
+
107
+ <b>Advanced:</b> This option applies all settings used in basic and will also de-activate and reactivate your theme when logging in for the first time. This
108
+ options should be used only if the Basic option did not work.
109
+ </td>
110
+ </tr>
111
  <tr>
112
  <td>Config Files <sup>pro</sup></td>
113
  <td>
144
  <br/><br/>
145
 
146
  </div>
147
+ <br/>
148
 
149
 
150
  <!-- ============================================
278
  use 'utf8mb4_unicode_520', then 'utf8mb4', then 'utf8' and so on until it runs out of options.
279
  <br/><br/>
280
  For more information about this feature see the online FAQ question titled
281
+ <a href="https://snapcreek.com/duplicator/docs/faqs-tech/#faq-installer-110-q" target="_blank">"What is compatibility mode & 'unknown collation' errors"</a>
282
  </td>
283
  </tr>
284
  <tr>
335
  </tr>
336
  </table>
337
  <br/><br/>
338
+ </div><br/>
 
 
 
339
 
340
 
341
  <!-- ============================================
365
  </tr>
366
  <tr>
367
  <td colspan="2" class="section">New Admin Account</td>
368
+ </tr>
369
  <tr>
370
  <td>Username</td>
371
  <td>A new WordPress username to create. This will create a new WordPress administrator account. Please note that usernames are not changeable from the within the UI.</td>
376
  </tr>
377
  <tr>
378
  <td colspan="2" class="section">Scan Options</td>
379
+ </tr>
380
  <tr>
381
  <td>Cleanup <sup>pro</sup></td>
382
  <td>The checkbox labeled Remove schedules &amp; storage endpoints will empty the Duplicator schedule and storage settings. This is recommended to keep enabled so that you do not have unwanted schedules and storage options enabled.</td>
425
  </tr>
426
  </table>
427
  <br/><br/>
428
+ </div><br/>
429
 
430
 
431
  <!-- ============================================
installer/build/view.step1.php CHANGED
@@ -274,7 +274,7 @@ VALIDATION
274
  </table><br/>
275
 
276
  The deployment path above must be writable by PHP in order to extract the archive file. Incorrect permissions and extension such as
277
- <a href="https://suhosin.org/stories/index.html" target="_blank">suhosin</a> can sometimes inter-fear with PHP being able to write/extract files.
278
  Please see the <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=installer_perms#faq-trouble-055-q" target="_blank">FAQ permission</a> help link for complete details.
279
  PHP with <a href='http://php.net/manual/en/features.safe-mode.php' target='_blank'>safe mode</a> should be disabled. If this test fails
280
  please contact your hosting provider or server administrator to disable PHP safe mode.
@@ -444,7 +444,7 @@ OPTIONS
444
  <div id="s1-area-adv-opts" style="display:none">
445
  <div class="help-target"><a href="?help#help-s1" target="_blank">[help]</a></div>
446
  <br/>
447
- <div class="hdr-sub3">Advanced</div>
448
  <table class="dupx-opts dupx-advopts">
449
  <tr>
450
  <td>Extraction:</td>
@@ -462,8 +462,20 @@ OPTIONS
462
  </td>
463
  </tr>
464
  </table>
465
-
 
 
466
  <table class="dupx-opts dupx-advopts">
 
 
 
 
 
 
 
 
 
 
467
  <tr>
468
  <td>Config Files:</td>
469
  <td>
@@ -616,6 +628,7 @@ Auto Posts to view.step2.php
616
  <input type="hidden" name="action_step" value="2" />
617
  <input type="hidden" name="archive_name" value="<?php echo $GLOBALS['FW_PACKAGE_NAME'] ?>" />
618
  <input type="hidden" name="logging" id="ajax-logging" />
 
619
  <input type="hidden" name="retain_config" id="ajax-retain-config" />
620
  <input type="hidden" name="json" id="ajax-json" />
621
  <textarea id='ajax-json-debug' name='json_debug_view'></textarea>
@@ -679,6 +692,7 @@ Auto Posts to view.step2.php
679
  if (typeof(data) != 'undefined' && data.pass == 1) {
680
  $("#ajax-logging").val($("input:radio[name=logging]:checked").val());
681
  $("#ajax-retain-config").val($("#retain_config").is(":checked") ? 1 : 0);
 
682
  $("#ajax-json").val(escape(dataJSON));
683
  <?php if (! $GLOBALS['DUPX_DEBUG']) : ?>
684
  setTimeout(function() {$('#s1-result-form').submit();}, 500);
@@ -733,7 +747,22 @@ Auto Posts to view.step2.php
733
  $('#s1-result-form').hide();
734
  $('#s1-input-form').show(200);
735
  }
736
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
737
  //DOCUMENT LOAD
738
  $(document).ready(function()
739
  {
274
  </table><br/>
275
 
276
  The deployment path above must be writable by PHP in order to extract the archive file. Incorrect permissions and extension such as
277
+ <a href="https://suhosin.org/stories/index.html" target="_blank">suhosin</a> can sometimes interfere with PHP being able to write/extract files.
278
  Please see the <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=installer_perms#faq-trouble-055-q" target="_blank">FAQ permission</a> help link for complete details.
279
  PHP with <a href='http://php.net/manual/en/features.safe-mode.php' target='_blank'>safe mode</a> should be disabled. If this test fails
280
  please contact your hosting provider or server administrator to disable PHP safe mode.
444
  <div id="s1-area-adv-opts" style="display:none">
445
  <div class="help-target"><a href="?help#help-s1" target="_blank">[help]</a></div>
446
  <br/>
447
+ <div class="hdr-sub3">General</div>
448
  <table class="dupx-opts dupx-advopts">
449
  <tr>
450
  <td>Extraction:</td>
462
  </td>
463
  </tr>
464
  </table>
465
+ <br>
466
+ <br>
467
+ <div class="hdr-sub3">Advanced</div>
468
  <table class="dupx-opts dupx-advopts">
469
+ <tr>
470
+ <td>Safe Mode:</td>
471
+ <td>
472
+ <select name="exe_safe_mode" id="exe_safe_mode" onchange="DUPX.onSafeModeSwitch();" style="width:200px;">
473
+ <option value="0">Off</option>
474
+ <option value="1">Basic</option>
475
+ <option value="2">Advance</option>
476
+ </select>
477
+ </td>
478
+ </tr>
479
  <tr>
480
  <td>Config Files:</td>
481
  <td>
628
  <input type="hidden" name="action_step" value="2" />
629
  <input type="hidden" name="archive_name" value="<?php echo $GLOBALS['FW_PACKAGE_NAME'] ?>" />
630
  <input type="hidden" name="logging" id="ajax-logging" />
631
+ <input type="hidden" name="exe_safe_mode" id="exe-safe-mode" value="0" />
632
  <input type="hidden" name="retain_config" id="ajax-retain-config" />
633
  <input type="hidden" name="json" id="ajax-json" />
634
  <textarea id='ajax-json-debug' name='json_debug_view'></textarea>
692
  if (typeof(data) != 'undefined' && data.pass == 1) {
693
  $("#ajax-logging").val($("input:radio[name=logging]:checked").val());
694
  $("#ajax-retain-config").val($("#retain_config").is(":checked") ? 1 : 0);
695
+ $("#exe-safe-mode").val($("#exe_safe_mode").val());
696
  $("#ajax-json").val(escape(dataJSON));
697
  <?php if (! $GLOBALS['DUPX_DEBUG']) : ?>
698
  setTimeout(function() {$('#s1-result-form').submit();}, 500);
747
  $('#s1-result-form').hide();
748
  $('#s1-input-form').show(200);
749
  }
750
+
751
+ DUPX.onSafeModeSwitch = function ()
752
+ {
753
+ var mode = $('#exe_safe_mode').val();
754
+ if(mode == 0){
755
+ $("#retain_config").removeAttr("disabled");
756
+ }else if(mode == 1 || mode ==2){
757
+ if($("#retain_config").is(':checked'))
758
+ $("#retain_config").removeAttr("checked");
759
+ $("#retain_config").attr("disabled", true);
760
+ }
761
+
762
+ $('#exe-safe-mode').val(mode);
763
+ console.log("mode set to"+mode);
764
+ }
765
+
766
  //DOCUMENT LOAD
767
  $(document).ready(function()
768
  {
installer/build/view.step2.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
  $_POST['logging'] = isset($_POST['logging']) ? trim($_POST['logging']) : 1;
 
3
  ?>
4
 
5
 
@@ -192,6 +193,7 @@ Auto Posts to view.step3.php
192
  <input type="hidden" name="archive_name" value="<?php echo $GLOBALS['FW_PACKAGE_NAME'] ?>" />
193
  <input type="hidden" name="logging" id="ajax-logging" />
194
  <input type="hidden" name="retain_config" value="<?php echo $_POST['retain_config']; ?>" />
 
195
  <input type="hidden" name="dbhost" id="ajax-dbhost" />
196
  <input type="hidden" name="dbport" id="ajax-dbport" />
197
  <input type="hidden" name="dbuser" id="ajax-dbuser" />
1
  <?php
2
  $_POST['logging'] = isset($_POST['logging']) ? trim($_POST['logging']) : 1;
3
+ $_POST['exe_safe_mode'] = (isset($_POST['exe_safe_mode'])) ? $_POST['exe_safe_mode'] : 0;
4
  ?>
5
 
6
 
193
  <input type="hidden" name="archive_name" value="<?php echo $GLOBALS['FW_PACKAGE_NAME'] ?>" />
194
  <input type="hidden" name="logging" id="ajax-logging" />
195
  <input type="hidden" name="retain_config" value="<?php echo $_POST['retain_config']; ?>" />
196
+ <input type="hidden" name="exe_safe_mode" id="exe-safe-mode" value="<?php echo $_POST['exe_safe_mode']; ?>"/>
197
  <input type="hidden" name="dbhost" id="ajax-dbhost" />
198
  <input type="hidden" name="dbport" id="ajax-dbport" />
199
  <input type="hidden" name="dbuser" id="ajax-dbuser" />
installer/build/view.step3.php CHANGED
@@ -7,6 +7,7 @@
7
  $old_path = $GLOBALS['FW_WPROOT'];
8
  $new_path = DUPX_U::setSafePath($GLOBALS['CURRENT_ROOT_PATH']);
9
  $new_path = ((strrpos($old_path, '/') + 1) == strlen($old_path)) ? DUPX_U::addSlash($new_path) : $new_path;
 
10
  ?>
11
 
12
 
@@ -28,6 +29,7 @@ VIEW: STEP 3- INPUT -->
28
  <input type="hidden" name="dbname" value="<?php echo $_POST['dbname'] ?>" />
29
  <input type="hidden" name="dbcharset" value="<?php echo $_POST['dbcharset'] ?>" />
30
  <input type="hidden" name="dbcollate" value="<?php echo $_POST['dbcollate'] ?>" />
 
31
 
32
  <div class="dupx-logfile-link"><a href="installer-log.txt?now=<?php echo $GLOBALS['NOW_DATE'] ?>" target="install_log">installer-log.txt</a></div>
33
  <div class="hdr-main">
@@ -120,26 +122,29 @@ VIEW: STEP 3- INPUT -->
120
  <a href="javascript:void(0)" onclick="$('#tables option').prop('selected',true);">[All]</a>
121
  <a href="javascript:void(0)" onclick="$('#tables option').prop('selected',false);">[None]</a>
122
  </div><br style="clear:both" />
123
- <select id="tables" name="tables[]" multiple="multiple" style="width:315px; height:100px">
124
  <?php
125
- foreach( $all_tables as $table ) {
126
- echo '<option selected="selected" value="' . DUPX_U::escapeHTML( $table ) . '">' . $table . '</option>';
127
- }
128
  ?>
129
  </select>
130
-
131
  </td>
132
  <td valign="top">
133
  <b>Activate Plugins:</b>
134
- <div class="s3-allnonelinks">
 
135
  <a href="javascript:void(0)" onclick="$('#plugins option').prop('selected',true);">[All]</a>
136
  <a href="javascript:void(0)" onclick="$('#plugins option').prop('selected',false);">[None]</a>
137
  </div><br style="clear:both" />
138
- <select id="plugins" name="plugins[]" multiple="multiple" style="width:315px; height:100px">
139
  <?php
140
- foreach ($active_plugins as $plugin) {
141
- echo '<option selected="selected" value="' . DUPX_U::escapeHTML( $plugin ) . '">' . dirname($plugin) . '</option>';
142
- }
 
 
 
143
  ?>
144
  </select>
145
  </td>
@@ -190,6 +195,7 @@ VIEW: STEP 3 - AJAX RESULT
190
  <input type="hidden" name="action_step" value="4" />
191
  <input type="hidden" name="archive_name" value="<?php echo $_POST['archive_name'] ?>" />
192
  <input type="hidden" name="retain_config" value="<?php echo $_POST['retain_config']; ?>" />
 
193
  <input type="hidden" name="url_new" id="ajax-url_new" />
194
  <input type="hidden" name="json" id="ajax-json" />
195
  <br/>
7
  $old_path = $GLOBALS['FW_WPROOT'];
8
  $new_path = DUPX_U::setSafePath($GLOBALS['CURRENT_ROOT_PATH']);
9
  $new_path = ((strrpos($old_path, '/') + 1) == strlen($old_path)) ? DUPX_U::addSlash($new_path) : $new_path;
10
+ $_POST['exe_safe_mode'] = isset($_POST['exe_safe_mode']) ? $_POST['exe_safe_mode'] : 0;
11
  ?>
12
 
13
 
29
  <input type="hidden" name="dbname" value="<?php echo $_POST['dbname'] ?>" />
30
  <input type="hidden" name="dbcharset" value="<?php echo $_POST['dbcharset'] ?>" />
31
  <input type="hidden" name="dbcollate" value="<?php echo $_POST['dbcollate'] ?>" />
32
+ <input type="hidden" name="exe_safe_mode" id="exe-safe-mode" value="<?php echo $_POST['exe_safe_mode'] ?>" />
33
 
34
  <div class="dupx-logfile-link"><a href="installer-log.txt?now=<?php echo $GLOBALS['NOW_DATE'] ?>" target="install_log">installer-log.txt</a></div>
35
  <div class="hdr-main">
122
  <a href="javascript:void(0)" onclick="$('#tables option').prop('selected',true);">[All]</a>
123
  <a href="javascript:void(0)" onclick="$('#tables option').prop('selected',false);">[None]</a>
124
  </div><br style="clear:both" />
125
+ <select id="tables" name="tables[]" multiple="multiple">
126
  <?php
127
+ foreach( $all_tables as $table ) {
128
+ echo '<option selected="selected" value="' . DUPX_U::escapeHTML( $table ) . '">' . $table . '</option>';
129
+ }
130
  ?>
131
  </select>
 
132
  </td>
133
  <td valign="top">
134
  <b>Activate Plugins:</b>
135
+ <?php echo ($_POST['exe_safe_mode'] > 0) ? '<small class="s3-warn">Safe Mode Enabled</small>' : '' ; ?>
136
+ <div class="s3-allnonelinks" style="<?php echo ($_POST['exe_safe_mode']>0)? 'display:none':''; ?>">
137
  <a href="javascript:void(0)" onclick="$('#plugins option').prop('selected',true);">[All]</a>
138
  <a href="javascript:void(0)" onclick="$('#plugins option').prop('selected',false);">[None]</a>
139
  </div><br style="clear:both" />
140
+ <select id="plugins" name="plugins[]" multiple="multiple" <?php echo ($_POST['exe_safe_mode'] > 0) ? 'disabled="disabled"' : ''; ?>>
141
  <?php
142
+ $selected_string = ($_POST['exe_safe_mode'] > 0) ? '' : 'selected="selected"';
143
+ foreach ($active_plugins as $plugin) {
144
+ $plug_val = DUPX_U::escapeHTML($plugin);
145
+ $plug_name = dirname($plugin);
146
+ echo "<option {$selected_string} value='{$plug_val}'>{$plug_name}</option>";
147
+ }
148
  ?>
149
  </select>
150
  </td>
195
  <input type="hidden" name="action_step" value="4" />
196
  <input type="hidden" name="archive_name" value="<?php echo $_POST['archive_name'] ?>" />
197
  <input type="hidden" name="retain_config" value="<?php echo $_POST['retain_config']; ?>" />
198
+ <input type="hidden" name="exe_safe_mode" id="exe-safe-mode" value="<?php echo $_POST['exe_safe_mode']; ?>"/>
199
  <input type="hidden" name="url_new" id="ajax-url_new" />
200
  <input type="hidden" name="json" id="ajax-json" />
201
  <br/>
installer/build/view.step4.php CHANGED
@@ -1,8 +1,12 @@
1
  <?php
2
  $_POST['archive_name'] = isset($_POST['archive_name']) ? $_POST['archive_name'] : '';
3
  $_POST['retain_config'] = (isset($_POST['retain_config']) && $_POST['retain_config'] == '1') ? true : false;
 
 
4
  $admin_base = basename($GLOBALS['FW_WPLOGIN_URL']);
5
- $admin_redirect = rtrim($_POST['url_new'], "/") . "/wp-admin/admin.php?page=duplicator-tools&tab=cleanup&package={$_POST['archive_name']}";
 
 
6
  $admin_redirect = urlencode($admin_redirect);
7
  $admin_url_qry = (strpos($admin_base, '?') === false) ? '?' : '&';
8
  $admin_login = rtrim($_POST['url_new'], '/') . "/{$admin_base}{$admin_url_qry}redirect_to={$admin_redirect}";
@@ -25,27 +29,31 @@ VIEW: STEP 4 - INPUT -->
25
  <div class="dupx-logfile-link"><a href="installer-log.txt?now=<?php echo $GLOBALS['NOW_DATE'] ?>" target="install_log">installer-log.txt</a></div>
26
 
27
  <div class="hdr-main">
28
- Step <span class="step">4</span> of 4: Test
29
  </div><br />
30
 
31
- <div class="hdr-sub3">
32
- <div class="s4-final-title">Final Steps</div>
33
- </div>
34
-
35
  <table class="s4-final-step">
36
- <tr>
37
  <td><a class="s4-final-btns" href="javascript:void(0)" onclick="DUPX.getAdminLogin()">Site Login</a></td>
38
  <td>
39
- <i>Login to the administrator section to finalize the setup</i>
40
  <?php if ($_POST['retain_config']) :?>
41
  <br/> <i>Update of Permalinks required see: Admin &gt; Settings &gt; Permalinks &gt; Save</i>
42
  <?php endif;?>
 
 
 
 
 
 
 
 
43
  </td>
44
  </tr>
45
  <tr>
46
  <td><a class="s4-final-btns" href="javascript:void(0)" onclick="$('#dup-step3-install-report').toggle(400)">Show Report</a></td>
47
  <td>
48
- <i>Optionally, review the migration report.</i><br/>
49
  <i id="dup-step3-install-report-count">
50
  <span data-bind="with: status.step2">Install Notices: (<span data-bind="text: query_errs"></span>)</span> &nbsp;
51
  <span data-bind="with: status.step3">Update Notices: (<span data-bind="text: err_all"></span>)</span> &nbsp; &nbsp;
@@ -53,7 +61,8 @@ VIEW: STEP 4 - INPUT -->
53
  </i>
54
  </td>
55
  </tr>
56
- </table><br/>
 
57
 
58
  <div class="s4-go-back">
59
  Additional Notes:
@@ -63,6 +72,10 @@ VIEW: STEP 4 - INPUT -->
63
  re-run installer at <a href="javascript:history.go(-3)">step 1</a>
64
  </li>
65
  <li>The .htaccess file was reset. Resave plugins that write to this file.</li>
 
 
 
 
66
  </ul>
67
  </div>
68
 
@@ -228,10 +241,10 @@ VIEW: STEP 4 - INPUT -->
228
  </div>
229
  <br/><br/>
230
 
231
- <div class='s4-connect'>
232
  <a href="installer.php?help=1#troubleshoot" target="_blank">Troubleshoot</a> |
233
  <a href='https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst4_step4_troubleshoot' target='_blank'>FAQs</a>
234
- </div><br/>
235
  </form>
236
 
237
  <script>
1
  <?php
2
  $_POST['archive_name'] = isset($_POST['archive_name']) ? $_POST['archive_name'] : '';
3
  $_POST['retain_config'] = (isset($_POST['retain_config']) && $_POST['retain_config'] == '1') ? true : false;
4
+ $_POST['exe_safe_mode'] = isset($_POST['exe_safe_mode']) ? $_POST['exe_safe_mode'] : 0;
5
+
6
  $admin_base = basename($GLOBALS['FW_WPLOGIN_URL']);
7
+
8
+ $safe_mode = $_POST['exe_safe_mode'];
9
+ $admin_redirect = rtrim($_POST['url_new'], "/") . "/wp-admin/admin.php?page=duplicator-tools&tab=diagnostics&section=info&package={$_POST['archive_name']}&safe_mode={$safe_mode}";
10
  $admin_redirect = urlencode($admin_redirect);
11
  $admin_url_qry = (strpos($admin_base, '?') === false) ? '?' : '&';
12
  $admin_login = rtrim($_POST['url_new'], '/') . "/{$admin_base}{$admin_url_qry}redirect_to={$admin_redirect}";
29
  <div class="dupx-logfile-link"><a href="installer-log.txt?now=<?php echo $GLOBALS['NOW_DATE'] ?>" target="install_log">installer-log.txt</a></div>
30
 
31
  <div class="hdr-main">
32
+ Step <span class="step">4</span> of 4: Test Site
33
  </div><br />
34
 
 
 
 
 
35
  <table class="s4-final-step">
36
+ <tr style="vertical-align:top">
37
  <td><a class="s4-final-btns" href="javascript:void(0)" onclick="DUPX.getAdminLogin()">Site Login</a></td>
38
  <td>
39
+ <i>Login to finalize the setup</i>
40
  <?php if ($_POST['retain_config']) :?>
41
  <br/> <i>Update of Permalinks required see: Admin &gt; Settings &gt; Permalinks &gt; Save</i>
42
  <?php endif;?>
43
+ <br/><br/>
44
+
45
+ <!-- WARN: SAFE MODE MESSAGES -->
46
+ <div class="s4-warn" style="display:<?php echo ($safe_mode > 0 ? 'block' : 'none')?>">
47
+ <b>Safe Mode</b><br/>
48
+ Safe mode has <u>deactivated</u> all plugins. Please be sure to enable your plugins after logging in. <i>If you notice that problems arise when activating
49
+ the plugins then active them one-by-one to isolate the plugin that could be causing the issue.</i>
50
+ </div>
51
  </td>
52
  </tr>
53
  <tr>
54
  <td><a class="s4-final-btns" href="javascript:void(0)" onclick="$('#dup-step3-install-report').toggle(400)">Show Report</a></td>
55
  <td>
56
+ <i>Optionally review the migration report</i><br/>
57
  <i id="dup-step3-install-report-count">
58
  <span data-bind="with: status.step2">Install Notices: (<span data-bind="text: query_errs"></span>)</span> &nbsp;
59
  <span data-bind="with: status.step3">Update Notices: (<span data-bind="text: err_all"></span>)</span> &nbsp; &nbsp;
61
  </i>
62
  </td>
63
  </tr>
64
+ </table>
65
+ <br/><br/>
66
 
67
  <div class="s4-go-back">
68
  Additional Notes:
72
  re-run installer at <a href="javascript:history.go(-3)">step 1</a>
73
  </li>
74
  <li>The .htaccess file was reset. Resave plugins that write to this file.</li>
75
+ <li>
76
+ Visit the <a href="installer.php?help=1#troubleshoot" target="_blank">troubleshoot</a> section or
77
+ <a href='https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst4_step4_troubleshoot' target='_blank'>online FAQs</a> for additional help.
78
+ </li>
79
  </ul>
80
  </div>
81
 
241
  </div>
242
  <br/><br/>
243
 
244
+ <!--div class='s4-connect'>
245
  <a href="installer.php?help=1#troubleshoot" target="_blank">Troubleshoot</a> |
246
  <a href='https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst4_step4_troubleshoot' target='_blank'>FAQs</a>
247
+ </div--><br/>
248
  </form>
249
 
250
  <script>
readme.txt CHANGED
@@ -3,9 +3,9 @@ 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.2
7
  Requires PHP: 5.2.17
8
- Stable tag: 1.2.26
9
  License: GPLv2
10
 
11
  WordPress migration and backups are much easier with Duplicator! Clone, backup, move and transfer an entire site from one location to another.
@@ -103,4 +103,4 @@ Please see the following url:
103
 
104
  == Upgrade Notice ==
105
 
106
- Please use our ticketing system when submitting your logs. Please do not post to the forums.
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.3
7
  Requires PHP: 5.2.17
8
+ Stable tag: 1.2.28
9
  License: GPLv2
10
 
11
  WordPress migration and backups are much easier with Duplicator! Clone, backup, move and transfer an entire site from one location to another.
103
 
104
  == Upgrade Notice ==
105
 
106
+ Please use our ticketing system when submitting your logs. Please do not post to the forums.
views/help/gopro.php CHANGED
@@ -122,7 +122,7 @@ require_once(DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php');
122
  <td class="feature-column"><?php _e('Large Site Support', 'duplicator') ?><sup>
123
  <i class="fa fa-question-circle dup-gopro-help"
124
  data-tooltip-title="<?php _e("Large Site Support", 'duplicator'); ?>"
125
- data-tooltip="<?php _e('Advanced archive engine processes multi-gig sites on even stubborn budget hosts!', 'duplicator'); ?>"/></i></sup>
126
  </td>
127
  <td class="check-column"></td>
128
  <td class="check-column"><i class="fa fa-check"></i></td>
@@ -204,23 +204,23 @@ require_once(DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php');
204
  <td colspan="3" class="group-header"><?php _e('Enhanced Experience', 'duplicator') ?></td>
205
  </tr>-->
206
  <tr>
207
- <td class="feature-column"><?php _e('Email Alerts', 'duplicator') ?></td>
208
  <td class="check-column"></td>
209
  <td class="check-column"><i class="fa fa-check"></i></td>
210
  </tr>
211
 
212
  <tr>
213
- <td class="feature-column"><?php _e('Manual Transfers', 'duplicator') ?></td>
214
  <td class="check-column"></td>
215
  <td class="check-column"><i class="fa fa-check"></i></td>
216
  </tr>
217
  <tr>
218
- <td class="feature-column"><?php _e('Active Customer Support', 'duplicator') ?></td>
219
  <td class="check-column"></td>
220
  <td class="check-column"><i class="fa fa-check"></i></td>
221
  </tr>
222
  <tr>
223
- <td class="feature-column"><?php _e('Plus Many Other Features...', 'duplicator') ?></td>
224
  <td class="check-column"></td>
225
  <td class="check-column"><i class="fa fa-check"></i></td>
226
  </tr>
122
  <td class="feature-column"><?php _e('Large Site Support', 'duplicator') ?><sup>
123
  <i class="fa fa-question-circle dup-gopro-help"
124
  data-tooltip-title="<?php _e("Large Site Support", 'duplicator'); ?>"
125
+ data-tooltip="<?php _e('Advanced archive engine processes multi-gig sites - even on stubborn budget hosts!', 'duplicator'); ?>"/></i></sup>
126
  </td>
127
  <td class="check-column"></td>
128
  <td class="check-column"><i class="fa fa-check"></i></td>
204
  <td colspan="3" class="group-header"><?php _e('Enhanced Experience', 'duplicator') ?></td>
205
  </tr>-->
206
  <tr>
207
+ <td class="feature-column"><?php _e('Email Alerts') ?></td>
208
  <td class="check-column"></td>
209
  <td class="check-column"><i class="fa fa-check"></i></td>
210
  </tr>
211
 
212
  <tr>
213
+ <td class="feature-column"><?php _e('Manual Transfers') ?></td>
214
  <td class="check-column"></td>
215
  <td class="check-column"><i class="fa fa-check"></i></td>
216
  </tr>
217
  <tr>
218
+ <td class="feature-column"><?php _e('Active Customer Support') ?></td>
219
  <td class="check-column"></td>
220
  <td class="check-column"><i class="fa fa-check"></i></td>
221
  </tr>
222
  <tr>
223
+ <td class="feature-column"><?php _e('Plus Many Other Features...') ?></td>
224
  <td class="check-column"></td>
225
  <td class="check-column"><i class="fa fa-check"></i></td>
226
  </tr>
views/packages/details/detail.php CHANGED
@@ -48,7 +48,7 @@ $dbbuild_mode = ($mysqldump_on) ? 'mysqldump' : 'PHP';
48
  </style>
49
 
50
  <?php if ($package_id == 0) :?>
51
- <div class="error below-h2"><p><?php _e('Invlaid Package ID request. Please try again!', 'duplicator'); ?></p></div>
52
  <?php endif; ?>
53
 
54
  <div class="toggle-box">
48
  </style>
49
 
50
  <?php if ($package_id == 0) :?>
51
+ <div class="notice notice-error is-dismissible"><p><?php _e('Invlaid Package ID request. Please try again!', 'duplicator'); ?></p></div>
52
  <?php endif; ?>
53
 
54
  <div class="toggle-box">
views/packages/main/s1.setup1.php CHANGED
@@ -74,12 +74,12 @@ TOOL BAR: STEPS -->
74
  <hr class="dup-toolbar-line">
75
 
76
  <?php if (!empty($action_response)) : ?>
77
- <div id="message" class="updated below-h2"><p><?php echo $action_response; ?></p></div>
78
  <?php endif; ?>
79
 
80
  <!-- ============================
81
  SYSTEM REQUIREMENTS -->
82
- <?php if (! $dup_tests['Success']) : ?>
83
  <div class="dup-box">
84
  <div class="dup-box-title">
85
  <?php
@@ -137,21 +137,30 @@ SYSTEM REQUIREMENTS -->
137
  <!-- PERMISSIONS -->
138
  <div class='dup-sys-req'>
139
  <div class='dup-sys-title'>
140
- <a><?php _e('Required Paths', 'duplicator'); ?></a> <div><?php echo $dup_tests['IO']['ALL']; ?></div>
 
 
 
 
 
 
 
 
 
141
  </div>
142
  <div class="dup-sys-info dup-info-box">
143
  <?php
144
- printf("<b>%s</b> &nbsp; [%s] <br/>", $dup_tests['IO']['SSDIR'], DUPLICATOR_SSDIR_PATH);
145
- printf("<b>%s</b> &nbsp; [%s] <br/>", $dup_tests['IO']['SSTMP'], DUPLICATOR_SSDIR_PATH_TMP);
 
146
  ?>
147
- <br/>
148
- <div style="font-size:11px">
149
- <?php
150
- _e("If Duplicator does not have enough permissions then you will need to manually create the paths above. &nbsp; ", 'duplicator');
151
- if ($dup_tests['IO']['WPROOT'] == 'Fail')
152
- {
153
- echo sprintf( __('The root WordPress path [%s] is currently not writable by PHP.', 'duplicator'), DUPLICATOR_WPROOTPATH);
154
  }
 
155
  ?>
156
  </div>
157
  </div>
@@ -197,7 +206,7 @@ SYSTEM REQUIREMENTS -->
197
  <?php else:
198
  $duplicator_nonce = wp_create_nonce('duplicator_cleanup_page');
199
  ?>
200
- <form method="post" action="admin.php?page=duplicator-tools&tab=cleanup&action=installer&_wpnonce=<?php echo $duplicator_nonce; ?>">
201
  <b><?php _e('WordPress Root Path:', 'duplicator'); ?></b> <?php echo DUPLICATOR_WPROOTPATH; ?><br/>
202
  <?php _e("A reserved file(s) was found in the WordPress root directory. Reserved file names include [{$dup_intaller_files}]. To archive your data correctly please remove any of these files from your WordPress root directory. Then try creating your package again.", 'duplicator'); ?>
203
  <br/><input type='submit' class='button button-small' value='<?php _e('Remove Files Now', 'duplicator') ?>' style='font-size:10px; margin-top:5px;' />
74
  <hr class="dup-toolbar-line">
75
 
76
  <?php if (!empty($action_response)) : ?>
77
+ <div id="message" class="notice notice-success is-dismissible"><p><?php echo $action_response; ?></p></div>
78
  <?php endif; ?>
79
 
80
  <!-- ============================
81
  SYSTEM REQUIREMENTS -->
82
+ <?php if (! $dup_tests['Success'] || $dup_tests['Warning']) : ?>
83
  <div class="dup-box">
84
  <div class="dup-box-title">
85
  <?php
137
  <!-- PERMISSIONS -->
138
  <div class='dup-sys-req'>
139
  <div class='dup-sys-title'>
140
+ <a><?php _e('Required Paths', 'duplicator'); ?></a>
141
+ <div>
142
+ <?php
143
+ if ($dup_tests['IO']['ALL']) {
144
+ echo ($dup_tests['IO']['WPROOT'] == 'Warn') ? 'Warn' : 'Pass';
145
+ } else {
146
+ echo 'Fail';
147
+ }
148
+ ?>
149
+ </div>
150
  </div>
151
  <div class="dup-sys-info dup-info-box">
152
  <?php
153
+ printf("<b>%s</b> &nbsp; [%s] <br/>", $dup_tests['IO']['SSDIR'], DUPLICATOR_SSDIR_PATH);
154
+ printf("<b>%s</b> &nbsp; [%s] <br/>", $dup_tests['IO']['SSTMP'], DUPLICATOR_SSDIR_PATH_TMP);
155
+ printf("<b>%s</b> &nbsp; [%s] <br/>", $dup_tests['IO']['WPROOT'], DUPLICATOR_WPROOTPATH);
156
  ?>
157
+ <div style="font-size:11px; padding-top: 3px">
158
+ <?php
159
+ if ($dup_tests['IO']['WPROOT'] == 'Warn') {
160
+ echo sprintf( __('If the root WordPress path is not writable by PHP on some systems this can cause issues.', 'duplicator'), DUPLICATOR_WPROOTPATH);
161
+ echo '<br/>';
 
 
162
  }
163
+ _e("If Duplicator does not have enough permissions then you will need to manually create the paths above. &nbsp; ", 'duplicator');
164
  ?>
165
  </div>
166
  </div>
206
  <?php else:
207
  $duplicator_nonce = wp_create_nonce('duplicator_cleanup_page');
208
  ?>
209
+ <form method="post" action="admin.php?page=duplicator-tools&tab=diagnostics&section=info&action=installer&_wpnonce=<?php echo $duplicator_nonce; ?>">
210
  <b><?php _e('WordPress Root Path:', 'duplicator'); ?></b> <?php echo DUPLICATOR_WPROOTPATH; ?><br/>
211
  <?php _e("A reserved file(s) was found in the WordPress root directory. Reserved file names include [{$dup_intaller_files}]. To archive your data correctly please remove any of these files from your WordPress root directory. Then try creating your package again.", 'duplicator'); ?>
212
  <br/><input type='submit' class='button button-small' value='<?php _e('Remove Files Now', 'duplicator') ?>' style='font-size:10px; margin-top:5px;' />
views/packages/main/s2.scan1.php CHANGED
@@ -271,6 +271,12 @@ jQuery(document).ready(function($)
271
  Duplicator.Pack.initArchiveFilesData(data);
272
  Duplicator.Pack.initArchiveDBData(data);
273
 
 
 
 
 
 
 
274
  $('#dup-msg-success').show();
275
 
276
  //Waring Check
271
  Duplicator.Pack.initArchiveFilesData(data);
272
  Duplicator.Pack.initArchiveDBData(data);
273
 
274
+ //Addon Sites
275
+ $('#data-arc-status-addonsites').html(Duplicator.Pack.setScanStatus(data.ARC.Status.AddonSites));
276
+ if (data.ARC.FilterInfo.Dirs.AddonSites !== undefined && data.ARC.FilterInfo.Dirs.AddonSites.length > 0) {
277
+ $("#addonsites-block").show();
278
+ }
279
+
280
  $('#dup-msg-success').show();
281
 
282
  //Waring Check
views/packages/main/s2.scan3.php CHANGED
@@ -151,6 +151,59 @@ TOTAL SIZE -->
151
  </div>
152
  </div>
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  <!-- ============
155
  FILE NAME CHECKS -->
156
  <div class="scan-item scan-item-last">
@@ -547,7 +600,19 @@ jQuery(document).ready(function($)
547
  $btn.html('<i class="fa fa-circle-o-notch fa-spin"></i> <?php _e('Initializing Please Wait...', 'duplicator');?>');
548
  $btn.attr('disabled', 'true');
549
 
550
- var id = (type == 'large') ? '#hb-files-large-result' : '#hb-files-utf8-result'
 
 
 
 
 
 
 
 
 
 
 
 
551
  var dirFilters = [];
552
  var fileFilters = [];
553
  $(id + " input[name='dir_paths[]']:checked").each(function() {dirFilters.push($(this).val());});
@@ -593,6 +658,12 @@ jQuery(document).ready(function($)
593
  var html = templateScript(data);
594
  $('#hb-files-large-result').html(html);
595
 
 
 
 
 
 
 
596
  //NAME CHECKS
597
  var template = $('#hb-files-utf8').html();
598
  var templateScript = Handlebars.compile(template);
151
  </div>
152
  </div>
153
 
154
+ <!-- ======================
155
+ ADDON SITES -->
156
+ <div id="addonsites-block" class="scan-item">
157
+ <div class='title' onclick="Duplicator.Pack.toggleScanItem(this);">
158
+ <div class="text"><i class="fa fa-caret-right"></i> <?php _e('Addon Sites');?></div>
159
+ <div id="data-arc-status-addonsites"></div>
160
+ </div>
161
+ <div class="info">
162
+ <div style="margin-bottom:10px;">
163
+ <small>
164
+ <?php
165
+ printf(__('An "Addon Site" is a separate WordPress site(s) residing in subdirectories within this site. If you confirm these to be separate sites, '
166
+ . 'then it is recommended that you exclude them by checking the corresponding boxes below and clicking the \'Add Filters & Rescan\' button. To backup the other sites '
167
+ . 'install the plugin on the sites needing to be backed-up.'));
168
+ ?>
169
+ </small>
170
+ </div>
171
+ <script id="hb-addon-sites" type="text/x-handlebars-template">
172
+ <div class="container">
173
+ <div class="hdrs">
174
+ <span style="font-weight:bold">
175
+ <?php _e('Quick Filters'); ?>
176
+ </span>
177
+ </div>
178
+ <div class="data">
179
+ {{#if ARC.FilterInfo.Dirs.AddonSites.length}}
180
+ {{#each ARC.FilterInfo.Dirs.AddonSites as |path|}}
181
+ <div class="directory">
182
+ <input type="checkbox" name="dir_paths[]" value="{{path}}" id="as_dir_{{@index}}"/>
183
+ <label for="as_dir_{{@index}}" title="{{path}}">
184
+ {{path}}
185
+ </label>
186
+ </div>
187
+ {{/each}}
188
+ {{else}}
189
+ <?php _e('No add on sites found.'); ?>
190
+ {{/if}}
191
+ </div>
192
+ </div>
193
+ <div class="apply-btn">
194
+ <div class="apply-warn">
195
+ <?php _e('*Checking a directory will exclude all items in that path recursively.'); ?>
196
+ </div>
197
+ <button type="button" class="button-small" onclick="Duplicator.Pack.applyFilters(this, 'addon')">
198
+ <i class="fa fa-filter"></i> <?php _e('Add Filters &amp; Rescan');?>
199
+ </button>
200
+ </div>
201
+ </script>
202
+ <div id="hb-addon-sites-result" class="hb-files-style"></div>
203
+ </div>
204
+ </div>
205
+
206
+
207
  <!-- ============
208
  FILE NAME CHECKS -->
209
  <div class="scan-item scan-item-last">
600
  $btn.html('<i class="fa fa-circle-o-notch fa-spin"></i> <?php _e('Initializing Please Wait...', 'duplicator');?>');
601
  $btn.attr('disabled', 'true');
602
 
603
+ //var id = (type == 'large') ? '#hb-files-large-result' : '#hb-files-utf8-result'
604
+ var id = '';
605
+ switch(type){
606
+ case 'large':
607
+ id = '#hb-files-large-result';
608
+ break;
609
+ case 'utf8':
610
+ id = '#hb-files-utf8-result';
611
+ break;
612
+ case 'addon':
613
+ id = '#hb-addon-sites-result';
614
+ break;
615
+ }
616
  var dirFilters = [];
617
  var fileFilters = [];
618
  $(id + " input[name='dir_paths[]']:checked").each(function() {dirFilters.push($(this).val());});
658
  var html = templateScript(data);
659
  $('#hb-files-large-result').html(html);
660
 
661
+ //ADDON SITES
662
+ var template = $('#hb-addon-sites').html();
663
+ var templateScript = Handlebars.compile(template);
664
+ var html = templateScript(data);
665
+ $('#hb-addon-sites-result').html(html);
666
+
667
  //NAME CHECKS
668
  var template = $('#hb-files-utf8').html();
669
  var templateScript = Handlebars.compile(template);
views/settings/general.php CHANGED
@@ -21,7 +21,8 @@ if (isset($_POST['action']) && $_POST['action'] == 'save') {
21
  DUP_Settings::Set('wpfront_integrate', isset($_POST['wpfront_integrate']) ? "1" : "0");
22
  DUP_Settings::Set('package_debug', isset($_POST['package_debug']) ? "1" : "0");
23
 
24
- $action_updated = DUP_Settings::Save();
 
25
  DUP_Util::initSnapshotDirectory();
26
  }
27
 
@@ -49,7 +50,7 @@ $package_debug = DUP_Settings::Get('package_debug');
49
  <input type="hidden" name="page" value="duplicator-settings">
50
 
51
  <?php if ($action_updated) : ?>
52
- <div id="message" class="updated below-h2"><p><?php echo $action_response; ?></p></div>
53
  <?php endif; ?>
54
 
55
 
21
  DUP_Settings::Set('wpfront_integrate', isset($_POST['wpfront_integrate']) ? "1" : "0");
22
  DUP_Settings::Set('package_debug', isset($_POST['package_debug']) ? "1" : "0");
23
 
24
+ DUP_Settings::Save();
25
+ $action_updated = true;
26
  DUP_Util::initSnapshotDirectory();
27
  }
28
 
50
  <input type="hidden" name="page" value="duplicator-settings">
51
 
52
  <?php if ($action_updated) : ?>
53
+ <div id="message" class="notice notice-success is-dismissible dup-wpnotice-box"><p><?php echo $action_response; ?></p></div>
54
  <?php endif; ?>
55
 
56
 
views/settings/packages.php CHANGED
@@ -15,7 +15,9 @@ if (isset($_POST['action']) && $_POST['action'] == 'save') {
15
 
16
  //Package
17
  $mysqldump_enabled = isset($_POST['package_dbmode']) && $_POST['package_dbmode'] == 'mysql' ? "1" : "0";
18
- $mysqldump_exe_file = isset($_POST['package_mysqldump_path']) ? trim(esc_sql(strip_tags($_POST['package_mysqldump_path']))) : null;
 
 
19
  $mysqldump_path_valid = is_file($mysqldump_exe_file) ? true : false;
20
 
21
  DUP_Settings::Set('last_updated', date('Y-m-d-H-i-s'));
@@ -56,7 +58,7 @@ $mysqlDumpFound = ($mysqlDumpPath) ? true : false;
56
  <input type="hidden" name="page" value="duplicator-settings">
57
 
58
  <?php if ($action_updated) : ?>
59
- <div id="message" class="updated below-h2"><p><?php echo $action_response; ?></p></div>
60
  <?php endif; ?>
61
 
62
  <h3 class="title"><?php _e("Visual", 'duplicator') ?> </h3>
15
 
16
  //Package
17
  $mysqldump_enabled = isset($_POST['package_dbmode']) && $_POST['package_dbmode'] == 'mysql' ? "1" : "0";
18
+ $mysqldump_exe_file = isset($_POST['package_mysqldump_path'])
19
+ ? trim(DUP_DB::escSQL(strip_tags($_POST['package_mysqldump_path']), true))
20
+ : null;
21
  $mysqldump_path_valid = is_file($mysqldump_exe_file) ? true : false;
22
 
23
  DUP_Settings::Set('last_updated', date('Y-m-d-H-i-s'));
58
  <input type="hidden" name="page" value="duplicator-settings">
59
 
60
  <?php if ($action_updated) : ?>
61
+ <div id="message" class="notice notice-success is-dismissible dup-wpnotice-box"><p><?php echo $action_response; ?></p></div>
62
  <?php endif; ?>
63
 
64
  <h3 class="title"><?php _e("Visual", 'duplicator') ?> </h3>
views/tools/cleanup.php CHANGED
@@ -52,7 +52,7 @@
52
  <form id="dup-settings-form" action="?page=duplicator-tools&tab=cleanup" method="post">
53
 
54
  <?php if ($_GET['action'] != 'display') : ?>
55
- <div id="message" class="updated below-h2">
56
  <p><b><?php echo $action_response; ?></b></p>
57
  <?php if ( $_GET['action'] == 'installer') : ?>
58
  <?php
52
  <form id="dup-settings-form" action="?page=duplicator-tools&tab=cleanup" method="post">
53
 
54
  <?php if ($_GET['action'] != 'display') : ?>
55
+ <div id="message" class="notice notice-success is-dismissible">
56
  <p><b><?php echo $action_response; ?></b></p>
57
  <?php if ( $_GET['action'] == 'installer') : ?>
58
  <?php
views/tools/controller.php CHANGED
@@ -14,21 +14,147 @@ $current_tab = isset($_REQUEST['tab']) ? esc_html($_REQUEST['tab']) : 'diagnosti
14
  <style>
15
  div.lite-sub-tabs {padding: 10px 0 10px 0; font-size: 14px}
16
  </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  <div class="wrap">
18
 
19
  <?php duplicator_header(__("Tools", 'duplicator')) ?>
20
 
21
  <h2 class="nav-tab-wrapper">
22
  <a href="?page=duplicator-tools&tab=diagnostics" class="nav-tab <?php echo ($current_tab == 'diagnostics') ? 'nav-tab-active' : '' ?>"> <?php _e('Diagnostics', 'duplicator'); ?></a>
23
- <a href="?page=duplicator-tools&tab=cleanup" class="nav-tab <?php echo ($current_tab == 'cleanup') ? 'nav-tab-active' : '' ?>"> <?php _e('Cleanup', 'duplicator'); ?></a>
24
- </h2>
25
 
26
  <?php
27
  switch ($current_tab) {
28
  case 'diagnostics': include('diagnostics/main.php');
29
  break;
30
- case 'cleanup': include('cleanup.php');
31
- break;
32
  }
33
  ?>
34
  </div>
14
  <style>
15
  div.lite-sub-tabs {padding: 10px 0 10px 0; font-size: 14px}
16
  </style>
17
+ <?php
18
+
19
+ $installer_files = DUP_Server::getInstallerFiles();
20
+ $package_name = (isset($_GET['package'])) ? esc_html($_GET['package']) : '';
21
+ $package_path = (isset($_GET['package'])) ? DUPLICATOR_WPROOTPATH . esc_html($_GET['package']) : '';
22
+
23
+ $txt_found = __('File Found', 'duplicator');
24
+ $txt_removed = __('File Removed', 'duplicator');
25
+ $txt_archive_msg = __("<b>Archive File:</b> The archive file has a unique hashed name when downloaded. Leaving the archive file on your server does not impose a security"
26
+ . " risk if the file was not renamed. It is still recommended to remove the archive file after install,"
27
+ . " especially if it was renamed.", 'duplicator');
28
+
29
+ $nonce = wp_create_nonce('duplicator_cleanup_page');
30
+ $section = (isset($_GET['section'])) ?$_GET['section']:'';
31
+ if($current_tab == "diagnostics" && ($section == "info" || $section == '')){
32
+ $ajax_nonce = wp_create_nonce('DUP_CTRL_Tools_deleteInstallerFiles');
33
+ $_GET['action'] = isset($_GET['action']) ? $_GET['action'] : 'display';
34
+
35
+ if (isset($_GET['action'])) {
36
+ if (($_GET['action'] == 'installer') || ($_GET['action'] == 'legacy') || ($_GET['action'] == 'tmp-cache')) {
37
+ $verify_nonce = $_REQUEST['_wpnonce'];
38
+ if (!wp_verify_nonce($verify_nonce, 'duplicator_cleanup_page')) {
39
+ exit; // Get out of here bad nounce!
40
+ }
41
+ }
42
+ }
43
+
44
+ switch ($_GET['action']) {
45
+ case 'installer' :
46
+ $action_response = __('Installer file cleanup ran!', 'duplicator');
47
+ $css_hide_msg = 'div.error {display:none}';
48
+ break;
49
+ case 'legacy':
50
+ DUP_Settings::LegacyClean();
51
+ $action_response = __('Legacy data removed.', 'duplicator');
52
+ break;
53
+ case 'tmp-cache':
54
+ DUP_Package::tempFileCleanup(true);
55
+ $action_response = __('Build cache removed.', 'duplicator');
56
+ break;
57
+ }
58
+
59
+ if ($_GET['action'] != 'display') : ?>
60
+ <div id="message" class="notice notice-success is-dismissible">
61
+ <p><b><?php echo $action_response; ?></b></p>
62
+ <?php if ( $_GET['action'] == 'installer') : ?>
63
+ <?php
64
+ $html = "";
65
+
66
+ //REMOVE CORE INSTALLER FILES
67
+ $installer_files = DUP_Server::getInstallerFiles();
68
+ foreach ($installer_files as $file => $path) {
69
+ @unlink($path);
70
+ echo (file_exists($path))
71
+ ? "<div class='failed'><i class='fa fa-exclamation-triangle'></i> {$txt_found} - {$path} </div>"
72
+ : "<div class='success'> <i class='fa fa-check'></i> {$txt_removed} - {$path} </div>";
73
+ }
74
+
75
+ //No way to know exact name of archive file except from installer.
76
+ //The only place where the package can be removed is from installer
77
+ //So just show a message if removing from plugin.
78
+ if (file_exists($package_path)) {
79
+ $path_parts = pathinfo($package_name);
80
+ $path_parts = (isset($path_parts['extension'])) ? $path_parts['extension'] : '';
81
+ if ($path_parts == "zip" && !is_dir($package_path)) {
82
+ $html .= (@unlink($package_path))
83
+ ? "<div class='success'><i class='fa fa-check'></i> {$txt_removed} - {$package_path}</div>"
84
+ : "<div class='failed'><i class='fa fa-exclamation-triangle'></i> {$txt_found} - {$package_path}</div>";
85
+ }
86
+ }
87
+
88
+ echo $html;
89
+ ?><br/>
90
+
91
+ <div style="font-style: italic; max-width:900px">
92
+ <b><?php _e('Security Notes', 'duplicator')?>:</b>
93
+ <?php _e('If the installer files do not successfully get removed with this action, then they WILL need to be removed manually through your hosts control panel, '
94
+ . ' file system or FTP. Please remove all installer files listed above to avoid leaving open security issues on your server.', 'duplicator')?>
95
+ <br/><br/>
96
+ <?php echo $txt_archive_msg; ?>
97
+ <br/><br/>
98
+ </div>
99
+
100
+ <?php endif; ?>
101
+ </div>
102
+ <?php endif;
103
+ if(isset($_GET['action']) && $_GET['action']=="installer" && get_option("duplicator_exe_safe_mode")){
104
+ $safe_title = __('This site has been successfully migrated!');
105
+ $safe_msg = __('Please test the entire site to validate the migration process!');
106
+
107
+ switch(get_option("duplicator_exe_safe_mode")){
108
+ //safe_mode basic
109
+ case 1:
110
+ $safe_msg = __('NOTICE: Safe mode (Basic) was enabled during install, be sure to re-enable all your plugins.');
111
+ break;
112
+ //safe_mode advance
113
+ case 2:
114
+ $safe_msg = __('NOTICE: Safe mode (Advanced) was enabled during install, be sure to re-enable all your plugins.');
115
+
116
+ $temp_theme = null;
117
+ $active_theme = wp_get_theme();
118
+ $available_themes = wp_get_themes();
119
+ foreach($available_themes as $theme){
120
+ if($temp_theme == null && $theme->stylesheet != $active_theme->stylesheet){
121
+ $temp_theme = array('stylesheet' => $theme->stylesheet, 'template' => $theme->template);
122
+ break;
123
+ }
124
+ }
125
+
126
+ if($temp_theme != null){
127
+ //switch to another theme then backto default
128
+ switch_theme($temp_theme['template'], $temp_theme['stylesheet']);
129
+ switch_theme($active_theme->template, $active_theme->stylesheet);
130
+ }
131
+
132
+
133
+ break;
134
+ }
135
+
136
+ if (! DUP_Server::hasInstallerFiles()) {
137
+ echo "<div class='notice notice-success cleanup-notice'><p><b class='title'><i class='fa fa-check-circle'></i> {$safe_title}</b> "
138
+ . "<div class='notice-safemode'>{$safe_msg}</p></div></div>";
139
+ }
140
+
141
+ delete_option("duplicator_exe_safe_mode");
142
+ }
143
+ }
144
+ ?>
145
+
146
  <div class="wrap">
147
 
148
  <?php duplicator_header(__("Tools", 'duplicator')) ?>
149
 
150
  <h2 class="nav-tab-wrapper">
151
  <a href="?page=duplicator-tools&tab=diagnostics" class="nav-tab <?php echo ($current_tab == 'diagnostics') ? 'nav-tab-active' : '' ?>"> <?php _e('Diagnostics', 'duplicator'); ?></a>
152
+ </h2>
 
153
 
154
  <?php
155
  switch ($current_tab) {
156
  case 'diagnostics': include('diagnostics/main.php');
157
  break;
 
 
158
  }
159
  ?>
160
  </div>
views/tools/diagnostics/inc.data.php CHANGED
@@ -2,6 +2,9 @@
2
 
3
  $sql = "SELECT * FROM `{$wpdb->prefix}options` WHERE `option_name` LIKE '%duplicator_%' AND `option_name` NOT LIKE '%duplicator_pro%' ORDER BY option_name";
4
 
 
 
 
5
  ?>
6
 
7
  <!-- ==============================
@@ -13,14 +16,54 @@ OPTIONS DATA -->
13
  <div class="dup-box-arrow"></div>
14
  </div>
15
  <div class="dup-box-panel" id="dup-settings-diag-opts-panel" style="<?php echo $ui_css_opts_panel?>">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  <div style="padding:0px 20px 0px 25px">
17
  <h3 class="title" style="margin-left:-15px"><?php _e("Options Values", 'duplicator') ?> </h3>
18
-
19
- <table class="widefat" cellspacing="0">
20
- <tr>
21
- <th>Key</th>
22
- <th>Value</th>
23
- </tr>
 
 
24
  <?php
25
  foreach( $wpdb->get_results("{$sql}") as $key => $row) { ?>
26
  <tr>
@@ -33,7 +76,8 @@ OPTIONS DATA -->
33
  </td>
34
  <td><textarea class="dup-opts-read" readonly="readonly"><?php echo $row->option_value?></textarea></td>
35
  </tr>
36
- <?php } ?>
 
37
  </table>
38
  </div>
39
 
@@ -50,6 +94,12 @@ THICK-BOX DIALOGS: -->
50
  $confirm1->progressText = __('Removing Option, Please Wait...', 'duplicator');
51
  $confirm1->jscallback = 'Duplicator.Settings.DeleteOption()';
52
  $confirm1->initConfirm();
 
 
 
 
 
 
53
  ?>
54
 
55
  <script>
@@ -70,5 +120,40 @@ jQuery(document).ready(function($)
70
  {
71
  jQuery('#dup-settings-form').submit();
72
  }
73
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  </script>
2
 
3
  $sql = "SELECT * FROM `{$wpdb->prefix}options` WHERE `option_name` LIKE '%duplicator_%' AND `option_name` NOT LIKE '%duplicator_pro%' ORDER BY option_name";
4
 
5
+ $txt_archive_msg = __("<b>Archive File:</b> The archive file has a unique hashed name when downloaded. Leaving the archive file on your server does not impose a security"
6
+ . " risk if the file was not renamed. It is still recommended to remove the archive file after install,"
7
+ . " especially if it was renamed.", 'duplicator');
8
  ?>
9
 
10
  <!-- ==============================
16
  <div class="dup-box-arrow"></div>
17
  </div>
18
  <div class="dup-box-panel" id="dup-settings-diag-opts-panel" style="<?php echo $ui_css_opts_panel?>">
19
+ <div style="padding-left:10px">
20
+ <h3 class="title"><?php _e('Data Cleanup', 'duplicator') ?></h3>
21
+ <table class="dup-reset-opts">
22
+ <tr style="vertical-align:text-top">
23
+ <td>
24
+ <button id="dup-remove-installer-files-btn" type="button" class="button button-small dup-fixed-btn" onclick="Duplicator.Tools.deleteInstallerFiles();">
25
+ <?php _e("Remove Installation Files", 'duplicator'); ?>
26
+ </button>
27
+ </td>
28
+ <td>
29
+ <?php _e("Removes all reserved installer files.", 'duplicator'); ?>
30
+ <a href="javascript:void(0)" onclick="jQuery('#dup-tools-delete-moreinfo').toggle()">[<?php _e("more info", 'duplicator'); ?>]</a><br/>
31
+
32
+ <div id="dup-tools-delete-moreinfo">
33
+ <?php
34
+ _e("Clicking on the 'Remove Installation Files' button will remove the files used by Duplicator to install this site. "
35
+ ."These files should not be left on production systems for security reasons.", 'duplicator');
36
+ echo "<br/><br/>";
37
+
38
+ foreach ($installer_files as $file => $path) {
39
+ echo (file_exists($path)) ? "<div class='failed'><i class='fa fa-exclamation-triangle'></i> {$txt_found} - {$file}</div>" : "<div class='success'><i class='fa fa-check'></i> {$txt_removed} - {$file}</div>";
40
+ }
41
+ echo "<br/>";
42
+ echo $txt_archive_msg;
43
+ ?>
44
+ </div>
45
+ </td>
46
+ </tr>
47
+ <tr>
48
+ <td>
49
+ <button type="button" class="button button-small dup-fixed-btn" onclick="Duplicator.Tools.ConfirmClearBuildCache()">
50
+ <?php _e("Clear Build Cache", 'duplicator'); ?>
51
+ </button>
52
+ </td>
53
+ <td><?php _e("Removes all build data from:", 'duplicator'); ?> [<?php echo DUPLICATOR_SSDIR_PATH_TMP ?>].</td>
54
+ </tr>
55
+ </table>
56
+ </div>
57
  <div style="padding:0px 20px 0px 25px">
58
  <h3 class="title" style="margin-left:-15px"><?php _e("Options Values", 'duplicator') ?> </h3>
59
+ <table class="widefat" cellspacing="0">
60
+ <thead>
61
+ <tr>
62
+ <th>Key</th>
63
+ <th>Value</th>
64
+ </tr>
65
+ </thead>
66
+ <tbody>
67
  <?php
68
  foreach( $wpdb->get_results("{$sql}") as $key => $row) { ?>
69
  <tr>
76
  </td>
77
  <td><textarea class="dup-opts-read" readonly="readonly"><?php echo $row->option_value?></textarea></td>
78
  </tr>
79
+ <?php } ?>
80
+ </tbody>
81
  </table>
82
  </div>
83
 
94
  $confirm1->progressText = __('Removing Option, Please Wait...', 'duplicator');
95
  $confirm1->jscallback = 'Duplicator.Settings.DeleteOption()';
96
  $confirm1->initConfirm();
97
+
98
+ $confirm2 = new DUP_UI_Dialog();
99
+ $confirm2->title = __('Clear Build Cache?', 'duplicator');
100
+ $confirm2->message = __('This process will remove all build cache files. Be sure no packages are currently building or else they will be cancelled.', 'duplicator');
101
+ $confirm2->jscallback = 'Duplicator.Tools.ClearBuildCache()';
102
+ $confirm2->initConfirm();
103
  ?>
104
 
105
  <script>
120
  {
121
  jQuery('#dup-settings-form').submit();
122
  }
123
+
124
+ Duplicator.Tools.ConfirmClearBuildCache = function ()
125
+ {
126
+ <?php $confirm2->showConfirm(); ?>
127
+ }
128
+
129
+ Duplicator.Tools.ClearBuildCache = function ()
130
+ {
131
+ window.location = '?page=duplicator-tools&tab=diagnostics&action=tmp-cache&_wpnonce=<?php echo $nonce; ?>';
132
+ }
133
+ });
134
+
135
+
136
+ Duplicator.Tools.deleteInstallerFiles = function()
137
+ {
138
+ var data = {
139
+ action: 'DUP_CTRL_Tools_deleteInstallerFiles',
140
+ nonce: '<?php echo $ajax_nonce; ?>',
141
+ 'archive-name': '<?php echo $package_name; ?>'
142
+ };
143
+
144
+ jQuery.ajax({
145
+ type: "POST",
146
+ url: ajaxurl,
147
+ dataType: "json",
148
+ data: data,
149
+ complete: function() {
150
+ <?php
151
+ $url = "?page=duplicator-tools&tab=diagnostics&action=installer&_wpnonce={$nonce}&package={$package_name}";
152
+ echo "window.location = '{$url}';";
153
+ ?>
154
+ },
155
+ error: function(data) {console.log(data)},
156
+ done: function(data) {console.log(data)}
157
+ });
158
+ }
159
  </script>
views/tools/diagnostics/information.php CHANGED
@@ -1,12 +1,21 @@
1
- <form id="dup-settings-form" action="<?php echo admin_url( 'admin.php?page=duplicator-tools&tab=diagnostics&section=diagnostic' ); ?>" method="post">
2
  <?php wp_nonce_field( 'duplicator_settings_page', '_wpnonce', false ); ?>
3
  <input type="hidden" id="dup-settings-form-action" name="action" value="">
4
- <br/>
5
 
6
  <?php if (! empty($action_response)) : ?>
7
- <div id="message" class="updated below-h2"><p><?php echo $action_response; ?></p></div>
8
  <?php endif; ?>
9
 
 
 
 
 
 
 
 
 
 
 
10
  <?php
11
  include_once 'inc.data.php';
12
  include_once 'inc.settings.php';
1
+ <form id="dup-settings-form" action="<?php echo admin_url( 'admin.php?page=duplicator-tools&tab=diagnostics&section=info' ); ?>" method="post">
2
  <?php wp_nonce_field( 'duplicator_settings_page', '_wpnonce', false ); ?>
3
  <input type="hidden" id="dup-settings-form-action" name="action" value="">
 
4
 
5
  <?php if (! empty($action_response)) : ?>
6
+ <div id="message" class="notice notice-success is-dismissible dup-wpnotice-box"><p><?php echo $action_response; ?></p></div>
7
  <?php endif; ?>
8
 
9
+ <style>
10
+ <?php echo isset($css_hide_msg) ? $css_hide_msg : ''; ?>
11
+ div.success {color:#4A8254}
12
+ div.failed {color:red}
13
+ table.dup-reset-opts td:first-child {font-weight: bold}
14
+ table.dup-reset-opts td {padding:10px}
15
+ button.dup-fixed-btn {min-width: 150px; text-align: center}
16
+ div#dup-tools-delete-moreinfo {display: none; padding: 5px 0 0 20px; border:1px solid silver; background-color: #fff; border-radius: 5px; padding:10px; margin:5px; width:750px }
17
+ </style>
18
+
19
  <?php
20
  include_once 'inc.data.php';
21
  include_once 'inc.settings.php';