Version Description
Download this release
Release Info
Developer | wpdprx |
Plugin | BackUpWordPress |
Version | 0.3.1 |
Comparing to | |
See all releases |
Code changes from version 0.2.7 to 0.3.1
- Archive.php +1 -1
- Archive/Reader.php +0 -2
- Archive/Writer.php +0 -2
- PEAR.php +2 -4
- Sajax.php +0 -361
- Type.php +2 -2
- backupwordpress.php +28 -4
- bkpwp-classes/manage_backups.php +13 -8
- bkpwp-pages/bkpwp_help.php +1 -1
- bkpwp-pages/bkpwp_manage_backups.php +19 -14
- bkpwp-pages/bkpwp_manage_presets.php +29 -32
- bkpwp-pages/bkpwp_options.php +11 -2
- bkpwp-pages/bkpwp_schedule.php +10 -4
- functions-interface.php +1 -63
- functions.php +0 -12
- readme.txt +1 -1
Archive.php
CHANGED
@@ -35,7 +35,7 @@
|
|
35 |
* To have access to PEAR::isError and PEAR::raiseError
|
36 |
* We should probably use lazy include and remove this inclusion...
|
37 |
*/
|
38 |
-
if (!
|
39 |
require_once $GLOBALS['bkpwp_plugin_path']."PEAR.php";
|
40 |
}
|
41 |
|
35 |
* To have access to PEAR::isError and PEAR::raiseError
|
36 |
* We should probably use lazy include and remove this inclusion...
|
37 |
*/
|
38 |
+
if (!class_exists("pear")) {
|
39 |
require_once $GLOBALS['bkpwp_plugin_path']."PEAR.php";
|
40 |
}
|
41 |
|
Archive/Reader.php
CHANGED
@@ -31,9 +31,7 @@
|
|
31 |
* @link http://pear.php.net/package/File_Archive
|
32 |
*/
|
33 |
|
34 |
-
if (!in_array("PEAR", get_declared_classes())) {
|
35 |
require_once $GLOBALS['bkpwp_plugin_path']."PEAR.php";
|
36 |
-
}
|
37 |
|
38 |
/**
|
39 |
* Abstract base class for all the readers
|
31 |
* @link http://pear.php.net/package/File_Archive
|
32 |
*/
|
33 |
|
|
|
34 |
require_once $GLOBALS['bkpwp_plugin_path']."PEAR.php";
|
|
|
35 |
|
36 |
/**
|
37 |
* Abstract base class for all the readers
|
Archive/Writer.php
CHANGED
@@ -29,9 +29,7 @@
|
|
29 |
* @link http://pear.php.net/package/File_Archive
|
30 |
*/
|
31 |
|
32 |
-
if (!in_array("PEAR", get_declared_classes())) {
|
33 |
require_once $GLOBALS['bkpwp_plugin_path']."PEAR.php";
|
34 |
-
}
|
35 |
|
36 |
/**
|
37 |
* Base class for any writer
|
29 |
* @link http://pear.php.net/package/File_Archive
|
30 |
*/
|
31 |
|
|
|
32 |
require_once $GLOBALS['bkpwp_plugin_path']."PEAR.php";
|
|
|
33 |
|
34 |
/**
|
35 |
* Base class for any writer
|
PEAR.php
CHANGED
@@ -1,8 +1,6 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
}
|
5 |
-
if (in_array("PEAR", get_declared_classes()) || in_array("pear", get_declared_classes())) {
|
6 |
return;
|
7 |
}
|
8 |
/**
|
1 |
<?php
|
2 |
+
|
3 |
+
if (class_exists("pear")) {
|
|
|
|
|
4 |
return;
|
5 |
}
|
6 |
/**
|
Sajax.php
DELETED
@@ -1,361 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if (!isset($GLOBALS['SAJAX_INCLUDED'])) {
|
3 |
-
|
4 |
-
/*
|
5 |
-
* GLOBALS AND DEFAULTS
|
6 |
-
*
|
7 |
-
*/
|
8 |
-
$GLOBALS['sajax_version'] = '0.12';
|
9 |
-
$GLOBALS['sajax_debug_mode'] = 0;
|
10 |
-
$GLOBALS['sajax_export_list'] = array();
|
11 |
-
$GLOBALS['sajax_request_type'] = 'GET';
|
12 |
-
$GLOBALS['sajax_remote_uri'] = '';
|
13 |
-
$GLOBALS['sajax_failure_redirect'] = '';
|
14 |
-
|
15 |
-
/*
|
16 |
-
* CODE
|
17 |
-
*
|
18 |
-
*/
|
19 |
-
|
20 |
-
//
|
21 |
-
// Initialize the Sajax library.
|
22 |
-
//
|
23 |
-
function sajax_init() {
|
24 |
-
}
|
25 |
-
|
26 |
-
//
|
27 |
-
// Helper function to return the script's own URI.
|
28 |
-
//
|
29 |
-
function sajax_get_my_uri() {
|
30 |
-
return $_SERVER["REQUEST_URI"];
|
31 |
-
}
|
32 |
-
$sajax_remote_uri = sajax_get_my_uri();
|
33 |
-
|
34 |
-
//
|
35 |
-
// Helper function to return an eval()-usable representation
|
36 |
-
// of an object in JavaScript.
|
37 |
-
//
|
38 |
-
function sajax_get_js_repr($value) {
|
39 |
-
$type = gettype($value);
|
40 |
-
|
41 |
-
if ($type == "boolean") {
|
42 |
-
return ($value) ? "Boolean(true)" : "Boolean(false)";
|
43 |
-
}
|
44 |
-
elseif ($type == "integer") {
|
45 |
-
return "parseInt($value)";
|
46 |
-
}
|
47 |
-
elseif ($type == "double") {
|
48 |
-
return "parseFloat($value)";
|
49 |
-
}
|
50 |
-
elseif ($type == "array" || $type == "object" ) {
|
51 |
-
//
|
52 |
-
// XXX Arrays with non-numeric indices are not
|
53 |
-
// permitted according to ECMAScript, yet everyone
|
54 |
-
// uses them.. We'll use an object.
|
55 |
-
//
|
56 |
-
$s = "{ ";
|
57 |
-
if ($type == "object") {
|
58 |
-
$value = get_object_vars($value);
|
59 |
-
}
|
60 |
-
foreach ($value as $k=>$v) {
|
61 |
-
$esc_key = sajax_esc($k);
|
62 |
-
if (is_numeric($k))
|
63 |
-
$s .= "$k: " . sajax_get_js_repr($v) . ", ";
|
64 |
-
else
|
65 |
-
$s .= "\"$esc_key\": " . sajax_get_js_repr($v) . ", ";
|
66 |
-
}
|
67 |
-
if (count($value))
|
68 |
-
$s = substr($s, 0, -2);
|
69 |
-
return $s . " }";
|
70 |
-
}
|
71 |
-
else {
|
72 |
-
$esc_val = sajax_esc($value);
|
73 |
-
$s = "'$esc_val'";
|
74 |
-
return $s;
|
75 |
-
}
|
76 |
-
}
|
77 |
-
|
78 |
-
function sajax_handle_client_request() {
|
79 |
-
global $sajax_export_list;
|
80 |
-
|
81 |
-
$mode = "";
|
82 |
-
|
83 |
-
if (! empty($_GET["rs"]))
|
84 |
-
$mode = "get";
|
85 |
-
|
86 |
-
if (!empty($_POST["rs"]))
|
87 |
-
$mode = "post";
|
88 |
-
|
89 |
-
if (empty($mode))
|
90 |
-
return;
|
91 |
-
|
92 |
-
$target = "";
|
93 |
-
|
94 |
-
if ($mode == "get") {
|
95 |
-
// Bust cache in the head
|
96 |
-
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
97 |
-
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
98 |
-
// always modified
|
99 |
-
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
100 |
-
header ("Pragma: no-cache"); // HTTP/1.0
|
101 |
-
$func_name = $_GET["rs"];
|
102 |
-
if (! empty($_GET["rsargs"]))
|
103 |
-
$args = $_GET["rsargs"];
|
104 |
-
else
|
105 |
-
$args = array();
|
106 |
-
}
|
107 |
-
else {
|
108 |
-
$func_name = $_POST["rs"];
|
109 |
-
if (! empty($_POST["rsargs"]))
|
110 |
-
$args = $_POST["rsargs"];
|
111 |
-
else
|
112 |
-
$args = array();
|
113 |
-
}
|
114 |
-
|
115 |
-
if (! in_array($func_name, $sajax_export_list))
|
116 |
-
echo "-:$func_name not callable";
|
117 |
-
else {
|
118 |
-
echo "+:";
|
119 |
-
$result = call_user_func_array($func_name, $args);
|
120 |
-
echo "var res = " . trim(sajax_get_js_repr($result)) . "; res;";
|
121 |
-
}
|
122 |
-
exit;
|
123 |
-
}
|
124 |
-
|
125 |
-
function sajax_get_common_js() {
|
126 |
-
global $sajax_debug_mode;
|
127 |
-
global $sajax_request_type;
|
128 |
-
global $sajax_remote_uri;
|
129 |
-
global $sajax_failure_redirect;
|
130 |
-
|
131 |
-
$t = strtoupper($sajax_request_type);
|
132 |
-
if ($t != "" && $t != "GET" && $t != "POST")
|
133 |
-
return "// Invalid type: $t.. \n\n";
|
134 |
-
|
135 |
-
ob_start();
|
136 |
-
?>
|
137 |
-
|
138 |
-
// remote scripting library
|
139 |
-
// (c) copyright 2005 modernmethod, inc
|
140 |
-
var sajax_debug_mode = <?php echo $sajax_debug_mode ? "true" : "false"; ?>;
|
141 |
-
var sajax_request_type = "<?php echo $t; ?>";
|
142 |
-
var sajax_target_id = "";
|
143 |
-
var sajax_failure_redirect = "<?php echo $sajax_failure_redirect; ?>";
|
144 |
-
|
145 |
-
function sajax_debug(text) {
|
146 |
-
if (sajax_debug_mode)
|
147 |
-
alert(text);
|
148 |
-
}
|
149 |
-
|
150 |
-
function sajax_init_object() {
|
151 |
-
sajax_debug("sajax_init_object() called..")
|
152 |
-
|
153 |
-
var A;
|
154 |
-
|
155 |
-
var msxmlhttp = new Array(
|
156 |
-
'Msxml2.XMLHTTP.5.0',
|
157 |
-
'Msxml2.XMLHTTP.4.0',
|
158 |
-
'Msxml2.XMLHTTP.3.0',
|
159 |
-
'Msxml2.XMLHTTP',
|
160 |
-
'Microsoft.XMLHTTP');
|
161 |
-
for (var i = 0; i < msxmlhttp.length; i++) {
|
162 |
-
try {
|
163 |
-
A = new ActiveXObject(msxmlhttp[i]);
|
164 |
-
} catch (e) {
|
165 |
-
A = null;
|
166 |
-
}
|
167 |
-
}
|
168 |
-
|
169 |
-
if(!A && typeof XMLHttpRequest != "undefined")
|
170 |
-
A = new XMLHttpRequest();
|
171 |
-
if (!A)
|
172 |
-
sajax_debug("Could not create connection object.");
|
173 |
-
return A;
|
174 |
-
}
|
175 |
-
|
176 |
-
var sajax_requests = new Array();
|
177 |
-
|
178 |
-
function sajax_cancel() {
|
179 |
-
for (var i = 0; i < sajax_requests.length; i++)
|
180 |
-
sajax_requests[i].abort();
|
181 |
-
}
|
182 |
-
|
183 |
-
function sajax_do_call(func_name, args) {
|
184 |
-
var i, x, n;
|
185 |
-
var uri;
|
186 |
-
var post_data;
|
187 |
-
var target_id;
|
188 |
-
|
189 |
-
sajax_debug("in sajax_do_call().." + sajax_request_type + "/" + sajax_target_id);
|
190 |
-
target_id = sajax_target_id;
|
191 |
-
if (typeof(sajax_request_type) == "undefined" || sajax_request_type == "")
|
192 |
-
sajax_request_type = "GET";
|
193 |
-
|
194 |
-
uri = "<?php echo $sajax_remote_uri; ?>";
|
195 |
-
if (sajax_request_type == "GET") {
|
196 |
-
|
197 |
-
if (uri.indexOf("?") == -1)
|
198 |
-
uri += "?rs=" + escape(func_name);
|
199 |
-
else
|
200 |
-
uri += "&rs=" + escape(func_name);
|
201 |
-
uri += "&rst=" + escape(sajax_target_id);
|
202 |
-
uri += "&rsrnd=" + new Date().getTime();
|
203 |
-
|
204 |
-
for (i = 0; i < args.length-1; i++)
|
205 |
-
uri += "&rsargs[]=" + escape(args[i]);
|
206 |
-
|
207 |
-
post_data = null;
|
208 |
-
}
|
209 |
-
else if (sajax_request_type == "POST") {
|
210 |
-
post_data = "rs=" + escape(func_name);
|
211 |
-
post_data += "&rst=" + escape(sajax_target_id);
|
212 |
-
post_data += "&rsrnd=" + new Date().getTime();
|
213 |
-
|
214 |
-
for (i = 0; i < args.length-1; i++)
|
215 |
-
post_data = post_data + "&rsargs[]=" + escape(args[i]);
|
216 |
-
}
|
217 |
-
else {
|
218 |
-
alert("Illegal request type: " + sajax_request_type);
|
219 |
-
}
|
220 |
-
|
221 |
-
x = sajax_init_object();
|
222 |
-
if (x == null) {
|
223 |
-
if (sajax_failure_redirect != "") {
|
224 |
-
location.href = sajax_failure_redirect;
|
225 |
-
return false;
|
226 |
-
} else {
|
227 |
-
sajax_debug("NULL sajax object for user agent:\n" + navigator.userAgent);
|
228 |
-
return false;
|
229 |
-
}
|
230 |
-
} else {
|
231 |
-
x.open(sajax_request_type, uri, true);
|
232 |
-
// window.open(uri);
|
233 |
-
|
234 |
-
sajax_requests[sajax_requests.length] = x;
|
235 |
-
|
236 |
-
if (sajax_request_type == "POST") {
|
237 |
-
x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");
|
238 |
-
x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
239 |
-
}
|
240 |
-
|
241 |
-
x.onreadystatechange = function() {
|
242 |
-
if (x.readyState != 4)
|
243 |
-
return;
|
244 |
-
|
245 |
-
sajax_debug("received " + x.responseText);
|
246 |
-
|
247 |
-
var status;
|
248 |
-
var data;
|
249 |
-
var txt = x.responseText.replace(/^\s*|\s*$/g,"");
|
250 |
-
status = txt.charAt(0);
|
251 |
-
data = txt.substring(2);
|
252 |
-
|
253 |
-
if (status == "") {
|
254 |
-
// let's just assume this is a pre-response bailout and let it slide for now
|
255 |
-
} else if (status == "-")
|
256 |
-
alert("Error: " + data);
|
257 |
-
else {
|
258 |
-
if (target_id != "")
|
259 |
-
document.getElementById(target_id).innerHTML = eval(data);
|
260 |
-
else {
|
261 |
-
try {
|
262 |
-
var callback;
|
263 |
-
var extra_data = false;
|
264 |
-
if (typeof args[args.length-1] == "object") {
|
265 |
-
callback = args[args.length-1].callback;
|
266 |
-
extra_data = args[args.length-1].extra_data;
|
267 |
-
} else {
|
268 |
-
callback = args[args.length-1];
|
269 |
-
}
|
270 |
-
callback(eval(data), extra_data);
|
271 |
-
} catch (e) {
|
272 |
-
sajax_debug("Caught error " + e + ": Could not eval " + data );
|
273 |
-
}
|
274 |
-
}
|
275 |
-
}
|
276 |
-
}
|
277 |
-
}
|
278 |
-
|
279 |
-
sajax_debug(func_name + " uri = " + uri + "/post = " + post_data);
|
280 |
-
x.send(post_data);
|
281 |
-
sajax_debug(func_name + " waiting..");
|
282 |
-
delete x;
|
283 |
-
return true;
|
284 |
-
}
|
285 |
-
|
286 |
-
<?php
|
287 |
-
$html = ob_get_contents();
|
288 |
-
ob_end_clean();
|
289 |
-
return $html;
|
290 |
-
}
|
291 |
-
|
292 |
-
function sajax_show_common_js() {
|
293 |
-
echo sajax_get_common_js();
|
294 |
-
}
|
295 |
-
|
296 |
-
// javascript escape a value
|
297 |
-
function sajax_esc($val)
|
298 |
-
{
|
299 |
-
$val = str_replace("\\", "\\\\", $val);
|
300 |
-
$val = str_replace("\r", "\\r", $val);
|
301 |
-
$val = str_replace("\n", "\\n", $val);
|
302 |
-
$val = str_replace("'", "\\'", $val);
|
303 |
-
return str_replace('"', '\\"', $val);
|
304 |
-
}
|
305 |
-
|
306 |
-
function sajax_get_one_stub($func_name) {
|
307 |
-
ob_start();
|
308 |
-
?>
|
309 |
-
|
310 |
-
// wrapper for <?php echo $func_name; ?>
|
311 |
-
|
312 |
-
function x_<?php echo $func_name; ?>() {
|
313 |
-
sajax_do_call("<?php echo $func_name; ?>",
|
314 |
-
x_<?php echo $func_name; ?>.arguments);
|
315 |
-
}
|
316 |
-
|
317 |
-
<?php
|
318 |
-
$html = ob_get_contents();
|
319 |
-
ob_end_clean();
|
320 |
-
return $html;
|
321 |
-
}
|
322 |
-
|
323 |
-
function sajax_show_one_stub($func_name) {
|
324 |
-
echo sajax_get_one_stub($func_name);
|
325 |
-
}
|
326 |
-
|
327 |
-
function sajax_export() {
|
328 |
-
global $sajax_export_list;
|
329 |
-
|
330 |
-
$n = func_num_args();
|
331 |
-
for ($i = 0; $i < $n; $i++) {
|
332 |
-
$sajax_export_list[] = func_get_arg($i);
|
333 |
-
}
|
334 |
-
}
|
335 |
-
|
336 |
-
$sajax_js_has_been_shown = 0;
|
337 |
-
function sajax_get_javascript()
|
338 |
-
{
|
339 |
-
global $sajax_js_has_been_shown;
|
340 |
-
global $sajax_export_list;
|
341 |
-
|
342 |
-
$html = "";
|
343 |
-
if (! $sajax_js_has_been_shown) {
|
344 |
-
$html .= sajax_get_common_js();
|
345 |
-
$sajax_js_has_been_shown = 1;
|
346 |
-
}
|
347 |
-
foreach ($sajax_export_list as $func) {
|
348 |
-
$html .= sajax_get_one_stub($func);
|
349 |
-
}
|
350 |
-
return $html;
|
351 |
-
}
|
352 |
-
|
353 |
-
function sajax_show_javascript()
|
354 |
-
{
|
355 |
-
echo sajax_get_javascript();
|
356 |
-
}
|
357 |
-
|
358 |
-
|
359 |
-
$GLOBALS['SAJAX_INCLUDED'] = 1;
|
360 |
-
}
|
361 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Type.php
CHANGED
@@ -19,8 +19,8 @@
|
|
19 |
// $Id: Type.php,v 1.2 2004/08/07 22:19:04 ieure Exp $
|
20 |
|
21 |
|
22 |
-
if (!
|
23 |
-
|
24 |
}
|
25 |
|
26 |
$_fileCmd = &PEAR::getStaticProperty('MIME_Type', 'fileCmd');
|
19 |
// $Id: Type.php,v 1.2 2004/08/07 22:19:04 ieure Exp $
|
20 |
|
21 |
|
22 |
+
if (!class_exists("pear")) {
|
23 |
+
require_once $GLOBALS['bkpwp_plugin_path']."PEAR.php";
|
24 |
}
|
25 |
|
26 |
$_fileCmd = &PEAR::getStaticProperty('MIME_Type', 'fileCmd');
|
backupwordpress.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: BackUpWordPress
|
|
4 |
Plugin URI: http://wordpress.designpraxis.at
|
5 |
Description: Manage <a href="admin.php?page=backupwordpress/backupwordpress.php">WordPress Backups</a>. Beta Release. Please help testing and give me feedback under the comments section of <a href="http://wordpress.designpraxis.at/plugins/backupwordpress/">the Plugin page</a>. Backup DB, Files & Folders, use .tar.gz, .zip, Exclude List, etc.
|
6 |
Author: Roland Rust
|
7 |
-
Version: 0.
|
8 |
Author URI: http://wordpress.designpraxis.at
|
9 |
*/
|
10 |
|
@@ -26,7 +26,7 @@ Author URI: http://wordpress.designpraxis.at
|
|
26 |
*/
|
27 |
|
28 |
$GLOBALS['bkpwp_plugin_path'] = ABSPATH."wp-content/plugins/backupwordpress/";
|
29 |
-
$GLOBALS['bkpwp_version'] = "0.
|
30 |
|
31 |
// get the functions
|
32 |
require_once($GLOBALS['bkpwp_plugin_path']."functions.php");
|
@@ -47,7 +47,6 @@ add_action('deactivate_backupwordpress/backupwordpress.php', 'bkpwp_exit');
|
|
47 |
// set up ajax stuff on init, to prevent header oputput
|
48 |
add_action('init', 'bkpwp_download_files');
|
49 |
add_action('init', 'bkpwp_setup');
|
50 |
-
add_action('init', 'bkpwp_sajax_do');
|
51 |
add_action('init', 'bkpwp_proceed_unfinished');
|
52 |
|
53 |
// cron jobs with wordpress' pseude-cron: add special reccurences
|
@@ -56,8 +55,33 @@ add_filter('cron_schedules', 'bkpwp_more_reccurences');
|
|
56 |
add_action('bkpwp_schedule_bkpwp_hook','bkpwp_schedule_bkpwp');
|
57 |
add_action('bkpwp_finish_bkpwp_hook','bkpwp_finish_bkpwp');
|
58 |
|
|
|
59 |
if (eregi("backupwordpress",$_REQUEST['page']) || eregi("bkpwp",$_REQUEST['page'])) {
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
62 |
if (eregi("backupwordpress",$_REQUEST['page']) || eregi("bkpwp",$_REQUEST['page']) || $_SERVER['REQUEST_URI'] == "/wp-admin/index.php" || $_SERVER['REQUEST_URI'] == "/wp-admin/") {
|
63 |
add_action('admin_head', 'bkpwp_load_css_and_js');
|
4 |
Plugin URI: http://wordpress.designpraxis.at
|
5 |
Description: Manage <a href="admin.php?page=backupwordpress/backupwordpress.php">WordPress Backups</a>. Beta Release. Please help testing and give me feedback under the comments section of <a href="http://wordpress.designpraxis.at/plugins/backupwordpress/">the Plugin page</a>. Backup DB, Files & Folders, use .tar.gz, .zip, Exclude List, etc.
|
6 |
Author: Roland Rust
|
7 |
+
Version: 0.3.1
|
8 |
Author URI: http://wordpress.designpraxis.at
|
9 |
*/
|
10 |
|
26 |
*/
|
27 |
|
28 |
$GLOBALS['bkpwp_plugin_path'] = ABSPATH."wp-content/plugins/backupwordpress/";
|
29 |
+
$GLOBALS['bkpwp_version'] = "0.3.1";
|
30 |
|
31 |
// get the functions
|
32 |
require_once($GLOBALS['bkpwp_plugin_path']."functions.php");
|
47 |
// set up ajax stuff on init, to prevent header oputput
|
48 |
add_action('init', 'bkpwp_download_files');
|
49 |
add_action('init', 'bkpwp_setup');
|
|
|
50 |
add_action('init', 'bkpwp_proceed_unfinished');
|
51 |
|
52 |
// cron jobs with wordpress' pseude-cron: add special reccurences
|
55 |
add_action('bkpwp_schedule_bkpwp_hook','bkpwp_schedule_bkpwp');
|
56 |
add_action('bkpwp_finish_bkpwp_hook','bkpwp_finish_bkpwp');
|
57 |
|
58 |
+
// ajax new: prototype replaces sajax
|
59 |
if (eregi("backupwordpress",$_REQUEST['page']) || eregi("bkpwp",$_REQUEST['page'])) {
|
60 |
+
wp_enqueue_script('prototype');
|
61 |
+
if (!empty($_POST['bkpwp_calculate_preset'])) {
|
62 |
+
echo bkpwp_ajax_calculater($_POST['bkpwp_calculate_preset']); exit;
|
63 |
+
}
|
64 |
+
if (!empty($_POST['bkpwp_docreate_preset'])) {
|
65 |
+
echo bkpwp_ajax_create($_POST['bkpwp_docreate_preset']); exit;
|
66 |
+
}
|
67 |
+
if (!empty($_POST['bkpwp_view_backup'])) {
|
68 |
+
echo bkpwp_ajax_view_backup($_POST['bkpwp_view_backup']); exit;
|
69 |
+
}
|
70 |
+
if (!empty($_POST['bkpwp_view_excludelist'])) {
|
71 |
+
echo bkpwp_ajax_shownobfiles($_POST['bkpwp_view_excludelist']); exit;
|
72 |
+
}
|
73 |
+
if (!empty($_POST['bkpwp_load_preset'])) {
|
74 |
+
echo bkpwp_ajax_load_preset($_POST['bkpwp_load_preset']); exit;
|
75 |
+
}
|
76 |
+
if (!empty($_POST['bkpwp_view_preset'])) {
|
77 |
+
echo bkpwp_ajax_view_preset($_POST['bkpwp_view_preset']); exit;
|
78 |
+
}
|
79 |
+
if (!empty($_POST['bkpwp_delete_preset'])) {
|
80 |
+
echo bkpwp_ajax_delete_preset($_POST['bkpwp_delete_preset']); exit;
|
81 |
+
}
|
82 |
+
if (!empty($_POST['bkpwp_save_preset'])) {
|
83 |
+
echo bkpwp_ajax_save_preset($_POST['bkpwp_save_preset'],$_POST['bkpwp_preset_archive_type'],$_POST['bkpwp_excludelist'],$_POST['bkpwp_sql_only']); exit;
|
84 |
+
}
|
85 |
}
|
86 |
if (eregi("backupwordpress",$_REQUEST['page']) || eregi("bkpwp",$_REQUEST['page']) || $_SERVER['REQUEST_URI'] == "/wp-admin/index.php" || $_SERVER['REQUEST_URI'] == "/wp-admin/") {
|
87 |
add_action('admin_head', 'bkpwp_load_css_and_js');
|
bkpwp-classes/manage_backups.php
CHANGED
@@ -91,10 +91,14 @@ class BKPWP_BACKUP_ARCHIVE {
|
|
91 |
<?php if (!$backup->options->bkpwp_easy_mode()) { ?>
|
92 |
<?php
|
93 |
echo " <a href=\"javascript:void(0)\"
|
94 |
-
onclick=\"bkpwp_js_loading('".__("View Backup Information","bkpwp")."');
|
95 |
-
|
96 |
-
|
97 |
-
|
|
|
|
|
|
|
|
|
98 |
?>
|
99 |
</td>
|
100 |
<td style="text-align: center;">
|
@@ -841,6 +845,7 @@ class BKPWP_MANAGE {
|
|
841 |
function bkpwp_load_preset($preset) {
|
842 |
$options = new BKPWP_OPTIONS();
|
843 |
$ret = "<div style=\"border: 1px solid #ccc; padding:10px; margin-bottom:20px;\">";
|
|
|
844 |
/*if ($preset['bkpwp_preset_options']['default'] == 1) {
|
845 |
$ret .= "<div id=\"message\" class=\"updated fade\"><p>".__("You can not overwrite this default preset. Please save changes with a new Preset Name.","bkpwp")."</p></div>";
|
846 |
}
|
@@ -878,7 +883,7 @@ class BKPWP_MANAGE {
|
|
878 |
$ret .= ">".$l['listname']."</option>";
|
879 |
}
|
880 |
$ret .= "</select>";
|
881 |
-
$ret .= " <a href=\"admin.php?page=
|
882 |
$ret .= "</p>";
|
883 |
}
|
884 |
$ret .= "</div>";
|
@@ -888,8 +893,8 @@ class BKPWP_MANAGE {
|
|
888 |
$ret .= " checked";
|
889 |
}
|
890 |
$ret .= " onclick=\"if (document.getElementById('mod_bkpwp_sql_only').checked == false) { document.getElementById('mod_bkpwp_sql_only').value=''; document.getElementById('full_only').style.display='block'; } else { document.getElementById('mod_bkpwp_sql_only').value=1; document.getElementById('full_only').style.display='none'; }\" /> ".__("SQL only","bkpwp")."</label></p>";
|
891 |
-
$ret .= "<p><input type=\"
|
892 |
-
$ret .= "</div>";
|
893 |
return $ret;
|
894 |
}
|
895 |
|
@@ -1039,7 +1044,7 @@ class BKPWP_MANAGE {
|
|
1039 |
}
|
1040 |
|
1041 |
|
1042 |
-
|
1043 |
class backupwordpressMailer extends PHPMailer {
|
1044 |
// Set default variables for all new objects
|
1045 |
//var $From = $GLOBALS['userdata']->user_email;
|
91 |
<?php if (!$backup->options->bkpwp_easy_mode()) { ?>
|
92 |
<?php
|
93 |
echo " <a href=\"javascript:void(0)\"
|
94 |
+
onclick=\"bkpwp_js_loading('".__("View Backup Information","bkpwp")."');
|
95 |
+
ajax = new Ajax.Updater(
|
96 |
+
'bkpwp_action_buffer', // DIV id must be declared before the method was called
|
97 |
+
'".get_bloginfo("wpurl")."/wp-admin/admin.php?page=backupwordpress/backupwordpress.php"."',
|
98 |
+
{
|
99 |
+
method:'post',
|
100 |
+
postBody:'bkpwp_view_backup=".base64_encode($f['file'])."'
|
101 |
+
});\">".__("view","bkpwp")."</a>";
|
102 |
?>
|
103 |
</td>
|
104 |
<td style="text-align: center;">
|
845 |
function bkpwp_load_preset($preset) {
|
846 |
$options = new BKPWP_OPTIONS();
|
847 |
$ret = "<div style=\"border: 1px solid #ccc; padding:10px; margin-bottom:20px;\">";
|
848 |
+
$ret .= "<form method=\"post\" action=\"admin.php?page=bkpwp_manage_presets\">";
|
849 |
/*if ($preset['bkpwp_preset_options']['default'] == 1) {
|
850 |
$ret .= "<div id=\"message\" class=\"updated fade\"><p>".__("You can not overwrite this default preset. Please save changes with a new Preset Name.","bkpwp")."</p></div>";
|
851 |
}
|
883 |
$ret .= ">".$l['listname']."</option>";
|
884 |
}
|
885 |
$ret .= "</select>";
|
886 |
+
$ret .= " <a href=\"admin.php?page=bkpwp-backup-options&excludelistname=".$preset['bkpwp_preset_options']['bkpwp_excludelist']."#excludelist\">".__("Configure","bkpwp")." »</a>";
|
887 |
$ret .= "</p>";
|
888 |
}
|
889 |
$ret .= "</div>";
|
893 |
$ret .= " checked";
|
894 |
}
|
895 |
$ret .= " onclick=\"if (document.getElementById('mod_bkpwp_sql_only').checked == false) { document.getElementById('mod_bkpwp_sql_only').value=''; document.getElementById('full_only').style.display='block'; } else { document.getElementById('mod_bkpwp_sql_only').value=1; document.getElementById('full_only').style.display='none'; }\" /> ".__("SQL only","bkpwp")."</label></p>";
|
896 |
+
$ret .= "<p><input type=\"submit\" class=\"button\" value=\"".__("Save Preset","bkpwp")."\" /></p>";
|
897 |
+
$ret .= "</form></div>";
|
898 |
return $ret;
|
899 |
}
|
900 |
|
1044 |
}
|
1045 |
|
1046 |
|
1047 |
+
require(ABSPATH."wp-includes/class-phpmailer.php");
|
1048 |
class backupwordpressMailer extends PHPMailer {
|
1049 |
// Set default variables for all new objects
|
1050 |
//var $From = $GLOBALS['userdata']->user_email;
|
bkpwp-pages/bkpwp_help.php
CHANGED
@@ -48,7 +48,7 @@ $options = new BKPWP_OPTIONS();
|
|
48 |
_e("By default, BackUpWordPress keeps a number of","bkpwp");
|
49 |
echo " ".get_option("bkpwp_max_backups")." ";
|
50 |
_e("backup archives in the backup repository. You can alter this number within the Advanced Backup Settings. ","bkpwp");?>
|
51 |
-
<br /><a href="admin.php?page=
|
52 |
</p>
|
53 |
<p>
|
54 |
<?php _e("As soon as this amount of backup archives in the repository is reached,
|
48 |
_e("By default, BackUpWordPress keeps a number of","bkpwp");
|
49 |
echo " ".get_option("bkpwp_max_backups")." ";
|
50 |
_e("backup archives in the backup repository. You can alter this number within the Advanced Backup Settings. ","bkpwp");?>
|
51 |
+
<br /><a href="admin.php?page=bkpwp_options#backup_options"><?php _e("Configure","bkpwp"); ?> »</a>
|
52 |
</p>
|
53 |
<p>
|
54 |
<?php _e("As soon as this amount of backup archives in the repository is reached,
|
bkpwp-pages/bkpwp_manage_backups.php
CHANGED
@@ -239,33 +239,45 @@ if (count($backup_archives) < 1) {
|
|
239 |
?>
|
240 |
<h2><?php _e("Manage Backups","bkpwp"); ?></h2>
|
241 |
<script type="text/javascript">
|
|
|
242 |
<!-- ajax call to the actual backup function -->
|
243 |
-
function
|
244 |
var preset;
|
245 |
<?php if (!$backups->options->bkpwp_easy_mode()) { ?>
|
246 |
preset = document.getElementById('bkpwp_preset').options[document.getElementById('bkpwp_preset').selectedIndex].value;
|
247 |
<?php } else { ?>
|
248 |
preset = "full backup";
|
249 |
<?php } ?>
|
250 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
}
|
252 |
|
253 |
<!-- ajax call for calculating disk space usage -->
|
254 |
-
function
|
255 |
var preset;
|
256 |
<?php if (!$backups->options->bkpwp_easy_mode()) { ?>
|
257 |
preset = document.getElementById('bkpwp_preset').options[document.getElementById('bkpwp_preset').selectedIndex].value;
|
258 |
<?php } else { ?>
|
259 |
preset = "full backup";
|
260 |
<?php } ?>
|
261 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
}
|
263 |
|
264 |
<!-- displays a loading text information while doing ajax requests -->
|
265 |
function bkpwp_js_loading(str) {
|
266 |
document.getElementById('bkpwp_actions').style.display = 'block';
|
267 |
is_loading('bkpwp_action_buffer');
|
268 |
-
sajax_target_id = 'bkpwp_action_buffer';
|
269 |
document.getElementById('bkpwp_action_title').innerHTML="<h4>" + str + "</h4>";
|
270 |
}
|
271 |
</script>
|
@@ -319,13 +331,6 @@ if (count($backup_archives) < 1) {
|
|
319 |
?>
|
320 |
</p>
|
321 |
<p>
|
322 |
-
<?php
|
323 |
-
/*
|
324 |
-
echo __("Your server's configuration allows scripts to run for a maximum of","bkpwp")." ";
|
325 |
-
echo ini_get("max_execution_time");
|
326 |
-
echo " ".__("seconds.","bkpwp");
|
327 |
-
*/
|
328 |
-
?>
|
329 |
</p>
|
330 |
</div>
|
331 |
<?php
|
@@ -350,9 +355,9 @@ if (count($backup_archives) < 1) {
|
|
350 |
</p>
|
351 |
<?php }
|
352 |
} ?>
|
353 |
-
<button class="button" onclick="bkpwp_js_loading('<?php _e("Your backup is being processed.","bkpwp"); ?>');
|
354 |
<?php if (!$backups->options->bkpwp_easy_mode()) { ?>
|
355 |
-
<button class="button" onclick="bkpwp_js_loading('<?php _e("Calculating used disk space","bkpwp"); ?>');
|
356 |
<?php }
|
357 |
} ?>
|
358 |
|
239 |
?>
|
240 |
<h2><?php _e("Manage Backups","bkpwp"); ?></h2>
|
241 |
<script type="text/javascript">
|
242 |
+
|
243 |
<!-- ajax call to the actual backup function -->
|
244 |
+
function do_create2() {
|
245 |
var preset;
|
246 |
<?php if (!$backups->options->bkpwp_easy_mode()) { ?>
|
247 |
preset = document.getElementById('bkpwp_preset').options[document.getElementById('bkpwp_preset').selectedIndex].value;
|
248 |
<?php } else { ?>
|
249 |
preset = "full backup";
|
250 |
<?php } ?>
|
251 |
+
ajax = new Ajax.Updater(
|
252 |
+
'bkpwp_action_buffer', // DIV id must be declared before the method was called
|
253 |
+
'<?php echo get_bloginfo("wpurl")."/wp-admin/admin.php?page=backupwordpress/backupwordpress.php"; ?>', // URL
|
254 |
+
{ // options
|
255 |
+
method:'post',
|
256 |
+
postBody:'bkpwp_docreate_preset='+preset
|
257 |
+
});
|
258 |
}
|
259 |
|
260 |
<!-- ajax call for calculating disk space usage -->
|
261 |
+
function calculate2() {
|
262 |
var preset;
|
263 |
<?php if (!$backups->options->bkpwp_easy_mode()) { ?>
|
264 |
preset = document.getElementById('bkpwp_preset').options[document.getElementById('bkpwp_preset').selectedIndex].value;
|
265 |
<?php } else { ?>
|
266 |
preset = "full backup";
|
267 |
<?php } ?>
|
268 |
+
ajax = new Ajax.Updater(
|
269 |
+
'bkpwp_action_buffer', // DIV id must be declared before the method was called
|
270 |
+
'<?php echo get_bloginfo("wpurl")."/wp-admin/admin.php?page=backupwordpress/backupwordpress.php"; ?>', // URL
|
271 |
+
{ // options
|
272 |
+
method:'post',
|
273 |
+
postBody:'bkpwp_calculate_preset='+preset
|
274 |
+
});
|
275 |
}
|
276 |
|
277 |
<!-- displays a loading text information while doing ajax requests -->
|
278 |
function bkpwp_js_loading(str) {
|
279 |
document.getElementById('bkpwp_actions').style.display = 'block';
|
280 |
is_loading('bkpwp_action_buffer');
|
|
|
281 |
document.getElementById('bkpwp_action_title').innerHTML="<h4>" + str + "</h4>";
|
282 |
}
|
283 |
</script>
|
331 |
?>
|
332 |
</p>
|
333 |
<p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
334 |
</p>
|
335 |
</div>
|
336 |
<?php
|
355 |
</p>
|
356 |
<?php }
|
357 |
} ?>
|
358 |
+
<button class="button" onclick="bkpwp_js_loading('<?php _e("Your backup is being processed.","bkpwp"); ?>'); do_create2(); return false;"><?php _e("BackUp WordPress Now","bkpwp"); ?> »</button>
|
359 |
<?php if (!$backups->options->bkpwp_easy_mode()) { ?>
|
360 |
+
<button class="button" onclick="bkpwp_js_loading('<?php _e("Calculating used disk space","bkpwp"); ?>'); calculate2(); return false;"><?php _e("Recalculate Used Disk Space","bkpwp"); ?> »</button>
|
361 |
<?php }
|
362 |
} ?>
|
363 |
|
bkpwp-pages/bkpwp_manage_presets.php
CHANGED
@@ -14,8 +14,17 @@ $presets = $backups->bkpwp_get_presets();
|
|
14 |
$preset = $backups->bkpwp_get_preset($_REQUEST['mod_bkpwp_preset_name']);
|
15 |
echo $backups->bkpwp_load_preset($preset);
|
16 |
}
|
|
|
|
|
17 |
if (!empty($_REQUEST['bkpwp_delete_preset'])) {
|
18 |
-
$backups->bkpwp_delete_preset($_REQUEST['bkpwp_delete_preset']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
}
|
20 |
?>
|
21 |
<table class="widefat">
|
@@ -67,27 +76,35 @@ $presets = $backups->bkpwp_get_presets();
|
|
67 |
<td style="text-align: center;">
|
68 |
<?php
|
69 |
echo " <a href=\"javascript:void(0)\"
|
70 |
-
onclick=\"is_loading('
|
71 |
-
|
72 |
-
|
73 |
-
|
|
|
|
|
|
|
|
|
74 |
?>
|
75 |
</td>
|
76 |
<td style="text-align: center;">
|
77 |
<?php
|
78 |
echo " <a href=\"javascript:void(0)\"
|
79 |
-
onclick=\"is_loading('
|
80 |
-
|
81 |
-
|
82 |
-
|
|
|
|
|
|
|
|
|
83 |
?>
|
84 |
</td>
|
85 |
<td style="text-align: center;">
|
86 |
<?php
|
87 |
if ($p['bkpwp_preset_options']['default'] != 1) {
|
88 |
-
|
89 |
} else {
|
90 |
-
|
91 |
}
|
92 |
?>
|
93 |
</td>
|
@@ -106,33 +123,13 @@ $presets = $backups->bkpwp_get_presets();
|
|
106 |
?>
|
107 |
<div class="wrap">
|
108 |
<script type="text/javascript">
|
109 |
-
|
110 |
-
function save_preset() {
|
111 |
-
var name;
|
112 |
-
var archive_type;
|
113 |
-
var excludelist;
|
114 |
-
var sql_only;
|
115 |
-
name = document.getElementById('mod_bkpwp_preset_name').value;
|
116 |
-
archive_type = document.getElementById('mod_bkpwp_archive_type').value;
|
117 |
-
excludelist = document.getElementById('mod_bkpwp_excludelist').value;
|
118 |
-
sql_only = document.getElementById('mod_bkpwp_sql_only').value;
|
119 |
-
x_bkpwp_ajax_save_preset(name,archive_type,excludelist,sql_only,"");
|
120 |
-
}
|
121 |
-
|
122 |
-
function delete_preset() {
|
123 |
-
var name;
|
124 |
-
name = document.getElementById('mod_bkpwp_preset_name').value;
|
125 |
-
x_bkpwp_ajax_delete_preset(name,"");
|
126 |
-
}
|
127 |
-
|
128 |
function is_loading(divid) {
|
|
|
129 |
document.getElementById(divid).innerHTML="<img src='<?php bloginfo("url"); ?>/wp-content/plugins/backupwordpress/images/loading.gif' />";
|
130 |
}
|
131 |
<!-- displays a loading text information while doing ajax requests -->
|
132 |
function bkpwp_js_loading(str) {
|
133 |
-
document.getElementById('bkpwp_actions').style.display = 'block';
|
134 |
is_loading('bkpwp_action_buffer');
|
135 |
-
sajax_target_id = 'bkpwp_action_buffer';
|
136 |
document.getElementById('bkpwp_action_title').innerHTML="<h4>" + str + "</h4>";
|
137 |
}
|
138 |
</script>
|
14 |
$preset = $backups->bkpwp_get_preset($_REQUEST['mod_bkpwp_preset_name']);
|
15 |
echo $backups->bkpwp_load_preset($preset);
|
16 |
}
|
17 |
+
|
18 |
+
/* delete the backup (but leave the logfile for a while!) */
|
19 |
if (!empty($_REQUEST['bkpwp_delete_preset'])) {
|
20 |
+
$backups->bkpwp_delete_preset(urldecode($_REQUEST['bkpwp_delete_preset']));
|
21 |
+
}
|
22 |
+
|
23 |
+
if (!empty($_REQUEST['mod_bkpwp_preset_name'])) {
|
24 |
+
echo $backups->bkpwp_save_preset($_REQUEST['mod_bkpwp_preset_name'],$_REQUEST['mod_bkpwp_archive_type'],$_REQUEST['mod_bkpwp_excludelist'],$_REQUEST['mod_bkpwp_sql_only']);
|
25 |
+
$backups = new BKPWP_MANAGE();
|
26 |
+
$backups->options = new BKPWP_OPTIONS();
|
27 |
+
$presets = $backups->bkpwp_get_presets();
|
28 |
}
|
29 |
?>
|
30 |
<table class="widefat">
|
76 |
<td style="text-align: center;">
|
77 |
<?php
|
78 |
echo " <a href=\"javascript:void(0)\"
|
79 |
+
onclick=\"is_loading('bkpwp_action_buffer');
|
80 |
+
ajax = new Ajax.Updater(
|
81 |
+
'bkpwp_action_buffer',
|
82 |
+
'".get_bloginfo("wpurl")."/wp-admin/admin.php?page=backupwordpress/backupwordpress.php"."',
|
83 |
+
{
|
84 |
+
method:'post',
|
85 |
+
postBody:'bkpwp_load_preset=".$p['bkpwp_preset_name']."'
|
86 |
+
});\">".__("edit","bkpwp")."</a>";
|
87 |
?>
|
88 |
</td>
|
89 |
<td style="text-align: center;">
|
90 |
<?php
|
91 |
echo " <a href=\"javascript:void(0)\"
|
92 |
+
onclick=\"is_loading('bkpwp_action_buffer');
|
93 |
+
ajax = new Ajax.Updater(
|
94 |
+
'bkpwp_action_buffer',
|
95 |
+
'".get_bloginfo("wpurl")."/wp-admin/admin.php?page=backupwordpress/backupwordpress.php"."',
|
96 |
+
{
|
97 |
+
method:'post',
|
98 |
+
postBody:'bkpwp_view_preset=".$p['bkpwp_preset_name']."'
|
99 |
+
});\">".__("view","bkpwp")."</a>";
|
100 |
?>
|
101 |
</td>
|
102 |
<td style="text-align: center;">
|
103 |
<?php
|
104 |
if ($p['bkpwp_preset_options']['default'] != 1) {
|
105 |
+
echo " <a href=\"admin.php?page=bkpwp_manage_presets&bkpwp_delete_preset=".$p['bkpwp_preset_name']."\">".__("delete","bkpwp")."</a>";
|
106 |
} else {
|
107 |
+
echo __("default","bkpwp");
|
108 |
}
|
109 |
?>
|
110 |
</td>
|
123 |
?>
|
124 |
<div class="wrap">
|
125 |
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
function is_loading(divid) {
|
127 |
+
document.getElementById('bkpwp_actions').style.display = 'block';
|
128 |
document.getElementById(divid).innerHTML="<img src='<?php bloginfo("url"); ?>/wp-content/plugins/backupwordpress/images/loading.gif' />";
|
129 |
}
|
130 |
<!-- displays a loading text information while doing ajax requests -->
|
131 |
function bkpwp_js_loading(str) {
|
|
|
132 |
is_loading('bkpwp_action_buffer');
|
|
|
133 |
document.getElementById('bkpwp_action_title').innerHTML="<h4>" + str + "</h4>";
|
134 |
}
|
135 |
</script>
|
bkpwp-pages/bkpwp_options.php
CHANGED
@@ -147,10 +147,19 @@ $bkpwppath = get_option("bkpwppath");
|
|
147 |
function do_show_nobfiles() {
|
148 |
x_bkpwp_ajax_shownobfiles('<?php echo urlencode($listn); ?>',"","");
|
149 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
function loading_shownobfiles() {
|
151 |
document.getElementById('bkpwp_actions').style.display="block";
|
152 |
document.getElementById('bkpwp_action_title').innerHTML="<br /><?php _e("Files & Folders that will NOT (!) be included in the Backup when using ","bkpwp"); echo $_REQUEST['excludelist_to_change']; ?><br /><br />";
|
153 |
-
document.getElementById('bkpwp_action_buffer').innerHTML="<img src='<?php bloginfo("
|
154 |
}
|
155 |
</script>
|
156 |
<div id="bkpwp_actions" style="display:none;">
|
@@ -202,7 +211,7 @@ $bkpwppath = get_option("bkpwppath");
|
|
202 |
<?php } else { ?>
|
203 |
<p><?php _e("this is a Default Exclude List","bkpwp"); ?>
|
204 |
<?php } ?>
|
205 |
-
<button class="button" onclick="loading_shownobfiles();
|
206 |
</p>
|
207 |
<?php } else { ?>
|
208 |
<h4><?php _e("New Exclude List","bkpwp"); ?></h4>
|
147 |
function do_show_nobfiles() {
|
148 |
x_bkpwp_ajax_shownobfiles('<?php echo urlencode($listn); ?>',"","");
|
149 |
}
|
150 |
+
function do_show_nobfiles2() {
|
151 |
+
ajax = new Ajax.Updater(
|
152 |
+
'bkpwp_action_buffer', // DIV id must be declared before the method was called
|
153 |
+
'<?php echo get_bloginfo("wpurl")."/wp-admin/admin.php?page=backupwordpress/backupwordpress.php"; ?>', // URL
|
154 |
+
{ // options
|
155 |
+
method:'post',
|
156 |
+
postBody:'bkpwp_view_excludelist=<?php echo $listn; ?>'
|
157 |
+
});
|
158 |
+
}
|
159 |
function loading_shownobfiles() {
|
160 |
document.getElementById('bkpwp_actions').style.display="block";
|
161 |
document.getElementById('bkpwp_action_title').innerHTML="<br /><?php _e("Files & Folders that will NOT (!) be included in the Backup when using ","bkpwp"); echo $_REQUEST['excludelist_to_change']; ?><br /><br />";
|
162 |
+
document.getElementById('bkpwp_action_buffer').innerHTML="<img src='<?php bloginfo("wpurl"); ?>/wp-content/plugins/backupwordpress/images/loading.gif' />";
|
163 |
}
|
164 |
</script>
|
165 |
<div id="bkpwp_actions" style="display:none;">
|
211 |
<?php } else { ?>
|
212 |
<p><?php _e("this is a Default Exclude List","bkpwp"); ?>
|
213 |
<?php } ?>
|
214 |
+
<button class="button" onclick="loading_shownobfiles(); do_show_nobfiles2(); return false;">» <?php _e("Show excluded files","bkpwp"); ?></button>
|
215 |
</p>
|
216 |
<?php } else { ?>
|
217 |
<h4><?php _e("New Exclude List","bkpwp"); ?></h4>
|
bkpwp-pages/bkpwp_schedule.php
CHANGED
@@ -7,22 +7,28 @@ function bkpwp_schedulelist($bkpwppath) {
|
|
7 |
echo "<p>".__("Info: Creating custom schedules is on the wishlist for BackUpWordPress 2.0.","bkpwp")."</p>";
|
8 |
?>
|
9 |
<script type="text/javascript">
|
|
|
10 |
<!-- ajax call for calculating disk space usage -->
|
11 |
-
function
|
12 |
var preset;
|
13 |
<?php if (!$backups->options->bkpwp_easy_mode()) { ?>
|
14 |
preset = document.getElementById('bkpwp_preset').value;
|
15 |
<?php } else { ?>
|
16 |
preset = "full backup";
|
17 |
<?php } ?>
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
}
|
20 |
|
21 |
<!-- displays a loading text information while doing ajax requests -->
|
22 |
function bkpwp_js_loading(str) {
|
23 |
document.getElementById('bkpwp_actions').style.display = 'block';
|
24 |
is_loading('bkpwp_action_buffer');
|
25 |
-
sajax_target_id = 'bkpwp_action_buffer';
|
26 |
document.getElementById('bkpwp_action_title').innerHTML="<h4>" + str + "</h4>";
|
27 |
}
|
28 |
</script>
|
@@ -110,7 +116,7 @@ function bkpwp_schedulelist($bkpwppath) {
|
|
110 |
?>
|
111 |
<a title="<?php _e("Recalculate Backup size","bkpwp"); ?>"
|
112 |
href="javascript:void(0);"
|
113 |
-
onclick="document.getElementById('bkpwp_preset').value='<?php echo $options['preset']; ?>'; bkpwp_js_loading('<?php _e("Calculating file sizes","bkpwp"); ?>');
|
114 |
</td>
|
115 |
<td>
|
116 |
<?php
|
7 |
echo "<p>".__("Info: Creating custom schedules is on the wishlist for BackUpWordPress 2.0.","bkpwp")."</p>";
|
8 |
?>
|
9 |
<script type="text/javascript">
|
10 |
+
|
11 |
<!-- ajax call for calculating disk space usage -->
|
12 |
+
function calculate2() {
|
13 |
var preset;
|
14 |
<?php if (!$backups->options->bkpwp_easy_mode()) { ?>
|
15 |
preset = document.getElementById('bkpwp_preset').value;
|
16 |
<?php } else { ?>
|
17 |
preset = "full backup";
|
18 |
<?php } ?>
|
19 |
+
ajax = new Ajax.Updater(
|
20 |
+
'bkpwp_action_buffer', // DIV id must be declared before the method was called
|
21 |
+
'<?php echo get_bloginfo("wpurl")."/wp-admin/admin.php?page=backupwordpress/backupwordpress.php"; ?>', // URL
|
22 |
+
{ // options
|
23 |
+
method:'post',
|
24 |
+
postBody:'bkpwp_calculate_preset='+preset
|
25 |
+
});
|
26 |
}
|
27 |
|
28 |
<!-- displays a loading text information while doing ajax requests -->
|
29 |
function bkpwp_js_loading(str) {
|
30 |
document.getElementById('bkpwp_actions').style.display = 'block';
|
31 |
is_loading('bkpwp_action_buffer');
|
|
|
32 |
document.getElementById('bkpwp_action_title').innerHTML="<h4>" + str + "</h4>";
|
33 |
}
|
34 |
</script>
|
116 |
?>
|
117 |
<a title="<?php _e("Recalculate Backup size","bkpwp"); ?>"
|
118 |
href="javascript:void(0);"
|
119 |
+
onclick="document.getElementById('bkpwp_preset').value='<?php echo $options['preset']; ?>'; bkpwp_js_loading('<?php _e("Calculating file sizes","bkpwp"); ?>'); calculate2(); return false;">»</a>
|
120 |
</td>
|
121 |
<td>
|
122 |
<?php
|
functions-interface.php
CHANGED
@@ -15,61 +15,6 @@ function bkpwp_display_message($msg) {
|
|
15 |
<?php
|
16 |
}
|
17 |
|
18 |
-
function bkpwp_display_console() {
|
19 |
-
?>
|
20 |
-
<textarea id="bkpwp_console"></textarea><br /><br />
|
21 |
-
<?php
|
22 |
-
flush();
|
23 |
-
}
|
24 |
-
|
25 |
-
function bkpwp_console($msg,$all=true) {
|
26 |
-
echo "<script>
|
27 |
-
var objDiv = document.getElementById('bkpwp_console');
|
28 |
-
objDiv.value ";
|
29 |
-
if ($all == true) {
|
30 |
-
echo "+";
|
31 |
-
} else {
|
32 |
-
$msg = "[...]".$msg;
|
33 |
-
}
|
34 |
-
echo "= '".$msg."';
|
35 |
-
objDiv.scrollTop = objDiv.scrollHeight;
|
36 |
-
currentTime();</script>";
|
37 |
-
flush();
|
38 |
-
}
|
39 |
-
|
40 |
-
function bkpwp_sajax_do() {
|
41 |
-
// maybe some other module has sajax allready built in? (zenphoto, cforms,...)
|
42 |
-
if (!function_exists("sajax_handle_client_request")) {
|
43 |
-
require_once $GLOBALS['bkpwp_plugin_path']."Sajax.php";
|
44 |
-
}
|
45 |
-
//$GLOBALS['sajax_debug_mode'] = 1;
|
46 |
-
|
47 |
-
sajax_init();
|
48 |
-
sajax_export("bkpwp_ajax_calculater",
|
49 |
-
"bkpwp_ajax_create",
|
50 |
-
"bkpwp_ajax_shownobfiles",
|
51 |
-
"bkpwp_ajax_load_preset",
|
52 |
-
"bkpwp_ajax_view_preset",
|
53 |
-
"bkpwp_ajax_view_backup",
|
54 |
-
"bkpwp_ajax_save_preset",
|
55 |
-
"bkpwp_ajax_delete_preset",
|
56 |
-
"bkpwp_reload_table");
|
57 |
-
sajax_handle_client_request();
|
58 |
-
}
|
59 |
-
|
60 |
-
function bkpwp_sajax_js() {
|
61 |
-
bkpwp_sajax_do();
|
62 |
-
?>
|
63 |
-
<script>
|
64 |
-
<?php
|
65 |
-
if (function_exists("sajax_show_javascript")) {
|
66 |
-
sajax_show_javascript();
|
67 |
-
}
|
68 |
-
?>
|
69 |
-
</script>
|
70 |
-
<?php
|
71 |
-
}
|
72 |
-
|
73 |
function bkpwp_load_css_and_js() {
|
74 |
echo "<style type='text/css'>
|
75 |
h2 {
|
@@ -87,13 +32,6 @@ function bkpwp_load_css_and_js() {
|
|
87 |
.success {
|
88 |
color: green;
|
89 |
}
|
90 |
-
#bkpwp_console {
|
91 |
-
font-family: monospace;
|
92 |
-
color:#EEE;
|
93 |
-
width: 750px; min-height: 120px;
|
94 |
-
background: #000;
|
95 |
-
border: 1px solid lime;
|
96 |
-
}
|
97 |
.bkpwp_manage_backups_newrow {
|
98 |
background: #99FF66;
|
99 |
}
|
@@ -113,7 +51,7 @@ function bkpwp_load_css_and_js() {
|
|
113 |
<!-- displays a loading animation while doing ajax requests -->
|
114 |
function is_loading(divid) {
|
115 |
document.getElementById(divid).style.display = 'block';
|
116 |
-
document.getElementById(divid).innerHTML="<img src='<?php bloginfo("
|
117 |
}
|
118 |
</script>
|
119 |
|
15 |
<?php
|
16 |
}
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
function bkpwp_load_css_and_js() {
|
19 |
echo "<style type='text/css'>
|
20 |
h2 {
|
32 |
.success {
|
33 |
color: green;
|
34 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
.bkpwp_manage_backups_newrow {
|
36 |
background: #99FF66;
|
37 |
}
|
51 |
<!-- displays a loading animation while doing ajax requests -->
|
52 |
function is_loading(divid) {
|
53 |
document.getElementById(divid).style.display = 'block';
|
54 |
+
document.getElementById(divid).innerHTML="<img src='<?php bloginfo("wpurl"); ?>/wp-content/plugins/backupwordpress/images/loading.gif' />";
|
55 |
}
|
56 |
</script>
|
57 |
|
functions.php
CHANGED
@@ -277,18 +277,6 @@ function bkpwp_ajax_shownobfiles($excludelist) {
|
|
277 |
return $ret;
|
278 |
}
|
279 |
|
280 |
-
function bkpwp_ajax_save_preset($name="",$archive_type="",$excludelist="",$sql_only="") {
|
281 |
-
$backup = new BKPWP_MANAGE();
|
282 |
-
$ret = $backup->bkpwp_save_preset($name,$archive_type,$excludelist,$sql_only);
|
283 |
-
return $ret;
|
284 |
-
}
|
285 |
-
|
286 |
-
function bkpwp_ajax_delete_preset($name) {
|
287 |
-
$backup = new BKPWP_MANAGE();
|
288 |
-
$ret = $backup->bkpwp_delete_preset($name);
|
289 |
-
return $ret;
|
290 |
-
}
|
291 |
-
|
292 |
function bkpwp_ajax_calculater($preset="") {
|
293 |
$backup = new BKPWP_BACKUP();
|
294 |
$backup->preset = new BKPWP_MANAGE();
|
277 |
return $ret;
|
278 |
}
|
279 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
function bkpwp_ajax_calculater($preset="") {
|
281 |
$backup = new BKPWP_BACKUP();
|
282 |
$backup->preset = new BKPWP_MANAGE();
|
readme.txt
CHANGED
@@ -62,7 +62,6 @@ BackUpWordPress utilizes several Open Source Tools:
|
|
62 |
+ [PEAR](http://pear.php.net/package/PEAR/)
|
63 |
+ [FILE_ARCHIVE](http://pear.php.net/package/File_Archive) for compression/decompression
|
64 |
+ [bigdump](http://www.ozerov.de/bigdump.php) for staggered sql import
|
65 |
-
+ [Sajax](http://www.modernmethod.com/sajax/) for ajax support
|
66 |
|
67 |
Some pieces of code have been modified:
|
68 |
|
@@ -77,6 +76,7 @@ Changes in 0.2.7:
|
|
77 |
|
78 |
+ manage presets. link to configure excludelists corrected
|
79 |
+ require_once instead of require for class-phpmailer.php
|
|
|
80 |
|
81 |
Changes in 0.2.6:
|
82 |
|
62 |
+ [PEAR](http://pear.php.net/package/PEAR/)
|
63 |
+ [FILE_ARCHIVE](http://pear.php.net/package/File_Archive) for compression/decompression
|
64 |
+ [bigdump](http://www.ozerov.de/bigdump.php) for staggered sql import
|
|
|
65 |
|
66 |
Some pieces of code have been modified:
|
67 |
|
76 |
|
77 |
+ manage presets. link to configure excludelists corrected
|
78 |
+ require_once instead of require for class-phpmailer.php
|
79 |
+
+ Sajax is replaces by prototype. this resolves the "backup hangs" bug on hosts with hardened php (register_globals: off, safe_mode: on, etc.)
|
80 |
|
81 |
Changes in 0.2.6:
|
82 |
|