Duplicator – WordPress Migration Plugin - Version 0.5.28

Version Description

Download this release

Release Info

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

Code changes from version 0.5.26 to 0.5.28

Files changed (4) hide show
  1. define.php +1 -1
  2. duplicator.php +1 -1
  3. readme.txt +3 -3
  4. views/tools/logging.php +197 -196
define.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  //Prevent directly browsing to the file
3
  if (function_exists('plugin_dir_url')) {
4
- define('DUPLICATOR_VERSION', '0.5.26');
5
  define("DUPLICATOR_HOMEPAGE", "http://lifeinthegrid.com/labs/duplicator");
6
  define("DUPLICATOR_GIVELINK", "http://lifeinthegrid.com/partner");
7
  define("DUPLICATOR_HELPLINK", "http://lifeinthegrid.com/duplicator-docs");
1
  <?php
2
  //Prevent directly browsing to the file
3
  if (function_exists('plugin_dir_url')) {
4
+ define('DUPLICATOR_VERSION', '0.5.28');
5
  define("DUPLICATOR_HOMEPAGE", "http://lifeinthegrid.com/labs/duplicator");
6
  define("DUPLICATOR_GIVELINK", "http://lifeinthegrid.com/partner");
7
  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: 0.5.26
7
  Author: LifeInTheGrid
8
  Author URI: http://www.lifeinthegrid.com
9
  Text Domain: wpduplicator
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: 0.5.28
7
  Author: LifeInTheGrid
8
  Author URI: http://www.lifeinthegrid.com
9
  Text Domain: wpduplicator
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  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.8
6
- Tested up to: 4.2
7
- Stable tag: 0.5.26
8
  License: GPLv2
9
 
10
  Duplicate, clone, backup, move and transfer an entire site from one location to another.
2
  Contributors: corylamleorg, bobriley
3
  Donate link: www.lifeinthegrid.com/partner
4
  Tags: backup, restore, move, migrate, localhost, synchronize, duplicate, clone, automate, niche
5
+ Requires at least: 3.9
6
+ Tested up to: 4.3
7
+ Stable tag: 0.5.28
8
  License: GPLv2
9
 
10
  Duplicate, clone, backup, move and transfer an entire site from one location to another.
views/tools/logging.php CHANGED
@@ -1,197 +1,198 @@
1
- <?php
2
-
3
- require_once(DUPLICATOR_PLUGIN_PATH . '/views/javascript.php');
4
- require_once(DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php');
5
-
6
- $logs = glob(DUPLICATOR_SSDIR_PATH . '/*.log') ;
7
- if ($logs != false && count($logs)) {
8
- usort($logs, create_function('$a,$b', 'return filemtime($b) - filemtime($a);'));
9
- @chmod(DUP_Util::SafePath($logs[0]), 0644);
10
- }
11
-
12
- $logname = (isset($_GET['logname'])) ? trim($_GET['logname']) : "";
13
- $refresh = (isset($_POST['refresh']) && $_POST['refresh'] == 1) ? 1 : 0;
14
- $auto = (isset($_POST['auto']) && $_POST['auto'] == 1) ? 1 : 0;
15
-
16
- //Check for invalid file
17
- if (isset($_GET['logname'])) {
18
- $validFiles = array_map('basename', $logs);
19
- if (validate_file($logname, $validFiles) > 0) {
20
- unset($logname);
21
- }
22
- unset($validFiles);
23
- }
24
-
25
- if (!isset($logname) || !$logname) {
26
- $logname = (count($logs) > 0) ? basename($logs[0]) : "";
27
- }
28
-
29
- $logurl = get_site_url(null, '', is_ssl() ? 'https' : 'http') . '/' . DUPLICATOR_SSDIR_NAME . '/' . $logname;
30
- $logfound = (strlen($logname) > 0) ? true :false;
31
-
32
- ?>
33
-
34
- <style>
35
- div#dup-refresh-count {display: inline-block}
36
- table#dup-log-panels {width:100%; }
37
- td#dup-log-panel-left {width:75%;}
38
- td#dup-log-panel-left div.name {float:left; margin: 0px 0px 5px 5px; font-weight: bold}
39
- td#dup-log-panel-left div.opts {float:right;}
40
- td#dup-log-panel-right {vertical-align: top; padding-left:15px; max-width: 375px}
41
- div.dup-log-file-list a, span{display: inline-block; white-space: nowrap; text-overflow: ellipsis; max-width: 375px; line-height:20px; overflow:hidden}
42
- div.dup-log-file-list span {font-weight: bold}
43
- div.dup-opts-items {border:1px solid silver; background: #efefef; padding: 5px; border-radius: 4px; margin:2px 0px 10px -2px;}
44
- label#dup-auto-refresh-lbl {display: inline-block;}
45
- iframe#dup-log-content {padding:5px; background: #fff; min-height:500px; width:99%; border:1px solid silver}
46
- </style>
47
-
48
- <script type="text/javascript">
49
- jQuery(document).ready(function($) {
50
-
51
- Duplicator.Tools.FullLog = function() {
52
- var $panelL = $('#dup-log-panel-left');
53
- var $panelR = $('#dup-log-panel-right');
54
-
55
- if ($panelR.is(":visible") ) {
56
- $panelR.hide(400);
57
- $panelL.css({width: '100%'});
58
- } else {
59
- $panelR.show(200);
60
- $panelL.css({width: '75%'});
61
- }
62
- }
63
-
64
- Duplicator.Tools.Refresh = function() {
65
- $('#refresh').val(1);
66
- $('#dup-form-logs').submit();
67
- }
68
-
69
- Duplicator.Tools.RefreshAuto = function() {
70
- if ( $("#dup-auto-refresh").is(":checked")) {
71
- $('#auto').val(1);
72
- startTimer();
73
- } else {
74
- $('#auto').val(0);
75
- }
76
- }
77
-
78
- Duplicator.Tools.GetLog = function(log) {
79
- window.location = log;
80
- }
81
-
82
- Duplicator.Tools.WinResize = function() {
83
- var height = $(window).height() - 170;
84
- $("#dup-log-content").css({height: height + 'px'});
85
- }
86
-
87
-
88
- var duration = 10;
89
- var count = duration;
90
- var timerInterval;
91
- function timer() {
92
- count = count - 1;
93
- $("#dup-refresh-count").html(count.toString());
94
- if (! $("#dup-auto-refresh").is(":checked")) {
95
- clearInterval(timerInterval);
96
- $("#dup-refresh-count").text(count.toString().trim());
97
- return;
98
- }
99
-
100
- if (count <= 0) {
101
- count = duration + 1;
102
- Duplicator.Tools.Refresh();
103
- }
104
- }
105
-
106
- function startTimer() {
107
- timerInterval = setInterval(timer, 1000);
108
- }
109
-
110
- //INIT Events
111
- $(window).resize(Duplicator.Tools.WinResize);
112
- $('#dup-options').click(Duplicator.Tools.FullLog);
113
- $("#dup-refresh").click(Duplicator.Tools.Refresh);
114
- $("#dup-auto-refresh").click(Duplicator.Tools.RefreshAuto);
115
- $("#dup-refresh-count").html(duration.toString());
116
-
117
- //INIT
118
- Duplicator.Tools.WinResize();
119
- <?php if ($refresh) : ?>
120
- //Scroll to Bottom
121
- $("#dup-log-content").load(function () {
122
- var $contents = $('#dup-log-content').contents();
123
- $contents.scrollTop($contents.height());
124
- });
125
- <?php if ($auto) : ?>
126
- $("#dup-auto-refresh").prop('checked', true);
127
- Duplicator.Tools.RefreshAuto();
128
- <?php endif; ?>
129
- <?php endif; ?>
130
-
131
- });
132
-
133
- </script>
134
-
135
- <form id="dup-form-logs" method="post" action="">
136
- <input type="hidden" id="refresh" name="refresh" value="<?php echo ($refresh) ? 1 : 0 ?>" />
137
- <input type="hidden" id="auto" name="auto" value="<?php echo ($auto) ? 1 : 0 ?>" />
138
- <?php if (! $logfound) : ?>
139
- <div style="padding:20px">
140
- <h2><?php _e("Log file not found or unreadable", 'wpduplicator') ?>.</h2>
141
-
142
- <?php _e("Try to create a package, since no log files were found in the snapshots directory with the extension *.log", 'wpduplicator') ?>.<br/><br/>
143
-
144
- <?php _e("Reasons for log file not showing", 'wpduplicator') ?>: <br/>
145
- - <?php _e("The web server does not support returning .log file extentions", 'wpduplicator') ?>. <br/>
146
- - <?php _e("The snapshots directory does not have the correct permissions to write files. Try setting the permissions to 755", 'wpduplicator') ?>. <br/>
147
- - <?php _e("The process that PHP runs under does not have enough permissions to create files. Please contact your hosting provider for more details", 'wpduplicator') ?>. <br/>
148
- </div>
149
-
150
- <?php else: ?>
151
-
152
- <table id="dup-log-panels">
153
- <tr>
154
- <td id="dup-log-panel-left">
155
- <div class="name"><i class='fa fa-list-alt'></i> <?php echo basename($logurl); ?></div>
156
- <div class="opts"><a href="javascript:void(0)" id="dup-options"><?php _e("Options", 'wpduplicator') ?> <i class="fa fa-angle-double-right"></i></a> &nbsp;</div>
157
- <br style="clear:both" />
158
- <iframe id="dup-log-content" src="<?php echo $logurl ?>" ></iframe>
159
- </td>
160
- <td id="dup-log-panel-right">
161
- <h2><?php _e("Options", 'wpduplicator') ?> </h2>
162
- <div class="dup-opts-items">
163
- <input type="button" class="button" id="dup-refresh" value="<?php _e("Refresh", 'wpduplicator') ?>" /> &nbsp;
164
- <div style="display:inline-block; margin-top:5px">
165
- <input type='checkbox' id="dup-auto-refresh" style="margin-top:1px" />
166
- <label id="dup-auto-refresh-lbl" for="dup-auto-refresh">
167
-
168
- <?php _e("Auto Refresh", 'wpduplicator') ?>
169
- [<div id="dup-refresh-count"></div>]
170
- </label>
171
- </div>
172
- </div>
173
-
174
- <b><?php _e("Last 20 Logs", 'wpduplicator') ?> </b><br/>
175
-
176
- <div class="dup-log-file-list">
177
- <?php
178
- $count=0;
179
- $active = basename($logurl);
180
- foreach ($logs as $log) {
181
- $time = date('h:i:s m/d/y', filemtime($log));
182
- $name = esc_html(basename($log));
183
- $url = '?page=duplicator-tools&logname=' . $name;
184
- echo ($active == $name)
185
- ? "<span title='{$name}'>{$time} - {$name}</span><br/>"
186
- : "<a href='javascript:void(0)' title='{$name}' onclick='Duplicator.Tools.GetLog(\"{$url}\")'>{$time} - {$name}</a><br/>";
187
- if ($count > 20) break;
188
- }
189
- ?>
190
- </div>
191
- </td>
192
- </tr>
193
- </table>
194
-
195
- <?php endif; ?>
196
- </form>
 
197
 
1
+ <?php
2
+
3
+ require_once(DUPLICATOR_PLUGIN_PATH . '/views/javascript.php');
4
+ require_once(DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php');
5
+
6
+ $logs = glob(DUPLICATOR_SSDIR_PATH . '/*.log') ;
7
+ if ($logs != false && count($logs)) {
8
+ usort($logs, create_function('$a,$b', 'return filemtime($b) - filemtime($a);'));
9
+ @chmod(DUP_Util::SafePath($logs[0]), 0644);
10
+ }
11
+
12
+ $logname = (isset($_GET['logname'])) ? trim(sanitize_text_field($_GET['logname'])) : "";
13
+
14
+ $refresh = (isset($_POST['refresh']) && $_POST['refresh'] == 1) ? 1 : 0;
15
+ $auto = (isset($_POST['auto']) && $_POST['auto'] == 1) ? 1 : 0;
16
+
17
+ //Check for invalid file
18
+ if (!empty($logname)) {
19
+ $validFiles = array_map('basename', $logs);
20
+ if (validate_file($logname, $validFiles) > 0) {
21
+ unset($logname);
22
+ }
23
+ unset($validFiles);
24
+ }
25
+
26
+ if (!isset($logname) || !$logname) {
27
+ $logname = (count($logs) > 0) ? basename($logs[0]) : "";
28
+ }
29
+
30
+ $logurl = get_site_url(null, '', is_ssl() ? 'https' : 'http') . '/' . DUPLICATOR_SSDIR_NAME . '/' . $logname;
31
+ $logfound = (strlen($logname) > 0) ? true :false;
32
+
33
+ ?>
34
+
35
+ <style>
36
+ div#dup-refresh-count {display: inline-block}
37
+ table#dup-log-panels {width:100%; }
38
+ td#dup-log-panel-left {width:75%;}
39
+ td#dup-log-panel-left div.name {float:left; margin: 0px 0px 5px 5px; font-weight: bold}
40
+ td#dup-log-panel-left div.opts {float:right;}
41
+ td#dup-log-panel-right {vertical-align: top; padding-left:15px; max-width: 375px}
42
+ div.dup-log-file-list a, span{display: inline-block; white-space: nowrap; text-overflow: ellipsis; max-width: 375px; line-height:20px; overflow:hidden}
43
+ div.dup-log-file-list span {font-weight: bold}
44
+ div.dup-opts-items {border:1px solid silver; background: #efefef; padding: 5px; border-radius: 4px; margin:2px 0px 10px -2px;}
45
+ label#dup-auto-refresh-lbl {display: inline-block;}
46
+ iframe#dup-log-content {padding:5px; background: #fff; min-height:500px; width:99%; border:1px solid silver}
47
+ </style>
48
+
49
+ <script type="text/javascript">
50
+ jQuery(document).ready(function($) {
51
+
52
+ Duplicator.Tools.FullLog = function() {
53
+ var $panelL = $('#dup-log-panel-left');
54
+ var $panelR = $('#dup-log-panel-right');
55
+
56
+ if ($panelR.is(":visible") ) {
57
+ $panelR.hide(400);
58
+ $panelL.css({width: '100%'});
59
+ } else {
60
+ $panelR.show(200);
61
+ $panelL.css({width: '75%'});
62
+ }
63
+ }
64
+
65
+ Duplicator.Tools.Refresh = function() {
66
+ $('#refresh').val(1);
67
+ $('#dup-form-logs').submit();
68
+ }
69
+
70
+ Duplicator.Tools.RefreshAuto = function() {
71
+ if ( $("#dup-auto-refresh").is(":checked")) {
72
+ $('#auto').val(1);
73
+ startTimer();
74
+ } else {
75
+ $('#auto').val(0);
76
+ }
77
+ }
78
+
79
+ Duplicator.Tools.GetLog = function(log) {
80
+ window.location = log;
81
+ }
82
+
83
+ Duplicator.Tools.WinResize = function() {
84
+ var height = $(window).height() - 170;
85
+ $("#dup-log-content").css({height: height + 'px'});
86
+ }
87
+
88
+
89
+ var duration = 10;
90
+ var count = duration;
91
+ var timerInterval;
92
+ function timer() {
93
+ count = count - 1;
94
+ $("#dup-refresh-count").html(count.toString());
95
+ if (! $("#dup-auto-refresh").is(":checked")) {
96
+ clearInterval(timerInterval);
97
+ $("#dup-refresh-count").text(count.toString().trim());
98
+ return;
99
+ }
100
+
101
+ if (count <= 0) {
102
+ count = duration + 1;
103
+ Duplicator.Tools.Refresh();
104
+ }
105
+ }
106
+
107
+ function startTimer() {
108
+ timerInterval = setInterval(timer, 1000);
109
+ }
110
+
111
+ //INIT Events
112
+ $(window).resize(Duplicator.Tools.WinResize);
113
+ $('#dup-options').click(Duplicator.Tools.FullLog);
114
+ $("#dup-refresh").click(Duplicator.Tools.Refresh);
115
+ $("#dup-auto-refresh").click(Duplicator.Tools.RefreshAuto);
116
+ $("#dup-refresh-count").html(duration.toString());
117
+
118
+ //INIT
119
+ Duplicator.Tools.WinResize();
120
+ <?php if ($refresh) : ?>
121
+ //Scroll to Bottom
122
+ $("#dup-log-content").load(function () {
123
+ var $contents = $('#dup-log-content').contents();
124
+ $contents.scrollTop($contents.height());
125
+ });
126
+ <?php if ($auto) : ?>
127
+ $("#dup-auto-refresh").prop('checked', true);
128
+ Duplicator.Tools.RefreshAuto();
129
+ <?php endif; ?>
130
+ <?php endif; ?>
131
+
132
+ });
133
+
134
+ </script>
135
+
136
+ <form id="dup-form-logs" method="post" action="">
137
+ <input type="hidden" id="refresh" name="refresh" value="<?php echo ($refresh) ? 1 : 0 ?>" />
138
+ <input type="hidden" id="auto" name="auto" value="<?php echo ($auto) ? 1 : 0 ?>" />
139
+ <?php if (! $logfound) : ?>
140
+ <div style="padding:20px">
141
+ <h2><?php _e("Log file not found or unreadable", 'wpduplicator') ?>.</h2>
142
+
143
+ <?php _e("Try to create a package, since no log files were found in the snapshots directory with the extension *.log", 'wpduplicator') ?>.<br/><br/>
144
+
145
+ <?php _e("Reasons for log file not showing", 'wpduplicator') ?>: <br/>
146
+ - <?php _e("The web server does not support returning .log file extentions", 'wpduplicator') ?>. <br/>
147
+ - <?php _e("The snapshots directory does not have the correct permissions to write files. Try setting the permissions to 755", 'wpduplicator') ?>. <br/>
148
+ - <?php _e("The process that PHP runs under does not have enough permissions to create files. Please contact your hosting provider for more details", 'wpduplicator') ?>. <br/>
149
+ </div>
150
+
151
+ <?php else: ?>
152
+
153
+ <table id="dup-log-panels">
154
+ <tr>
155
+ <td id="dup-log-panel-left">
156
+ <div class="name"><i class='fa fa-list-alt'></i> <?php echo basename($logurl); ?></div>
157
+ <div class="opts"><a href="javascript:void(0)" id="dup-options"><?php _e("Options", 'wpduplicator') ?> <i class="fa fa-angle-double-right"></i></a> &nbsp;</div>
158
+ <br style="clear:both" />
159
+ <iframe id="dup-log-content" src="<?php echo $logurl ?>" ></iframe>
160
+ </td>
161
+ <td id="dup-log-panel-right">
162
+ <h2><?php _e("Options", 'wpduplicator') ?> </h2>
163
+ <div class="dup-opts-items">
164
+ <input type="button" class="button" id="dup-refresh" value="<?php _e("Refresh", 'wpduplicator') ?>" /> &nbsp;
165
+ <div style="display:inline-block; margin-top:5px">
166
+ <input type='checkbox' id="dup-auto-refresh" style="margin-top:1px" />
167
+ <label id="dup-auto-refresh-lbl" for="dup-auto-refresh">
168
+
169
+ <?php _e("Auto Refresh", 'wpduplicator') ?>
170
+ [<div id="dup-refresh-count"></div>]
171
+ </label>
172
+ </div>
173
+ </div>
174
+
175
+ <b><?php _e("Last 20 Logs", 'wpduplicator') ?> </b><br/>
176
+
177
+ <div class="dup-log-file-list">
178
+ <?php
179
+ $count=0;
180
+ $active = basename($logurl);
181
+ foreach ($logs as $log) {
182
+ $time = date('h:i:s m/d/y', filemtime($log));
183
+ $name = esc_html(basename($log));
184
+ $url = '?page=duplicator-tools&logname=' . $name;
185
+ echo ($active == $name)
186
+ ? "<span title='{$name}'>{$time} - {$name}</span><br/>"
187
+ : "<a href='javascript:void(0)' title='{$name}' onclick='Duplicator.Tools.GetLog(\"{$url}\")'>{$time} - {$name}</a><br/>";
188
+ if ($count > 20) break;
189
+ }
190
+ ?>
191
+ </div>
192
+ </td>
193
+ </tr>
194
+ </table>
195
+
196
+ <?php endif; ?>
197
+ </form>
198