Version Description
Download this release
Release Info
Developer | cory@lamle.org |
Plugin | Duplicator – WordPress Migration Plugin |
Version | 1.1.4 |
Comparing to | |
See all releases |
Code changes from version 1.1.2 to 1.1.4
- classes/package.php +518 -505
- define.php +1 -1
- duplicator.php +1 -1
- readme.txt +2 -2
- views/actions.php +144 -141
- views/packages/details/detail.php +10 -4
- views/packages/main/new1.base.php +1 -1
- views/packages/main/new1.inc.form.php +2 -1
- views/packages/main/new2.base.php +648 -641
- views/packages/main/new3.base.php +203 -204
classes/package.php
CHANGED
@@ -1,506 +1,519 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! defined( 'DUPLICATOR_VERSION' ) ) exit; // Exit if accessed directly
|
3 |
-
|
4 |
-
require_once (DUPLICATOR_PLUGIN_PATH . 'classes/package.archive.php');
|
5 |
-
require_once (DUPLICATOR_PLUGIN_PATH . 'classes/package.installer.php');
|
6 |
-
require_once (DUPLICATOR_PLUGIN_PATH . 'classes/package.database.php');
|
7 |
-
require_once (DUPLICATOR_PLUGIN_PATH . 'classes/utility.php');
|
8 |
-
|
9 |
-
final class DUP_PackageStatus {
|
10 |
-
private function __construct() {}
|
11 |
-
const START = 10;
|
12 |
-
const DBSTART = 20;
|
13 |
-
const DBDONE = 30;
|
14 |
-
const ARCSTART = 40;
|
15 |
-
const ARCDONE = 50;
|
16 |
-
const COMPLETE = 100;
|
17 |
-
}
|
18 |
-
|
19 |
-
final class DUP_PackageType {
|
20 |
-
private function __construct() {}
|
21 |
-
const MANUAL = 0;
|
22 |
-
const SCHEDULED = 1;
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Class used to store and process all Package logic
|
27 |
-
* @package Dupicator\classes
|
28 |
-
*/
|
29 |
-
class DUP_Package {
|
30 |
-
|
31 |
-
const OPT_ACTIVE = 'duplicator_package_active';
|
32 |
-
|
33 |
-
//Properties
|
34 |
-
public $ID;
|
35 |
-
public $Name;
|
36 |
-
public $Hash;
|
37 |
-
public $NameHash;
|
38 |
-
public $Version;
|
39 |
-
public $
|
40 |
-
public $
|
41 |
-
public $
|
42 |
-
public $
|
43 |
-
public $
|
44 |
-
public $
|
45 |
-
public $
|
46 |
-
public $
|
47 |
-
public $
|
48 |
-
public $
|
49 |
-
|
50 |
-
public $
|
51 |
-
public $
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
$this->
|
63 |
-
$this->
|
64 |
-
|
65 |
-
$this->
|
66 |
-
$this->
|
67 |
-
$this->
|
68 |
-
$this->
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
$
|
83 |
-
$report
|
84 |
-
|
85 |
-
|
86 |
-
$
|
87 |
-
$report['
|
88 |
-
|
89 |
-
|
90 |
-
$
|
91 |
-
$report['SRV']['
|
92 |
-
$report['SRV']['
|
93 |
-
|
94 |
-
|
95 |
-
$report['SRV']['
|
96 |
-
$report['SRV']['
|
97 |
-
$report['SRV']['
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
$
|
102 |
-
$
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
$
|
107 |
-
$
|
108 |
-
$
|
109 |
-
|
110 |
-
|
111 |
-
$report['ARC']['
|
112 |
-
$report['ARC']['
|
113 |
-
$report['ARC']['
|
114 |
-
|
115 |
-
$report['ARC']['
|
116 |
-
$report['ARC']['
|
117 |
-
$report['ARC']['
|
118 |
-
|
119 |
-
$report['ARC']['
|
120 |
-
$report['ARC']['
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
$
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
$
|
129 |
-
$report['DB']['
|
130 |
-
|
131 |
-
$
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
$report['
|
137 |
-
$
|
138 |
-
$
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
$
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
$
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
$
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
$
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
$
|
177 |
-
$
|
178 |
-
$
|
179 |
-
|
180 |
-
$info
|
181 |
-
$info .= "
|
182 |
-
$info .= "
|
183 |
-
$info .= "
|
184 |
-
$info .= "
|
185 |
-
$info .= "
|
186 |
-
$info .= "
|
187 |
-
|
188 |
-
$info
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
'
|
207 |
-
'
|
208 |
-
|
209 |
-
|
210 |
-
$
|
211 |
-
|
212 |
-
|
213 |
-
$
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
}
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
$
|
252 |
-
$
|
253 |
-
|
254 |
-
$this->
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
$
|
259 |
-
|
260 |
-
|
261 |
-
$info
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
$
|
287 |
-
$
|
288 |
-
$
|
289 |
-
|
290 |
-
|
291 |
-
$this->
|
292 |
-
$this->
|
293 |
-
$
|
294 |
-
$
|
295 |
-
$
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
$this->
|
300 |
-
$this->
|
301 |
-
$this->
|
302 |
-
|
303 |
-
$this->
|
304 |
-
$this->
|
305 |
-
|
306 |
-
|
307 |
-
$this->
|
308 |
-
$this->
|
309 |
-
|
310 |
-
$this->
|
311 |
-
$this->
|
312 |
-
|
313 |
-
$this->
|
314 |
-
$this->
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
}
|
333 |
-
|
334 |
-
/**
|
335 |
-
*
|
336 |
-
* @param $
|
337 |
-
* @
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
$
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
$table = $wpdb->prefix . "duplicator_packages";
|
366 |
-
$
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
$
|
431 |
-
return $
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
*
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
506 |
?>
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'DUPLICATOR_VERSION' ) ) exit; // Exit if accessed directly
|
3 |
+
|
4 |
+
require_once (DUPLICATOR_PLUGIN_PATH . 'classes/package.archive.php');
|
5 |
+
require_once (DUPLICATOR_PLUGIN_PATH . 'classes/package.installer.php');
|
6 |
+
require_once (DUPLICATOR_PLUGIN_PATH . 'classes/package.database.php');
|
7 |
+
require_once (DUPLICATOR_PLUGIN_PATH . 'classes/utility.php');
|
8 |
+
|
9 |
+
final class DUP_PackageStatus {
|
10 |
+
private function __construct() {}
|
11 |
+
const START = 10;
|
12 |
+
const DBSTART = 20;
|
13 |
+
const DBDONE = 30;
|
14 |
+
const ARCSTART = 40;
|
15 |
+
const ARCDONE = 50;
|
16 |
+
const COMPLETE = 100;
|
17 |
+
}
|
18 |
+
|
19 |
+
final class DUP_PackageType {
|
20 |
+
private function __construct() {}
|
21 |
+
const MANUAL = 0;
|
22 |
+
const SCHEDULED = 1;
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Class used to store and process all Package logic
|
27 |
+
* @package Dupicator\classes
|
28 |
+
*/
|
29 |
+
class DUP_Package {
|
30 |
+
|
31 |
+
const OPT_ACTIVE = 'duplicator_package_active';
|
32 |
+
|
33 |
+
//Properties
|
34 |
+
public $ID;
|
35 |
+
public $Name;
|
36 |
+
public $Hash;
|
37 |
+
public $NameHash;
|
38 |
+
public $Version;
|
39 |
+
public $VersionWP;
|
40 |
+
public $VersionDB;
|
41 |
+
public $VersionPHP;
|
42 |
+
public $Type;
|
43 |
+
public $Notes;
|
44 |
+
public $StorePath;
|
45 |
+
public $StoreURL;
|
46 |
+
public $ScanFile;
|
47 |
+
public $Runtime;
|
48 |
+
public $ExeSize;
|
49 |
+
public $ZipSize;
|
50 |
+
public $Status;
|
51 |
+
public $WPUser;
|
52 |
+
//Objects
|
53 |
+
public $Archive;
|
54 |
+
public $Installer;
|
55 |
+
public $Database;
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Manages the Package Process
|
59 |
+
*/
|
60 |
+
function __construct() {
|
61 |
+
|
62 |
+
$this->ID = null;
|
63 |
+
$this->Version = DUPLICATOR_VERSION;
|
64 |
+
|
65 |
+
$this->Type = DUP_PackageType::MANUAL;
|
66 |
+
$this->Name = self::GetDefaultName();
|
67 |
+
$this->Notes = null;
|
68 |
+
$this->StoreURL = DUP_Util::SSDirURL();
|
69 |
+
$this->StorePath = DUPLICATOR_SSDIR_PATH_TMP;
|
70 |
+
$this->Database = new DUP_Database($this);
|
71 |
+
$this->Archive = new DUP_Archive($this);
|
72 |
+
$this->Installer = new DUP_Installer($this);
|
73 |
+
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Generates a scan report
|
78 |
+
* @return array of scan results
|
79 |
+
*/
|
80 |
+
public function Scan() {
|
81 |
+
|
82 |
+
$timerStart = DUP_Util::GetMicrotime();
|
83 |
+
$report = array();
|
84 |
+
$this->ScanFile = "{$this->NameHash}_scan.json";
|
85 |
+
|
86 |
+
$report['RPT']['ScanTime'] = "0";
|
87 |
+
$report['RPT']['ScanFile'] = $this->ScanFile;
|
88 |
+
|
89 |
+
//SERVER
|
90 |
+
$srv = DUP_Server::GetChecks();
|
91 |
+
$report['SRV']['WEB']['ALL'] = $srv['SRV']['WEB']['ALL'];
|
92 |
+
$report['SRV']['WEB']['model'] = $srv['SRV']['WEB']['model'];
|
93 |
+
|
94 |
+
$report['SRV']['PHP']['ALL'] = $srv['SRV']['PHP']['ALL'];
|
95 |
+
$report['SRV']['PHP']['openbase'] = $srv['SRV']['PHP']['openbase'];
|
96 |
+
$report['SRV']['PHP']['maxtime'] = $srv['SRV']['PHP']['maxtime'];
|
97 |
+
$report['SRV']['PHP']['mysqli'] = $srv['SRV']['PHP']['mysqli'];
|
98 |
+
|
99 |
+
$report['SRV']['WP']['ALL'] = $srv['SRV']['WP']['ALL'];
|
100 |
+
$report['SRV']['WP']['version'] = $srv['SRV']['WP']['version'];
|
101 |
+
$report['SRV']['WP']['core'] = $srv['SRV']['WP']['core'];
|
102 |
+
$report['SRV']['WP']['cache'] = $srv['SRV']['WP']['cache'];
|
103 |
+
|
104 |
+
//FILES
|
105 |
+
$this->Archive->Stats();
|
106 |
+
$dirCount = count($this->Archive->Dirs);
|
107 |
+
$fileCount = count($this->Archive->Files);
|
108 |
+
$fullCount = $dirCount + $fileCount;
|
109 |
+
|
110 |
+
$report['ARC']['Size'] = DUP_Util::ByteSize($this->Archive->Size) or "unknown";
|
111 |
+
$report['ARC']['DirCount'] = number_format($dirCount);
|
112 |
+
$report['ARC']['FileCount'] = number_format($fileCount);
|
113 |
+
$report['ARC']['FullCount'] = number_format($fullCount);
|
114 |
+
|
115 |
+
$report['ARC']['FilterInfo']['Dirs'] = $this->Archive->FilterInfo->Dirs;
|
116 |
+
$report['ARC']['FilterInfo']['Files'] = $this->Archive->FilterInfo->Files;
|
117 |
+
$report['ARC']['FilterInfo']['Exts'] = $this->Archive->FilterInfo->Exts;
|
118 |
+
|
119 |
+
$report['ARC']['Status']['Size'] = ($this->Archive->Size > DUPLICATOR_SCAN_SITE) ? 'Warn' : 'Good';
|
120 |
+
$report['ARC']['Status']['Names'] = (count($this->Archive->FilterInfo->Files->Warning) + count($this->Archive->FilterInfo->Dirs->Warning)) ? 'Warn' : 'Good';
|
121 |
+
$report['ARC']['Status']['Big'] = count($this->Archive->FilterInfo->Files->Size) ? 'Warn' : 'Good';
|
122 |
+
|
123 |
+
$report['ARC']['Dirs'] = $this->Archive->Dirs;
|
124 |
+
$report['ARC']['Files'] = $this->Archive->Files;
|
125 |
+
|
126 |
+
|
127 |
+
//DATABASE
|
128 |
+
$db = $this->Database->Stats();
|
129 |
+
$report['DB']['Status'] = $db['Status'];
|
130 |
+
$report['DB']['Size'] = DUP_Util::ByteSize($db['Size']) or "unknown";
|
131 |
+
$report['DB']['Rows'] = number_format($db['Rows']) or "unknown";
|
132 |
+
$report['DB']['TableCount'] = $db['TableCount'] or "unknown";
|
133 |
+
$report['DB']['TableList'] = $db['TableList'] or "unknown";
|
134 |
+
|
135 |
+
$warnings = array($report['SRV']['WEB']['ALL'],
|
136 |
+
$report['SRV']['PHP']['ALL'],
|
137 |
+
$report['SRV']['WP']['ALL'],
|
138 |
+
$report['ARC']['Status']['Size'],
|
139 |
+
$report['ARC']['Status']['Names'],
|
140 |
+
$report['ARC']['Status']['Big'],
|
141 |
+
$db['Status']['Size'],
|
142 |
+
$db['Status']['Rows']);
|
143 |
+
|
144 |
+
$warn_counts = array_count_values($warnings);
|
145 |
+
|
146 |
+
$report['RPT']['Warnings'] = $warn_counts['Warn'];
|
147 |
+
$report['RPT']['Success'] = $warn_counts['Good'];
|
148 |
+
$report['RPT']['ScanTime'] = DUP_Util::ElapsedTime(DUP_Util::GetMicrotime(), $timerStart);
|
149 |
+
$fp = fopen(DUPLICATOR_SSDIR_PATH_TMP . "/{$this->ScanFile}", 'w');
|
150 |
+
fwrite($fp, json_encode($report));
|
151 |
+
fclose($fp);
|
152 |
+
|
153 |
+
return $report;
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Starts the package build process
|
158 |
+
* @return DUP_Package
|
159 |
+
*/
|
160 |
+
public function Build() {
|
161 |
+
|
162 |
+
global $wp_version;
|
163 |
+
global $wpdb;
|
164 |
+
global $current_user;
|
165 |
+
|
166 |
+
$timerStart = DUP_Util::GetMicrotime();
|
167 |
+
|
168 |
+
$this->Archive->File = "{$this->NameHash}_archive.zip";
|
169 |
+
$this->Installer->File = "{$this->NameHash}_installer.php";
|
170 |
+
$this->Database->File = "{$this->NameHash}_database.sql";
|
171 |
+
$this->WPUser = isset($current_user->user_login) ? $current_user->user_login : 'unknown';
|
172 |
+
|
173 |
+
//START LOGGING
|
174 |
+
DUP_Log::Open($this->NameHash);
|
175 |
+
$php_max_time = @ini_get("max_execution_time");
|
176 |
+
$php_max_memory = @ini_set('memory_limit', DUPLICATOR_PHP_MAX_MEMORY);
|
177 |
+
$php_max_time = ($php_max_time == 0) ? "(0) no time limit imposed" : "[{$php_max_time}] not allowed";
|
178 |
+
$php_max_memory = ($php_max_memory === false) ? "Unabled to set php memory_limit" : DUPLICATOR_PHP_MAX_MEMORY . " ({$php_max_memory} default)";
|
179 |
+
|
180 |
+
$info = "********************************************************************************\n";
|
181 |
+
$info .= "PACKAGE-LOG: " . @date("Y-m-d H:i:s") . "\n";
|
182 |
+
$info .= "NOTICE: Do NOT post to public sites or forums \n";
|
183 |
+
$info .= "********************************************************************************\n";
|
184 |
+
$info .= "VERSION:\t" . DUPLICATOR_VERSION . "\n";
|
185 |
+
$info .= "WORDPRESS:\t{$wp_version}\n";
|
186 |
+
$info .= "PHP INFO:\t" . phpversion() . ' | ' . 'SAPI: ' . php_sapi_name() . "\n";
|
187 |
+
$info .= "SERVER:\t\t{$_SERVER['SERVER_SOFTWARE']} \n";
|
188 |
+
$info .= "PHP TIME LIMIT: {$php_max_time} \n";
|
189 |
+
$info .= "PHP MAX MEMORY: {$php_max_memory} \n";
|
190 |
+
$info .= "MEMORY STACK: " . DUP_Server::GetPHPMemory();
|
191 |
+
DUP_Log::Info($info);
|
192 |
+
$info = null;
|
193 |
+
|
194 |
+
//CREATE DB RECORD
|
195 |
+
$packageObj = serialize($this);
|
196 |
+
if (! $packageObj) {
|
197 |
+
DUP_Log::Error("Unable to serialize pacakge object while building record.");
|
198 |
+
}
|
199 |
+
|
200 |
+
$this->ID = $this->FindHashKey($this->Hash);
|
201 |
+
|
202 |
+
if ($this->ID != 0){
|
203 |
+
$this->SetStatus(DUP_PackageStatus::START);
|
204 |
+
} else {
|
205 |
+
$results = $wpdb->insert($wpdb->prefix . "duplicator_packages", array(
|
206 |
+
'name' => $this->Name,
|
207 |
+
'hash' => $this->Hash,
|
208 |
+
'status' => DUP_PackageStatus::START,
|
209 |
+
'created' => current_time('mysql', get_option('gmt_offset', 1)),
|
210 |
+
'owner' => isset($current_user->user_login) ? $current_user->user_login : 'unknown',
|
211 |
+
'package' => $packageObj)
|
212 |
+
);
|
213 |
+
if ($results == false) {
|
214 |
+
$error_result = $wpdb->print_error();
|
215 |
+
DUP_Log::Error("Duplicator is unable to insert a package record into the database table.", "'{$error_result}'");
|
216 |
+
}
|
217 |
+
$this->ID = $wpdb->insert_id;
|
218 |
+
}
|
219 |
+
|
220 |
+
//START BUILD
|
221 |
+
//PHPs serialze method will return the object, but the ID above is not passed
|
222 |
+
//for one reason or another so passing the object back in seems to do the trick
|
223 |
+
$this->Database->Build($this);
|
224 |
+
$this->Archive->Build($this);
|
225 |
+
$this->Installer->Build($this);
|
226 |
+
|
227 |
+
|
228 |
+
//INTEGRITY CHECKS
|
229 |
+
DUP_Log::Info("\n********************************************************************************");
|
230 |
+
DUP_Log::Info("INTEGRITY CHECKS:");
|
231 |
+
DUP_Log::Info("********************************************************************************");
|
232 |
+
$dbSizeRead = DUP_Util::ByteSize($this->Database->Size);
|
233 |
+
$zipSizeRead = DUP_Util::ByteSize($this->Archive->Size);
|
234 |
+
$exeSizeRead = DUP_Util::ByteSize($this->Installer->Size);
|
235 |
+
|
236 |
+
DUP_Log::Info("SQL File: {$dbSizeRead}");
|
237 |
+
DUP_Log::Info("Installer File: {$exeSizeRead}");
|
238 |
+
DUP_Log::Info("Archive File: {$zipSizeRead} ");
|
239 |
+
|
240 |
+
if ( !($this->Archive->Size && $this->Database->Size && $this->Installer->Size)) {
|
241 |
+
DUP_Log::Error("A required file contains zero bytes.", "Archive Size: {$zipSizeRead} | SQL Size: {$dbSizeRead} | Installer Size: {$exeSizeRead}");
|
242 |
+
}
|
243 |
+
|
244 |
+
//Validate SQL files completed
|
245 |
+
$sql_tmp_path = DUP_UTIL::SafePath(DUPLICATOR_SSDIR_PATH_TMP . '/'. $this->Database->File);
|
246 |
+
$sql_complete_txt = DUP_Util::TailFile($sql_tmp_path, 3);
|
247 |
+
if (! strstr($sql_complete_txt, 'DUPLICATOR_MYSQLDUMP_EOF')) {
|
248 |
+
DUP_Log::Error("ERROR: SQL file not complete. The end of file marker was not found. Please try to re-create the package.");
|
249 |
+
}
|
250 |
+
|
251 |
+
$timerEnd = DUP_Util::GetMicrotime();
|
252 |
+
$timerSum = DUP_Util::ElapsedTime($timerEnd, $timerStart);
|
253 |
+
|
254 |
+
$this->Runtime = $timerSum;
|
255 |
+
$this->ExeSize = $exeSizeRead;
|
256 |
+
$this->ZipSize = $zipSizeRead;
|
257 |
+
|
258 |
+
$this->buildCleanup();
|
259 |
+
|
260 |
+
//FINAL REPORT
|
261 |
+
$info = "\n********************************************************************************\n";
|
262 |
+
$info .= "RECORD ID:[{$this->ID}]\n";
|
263 |
+
$info .= "TOTAL PROCESS RUNTIME: {$timerSum}\n";
|
264 |
+
$info .= "PEAK PHP MEMORY USED: " . DUP_Server::GetPHPMemory(true) . "\n";
|
265 |
+
$info .= "DONE PROCESSING => {$this->Name} " . @date("Y-m-d H:i:s") . "\n";
|
266 |
+
|
267 |
+
DUP_Log::Info($info);
|
268 |
+
DUP_Log::Close();
|
269 |
+
|
270 |
+
$this->SetStatus(DUP_PackageStatus::COMPLETE);
|
271 |
+
return $this;
|
272 |
+
}
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Saves the active options associted with the active(latest) package.
|
276 |
+
* @param $_POST $post The Post server object
|
277 |
+
* @see DUP_Package::GetActive
|
278 |
+
* @return void */
|
279 |
+
public function SaveActive($post = null)
|
280 |
+
{
|
281 |
+
global $wp_version;
|
282 |
+
|
283 |
+
if (isset($post)) {
|
284 |
+
$post = stripslashes_deep($post);
|
285 |
+
|
286 |
+
$name_chars = array(".", "-");
|
287 |
+
$name = ( isset($post['package-name']) && ! empty($post['package-name'])) ? $post['package-name'] : self::GetDefaultName();
|
288 |
+
$name = substr(sanitize_file_name($name), 0 , 40);
|
289 |
+
$name = str_replace($name_chars, '', $name);
|
290 |
+
|
291 |
+
$filter_dirs = isset($post['filter-dirs']) ? $this->parseDirectoryFilter($post['filter-dirs']) : '';
|
292 |
+
$filter_exts = isset($post['filter-exts']) ? $this->parseExtensionFilter($post['filter-exts']) : '';
|
293 |
+
$tablelist = isset($post['dbtables']) ? implode(',', $post['dbtables']) : '';
|
294 |
+
$compatlist = isset($post['dbcompat']) ? implode(',', $post['dbcompat']) : '';
|
295 |
+
$dbversion = DUP_Util::MysqlVariableValue('version');
|
296 |
+
$dbversion = is_null($dbversion) ? '- unknown -' : $dbversion;
|
297 |
+
|
298 |
+
//PACKAGE
|
299 |
+
$this->Version = DUPLICATOR_VERSION;
|
300 |
+
$this->VersionWP = $wp_version;
|
301 |
+
$this->VersionPHP = phpversion();
|
302 |
+
$this->VersionDB = $dbversion;
|
303 |
+
$this->Name = $name;
|
304 |
+
$this->Hash = $this->MakeHash();// $post['package-hash'];
|
305 |
+
//RSR
|
306 |
+
//$this->Hash = $post['package-hash'];
|
307 |
+
$this->NameHash = "{$this->Name}_{$this->Hash}";;
|
308 |
+
$this->Notes = esc_html($post['package-notes']);
|
309 |
+
//ARCHIVE
|
310 |
+
$this->Archive->PackDir = rtrim(DUPLICATOR_WPROOTPATH, '/');
|
311 |
+
$this->Archive->Format = 'ZIP';
|
312 |
+
$this->Archive->FilterOn = isset($post['filter-on']) ? 1 : 0;
|
313 |
+
$this->Archive->FilterDirs = esc_html($filter_dirs);
|
314 |
+
$this->Archive->FilterExts = str_replace(array('.' ,' '), "", esc_html($filter_exts));
|
315 |
+
//INSTALLER
|
316 |
+
$this->Installer->OptsDBHost = esc_html($post['dbhost']);
|
317 |
+
$this->Installer->OptsDBPort = esc_html($post['dbport']);
|
318 |
+
$this->Installer->OptsDBName = esc_html($post['dbname']);
|
319 |
+
$this->Installer->OptsDBUser = esc_html($post['dbuser']);
|
320 |
+
$this->Installer->OptsSSLAdmin = isset($post['ssl-admin']) ? 1 : 0;
|
321 |
+
$this->Installer->OptsSSLLogin = isset($post['ssl-login']) ? 1 : 0;
|
322 |
+
$this->Installer->OptsCacheWP = isset($post['cache-wp']) ? 1 : 0;
|
323 |
+
$this->Installer->OptsCachePath = isset($post['cache-path']) ? 1 : 0;
|
324 |
+
$this->Installer->OptsURLNew = esc_html($post['url-new']);
|
325 |
+
//DATABASE
|
326 |
+
$this->Database->FilterOn = isset($post['dbfilter-on']) ? 1 : 0;
|
327 |
+
$this->Database->FilterTables = esc_html($tablelist);
|
328 |
+
$this->Database->Compatible = $compatlist;
|
329 |
+
|
330 |
+
update_option(self::OPT_ACTIVE, $this);
|
331 |
+
}
|
332 |
+
}
|
333 |
+
|
334 |
+
/**
|
335 |
+
* Save any property of this class through reflection
|
336 |
+
* @param $property A valid public property in this class
|
337 |
+
* @param $value The value for the new dynamic property
|
338 |
+
* @return void */
|
339 |
+
public function SaveActiveItem($property, $value) {
|
340 |
+
$package = self::GetActive();
|
341 |
+
|
342 |
+
$reflectionClass = new ReflectionClass($package);
|
343 |
+
$reflectionClass->getProperty($property)->setValue($package, $value);
|
344 |
+
update_option(self::OPT_ACTIVE, $package);
|
345 |
+
}
|
346 |
+
|
347 |
+
/**
|
348 |
+
* Sets the status to log the state of the build
|
349 |
+
* @param $status The status level for where the package is
|
350 |
+
* @return void */
|
351 |
+
public function SetStatus($status) {
|
352 |
+
global $wpdb;
|
353 |
+
|
354 |
+
$packageObj = serialize($this);
|
355 |
+
|
356 |
+
if (! isset($status)) {
|
357 |
+
DUP_Log::Error("Package SetStatus did not receive a proper code.");
|
358 |
+
}
|
359 |
+
|
360 |
+
if (! $packageObj) {
|
361 |
+
DUP_Log::Error("Package SetStatus was unable to serialize package object while updating record.");
|
362 |
+
}
|
363 |
+
|
364 |
+
$wpdb->flush();
|
365 |
+
$table = $wpdb->prefix . "duplicator_packages";
|
366 |
+
$sql = "UPDATE `{$table}` SET status = {$status}, package = '{$packageObj}' WHERE ID = {$this->ID}";
|
367 |
+
$wpdb->query($sql);
|
368 |
+
}
|
369 |
+
|
370 |
+
/**
|
371 |
+
* Does a hash already exisit
|
372 |
+
* @return int Returns 0 if no has is found, if found returns the table ID
|
373 |
+
*/
|
374 |
+
public function FindHashKey($hash) {
|
375 |
+
|
376 |
+
global $wpdb;
|
377 |
+
|
378 |
+
$table = $wpdb->prefix . "duplicator_packages";
|
379 |
+
$qry = $wpdb->get_row("SELECT ID, hash FROM `{$table}` WHERE hash = '{$hash}'" );
|
380 |
+
if ( strlen($qry->hash) == 0) {
|
381 |
+
return 0;
|
382 |
+
} else {
|
383 |
+
return $qry->ID;
|
384 |
+
}
|
385 |
+
|
386 |
+
}
|
387 |
+
|
388 |
+
/**
|
389 |
+
* Makes the hashkey for the package files
|
390 |
+
* @return string A unique hashkey */
|
391 |
+
public function MakeHash() {
|
392 |
+
return uniqid() . mt_rand(1000, 9999) . date("ymdHis");
|
393 |
+
}
|
394 |
+
|
395 |
+
/**
|
396 |
+
* Gets the active package. The active package is defined as the package that was lasted saved.
|
397 |
+
* Do to cache issues with the built in WP function get_option moved call to a direct DB call.
|
398 |
+
* @see DUP_Package::SaveActive
|
399 |
+
* @return DUP_Package
|
400 |
+
*/
|
401 |
+
public static function GetActive() {
|
402 |
+
|
403 |
+
global $wpdb;
|
404 |
+
$obj = new DUP_Package();
|
405 |
+
$row = $wpdb->get_row( $wpdb->prepare( "SELECT option_value FROM `{$wpdb->options}` WHERE option_name = %s LIMIT 1", self::OPT_ACTIVE ) );
|
406 |
+
if (is_object($row)) {
|
407 |
+
$obj = @unserialize($row->option_value);
|
408 |
+
}
|
409 |
+
//Incase unserilaize fails
|
410 |
+
$obj = (is_object($obj)) ? $obj : new DUP_Package();
|
411 |
+
return $obj;
|
412 |
+
}
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Gets the Package by ID
|
416 |
+
* @see DUP_Package::GetByID
|
417 |
+
* @return DUP_Package
|
418 |
+
*/
|
419 |
+
public static function GetByID($id) {
|
420 |
+
|
421 |
+
global $wpdb;
|
422 |
+
$obj = new DUP_Package();
|
423 |
+
|
424 |
+
$row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM `{$wpdb->prefix}duplicator_packages` WHERE ID = %s", $id ) );
|
425 |
+
if (is_object($row)) {
|
426 |
+
$obj = @unserialize($row->package);
|
427 |
+
$obj->Status = $row->status;
|
428 |
+
}
|
429 |
+
//Incase unserilaize fails
|
430 |
+
$obj = (is_object($obj)) ? $obj : null;
|
431 |
+
return $obj;
|
432 |
+
}
|
433 |
+
|
434 |
+
/**
|
435 |
+
* Creates a default name
|
436 |
+
* @return string A default packagename
|
437 |
+
*/
|
438 |
+
public static function GetDefaultName() {
|
439 |
+
//Remove specail_chars from final result
|
440 |
+
$special_chars = array(".", "-");
|
441 |
+
$name = date('Ymd') . '_' . sanitize_title(get_bloginfo( 'name', 'display' ));
|
442 |
+
$name = substr(sanitize_file_name($name), 0 , 40);
|
443 |
+
$name = str_replace($special_chars, '', $name);
|
444 |
+
return $name;
|
445 |
+
|
446 |
+
}
|
447 |
+
|
448 |
+
/**
|
449 |
+
* Cleanup all tmp files
|
450 |
+
* @param all empty all contents
|
451 |
+
* @return void
|
452 |
+
*/
|
453 |
+
public static function TmpCleanup($all = false) {
|
454 |
+
|
455 |
+
//Delete all files now
|
456 |
+
if ($all){
|
457 |
+
$dir = DUPLICATOR_SSDIR_PATH_TMP . "/*";
|
458 |
+
foreach (glob($dir) as $file) {
|
459 |
+
unlink($file);
|
460 |
+
}
|
461 |
+
}
|
462 |
+
//Remove scan files that are 24 hours old
|
463 |
+
else {
|
464 |
+
$dir = DUPLICATOR_SSDIR_PATH_TMP . "/*_scan.json";
|
465 |
+
foreach (glob($dir) as $file) {
|
466 |
+
if (filemtime($file) <= time() - 86400) {
|
467 |
+
unlink($file);
|
468 |
+
}
|
469 |
+
}
|
470 |
+
}
|
471 |
+
}
|
472 |
+
|
473 |
+
private function buildCleanup() {
|
474 |
+
|
475 |
+
$files = DUP_Util::ListFiles(DUPLICATOR_SSDIR_PATH_TMP);
|
476 |
+
$newPath = DUPLICATOR_SSDIR_PATH;
|
477 |
+
|
478 |
+
if (function_exists('rename')) {
|
479 |
+
foreach($files as $file){
|
480 |
+
$name = basename($file);
|
481 |
+
if (strstr($name, $this->NameHash)) {
|
482 |
+
rename($file,"{$newPath}/{$name}");
|
483 |
+
}
|
484 |
+
}
|
485 |
+
} else {
|
486 |
+
foreach($files as $file){
|
487 |
+
$name = basename($file);
|
488 |
+
if (strstr($name, $this->NameHash)) {
|
489 |
+
copy($file,"{$newPath}/{$name}");
|
490 |
+
unlink($file);
|
491 |
+
}
|
492 |
+
}
|
493 |
+
}
|
494 |
+
}
|
495 |
+
|
496 |
+
private function parseDirectoryFilter($dirs = "") {
|
497 |
+
$dirs = str_replace(array("\n", "\t", "\r"), '', $dirs);
|
498 |
+
$filter_dirs = "";
|
499 |
+
$dir_array = array_unique(explode(";", $dirs));
|
500 |
+
foreach ($dir_array as $val) {
|
501 |
+
if (strlen($val) >= 2) {
|
502 |
+
$filter_dirs .= DUP_Util::SafePath(trim(rtrim($val, "/\\"))) . ";";
|
503 |
+
}
|
504 |
+
}
|
505 |
+
return $filter_dirs;
|
506 |
+
}
|
507 |
+
|
508 |
+
private function parseExtensionFilter($extensions = "") {
|
509 |
+
$filter_exts = "";
|
510 |
+
if (strlen($extensions) >= 1 && $extensions != ";") {
|
511 |
+
$filter_exts = str_replace(array(' ', '.'), '', $extensions);
|
512 |
+
$filter_exts = str_replace(",", ";", $filter_exts);
|
513 |
+
$filter_exts = DUP_Util::StringAppend($extensions, ";");
|
514 |
+
}
|
515 |
+
return $filter_exts;
|
516 |
+
}
|
517 |
+
|
518 |
+
}
|
519 |
?>
|
define.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
if (function_exists('plugin_dir_url')) {
|
4 |
|
5 |
|
6 |
-
define('DUPLICATOR_VERSION', '1.1.
|
7 |
define("DUPLICATOR_HOMEPAGE", "http://lifeinthegrid.com/labs/duplicator");
|
8 |
define("DUPLICATOR_GIVELINK", "http://lifeinthegrid.com/partner");
|
9 |
define("DUPLICATOR_HELPLINK", "http://lifeinthegrid.com/duplicator-docs");
|
3 |
if (function_exists('plugin_dir_url')) {
|
4 |
|
5 |
|
6 |
+
define('DUPLICATOR_VERSION', '1.1.4');
|
7 |
define("DUPLICATOR_HOMEPAGE", "http://lifeinthegrid.com/labs/duplicator");
|
8 |
define("DUPLICATOR_GIVELINK", "http://lifeinthegrid.com/partner");
|
9 |
define("DUPLICATOR_HELPLINK", "http://lifeinthegrid.com/duplicator-docs");
|
duplicator.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Duplicator
|
4 |
Plugin URI: http://www.lifeinthegrid.com/duplicator/
|
5 |
Description: Create a backup of your WordPress files and database. Duplicate and move an entire site from one location to another in a few steps. Create a full snapshot of your site at any point in time.
|
6 |
-
Version: 1.1.
|
7 |
Author: LifeInTheGrid
|
8 |
Author URI: http://www.lifeinthegrid.com
|
9 |
Text Domain: duplicator
|
3 |
Plugin Name: Duplicator
|
4 |
Plugin URI: http://www.lifeinthegrid.com/duplicator/
|
5 |
Description: Create a backup of your WordPress files and database. Duplicate and move an entire site from one location to another in a few steps. Create a full snapshot of your site at any point in time.
|
6 |
+
Version: 1.1.4
|
7 |
Author: LifeInTheGrid
|
8 |
Author URI: http://www.lifeinthegrid.com
|
9 |
Text Domain: duplicator
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: corylamleorg, bobriley
|
|
3 |
Donate link: www.lifeinthegrid.com/partner
|
4 |
Tags: backup, restore, move, migrate, localhost, synchronize, duplicate, clone, automate, niche
|
5 |
Requires at least: 3.9
|
6 |
-
Tested up to: 4.4.
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GPLv2
|
9 |
|
10 |
Duplicate, clone, backup, move and transfer an entire site from one location to another.
|
3 |
Donate link: www.lifeinthegrid.com/partner
|
4 |
Tags: backup, restore, move, migrate, localhost, synchronize, duplicate, clone, automate, niche
|
5 |
Requires at least: 3.9
|
6 |
+
Tested up to: 4.4.2
|
7 |
+
Stable tag: 1.1.4
|
8 |
License: GPLv2
|
9 |
|
10 |
Duplicate, clone, backup, move and transfer an entire site from one location to another.
|
views/actions.php
CHANGED
@@ -1,142 +1,145 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* DUPLICATOR_PACKAGE_SCAN
|
5 |
-
* Returns a json scan report object which contains data about the system
|
6 |
-
*
|
7 |
-
* @return json json report object
|
8 |
-
* @example to test: /wp-admin/admin-ajax.php?action=duplicator_package_scan
|
9 |
-
*/
|
10 |
-
function duplicator_package_scan() {
|
11 |
-
|
12 |
-
header('Content-Type: application/json;');
|
13 |
-
DUP_Util::CheckPermissions('export');
|
14 |
-
|
15 |
-
@set_time_limit(0);
|
16 |
-
$errLevel = error_reporting();
|
17 |
-
error_reporting(E_ERROR);
|
18 |
-
DUP_Util::InitSnapshotDirectory();
|
19 |
-
|
20 |
-
$Package = DUP_Package::GetActive();
|
21 |
-
$report = $Package->Scan();
|
22 |
-
|
23 |
-
$Package->SaveActiveItem('ScanFile', $Package->ScanFile);
|
24 |
-
$json_response = json_encode($report);
|
25 |
-
|
26 |
-
DUP_Package::TmpCleanup();
|
27 |
-
error_reporting($errLevel);
|
28 |
-
die($json_response);
|
29 |
-
}
|
30 |
-
|
31 |
-
/**
|
32 |
-
* duplicator_package_build
|
33 |
-
* Returns the package result status
|
34 |
-
*
|
35 |
-
* @return json json object of package results
|
36 |
-
*/
|
37 |
-
function duplicator_package_build() {
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
$json
|
61 |
-
$json['
|
62 |
-
$json['
|
63 |
-
$
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
*
|
74 |
-
*
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
$
|
87 |
-
$
|
88 |
-
$
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
@chmod(DUP_Util::SafePath(
|
106 |
-
@chmod(DUP_Util::SafePath(
|
107 |
-
@chmod(DUP_Util::SafePath(
|
108 |
-
@chmod(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH . "/{$nameHash}
|
109 |
-
@chmod(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH . "/{$nameHash}.
|
110 |
-
|
111 |
-
@
|
112 |
-
@
|
113 |
-
|
114 |
-
@unlink(DUP_Util::SafePath(
|
115 |
-
@unlink(DUP_Util::SafePath(
|
116 |
-
@unlink(DUP_Util::SafePath(
|
117 |
-
@unlink(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH . "/{$nameHash}
|
118 |
-
@unlink(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH . "/{$nameHash}.
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
}
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
}
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
}
|
140 |
-
|
141 |
-
|
|
|
|
|
|
|
142 |
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* DUPLICATOR_PACKAGE_SCAN
|
5 |
+
* Returns a json scan report object which contains data about the system
|
6 |
+
*
|
7 |
+
* @return json json report object
|
8 |
+
* @example to test: /wp-admin/admin-ajax.php?action=duplicator_package_scan
|
9 |
+
*/
|
10 |
+
function duplicator_package_scan() {
|
11 |
+
|
12 |
+
header('Content-Type: application/json;');
|
13 |
+
DUP_Util::CheckPermissions('export');
|
14 |
+
|
15 |
+
@set_time_limit(0);
|
16 |
+
$errLevel = error_reporting();
|
17 |
+
error_reporting(E_ERROR);
|
18 |
+
DUP_Util::InitSnapshotDirectory();
|
19 |
+
|
20 |
+
$Package = DUP_Package::GetActive();
|
21 |
+
$report = $Package->Scan();
|
22 |
+
|
23 |
+
$Package->SaveActiveItem('ScanFile', $Package->ScanFile);
|
24 |
+
$json_response = json_encode($report);
|
25 |
+
|
26 |
+
DUP_Package::TmpCleanup();
|
27 |
+
error_reporting($errLevel);
|
28 |
+
die($json_response);
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* duplicator_package_build
|
33 |
+
* Returns the package result status
|
34 |
+
*
|
35 |
+
* @return json json object of package results
|
36 |
+
*/
|
37 |
+
function duplicator_package_build() {
|
38 |
+
|
39 |
+
DUP_Util::CheckPermissions('export');
|
40 |
+
|
41 |
+
check_ajax_referer( 'dup_package_build', 'nonce');
|
42 |
+
|
43 |
+
header('Content-Type: application/json');
|
44 |
+
|
45 |
+
@set_time_limit(0);
|
46 |
+
$errLevel = error_reporting();
|
47 |
+
error_reporting(E_ERROR);
|
48 |
+
DUP_Util::InitSnapshotDirectory();
|
49 |
+
|
50 |
+
$Package = DUP_Package::GetActive();
|
51 |
+
|
52 |
+
if (!is_readable(DUPLICATOR_SSDIR_PATH_TMP . "/{$Package->ScanFile}")) {
|
53 |
+
die("The scan result file was not found. Please run the scan step before building the package.");
|
54 |
+
}
|
55 |
+
|
56 |
+
$Package->Build();
|
57 |
+
|
58 |
+
//JSON:Debug Response
|
59 |
+
//Pass = 1, Warn = 2, Fail = 3
|
60 |
+
$json = array();
|
61 |
+
$json['Status'] = 1;
|
62 |
+
$json['Package'] = $Package;
|
63 |
+
$json['Runtime'] = $Package->Runtime;
|
64 |
+
$json['ExeSize'] = $Package->ExeSize;
|
65 |
+
$json['ZipSize'] = $Package->ZipSize;
|
66 |
+
$json_response = json_encode($json);
|
67 |
+
|
68 |
+
error_reporting($errLevel);
|
69 |
+
die($json_response);
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* DUPLICATOR_PACKAGE_DELETE
|
74 |
+
* Deletes the files and database record entries
|
75 |
+
*
|
76 |
+
* @return json A json message about the action.
|
77 |
+
* Use console.log to debug from client
|
78 |
+
*/
|
79 |
+
function duplicator_package_delete() {
|
80 |
+
|
81 |
+
DUP_Util::CheckPermissions('export');
|
82 |
+
check_ajax_referer( 'package_list', 'nonce' );
|
83 |
+
|
84 |
+
try {
|
85 |
+
global $wpdb;
|
86 |
+
$json = array();
|
87 |
+
$post = stripslashes_deep($_POST);
|
88 |
+
$tblName = $wpdb->prefix . 'duplicator_packages';
|
89 |
+
$postIDs = isset($post['duplicator_delid']) ? $post['duplicator_delid'] : null;
|
90 |
+
$list = explode(",", $postIDs);
|
91 |
+
$delCount = 0;
|
92 |
+
|
93 |
+
if ($postIDs != null) {
|
94 |
+
|
95 |
+
foreach ($list as $id) {
|
96 |
+
|
97 |
+
$getResult = $wpdb->get_results($wpdb->prepare("SELECT name, hash FROM `{$tblName}` WHERE id = %d", $id), ARRAY_A);
|
98 |
+
|
99 |
+
if ($getResult) {
|
100 |
+
$row = $getResult[0];
|
101 |
+
$nameHash = "{$row['name']}_{$row['hash']}";
|
102 |
+
$delResult = $wpdb->query($wpdb->prepare( "DELETE FROM `{$tblName}` WHERE id = %d", $id ));
|
103 |
+
if ($delResult != 0) {
|
104 |
+
//Perms
|
105 |
+
@chmod(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH_TMP . "/{$nameHash}_archive.zip"), 0644);
|
106 |
+
@chmod(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH_TMP . "/{$nameHash}_database.sql"), 0644);
|
107 |
+
@chmod(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH_TMP . "/{$nameHash}_installer.php"), 0644);
|
108 |
+
@chmod(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH . "/{$nameHash}_archive.zip"), 0644);
|
109 |
+
@chmod(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH . "/{$nameHash}_database.sql"), 0644);
|
110 |
+
@chmod(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH . "/{$nameHash}_installer.php"), 0644);
|
111 |
+
@chmod(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH . "/{$nameHash}_scan.json"), 0644);
|
112 |
+
@chmod(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH . "/{$nameHash}.log"), 0644);
|
113 |
+
//Remove
|
114 |
+
@unlink(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH_TMP . "/{$nameHash}_archive.zip"));
|
115 |
+
@unlink(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH_TMP . "/{$nameHash}_database.sql"));
|
116 |
+
@unlink(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH_TMP . "/{$nameHash}_installer.php"));
|
117 |
+
@unlink(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH . "/{$nameHash}_archive.zip"));
|
118 |
+
@unlink(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH . "/{$nameHash}_database.sql"));
|
119 |
+
@unlink(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH . "/{$nameHash}_installer.php"));
|
120 |
+
@unlink(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH . "/{$nameHash}_scan.json"));
|
121 |
+
@unlink(DUP_Util::SafePath(DUPLICATOR_SSDIR_PATH . "/{$nameHash}.log"));
|
122 |
+
//Unfinished Zip files
|
123 |
+
$tmpZip = DUPLICATOR_SSDIR_PATH_TMP . "/{$nameHash}_archive.zip.*";
|
124 |
+
if ($tmpZip !== false) {
|
125 |
+
array_map('unlink', glob($tmpZip));
|
126 |
+
}
|
127 |
+
@unlink(DUP_Util::SafePath());
|
128 |
+
$delCount++;
|
129 |
+
}
|
130 |
+
}
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
} catch (Exception $e) {
|
135 |
+
$json['error'] = "{$e}";
|
136 |
+
die(json_encode($json));
|
137 |
+
}
|
138 |
+
|
139 |
+
$json['ids'] = "{$postIDs}";
|
140 |
+
$json['removed'] = $delCount;
|
141 |
+
die(json_encode($json));
|
142 |
+
}
|
143 |
+
|
144 |
+
//DO NOT ADD A CARRIAGE RETURN BEYOND THIS POINT (headers issue)!!
|
145 |
?>
|
views/packages/details/detail.php
CHANGED
@@ -40,7 +40,7 @@ $dbbuild_mode = ($mysqldump_on) ? 'mysqldump (fast)' : 'PHP (slow)';
|
|
40 |
div.dup-store-pro a {text-decoration: underline}
|
41 |
|
42 |
/*GENERAL*/
|
43 |
-
div#dup-name-info {display: none; font-size:11px; line-height:20px; margin:4px 0 0 0}
|
44 |
div#dup-downloads-area {padding: 5px 0 5px 0; }
|
45 |
div#dup-downloads-msg {margin-bottom:-5px; font-style: italic}
|
46 |
</style>
|
@@ -78,10 +78,16 @@ GENERAL -->
|
|
78 |
<td><?php DUP_Util::_e("Notes") ?>:</td>
|
79 |
<td><?php echo strlen($package->Notes) ? $package->Notes : DUP_Util::__("- no notes -") ?></td>
|
80 |
</tr>
|
81 |
-
|
82 |
<tr>
|
83 |
-
<td><?php DUP_Util::_e("
|
84 |
-
<td
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
</tr>
|
86 |
<tr>
|
87 |
<td><?php DUP_Util::_e("Runtime") ?>:</td>
|
40 |
div.dup-store-pro a {text-decoration: underline}
|
41 |
|
42 |
/*GENERAL*/
|
43 |
+
div#dup-name-info, div#dup-version-info {display: none; font-size:11px; line-height:20px; margin:4px 0 0 0}
|
44 |
div#dup-downloads-area {padding: 5px 0 5px 0; }
|
45 |
div#dup-downloads-msg {margin-bottom:-5px; font-style: italic}
|
46 |
</style>
|
78 |
<td><?php DUP_Util::_e("Notes") ?>:</td>
|
79 |
<td><?php echo strlen($package->Notes) ? $package->Notes : DUP_Util::__("- no notes -") ?></td>
|
80 |
</tr>
|
|
|
81 |
<tr>
|
82 |
+
<td><?php DUP_Util::_e("Versions") ?>:</td>
|
83 |
+
<td>
|
84 |
+
<a href="javascript:void(0);" onclick="jQuery('#dup-version-info').toggle()"><?php echo $package->Version ?></a>
|
85 |
+
<div id="dup-version-info">
|
86 |
+
<b><?php DUP_Util::_e("WordPress") ?>:</b> <?php echo strlen($package->VersionWP) ? $package->VersionWP : DUP_Util::__("- unknown -") ?><br/>
|
87 |
+
<b><?php DUP_Util::_e("Mysql") ?>:</b> <?php echo strlen($package->VersionDB) ? $package->VersionDB : DUP_Util::__("- unknown -") ?><br/>
|
88 |
+
<b><?php DUP_Util::_e("PHP") ?>:</b> <?php echo strlen($package->VersionPHP) ? $package->VersionPHP : DUP_Util::__("- unknown -") ?><br/>
|
89 |
+
</div>
|
90 |
+
</td>
|
91 |
</tr>
|
92 |
<tr>
|
93 |
<td><?php DUP_Util::_e("Runtime") ?>:</td>
|
views/packages/main/new1.base.php
CHANGED
@@ -18,7 +18,7 @@ if (isset($_POST['action']))
|
|
18 |
DUP_Util::InitSnapshotDirectory();
|
19 |
|
20 |
$Package = DUP_Package::GetActive();
|
21 |
-
$package_hash = $Package->MakeHash();
|
22 |
|
23 |
$dup_tests = array();
|
24 |
$dup_tests = DUP_Server::GetRequirements();
|
18 |
DUP_Util::InitSnapshotDirectory();
|
19 |
|
20 |
$Package = DUP_Package::GetActive();
|
21 |
+
//RSR REMOVED $package_hash = $Package->MakeHash();
|
22 |
|
23 |
$dup_tests = array();
|
24 |
$dup_tests = DUP_Server::GetRequirements();
|
views/packages/main/new1.inc.form.php
CHANGED
@@ -39,7 +39,8 @@
|
|
39 |
|
40 |
<form id="dup-form-opts" method="post" action="?page=duplicator&tab=new2" data-validate="parsley">
|
41 |
<input type="hidden" id="dup-form-opts-action" name="action" value="">
|
42 |
-
|
|
|
43 |
<div>
|
44 |
<label for="package-name"><b><?php _e('Name', 'duplicator') ?>:</b> </label>
|
45 |
<div class="dup-notes-add">
|
39 |
|
40 |
<form id="dup-form-opts" method="post" action="?page=duplicator&tab=new2" data-validate="parsley">
|
41 |
<input type="hidden" id="dup-form-opts-action" name="action" value="">
|
42 |
+
<!-- RSR Removed the following -->
|
43 |
+
<!-- <input type="hidden" id="dup-form-opts-hash" name="package-hash" value="<?php echo $package_hash; ?>">-->
|
44 |
<div>
|
45 |
<label for="package-name"><b><?php _e('Name', 'duplicator') ?>:</b> </label>
|
46 |
<div class="dup-notes-add">
|
views/packages/main/new2.base.php
CHANGED
@@ -1,642 +1,649 @@
|
|
1 |
-
<?php
|
2 |
-
require_once (DUPLICATOR_PLUGIN_PATH . 'classes/package.php');
|
3 |
-
require_once (DUPLICATOR_PLUGIN_PATH . 'classes/utility.php');
|
4 |
-
|
5 |
-
if(empty($_POST))
|
6 |
-
{
|
7 |
-
//F5 Refresh Check
|
8 |
-
$redirect = admin_url('admin.php?page=duplicator&tab=new1');
|
9 |
-
echo "<script>window.location.href = '{$redirect}'</script>";
|
10 |
-
exit;
|
11 |
-
}
|
12 |
-
|
13 |
-
global $wp_version;
|
14 |
-
$Package = new DUP_Package();
|
15 |
-
|
16 |
-
$
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
div
|
37 |
-
div.dup-
|
38 |
-
|
39 |
-
div
|
40 |
-
div
|
41 |
-
div
|
42 |
-
|
43 |
-
div.dup-
|
44 |
-
div.dup-scan-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
div
|
52 |
-
div
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
div#
|
59 |
-
|
60 |
-
|
61 |
-
div#
|
62 |
-
div#
|
63 |
-
|
64 |
-
div#
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
</
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
<
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
<!--
|
106 |
-
<div id="dup-
|
107 |
-
<div
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
<div class="dup-panel-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
DUP_Util::_e(
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
</div>
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
echo '<
|
162 |
-
|
163 |
-
|
164 |
-
echo '
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
echo '</small>';
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
</div>
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
echo '<
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
echo '<
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
<
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
<
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
<
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
$('#dup-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
}
|
508 |
-
|
509 |
-
Duplicator.Pack.
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
//****************
|
536 |
-
//
|
537 |
-
$('#data-
|
538 |
-
$('#data-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
$('#data-srv-
|
545 |
-
|
546 |
-
|
547 |
-
$('#data-srv-
|
548 |
-
$('#data-srv-
|
549 |
-
$('#data-srv-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
642 |
</script>
|
1 |
+
<?php
|
2 |
+
require_once (DUPLICATOR_PLUGIN_PATH . 'classes/package.php');
|
3 |
+
require_once (DUPLICATOR_PLUGIN_PATH . 'classes/utility.php');
|
4 |
+
|
5 |
+
if(empty($_POST))
|
6 |
+
{
|
7 |
+
//F5 Refresh Check
|
8 |
+
$redirect = admin_url('admin.php?page=duplicator&tab=new1');
|
9 |
+
echo "<script>window.location.href = '{$redirect}'</script>";
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
global $wp_version;
|
14 |
+
$Package = new DUP_Package();
|
15 |
+
|
16 |
+
if(isset($_POST['package-hash']))
|
17 |
+
{
|
18 |
+
// If someone is trying to pass the hasn into us that is illegal so stop it immediately.
|
19 |
+
die('Unauthorized');
|
20 |
+
}
|
21 |
+
|
22 |
+
$Package->SaveActive($_POST);
|
23 |
+
$Package = DUP_Package::GetActive();
|
24 |
+
|
25 |
+
$mysqldump_on = DUP_Settings::Get('package_mysqldump') && DUP_Database::GetMySqlDumpPath();
|
26 |
+
$mysqlcompat_on = isset($Package->Database->Compatible) && strlen($Package->Database->Compatible);
|
27 |
+
$mysqlcompat_on = ($mysqldump_on && $mysqlcompat_on) ? true : false;
|
28 |
+
$dbbuild_mode = ($mysqldump_on) ? 'mysqldump (fast)' : 'PHP (slow)';
|
29 |
+
|
30 |
+
$zip_check = DUP_Util::GetZipPath();
|
31 |
+
?>
|
32 |
+
|
33 |
+
<style>
|
34 |
+
/* ============----------
|
35 |
+
PROGRESS ARES-CHECKS */
|
36 |
+
div#dup-progress-area {text-align:center; max-width:650px; min-height:200px; margin:0px auto 0px auto; padding:0px;}
|
37 |
+
div.dup-progress-title {font-size:22px;padding:5px 0 20px 0; font-weight: bold}
|
38 |
+
div#dup-msg-success {color:#18592A; padding:5px; text-align: left}
|
39 |
+
div#dup-msg-success-subtitle {font-style: italic; margin:7px 0px}
|
40 |
+
div#dup-msg-error {color:#A62426; padding:5px; max-width: 790px;}
|
41 |
+
div#dup-msg-error-response-text { max-height:350px; overflow-y:scroll; border:1px solid silver; border-radius: 3px; padding:8px;background:#fff}
|
42 |
+
|
43 |
+
div.dup-panel {margin-bottom: 25px}
|
44 |
+
div.dup-scan-filter-status {display:inline; float: right; font-size:11px; margin-right:10px; color:#AF0000; font-style: italic}
|
45 |
+
/* SERVER-CHECKS */
|
46 |
+
div.dup-scan-title {display:inline-block; padding:1px; font-weight: bold;}
|
47 |
+
div.dup-scan-title a {display:inline-block; min-width:200px; padding:3px; }
|
48 |
+
div.dup-scan-title a:focus {outline: 1px solid #fff; box-shadow: none}
|
49 |
+
div.dup-scan-title div {display:inline-block; }
|
50 |
+
div.dup-scan-info {display:none;}
|
51 |
+
div.dup-scan-good {display:inline-block; color:green;font-weight: bold;}
|
52 |
+
div.dup-scan-warn {display:inline-block; color:#AF0000;font-weight: bold;}
|
53 |
+
span.dup-toggle {float:left; margin:0 2px 2px 0; }
|
54 |
+
/*DATABASE*/
|
55 |
+
table#dup-scan-db-details {line-height: 14px; margin:15px 0px 0px 5px; width:98%}
|
56 |
+
table#dup-scan-db-details td {padding:0px;}
|
57 |
+
table#dup-scan-db-details td:first-child {font-weight: bold; white-space: nowrap; width:90px}
|
58 |
+
div#dup-scan-db-info {margin:0px 0px 0px 10px}
|
59 |
+
div#data-db-tablelist {max-height: 300px; overflow-y: scroll}
|
60 |
+
div#data-db-tablelist div{padding:0px 0px 0px 15px;}
|
61 |
+
div#data-db-tablelist span{display:inline-block; min-width: 75px}
|
62 |
+
div#data-db-size1 {display: inline-block; float:right; font-size:11px; margin-right: 15px; font-style: italic}
|
63 |
+
/*FILES */
|
64 |
+
div#data-arc-size1 {display: inline-block; float:right; font-size:11px; margin-right: 15px; font-style: italic}
|
65 |
+
div#data-arc-names-data, div#data-arc-big-data
|
66 |
+
{word-wrap: break-word;font-size:10px; border:1px dashed silver; padding:5px; display: none}
|
67 |
+
|
68 |
+
div#dup-scan-warning-continue {display:none; text-align: center; padding: 0 0 15px 0}
|
69 |
+
div#dup-scan-warning-continue div.msg1 label{font-size:16px; color:maroon}
|
70 |
+
div#dup-scan-warning-continue div.msg2 {padding:2px}
|
71 |
+
div#dup-scan-warning-continue div.msg2 label {font-size:11px !important}
|
72 |
+
|
73 |
+
/*Footer*/
|
74 |
+
div.dup-button-footer {text-align:center; margin:0}
|
75 |
+
button.button {font-size:15px !important; height:30px !important; font-weight:bold; padding:3px 5px 5px 5px !important;}
|
76 |
+
</style>
|
77 |
+
|
78 |
+
<!-- =========================================
|
79 |
+
TOOL BAR: STEPS -->
|
80 |
+
<table id="dup-toolbar">
|
81 |
+
<tr valign="top">
|
82 |
+
<td style="white-space: nowrap">
|
83 |
+
<div id="dup-wiz">
|
84 |
+
<div id="dup-wiz-steps">
|
85 |
+
<div class="completed-step"><a><span>1</span> <?php DUP_Util::_e('Setup'); ?></a></div>
|
86 |
+
<div class="active-step"><a><span>2</span> <?php DUP_Util::_e('Scan'); ?> </a></div>
|
87 |
+
<div><a><span>3</span> <?php DUP_Util::_e('Build'); ?> </a></div>
|
88 |
+
</div>
|
89 |
+
<div id="dup-wiz-title">
|
90 |
+
<?php DUP_Util::_e('Step 2: System Scan'); ?>
|
91 |
+
</div>
|
92 |
+
</div>
|
93 |
+
</td>
|
94 |
+
<td class="dup-toolbar-btns">
|
95 |
+
<a id="dup-pro-create-new" href="?page=duplicator" class="add-new-h2"><i class="fa fa-archive"></i> <?php DUP_Util::_e("All Packages"); ?></a>
|
96 |
+
<span> <?php DUP_Util::_e("Create New"); ?></span>
|
97 |
+
</td>
|
98 |
+
</tr>
|
99 |
+
</table>
|
100 |
+
<hr style="margin-bottom:10px">
|
101 |
+
|
102 |
+
|
103 |
+
<form id="form-duplicator" method="post" action="?page=duplicator&tab=new3">
|
104 |
+
<div id="dup-progress-area">
|
105 |
+
<!-- PROGRESS BAR -->
|
106 |
+
<div id="dup-progress-bar-area">
|
107 |
+
<div class="dup-progress-title"><i class="fa fa-spinner fa-spin"></i> <?php DUP_Util::_e('Scanning Site'); ?></div>
|
108 |
+
<div id="dup-progress-bar"></div>
|
109 |
+
<b><?php DUP_Util::_e('Please Wait...'); ?></b>
|
110 |
+
</div>
|
111 |
+
|
112 |
+
<!-- SUCCESS MESSAGE -->
|
113 |
+
<div id="dup-msg-success" style="display:none">
|
114 |
+
<div style="text-align:center">
|
115 |
+
<div class="dup-hdr-success"><i class="fa fa-check-square-o fa-lg"></i> <?php DUP_Util::_e('Scan Complete'); ?></div>
|
116 |
+
<div id="dup-msg-success-subtitle">
|
117 |
+
<?php DUP_Util::_e("Process Time:"); ?> <span id="data-rpt-scantime"></span>
|
118 |
+
</div>
|
119 |
+
</div><br/>
|
120 |
+
|
121 |
+
<!-- ================================================================
|
122 |
+
META-BOX: SERVER
|
123 |
+
================================================================ -->
|
124 |
+
<div class="dup-panel">
|
125 |
+
<div class="dup-panel-title">
|
126 |
+
<i class="fa fa-hdd-o"></i> <?php DUP_Util::_e("Server"); ?>
|
127 |
+
<div style="float:right; margin:-1px 10px 0px 0px">
|
128 |
+
<small><a href="?page=duplicator-tools&tab=diagnostics" target="_blank"><?php DUP_Util::_e('Diagnostics');?></a></small>
|
129 |
+
</div>
|
130 |
+
|
131 |
+
</div>
|
132 |
+
<div class="dup-panel-panel">
|
133 |
+
<!-- ============
|
134 |
+
WEB SERVER -->
|
135 |
+
<div>
|
136 |
+
<div class='dup-scan-title'>
|
137 |
+
<a><?php DUP_Util::_e('Web Server');?></a> <div id="data-srv-web-all"></div>
|
138 |
+
</div>
|
139 |
+
<div class='dup-scan-info dup-info-box'>
|
140 |
+
<?php
|
141 |
+
$web_servers = implode(', ', $GLOBALS['DUPLICATOR_SERVER_LIST']);
|
142 |
+
echo '<span id="data-srv-web-model"></span> <b>' . DUP_Util::__('Web Server') . ":</b> '{$_SERVER['SERVER_SOFTWARE']}'";
|
143 |
+
echo '<small>';
|
144 |
+
DUP_Util::_e("Supported web servers:");
|
145 |
+
echo "{$web_servers}";
|
146 |
+
echo '</small>';
|
147 |
+
?>
|
148 |
+
</div>
|
149 |
+
</div>
|
150 |
+
<!-- ============
|
151 |
+
PHP SETTINGS -->
|
152 |
+
<div>
|
153 |
+
<div class='dup-scan-title'>
|
154 |
+
<a><?php DUP_Util::_e('PHP Setup');?></a> <div id="data-srv-php-all"></div>
|
155 |
+
</div>
|
156 |
+
<div class='dup-scan-info dup-info-box'>
|
157 |
+
<?php
|
158 |
+
//OPEN_BASEDIR
|
159 |
+
$test = ini_get("open_basedir");
|
160 |
+
echo '<span id="data-srv-php-openbase"></span> <b>' . DUP_Util::__('Open Base Dir') . ":</b> '{$test}' <br/>";
|
161 |
+
echo '<small>';
|
162 |
+
DUP_Util::_e('Issues might occur when [open_basedir] is enabled. Work with your server admin to disable this value in the php.ini file if you’re having issues building a package.');
|
163 |
+
echo " <i><a href='http://www.php.net/manual/en/ini.core.php#ini.open-basedir' target='_blank'>[" . DUP_Util::__('details') . "]</a></i><br/>";
|
164 |
+
echo '</small>';
|
165 |
+
|
166 |
+
//MAX_EXECUTION_TIME
|
167 |
+
$test = (set_time_limit(0)) ? 0 : ini_get("max_execution_time");
|
168 |
+
echo '<hr size="1" /><span id="data-srv-php-maxtime"></span> <b>' . DUP_Util::__('Max Execution Time') . ":</b> '{$test}' <br/>";
|
169 |
+
echo '<small>';
|
170 |
+
printf(DUP_Util::__('Issues might occur for larger packages when the [max_execution_time] value in the php.ini is too low. The minimum recommended timeout is "%1$s" seconds or higher. An attempt is made to override this value if the server allows it. A value of 0 (recommended) indicates that PHP has no time limits.'), DUPLICATOR_SCAN_TIMEOUT);
|
171 |
+
echo '<br/><br/>';
|
172 |
+
DUP_Util::_e('Note: Timeouts can also be set at the web server layer, so if the PHP max timeout passes and you still see a build interrupt messages, then your web server could be killing the process. If you are limited on processing time, consider using the database or file filters to shrink the size of your overall package. However use caution as excluding the wrong resources can cause your install to not work properly.');
|
173 |
+
echo " <i><a href='http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time' target='_blank'>[" .DUP_Util::__('details') . "]</a></i>";
|
174 |
+
|
175 |
+
if ($zip_check != null) {
|
176 |
+
echo '<br/><br/>';
|
177 |
+
echo '<span style="font-weight:bold">';
|
178 |
+
DUP_Util::_e('Get faster builds with Duplicator Pro.');
|
179 |
+
echo '</span>';
|
180 |
+
echo " <i><a href='http://snapcreek.com/duplicator?free-max-execution-time-warn' target='_blank'>[" . DUP_Util::__('details') . "]</a></i>";
|
181 |
+
}
|
182 |
+
|
183 |
+
echo '</small>';
|
184 |
+
|
185 |
+
//MYSQLI
|
186 |
+
echo '<hr size="1" /><span id="data-srv-php-mysqli"></span> <b>' . DUP_Util::__('MySQLi') . "</b> <br/>";
|
187 |
+
echo '<small>';
|
188 |
+
DUP_Util::_e('Creating the package does not require the mysqli module. However the installer.php file requires that the PHP module mysqli be installed on the server it is deployed on.');
|
189 |
+
echo " <i><a href='http://php.net/manual/en/mysqli.installation.php' target='_blank'>[" . DUP_Util::__('details') . "]</a></i>";
|
190 |
+
echo '</small>';
|
191 |
+
?>
|
192 |
+
</div>
|
193 |
+
</div>
|
194 |
+
<!-- ============
|
195 |
+
WORDPRESS SETTINGS -->
|
196 |
+
<div>
|
197 |
+
<div class='dup-scan-title'>
|
198 |
+
<a><?php DUP_Util::_e('WordPress');?></a> <div id="data-srv-wp-all"></div>
|
199 |
+
</div>
|
200 |
+
<div class='dup-scan-info dup-info-box'>
|
201 |
+
<?php
|
202 |
+
//VERSION CHECK
|
203 |
+
echo '<span id="data-srv-wp-version"></span> <b>' . DUP_Util::__('WordPress Version') . ":</b> '{$wp_version}' <br/>";
|
204 |
+
echo '<small>';
|
205 |
+
printf(DUP_Util::__('It is recommended to have a version of WordPress that is greater than %1$s'), DUPLICATOR_SCAN_MIN_WP);
|
206 |
+
echo '</small>';
|
207 |
+
|
208 |
+
//CORE FILES
|
209 |
+
echo '<hr size="1" /><span id="data-srv-wp-core"></span> <b>' . DUP_Util::__('Core Files') . "</b> <br/>";
|
210 |
+
echo '<small>';
|
211 |
+
DUP_Util::_e("If the scanner is unable to locate the wp-config.php file in the root directory, then you will need to manually copy it to its new location.");
|
212 |
+
echo '</small>';
|
213 |
+
|
214 |
+
//CACHE DIR
|
215 |
+
$cache_path = $cache_path = DUP_Util::SafePath(WP_CONTENT_DIR) . '/cache';
|
216 |
+
$cache_size = DUP_Util::ByteSize(DUP_Util::GetDirectorySize($cache_path));
|
217 |
+
echo '<hr size="1" /><span id="data-srv-wp-cache"></span> <b>' . DUP_Util::__('Cache Path') . ":</b> '{$cache_path}' ({$cache_size}) <br/>";
|
218 |
+
echo '<small>';
|
219 |
+
DUP_Util::_e("Cached data will lead to issues at install time and increases your archive size. It is recommended to empty your cache directory at build time. Use caution when removing data from the cache directory. If you have a cache plugin review the documentation for how to empty it; simply removing files might cause errors on your site. The cache size minimum threshold is currently set at ");
|
220 |
+
echo DUP_Util::ByteSize(DUPLICATOR_SCAN_CACHESIZE) . '.';
|
221 |
+
echo '</small>';
|
222 |
+
|
223 |
+
?>
|
224 |
+
</div>
|
225 |
+
</div>
|
226 |
+
</div><!-- end .dup-panel -->
|
227 |
+
</div><!-- end .dup-panel-panel -->
|
228 |
+
|
229 |
+
<h2 style="font-size:18px; font-weight:bold; margin:-15px 0 0 10px"><i class="fa fa-file-archive-o"></i> <?php DUP_Util::_e('Archive');?> </h2>
|
230 |
+
|
231 |
+
<!-- ================================================================
|
232 |
+
FILES
|
233 |
+
================================================================ -->
|
234 |
+
<div class="dup-panel">
|
235 |
+
<div class="dup-panel-title">
|
236 |
+
<i class="fa fa-files-o"></i>
|
237 |
+
<?php DUP_Util::_e("Files"); ?>
|
238 |
+
<div id="data-arc-size1"></div>
|
239 |
+
<div class="dup-scan-filter-status">
|
240 |
+
<?php
|
241 |
+
if ($Package->Archive->FilterOn) {
|
242 |
+
echo '<i class="fa fa-filter"></i> '; DUP_Util::_e('Enabled');
|
243 |
+
}
|
244 |
+
?>
|
245 |
+
</div>
|
246 |
+
</div>
|
247 |
+
<div class="dup-panel-panel">
|
248 |
+
|
249 |
+
<!-- ============
|
250 |
+
TOTAL SIZE -->
|
251 |
+
<div>
|
252 |
+
<div class='dup-scan-title'>
|
253 |
+
<a><?php DUP_Util::_e('Total Size');?></a> <div id="data-arc-status-size"></div>
|
254 |
+
</div>
|
255 |
+
<div class='dup-scan-info dup-info-box'>
|
256 |
+
<b><?php DUP_Util::_e('Size');?>:</b> <span id="data-arc-size2"></span> |
|
257 |
+
<b><?php DUP_Util::_e('File Count');?>:</b> <span id="data-arc-files"></span> |
|
258 |
+
<b><?php DUP_Util::_e('Directory Count');?>:</b> <span id="data-arc-dirs"></span>
|
259 |
+
<small>
|
260 |
+
<?php
|
261 |
+
printf(DUP_Util::__('Total size represents all files minus any filters that have been setup. The current thresholds that triggers a warning is %1$s for the total size. Some budget hosts limit the amount of time a PHP/Web request process can run. When working with larger sites this can cause timeout issues. Consider using a file filter in step 1 to shrink and filter the overall size of your package.'),
|
262 |
+
DUP_Util::ByteSize(DUPLICATOR_SCAN_SITE),
|
263 |
+
DUP_Util::ByteSize(DUPLICATOR_SCAN_WARNFILESIZE));
|
264 |
+
|
265 |
+
if ($zip_check != null) {
|
266 |
+
echo '<br/><br/>';
|
267 |
+
echo '<span style="font-weight:bold">';
|
268 |
+
DUP_Util::_e('Package support up to 2GB available in Duplicator Pro.');
|
269 |
+
echo '</span>';
|
270 |
+
echo " <i><a href='http://snapcreek.com/duplicator?free-size-warn' target='_blank'>[" . DUP_Util::__('details') . "]</a></i>";
|
271 |
+
}
|
272 |
+
|
273 |
+
?>
|
274 |
+
</small>
|
275 |
+
</div>
|
276 |
+
</div>
|
277 |
+
|
278 |
+
<!-- ============
|
279 |
+
FILE NAME LENGTHS -->
|
280 |
+
<div>
|
281 |
+
<div class='dup-scan-title'>
|
282 |
+
<a><?php DUP_Util::_e('Name Checks');?></a> <div id="data-arc-status-names"></div>
|
283 |
+
</div>
|
284 |
+
<div class='dup-scan-info dup-info-box'>
|
285 |
+
<small>
|
286 |
+
<?php
|
287 |
+
DUP_Util::_e('File or directory names may cause issues when working across different environments and servers. Names that are over 250 characters, contain special characters (such as * ? > < : / \ |) or are unicode might cause issues in a remote enviroment. It is recommended to remove or filter these files before building the archive if you have issues at install time.');
|
288 |
+
?>
|
289 |
+
</small><br/>
|
290 |
+
<a href="javascript:void(0)" onclick="jQuery('#data-arc-names-data').toggle()">[<?php DUP_Util::_e('Show Paths');?>]</a>
|
291 |
+
<div id="data-arc-names-data"></div>
|
292 |
+
</div>
|
293 |
+
</div>
|
294 |
+
|
295 |
+
<!-- ============
|
296 |
+
LARGE FILES -->
|
297 |
+
<div>
|
298 |
+
<div class='dup-scan-title'>
|
299 |
+
<a><?php DUP_Util::_e('Large Files');?></a> <div id="data-arc-status-big"></div>
|
300 |
+
</div>
|
301 |
+
<div class='dup-scan-info dup-info-box'>
|
302 |
+
<small>
|
303 |
+
<?php
|
304 |
+
printf(DUP_Util::__('Large files such as movies or other backuped data can cause issues with timeouts. The current check for large files is %1$s per file. If your having issues creating a package consider excluding these files with the files filter and manually moving them to your new location.'),
|
305 |
+
DUP_Util::ByteSize(DUPLICATOR_SCAN_WARNFILESIZE));
|
306 |
+
?>
|
307 |
+
</small><br/>
|
308 |
+
<a href="javascript:void(0)" onclick="jQuery('#data-arc-big-data').toggle()">[<?php DUP_Util::_e('Show Paths');?>]</a>
|
309 |
+
<div id="data-arc-big-data"></div>
|
310 |
+
</div>
|
311 |
+
</div>
|
312 |
+
|
313 |
+
<!-- ============
|
314 |
+
VIEW FILTERS -->
|
315 |
+
<?php if ($Package->Archive->FilterOn) : ?>
|
316 |
+
<div>
|
317 |
+
<div class='dup-scan-title'>
|
318 |
+
<a style='font-weight: normal'><?php DUP_Util::_e('Archive Details');?></a>
|
319 |
+
</div>
|
320 |
+
<div class='dup-scan-info dup-info-box'>
|
321 |
+
<b>[<?php DUP_Util::_e('Root Directory');?>]</b><br/>
|
322 |
+
<?php echo DUPLICATOR_WPROOTPATH;?>
|
323 |
+
<br/><br/>
|
324 |
+
|
325 |
+
<b>[<?php DUP_Util::_e('Excluded Directories');?>]</b><br/>
|
326 |
+
<?php
|
327 |
+
if (strlen( $Package->Archive->FilterDirs)) {
|
328 |
+
echo str_replace(";", "<br/>", $Package->Archive->FilterDirs);
|
329 |
+
} else {
|
330 |
+
DUP_Util::_e('No directory filters have been set.');
|
331 |
+
}
|
332 |
+
?>
|
333 |
+
<br/>
|
334 |
+
|
335 |
+
<b>[<?php DUP_Util::_e('Excluded File Extensions');?>]</b><br/>
|
336 |
+
<?php
|
337 |
+
if (strlen( $Package->Archive->FilterExts)) {
|
338 |
+
echo $Package->Archive->FilterExts;
|
339 |
+
} else {
|
340 |
+
DUP_Util::_e('No file extension filters have been set.');
|
341 |
+
}
|
342 |
+
?>
|
343 |
+
<small>
|
344 |
+
<?php
|
345 |
+
DUP_Util::_e('The root directory is where Duplicator starts archiving files. The excluded sections will be skipped during the archive process. ');
|
346 |
+
DUP_Util::_e('All results are stored in a json file. ');
|
347 |
+
?>
|
348 |
+
<a href="<?php echo DUPLICATOR_SITE_URL ?>/wp-admin/admin-ajax.php?action=duplicator_package_scan" target="dup_report"><?php DUP_Util::_e('[view json report]');?></a>
|
349 |
+
</small><br/>
|
350 |
+
</div>
|
351 |
+
</div>
|
352 |
+
<?php endif; ?>
|
353 |
+
</div><!-- end .dup-panel -->
|
354 |
+
<br/>
|
355 |
+
|
356 |
+
<!-- ================================================================
|
357 |
+
DATABASE
|
358 |
+
================================================================ -->
|
359 |
+
<div class="dup-panel-title">
|
360 |
+
<i class="fa fa-table"></i>
|
361 |
+
<?php DUP_Util::_e("Database"); ?>
|
362 |
+
<div id="data-db-size1"></div>
|
363 |
+
<div class="dup-scan-filter-status">
|
364 |
+
<?php
|
365 |
+
if ($Package->Database->FilterOn) {
|
366 |
+
echo '<i class="fa fa-filter"></i> '; DUP_Util::_e('Enabled');
|
367 |
+
}
|
368 |
+
?>
|
369 |
+
</div>
|
370 |
+
</div>
|
371 |
+
<div class="dup-panel-panel" id="dup-scan-db">
|
372 |
+
|
373 |
+
<!-- ============
|
374 |
+
TOTAL SIZE -->
|
375 |
+
<div>
|
376 |
+
<div class='dup-scan-title'>
|
377 |
+
<a><?php DUP_Util::_e('Total Size');?></a>
|
378 |
+
<div id="data-db-status-size1"></div>
|
379 |
+
</div>
|
380 |
+
<div class='dup-scan-info dup-info-box'>
|
381 |
+
<b><?php DUP_Util::_e('Tables');?>:</b> <span id="data-db-tablecount"></span> |
|
382 |
+
<b><?php DUP_Util::_e('Records');?>:</b> <span id="data-db-rows"></span> |
|
383 |
+
<b><?php DUP_Util::_e('Size');?>:</b> <span id="data-db-size2"></span> <br/><br/>
|
384 |
+
<?php
|
385 |
+
$lnk = '<a href="maint/repair.php" target="_blank">' . DUP_Util::__('repair and optimization') . '</a>';
|
386 |
+
printf(DUP_Util::__('Total size and row count for all database tables are approximate values. The thresholds that trigger warnings are %1$s and %2$s records. Large databases take time to process and can cause issues with server timeout and memory settings. Running a %3$s on your database can also help improve the overall size and performance. If your server supports shell_exec and mysqldump you can try to enable this option from the settings menu.'),
|
387 |
+
DUP_Util::ByteSize(DUPLICATOR_SCAN_DBSIZE),
|
388 |
+
number_format(DUPLICATOR_SCAN_DBROWS),
|
389 |
+
$lnk);
|
390 |
+
?>
|
391 |
+
</div>
|
392 |
+
</div>
|
393 |
+
|
394 |
+
<!-- ============
|
395 |
+
TABLE DETAILS -->
|
396 |
+
<div>
|
397 |
+
<div class='dup-scan-title'>
|
398 |
+
<a><?php DUP_Util::_e('Table Details');?></a>
|
399 |
+
<div id="data-db-status-size2"></div>
|
400 |
+
</div>
|
401 |
+
<div class='dup-scan-info dup-info-box'>
|
402 |
+
<div id="dup-scan-db-info">
|
403 |
+
<div id="data-db-tablelist"></div>
|
404 |
+
</div>
|
405 |
+
</div>
|
406 |
+
</div>
|
407 |
+
|
408 |
+
<table id="dup-scan-db-details">
|
409 |
+
<tr><td><b><?php DUP_Util::_e('Name:');?></b></td><td><?php echo DB_NAME ;?> </td></tr>
|
410 |
+
<tr><td><b><?php DUP_Util::_e('Host:');?></b></td><td><?php echo DB_HOST ;?> </td></tr>
|
411 |
+
<tr>
|
412 |
+
<td style="vertical-align: top"><b><?php DUP_Util::_e('Build Mode:');?></b></td>
|
413 |
+
<td style="line-height:18px">
|
414 |
+
<a href="?page=duplicator-settings" target="_blank"><?php echo $dbbuild_mode ;?></a>
|
415 |
+
<?php if ($mysqlcompat_on) :?>
|
416 |
+
<br/>
|
417 |
+
<small style="font-style:italic; color:maroon">
|
418 |
+
<i class="fa fa-exclamation-circle"></i> <?php DUP_Util::_e('MySQL Compatibility Mode Enabled'); ?>
|
419 |
+
<a href="https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_compatible" target="_blank">[<?php DUP_Util::_e('details'); ?>]</a>
|
420 |
+
</small>
|
421 |
+
<?php endif;?>
|
422 |
+
</td>
|
423 |
+
</tr>
|
424 |
+
</table>
|
425 |
+
|
426 |
+
</div><!-- end .dup-panel -->
|
427 |
+
</div><!-- end .dup-panel-panel -->
|
428 |
+
|
429 |
+
<!-- WARNING CONTINUE -->
|
430 |
+
<div id="dup-scan-warning-continue">
|
431 |
+
<div class="msg1">
|
432 |
+
<input type="checkbox" id="dup-scan-warning-continue-checkbox" onclick="Duplicator.Pack.WarningContinue(this)"/>
|
433 |
+
<label for="dup-scan-warning-continue-checkbox"><?php DUP_Util::_e('A warning status was detected, are you sure you want to continue?');?></label>
|
434 |
+
</div>
|
435 |
+
<div class="msg2">
|
436 |
+
<label for="dup-scan-warning-continue-checkbox">
|
437 |
+
<?php
|
438 |
+
DUP_Util::_e("Scan checks are not required to pass, however they could cause issues on some systems.");
|
439 |
+
echo '<br/>';
|
440 |
+
DUP_Util::_e("Please review the details for each warning by clicking on the detail link.");
|
441 |
+
?>
|
442 |
+
</label>
|
443 |
+
</div>
|
444 |
+
</div>
|
445 |
+
|
446 |
+
</div>
|
447 |
+
|
448 |
+
|
449 |
+
|
450 |
+
<!-- ERROR MESSAGE -->
|
451 |
+
<div id="dup-msg-error" style="display:none">
|
452 |
+
<div class="dup-hdr-error"><i class="fa fa-exclamation-circle"></i> <?php DUP_Util::_e('Scan Error'); ?></div>
|
453 |
+
<i><?php DUP_Util::_e('Please try again!'); ?></i><br/>
|
454 |
+
<div style="text-align:left">
|
455 |
+
<b><?php DUP_Util::_e("Server Status:"); ?></b>
|
456 |
+
<div id="dup-msg-error-response-status" style="display:inline-block"></div><br/>
|
457 |
+
|
458 |
+
<b><?php DUP_Util::_e("Error Message:"); ?></b>
|
459 |
+
<div id="dup-msg-error-response-text"></div>
|
460 |
+
</div>
|
461 |
+
</div>
|
462 |
+
</div> <!-- end #dup-progress-area -->
|
463 |
+
|
464 |
+
<div class="dup-button-footer" style="display:none">
|
465 |
+
<input type="button" value="◄ <?php DUP_Util::_e("Back") ?>" onclick="window.location.assign('?page=duplicator&tab=new1')" class="button button-large" />
|
466 |
+
<input type="button" value="<?php DUP_Util::_e("Rescan") ?>" onclick="Duplicator.Pack.Rescan()" class="button button-large" />
|
467 |
+
<input type="submit" value="<?php DUP_Util::_e("Build") ?> ►" class="button button-primary button-large" id="dup-build-button" />
|
468 |
+
<!-- Used for iMacros testing do not remove -->
|
469 |
+
<div id="dup-automation-imacros"></div>
|
470 |
+
</div>
|
471 |
+
</form>
|
472 |
+
|
473 |
+
<script type="text/javascript">
|
474 |
+
jQuery(document).ready(function($) {
|
475 |
+
|
476 |
+
/* Performs Ajax post to create check system */
|
477 |
+
Duplicator.Pack.Scan = function() {
|
478 |
+
var data = {action : 'duplicator_package_scan'}
|
479 |
+
|
480 |
+
$.ajax({
|
481 |
+
type: "POST",
|
482 |
+
url: ajaxurl,
|
483 |
+
dataType: "json",
|
484 |
+
timeout: 10000000,
|
485 |
+
data: data,
|
486 |
+
complete: function() {$('.dup-button-footer').show()},
|
487 |
+
success: function(data) {
|
488 |
+
Duplicator.Pack.LoadScanData(data)
|
489 |
+
//Imacros testing required
|
490 |
+
$('#dup-automation-imacros').html('<input type="hidden" id="dup-finished" value="done" />');
|
491 |
+
},
|
492 |
+
error: function(data) {
|
493 |
+
$('#dup-progress-bar-area').hide();
|
494 |
+
var status = data.status + ' -' + data.statusText;
|
495 |
+
$('#dup-msg-error-response-status').html(status)
|
496 |
+
$('#dup-msg-error-response-text').html(data.responseText);
|
497 |
+
$('#dup-msg-error').show(200);
|
498 |
+
console.log(data);
|
499 |
+
}
|
500 |
+
});
|
501 |
+
}
|
502 |
+
|
503 |
+
Duplicator.Pack.Rescan = function() {
|
504 |
+
$('#dup-msg-success,#dup-msg-error,.dup-button-footer').hide();
|
505 |
+
$('#dup-progress-bar-area').show();
|
506 |
+
Duplicator.Pack.Scan();
|
507 |
+
}
|
508 |
+
|
509 |
+
Duplicator.Pack.WarningContinue = function(checkbox) {
|
510 |
+
($(checkbox).is(':checked'))
|
511 |
+
? $('#dup-build-button').prop('disabled',false).addClass('button-primary')
|
512 |
+
: $('#dup-build-button').prop('disabled',true).removeClass('button-primary');
|
513 |
+
|
514 |
+
}
|
515 |
+
|
516 |
+
Duplicator.Pack.LoadScanStatus = function(status) {
|
517 |
+
var result;
|
518 |
+
switch (status) {
|
519 |
+
case false : result = '<div class="dup-scan-warn"><i class="fa fa-exclamation-triangle"></i></div>'; break;
|
520 |
+
case 'Warn' : result = '<div class="dup-scan-warn"><i class="fa fa-exclamation-triangle"></i> Warn</div>'; break;
|
521 |
+
case true : result = '<div class="dup-scan-good"><i class="fa fa-check"></i></div>'; break;
|
522 |
+
case 'Good' : result = '<div class="dup-scan-good"><i class="fa fa-check"></i> Good</div>'; break;
|
523 |
+
default :
|
524 |
+
result = 'unable to read';
|
525 |
+
}
|
526 |
+
return result;
|
527 |
+
}
|
528 |
+
|
529 |
+
/* Load Scan Data */
|
530 |
+
Duplicator.Pack.LoadScanData = function(data) {
|
531 |
+
|
532 |
+
var errMsg = "unable to read";
|
533 |
+
$('#dup-progress-bar-area').hide();
|
534 |
+
|
535 |
+
//****************
|
536 |
+
//REPORT
|
537 |
+
var base = $('#data-rpt-scanfile').attr('href');
|
538 |
+
$('#data-rpt-scanfile').attr('href', base + '&scanfile=' + data.RPT.ScanFile);
|
539 |
+
$('#data-rpt-scantime').text(data.RPT.ScanTime || 0);
|
540 |
+
|
541 |
+
|
542 |
+
//****************
|
543 |
+
//SERVER
|
544 |
+
$('#data-srv-web-model').html(Duplicator.Pack.LoadScanStatus(data.SRV.WEB.model));
|
545 |
+
$('#data-srv-web-all').html(Duplicator.Pack.LoadScanStatus(data.SRV.WEB.ALL));
|
546 |
+
|
547 |
+
$('#data-srv-php-openbase').html(Duplicator.Pack.LoadScanStatus(data.SRV.PHP.openbase));
|
548 |
+
$('#data-srv-php-maxtime').html(Duplicator.Pack.LoadScanStatus(data.SRV.PHP.maxtime));
|
549 |
+
$('#data-srv-php-mysqli').html(Duplicator.Pack.LoadScanStatus(data.SRV.PHP.mysqli));
|
550 |
+
$('#data-srv-php-openssl').html(Duplicator.Pack.LoadScanStatus(data.SRV.PHP.openssl));
|
551 |
+
$('#data-srv-php-all').html(Duplicator.Pack.LoadScanStatus(data.SRV.PHP.ALL));
|
552 |
+
|
553 |
+
$('#data-srv-wp-version').html(Duplicator.Pack.LoadScanStatus(data.SRV.WP.version));
|
554 |
+
$('#data-srv-wp-core').html(Duplicator.Pack.LoadScanStatus(data.SRV.WP.core));
|
555 |
+
$('#data-srv-wp-cache').html(Duplicator.Pack.LoadScanStatus(data.SRV.WP.cache));
|
556 |
+
$('#data-srv-wp-all').html(Duplicator.Pack.LoadScanStatus(data.SRV.WP.ALL));
|
557 |
+
|
558 |
+
//****************
|
559 |
+
//DATABASE
|
560 |
+
var html = "";
|
561 |
+
if (data.DB.Status.Success) {
|
562 |
+
$('#data-db-status-size1').html(Duplicator.Pack.LoadScanStatus(data.DB.Status.Size));
|
563 |
+
$('#data-db-status-size2').html(Duplicator.Pack.LoadScanStatus(data.DB.Status.Size));
|
564 |
+
$('#data-db-size1').text(data.DB.Size || errMsg);
|
565 |
+
$('#data-db-size2').text(data.DB.Size || errMsg);
|
566 |
+
$('#data-db-rows').text(data.DB.Rows || errMsg);
|
567 |
+
$('#data-db-tablecount').text(data.DB.TableCount || errMsg);
|
568 |
+
//Table Details
|
569 |
+
if (data.DB.TableList == undefined || data.DB.TableList.length == 0) {
|
570 |
+
html = '<?php DUP_Util::_e("Unable to report on any tables") ?>';
|
571 |
+
} else {
|
572 |
+
$.each(data.DB.TableList, function(i) {
|
573 |
+
html += '<b>' + i + '</b><br/>';
|
574 |
+
$.each(data.DB.TableList[i], function(key,val) {html += '<div><span>' + key + ':</span>' + val + '</div>'; })
|
575 |
+
});
|
576 |
+
}
|
577 |
+
$('#data-db-tablelist').append(html);
|
578 |
+
} else {
|
579 |
+
html = '<?php DUP_Util::_e("Unable to report on database stats") ?>';
|
580 |
+
$('#dup-scan-db').html(html);
|
581 |
+
}
|
582 |
+
|
583 |
+
//****************
|
584 |
+
//ARCHIVE
|
585 |
+
$('#data-arc-status-size').html(Duplicator.Pack.LoadScanStatus(data.ARC.Status.Size));
|
586 |
+
$('#data-arc-status-names').html(Duplicator.Pack.LoadScanStatus(data.ARC.Status.Names));
|
587 |
+
$('#data-arc-status-big').html(Duplicator.Pack.LoadScanStatus(data.ARC.Status.Big));
|
588 |
+
$('#data-arc-size1').text(data.ARC.Size || errMsg);
|
589 |
+
$('#data-arc-size2').text(data.ARC.Size || errMsg);
|
590 |
+
$('#data-arc-files').text(data.ARC.FileCount || errMsg);
|
591 |
+
$('#data-arc-dirs').text(data.ARC.DirCount || errMsg);
|
592 |
+
|
593 |
+
|
594 |
+
|
595 |
+
//Name Checks
|
596 |
+
html = '';
|
597 |
+
//Dirs
|
598 |
+
if (data.ARC.FilterInfo.Dirs.Warning !== undefined && data.ARC.FilterInfo.Dirs.Warning.length > 0) {
|
599 |
+
$.each(data.ARC.FilterInfo.Dirs.Warning, function (key, val) {
|
600 |
+
html += '<?php DUP_Util::_e("DIR") ?> ' + key + ':<br/>[' + val + ']<br/>';
|
601 |
+
});
|
602 |
+
}
|
603 |
+
//Files
|
604 |
+
if (data.ARC.FilterInfo.Files.Warning !== undefined && data.ARC.FilterInfo.Files.Warning.length > 0) {
|
605 |
+
$.each(data.ARC.FilterInfo.Files.Warning, function (key, val) {
|
606 |
+
html += '<?php DUP_Util::_e("FILE") ?> ' + key + ':<br/>[' + val + ']<br/>';
|
607 |
+
});
|
608 |
+
}
|
609 |
+
html = (html.length == 0) ? '<?php DUP_Util::_e("No name warning issues found.") ?>' : html;
|
610 |
+
|
611 |
+
|
612 |
+
$('#data-arc-names-data').html(html);
|
613 |
+
|
614 |
+
//Large Files
|
615 |
+
html = '<?php DUP_Util::_e("No large files found.") ?>';
|
616 |
+
if (data.ARC.FilterInfo.Files.Size !== undefined && data.ARC.FilterInfo.Files.Size.length > 0) {
|
617 |
+
html = '';
|
618 |
+
$.each(data.ARC.FilterInfo.Files.Size, function (key, val) {
|
619 |
+
html += '<?php DUP_Util::_e("FILE") ?> ' + key + ':<br/>' + val + '<br/>';
|
620 |
+
});
|
621 |
+
}
|
622 |
+
$('#data-arc-big-data').html(html);
|
623 |
+
$('#dup-msg-success').show();
|
624 |
+
|
625 |
+
//Waring Check
|
626 |
+
var warnCount = data.RPT.Warnings || 0;
|
627 |
+
if (warnCount > 0) {
|
628 |
+
$('#dup-scan-warning-continue').show();
|
629 |
+
$('#dup-build-button').prop("disabled",true).removeClass('button-primary');
|
630 |
+
} else {
|
631 |
+
$('#dup-scan-warning-continue').hide();
|
632 |
+
$('#dup-build-button').prop("disabled",false).addClass('button-primary');
|
633 |
+
}
|
634 |
+
|
635 |
+
}
|
636 |
+
|
637 |
+
//Page Init:
|
638 |
+
Duplicator.UI.AnimateProgressBar('dup-progress-bar');
|
639 |
+
Duplicator.Pack.Scan();
|
640 |
+
|
641 |
+
//Init: Toogle for system requirment detial links
|
642 |
+
$('.dup-scan-title a').each(function() {
|
643 |
+
$(this).attr('href', 'javascript:void(0)');
|
644 |
+
$(this).click({selector : '.dup-scan-info'}, Duplicator.Pack.ToggleSystemDetails);
|
645 |
+
$(this).prepend("<span class='ui-icon ui-icon-triangle-1-e dup-toggle' />");
|
646 |
+
});
|
647 |
+
|
648 |
+
});
|
649 |
</script>
|
views/packages/main/new3.base.php
CHANGED
@@ -1,205 +1,204 @@
|
|
1 |
-
<?php
|
2 |
-
require_once (DUPLICATOR_PLUGIN_PATH . 'classes/package.php');
|
3 |
-
$Package = DUP_Package::GetActive();
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
div
|
11 |
-
div
|
12 |
-
div#dup-progress-area
|
13 |
-
div#dup-progress-area
|
14 |
-
div#dup-
|
15 |
-
div#dup-msg-success
|
16 |
-
div#dup-msg-
|
17 |
-
div
|
18 |
-
div.dup-msg-
|
19 |
-
div.dup-msg-success-
|
20 |
-
div
|
21 |
-
div#dup-
|
22 |
-
div#dup-
|
23 |
-
div#dup-logs {text-
|
24 |
-
div
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
<
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
<div class="completed-step"><a><span>
|
38 |
-
<div class="
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
<
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
<div
|
60 |
-
<
|
61 |
-
<
|
62 |
-
<i><?php _e('
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
<div class="dup-panel-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
<b><?php _e('
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
<
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
<
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
<
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
<
|
113 |
-
|
114 |
-
|
115 |
-
<span class="
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
<span class="
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
<
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
*
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
$('#dup-progress-
|
170 |
-
|
171 |
-
|
172 |
-
var Pack =
|
173 |
-
var
|
174 |
-
|
175 |
-
|
176 |
-
$('#
|
177 |
-
$('#data-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
$('#dup-btn-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
$('#dup-progress-
|
189 |
-
|
190 |
-
var
|
191 |
-
|
192 |
-
$('#dup-msg-error-response-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
Duplicator.
|
202 |
-
|
203 |
-
|
204 |
-
});
|
205 |
</script>
|
1 |
+
<?php
|
2 |
+
require_once (DUPLICATOR_PLUGIN_PATH . 'classes/package.php');
|
3 |
+
$Package = DUP_Package::GetActive();
|
4 |
+
$ajax_nonce = wp_create_nonce('dup_package_build');
|
5 |
+
|
6 |
+
?>
|
7 |
+
|
8 |
+
<style>
|
9 |
+
div#dup-progress-area {text-align:center; max-width:800px; min-height:200px; border:1px solid silver; border-radius:5px; margin:25px auto 10px auto; padding:0px; box-shadow: 0 8px 6px -6px #999;}
|
10 |
+
div.dup-progress-title {font-size:22px;padding:5px 0 20px 0; font-weight: bold}
|
11 |
+
div#dup-progress-area div.inner {padding:10px; line-height:22px}
|
12 |
+
div#dup-progress-area h2.title {background-color:#efefef; margin:0px}
|
13 |
+
div#dup-progress-area span.label {font-weight:bold}
|
14 |
+
div#dup-msg-success {color:#18592A; padding:5px;}
|
15 |
+
div#dup-msg-success fieldset,
|
16 |
+
div#dup-msg-error fieldset {text-align:left; width:95%; border:1px solid #dfdfdf; border-radius:5px;}
|
17 |
+
div.dup-msg-error-area {overflow-y: scroll; padding:5px 15px 5px 15px; max-height:150px; max-width: 700px}
|
18 |
+
div.dup-msg-success-stats{color:#999;margin:10px 0px 0px 0px}
|
19 |
+
div.dup-msg-success-links {margin:20px 5px 5px 5px; font-size: 14px; font-weight: bold}
|
20 |
+
div#dup-msg-error {color:#A62426; padding:5px;}
|
21 |
+
div#dup-progress-area div.done-title {font-size:22px; font-weight:bold; margin:0px 0px 10px 0px}
|
22 |
+
div#dup-logs {text-align:center; margin:auto; padding:5px; width:350px;}
|
23 |
+
div#dup-logs a {font-size:15px; text-decoration:none !important; display:inline-block; margin:20px 0px 5px 0px}
|
24 |
+
div.dup-button-footer {text-align:right; margin:20px 10px 0px 0px}
|
25 |
+
button.button {font-size:16px !important; height:30px !important; font-weight:bold; padding:0px 10px 5px 10px !important; min-width: 150px }
|
26 |
+
span.dup-btn-size {font-size:11px;font-weight: normal}
|
27 |
+
</style>
|
28 |
+
|
29 |
+
<!-- =========================================
|
30 |
+
TOOL BAR: STEPS -->
|
31 |
+
<table id="dup-toolbar">
|
32 |
+
<tr valign="top">
|
33 |
+
<td style="white-space: nowrap">
|
34 |
+
<div id="dup-wiz">
|
35 |
+
<div id="dup-wiz-steps">
|
36 |
+
<div class="completed-step"><a><span>1</span> <?php _e('Setup', 'duplicator'); ?></a></div>
|
37 |
+
<div class="completed-step"><a><span>2</span> <?php _e('Scan', 'duplicator'); ?> </a></div>
|
38 |
+
<div class="active-step"><a><span>3</span> <?php _e('Build', 'duplicator'); ?> </a></div>
|
39 |
+
</div>
|
40 |
+
<div id="dup-wiz-title">
|
41 |
+
<?php _e('Step 3: Build Package', 'duplicator'); ?>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
</td>
|
45 |
+
<td class="dup-toolbar-btns">
|
46 |
+
<a id="dup-pro-create-new" href="?page=duplicator" class="add-new-h2"><i class="fa fa-archive"></i> <?php _e("All Packages", 'duplicator'); ?></a>
|
47 |
+
<span> <?php _e("Create New", 'duplicator'); ?></span>
|
48 |
+
</td>
|
49 |
+
</tr>
|
50 |
+
</table>
|
51 |
+
<hr style="margin-bottom:10px">
|
52 |
+
|
53 |
+
|
54 |
+
<form id="form-duplicator" method="post" action="?page=duplicator">
|
55 |
+
|
56 |
+
<!-- PROGRESS BAR -->
|
57 |
+
<div id="dup-progress-bar-area">
|
58 |
+
<div class="dup-progress-title"><i class="fa fa-cog fa-spin"></i> <?php _e('Building Package', 'duplicator'); ?></div>
|
59 |
+
<div id="dup-progress-bar"></div>
|
60 |
+
<b><?php _e('Please Wait...', 'duplicator'); ?></b><br/><br/>
|
61 |
+
<i><?php _e('Keep this window open during the build process.', 'duplicator'); ?></i><br/>
|
62 |
+
<i><?php _e('This may take several minutes.', 'duplicator'); ?></i><br/>
|
63 |
+
</div>
|
64 |
+
|
65 |
+
<div id="dup-progress-area" class="dup-panel" style="display:none">
|
66 |
+
<div class="dup-panel-title dup-box-title-fancy"><b style="font-size:18px"><?php _e('Build Status', 'duplicator'); ?></b></div>
|
67 |
+
<div class="dup-panel-panel">
|
68 |
+
|
69 |
+
<!-- =========================
|
70 |
+
SUCCESS MESSAGE -->
|
71 |
+
<div id="dup-msg-success" style="display:none">
|
72 |
+
<div class="dup-hdr-success">
|
73 |
+
<i class="fa fa-check-square-o fa-lg"></i> <?php _e('Package Completed', 'duplicator'); ?>
|
74 |
+
</div>
|
75 |
+
|
76 |
+
<div class="dup-msg-success-stats">
|
77 |
+
<b><?php _e('Name', 'duplicator'); ?>:</b> <span id="data-name-hash"></span><br/>
|
78 |
+
<b><?php _e('Process Time', 'duplicator'); ?>:</b> <span id="data-time"></span><br/>
|
79 |
+
</div><br/>
|
80 |
+
|
81 |
+
<button id="dup-btn-installer" class="button button-primary button-large">
|
82 |
+
<i class="fa fa-bolt"></i> <?php _e("Installer", 'duplicator') ?>
|
83 |
+
<span id="dup-btn-installer-size" class="dup-btn-size"></span>
|
84 |
+
</button>
|
85 |
+
<button id="dup-btn-archive" class="button button-primary button-large">
|
86 |
+
<i class="fa fa-file-archive-o"></i> <?php _e("Archive", 'duplicator') ?>
|
87 |
+
<span id="dup-btn-archive-size" class="dup-btn-size"></span>
|
88 |
+
</button>
|
89 |
+
<div style='margin: 7px 0 20px 0'>
|
90 |
+
<small><i><?php _e("click buttons to download", 'duplicator') ?></i></small>
|
91 |
+
</div>
|
92 |
+
<div class="dup-msg-success-links">
|
93 |
+
<?php printf("<a href='?page=duplicator'>[ %s ]</a>", __('All Packages', 'duplicator'));?>
|
94 |
+
</div><br/>
|
95 |
+
|
96 |
+
<!-- Used for iMacros testing do not remove -->
|
97 |
+
<div id="dup-automation-imacros"></div>
|
98 |
+
</div>
|
99 |
+
|
100 |
+
<!-- =========================
|
101 |
+
ERROR MESSAGE -->
|
102 |
+
<div id="dup-msg-error" style="display:none">
|
103 |
+
<div class="done-title"><i class="fa fa-chain-broken"></i> <?php _e('Build Interrupt', 'duplicator'); ?></div>
|
104 |
+
<b><?php _e('The current build has experienced an issue.', 'duplicator'); ?></b><br/>
|
105 |
+
|
106 |
+
<i><?php _e('Please try the process again.', 'duplicator'); ?></i><br/><br/>
|
107 |
+
|
108 |
+
<input type="button" style="margin-right:10px;" class="button" value="<?php _e('Diagnose', 'duplicator'); ?>" onclick="window.open('http://lifeinthegrid.com/support/knowledgebase.php?article=12#faq-trouble-timeout', '_blank');return false;" />
|
109 |
+
<input type="button" class="button" value="<?php _e('Try Again', 'duplicator'); ?>" onclick="window.location = 'admin.php?page=duplicator&tab=new1'" />
|
110 |
+
<fieldset>
|
111 |
+
<legend><b><i class="fa fa-exclamation"></i> <?php _e('Details', 'duplicator'); ?></b></legend>
|
112 |
+
<div class="dup-msg-error-area">
|
113 |
+
<div id="dup-msg-error-response-status">
|
114 |
+
<span class="label"><?php _e("Server Status:", 'duplicator'); ?></span>
|
115 |
+
<span class="data"></span>
|
116 |
+
</div>
|
117 |
+
<div id="dup-msg-error-response-text">
|
118 |
+
<span class="label"><?php _e("Error Message:", 'duplicator'); ?></span><br/>
|
119 |
+
<span class="data"></span>
|
120 |
+
</div>
|
121 |
+
</div>
|
122 |
+
</fieldset><br/>
|
123 |
+
|
124 |
+
<fieldset style="color:#777">
|
125 |
+
<legend><b> <?php _e('Notice', 'duplicator'); ?></b></legend>
|
126 |
+
<div class="dup-msg-error-area">
|
127 |
+
<?php printf('<b><i class="fa fa-folder-o"></i> %s %s</b> <br/> %s',
|
128 |
+
__('Build Folder:'),
|
129 |
+
DUPLICATOR_SSDIR_PATH_TMP,
|
130 |
+
__("Some servers close connections quickly; yet the build can continue to run in the background. To validate if a build is still running; open the 'tmp' folder above and see if the archive file is growing in size. If it is not then your server has strict timeout constraints. Please visit the support page for additional resources.", 'duplicator')
|
131 |
+
);
|
132 |
+
?> <br/>
|
133 |
+
</div>
|
134 |
+
</fieldset>
|
135 |
+
|
136 |
+
<!-- LOGS -->
|
137 |
+
<div id="dup-logs">
|
138 |
+
<div style="font-weight:bold">
|
139 |
+
<i class="fa fa-list-alt"></i> <a href='javascript:void(0)' style="color:#A62426" onclick='Duplicator.OpenLogWindow()'> <?php _e('Package Log', 'duplicator');?> </a>
|
140 |
+
</div>
|
141 |
+
<br/>
|
142 |
+
</div>
|
143 |
+
|
144 |
+
</div>
|
145 |
+
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
</form>
|
149 |
+
|
150 |
+
<script type="text/javascript">
|
151 |
+
jQuery(document).ready(function($) {
|
152 |
+
/* ----------------------------------------
|
153 |
+
* METHOD: Performs Ajax post to create a new package
|
154 |
+
* Timeout (10000000 = 166 minutes) */
|
155 |
+
Duplicator.Pack.Create = function() {
|
156 |
+
|
157 |
+
var data = {action : 'duplicator_package_build', nonce: '<?php echo $ajax_nonce; ?>'}
|
158 |
+
|
159 |
+
$.ajax({
|
160 |
+
type: "POST",
|
161 |
+
url: ajaxurl,
|
162 |
+
dataType: "json",
|
163 |
+
timeout: 10000000,
|
164 |
+
data: data,
|
165 |
+
beforeSend: function() {},
|
166 |
+
complete: function() {},
|
167 |
+
success: function(data) {
|
168 |
+
$('#dup-progress-bar-area').hide();
|
169 |
+
$('#dup-progress-area, #dup-msg-success').show(300);
|
170 |
+
|
171 |
+
var Pack = data.Package;
|
172 |
+
var InstallURL = Pack.StoreURL + Pack.Installer.File + "?get=1&file=" + Pack.Installer.File;
|
173 |
+
var ArchiveURL = Pack.StoreURL + Pack.Archive.File + "?get=1";
|
174 |
+
|
175 |
+
$('#dup-btn-archive-size').append(' (' + data.ZipSize + ')')
|
176 |
+
$('#data-name-hash').text(Pack.NameHash || 'error read');
|
177 |
+
$('#data-time').text(data.Runtime || 'unable to read time');
|
178 |
+
|
179 |
+
//Wire Up Downloads
|
180 |
+
$('#dup-btn-installer').on("click", {name: InstallURL }, Duplicator.Pack.DownloadFile );
|
181 |
+
$('#dup-btn-archive').on("click", {name: ArchiveURL }, Duplicator.Pack.DownloadFile );
|
182 |
+
//Imacros testing required
|
183 |
+
$('#dup-automation-imacros').html('<input type="hidden" id="dup-finished" value="done" />');
|
184 |
+
|
185 |
+
},
|
186 |
+
error: function(data) {
|
187 |
+
$('#dup-progress-bar-area').hide();
|
188 |
+
$('#dup-progress-area, #dup-msg-error').show(200);
|
189 |
+
var status = data.status + ' -' + data.statusText;
|
190 |
+
var response = (data.responseText != undefined && data.responseText.length > 1) ? data.responseText : 'Unknown Error - See Log File';
|
191 |
+
$('#dup-msg-error-response-status span.data').html(status)
|
192 |
+
$('#dup-msg-error-response-text span.data').html(response);
|
193 |
+
console.log(data);
|
194 |
+
}
|
195 |
+
});
|
196 |
+
return false;
|
197 |
+
}
|
198 |
+
|
199 |
+
//Page Init:
|
200 |
+
Duplicator.UI.AnimateProgressBar('dup-progress-bar');
|
201 |
+
Duplicator.Pack.Create();
|
202 |
+
|
203 |
+
});
|
|
|
204 |
</script>
|