Duplicator – WordPress Migration Plugin - Version 1.2.36

Version Description

Download this release

Release Info

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

Code changes from version 1.2.34 to 1.2.36

ctrls/ctrl.tools.php CHANGED
@@ -1,105 +1,106 @@
1
- <?php
2
- if ( ! defined('DUPLICATOR_VERSION') ) exit; // Exit if accessed directly
3
-
4
- require_once(DUPLICATOR_PLUGIN_PATH . '/ctrls/ctrl.base.php');
5
- require_once(DUPLICATOR_PLUGIN_PATH . '/classes/utilities/class.u.scancheck.php');
6
-
7
- /**
8
- * Controller for Tools
9
- * @package Dupicator\ctrls
10
- */
11
- class DUP_CTRL_Tools extends DUP_CTRL_Base
12
- {
13
- /**
14
- * Init this instance of the object
15
- */
16
- function __construct()
17
- {
18
- add_action('wp_ajax_DUP_CTRL_Tools_runScanValidator', array($this, 'runScanValidator'));
19
- add_action('wp_ajax_DUP_CTRL_Tools_deleteInstallerFiles', array($this, 'deleteInstallerFiles'));
20
- }
21
-
22
- /**
23
- * Calls the ScanValidator and returns a JSON result
24
- *
25
- * @param string $_POST['scan-path'] The path to start scanning from, defaults to DUPLICATOR_WPROOTPATH
26
- * @param bool $_POST['scan-recursive'] Recursivly search the path
27
- *
28
- * @notes: Testing = /wp-admin/admin-ajax.php?action=DUP_CTRL_Tools_runScanValidator
29
- */
30
- public function runScanValidator($post)
31
- {
32
- @set_time_limit(0);
33
- $post = $this->postParamMerge($post);
34
- check_ajax_referer($post['action'], 'nonce');
35
-
36
- $result = new DUP_CTRL_Result($this);
37
-
38
- try
39
- {
40
- //CONTROLLER LOGIC
41
- $path = isset($post['scan-path']) ? $post['scan-path'] : DUPLICATOR_WPROOTPATH;
42
- if (!is_dir($path)) {
43
- throw new Exception("Invalid directory provided '{$path}'!");
44
- }
45
- $scanner = new DUP_ScanCheck();
46
- $scanner->recursion = (isset($post['scan-recursive']) && $post['scan-recursive'] != 'false') ? true : false;
47
- $payload = $scanner->run($path);
48
-
49
- //RETURN RESULT
50
- $test = ($payload->fileCount > 0)
51
- ? DUP_CTRL_Status::SUCCESS
52
- : DUP_CTRL_Status::FAILED;
53
- $result->process($payload, $test);
54
- }
55
- catch (Exception $exc)
56
- {
57
- $result->processError($exc);
58
- }
59
- }
60
-
61
-
62
- /**
63
- * Removed all reserved installer files names
64
- *
65
- * @param string $_POST['archive-name'] The name of the archive file used to create this site
66
- *
67
- * @notes: Testing = /wp-admin/admin-ajax.php?action=DUP_CTRL_Tools_deleteInstallerFiles
68
- */
69
- public function deleteInstallerFiles($post)
70
- {
71
- $post = $this->postParamMerge($post);
72
- check_ajax_referer($post['action'], 'nonce');
73
- $result = new DUP_CTRL_Result($this);
74
- try
75
- {
76
- //CONTROLLER LOGIC
77
- $installer_files = DUP_Server::getInstallerFiles();
78
- //array_push($installer_files, $package_path);
79
- foreach($installer_files as $file => $path) {
80
- if (! is_dir($path)) {
81
- @chmod($path, 0777);
82
- $status = (@unlink($path) === false) ? false : true;
83
- $payload[] = array(
84
- 'file' => $path,
85
- 'removed' => $status,
86
- 'writable' => is_writable($path),
87
- 'readable' => is_readable($path),
88
- 'exists' => file_exists($path)
89
- );
90
- }
91
- }
92
-
93
- //RETURN RESULT
94
- $test = (in_array(true, $payload['exists']))
95
- ? DUP_CTRL_Status::FAILED
96
- : DUP_CTRL_Status::SUCCESS;
97
- $result->process($payload, $test);
98
- }
99
- catch (Exception $exc)
100
- {
101
- $result->processError($exc);
102
- }
103
- }
104
-
105
- }
 
1
+ <?php
2
+ if ( ! defined('DUPLICATOR_VERSION') ) exit; // Exit if accessed directly
3
+
4
+ require_once(DUPLICATOR_PLUGIN_PATH . '/ctrls/ctrl.base.php');
5
+ require_once(DUPLICATOR_PLUGIN_PATH . '/classes/utilities/class.u.scancheck.php');
6
+
7
+ /**
8
+ * Controller for Tools
9
+ * @package Dupicator\ctrls
10
+ */
11
+ class DUP_CTRL_Tools extends DUP_CTRL_Base
12
+ {
13
+ /**
14
+ * Init this instance of the object
15
+ */
16
+ function __construct()
17
+ {
18
+ add_action('wp_ajax_DUP_CTRL_Tools_runScanValidator', array($this, 'runScanValidator'));
19
+ add_action('wp_ajax_DUP_CTRL_Tools_deleteInstallerFiles', array($this, 'deleteInstallerFiles'));
20
+ }
21
+
22
+ /**
23
+ * Calls the ScanValidator and returns a JSON result
24
+ *
25
+ * @param string $_POST['scan-path'] The path to start scanning from, defaults to DUPLICATOR_WPROOTPATH
26
+ * @param bool $_POST['scan-recursive'] Recursivly search the path
27
+ *
28
+ * @notes: Testing = /wp-admin/admin-ajax.php?action=DUP_CTRL_Tools_runScanValidator
29
+ */
30
+ public function runScanValidator($post)
31
+ {
32
+ @set_time_limit(0);
33
+ $post = $this->postParamMerge($post);
34
+ check_ajax_referer($post['action'], 'nonce');
35
+
36
+ $result = new DUP_CTRL_Result($this);
37
+
38
+ try
39
+ {
40
+ //CONTROLLER LOGIC
41
+ $path = isset($post['scan-path']) ? $post['scan-path'] : DUPLICATOR_WPROOTPATH;
42
+ if (!is_dir($path)) {
43
+ throw new Exception("Invalid directory provided '{$path}'!");
44
+ }
45
+ $scanner = new DUP_ScanCheck();
46
+ $scanner->recursion = (isset($post['scan-recursive']) && $post['scan-recursive'] != 'false') ? true : false;
47
+ $payload = $scanner->run($path);
48
+
49
+ //RETURN RESULT
50
+ $test = ($payload->fileCount > 0)
51
+ ? DUP_CTRL_Status::SUCCESS
52
+ : DUP_CTRL_Status::FAILED;
53
+ $result->process($payload, $test);
54
+ }
55
+ catch (Exception $exc)
56
+ {
57
+ $result->processError($exc);
58
+ }
59
+ }
60
+
61
+
62
+ /**
63
+ * Removed all reserved installer files names
64
+ *
65
+ * @param string $_POST['archive-name'] The name of the archive file used to create this site
66
+ *
67
+ * @notes: Testing = /wp-admin/admin-ajax.php?action=DUP_CTRL_Tools_deleteInstallerFiles
68
+ */
69
+ public function deleteInstallerFiles($post)
70
+ {
71
+ $post = $this->postParamMerge($post);
72
+ check_ajax_referer($post['action'], 'nonce');
73
+ $result = new DUP_CTRL_Result($this);
74
+ $payload = array();
75
+ try
76
+ {
77
+ //CONTROLLER LOGIC
78
+ $installer_files = DUP_Server::getInstallerFiles();
79
+ //array_push($installer_files, $package_path);
80
+ foreach($installer_files as $file => $path) {
81
+ if (! is_dir($path)) {
82
+ @chmod($path, 0777);
83
+ $status = (@unlink($path) === false) ? false : true;
84
+ $payload[] = array(
85
+ 'file' => $path,
86
+ 'removed' => $status,
87
+ 'writable' => is_writable($path),
88
+ 'readable' => is_readable($path),
89
+ 'exists' => file_exists($path)
90
+ );
91
+ }
92
+ }
93
+
94
+ //RETURN RESULT
95
+ $test = (in_array(true, $payload['exists']))
96
+ ? DUP_CTRL_Status::FAILED
97
+ : DUP_CTRL_Status::SUCCESS;
98
+ $result->process($payload, $test);
99
+ }
100
+ catch (Exception $exc)
101
+ {
102
+ $result->processError($exc);
103
+ }
104
+ }
105
+
106
+ }
ctrls/ctrl.ui.php CHANGED
@@ -86,7 +86,7 @@ class DUP_CTRL_UI extends DUP_CTRL_Base
86
  $payload = DUP_UI_ViewState::getArray();
87
 
88
  //RETURN RESULT
89
- $test = (count($payload))
90
  ? DUP_CTRL_Status::SUCCESS
91
  : DUP_CTRL_Status::FAILED;
92
  return $result->process($payload, $test);
86
  $payload = DUP_UI_ViewState::getArray();
87
 
88
  //RETURN RESULT
89
+ $test = (is_array($payload) && count($payload))
90
  ? DUP_CTRL_Status::SUCCESS
91
  : DUP_CTRL_Status::FAILED;
92
  return $result->process($payload, $test);
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.34');
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.36');
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.34
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.36
7
  Author: Snap Creek
8
  Author URI: http://www.snapcreek.com/duplicator/
9
  Text Domain: duplicator
installer/build/classes/class.engine.php CHANGED
@@ -146,19 +146,9 @@ class DUPX_UpdateEngine
146
  'err_all' => 0
147
  );
148
 
149
- // Let's use anonymous function after PHP5.3.0 - is faster than create_function()
150
- // create_function() is removed from PHP 7.2
151
- if(DUPX_U::isVersion('5.3.0')) {
152
- // Use "try catch" to avoid PHP notice or error below PHP5.3.0
153
- try {
154
- $walk_function = function () use (&$str) {
155
- $str = "`$str`";
156
- };
157
- }
158
- catch (Exception $exc) {}
159
- } else {
160
- $walk_function = create_function('&$str', '$str = "`$str`";');
161
- }
162
 
163
  $profile_start = DUPX_U::getMicrotime();
164
  if (is_array($tables) && !empty($tables)) {
@@ -194,7 +184,7 @@ class DUPX_UpdateEngine
194
  if (!$fullsearch) {
195
  $colList = self::getTextColumns($dbh, $table);
196
  if ($colList != null && is_array($colList)) {
197
- array_walk($colList, $walk_function);
198
  $colList = implode(',', $colList);
199
  }
200
  $colMsg = (empty($colList)) ? '*' : '~';
@@ -339,13 +329,13 @@ class DUPX_UpdateEngine
339
  }
340
 
341
  /**
342
- * Take a serialised array and unserialise it replacing elements and
343
- * unserialising any subordinate arrays and performing the replace.
344
  *
345
  * @param string $from String we're looking to replace.
346
  * @param string $to What we want it to be replaced with
347
  * @param array $data Used to pass any subordinate arrays back to in.
348
- * @param bool $serialised Does the array passed via $data need serialising.
349
  *
350
  * @return array The original array with all elements replaced as needed.
351
  */
146
  'err_all' => 0
147
  );
148
 
149
+ function set_sql_column_safe(&$str) {
150
+ $str = "`$str`";
151
+ }
 
 
 
 
 
 
 
 
 
 
152
 
153
  $profile_start = DUPX_U::getMicrotime();
154
  if (is_array($tables) && !empty($tables)) {
184
  if (!$fullsearch) {
185
  $colList = self::getTextColumns($dbh, $table);
186
  if ($colList != null && is_array($colList)) {
187
+ array_walk($colList, set_sql_column_safe);
188
  $colList = implode(',', $colList);
189
  }
190
  $colMsg = (empty($colList)) ? '*' : '~';
329
  }
330
 
331
  /**
332
+ * Take a serialized array and unserialized it replacing elements and
333
+ * unserializing any subordinate arrays and performing the replace.
334
  *
335
  * @param string $from String we're looking to replace.
336
  * @param string $to What we want it to be replaced with
337
  * @param array $data Used to pass any subordinate arrays back to in.
338
+ * @param bool $serialised Does the array passed via $data need serializing.
339
  *
340
  * @return array The original array with all elements replaced as needed.
341
  */
installer/build/view.step1.php CHANGED
@@ -1,774 +1,777 @@
1
- <?php
2
- //VIEW: STEP 1- INPUT
3
-
4
- //ARCHIVE FILE
5
- $arcStatus = (file_exists($GLOBALS['ARCHIVE_PATH'])) ? 'Pass' : 'Fail';
6
- $arcFormat = ($arcStatus == 'Pass') ? 'Pass' : 'StatusFailed';
7
- $arcSize = @filesize($GLOBALS['ARCHIVE_PATH']);
8
- $arcSize = is_numeric($arcSize) ? $arcSize : 0;
9
- $zip_archive_enabled = class_exists('ZipArchive') ? 'Enabled' : 'Not Enabled';
10
-
11
- $arcSizeRatio = (((1.0) * $arcSize) / $GLOBALS['FW_PACKAGE_EST_SIZE']) * 100;
12
- $arcSizeStatus = ($arcSizeRatio > 90) ? 'Pass' : 'Fail';
13
-
14
- //ARCHIVE FORMAT
15
- if ($arcStatus) {
16
- if (class_exists('ZipArchive')){
17
- $zip = new ZipArchive();
18
- if($zip->open($GLOBALS['ARCHIVE_PATH']) === TRUE ) {
19
-
20
- $arcFilePath = basename($GLOBALS['ARCHIVE_PATH']);
21
- $arcFilePath = substr($arcFilePath, 0, strrpos($arcFilePath, "."));
22
- $badFiles = array('__MACOSX', $arcFilePath);
23
- $goodFiles = array('database.sql', 'installer-backup.php');
24
- $goodFilesFound = true;
25
- $badFilesFound = false;
26
-
27
- foreach ($badFiles as $val) {
28
- if (is_numeric($zip->locateName("{$val}/"))) {
29
- $badFilesFound = true;
30
- break;
31
- }
32
- }
33
-
34
- foreach ($goodFiles as $val) {
35
- if ($zip->locateName($val) !== true) {
36
- $goodFilesFound = false;
37
- }
38
- }
39
-
40
- $arcFormat = ($goodFilesFound == false && $badFilesFound == true) ? 'Fail' : 'Pass';
41
- }
42
- } else {
43
- $arcFormat = 'NoZipArchive';
44
- }
45
- }
46
-
47
- $all_arc = ($arcStatus == 'Pass' && $arcFormat != 'Fail' && $arcSizeStatus == 'Pass') ? 'Pass' : 'Fail';
48
-
49
- //REQUIRMENTS
50
- $req = array();
51
- $req['01'] = DUPX_Server::isDirWritable($GLOBALS["CURRENT_ROOT_PATH"]) ? 'Pass' : 'Fail';
52
- $req['02'] = 'Pass'; //Place-holder for future check
53
- $req['03'] = 'Pass'; //Place-holder for future check;
54
- $req['04'] = function_exists('mysqli_connect') ? 'Pass' : 'Fail';
55
- $req['05'] = DUPX_Server::$php_version_safe ? 'Pass' : 'Fail';
56
- $all_req = in_array('Fail', $req) ? 'Fail' : 'Pass';
57
-
58
- //NOTICES
59
- $openbase = ini_get("open_basedir");
60
- $scanfiles = @scandir($GLOBALS["CURRENT_ROOT_PATH"]);
61
- $scancount = is_array($scanfiles) ? (count($scanfiles)) : -1;
62
- $datetime1 = $GLOBALS['FW_CREATED'];
63
- $datetime2 = date("Y-m-d H:i:s");
64
- $fulldays = round(abs(strtotime($datetime1) - strtotime($datetime2))/86400);
65
- $root_path = DUPX_U::setSafePath($GLOBALS['CURRENT_ROOT_PATH']);
66
- $wpconf_path = "{$root_path}/wp-config.php";
67
- $max_time_zero = @set_time_limit(0);
68
- $max_time_size = 314572800; //300MB
69
- $max_time_ini = ini_get('max_execution_time');
70
- $max_time_warn = (is_numeric($max_time_ini) && $max_time_ini < 31 && $max_time_ini > 0) && $arcSize > $max_time_size;
71
-
72
-
73
- $notice = array();
74
- if (!$GLOBALS['FW_ARCHIVE_ONLYDB']) {
75
- $notice['01'] = ! file_exists($wpconf_path) ? 'Good' : 'Warn';
76
- $notice['02'] = $scancount <= 35 ? 'Good' : 'Warn';
77
- }
78
- $notice['03'] = $fulldays <= 120 ? 'Good' : 'Warn';
79
- $notice['04'] = 'Good'; //Place-holder for future check
80
- $notice['05'] = DUPX_Server::$php_version_53_plus ? 'Good' : 'Warn';
81
- $notice['06'] = empty($openbase) ? 'Good' : 'Warn';
82
- $notice['07'] = ! $max_time_warn ? 'Good' : 'Warn';
83
- $all_notice = in_array('Warn', $notice) ? 'Warn' : 'Good';
84
-
85
- //SUMMATION
86
- $req_success = ($all_req == 'Pass');
87
- $req_notice = ($all_notice == 'Good');
88
- $all_success = ($req_success && $req_notice);
89
- $agree_msg = "To enable this button the checkbox above under the 'Terms & Notices' must be checked.";
90
- ?>
91
-
92
-
93
- <form id='s1-input-form' method="post" class="content-form" >
94
- <input type="hidden" name="action_ajax" value="1" />
95
- <input type="hidden" name="action_step" value="1" />
96
- <input type="hidden" name="archive_name" value="<?php echo $GLOBALS['FW_PACKAGE_NAME'] ?>" />
97
-
98
- <div class="hdr-main">
99
- Step <span class="step">1</span> of 4: Deployment
100
- </div>
101
- <br/>
102
-
103
-
104
- <!-- ====================================
105
- ARCHIVE
106
- ==================================== -->
107
- <div class="hdr-sub1" id="s1-area-archive-file-link" data-type="toggle" data-target="#s1-area-archive-file">
108
- <a href="javascript:void(0)"><i class="dupx-plus-square"></i> Archive</a>
109
- <div class="<?php echo ($all_arc == 'Pass') ? 'status-badge-pass' : 'status-badge-fail'; ?>" style="float:right">
110
- <?php echo ($all_arc == 'Pass') ? 'Pass' : 'Fail'; ?>
111
- </div>
112
- </div>
113
- <div id="s1-area-archive-file" style="display:none">
114
-
115
- <table class="s1-archive-local">
116
- <tr>
117
- <td colspan="2"><div class="hdr-sub3">Site Details</div></td>
118
- </tr>
119
- <tr>
120
- <td>Site:</td>
121
- <td><?php echo $GLOBALS['FW_BLOGNAME'];?> </td>
122
- </tr>
123
- <tr>
124
- <td>Notes:</td>
125
- <td><?php echo strlen($GLOBALS['FW_PACKAGE_NOTES']) ? "{$GLOBALS['FW_PACKAGE_NOTES']}" : " - no notes - ";?></td>
126
- </tr>
127
- <?php if ($GLOBALS['FW_ARCHIVE_ONLYDB']) :?>
128
- <tr>
129
- <td>Mode:</td>
130
- <td>Archive only database was enabled during package package creation.</td>
131
- </tr>
132
- <?php endif; ?>
133
- </table>
134
-
135
- <table class="s1-archive-local">
136
- <tr>
137
- <td colspan="2"><div class="hdr-sub3">File Details</div></td>
138
- </tr>
139
- <tr style="vertical-align:top">
140
- <td>Size:</td>
141
- <td>
142
- <?php
143
- $projectedSize = DUPX_U::readableByteSize($GLOBALS['FW_PACKAGE_EST_SIZE']);
144
- $actualSize = DUPX_U::readableByteSize($arcSize);
145
- echo "{$actualSize}<br/>";
146
- if ($arcSizeStatus == 'Fail' ) {
147
- echo "<span class='dupx-fail'>The archive file size is currently <b>{$actualSize}</b> and its estimated file size should be around <b>{$projectedSize}</b>. "
148
- . "The archive file may not have been fully downloaded to the server. If so please wait for the file to completely download and then refresh this page.<br/><br/>";
149
-
150
- echo "This warning is only shown when the file has more than a 10% size ratio difference from when it was originally built. Please review the file sizes "
151
- . "to make sure the archive was downloaded to this server correctly if the download is complete.</span>";
152
- }
153
- ?>
154
- </td>
155
- </tr>
156
- <tr>
157
- <td>Name:</td>
158
- <td><?php echo "{$GLOBALS['FW_PACKAGE_NAME']}";?> </td>
159
- </tr>
160
- <tr>
161
- <td>Path:</td>
162
- <td><?php echo "{$GLOBALS['CURRENT_ROOT_PATH']}";?> </td>
163
- </tr>
164
- <tr>
165
- <td>Status:</td>
166
- <td>
167
- <?php if ($arcStatus != 'Fail') : ?>
168
- <span class="dupx-pass">File Found</span>
169
- <?php else : ?>
170
- <div class="s1-archive-failed-msg">
171
- <b class="dupx-fail">Archive File Not Found!</b><br/>
172
- The archive file name below must be the <u>exact</u> name of the archive file placed in the deployment path (character for character).
173
- If the file does not have the same name then rename it to the name above.
174
- <br/><br/>
175
-
176
- When downloading the package files make sure both files are from the same package line in the packages view. The archive file also
177
- must be completely downloaded to the server before starting the install. The following zip files were found at the deployment path:
178
- <?php
179
- //DETECT ARCHIVE FILES
180
- $zip_files = DUPX_Server::getZipFiles();
181
- $zip_count = count($zip_files);
182
-
183
- if ($zip_count >= 1) {
184
- echo "<ol style='padding:10px 20px 0 20px; font-style:italic'>";
185
- foreach($zip_files as $file) {
186
- echo "<li> '{$file}'</li>";
187
- }
188
- echo "</ol>";
189
- } else {
190
- echo "<br/><br/> <i>- No zip files found -</i>";
191
- }
192
- ?>
193
- </div>
194
- <?php endif; ?>
195
- </td>
196
- </tr>
197
- <tr>
198
- <td>Format:</td>
199
- <td>
200
- <?php if ($arcFormat == 'Pass') : ?>
201
- <span class="dupx-pass">Good structure</span>
202
- <?php elseif ($arcFormat == 'StatusFailed') : ?>
203
- <span class="dupx-fail">Unable to validate format</span><br/>
204
- <?php elseif ($arcFormat == 'NoZipArchive') : ?>
205
- <div class="s1-archive-failed-msg">
206
- The PHP extraction library <a href="" target="_help">ZipArchive</a> was not found on this server. There are a few options:
207
- <ol>
208
- <li>Contact your host to enable the this PHP library. <a href="" target="_help">[more info]</a></li>
209
- <li>Enable 'Manual package extraction' in the options menu and <a href="" target="_help">Manually extract the archive</a></li>
210
- </ol>
211
- </div>
212
- <?php else : ?>
213
- <div class="s1-archive-failed-msg">
214
- <b class="dupx-fail">Invalid Archive Format Detected!</b><br/>
215
- The archive files contents must be laid out in a specific format. If the format has been changed the install process will error out.
216
- <br/><br/>
217
-
218
- This scenario is rare but can happen on some systems during the download and upload process of the zip without a user being aware of
219
- the issue. Please check the contents of the zip archive and be sure its contents match the layout of your site.
220
- <br/><br/>
221
-
222
- Files such as database.sql and wp-config.php should be at the root of the archive. For more details see the FAQ article
223
- <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=invalid_ar_fmt#faq-installer-020-q" target="_help">The archive format is changing on my Mac what might be the problem?</a>
224
- </div>
225
- <?php endif; ?>
226
- </td>
227
- </tr>
228
- </table>
229
-
230
- </div>
231
- <br/><br/>
232
-
233
-
234
- <!-- ====================================
235
- VALIDATION
236
- ==================================== -->
237
- <div class="hdr-sub1" id="s1-area-sys-setup-link" data-type="toggle" data-target="#s1-area-sys-setup">
238
- <a href="javascript:void(0)"><i class="dupx-plus-square"></i> Validation</a>
239
- <div class="<?php echo ($req_success) ? 'status-badge-pass' : 'status-badge-fail'; ?>" style="float:right">
240
- <?php echo ($req_success) ? 'Pass' : 'Fail'; ?>
241
- </div>
242
- </div>
243
- <div id="s1-area-sys-setup" style="display:none">
244
- <div class='info-top'>The system validation checks help to make sure the system is ready for install.</div>
245
-
246
- <!-- *** REQUIREMENTS *** -->
247
- <div class="s1-reqs" id="s1-reqs-all">
248
- <div class="header">
249
- <table class="s1-checks-area">
250
- <tr>
251
- <td class="title">Requirements <small>(must pass)</small></td>
252
- <td class="toggle"><a href="javascript:void(0)" onclick="DUPX.toggleAll('#s1-reqs-all')">[toggle]</a></td>
253
- </tr>
254
- </table>
255
- </div>
256
-
257
- <!-- REQ 1 -->
258
- <div class="status <?php echo strtolower($req['01']); ?>"><?php echo $req['01']; ?></div>
259
- <div class="title" data-type="toggle" data-target="#s1-reqs01">+ Permissions</div>
260
- <div class="info" id="s1-reqs01">
261
- <table>
262
- <tr>
263
- <td><b>Deployment Path:</b> </td>
264
- <td><i><?php echo "{$GLOBALS['CURRENT_ROOT_PATH']}"; ?></i> </td>
265
- </tr>
266
- <tr>
267
- <td><b>Suhosin Extension:</b> </td>
268
- <td><?php echo extension_loaded('suhosin') ? "<i class='dupx-fail'>Enabled</i>" : "<i class='dupx-pass'>Disabled</i>"; ?> </td>
269
- </tr>
270
- <tr>
271
- <td><b>PHP Safe Mode:</b> </td>
272
- <td><?php echo (DUPX_Server::$php_safe_mode_on) ? "<i class='dupx-fail'>Enabled</i>" : "<i class='dupx-pass'>Disabled</i>"; ?> </td>
273
- </tr>
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.
281
- </div>
282
-
283
- <!-- REQ 2
284
- <div class="status <?php echo strtolower($req['02']); ?>"><?php echo $req['02']; ?></div>
285
- <div class="title" data-type="toggle" data-target="#s1-reqs02">+ Place Holder</div>
286
- <div class="info" id="s1-reqs02"></div>-->
287
-
288
- <!-- REQ 3
289
- <div class="status <?php echo strtolower($req['03']); ?>"><?php echo $req['03']; ?></div>
290
- <div class="title" data-type="toggle" data-target="#s1-reqs03">+ Place Holder</div>
291
- <div class="info" id="s1-reqs03"></div> -->
292
-
293
- <!-- REQ 4 -->
294
- <div class="status <?php echo strtolower($req['04']); ?>"><?php echo $req['04']; ?></div>
295
- <div class="title" data-type="toggle" data-target="#s1-reqs04">+ PHP Mysqli</div>
296
- <div class="info" id="s1-reqs04">
297
- Support for the PHP <a href='http://us2.php.net/manual/en/mysqli.installation.php' target='_blank'>mysqli extension</a> is required.
298
- Please contact your hosting provider or server administrator to enable the mysqli extension. <i>The detection for this call uses
299
- the function_exists('mysqli_connect') call.</i>
300
- </div>
301
-
302
- <!-- REQ 5 -->
303
- <div class="status <?php echo strtolower($req['05']); ?>"><?php echo $req['05']; ?></div>
304
- <div class="title" data-type="toggle" data-target="#s1-reqs05">+ PHP Min Version</div>
305
- <div class="info" id="s1-reqs05">
306
- This server is running PHP: <b><?php echo DUPX_Server::$php_version ?></b>. <i>A minimum of PHP 5.2.17 is required</i>.
307
- Contact your hosting provider or server administrator and let them know you would like to upgrade your PHP version.
308
- </div>
309
- </div><br/>
310
-
311
-
312
- <!-- *** NOTICES *** -->
313
- <div class="s1-reqs" id="s1-notice-all">
314
- <div class="header">
315
- <table class="s1-checks-area">
316
- <tr>
317
- <td class="title">Notices <small>(optional)</small></td>
318
- <td class="toggle"><a href="javascript:void(0)" onclick="DUPX.toggleAll('#s1-notice-all')">[toggle]</a></td>
319
- </tr>
320
- </table>
321
- </div>
322
-
323
- <?php if (!$GLOBALS['FW_ARCHIVE_ONLYDB']) :?>
324
-
325
- <!-- NOTICE 1 -->
326
- <div class="status <?php echo ($notice['01'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['01']; ?></div>
327
- <div class="title" data-type="toggle" data-target="#s1-notice01">+ Configuration File</div>
328
- <div class="info" id="s1-notice01">
329
- Duplicator works best by placing the installer and archive files into an empty directory. If a wp-config.php file is found in the extraction
330
- directory it might indicate that a pre-existing WordPress site exists which can lead to a bad install.
331
- <br/><br/>
332
- <b>Options:</b>
333
- <ul style="margin-bottom: 0">
334
- <li>If the archive was already manually extracted then <a href="javascript:void(0)" onclick="DUPX.getManaualArchiveOpt()">[Enable Manual Archive Extraction]</a></li>
335
- <li>If the wp-config file is not needed then remove it.</li>
336
- </ul>
337
- </div>
338
-
339
- <!-- NOTICE 2 -->
340
- <div class="status <?php echo ($notice['02'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['02']; ?></div>
341
- <div class="title" data-type="toggle" data-target="#s1-notice02">+ Directory Setup</div>
342
- <div class="info" id="s1-notice02">
343
- <b>Deployment Path:</b> <i><?php echo "{$GLOBALS['CURRENT_ROOT_PATH']}"; ?></i>
344
- <br/><br/>
345
- There are currently <?php echo "<b>[{$scancount}]</b>";?> items in the deployment path. These items will be overwritten if they also exist
346
- inside the archive file. The notice is to prevent overwriting an existing site or trying to install on-top of one which
347
- can have un-intended results. <i>This notice shows if it detects more than 40 items.</i>
348
-
349
- <br/><br/>
350
- <b>Options:</b>
351
- <ul style="margin-bottom: 0">
352
- <li>If the archive was already manually extracted then <a href="javascript:void(0)" onclick="DUPX.getManaualArchiveOpt()">[Enable Manual Archive Extraction]</a></li>
353
- <li>If the files/directories are not the same as those in the archive then this notice can be ignored.</li>
354
- <li>Remove the files if they are not needed and refresh this page.</li>
355
- </ul>
356
- </div>
357
-
358
- <?php endif; ?>
359
-
360
- <!-- NOTICE 3 -->
361
- <div class="status <?php echo ($notice['03'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['03']; ?></div>
362
- <div class="title" data-type="toggle" data-target="#s1-notice03">+ Package Age</div>
363
- <div class="info" id="s1-notice03">
364
- <?php echo "The package is {$fulldays} day(s) old. Packages older than 120 days might be considered stale. If you are comfortable with a package that that was created over "
365
- . "four months ago please ignore this notice."; ?>
366
- </div>
367
-
368
- <!-- NOTICE 4
369
- <div class="status <?php echo ($notice['04'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['04']; ?></div>
370
- <div class="title" data-type="toggle" data-target="#s1-notice04">+ Placeholder</div>
371
- <div class="info" id="s1-notice04">
372
- </div>-->
373
-
374
- <!-- NOTICE 5 -->
375
- <div class="status <?php echo ($notice['05'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['05']; ?></div>
376
- <div class="title" data-type="toggle" data-target="#s1-notice05">+ PHP Version 5.2</div>
377
- <div class="info" id="s1-notice05">
378
- <?php
379
- $currentPHP = DUPX_Server::$php_version;
380
- $cssStyle = DUPX_Server::$php_version_53_plus ? 'color:green' : 'color:red';
381
- echo "<b style='{$cssStyle}'>This server is currently running PHP version [{$currentPHP}]</b>.<br/>"
382
- . "Duplicator allows PHP 5.2 to be used during install but does not officially support it. If your using PHP 5.2 we strongly recommend NOT using it and having your "
383
- . "host upgrade to a newer more stable, secure and widely supported version. The <a href='http://php.net/eol.php' target='_blank'>end of life for PHP 5.2</a> "
384
- . "was in January of 2011 and is not recommended for use.<br/><br/>";
385
-
386
- echo "Many plugin and theme authors are no longer supporting PHP 5.2 and trying to use it can result in site wide problems and compatibility warnings and errors. "
387
- . "Please note if you continue with the install using PHP 5.2 the Duplicator support team will not be able to help with issues or troubleshooting your site. "
388
- . "If your server is running <b>PHP 5.3+</b> please feel free to reach out for help if you run into issues with your migration/install.";
389
- ?>
390
- </div>
391
-
392
- <!-- NOTICE 6 -->
393
- <div class="status <?php echo ($notice['06'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['06']; ?></div>
394
- <div class="title" data-type="toggle" data-target="#s1-notice06">+ PHP Open Base</div>
395
- <div class="info" id="s1-notice06">
396
- <b>Open BaseDir:</b> <i><?php echo $notice['06'] == 'Good' ? "<i class='dupx-pass'>Disabled</i>" : "<i class='dupx-fail'>Enabled</i>"; ?></i>
397
- <br/><br/>
398
-
399
- If <a href="http://www.php.net/manual/en/ini.core.php#ini.open-basedir" target="_blank">open_basedir</a> is enabled and you're
400
- having issues getting your site to install properly; please work with your host and follow these steps to prevent issues:
401
- <ol style="margin:7px; line-height:19px">
402
- <li>Disable the open_basedir setting in the php.ini file</li>
403
- <li>If the host will not disable, then add the path below to the open_basedir setting in the php.ini<br/>
404
- <i style="color:maroon">"<?php echo str_replace('\\', '/', dirname( __FILE__ )); ?>"</i>
405
- </li>
406
- <li>Save the settings and restart the web server</li>
407
- </ol>
408
- Note: This warning will still show if you choose option #2 and open_basedir is enabled, but should allow the installer to run properly. Please work with your
409
- hosting provider or server administrator to set this up correctly.
410
- </div>
411
-
412
- <!-- NOTICE 7 -->
413
- <div class="status <?php echo ($notice['07'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['07']; ?></div>
414
- <div class="title" data-type="toggle" data-target="#s1-notice07">+ PHP Timeout</div>
415
- <div class="info" id="s1-notice07">
416
- <b>Archive Size:</b> <?php echo DUPX_U::readableByteSize($arcSize) ?> <small>(detection limit is set at <?php echo DUPX_U::readableByteSize($max_time_size) ?>) </small><br/>
417
- <b>PHP max_execution_time:</b> <?php echo "{$max_time_ini}"; ?> <small>(zero means no limit)</small> <br/>
418
- <b>PHP set_time_limit:</b> <?php echo ($max_time_zero) ? '<i style="color:green">Success</i>' : '<i style="color:maroon">Failed</i>' ?>
419
- <br/><br/>
420
-
421
- The PHP <a href="http://php.net/manual/en/info.configuration.php#ini.max-execution-time" target="_blank">max_execution_time</a> setting is used to
422
- determine how long a PHP process is allowed to run. If the setting is too small and the archive file size is too large then PHP may not have enough
423
- time to finish running before the process is killed causing a timeout.
424
- <br/><br/>
425
-
426
- Duplicator attempts to turn off the timeout by using the
427
- <a href="http://php.net/manual/en/function.set-time-limit.php" target="_blank">set_time_limit</a> setting. If this notice shows as a warning then it is
428
- still safe to continue with the install. However, if a timeout occurs then you will need to consider working with the max_execution_time setting or extracting the
429
- archive file using the 'Manual package extraction' method.
430
- 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_timeout#faq-trouble-100-q" target="_blank">FAQ timeout</a> help link for more details.
431
-
432
- </div>
433
- </div>
434
- </div>
435
- <br/><br/>
436
-
437
-
438
- <!-- ====================================
439
- OPTIONS
440
- ==================================== -->
441
- <div class="hdr-sub1" data-type="toggle" data-target="#s1-area-adv-opts">
442
- <a href="javascript:void(0)"><i class="dupx-plus-square"></i> Options</a>
443
- </div>
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>
451
- <td>
452
-
453
- <select id="archive_engine" name="archive_engine" size="2">
454
- <option value="manual">Manual Archive Extraction</option>
455
- <?php
456
- //ZIP-ARCHIVE
457
- echo (! $zip_archive_enabled)
458
- ? '<option disabled="true">PHP ZipArchive (not detected on server)</option>'
459
- : '<option value="ziparchive" selected="true">PHP ZipArchive</option>';
460
- ?>
461
- </select>
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>
482
- <input type="checkbox" name="retain_config" id="retain_config" value="1" />
483
- <label for="retain_config" style="font-weight: normal">Retain original .htaccess, .user.ini and web.config</label>
484
- </td>
485
- </tr>
486
- <tr>
487
- <td>File Times:</td>
488
- <td>
489
- <input type="radio" name="archive_filetime" id="archive_filetime_now" value="current" checked="checked" /> <label class="radio" for="archive_filetime_now" title='Set the files current date time to now'>Current</label>
490
- <input type="radio" name="archive_filetime" id="archive_filetime_orginal" value="original" /> <label class="radio" for="archive_filetime_orginal" title="Keep the files date time the same">Original</label>
491
- </td>
492
- </tr>
493
- <tr>
494
- <td>Logging:</td>
495
- <td>
496
- <input type="radio" name="logging" id="logging-light" value="1" checked="true"> <label for="logging-light">Light</label>
497
- <input type="radio" name="logging" id="logging-detailed" value="2"> <label for="logging-detailed">Detailed</label>
498
- <input type="radio" name="logging" id="logging-debug" value="3"> <label for="logging-debug">Debug</label>
499
- </td>
500
- </tr>
501
- </table>
502
- <br/><br/>
503
-
504
- <!-- *** SETUP HELP *** -->
505
- <div class="hdr-sub3">Setup Help</div>
506
- <div id='s1-area-setup-help'>
507
- <div style="padding:10px 0px 0px 10px;line-height:22px">
508
- <table style='width:100%'>
509
- <tr>
510
- <td style="width:200px">
511
- &raquo; Watch 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_vid_tutor#faq-resource-070-q" target="_blank">video tutorials</a> <br/>
512
- &raquo; Read helpful <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=installer_help_art" target="_blank">articles</a> <br/>
513
- </td>
514
- <td>
515
- &raquo; Visit the <a href="https://snapcreek.com/duplicator/docs/quick-start/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_quickstart" target="_blank">quick start guides</a> <br/>
516
- &raquo; Browse the <a href="https://snapcreek.com/duplicator/docs/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=installer_online_docs" target="_blank">online docs</a> <br/>
517
- </td>
518
- </tr>
519
- </table>
520
- </div>
521
- </div><br/>
522
-
523
- </div>
524
- <br/><br/>
525
-
526
- <!-- ====================================
527
- NOTICES
528
- ==================================== -->
529
- <div id="dialog-server-notice" style="display:none">
530
- <div id="s1-warning-msg">
531
- <b>TERMS &amp; NOTICES</b> <br/><br/>
532
-
533
- <b>Disclaimer:</b>
534
- The Duplicator software and installer should be used at your own risk. Users should always back up or have backups of your database and files before running this installer.
535
- If you're not sure about how to use this tool then please enlist the guidance of a technical professional. <u>Always</u> test this installer in a sandbox environment
536
- before trying to deploy into a production environment. Be sure that if anything happens during the install that you have a backup recovery plan in place. By accepting
537
- this agreement the users of this software do not hold liable Snapcreek LLC or any of its affiliates/members liable for any issues that might occur during use of this software.
538
- <br/><br/>
539
-
540
-
541
- <b>Database:</b>
542
- Do not connect to an existing database unless you are 100% sure you want to remove all of it's data. Connecting to a database that already exists will permanently
543
- DELETE all data in that database. This tool is designed to populate and fill a database with NEW data from a duplicated database using the SQL script in the
544
- package name above.
545
- <br/><br/>
546
-
547
- <b>Setup:</b>
548
- Only the archive and installer file should be in the install directory, unless you have manually extracted the package and checked the
549
- 'Manual Package Extraction' checkbox. All other files will be OVERWRITTEN during install. Make sure you have full backups of all your databases and files
550
- before continuing with an installation. Manual extraction requires that all contents in the package are extracted to the same directory as the installer file.
551
- Manual extraction is only needed when your server does not support the ZipArchive extension. Please see the online help for more details.
552
- <br/><br/>
553
-
554
- <b>After Install:</b> When you are done with the installation you must remove the these files/directories:
555
- <ul>
556
- <li>installer.php</li>
557
- <li>installer-data.sql</li>
558
- <li>installer-backup.php</li>
559
- <li>installer-log.txt</li>
560
- <li>database.sql</li>
561
- </ul>
562
-
563
- These files contain sensitive information and should not remain on a production system for system integrity and security protection.
564
- <br/><br/>
565
-
566
- <b>License Overview</b><br/>
567
- Duplicator is licensed under the GPL v3 https://www.gnu.org/licenses/gpl-3.0.en.html including the following disclaimers and limitation of liability.
568
- <br/><br/>
569
-
570
- <b>Disclaimer of Warranty</b><br/>
571
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
572
- PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
573
- FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
574
- THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
575
- <br/><br/>
576
-
577
- <b>Limitation of Liability</b><br/>
578
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS
579
- PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
580
- PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO
581
- OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
582
- <br/><br/>
583
- </div>
584
- </div>
585
-
586
- <div id="s1-warning-check">
587
- <input id="accept-warnings" name="accpet-warnings" type="checkbox" onclick="DUPX.acceptWarning()" />
588
- <label for="accept-warnings">I have read and accept all <a href="javascript:void(0)" onclick="DUPX.showNotices()">terms &amp; notices</a> <small style="font-style:italic">(required to continue)</small></label><br/>
589
- </div>
590
-
591
-
592
- <?php if (! $req_success || $all_arc == 'Fail') :?>
593
- <div class="s1-err-msg">
594
- <i>
595
- This installation will not be able to proceed until the 'Archive' and 'Validation' sections pass. Please adjust your servers settings or contact your
596
- server administrator, hosting provider or visit the resources below for additional help.
597
- </i>
598
- <div style="padding:10px">
599
- &raquo; <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_validfail_techfaq" target="_blank">Technical FAQs</a> <br/>
600
- &raquo; <a href="https://snapcreek.com/support/docs/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_validfail_onlinedocs" target="_blank">Online Documentation</a> <br/>
601
- </div>
602
- </div> <br/><br/>
603
- <?php else : ?>
604
- <br/><br/><br/>
605
- <br/><br/><br/>
606
- <div class="dupx-footer-buttons">
607
- <button id="s1-deploy-btn" type="button" class="default-btn" onclick="DUPX.runExtraction()" title="<?php echo $agree_msg; ?>"> Next </button>
608
- </div>
609
- <?php endif; ?>
610
-
611
- </form>
612
-
613
-
614
-
615
- <!-- =========================================
616
- VIEW: STEP 1 - AJAX RESULT
617
- Auto Posts to view.step2.php
618
- ========================================= -->
619
- <form id='s1-result-form' method="post" class="content-form" style="display:none">
620
-
621
- <div class="dupx-logfile-link"><a href="installer-log.txt" target="install_log">installer-log.txt</a></div>
622
- <div class="hdr-main">
623
- Step <span class="step">1</span> of 4: Deployment
624
- </div>
625
-
626
- <!-- POST PARAMS -->
627
- <div class="dupx-debug">
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>
635
- <input type='submit' value='manual submit'>
636
- </div>
637
-
638
- <!-- PROGRESS BAR -->
639
- <div id="progress-area">
640
- <div style="width:500px; margin:auto">
641
- <h3>Running Deployment Processes Please Wait...</h3>
642
- <div id="progress-bar"></div>
643
- <i>This may take several minutes</i>
644
- </div>
645
- </div>
646
-
647
- <!-- AJAX SYSTEM ERROR -->
648
- <div id="ajaxerr-area" style="display:none">
649
- <p>Please try again an issue has occurred.</p>
650
- <div style="padding: 0px 10px 10px 0px;">
651
- <div id="ajaxerr-data">An unknown issue has occurred with the file and database set up process. Please see the installer-log.txt file for more details.</div>
652
- <div style="text-align:center; margin:10px auto 0px auto">
653
- <input type="button" class="default-btn" onclick="DUPX.hideErrorResult()" value="&laquo; Try Again" /><br/><br/>
654
- <i style='font-size:11px'>See online help for more details at <a href='https://snapcreek.com/ticket?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_ajaxerr_ticket' target='_blank'>snapcreek.com</a></i>
655
- </div>
656
- </div>
657
- </div>
658
- </form>
659
-
660
- <script>
661
- DUPX.getManaualArchiveOpt = function ()
662
- {
663
- $("html, body").animate({scrollTop: $(document).height()}, 1500);
664
- $("a[data-target='#s1-area-adv-opts']").find('i').removeClass('dupx-plus-square').addClass('dupx-minus-square');
665
- $('#s1-area-adv-opts').show(1000);
666
- $('select#archive_engine').val('manual').focus();
667
- };
668
-
669
- /** Performs Ajax post to extract files and create db
670
- * Timeout (10000000 = 166 minutes) */
671
- DUPX.runExtraction = function()
672
- {
673
- var $form = $('#s1-input-form');
674
-
675
- //1800000 = 30 minutes
676
- //If the extraction takes longer than 30 minutes then user
677
- //will probably want to do a manual extraction or even FTP
678
- $.ajax({
679
- type: "POST",
680
- timeout:1800000,
681
- dataType: "json",
682
- url: window.location.href,
683
- data: $form.serialize(),
684
- beforeSend: function() {
685
- DUPX.showProgressBar();
686
- $form.hide();
687
- $('#s1-result-form').show();
688
- },
689
- success: function(data) {
690
- var dataJSON = JSON.stringify(data);
691
- $("#ajax-json-debug").val(dataJSON);
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);
699
- <?php endif; ?>
700
- $('#progress-area').fadeOut(1000);
701
- } else {
702
- $('#ajaxerr-data').html('Error Processing Step 1');
703
- DUPX.hideProgressBar();
704
- }
705
- },
706
- error: function(xhr) {
707
- var status = "<b>Server Code:</b> " + xhr.status + "<br/>";
708
- status += "<b>Status:</b> " + xhr.statusText + "<br/>";
709
- status += "<b>Response:</b> " + xhr.responseText + "";
710
- status += "<hr/><b>Additional Troubleshooting Tips:</b><br/>";
711
- status += "- Check the <a href='installer-log.txt' target='install_log'>installer-log.txt</a> file for warnings or errors.<br/>";
712
- status += "- Check the web server and PHP error logs. <br/>";
713
- status += "- For timeout issues visit the <a href='https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_ajaxextract_tofaq#faq-trouble-100-q' target='_blank'>Timeout FAQ Section</a><br/>";
714
- $('#ajaxerr-data').html(status);
715
- DUPX.hideProgressBar();
716
- }
717
- });
718
-
719
- };
720
-
721
- /** Accetps Useage Warning */
722
- DUPX.acceptWarning = function()
723
- {
724
- if ($("#accept-warnings").is(':checked')) {
725
- $("#s1-deploy-btn").removeAttr("disabled");
726
- $("#s1-deploy-btn").removeAttr("title");
727
- } else {
728
- $("#s1-deploy-btn").attr("disabled", "true");
729
- $("#s1-deploy-btn").attr("title", "<?php echo $agree_msg; ?>");
730
- }
731
- }
732
-
733
- /** Server Terms Dialog*/
734
- DUPX.showNotices = function()
735
- {
736
- modal({
737
- type: 'alert',
738
- title: 'Terms and Notices',
739
- text: $('#dialog-server-notice').html()
740
- });
741
- }
742
-
743
-
744
- /** Go back on AJAX result view */
745
- DUPX.hideErrorResult = function()
746
- {
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
- {
769
- DUPX.acceptWarning();
770
- $("*[data-type='toggle']").click(DUPX.toggleClick);
771
- <?php echo ($all_arc == 'Fail') ? "$('#s1-area-archive-file-link').trigger('click');" : ""; ?>
772
- <?php echo (! $all_success) ? "$('#s1-area-sys-setup-link').trigger('click');" : ""; ?>
773
- })
774
- </script>
 
 
 
1
+ <?php
2
+ //VIEW: STEP 1- INPUT
3
+
4
+ //ARCHIVE FILE
5
+ $arcStatus = (file_exists($GLOBALS['ARCHIVE_PATH'])) ? 'Pass' : 'Fail';
6
+ $arcFormat = ($arcStatus == 'Pass') ? 'Pass' : 'StatusFailed';
7
+ $arcSize = @filesize($GLOBALS['ARCHIVE_PATH']);
8
+ $arcSize = is_numeric($arcSize) ? $arcSize : 0;
9
+ $zip_archive_enabled = class_exists('ZipArchive') ? 'Enabled' : 'Not Enabled';
10
+
11
+ $arcSizeRatio = (((1.0) * $arcSize) / $GLOBALS['FW_PACKAGE_EST_SIZE']) * 100;
12
+ $arcSizeStatus = ($arcSizeRatio > 90) ? 'Pass' : 'Fail';
13
+
14
+ //ARCHIVE FORMAT
15
+ if ($arcStatus) {
16
+ if (class_exists('ZipArchive')){
17
+ $zip = new ZipArchive();
18
+ if($zip->open($GLOBALS['ARCHIVE_PATH']) === TRUE ) {
19
+
20
+ $arcFilePath = basename($GLOBALS['ARCHIVE_PATH']);
21
+ $arcFilePath = substr($arcFilePath, 0, strrpos($arcFilePath, "."));
22
+ //Some systems the __MACOSX folder can cause issues on others it works fine removing
23
+ //until further reports are discovered, removed on 04-06-2018
24
+ //$badFiles = array('__MACOSX', $arcFilePath);
25
+ $badFiles = array('', $arcFilePath);
26
+ $goodFiles = array('database.sql', 'installer-backup.php');
27
+ $goodFilesFound = true;
28
+ $badFilesFound = false;
29
+
30
+ foreach ($badFiles as $val) {
31
+ if (is_numeric($zip->locateName("{$val}/"))) {
32
+ $badFilesFound = true;
33
+ break;
34
+ }
35
+ }
36
+
37
+ foreach ($goodFiles as $val) {
38
+ if ($zip->locateName($val) !== true) {
39
+ $goodFilesFound = false;
40
+ }
41
+ }
42
+
43
+ $arcFormat = ($goodFilesFound == false && $badFilesFound == true) ? 'Fail' : 'Pass';
44
+ }
45
+ } else {
46
+ $arcFormat = 'NoZipArchive';
47
+ }
48
+ }
49
+
50
+ $all_arc = ($arcStatus == 'Pass' && $arcFormat != 'Fail' && $arcSizeStatus == 'Pass') ? 'Pass' : 'Fail';
51
+
52
+ //REQUIRMENTS
53
+ $req = array();
54
+ $req['01'] = DUPX_Server::isDirWritable($GLOBALS["CURRENT_ROOT_PATH"]) ? 'Pass' : 'Fail';
55
+ $req['02'] = 'Pass'; //Place-holder for future check
56
+ $req['03'] = 'Pass'; //Place-holder for future check;
57
+ $req['04'] = function_exists('mysqli_connect') ? 'Pass' : 'Fail';
58
+ $req['05'] = DUPX_Server::$php_version_safe ? 'Pass' : 'Fail';
59
+ $all_req = in_array('Fail', $req) ? 'Fail' : 'Pass';
60
+
61
+ //NOTICES
62
+ $openbase = ini_get("open_basedir");
63
+ $scanfiles = @scandir($GLOBALS["CURRENT_ROOT_PATH"]);
64
+ $scancount = is_array($scanfiles) ? (count($scanfiles)) : -1;
65
+ $datetime1 = $GLOBALS['FW_CREATED'];
66
+ $datetime2 = date("Y-m-d H:i:s");
67
+ $fulldays = round(abs(strtotime($datetime1) - strtotime($datetime2))/86400);
68
+ $root_path = DUPX_U::setSafePath($GLOBALS['CURRENT_ROOT_PATH']);
69
+ $wpconf_path = "{$root_path}/wp-config.php";
70
+ $max_time_zero = @set_time_limit(0);
71
+ $max_time_size = 314572800; //300MB
72
+ $max_time_ini = ini_get('max_execution_time');
73
+ $max_time_warn = (is_numeric($max_time_ini) && $max_time_ini < 31 && $max_time_ini > 0) && $arcSize > $max_time_size;
74
+
75
+
76
+ $notice = array();
77
+ if (!$GLOBALS['FW_ARCHIVE_ONLYDB']) {
78
+ $notice['01'] = ! file_exists($wpconf_path) ? 'Good' : 'Warn';
79
+ $notice['02'] = $scancount <= 35 ? 'Good' : 'Warn';
80
+ }
81
+ $notice['03'] = $fulldays <= 120 ? 'Good' : 'Warn';
82
+ $notice['04'] = 'Good'; //Place-holder for future check
83
+ $notice['05'] = DUPX_Server::$php_version_53_plus ? 'Good' : 'Warn';
84
+ $notice['06'] = empty($openbase) ? 'Good' : 'Warn';
85
+ $notice['07'] = ! $max_time_warn ? 'Good' : 'Warn';
86
+ $all_notice = in_array('Warn', $notice) ? 'Warn' : 'Good';
87
+
88
+ //SUMMATION
89
+ $req_success = ($all_req == 'Pass');
90
+ $req_notice = ($all_notice == 'Good');
91
+ $all_success = ($req_success && $req_notice);
92
+ $agree_msg = "To enable this button the checkbox above under the 'Terms & Notices' must be checked.";
93
+ ?>
94
+
95
+
96
+ <form id='s1-input-form' method="post" class="content-form" >
97
+ <input type="hidden" name="action_ajax" value="1" />
98
+ <input type="hidden" name="action_step" value="1" />
99
+ <input type="hidden" name="archive_name" value="<?php echo $GLOBALS['FW_PACKAGE_NAME'] ?>" />
100
+
101
+ <div class="hdr-main">
102
+ Step <span class="step">1</span> of 4: Deployment
103
+ </div>
104
+ <br/>
105
+
106
+
107
+ <!-- ====================================
108
+ ARCHIVE
109
+ ==================================== -->
110
+ <div class="hdr-sub1" id="s1-area-archive-file-link" data-type="toggle" data-target="#s1-area-archive-file">
111
+ <a href="javascript:void(0)"><i class="dupx-plus-square"></i> Archive</a>
112
+ <div class="<?php echo ($all_arc == 'Pass') ? 'status-badge-pass' : 'status-badge-fail'; ?>" style="float:right">
113
+ <?php echo ($all_arc == 'Pass') ? 'Pass' : 'Fail'; ?>
114
+ </div>
115
+ </div>
116
+ <div id="s1-area-archive-file" style="display:none">
117
+
118
+ <table class="s1-archive-local">
119
+ <tr>
120
+ <td colspan="2"><div class="hdr-sub3">Site Details</div></td>
121
+ </tr>
122
+ <tr>
123
+ <td>Site:</td>
124
+ <td><?php echo $GLOBALS['FW_BLOGNAME'];?> </td>
125
+ </tr>
126
+ <tr>
127
+ <td>Notes:</td>
128
+ <td><?php echo strlen($GLOBALS['FW_PACKAGE_NOTES']) ? "{$GLOBALS['FW_PACKAGE_NOTES']}" : " - no notes - ";?></td>
129
+ </tr>
130
+ <?php if ($GLOBALS['FW_ARCHIVE_ONLYDB']) :?>
131
+ <tr>
132
+ <td>Mode:</td>
133
+ <td>Archive only database was enabled during package package creation.</td>
134
+ </tr>
135
+ <?php endif; ?>
136
+ </table>
137
+
138
+ <table class="s1-archive-local">
139
+ <tr>
140
+ <td colspan="2"><div class="hdr-sub3">File Details</div></td>
141
+ </tr>
142
+ <tr style="vertical-align:top">
143
+ <td>Size:</td>
144
+ <td>
145
+ <?php
146
+ $projectedSize = DUPX_U::readableByteSize($GLOBALS['FW_PACKAGE_EST_SIZE']);
147
+ $actualSize = DUPX_U::readableByteSize($arcSize);
148
+ echo "{$actualSize}<br/>";
149
+ if ($arcSizeStatus == 'Fail' ) {
150
+ echo "<span class='dupx-fail'>The archive file size is currently <b>{$actualSize}</b> and its estimated file size should be around <b>{$projectedSize}</b>. "
151
+ . "The archive file may not have been fully downloaded to the server. If so please wait for the file to completely download and then refresh this page.<br/><br/>";
152
+
153
+ echo "This warning is only shown when the file has more than a 10% size ratio difference from when it was originally built. Please review the file sizes "
154
+ . "to make sure the archive was downloaded to this server correctly if the download is complete.</span>";
155
+ }
156
+ ?>
157
+ </td>
158
+ </tr>
159
+ <tr>
160
+ <td>Name:</td>
161
+ <td><?php echo "{$GLOBALS['FW_PACKAGE_NAME']}";?> </td>
162
+ </tr>
163
+ <tr>
164
+ <td>Path:</td>
165
+ <td><?php echo "{$GLOBALS['CURRENT_ROOT_PATH']}";?> </td>
166
+ </tr>
167
+ <tr>
168
+ <td>Status:</td>
169
+ <td>
170
+ <?php if ($arcStatus != 'Fail') : ?>
171
+ <span class="dupx-pass">File Found</span>
172
+ <?php else : ?>
173
+ <div class="s1-archive-failed-msg">
174
+ <b class="dupx-fail">Archive File Not Found!</b><br/>
175
+ The archive file name below must be the <u>exact</u> name of the archive file placed in the deployment path (character for character).
176
+ If the file does not have the same name then rename it to the name above.
177
+ <br/><br/>
178
+
179
+ When downloading the package files make sure both files are from the same package line in the packages view. The archive file also
180
+ must be completely downloaded to the server before starting the install. The following zip files were found at the deployment path:
181
+ <?php
182
+ //DETECT ARCHIVE FILES
183
+ $zip_files = DUPX_Server::getZipFiles();
184
+ $zip_count = count($zip_files);
185
+
186
+ if ($zip_count >= 1) {
187
+ echo "<ol style='padding:10px 20px 0 20px; font-style:italic'>";
188
+ foreach($zip_files as $file) {
189
+ echo "<li> '{$file}'</li>";
190
+ }
191
+ echo "</ol>";
192
+ } else {
193
+ echo "<br/><br/> <i>- No zip files found -</i>";
194
+ }
195
+ ?>
196
+ </div>
197
+ <?php endif; ?>
198
+ </td>
199
+ </tr>
200
+ <tr>
201
+ <td>Format:</td>
202
+ <td>
203
+ <?php if ($arcFormat == 'Pass') : ?>
204
+ <span class="dupx-pass">Good structure</span>
205
+ <?php elseif ($arcFormat == 'StatusFailed') : ?>
206
+ <span class="dupx-fail">Unable to validate format</span><br/>
207
+ <?php elseif ($arcFormat == 'NoZipArchive') : ?>
208
+ <div class="s1-archive-failed-msg">
209
+ The PHP extraction library <a href="http://php.net/manual/en/book.zip.php" target="_help">ZipArchive</a> was not found on this server. There are a few options:
210
+ <ol>
211
+ <li>Contact your host to enable the this PHP library. <a href="http://php.net/manual/en/zip.installation.php" target="_help">[more info]</a></li>
212
+ <li>Enable 'Manual package extraction' in the options menu and <a href="https://snapcreek.com/duplicator/docs/faqs-tech/#faq-installer-015-q" target="_help">Manually extract the archive</a></li>
213
+ </ol>
214
+ </div>
215
+ <?php else : ?>
216
+ <div class="s1-archive-failed-msg">
217
+ <b class="dupx-fail">Invalid Archive Format Detected!</b><br/>
218
+ The archive files contents must be laid out in a specific format. If the format has been changed the install process will error out.
219
+ <br/><br/>
220
+
221
+ This scenario is rare but can happen on some systems during the download and upload process of the zip without a user being aware of
222
+ the issue. Please check the contents of the zip archive and be sure its contents match the layout of your site.
223
+ <br/><br/>
224
+
225
+ Files such as database.sql and wp-config.php should be at the root of the archive. For more details see the FAQ article
226
+ <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=invalid_ar_fmt#faq-installer-020-q" target="_help">The archive format is changing on my Mac what might be the problem?</a>
227
+ </div>
228
+ <?php endif; ?>
229
+ </td>
230
+ </tr>
231
+ </table>
232
+
233
+ </div>
234
+ <br/><br/>
235
+
236
+
237
+ <!-- ====================================
238
+ VALIDATION
239
+ ==================================== -->
240
+ <div class="hdr-sub1" id="s1-area-sys-setup-link" data-type="toggle" data-target="#s1-area-sys-setup">
241
+ <a href="javascript:void(0)"><i class="dupx-plus-square"></i> Validation</a>
242
+ <div class="<?php echo ($req_success) ? 'status-badge-pass' : 'status-badge-fail'; ?>" style="float:right">
243
+ <?php echo ($req_success) ? 'Pass' : 'Fail'; ?>
244
+ </div>
245
+ </div>
246
+ <div id="s1-area-sys-setup" style="display:none">
247
+ <div class='info-top'>The system validation checks help to make sure the system is ready for install.</div>
248
+
249
+ <!-- *** REQUIREMENTS *** -->
250
+ <div class="s1-reqs" id="s1-reqs-all">
251
+ <div class="header">
252
+ <table class="s1-checks-area">
253
+ <tr>
254
+ <td class="title">Requirements <small>(must pass)</small></td>
255
+ <td class="toggle"><a href="javascript:void(0)" onclick="DUPX.toggleAll('#s1-reqs-all')">[toggle]</a></td>
256
+ </tr>
257
+ </table>
258
+ </div>
259
+
260
+ <!-- REQ 1 -->
261
+ <div class="status <?php echo strtolower($req['01']); ?>"><?php echo $req['01']; ?></div>
262
+ <div class="title" data-type="toggle" data-target="#s1-reqs01">+ Permissions</div>
263
+ <div class="info" id="s1-reqs01">
264
+ <table>
265
+ <tr>
266
+ <td><b>Deployment Path:</b> </td>
267
+ <td><i><?php echo "{$GLOBALS['CURRENT_ROOT_PATH']}"; ?></i> </td>
268
+ </tr>
269
+ <tr>
270
+ <td><b>Suhosin Extension:</b> </td>
271
+ <td><?php echo extension_loaded('suhosin') ? "<i class='dupx-fail'>Enabled</i>" : "<i class='dupx-pass'>Disabled</i>"; ?> </td>
272
+ </tr>
273
+ <tr>
274
+ <td><b>PHP Safe Mode:</b> </td>
275
+ <td><?php echo (DUPX_Server::$php_safe_mode_on) ? "<i class='dupx-fail'>Enabled</i>" : "<i class='dupx-pass'>Disabled</i>"; ?> </td>
276
+ </tr>
277
+ </table><br/>
278
+
279
+ The deployment path above must be writable by PHP in order to extract the archive file. Incorrect permissions and extension such as
280
+ <a href="https://suhosin.org/stories/index.html" target="_blank">suhosin</a> can sometimes interfere with PHP being able to write/extract files.
281
+ 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.
282
+ 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
283
+ please contact your hosting provider or server administrator to disable PHP safe mode.
284
+ </div>
285
+
286
+ <!-- REQ 2
287
+ <div class="status <?php echo strtolower($req['02']); ?>"><?php echo $req['02']; ?></div>
288
+ <div class="title" data-type="toggle" data-target="#s1-reqs02">+ Place Holder</div>
289
+ <div class="info" id="s1-reqs02"></div>-->
290
+
291
+ <!-- REQ 3
292
+ <div class="status <?php echo strtolower($req['03']); ?>"><?php echo $req['03']; ?></div>
293
+ <div class="title" data-type="toggle" data-target="#s1-reqs03">+ Place Holder</div>
294
+ <div class="info" id="s1-reqs03"></div> -->
295
+
296
+ <!-- REQ 4 -->
297
+ <div class="status <?php echo strtolower($req['04']); ?>"><?php echo $req['04']; ?></div>
298
+ <div class="title" data-type="toggle" data-target="#s1-reqs04">+ PHP Mysqli</div>
299
+ <div class="info" id="s1-reqs04">
300
+ Support for the PHP <a href='http://us2.php.net/manual/en/mysqli.installation.php' target='_blank'>mysqli extension</a> is required.
301
+ Please contact your hosting provider or server administrator to enable the mysqli extension. <i>The detection for this call uses
302
+ the function_exists('mysqli_connect') call.</i>
303
+ </div>
304
+
305
+ <!-- REQ 5 -->
306
+ <div class="status <?php echo strtolower($req['05']); ?>"><?php echo $req['05']; ?></div>
307
+ <div class="title" data-type="toggle" data-target="#s1-reqs05">+ PHP Min Version</div>
308
+ <div class="info" id="s1-reqs05">
309
+ This server is running PHP: <b><?php echo DUPX_Server::$php_version ?></b>. <i>A minimum of PHP 5.2.17 is required</i>.
310
+ Contact your hosting provider or server administrator and let them know you would like to upgrade your PHP version.
311
+ </div>
312
+ </div><br/>
313
+
314
+
315
+ <!-- *** NOTICES *** -->
316
+ <div class="s1-reqs" id="s1-notice-all">
317
+ <div class="header">
318
+ <table class="s1-checks-area">
319
+ <tr>
320
+ <td class="title">Notices <small>(optional)</small></td>
321
+ <td class="toggle"><a href="javascript:void(0)" onclick="DUPX.toggleAll('#s1-notice-all')">[toggle]</a></td>
322
+ </tr>
323
+ </table>
324
+ </div>
325
+
326
+ <?php if (!$GLOBALS['FW_ARCHIVE_ONLYDB']) :?>
327
+
328
+ <!-- NOTICE 1 -->
329
+ <div class="status <?php echo ($notice['01'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['01']; ?></div>
330
+ <div class="title" data-type="toggle" data-target="#s1-notice01">+ Configuration File</div>
331
+ <div class="info" id="s1-notice01">
332
+ Duplicator works best by placing the installer and archive files into an empty directory. If a wp-config.php file is found in the extraction
333
+ directory it might indicate that a pre-existing WordPress site exists which can lead to a bad install.
334
+ <br/><br/>
335
+ <b>Options:</b>
336
+ <ul style="margin-bottom: 0">
337
+ <li>If the archive was already manually extracted then <a href="javascript:void(0)" onclick="DUPX.getManaualArchiveOpt()">[Enable Manual Archive Extraction]</a></li>
338
+ <li>If the wp-config file is not needed then remove it.</li>
339
+ </ul>
340
+ </div>
341
+
342
+ <!-- NOTICE 2 -->
343
+ <div class="status <?php echo ($notice['02'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['02']; ?></div>
344
+ <div class="title" data-type="toggle" data-target="#s1-notice02">+ Directory Setup</div>
345
+ <div class="info" id="s1-notice02">
346
+ <b>Deployment Path:</b> <i><?php echo "{$GLOBALS['CURRENT_ROOT_PATH']}"; ?></i>
347
+ <br/><br/>
348
+ There are currently <?php echo "<b>[{$scancount}]</b>";?> items in the deployment path. These items will be overwritten if they also exist
349
+ inside the archive file. The notice is to prevent overwriting an existing site or trying to install on-top of one which
350
+ can have un-intended results. <i>This notice shows if it detects more than 40 items.</i>
351
+
352
+ <br/><br/>
353
+ <b>Options:</b>
354
+ <ul style="margin-bottom: 0">
355
+ <li>If the archive was already manually extracted then <a href="javascript:void(0)" onclick="DUPX.getManaualArchiveOpt()">[Enable Manual Archive Extraction]</a></li>
356
+ <li>If the files/directories are not the same as those in the archive then this notice can be ignored.</li>
357
+ <li>Remove the files if they are not needed and refresh this page.</li>
358
+ </ul>
359
+ </div>
360
+
361
+ <?php endif; ?>
362
+
363
+ <!-- NOTICE 3 -->
364
+ <div class="status <?php echo ($notice['03'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['03']; ?></div>
365
+ <div class="title" data-type="toggle" data-target="#s1-notice03">+ Package Age</div>
366
+ <div class="info" id="s1-notice03">
367
+ <?php echo "The package is {$fulldays} day(s) old. Packages older than 120 days might be considered stale. If you are comfortable with a package that that was created over "
368
+ . "four months ago please ignore this notice."; ?>
369
+ </div>
370
+
371
+ <!-- NOTICE 4
372
+ <div class="status <?php echo ($notice['04'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['04']; ?></div>
373
+ <div class="title" data-type="toggle" data-target="#s1-notice04">+ Placeholder</div>
374
+ <div class="info" id="s1-notice04">
375
+ </div>-->
376
+
377
+ <!-- NOTICE 5 -->
378
+ <div class="status <?php echo ($notice['05'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['05']; ?></div>
379
+ <div class="title" data-type="toggle" data-target="#s1-notice05">+ PHP Version 5.2</div>
380
+ <div class="info" id="s1-notice05">
381
+ <?php
382
+ $currentPHP = DUPX_Server::$php_version;
383
+ $cssStyle = DUPX_Server::$php_version_53_plus ? 'color:green' : 'color:red';
384
+ echo "<b style='{$cssStyle}'>This server is currently running PHP version [{$currentPHP}]</b>.<br/>"
385
+ . "Duplicator allows PHP 5.2 to be used during install but does not officially support it. If your using PHP 5.2 we strongly recommend NOT using it and having your "
386
+ . "host upgrade to a newer more stable, secure and widely supported version. The <a href='http://php.net/eol.php' target='_blank'>end of life for PHP 5.2</a> "
387
+ . "was in January of 2011 and is not recommended for use.<br/><br/>";
388
+
389
+ echo "Many plugin and theme authors are no longer supporting PHP 5.2 and trying to use it can result in site wide problems and compatibility warnings and errors. "
390
+ . "Please note if you continue with the install using PHP 5.2 the Duplicator support team will not be able to help with issues or troubleshooting your site. "
391
+ . "If your server is running <b>PHP 5.3+</b> please feel free to reach out for help if you run into issues with your migration/install.";
392
+ ?>
393
+ </div>
394
+
395
+ <!-- NOTICE 6 -->
396
+ <div class="status <?php echo ($notice['06'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['06']; ?></div>
397
+ <div class="title" data-type="toggle" data-target="#s1-notice06">+ PHP Open Base</div>
398
+ <div class="info" id="s1-notice06">
399
+ <b>Open BaseDir:</b> <i><?php echo $notice['06'] == 'Good' ? "<i class='dupx-pass'>Disabled</i>" : "<i class='dupx-fail'>Enabled</i>"; ?></i>
400
+ <br/><br/>
401
+
402
+ If <a href="http://www.php.net/manual/en/ini.core.php#ini.open-basedir" target="_blank">open_basedir</a> is enabled and you're
403
+ having issues getting your site to install properly; please work with your host and follow these steps to prevent issues:
404
+ <ol style="margin:7px; line-height:19px">
405
+ <li>Disable the open_basedir setting in the php.ini file</li>
406
+ <li>If the host will not disable, then add the path below to the open_basedir setting in the php.ini<br/>
407
+ <i style="color:maroon">"<?php echo str_replace('\\', '/', dirname( __FILE__ )); ?>"</i>
408
+ </li>
409
+ <li>Save the settings and restart the web server</li>
410
+ </ol>
411
+ Note: This warning will still show if you choose option #2 and open_basedir is enabled, but should allow the installer to run properly. Please work with your
412
+ hosting provider or server administrator to set this up correctly.
413
+ </div>
414
+
415
+ <!-- NOTICE 7 -->
416
+ <div class="status <?php echo ($notice['07'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['07']; ?></div>
417
+ <div class="title" data-type="toggle" data-target="#s1-notice07">+ PHP Timeout</div>
418
+ <div class="info" id="s1-notice07">
419
+ <b>Archive Size:</b> <?php echo DUPX_U::readableByteSize($arcSize) ?> <small>(detection limit is set at <?php echo DUPX_U::readableByteSize($max_time_size) ?>) </small><br/>
420
+ <b>PHP max_execution_time:</b> <?php echo "{$max_time_ini}"; ?> <small>(zero means no limit)</small> <br/>
421
+ <b>PHP set_time_limit:</b> <?php echo ($max_time_zero) ? '<i style="color:green">Success</i>' : '<i style="color:maroon">Failed</i>' ?>
422
+ <br/><br/>
423
+
424
+ The PHP <a href="http://php.net/manual/en/info.configuration.php#ini.max-execution-time" target="_blank">max_execution_time</a> setting is used to
425
+ determine how long a PHP process is allowed to run. If the setting is too small and the archive file size is too large then PHP may not have enough
426
+ time to finish running before the process is killed causing a timeout.
427
+ <br/><br/>
428
+
429
+ Duplicator attempts to turn off the timeout by using the
430
+ <a href="http://php.net/manual/en/function.set-time-limit.php" target="_blank">set_time_limit</a> setting. If this notice shows as a warning then it is
431
+ still safe to continue with the install. However, if a timeout occurs then you will need to consider working with the max_execution_time setting or extracting the
432
+ archive file using the 'Manual package extraction' method.
433
+ 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_timeout#faq-trouble-100-q" target="_blank">FAQ timeout</a> help link for more details.
434
+
435
+ </div>
436
+ </div>
437
+ </div>
438
+ <br/><br/>
439
+
440
+
441
+ <!-- ====================================
442
+ OPTIONS
443
+ ==================================== -->
444
+ <div class="hdr-sub1" data-type="toggle" data-target="#s1-area-adv-opts">
445
+ <a href="javascript:void(0)"><i class="dupx-plus-square"></i> Options</a>
446
+ </div>
447
+ <div id="s1-area-adv-opts" style="display:none">
448
+ <div class="help-target"><a href="?help#help-s1" target="_blank">[help]</a></div>
449
+ <br/>
450
+ <div class="hdr-sub3">General</div>
451
+ <table class="dupx-opts dupx-advopts">
452
+ <tr>
453
+ <td>Extraction:</td>
454
+ <td>
455
+
456
+ <select id="archive_engine" name="archive_engine" size="2">
457
+ <option value="manual">Manual Archive Extraction</option>
458
+ <?php
459
+ //ZIP-ARCHIVE
460
+ echo (! $zip_archive_enabled)
461
+ ? '<option disabled="true">PHP ZipArchive (not detected on server)</option>'
462
+ : '<option value="ziparchive" selected="true">PHP ZipArchive</option>';
463
+ ?>
464
+ </select>
465
+ </td>
466
+ </tr>
467
+ </table>
468
+ <br>
469
+ <br>
470
+ <div class="hdr-sub3">Advanced</div>
471
+ <table class="dupx-opts dupx-advopts">
472
+ <tr>
473
+ <td>Safe Mode:</td>
474
+ <td>
475
+ <select name="exe_safe_mode" id="exe_safe_mode" onchange="DUPX.onSafeModeSwitch();" style="width:200px;">
476
+ <option value="0">Off</option>
477
+ <option value="1">Basic</option>
478
+ <option value="2">Advance</option>
479
+ </select>
480
+ </td>
481
+ </tr>
482
+ <tr>
483
+ <td>Config Files:</td>
484
+ <td>
485
+ <input type="checkbox" name="retain_config" id="retain_config" value="1" />
486
+ <label for="retain_config" style="font-weight: normal">Retain original .htaccess, .user.ini and web.config</label>
487
+ </td>
488
+ </tr>
489
+ <tr>
490
+ <td>File Times:</td>
491
+ <td>
492
+ <input type="radio" name="archive_filetime" id="archive_filetime_now" value="current" checked="checked" /> <label class="radio" for="archive_filetime_now" title='Set the files current date time to now'>Current</label>
493
+ <input type="radio" name="archive_filetime" id="archive_filetime_orginal" value="original" /> <label class="radio" for="archive_filetime_orginal" title="Keep the files date time the same">Original</label>
494
+ </td>
495
+ </tr>
496
+ <tr>
497
+ <td>Logging:</td>
498
+ <td>
499
+ <input type="radio" name="logging" id="logging-light" value="1" checked="true"> <label for="logging-light">Light</label>
500
+ <input type="radio" name="logging" id="logging-detailed" value="2"> <label for="logging-detailed">Detailed</label>
501
+ <input type="radio" name="logging" id="logging-debug" value="3"> <label for="logging-debug">Debug</label>
502
+ </td>
503
+ </tr>
504
+ </table>
505
+ <br/><br/>
506
+
507
+ <!-- *** SETUP HELP *** -->
508
+ <div class="hdr-sub3">Setup Help</div>
509
+ <div id='s1-area-setup-help'>
510
+ <div style="padding:10px 0px 0px 10px;line-height:22px">
511
+ <table style='width:100%'>
512
+ <tr>
513
+ <td style="width:200px">
514
+ &raquo; Watch 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_vid_tutor#faq-resource-070-q" target="_blank">video tutorials</a> <br/>
515
+ &raquo; Read helpful <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=installer_help_art" target="_blank">articles</a> <br/>
516
+ </td>
517
+ <td>
518
+ &raquo; Visit the <a href="https://snapcreek.com/duplicator/docs/quick-start/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_quickstart" target="_blank">quick start guides</a> <br/>
519
+ &raquo; Browse the <a href="https://snapcreek.com/duplicator/docs/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=installer_online_docs" target="_blank">online docs</a> <br/>
520
+ </td>
521
+ </tr>
522
+ </table>
523
+ </div>
524
+ </div><br/>
525
+
526
+ </div>
527
+ <br/><br/>
528
+
529
+ <!-- ====================================
530
+ NOTICES
531
+ ==================================== -->
532
+ <div id="dialog-server-notice" style="display:none">
533
+ <div id="s1-warning-msg">
534
+ <b>TERMS &amp; NOTICES</b> <br/><br/>
535
+
536
+ <b>Disclaimer:</b>
537
+ The Duplicator software and installer should be used at your own risk. Users should always back up or have backups of your database and files before running this installer.
538
+ If you're not sure about how to use this tool then please enlist the guidance of a technical professional. <u>Always</u> test this installer in a sandbox environment
539
+ before trying to deploy into a production environment. Be sure that if anything happens during the install that you have a backup recovery plan in place. By accepting
540
+ this agreement the users of this software do not hold liable Snapcreek LLC or any of its affiliates/members liable for any issues that might occur during use of this software.
541
+ <br/><br/>
542
+
543
+
544
+ <b>Database:</b>
545
+ Do not connect to an existing database unless you are 100% sure you want to remove all of it's data. Connecting to a database that already exists will permanently
546
+ DELETE all data in that database. This tool is designed to populate and fill a database with NEW data from a duplicated database using the SQL script in the
547
+ package name above.
548
+ <br/><br/>
549
+
550
+ <b>Setup:</b>
551
+ Only the archive and installer file should be in the install directory, unless you have manually extracted the package and checked the
552
+ 'Manual Package Extraction' checkbox. All other files will be OVERWRITTEN during install. Make sure you have full backups of all your databases and files
553
+ before continuing with an installation. Manual extraction requires that all contents in the package are extracted to the same directory as the installer file.
554
+ Manual extraction is only needed when your server does not support the ZipArchive extension. Please see the online help for more details.
555
+ <br/><br/>
556
+
557
+ <b>After Install:</b> When you are done with the installation you must remove the these files/directories:
558
+ <ul>
559
+ <li>installer.php</li>
560
+ <li>installer-data.sql</li>
561
+ <li>installer-backup.php</li>
562
+ <li>installer-log.txt</li>
563
+ <li>database.sql</li>
564
+ </ul>
565
+
566
+ These files contain sensitive information and should not remain on a production system for system integrity and security protection.
567
+ <br/><br/>
568
+
569
+ <b>License Overview</b><br/>
570
+ Duplicator is licensed under the GPL v3 https://www.gnu.org/licenses/gpl-3.0.en.html including the following disclaimers and limitation of liability.
571
+ <br/><br/>
572
+
573
+ <b>Disclaimer of Warranty</b><br/>
574
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
575
+ PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
576
+ FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
577
+ THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
578
+ <br/><br/>
579
+
580
+ <b>Limitation of Liability</b><br/>
581
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS
582
+ PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
583
+ PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO
584
+ OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
585
+ <br/><br/>
586
+ </div>
587
+ </div>
588
+
589
+ <div id="s1-warning-check">
590
+ <input id="accept-warnings" name="accpet-warnings" type="checkbox" onclick="DUPX.acceptWarning()" />
591
+ <label for="accept-warnings">I have read and accept all <a href="javascript:void(0)" onclick="DUPX.showNotices()">terms &amp; notices</a> <small style="font-style:italic">(required to continue)</small></label><br/>
592
+ </div>
593
+
594
+
595
+ <?php if (! $req_success || $all_arc == 'Fail') :?>
596
+ <div class="s1-err-msg">
597
+ <i>
598
+ This installation will not be able to proceed until the 'Archive' and 'Validation' sections pass. Please adjust your servers settings or contact your
599
+ server administrator, hosting provider or visit the resources below for additional help.
600
+ </i>
601
+ <div style="padding:10px">
602
+ &raquo; <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_validfail_techfaq" target="_blank">Technical FAQs</a> <br/>
603
+ &raquo; <a href="https://snapcreek.com/support/docs/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_validfail_onlinedocs" target="_blank">Online Documentation</a> <br/>
604
+ </div>
605
+ </div> <br/><br/>
606
+ <?php else : ?>
607
+ <br/><br/><br/>
608
+ <br/><br/><br/>
609
+ <div class="dupx-footer-buttons">
610
+ <button id="s1-deploy-btn" type="button" class="default-btn" onclick="DUPX.runExtraction()" title="<?php echo $agree_msg; ?>"> Next </button>
611
+ </div>
612
+ <?php endif; ?>
613
+
614
+ </form>
615
+
616
+
617
+
618
+ <!-- =========================================
619
+ VIEW: STEP 1 - AJAX RESULT
620
+ Auto Posts to view.step2.php
621
+ ========================================= -->
622
+ <form id='s1-result-form' method="post" class="content-form" style="display:none">
623
+
624
+ <div class="dupx-logfile-link"><a href="installer-log.txt" target="install_log">installer-log.txt</a></div>
625
+ <div class="hdr-main">
626
+ Step <span class="step">1</span> of 4: Deployment
627
+ </div>
628
+
629
+ <!-- POST PARAMS -->
630
+ <div class="dupx-debug">
631
+ <input type="hidden" name="action_step" value="2" />
632
+ <input type="hidden" name="archive_name" value="<?php echo $GLOBALS['FW_PACKAGE_NAME'] ?>" />
633
+ <input type="hidden" name="logging" id="ajax-logging" />
634
+ <input type="hidden" name="exe_safe_mode" id="exe-safe-mode" value="0" />
635
+ <input type="hidden" name="retain_config" id="ajax-retain-config" />
636
+ <input type="hidden" name="json" id="ajax-json" />
637
+ <textarea id='ajax-json-debug' name='json_debug_view'></textarea>
638
+ <input type='submit' value='manual submit'>
639
+ </div>
640
+
641
+ <!-- PROGRESS BAR -->
642
+ <div id="progress-area">
643
+ <div style="width:500px; margin:auto">
644
+ <h3>Running Deployment Processes Please Wait...</h3>
645
+ <div id="progress-bar"></div>
646
+ <i>This may take several minutes</i>
647
+ </div>
648
+ </div>
649
+
650
+ <!-- AJAX SYSTEM ERROR -->
651
+ <div id="ajaxerr-area" style="display:none">
652
+ <p>Please try again an issue has occurred.</p>
653
+ <div style="padding: 0px 10px 10px 0px;">
654
+ <div id="ajaxerr-data">An unknown issue has occurred with the file and database set up process. Please see the installer-log.txt file for more details.</div>
655
+ <div style="text-align:center; margin:10px auto 0px auto">
656
+ <input type="button" class="default-btn" onclick="DUPX.hideErrorResult()" value="&laquo; Try Again" /><br/><br/>
657
+ <i style='font-size:11px'>See online help for more details at <a href='https://snapcreek.com/ticket?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_ajaxerr_ticket' target='_blank'>snapcreek.com</a></i>
658
+ </div>
659
+ </div>
660
+ </div>
661
+ </form>
662
+
663
+ <script>
664
+ DUPX.getManaualArchiveOpt = function ()
665
+ {
666
+ $("html, body").animate({scrollTop: $(document).height()}, 1500);
667
+ $("a[data-target='#s1-area-adv-opts']").find('i').removeClass('dupx-plus-square').addClass('dupx-minus-square');
668
+ $('#s1-area-adv-opts').show(1000);
669
+ $('select#archive_engine').val('manual').focus();
670
+ };
671
+
672
+ /** Performs Ajax post to extract files and create db
673
+ * Timeout (10000000 = 166 minutes) */
674
+ DUPX.runExtraction = function()
675
+ {
676
+ var $form = $('#s1-input-form');
677
+
678
+ //1800000 = 30 minutes
679
+ //If the extraction takes longer than 30 minutes then user
680
+ //will probably want to do a manual extraction or even FTP
681
+ $.ajax({
682
+ type: "POST",
683
+ timeout:1800000,
684
+ dataType: "json",
685
+ url: window.location.href,
686
+ data: $form.serialize(),
687
+ beforeSend: function() {
688
+ DUPX.showProgressBar();
689
+ $form.hide();
690
+ $('#s1-result-form').show();
691
+ },
692
+ success: function(data) {
693
+ var dataJSON = JSON.stringify(data);
694
+ $("#ajax-json-debug").val(dataJSON);
695
+ if (typeof(data) != 'undefined' && data.pass == 1) {
696
+ $("#ajax-logging").val($("input:radio[name=logging]:checked").val());
697
+ $("#ajax-retain-config").val($("#retain_config").is(":checked") ? 1 : 0);
698
+ $("#exe-safe-mode").val($("#exe_safe_mode").val());
699
+ $("#ajax-json").val(escape(dataJSON));
700
+ <?php if (! $GLOBALS['DUPX_DEBUG']) : ?>
701
+ setTimeout(function() {$('#s1-result-form').submit();}, 500);
702
+ <?php endif; ?>
703
+ $('#progress-area').fadeOut(1000);
704
+ } else {
705
+ $('#ajaxerr-data').html('Error Processing Step 1');
706
+ DUPX.hideProgressBar();
707
+ }
708
+ },
709
+ error: function(xhr) {
710
+ var status = "<b>Server Code:</b> " + xhr.status + "<br/>";
711
+ status += "<b>Status:</b> " + xhr.statusText + "<br/>";
712
+ status += "<b>Response:</b> " + xhr.responseText + "";
713
+ status += "<hr/><b>Additional Troubleshooting Tips:</b><br/>";
714
+ status += "- Check the <a href='installer-log.txt' target='install_log'>installer-log.txt</a> file for warnings or errors.<br/>";
715
+ status += "- Check the web server and PHP error logs. <br/>";
716
+ status += "- For timeout issues visit the <a href='https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_ajaxextract_tofaq#faq-trouble-100-q' target='_blank'>Timeout FAQ Section</a><br/>";
717
+ $('#ajaxerr-data').html(status);
718
+ DUPX.hideProgressBar();
719
+ }
720
+ });
721
+
722
+ };
723
+
724
+ /** Accetps Useage Warning */
725
+ DUPX.acceptWarning = function()
726
+ {
727
+ if ($("#accept-warnings").is(':checked')) {
728
+ $("#s1-deploy-btn").removeAttr("disabled");
729
+ $("#s1-deploy-btn").removeAttr("title");
730
+ } else {
731
+ $("#s1-deploy-btn").attr("disabled", "true");
732
+ $("#s1-deploy-btn").attr("title", "<?php echo $agree_msg; ?>");
733
+ }
734
+ }
735
+
736
+ /** Server Terms Dialog*/
737
+ DUPX.showNotices = function()
738
+ {
739
+ modal({
740
+ type: 'alert',
741
+ title: 'Terms and Notices',
742
+ text: $('#dialog-server-notice').html()
743
+ });
744
+ }
745
+
746
+
747
+ /** Go back on AJAX result view */
748
+ DUPX.hideErrorResult = function()
749
+ {
750
+ $('#s1-result-form').hide();
751
+ $('#s1-input-form').show(200);
752
+ }
753
+
754
+ DUPX.onSafeModeSwitch = function ()
755
+ {
756
+ var mode = $('#exe_safe_mode').val();
757
+ if(mode == 0){
758
+ $("#retain_config").removeAttr("disabled");
759
+ }else if(mode == 1 || mode ==2){
760
+ if($("#retain_config").is(':checked'))
761
+ $("#retain_config").removeAttr("checked");
762
+ $("#retain_config").attr("disabled", true);
763
+ }
764
+
765
+ $('#exe-safe-mode').val(mode);
766
+ console.log("mode set to"+mode);
767
+ }
768
+
769
+ //DOCUMENT LOAD
770
+ $(document).ready(function()
771
+ {
772
+ DUPX.acceptWarning();
773
+ $("*[data-type='toggle']").click(DUPX.toggleClick);
774
+ <?php echo ($all_arc == 'Fail') ? "$('#s1-area-archive-file-link').trigger('click');" : ""; ?>
775
+ <?php echo (! $all_success) ? "$('#s1-area-sys-setup-link').trigger('click');" : ""; ?>
776
+ })
777
+ </script>
readme.txt CHANGED
@@ -1,106 +1,106 @@
1
- === Duplicator - WordPress Migration Plugin ===
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.9.4
7
- Requires PHP: 5.2.17
8
- Stable tag: 1.2.34
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.
12
-
13
- == Description ==
14
-
15
- > Duplicator gives WordPress users the ability to migrate, copy, move or clone a site from one location to another and also serves as a simple backup utility. Duplicator handles both serialized and base64 serialized string replacement. Standard WordPress migration and WordPress backups are easily handled by this plugin as are **zero downtime migrations**.
16
-
17
- For complete details visit [snapcreek.com](https://snapcreek.com/duplicator/?utm_source=duplicator_free&utm_medium=wp_org&utm_content=desc_details&utm_campaign=duplicator_free).
18
-
19
- = Quick Video Demo =
20
- http://www.youtube.com/watch?v=oc73jtvHWYQ
21
-
22
- = Overview =
23
- Duplicator enables you to:
24
-
25
- * Move, migrate or clone a WordPress site between domains or hosts with **zero downtime**
26
- * Pull down a live site to localhost for development
27
- * Manually backup a WordPress site or parts of a site
28
- * Duplicate a live site to a staging area or vice versa
29
- * Bundle up an entire WordPress site for easy reuse or distribution
30
- * Perform a full WordPress migration without struggling with messy import/export sql scripts
31
-
32
- = Migrate WordPress and Run WordPress Backups =
33
- Duplicator creates a package that bundles all the site's plugins, themes, content, database and WordPress files into a simple zip file called a package. This package can then be used to easily migrate a WordPress site to any location you wish. Move on the same server, across servers and pretty much any location a WordPress site can be hosted. *WordPress is not required for installation* since the package contains all site files.
34
-
35
- = Improve Your Workflow with Pre-Bundled Sites =
36
- Duplicator lets you make your own pre-configured sites to eliminate rework. Instead of manually configuring your favorite theme, set of plugins or content over and over, now just configure a single site and bundle it up into a Duplicator package. Once you have the bundled site, you can migrate the WordPress site over and over to different locations to instantly create many pre-configured sites!
37
-
38
- = Duplicator Pro =
39
- Duplicator Pro takes Duplicator to the next level with features you'll really appreciate, such as:
40
-
41
- * Scheduled backups
42
- * Cloud Storage to Dropbox, Google Drive, Amazon S3 and FTP
43
- * Multi-threaded to support larger web sites &amp; databases
44
- * Migrate an entire multisite WordPress network in one shot
45
- * Install a multisite subsite as a new standalone website
46
- * Database and user creation *in the installer* with cPanel API
47
- * Connect to cPanel directly from installer
48
- * Email notifications
49
- * Professional support
50
- * ... and much more!
51
-
52
- Check out [Duplicator Pro](https://snapcreek.com/duplicator/?utm_source=duplicator_free&utm_medium=wp_org&utm_content=wpo_premium&utm_campaign=duplicator_pro) today!
53
-
54
- = Please Note =
55
- The underlying logic to backup WordPress, move WordPress and transfer WordPress are complex and it's impossible to know how each system is setup; this is why your feedback is important to us. Thanks for helping us to make WordPress the best blogging platform in the world.
56
-
57
- = Disclaimer =
58
- This plugin does require some technical knowledge. If you plan to migrate WordPress or backup WordPress please use it at your own risk and don't forget to back up your files and databases beforehand. If you need to move or backup WordPress and would like additional help please visit the Duplicator [resources section](https://snapcreek.com/duplicator/docs/faqs-tech?utm_source=duplicator_free&utm_medium=wp_org&utm_content=free_disclaimer&utm_campaign=duplicator_free#faq-resource-030-q) .
59
-
60
- = Active Contributors =
61
- <li>[Paal Joachim Romdahl](http://www.easywebdesigntutorials.com) (Training)</li>
62
- <li>[Hans-M. Herbrand](http://www.web266.de) (German) </li>
63
- <li>[Nicolas Richer](http://nicolasricher.fr) (French)</li>
64
-
65
- == Screenshots ==
66
-
67
- 1. Main Interface for all Packages
68
- 2. Create Package Step 1
69
- 3. Create Package Step 2
70
- 4. Build Process
71
- 5. Installer Screen
72
-
73
- == Frequently Asked Questions ==
74
-
75
- = Does Duplicator have a knowledge base or FAQ? =
76
- Yes. Please see [all documents](https://snapcreek.com/duplicator/docs/?utm_source=duplicator_free&utm_medium=wp_org&utm_content=faq_docs&utm_campaign=duplicator_free) at snapcreek.com.
77
-
78
- = Installation Instructions =
79
- 1. Upload `duplicator` folder to the `/wp-content/plugins/` directory
80
- 2. Activate the plugin through the 'Plugins' menu in WordPress
81
- 3. Click on the Duplicator link from the main menu
82
- 4. Check out the help by clicking the help icon and create your first package.
83
-
84
- The Duplicator requires php 5.3 or higher.
85
-
86
-
87
- = Are there any videos I can watch? =
88
- Yes. Please see the [video section](https://snapcreek.com/duplicator/docs/faqs-tech?utm_source=duplicator_free&utm_medium=wp_org&utm_content=faq_videos&utm_campaign=duplicator_free#faq-resource-070-q) on the FAQ.
89
-
90
- = Is this plugin compatible with WordPress multisite (MU)? =
91
- Duplicator isn't, however [Duplicator Pro](https://snapcreek.com/duplicator/?utm_source=duplicator_free&utm_medium=wp_org&utm_content=faq_dpro_multisiteinfo&utm_campaign=duplicator_pro) supports full multisite network migrations/backups and also can install a multisite subsite as a standalone site.
92
-
93
- = Where can I get more help and support for this plugin? =
94
- Visit the [Duplicator support](https://snapcreek.com/duplicator/docs/faqs-tech?utm_source=duplicator_free&utm_medium=wp_org&utm_content=faq_support&utm_campaign=duplicator_free#faq-resource-030-q) section at snapcreek.com
95
-
96
-
97
- == Changelog ==
98
-
99
- Please see the following url:
100
- [https://snapcreek.com/duplicator/docs/changelog?lite](https://snapcreek.com/duplicator/docs/changelog?lite&utm_source=duplicator_free&utm_medium=wp_org&utm_content=changelog_support&utm_campaign=duplicator_free)
101
-
102
-
103
-
104
- == Upgrade Notice ==
105
-
106
  Please use our ticketing system when submitting your logs. Please do not post to the forums.
1
+ === Duplicator - WordPress Migration Plugin ===
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.9
7
+ Requires PHP: 5.2.17
8
+ Stable tag: 1.2.36
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.
12
+
13
+ == Description ==
14
+
15
+ > With over **10 million downloads** Duplicator successfully gives WordPress users the ability to migrate, copy, move or clone a site from one location to another and also serves as a simple backup utility. Duplicator handles serialized and base64 serialized replacements. Standard WordPress migration and WordPress backups are easily handled by this plugin as are **zero downtime migrations**.
16
+
17
+ For complete details visit [snapcreek.com](https://snapcreek.com/duplicator/?utm_source=duplicator_free&utm_medium=wp_org&utm_content=desc_details&utm_campaign=duplicator_free).
18
+
19
+ = Quick Video Demo =
20
+ http://www.youtube.com/watch?v=oc73jtvHWYQ
21
+
22
+ = Overview =
23
+ Duplicator enables you to:
24
+
25
+ * Move, migrate or clone a WordPress site between domains or hosts with **zero downtime**
26
+ * Pull down a live site to localhost for development
27
+ * Manually backup a WordPress site or parts of a site
28
+ * Duplicate a live site to a staging area or vice versa
29
+ * Bundle up an entire WordPress site for easy reuse or distribution
30
+ * Perform a full WordPress migration without struggling with messy import/export sql scripts
31
+
32
+ = Migrate WordPress and Run WordPress Backups =
33
+ Duplicator creates a package that bundles all the site's plugins, themes, content, database and WordPress files into a simple zip file called a package. This package can then be used to easily migrate a WordPress site to any location you wish. Move on the same server, across servers and pretty much any location a WordPress site can be hosted. *WordPress is not required for installation* since the package contains all site files.
34
+
35
+ = Improve Your Workflow with Pre-Bundled Sites =
36
+ Duplicator lets you make your own pre-configured sites to eliminate rework. Instead of manually configuring your favorite theme, set of plugins or content over and over, now just configure a single site and bundle it up into a Duplicator package. Once you have the bundled site, you can migrate the WordPress site over and over to different locations to instantly create many pre-configured sites!
37
+
38
+ = Duplicator Pro =
39
+ Duplicator Pro takes Duplicator to the next level with features you'll really appreciate, such as:
40
+
41
+ * Scheduled backups
42
+ * Cloud Storage to Dropbox, Google Drive, Amazon S3 and FTP
43
+ * Multi-threaded to support larger web sites &amp; databases
44
+ * Migrate an entire multisite WordPress network in one shot
45
+ * Install a multisite subsite as a new standalone website
46
+ * Database and user creation *in the installer* with cPanel API
47
+ * Connect to cPanel directly from installer
48
+ * Email notifications
49
+ * Professional support
50
+ * ... and much more!
51
+
52
+ Check out [Duplicator Pro](https://snapcreek.com/duplicator/?utm_source=duplicator_free&utm_medium=wp_org&utm_content=wpo_premium&utm_campaign=duplicator_pro) today!
53
+
54
+ = Please Note =
55
+ The underlying logic to backup WordPress, move WordPress and transfer WordPress are complex and it's impossible to know how each system is setup; this is why your feedback is important to us. Thanks for helping us to make WordPress the best blogging platform in the world.
56
+
57
+ = Disclaimer =
58
+ This plugin does require some technical knowledge. If you plan to migrate WordPress or backup WordPress please use it at your own risk and don't forget to back up your files and databases beforehand. If you need to move or backup WordPress and would like additional help please visit the Duplicator [resources section](https://snapcreek.com/duplicator/docs/faqs-tech?utm_source=duplicator_free&utm_medium=wp_org&utm_content=free_disclaimer&utm_campaign=duplicator_free#faq-resource-030-q) .
59
+
60
+ = Active Contributors =
61
+ <li>[Paal Joachim Romdahl](http://www.easywebdesigntutorials.com) (Training)</li>
62
+ <li>[Hans-M. Herbrand](http://www.web266.de) (German) </li>
63
+ <li>[Nicolas Richer](http://nicolasricher.fr) (French)</li>
64
+
65
+ == Screenshots ==
66
+
67
+ 1. Main Interface for all Packages
68
+ 2. Create Package Step 1
69
+ 3. Create Package Step 2
70
+ 4. Build Process
71
+ 5. Installer Screen
72
+
73
+ == Frequently Asked Questions ==
74
+
75
+ = Does Duplicator have a knowledge base or FAQ? =
76
+ Yes. Please see [all documents](https://snapcreek.com/duplicator/docs/?utm_source=duplicator_free&utm_medium=wp_org&utm_content=faq_docs&utm_campaign=duplicator_free) at snapcreek.com.
77
+
78
+ = Installation Instructions =
79
+ 1. Upload `duplicator` folder to the `/wp-content/plugins/` directory
80
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
81
+ 3. Click on the Duplicator link from the main menu
82
+ 4. Check out the help by clicking the help icon and create your first package.
83
+
84
+ The Duplicator requires php 5.3 or higher.
85
+
86
+
87
+ = Are there any videos I can watch? =
88
+ Yes. Please see the [video section](https://snapcreek.com/duplicator/docs/faqs-tech?utm_source=duplicator_free&utm_medium=wp_org&utm_content=faq_videos&utm_campaign=duplicator_free#faq-resource-070-q) on the FAQ.
89
+
90
+ = Is this plugin compatible with WordPress multisite (MU)? =
91
+ Duplicator isn't, however [Duplicator Pro](https://snapcreek.com/duplicator/?utm_source=duplicator_free&utm_medium=wp_org&utm_content=faq_dpro_multisiteinfo&utm_campaign=duplicator_pro) supports full multisite network migrations/backups and also can install a multisite subsite as a standalone site.
92
+
93
+ = Where can I get more help and support for this plugin? =
94
+ Visit the [Duplicator support](https://snapcreek.com/duplicator/docs/faqs-tech?utm_source=duplicator_free&utm_medium=wp_org&utm_content=faq_support&utm_campaign=duplicator_free#faq-resource-030-q) section at snapcreek.com
95
+
96
+
97
+ == Changelog ==
98
+
99
+ Please see the following url:
100
+ [https://snapcreek.com/duplicator/docs/changelog?lite](https://snapcreek.com/duplicator/docs/changelog?lite&utm_source=duplicator_free&utm_medium=wp_org&utm_content=changelog_support&utm_campaign=duplicator_free)
101
+
102
+
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
@@ -181,7 +181,7 @@ require_once(DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php');
181
  <td class="feature-column"><?php _e('Multisite Subsite &gt; Standalone', 'duplicator') ?><sup>
182
  <i class="fa fa-question-circle dup-gopro-help"
183
  data-tooltip-title="<?php _e("Multisite", 'duplicator'); ?>"
184
- data-tooltip="<?php _e('Install an individual subsite from a Multisite as a standalone site.', 'duplicator'); ?>"/></i></sup>
185
  </td>
186
  <td class="check-column"></td>
187
  <td class="check-column"><i class="fa fa-check"></i></td>
181
  <td class="feature-column"><?php _e('Multisite Subsite &gt; Standalone', 'duplicator') ?><sup>
182
  <i class="fa fa-question-circle dup-gopro-help"
183
  data-tooltip-title="<?php _e("Multisite", 'duplicator'); ?>"
184
+ data-tooltip="<?php _e('Install an individual subsite from a Multisite as a standalone site. This feature is only available with a business license purchase.', 'duplicator'); ?>"/></i></sup>
185
  </td>
186
  <td class="check-column"></td>
187
  <td class="check-column"><i class="fa fa-check"></i></td>
views/packages/main/packages.php CHANGED
@@ -1,330 +1,330 @@
1
- <?php
2
- $qryResult = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}duplicator_packages` ORDER BY id DESC", ARRAY_A);
3
- $qryStatus = $wpdb->get_results("SELECT status FROM `{$wpdb->prefix}duplicator_packages` WHERE status >= 100", ARRAY_A);
4
- $totalElements = count($qryResult);
5
- $statusCount = count($qryStatus);
6
- $package_debug = DUP_Settings::Get('package_debug');
7
- $ajax_nonce = wp_create_nonce('package_list');
8
- $ui_create_frmt = is_numeric(DUP_Settings::Get('package_ui_created')) ? DUP_Settings::Get('package_ui_created') : 1;
9
- ?>
10
-
11
- <style>
12
- div#dup-list-alert-nodata {padding:70px 20px;text-align:center; font-size:20px; line-height:26px}
13
- div.dup-notice-msg {border:1px solid silver; padding: 10px; border-radius: 5px; width: 550px;
14
- margin:40px auto 0px auto; font-size:12px; text-align: left; word-break:normal;
15
- background: #fefcea;
16
- background: -moz-linear-gradient(top, #fefcea 0%, #efe5a2 100%);
17
- background: -ms-linear-gradient(top, #fefcea 0%,#efe5a2 100%);
18
- background: linear-gradient(to bottom, #fefcea 0%,#efe5a2 100%);
19
- }
20
- input#dup-bulk-action-all {margin:0px;padding:0px 0px 0px 5px;}
21
- button.dup-button-selected {border:1px solid #000 !important; background-color:#dfdfdf !important;}
22
- div.dup-quick-start {font-style:italic; font-size: 13px; line-height: 18px; margin-top: 15px}
23
-
24
- /* Table package details */
25
- table.dup-pack-table {word-break:break-all;}
26
- table.dup-pack-table th {white-space:nowrap !important;}
27
- table.dup-pack-table td.pack-name {text-overflow:ellipsis; white-space:nowrap}
28
- table.dup-pack-table td.pack-name sup {font-style:italic;font-size:10px; cursor: pointer }
29
- table.dup-pack-table input[name="delete_confirm"] {margin-left:15px}
30
- table.dup-pack-table td.fail {border-left: 4px solid #d54e21;}
31
- table.dup-pack-table td.pass {border-left: 4px solid #2ea2cc;}
32
- tr.dup-pack-info td {white-space:nowrap; padding:12px 30px 0px 7px;}
33
- tr.dup-pack-info td.get-btns {text-align:right; padding:3px 5px 6px 0px !important;}
34
- tr.dup-pack-info td.get-btns button {box-shadow:none}
35
- textarea.dup-pack-debug {width:98%; height:300px; font-size:11px; display:none}
36
- td.error-msg a {color:maroon}
37
- td.error-msg a i {color:maroon}
38
- td.error-msg span {display:inline-block; padding:7px 18px 0px 0px; color:maroon}
39
- div#dup-help-dlg i {display: inline-block; width: 15px; padding:2px;line-height:28px; font-size:14px;}
40
- </style>
41
-
42
- <form id="form-duplicator" method="post">
43
-
44
- <!-- ====================
45
- TOOL-BAR -->
46
- <table id="dup-toolbar">
47
- <tr valign="top">
48
- <td style="white-space: nowrap">
49
- <select id="dup-pack-bulk-actions">
50
- <option value="-1" selected="selected"><?php _e("Bulk Actions", 'duplicator') ?></option>
51
- <option value="delete" title="<?php _e("Delete selected package(s)", 'duplicator') ?>"><?php _e("Delete", 'duplicator') ?></option>
52
- </select>
53
- <input type="button" id="dup-pack-bulk-apply" class="button action" value="<?php _e("Apply", 'duplicator') ?>" onclick="Duplicator.Pack.ConfirmDelete()">
54
- <span class="btn-separator"></span>
55
- <a href="javascript:void(0)" id="btn-logs-dialog" class="button" title="<?php _e("Get Help", 'duplicator') ?>" onclick="Duplicator.Pack.showHelp()">
56
- <?php echo ($statusCount == 1)
57
- ? '<i class="fa fa-question-circle" style="color:green"></i>'
58
- : '<i class="fa fa-question-circle grey-icon"></i>';
59
- ?>
60
- </a>
61
- <a href="admin.php?page=duplicator-settings&tab=package" class="button grey-icon" title="<?php _e("Settings", 'duplicator') ?>"><i class="fa fa-gear"></i></a>
62
- </td>
63
- <td>
64
- <span><i class="fa fa-archive"></i> <?php _e("Packages", 'duplicator'); ?></span>
65
- <a href="?page=duplicator&tab=new1" class="add-new-h2"><?php _e("Create New", 'duplicator'); ?></a>
66
- </td>
67
- </tr>
68
- </table>
69
-
70
-
71
- <?php if($totalElements == 0) : ?>
72
- <!-- ====================
73
- NO-DATA MESSAGES-->
74
- <table class="widefat dup-pack-table">
75
- <thead><tr><th>&nbsp;</th></tr></thead>
76
- <tbody>
77
- <tr>
78
- <td>
79
- <div id='dup-list-alert-nodata'>
80
- <i class="fa fa-archive"></i>
81
- <?php _e("No Packages Found.", 'duplicator'); ?><br/>
82
- <?php _e("Click the 'Create New' button to build a package.", 'duplicator'); ?><br/>
83
- <div class="dup-quick-start">
84
- <?php _e("New to Duplicator?", 'duplicator'); ?><br/>
85
- <a href="https://snapcreek.com/duplicator/docs/quick-start/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=packages_empty&utm_campaign=quick_start" target="_blank">
86
- <?php _e("Check out the 'Quick Start' guide!", 'duplicator'); ?>
87
- </a>
88
- </div>
89
- <div style="height:75px">&nbsp;</div>
90
- </div>
91
- </td>
92
- </tr>
93
- </tbody>
94
- <tfoot><tr><th>&nbsp;</th></tr></tfoot>
95
- </table>
96
- <?php else : ?>
97
- <!-- ====================
98
- LIST ALL PACKAGES -->
99
- <table class="widefat dup-pack-table">
100
- <thead>
101
- <tr>
102
- <th><input type="checkbox" id="dup-bulk-action-all" title="<?php _e("Select all packages", 'duplicator') ?>" style="margin-left:15px" onclick="Duplicator.Pack.SetDeleteAll()" /></th>
103
- <th><?php _e("Created", 'duplicator') ?></th>
104
- <th><?php _e("Size", 'duplicator') ?></th>
105
- <th style="width:90%;"><?php _e("Name", 'duplicator') ?></th>
106
- <th style="text-align:center;" colspan="2">
107
- <?php _e("Package", 'duplicator')?>
108
- </th>
109
- </tr>
110
- </thead>
111
- <?php
112
- $rowCount = 0;
113
- $totalSize = 0;
114
- $txt_dbonly = __('Database Only', 'duplicator');
115
- $rows = $qryResult;
116
- foreach ($rows as $row) {
117
- $Package = unserialize($row['package']);
118
- $pack_dbonly = false;
119
-
120
- if (is_object($Package)) {
121
- $pack_name = $Package->Name;
122
- $pack_archive_size = $Package->Archive->Size;
123
- $pack_storeurl = $Package->StoreURL;
124
- $pack_namehash = $Package->NameHash;
125
- $pack_dbonly = $Package->Archive->ExportOnlyDB;
126
- } else {
127
- $pack_archive_size = 0;
128
- $pack_storeurl = 'unknown';
129
- $pack_name = 'unknown';
130
- $pack_namehash = 'unknown';
131
- }
132
-
133
- //Links
134
- $uniqueid = "{$row['name']}_{$row['hash']}";
135
- $packagepath = $pack_storeurl . "{$uniqueid}_archive.zip";
136
- $installerpath = $pack_storeurl . "{$uniqueid}_installer.php";
137
- $installfilelink = "{$installerpath}?get=1&file={$uniqueid}_installer.php";
138
- $css_alt = ($rowCount % 2 != 0) ? '' : 'alternate';
139
- ?>
140
-
141
- <!-- COMPLETE -->
142
- <?php if ($row['status'] >= 100) : ?>
143
- <tr class="dup-pack-info <?php echo $css_alt ?>">
144
- <td class="pass"><input name="delete_confirm" type="checkbox" id="<?php echo $row['id'] ;?>" /></td>
145
- <td><?php echo DUP_Package::getCreatedDateFormat($row['created'], $ui_create_frmt);?></td>
146
- <td><?php echo DUP_Util::byteSize($pack_archive_size); ?></td>
147
- <td class='pack-name'>
148
- <?php echo ($pack_dbonly) ? "{$pack_name} <sup title='{$txt_dbonly}'>DB</sup>" : $pack_name ; ?>
149
- </td>
150
- <td class="get-btns">
151
- <button id="<?php echo "{$uniqueid}_installer.php" ?>" class="button no-select" onclick="Duplicator.Pack.DownloadFile('<?php echo $installfilelink; ?>', this); return false;">
152
- <i class="fa fa-bolt"></i> <?php _e("Installer", 'duplicator') ?>
153
- </button>
154
- <button id="<?php echo "{$uniqueid}_archive.zip" ?>" class="button no-select" onclick="Duplicator.Pack.DownloadFile('<?php echo $packagepath; ?>', this); return false;">
155
- <i class="fa fa-file-archive-o"></i> <?php _e("Archive", 'duplicator') ?>
156
- </button>
157
- <button type="button" class="button no-select" title="<?php _e("Package Details", 'duplicator') ?>" onclick="Duplicator.Pack.OpenPackageDetails(<?php echo "{$row['id']}"; ?>);">
158
- <i class="fa fa-archive" ></i>
159
- </button>
160
- </td>
161
- </tr>
162
-
163
- <!-- NOT COMPLETE -->
164
- <?php else : ?>
165
-
166
- <?php
167
- $size = 0;
168
- $tmpSearch = glob(DUPLICATOR_SSDIR_PATH_TMP . "/{$pack_namehash}_*");
169
- if (is_array($tmpSearch)) {
170
- $result = array_map('filesize', $tmpSearch);
171
- $size = array_sum($result);
172
- }
173
- $pack_archive_size = $size;
174
- $error_url = "?page=duplicator&action=detail&tab=detail&id={$row['id']}";
175
- ?>
176
- <tr class="dup-pack-info <?php echo $css_alt ?>">
177
- <td class="fail"><input name="delete_confirm" type="checkbox" id="<?php echo $row['id'] ;?>" /></td>
178
- <td><?php echo DUP_Package::getCreatedDateFormat($row['created'], $ui_create_frmt);?></td>
179
- <td><?php echo DUP_Util::byteSize($size); ?></td>
180
- <td class='pack-name'><?php echo $pack_name ;?></td>
181
- <td class="get-btns error-msg" colspan="2">
182
- <span>
183
- <i class="fa fa-exclamation-triangle"></i>
184
- <a href="<?php echo $error_url; ?>"><?php _e("Error Processing", 'duplicator') ?></a>
185
- </span>
186
- <a class="button no-select" title="<?php _e("Package Details", 'duplicator') ?>" href="<?php echo $error_url; ?>">
187
- <i class="fa fa-archive"></i>
188
- </a>
189
- </td>
190
- </tr>
191
- <?php endif; ?>
192
- <?php
193
- $totalSize = $totalSize + $pack_archive_size;
194
- $rowCount++;
195
- }
196
- ?>
197
- <tfoot>
198
- <tr>
199
- <th colspan="11" style='text-align:right; font-size:12px'>
200
- <?php echo _e("Packages", 'duplicator') . ': ' . $totalElements; ?> |
201
- <?php echo _e("Total Size", 'duplicator') . ': ' . DUP_Util::byteSize($totalSize); ?>
202
- </th>
203
- </tr>
204
- </tfoot>
205
- </table>
206
- <?php endif; ?>
207
- </form>
208
-
209
- <!-- ==========================================
210
- THICK-BOX DIALOGS: -->
211
- <?php
212
- $alert1 = new DUP_UI_Dialog();
213
- $alert1->title = __('Bulk Action Required', 'duplicator');
214
- $alert1->message = __('Please select an action from the "Bulk Actions" drop down menu!', 'duplicator');
215
- $alert1->initAlert();
216
-
217
- $alert2 = new DUP_UI_Dialog();
218
- $alert2->title = __('Selection Required', 'duplicator', 'duplicator');
219
- $alert2->message = __('Please select at least one package to delete!', 'duplicator');
220
- $alert2->initAlert();
221
-
222
- $confirm1 = new DUP_UI_Dialog();
223
- $confirm1->title = __('Delete Packages?', 'duplicator');
224
- $confirm1->message = __('Are you sure, you want to delete the selected package(s)?', 'duplicator');
225
- $confirm1->progressText = __('Removing Packages, Please Wait...', 'duplicator');
226
- $confirm1->jscallback = 'Duplicator.Pack.Delete()';
227
- $confirm1->initConfirm();
228
-
229
- $alert3 = new DUP_UI_Dialog();
230
- $alert3->height = 350;
231
- $alert3->width = 350;
232
- $alert3->title = __('Duplicator Help', 'duplicator');
233
- $alert3->message = "<div id='dup-help-dlg'></div>";
234
- $alert3->initAlert();
235
- ?>
236
-
237
- <!-- =======================
238
- DIALOG: HELP DIALOG -->
239
- <div id="dup-help-dlg-info" style="display:none">
240
- <b><?php _e("Common Questions:", 'duplicator') ?></b><hr size='1'/>
241
- <i class="fa fa-file-text-o"></i> <a href="https://snapcreek.com/duplicator/docs/quick-start?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=help_btn_pack_help&utm_campaign=duplicator_free#quick-010-q" target="_blank"><?php _e("How do I create a package", 'duplicator') ?></a> <br/>
242
- <i class="fa fa-file-text-o"></i> <a href="https://snapcreek.com/duplicator/docs/quick-start/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=help_btn_install_help&utm_campaign=duplicator_free#quick-040-q" target="_blank"><?php _e('How do I install a package?', 'duplicator'); ?></a> <br/>
243
- <i class="fa fa-file-code-o"></i> <a href="https://snapcreek.com/duplicator/docs/faqs-tech?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=help_btn_faq&utm_campaign=duplicator_free" target="_blank"><?php _e("Frequently Asked Questions!", 'duplicator') ?></a>
244
- <br/><br/>
245
-
246
- <b><?php _e("Other Resources:", 'duplicator') ?></b><hr size='1'/>
247
- <i class="fa fa-question-circle"></i> <a href="https://snapcreek.com/ticket?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=help_btn_ticket&utm_campaign=duplicator_free" target="_blank"><?php _e("Need help with the plugin?", 'duplicator') ?></a> <br/>
248
- <i class="fa fa-lightbulb-o"></i> <a href="https://snapcreek.com/support?idea=1&utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=help_btn_idea&utm_campaign=duplicator_free" target="_blank"><?php _e("Have an idea for the plugin?", 'duplicator') ?></a> <br/>
249
- <?php if($statusCount >= 3) : ?>
250
- <i class="fa fa-star-o"></i> <a href="https://wordpress.org/support/plugin/duplicator/reviews/?filter=5" target="vote-wp"><?php _e("Help review the plugin!", 'duplicator') ?></a>
251
- <?php endif; ?>
252
- </div>
253
-
254
- <script>
255
- jQuery(document).ready(function($)
256
- {
257
-
258
- /* Creats a comma seperate list of all selected package ids */
259
- Duplicator.Pack.GetDeleteList = function ()
260
- {
261
- var arr = new Array;
262
- var count = 0;
263
- $("input[name=delete_confirm]").each(function () {
264
- if (this.checked) {
265
- arr[count++] = this.id;
266
- }
267
- });
268
- var list = arr.join(',');
269
- return list;
270
- }
271
-
272
- /* Provides the correct confirmation items when deleting packages */
273
- Duplicator.Pack.ConfirmDelete = function ()
274
- {
275
- if ($("#dup-pack-bulk-actions").val() != "delete") {
276
- <?php $alert1->showAlert(); ?>
277
- return;
278
- }
279
-
280
- var list = Duplicator.Pack.GetDeleteList();
281
- if (list.length == 0) {
282
- <?php $alert2->showAlert(); ?>
283
- return;
284
- }
285
- <?php $confirm1->showConfirm(); ?>
286
- }
287
-
288
-
289
- /* Removes all selected package sets
290
- * @param event To prevent bubbling */
291
- Duplicator.Pack.Delete = function (event)
292
- {
293
- var list = Duplicator.Pack.GetDeleteList();
294
-
295
- $.ajax({
296
- type: "POST",
297
- url: ajaxurl,
298
- dataType: "json",
299
- data: {action : 'duplicator_package_delete', duplicator_delid : list, nonce: '<?php echo $ajax_nonce; ?>' },
300
- complete: function(data) {
301
- Duplicator.ReloadWindow(data);
302
- }
303
- });
304
-
305
- };
306
-
307
- /* Toogles the Bulk Action Check boxes */
308
- Duplicator.Pack.SetDeleteAll = function()
309
- {
310
- var state = $('input#dup-bulk-action-all').is(':checked') ? 1 : 0;
311
- $("input[name=delete_confirm]").each(function() {
312
- this.checked = (state) ? true : false;
313
- });
314
- }
315
-
316
- /* Opens detail screen */
317
- Duplicator.Pack.OpenPackageDetails = function (package_id)
318
- {
319
- window.location.href = '?page=duplicator&action=detail&tab=detail&id=' + package_id;
320
- }
321
-
322
- /* Toggles the feedback form */
323
- Duplicator.Pack.showHelp = function ()
324
- {
325
- $('#dup-help-dlg').html($('#dup-help-dlg-info').html());
326
- <?php $alert3->showAlert(); ?>
327
- }
328
-
329
- });
330
  </script>
1
+ <?php
2
+ $qryResult = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}duplicator_packages` ORDER BY id DESC", ARRAY_A);
3
+ $qryStatus = $wpdb->get_results("SELECT status FROM `{$wpdb->prefix}duplicator_packages` WHERE status >= 100", ARRAY_A);
4
+ $totalElements = count($qryResult);
5
+ $statusCount = count($qryStatus);
6
+ $package_debug = DUP_Settings::Get('package_debug');
7
+ $ajax_nonce = wp_create_nonce('package_list');
8
+ $ui_create_frmt = is_numeric(DUP_Settings::Get('package_ui_created')) ? DUP_Settings::Get('package_ui_created') : 1;
9
+ ?>
10
+
11
+ <style>
12
+ div#dup-list-alert-nodata {padding:70px 20px;text-align:center; font-size:20px; line-height:26px}
13
+ div.dup-notice-msg {border:1px solid silver; padding: 10px; border-radius: 5px; width: 550px;
14
+ margin:40px auto 0px auto; font-size:12px; text-align: left; word-break:normal;
15
+ background: #fefcea;
16
+ background: -moz-linear-gradient(top, #fefcea 0%, #efe5a2 100%);
17
+ background: -ms-linear-gradient(top, #fefcea 0%,#efe5a2 100%);
18
+ background: linear-gradient(to bottom, #fefcea 0%,#efe5a2 100%);
19
+ }
20
+ input#dup-bulk-action-all {margin:0px;padding:0px 0px 0px 5px;}
21
+ button.dup-button-selected {border:1px solid #000 !important; background-color:#dfdfdf !important;}
22
+ div.dup-quick-start {font-style:italic; font-size: 13px; line-height: 18px; margin-top: 15px}
23
+
24
+ /* Table package details */
25
+ table.dup-pack-table {word-break:break-all;}
26
+ table.dup-pack-table th {white-space:nowrap !important;}
27
+ table.dup-pack-table td.pack-name {text-overflow:ellipsis; white-space:nowrap}
28
+ table.dup-pack-table td.pack-name sup {font-style:italic;font-size:10px; cursor: pointer }
29
+ table.dup-pack-table input[name="delete_confirm"] {margin-left:15px}
30
+ table.dup-pack-table td.fail {border-left: 4px solid #d54e21;}
31
+ table.dup-pack-table td.pass {border-left: 4px solid #2ea2cc;}
32
+ tr.dup-pack-info td {white-space:nowrap; padding:12px 30px 0px 7px;}
33
+ tr.dup-pack-info td.get-btns {text-align:right; padding:3px 5px 6px 0px !important;}
34
+ tr.dup-pack-info td.get-btns button {box-shadow:none}
35
+ textarea.dup-pack-debug {width:98%; height:300px; font-size:11px; display:none}
36
+ td.error-msg a {color:maroon}
37
+ td.error-msg a i {color:maroon}
38
+ td.error-msg span {display:inline-block; padding:7px 18px 0px 0px; color:maroon}
39
+ div#dup-help-dlg i {display: inline-block; width: 15px; padding:2px;line-height:28px; font-size:14px;}
40
+ </style>
41
+
42
+ <form id="form-duplicator" method="post">
43
+
44
+ <!-- ====================
45
+ TOOL-BAR -->
46
+ <table id="dup-toolbar">
47
+ <tr valign="top">
48
+ <td style="white-space: nowrap">
49
+ <select id="dup-pack-bulk-actions">
50
+ <option value="-1" selected="selected"><?php _e("Bulk Actions", 'duplicator') ?></option>
51
+ <option value="delete" title="<?php _e("Delete selected package(s)", 'duplicator') ?>"><?php _e("Delete", 'duplicator') ?></option>
52
+ </select>
53
+ <input type="button" id="dup-pack-bulk-apply" class="button action" value="<?php _e("Apply", 'duplicator') ?>" onclick="Duplicator.Pack.ConfirmDelete()">
54
+ <span class="btn-separator"></span>
55
+ <a href="javascript:void(0)" class="button" title="<?php _e("Get Help", 'duplicator') ?>" onclick="Duplicator.Pack.showHelp()">
56
+ <?php echo ($statusCount == 1)
57
+ ? '<i class="fa fa-question-circle" style="color:green"></i>'
58
+ : '<i class="fa fa-question-circle grey-icon"></i>';
59
+ ?>
60
+ </a>
61
+ <a href="admin.php?page=duplicator-settings&tab=package" class="button grey-icon" title="<?php _e("Settings", 'duplicator') ?>"><i class="fa fa-gear"></i></a>
62
+ </td>
63
+ <td>
64
+ <span><i class="fa fa-archive"></i> <?php _e("Packages", 'duplicator'); ?></span>
65
+ <a href="?page=duplicator&tab=new1" class="add-new-h2"><?php _e("Create New", 'duplicator'); ?></a>
66
+ </td>
67
+ </tr>
68
+ </table>
69
+
70
+
71
+ <?php if($totalElements == 0) : ?>
72
+ <!-- ====================
73
+ NO-DATA MESSAGES-->
74
+ <table class="widefat dup-pack-table">
75
+ <thead><tr><th>&nbsp;</th></tr></thead>
76
+ <tbody>
77
+ <tr>
78
+ <td>
79
+ <div id='dup-list-alert-nodata'>
80
+ <i class="fa fa-archive"></i>
81
+ <?php _e("No Packages Found.", 'duplicator'); ?><br/>
82
+ <?php _e("Click the 'Create New' button to build a package.", 'duplicator'); ?><br/>
83
+ <div class="dup-quick-start">
84
+ <?php _e("New to Duplicator?", 'duplicator'); ?><br/>
85
+ <a href="https://snapcreek.com/duplicator/docs/quick-start/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=packages_empty&utm_campaign=quick_start" target="_blank">
86
+ <?php _e("Check out the 'Quick Start' guide!", 'duplicator'); ?>
87
+ </a>
88
+ </div>
89
+ <div style="height:75px">&nbsp;</div>
90
+ </div>
91
+ </td>
92
+ </tr>
93
+ </tbody>
94
+ <tfoot><tr><th>&nbsp;</th></tr></tfoot>
95
+ </table>
96
+ <?php else : ?>
97
+ <!-- ====================
98
+ LIST ALL PACKAGES -->
99
+ <table class="widefat dup-pack-table">
100
+ <thead>
101
+ <tr>
102
+ <th><input type="checkbox" id="dup-bulk-action-all" title="<?php _e("Select all packages", 'duplicator') ?>" style="margin-left:15px" onclick="Duplicator.Pack.SetDeleteAll()" /></th>
103
+ <th><?php _e("Created", 'duplicator') ?></th>
104
+ <th><?php _e("Size", 'duplicator') ?></th>
105
+ <th style="width:90%;"><?php _e("Name", 'duplicator') ?></th>
106
+ <th style="text-align:center;" colspan="2">
107
+ <?php _e("Package", 'duplicator')?>
108
+ </th>
109
+ </tr>
110
+ </thead>
111
+ <?php
112
+ $rowCount = 0;
113
+ $totalSize = 0;
114
+ $txt_dbonly = __('Database Only', 'duplicator');
115
+ $rows = $qryResult;
116
+ foreach ($rows as $row) {
117
+ $Package = unserialize($row['package']);
118
+ $pack_dbonly = false;
119
+
120
+ if (is_object($Package)) {
121
+ $pack_name = $Package->Name;
122
+ $pack_archive_size = $Package->Archive->Size;
123
+ $pack_storeurl = $Package->StoreURL;
124
+ $pack_namehash = $Package->NameHash;
125
+ $pack_dbonly = $Package->Archive->ExportOnlyDB;
126
+ } else {
127
+ $pack_archive_size = 0;
128
+ $pack_storeurl = 'unknown';
129
+ $pack_name = 'unknown';
130
+ $pack_namehash = 'unknown';
131
+ }
132
+
133
+ //Links
134
+ $uniqueid = "{$row['name']}_{$row['hash']}";
135
+ $packagepath = $pack_storeurl . "{$uniqueid}_archive.zip";
136
+ $installerpath = $pack_storeurl . "{$uniqueid}_installer.php";
137
+ $installfilelink = "{$installerpath}?get=1&file={$uniqueid}_installer.php";
138
+ $css_alt = ($rowCount % 2 != 0) ? '' : 'alternate';
139
+ ?>
140
+
141
+ <!-- COMPLETE -->
142
+ <?php if ($row['status'] >= 100) : ?>
143
+ <tr class="dup-pack-info <?php echo $css_alt ?>">
144
+ <td class="pass"><input name="delete_confirm" type="checkbox" id="<?php echo $row['id'] ;?>" /></td>
145
+ <td><?php echo DUP_Package::getCreatedDateFormat($row['created'], $ui_create_frmt);?></td>
146
+ <td><?php echo DUP_Util::byteSize($pack_archive_size); ?></td>
147
+ <td class='pack-name'>
148
+ <?php echo ($pack_dbonly) ? "{$pack_name} <sup title='{$txt_dbonly}'>DB</sup>" : $pack_name ; ?>
149
+ </td>
150
+ <td class="get-btns">
151
+ <button id="<?php echo "{$uniqueid}_installer.php" ?>" class="button no-select" onclick="Duplicator.Pack.DownloadFile('<?php echo $installfilelink; ?>', this); return false;">
152
+ <i class="fa fa-bolt"></i> <?php _e("Installer", 'duplicator') ?>
153
+ </button>
154
+ <button id="<?php echo "{$uniqueid}_archive.zip" ?>" class="button no-select" onclick="Duplicator.Pack.DownloadFile('<?php echo $packagepath; ?>', this); return false;">
155
+ <i class="fa fa-file-archive-o"></i> <?php _e("Archive", 'duplicator') ?>
156
+ </button>
157
+ <button type="button" class="button no-select" title="<?php _e("Package Details", 'duplicator') ?>" onclick="Duplicator.Pack.OpenPackageDetails(<?php echo "{$row['id']}"; ?>);">
158
+ <i class="fa fa-archive" ></i>
159
+ </button>
160
+ </td>
161
+ </tr>
162
+
163
+ <!-- NOT COMPLETE -->
164
+ <?php else : ?>
165
+
166
+ <?php
167
+ $size = 0;
168
+ $tmpSearch = glob(DUPLICATOR_SSDIR_PATH_TMP . "/{$pack_namehash}_*");
169
+ if (is_array($tmpSearch)) {
170
+ $result = array_map('filesize', $tmpSearch);
171
+ $size = array_sum($result);
172
+ }
173
+ $pack_archive_size = $size;
174
+ $error_url = "?page=duplicator&action=detail&tab=detail&id={$row['id']}";
175
+ ?>
176
+ <tr class="dup-pack-info <?php echo $css_alt ?>">
177
+ <td class="fail"><input name="delete_confirm" type="checkbox" id="<?php echo $row['id'] ;?>" /></td>
178
+ <td><?php echo DUP_Package::getCreatedDateFormat($row['created'], $ui_create_frmt);?></td>
179
+ <td><?php echo DUP_Util::byteSize($size); ?></td>
180
+ <td class='pack-name'><?php echo $pack_name ;?></td>
181
+ <td class="get-btns error-msg" colspan="2">
182
+ <span>
183
+ <i class="fa fa-exclamation-triangle"></i>
184
+ <a href="<?php echo $error_url; ?>"><?php _e("Error Processing", 'duplicator') ?></a>
185
+ </span>
186
+ <a class="button no-select" title="<?php _e("Package Details", 'duplicator') ?>" href="<?php echo $error_url; ?>">
187
+ <i class="fa fa-archive"></i>
188
+ </a>
189
+ </td>
190
+ </tr>
191
+ <?php endif; ?>
192
+ <?php
193
+ $totalSize = $totalSize + $pack_archive_size;
194
+ $rowCount++;
195
+ }
196
+ ?>
197
+ <tfoot>
198
+ <tr>
199
+ <th colspan="11" style='text-align:right; font-size:12px'>
200
+ <?php echo _e("Packages", 'duplicator') . ': ' . $totalElements; ?> |
201
+ <?php echo _e("Total Size", 'duplicator') . ': ' . DUP_Util::byteSize($totalSize); ?>
202
+ </th>
203
+ </tr>
204
+ </tfoot>
205
+ </table>
206
+ <?php endif; ?>
207
+ </form>
208
+
209
+ <!-- ==========================================
210
+ THICK-BOX DIALOGS: -->
211
+ <?php
212
+ $alert1 = new DUP_UI_Dialog();
213
+ $alert1->title = __('Bulk Action Required', 'duplicator');
214
+ $alert1->message = __('Please select an action from the "Bulk Actions" drop down menu!', 'duplicator');
215
+ $alert1->initAlert();
216
+
217
+ $alert2 = new DUP_UI_Dialog();
218
+ $alert2->title = __('Selection Required', 'duplicator', 'duplicator');
219
+ $alert2->message = __('Please select at least one package to delete!', 'duplicator');
220
+ $alert2->initAlert();
221
+
222
+ $confirm1 = new DUP_UI_Dialog();
223
+ $confirm1->title = __('Delete Packages?', 'duplicator');
224
+ $confirm1->message = __('Are you sure, you want to delete the selected package(s)?', 'duplicator');
225
+ $confirm1->progressText = __('Removing Packages, Please Wait...', 'duplicator');
226
+ $confirm1->jscallback = 'Duplicator.Pack.Delete()';
227
+ $confirm1->initConfirm();
228
+
229
+ $alert3 = new DUP_UI_Dialog();
230
+ $alert3->height = 350;
231
+ $alert3->width = 350;
232
+ $alert3->title = __('Duplicator Help', 'duplicator');
233
+ $alert3->message = "<div id='dup-help-dlg'></div>";
234
+ $alert3->initAlert();
235
+ ?>
236
+
237
+ <!-- =======================
238
+ DIALOG: HELP DIALOG -->
239
+ <div id="dup-help-dlg-info" style="display:none">
240
+ <b><?php _e("Common Questions:", 'duplicator') ?></b><hr size='1'/>
241
+ <i class="fa fa-file-text-o"></i> <a href="https://snapcreek.com/duplicator/docs/quick-start?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=help_btn_pack_help&utm_campaign=duplicator_free#quick-010-q" target="_blank"><?php _e("How do I create a package", 'duplicator') ?></a> <br/>
242
+ <i class="fa fa-file-text-o"></i> <a href="https://snapcreek.com/duplicator/docs/quick-start/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=help_btn_install_help&utm_campaign=duplicator_free#quick-040-q" target="_blank"><?php _e('How do I install a package?', 'duplicator'); ?></a> <br/>
243
+ <i class="fa fa-file-code-o"></i> <a href="https://snapcreek.com/duplicator/docs/faqs-tech?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=help_btn_faq&utm_campaign=duplicator_free" target="_blank"><?php _e("Frequently Asked Questions!", 'duplicator') ?></a>
244
+ <br/><br/>
245
+
246
+ <b><?php _e("Other Resources:", 'duplicator') ?></b><hr size='1'/>
247
+ <i class="fa fa-question-circle"></i> <a href="https://snapcreek.com/ticket?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=help_btn_ticket&utm_campaign=duplicator_free" target="_blank"><?php _e("Need help with the plugin?", 'duplicator') ?></a> <br/>
248
+ <i class="fa fa-lightbulb-o"></i> <a href="https://snapcreek.com/support?idea=1&utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=help_btn_idea&utm_campaign=duplicator_free" target="_blank"><?php _e("Have an idea for the plugin?", 'duplicator') ?></a> <br/>
249
+ <?php if($statusCount >= 3) : ?>
250
+ <i class="fa fa-star-o"></i> <a href="https://wordpress.org/support/plugin/duplicator/reviews/?filter=5" target="vote-wp"><?php _e("Help review the plugin!", 'duplicator') ?></a>
251
+ <?php endif; ?>
252
+ </div>
253
+
254
+ <script>
255
+ jQuery(document).ready(function($)
256
+ {
257
+
258
+ /* Creats a comma seperate list of all selected package ids */
259
+ Duplicator.Pack.GetDeleteList = function ()
260
+ {
261
+ var arr = new Array;
262
+ var count = 0;
263
+ $("input[name=delete_confirm]").each(function () {
264
+ if (this.checked) {
265
+ arr[count++] = this.id;
266
+ }
267
+ });
268
+ var list = arr.join(',');
269
+ return list;
270
+ }
271
+
272
+ /* Provides the correct confirmation items when deleting packages */
273
+ Duplicator.Pack.ConfirmDelete = function ()
274
+ {
275
+ if ($("#dup-pack-bulk-actions").val() != "delete") {
276
+ <?php $alert1->showAlert(); ?>
277
+ return;
278
+ }
279
+
280
+ var list = Duplicator.Pack.GetDeleteList();
281
+ if (list.length == 0) {
282
+ <?php $alert2->showAlert(); ?>
283
+ return;
284
+ }
285
+ <?php $confirm1->showConfirm(); ?>
286
+ }
287
+
288
+
289
+ /* Removes all selected package sets
290
+ * @param event To prevent bubbling */
291
+ Duplicator.Pack.Delete = function (event)
292
+ {
293
+ var list = Duplicator.Pack.GetDeleteList();
294
+
295
+ $.ajax({
296
+ type: "POST",
297
+ url: ajaxurl,
298
+ dataType: "json",
299
+ data: {action : 'duplicator_package_delete', duplicator_delid : list, nonce: '<?php echo $ajax_nonce; ?>' },
300
+ complete: function(data) {
301
+ Duplicator.ReloadWindow(data);
302
+ }
303
+ });
304
+
305
+ };
306
+
307
+ /* Toogles the Bulk Action Check boxes */
308
+ Duplicator.Pack.SetDeleteAll = function()
309
+ {
310
+ var state = $('input#dup-bulk-action-all').is(':checked') ? 1 : 0;
311
+ $("input[name=delete_confirm]").each(function() {
312
+ this.checked = (state) ? true : false;
313
+ });
314
+ }
315
+
316
+ /* Opens detail screen */
317
+ Duplicator.Pack.OpenPackageDetails = function (package_id)
318
+ {
319
+ window.location.href = '?page=duplicator&action=detail&tab=detail&id=' + package_id;
320
+ }
321
+
322
+ /* Toggles the feedback form */
323
+ Duplicator.Pack.showHelp = function ()
324
+ {
325
+ $('#dup-help-dlg').html($('#dup-help-dlg-info').html());
326
+ <?php $alert3->showAlert(); ?>
327
+ }
328
+
329
+ });
330
  </script>
views/settings/packages.php CHANGED
@@ -1,233 +1,233 @@
1
- <?php
2
- global $wp_version;
3
- global $wpdb;
4
-
5
- $action_updated = null;
6
- $action_response = __("Package Settings Saved", 'duplicator');
7
-
8
- //SAVE RESULTS
9
- if (isset($_POST['action']) && $_POST['action'] == 'save') {
10
-
11
- //Nonce Check
12
- if (! isset( $_POST['dup_settings_save_nonce_field'] ) || ! wp_verify_nonce( $_POST['dup_settings_save_nonce_field'], 'dup_settings_save' )) {
13
- die('Invalid token permissions to perform this request.');
14
- }
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'));
24
- DUP_Settings::Set('package_zip_flush', isset($_POST['package_zip_flush']) ? "1" : "0");
25
- DUP_Settings::Set('package_mysqldump', $mysqldump_enabled ? "1" : "0");
26
- DUP_Settings::Set('package_phpdump_qrylimit', isset($_POST['package_phpdump_qrylimit']) ? $_POST['package_phpdump_qrylimit'] : "100");
27
- if ($mysqldump_path_valid) {
28
- $mysqldump_exe_file = DUP_Util::isWindows() ? realpath($mysqldump_exe_file) : $mysqldump_exe_file;
29
- DUP_Settings::Set('package_mysqldump_path', $mysqldump_exe_file);
30
- }
31
- DUP_Settings::Set('package_ui_created', $_POST['package_ui_created']);
32
-
33
- $action_updated = DUP_Settings::Save();
34
- DUP_Util::initSnapshotDirectory();
35
- }
36
-
37
- $package_zip_flush = DUP_Settings::Get('package_zip_flush');
38
- $phpdump_chunkopts = array("20", "100", "500", "1000", "2000");
39
- $phpdump_qrylimit = DUP_Settings::Get('package_phpdump_qrylimit');
40
- $package_mysqldump = DUP_Settings::Get('package_mysqldump');
41
- $package_mysqldump_path = trim(DUP_Settings::Get('package_mysqldump_path'));
42
- $package_ui_created = is_numeric(DUP_Settings::Get('package_ui_created')) ? DUP_Settings::Get('package_ui_created') : 1;
43
- $mysqlDumpPath = DUP_DB::getMySqlDumpPath();
44
- $mysqlDumpFound = ($mysqlDumpPath) ? true : false;
45
-
46
- ?>
47
-
48
- <style>
49
- form#dup-settings-form input[type=text] {width:500px; }
50
- div.dup-feature-found {padding:10px 0 5px 0; color:green;}
51
- div.dup-feature-notfound {color:maroon; width:600px; line-height: 18px}
52
- select#package_ui_created {font-family: monospace}
53
- </style>
54
-
55
- <form id="dup-settings-form" action="<?php echo admin_url('admin.php?page=duplicator-settings&tab=package'); ?>" method="post">
56
- <?php wp_nonce_field('dup_settings_save', 'dup_settings_save_nonce_field', false); ?>
57
- <input type="hidden" name="action" value="save">
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>
65
- <hr size="1" />
66
- <table class="form-table">
67
- <tr>
68
- <th scope="row"><label><?php _e("Created Format", 'duplicator'); ?></label></th>
69
- <td>
70
- <select name="package_ui_created" id="package_ui_created">
71
- <!-- YEAR -->
72
- <optgroup label="<?php _e("By Year", 'duplicator'); ?>">
73
- <option value="1">Y-m-d H:i &nbsp; [2000-01-05 12:00]</option>
74
- <option value="2">Y-m-d H:i:s [2000-01-05 12:00:01]</option>
75
- <option value="3">y-m-d H:i &nbsp; [00-01-05 12:00]</option>
76
- <option value="4">y-m-d H:i:s [00-01-05 12:00:01]</option>
77
- </optgroup>
78
- <!-- MONTH -->
79
- <optgroup label="<?php _e("By Month", 'duplicator'); ?>">
80
- <option value="5">m-d-Y H:i &nbsp; [01-05-2000 12:00]</option>
81
- <option value="6">m-d-Y H:i:s [01-05-2000 12:00:01]</option>
82
- <option value="7">m-d-y H:i &nbsp; [01-05-00 12:00]</option>
83
- <option value="8">m-d-y H:i:s [01-05-00 12:00:01]</option>
84
- </optgroup>
85
- <!-- DAY -->
86
- <optgroup label="<?php _e("By Day", 'duplicator'); ?>">
87
- <option value="9"> d-m-Y H:i &nbsp; [05-01-2000 12:00]</option>
88
- <option value="10">d-m-Y H:i:s [05-01-2000 12:00:01]</option>
89
- <option value="11">d-m-y H:i &nbsp; [05-01-00 12:00]</option>
90
- <option value="12">d-m-y H:i:s [05-01-00 12:00:01]</option>
91
- </optgroup>
92
- </select>
93
- <p class="description">
94
- <?php _e("The date format shown in the 'Created' column on the Packages screen.", 'duplicator'); ?>
95
- </p>
96
- </td>
97
- </tr>
98
- </table>
99
- <br/>
100
-
101
- <h3 class="title"><?php _e("Processing", 'duplicator') ?> </h3>
102
- <hr size="1" />
103
- <table class="form-table">
104
- <tr>
105
- <th scope="row"><label><?php _e("SQL Script", 'duplicator'); ?></label></th>
106
- <td>
107
- <?php if (!DUP_Util::hasShellExec()) : ?>
108
- <input type="radio" disabled="true" />
109
- <label><?php _e("Mysqldump", 'duplicator'); ?> <i style="font-size:12px">(<?php _e("recommended", 'duplicator'); ?>)</i></label>
110
- <p class="description" style="width:550px; margin:5px 0 0 20px">
111
- <?php
112
- _e("This server does not support the PHP shell_exec function which is required for mysqldump to run. ", 'duplicator');
113
- _e("Please contact the host or server administrator to enable this feature.", 'duplicator');
114
- ?>
115
- <br/>
116
- <small>
117
- <i style="cursor: pointer"
118
- data-tooltip-title="<?php _e("Host Recommendation:", 'duplicator'); ?>"
119
- data-tooltip="<?php _e('Duplicator recommends going with the high performance pro plan or better from our recommended list', 'duplicator'); ?>">
120
- <i class="fa fa-lightbulb-o" aria-hidden="true"></i>
121
- <?php
122
- printf("%s <a target='_blank' href='//snapcreek.com/wordpress-hosting/'>%s</a> %s",
123
- __("Please visit our recommended", 'duplicator'),
124
- __("host list", 'duplicator'),
125
- __("for reliable access to mysqldump", 'duplicator'));
126
- ?>
127
- </i>
128
- </small>
129
- <br/><br/>
130
- </p>
131
- <?php else : ?>
132
- <input type="radio" name="package_dbmode" value="mysql" id="package_mysqldump" <?php echo ($package_mysqldump) ? 'checked="checked"' : ''; ?> />
133
- <label for="package_mysqldump"><?php _e("Mysqldump", 'duplicator'); ?></label>
134
- <i style="font-size:12px">(<?php _e("recommended", 'duplicator'); ?>)</i> <br/>
135
-
136
- <div style="margin:5px 0px 0px 25px">
137
- <?php if ($mysqlDumpFound) : ?>
138
- <div class="dup-feature-found">
139
- <i class="fa fa-check-circle"></i>
140
- <?php _e("Successfully Found:", 'duplicator'); ?> &nbsp;
141
- <i><?php echo $mysqlDumpPath ?></i>
142
- </div><br/>
143
- <?php else : ?>
144
- <div class="dup-feature-notfound">
145
- <i class="fa fa-exclamation-triangle"></i>
146
- <?php
147
- _e('Mysqldump was not found at its default location or the location provided. Please enter a custom path to a valid location where mysqldump can run. '
148
- . 'If the problem persist contact your host or server administrator. ', 'duplicator');
149
-
150
- printf("%s <a target='_blank' href='//snapcreek.com/wordpress-hosting/'>%s</a> %s",
151
- __("See the", 'duplicator'),
152
- __("host list", 'duplicator'),
153
- __("for reliable access to mysqldump.", 'duplicator'));
154
-
155
- ?>
156
- </div><br/>
157
-
158
- <?php endif; ?>
159
-
160
- <i class="fa fa-question-circle"
161
- data-tooltip-title="<?php _e("mysqldump path:", 'duplicator'); ?>"
162
- data-tooltip="<?php _e('An optional path to the mysqldump program. Add a custom path if the path to mysqldump is not properly detected or needs to be changed.', 'duplicator'); ?>"></i>
163
- <label><?php _e("Custom Path:", 'duplicator'); ?></label><br/>
164
- <input type="text" name="package_mysqldump_path" id="package_mysqldump_path" value="<?php echo $package_mysqldump_path; ?>" placeholder="<?php _e("/usr/bin/mypath/mysqldump.exe", 'duplicator'); ?>" />
165
- <div class="dup-feature-notfound">
166
- <?php
167
- if ($action_updated && $mysqldump_path_valid === false) {
168
- $mysqldump_path = DUP_Util::isWindows() ? stripslashes($_POST['package_mysqldump_path']) : $_POST['package_mysqldump_path'];
169
- if (strlen($mysqldump_path)) {
170
- _e('<i class="fa fa-exclamation-triangle"></i> The custom path provided is not recognized as a valid mysqldump file:<br/>', 'duplicator');
171
- $mysqldump_path = esc_html($mysqldump_path);
172
- echo "'{$mysqldump_path}'";
173
- }
174
- }
175
- ?>
176
- </div>
177
- <br/><br/>
178
- </div>
179
-
180
- <?php endif; ?>
181
-
182
- <!-- PHP MODE -->
183
- <?php if (! $mysqlDumpFound) : ?>
184
- <input type="radio" name="package_dbmode" id="package_phpdump" value="php" checked="checked" />
185
- <?php else : ?>
186
- <input type="radio" name="package_dbmode" id="package_phpdump" value="php" <?php echo (! $package_mysqldump) ? 'checked="checked"' : ''; ?> />
187
- <?php endif; ?>
188
-
189
- <label for="package_phpdump"><?php _e("PHP Code", 'duplicator'); ?></label> &nbsp;
190
-
191
- <div style="margin:5px 0px 0px 25px">
192
- <i class="fa fa-question-circle"
193
- data-tooltip-title="<?php _e("PHP Query Limit Size", 'duplicator'); ?>"
194
- data-tooltip="<?php _e('A higher limit size will speed up the database build time, however it will use more memory. If your host has memory caps start off low.', 'duplicator'); ?>"></i>
195
- <label for="package_phpdump_qrylimit"><?php _e("Query Limit Size", 'duplicator'); ?></label> &nbsp;
196
- <select name="package_phpdump_qrylimit" id="package_phpdump_qrylimit">
197
- <?php
198
- foreach($phpdump_chunkopts as $value) {
199
- $selected = ( $phpdump_qrylimit == $value ? "selected='selected'" : '' );
200
- echo "<option {$selected} value='{$value}'>" . number_format($value) . '</option>';
201
- }
202
- ?>
203
- </select>
204
- </div><br/>
205
- </td>
206
- </tr>
207
- <tr>
208
- <th scope="row"><label><?php _e("Archive Flush", 'duplicator'); ?></label></th>
209
- <td>
210
- <input type="checkbox" name="package_zip_flush" id="package_zip_flush" <?php echo ($package_zip_flush) ? 'checked="checked"' : ''; ?> />
211
- <label for="package_zip_flush"><?php _e("Attempt Network Keep Alive", 'duplicator'); ?></label>
212
- <i style="font-size:12px">(<?php _e("enable only for large archives", 'duplicator'); ?>)</i>
213
- <p class="description">
214
- <?php _e("This will attempt to keep a network connection established for large archives.", 'duplicator'); ?>
215
- </p>
216
- </td>
217
- </tr>
218
- </table>
219
-
220
-
221
- <p class="submit" style="margin: 20px 0px 0xp 5px;">
222
- <br/>
223
- <input type="submit" name="submit" id="submit" class="button-primary" value="<?php _e("Save Package Settings", 'duplicator') ?>" style="display: inline-block;" />
224
- </p>
225
-
226
- </form>
227
-
228
- <script>
229
- jQuery(document).ready(function($)
230
- {
231
- $('#package_ui_created').val(<?php echo $package_ui_created ?> );
232
- });
233
  </script>
1
+ <?php
2
+ global $wp_version;
3
+ global $wpdb;
4
+
5
+ $action_updated = null;
6
+ $action_response = __("Package Settings Saved", 'duplicator');
7
+
8
+ //SAVE RESULTS
9
+ if (isset($_POST['action']) && $_POST['action'] == 'save') {
10
+
11
+ //Nonce Check
12
+ if (! isset( $_POST['dup_settings_save_nonce_field'] ) || ! wp_verify_nonce( $_POST['dup_settings_save_nonce_field'], 'dup_settings_save' )) {
13
+ die('Invalid token permissions to perform this request.');
14
+ }
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'));
24
+ DUP_Settings::Set('package_zip_flush', isset($_POST['package_zip_flush']) ? "1" : "0");
25
+ DUP_Settings::Set('package_mysqldump', $mysqldump_enabled ? "1" : "0");
26
+ DUP_Settings::Set('package_phpdump_qrylimit', isset($_POST['package_phpdump_qrylimit']) ? $_POST['package_phpdump_qrylimit'] : "100");
27
+ if ($mysqldump_path_valid) {
28
+ $mysqldump_exe_file = DUP_Util::isWindows() ? realpath($mysqldump_exe_file) : $mysqldump_exe_file;
29
+ DUP_Settings::Set('package_mysqldump_path', $mysqldump_exe_file);
30
+ }
31
+ DUP_Settings::Set('package_ui_created', $_POST['package_ui_created']);
32
+
33
+ $action_updated = DUP_Settings::Save();
34
+ DUP_Util::initSnapshotDirectory();
35
+ }
36
+
37
+ $package_zip_flush = DUP_Settings::Get('package_zip_flush');
38
+ $phpdump_chunkopts = array("20", "100", "500", "1000", "2000");
39
+ $phpdump_qrylimit = DUP_Settings::Get('package_phpdump_qrylimit');
40
+ $package_mysqldump = DUP_Settings::Get('package_mysqldump');
41
+ $package_mysqldump_path = trim(DUP_Settings::Get('package_mysqldump_path'));
42
+ $package_ui_created = is_numeric(DUP_Settings::Get('package_ui_created')) ? DUP_Settings::Get('package_ui_created') : 1;
43
+ $mysqlDumpPath = DUP_DB::getMySqlDumpPath();
44
+ $mysqlDumpFound = ($mysqlDumpPath) ? true : false;
45
+
46
+ ?>
47
+
48
+ <style>
49
+ form#dup-settings-form input[type=text] {width:500px; }
50
+ div.dup-feature-found {padding:10px 0 5px 0; color:green;}
51
+ div.dup-feature-notfound {color:maroon; width:600px; line-height: 18px}
52
+ select#package_ui_created {font-family: monospace}
53
+ </style>
54
+
55
+ <form id="dup-settings-form" action="<?php echo admin_url('admin.php?page=duplicator-settings&tab=package'); ?>" method="post">
56
+ <?php wp_nonce_field('dup_settings_save', 'dup_settings_save_nonce_field', false); ?>
57
+ <input type="hidden" name="action" value="save">
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>
65
+ <hr size="1" />
66
+ <table class="form-table">
67
+ <tr>
68
+ <th scope="row"><label><?php _e("Created Format", 'duplicator'); ?></label></th>
69
+ <td>
70
+ <select name="package_ui_created" id="package_ui_created">
71
+ <!-- YEAR -->
72
+ <optgroup label="<?php _e("By Year", 'duplicator'); ?>">
73
+ <option value="1">Y-m-d H:i &nbsp; [2000-01-05 12:00]</option>
74
+ <option value="2">Y-m-d H:i:s [2000-01-05 12:00:01]</option>
75
+ <option value="3">y-m-d H:i &nbsp; [00-01-05 12:00]</option>
76
+ <option value="4">y-m-d H:i:s [00-01-05 12:00:01]</option>
77
+ </optgroup>
78
+ <!-- MONTH -->
79
+ <optgroup label="<?php _e("By Month", 'duplicator'); ?>">
80
+ <option value="5">m-d-Y H:i &nbsp; [01-05-2000 12:00]</option>
81
+ <option value="6">m-d-Y H:i:s [01-05-2000 12:00:01]</option>
82
+ <option value="7">m-d-y H:i &nbsp; [01-05-00 12:00]</option>
83
+ <option value="8">m-d-y H:i:s [01-05-00 12:00:01]</option>
84
+ </optgroup>
85
+ <!-- DAY -->
86
+ <optgroup label="<?php _e("By Day", 'duplicator'); ?>">
87
+ <option value="9"> d-m-Y H:i &nbsp; [05-01-2000 12:00]</option>
88
+ <option value="10">d-m-Y H:i:s [05-01-2000 12:00:01]</option>
89
+ <option value="11">d-m-y H:i &nbsp; [05-01-00 12:00]</option>
90
+ <option value="12">d-m-y H:i:s [05-01-00 12:00:01]</option>
91
+ </optgroup>
92
+ </select>
93
+ <p class="description">
94
+ <?php _e("The UTC date format shown in the 'Created' column on the Packages screen.", 'duplicator'); ?> <br/>
95
+ <small><?php _e("To use WordPress timezone formats consider an upgrade to Duplicator Pro.", 'duplicator'); ?></small>
96
+ </p>
97
+ </td>
98
+ </tr>
99
+ </table>
100
+
101
+ <h3 class="title"><?php _e("Processing", 'duplicator') ?> </h3>
102
+ <hr size="1" />
103
+ <table class="form-table">
104
+ <tr>
105
+ <th scope="row"><label><?php _e("SQL Script", 'duplicator'); ?></label></th>
106
+ <td>
107
+ <?php if (!DUP_Util::hasShellExec()) : ?>
108
+ <input type="radio" disabled="true" />
109
+ <label><?php _e("Mysqldump", 'duplicator'); ?> <i style="font-size:12px">(<?php _e("recommended", 'duplicator'); ?>)</i></label>
110
+ <p class="description" style="width:550px; margin:5px 0 0 20px">
111
+ <?php
112
+ _e("This server does not support the PHP shell_exec function which is required for mysqldump to run. ", 'duplicator');
113
+ _e("Please contact the host or server administrator to enable this feature.", 'duplicator');
114
+ ?>
115
+ <br/>
116
+ <small>
117
+ <i style="cursor: pointer"
118
+ data-tooltip-title="<?php _e("Host Recommendation:", 'duplicator'); ?>"
119
+ data-tooltip="<?php _e('Duplicator recommends going with the high performance pro plan or better from our recommended list', 'duplicator'); ?>">
120
+ <i class="fa fa-lightbulb-o" aria-hidden="true"></i>
121
+ <?php
122
+ printf("%s <a target='_blank' href='//snapcreek.com/wordpress-hosting/'>%s</a> %s",
123
+ __("Please visit our recommended", 'duplicator'),
124
+ __("host list", 'duplicator'),
125
+ __("for reliable access to mysqldump", 'duplicator'));
126
+ ?>
127
+ </i>
128
+ </small>
129
+ <br/><br/>
130
+ </p>
131
+ <?php else : ?>
132
+ <input type="radio" name="package_dbmode" value="mysql" id="package_mysqldump" <?php echo ($package_mysqldump) ? 'checked="checked"' : ''; ?> />
133
+ <label for="package_mysqldump"><?php _e("Mysqldump", 'duplicator'); ?></label>
134
+ <i style="font-size:12px">(<?php _e("recommended", 'duplicator'); ?>)</i> <br/>
135
+
136
+ <div style="margin:5px 0px 0px 25px">
137
+ <?php if ($mysqlDumpFound) : ?>
138
+ <div class="dup-feature-found">
139
+ <i class="fa fa-check-circle"></i>
140
+ <?php _e("Successfully Found:", 'duplicator'); ?> &nbsp;
141
+ <i><?php echo $mysqlDumpPath ?></i>
142
+ </div><br/>
143
+ <?php else : ?>
144
+ <div class="dup-feature-notfound">
145
+ <i class="fa fa-exclamation-triangle"></i>
146
+ <?php
147
+ _e('Mysqldump was not found at its default location or the location provided. Please enter a custom path to a valid location where mysqldump can run. '
148
+ . 'If the problem persist contact your host or server administrator. ', 'duplicator');
149
+
150
+ printf("%s <a target='_blank' href='//snapcreek.com/wordpress-hosting/'>%s</a> %s",
151
+ __("See the", 'duplicator'),
152
+ __("host list", 'duplicator'),
153
+ __("for reliable access to mysqldump.", 'duplicator'));
154
+
155
+ ?>
156
+ </div><br/>
157
+
158
+ <?php endif; ?>
159
+
160
+ <i class="fa fa-question-circle"
161
+ data-tooltip-title="<?php _e("mysqldump path:", 'duplicator'); ?>"
162
+ data-tooltip="<?php _e('An optional path to the mysqldump program. Add a custom path if the path to mysqldump is not properly detected or needs to be changed.', 'duplicator'); ?>"></i>
163
+ <label><?php _e("Custom Path:", 'duplicator'); ?></label><br/>
164
+ <input type="text" name="package_mysqldump_path" id="package_mysqldump_path" value="<?php echo $package_mysqldump_path; ?>" placeholder="<?php _e("/usr/bin/mypath/mysqldump.exe", 'duplicator'); ?>" />
165
+ <div class="dup-feature-notfound">
166
+ <?php
167
+ if ($action_updated && $mysqldump_path_valid === false) {
168
+ $mysqldump_path = DUP_Util::isWindows() ? stripslashes($_POST['package_mysqldump_path']) : $_POST['package_mysqldump_path'];
169
+ if (strlen($mysqldump_path)) {
170
+ _e('<i class="fa fa-exclamation-triangle"></i> The custom path provided is not recognized as a valid mysqldump file:<br/>', 'duplicator');
171
+ $mysqldump_path = esc_html($mysqldump_path);
172
+ echo "'{$mysqldump_path}'";
173
+ }
174
+ }
175
+ ?>
176
+ </div>
177
+ <br/><br/>
178
+ </div>
179
+
180
+ <?php endif; ?>
181
+
182
+ <!-- PHP MODE -->
183
+ <?php if (! $mysqlDumpFound) : ?>
184
+ <input type="radio" name="package_dbmode" id="package_phpdump" value="php" checked="checked" />
185
+ <?php else : ?>
186
+ <input type="radio" name="package_dbmode" id="package_phpdump" value="php" <?php echo (! $package_mysqldump) ? 'checked="checked"' : ''; ?> />
187
+ <?php endif; ?>
188
+
189
+ <label for="package_phpdump"><?php _e("PHP Code", 'duplicator'); ?></label> &nbsp;
190
+
191
+ <div style="margin:5px 0px 0px 25px">
192
+ <i class="fa fa-question-circle"
193
+ data-tooltip-title="<?php _e("PHP Query Limit Size", 'duplicator'); ?>"
194
+ data-tooltip="<?php _e('A higher limit size will speed up the database build time, however it will use more memory. If your host has memory caps start off low.', 'duplicator'); ?>"></i>
195
+ <label for="package_phpdump_qrylimit"><?php _e("Query Limit Size", 'duplicator'); ?></label> &nbsp;
196
+ <select name="package_phpdump_qrylimit" id="package_phpdump_qrylimit">
197
+ <?php
198
+ foreach($phpdump_chunkopts as $value) {
199
+ $selected = ( $phpdump_qrylimit == $value ? "selected='selected'" : '' );
200
+ echo "<option {$selected} value='{$value}'>" . number_format($value) . '</option>';
201
+ }
202
+ ?>
203
+ </select>
204
+ </div><br/>
205
+ </td>
206
+ </tr>
207
+ <tr>
208
+ <th scope="row"><label><?php _e("Archive Flush", 'duplicator'); ?></label></th>
209
+ <td>
210
+ <input type="checkbox" name="package_zip_flush" id="package_zip_flush" <?php echo ($package_zip_flush) ? 'checked="checked"' : ''; ?> />
211
+ <label for="package_zip_flush"><?php _e("Attempt Network Keep Alive", 'duplicator'); ?></label>
212
+ <i style="font-size:12px">(<?php _e("enable only for large archives", 'duplicator'); ?>)</i>
213
+ <p class="description">
214
+ <?php _e("This will attempt to keep a network connection established for large archives.", 'duplicator'); ?>
215
+ </p>
216
+ </td>
217
+ </tr>
218
+ </table>
219
+
220
+
221
+ <p class="submit" style="margin: 20px 0px 0xp 5px;">
222
+ <br/>
223
+ <input type="submit" name="submit" id="submit" class="button-primary" value="<?php _e("Save Package Settings", 'duplicator') ?>" style="display: inline-block;" />
224
+ </p>
225
+
226
+ </form>
227
+
228
+ <script>
229
+ jQuery(document).ready(function($)
230
+ {
231
+ $('#package_ui_created').val(<?php echo $package_ui_created ?> );
232
+ });
233
  </script>
views/tools/controller.php CHANGED
@@ -149,12 +149,15 @@ if($current_tab == "diagnostics" && ($section == "info" || $section == '')){
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>
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
+ <a href="?page=duplicator-tools&tab=templates" class="nav-tab <?php echo ($current_tab == 'templates') ? 'nav-tab-active' : '' ?>"> <?php _e('Templates', 'duplicator'); ?></a>
153
  </h2>
154
 
155
  <?php
156
  switch ($current_tab) {
157
+ case 'diagnostics': include('diagnostics/main.php');
158
+ break;
159
+ case 'templates': include('templates.php');
160
+ break;
161
+ }
162
+ ?>
163
  </div>
views/tools/templates.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style>
2
+ div.panel {padding: 20px 5px 10px 10px;}
3
+ div.area {font-size:16px; text-align: center; line-height: 30px}
4
+ </style>
5
+
6
+ <div class="panel">
7
+
8
+ <br/>
9
+ <div class="area">
10
+ <img src="<?php echo DUPLICATOR_PLUGIN_URL ?>assets/img/logo-dpro-300x50.png" />
11
+ <?php
12
+ echo '<h2><i class="fa fa-clone"></i> ' . __('This option is available in Duplicator Pro.', 'duplicator') . '</h2>';
13
+ _e('Templates allow you to customize what you want to include in your site and store it as a re-usable profile.', 'duplicator');
14
+ echo '<br/>';
15
+ _e('Save time and create a template that can be applied to a schedule or a custom package setup.', 'duplicator');
16
+ ?>
17
+ </div>
18
+ <p style="text-align:center">
19
+ <a href="https://snapcreek.com/duplicator/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=free_tools_templates&utm_campaign=duplicator_pro" target="_blank" class="button button-primary button-large dup-check-it-btn" >
20
+ <?php _e('Learn More', 'duplicator') ?>
21
+ </a>
22
+ </p>
23
+ </div>
24
+
25
+