Version Description
Please, keep your Dropbox Backup and Restore plugin up-to-date.
Download this release
Release Info
Developer | backup-dropbox |
Plugin | Backup & Restore Dropbox |
Version | 1.4.6.2 |
Comparing to | |
See all releases |
Code changes from version 1.4.6 to 1.4.6.2
- dropbox-backup.php +1 -1
- functions/wpadm.php +0 -6
- libs/wpadm.server.main.class.php +1 -1
- main/wpadm-class-wp.php +14 -10
- methods/class-wpadm-method-backup.php +3 -0
- methods/class-wpadm-method-full-backup-dropbox.php +3 -0
- methods/class-wpadm-method-local-backup.php +23 -2
- modules/class-wpadm-core.php +8 -4
- modules/class-wpadm-mysqldump.php +37 -0
- modules/class-wpadm-running.php +1 -0
- modules/restore-class.php +79 -31
- readme.txt +22 -6
- template/expsys.php +1 -1
- template/js/admin-wpadm.js +5 -0
- template/wpadm_show_backup.php +32 -12
dropbox-backup.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Dropbox Backup & Restore
|
4 |
Description: Dropbox Backup & Restore Plugin to create Dropbox Full Backup (Files + Database) of your Web Page
|
5 |
-
Version: 1.4.
|
6 |
Text Domain: dropbox-backup
|
7 |
Domain Path: /languages/
|
8 |
*/
|
2 |
/*
|
3 |
Plugin Name: Dropbox Backup & Restore
|
4 |
Description: Dropbox Backup & Restore Plugin to create Dropbox Full Backup (Files + Database) of your Web Page
|
5 |
+
Version: 1.4.6.2
|
6 |
Text Domain: dropbox-backup
|
7 |
Domain Path: /languages/
|
8 |
*/
|
functions/wpadm.php
CHANGED
@@ -44,12 +44,6 @@ if ( ! function_exists('wpadm_pack')) {
|
|
44 |
}
|
45 |
}
|
46 |
|
47 |
-
if ( ! function_exists('wpadm_admin_notice')) {
|
48 |
-
function wpadm_admin_notice() {
|
49 |
-
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
|
54 |
if ( ! function_exists('wpadm_deactivation')) {
|
55 |
function wpadm_deactivation() {
|
44 |
}
|
45 |
}
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
if ( ! function_exists('wpadm_deactivation')) {
|
49 |
function wpadm_deactivation() {
|
libs/wpadm.server.main.class.php
CHANGED
@@ -800,7 +800,7 @@
|
|
800 |
<?php $ex = $c['ex']; ?>
|
801 |
<td><?php echo ( $ex ) === false ? 'All present' : '<span style="color:#ffba00;font-weight:bold;">' . implode(", ", $ex) . '</span>'; ?></td>
|
802 |
<td><?php echo ( $ex ) === false ? 'Found' : '<span style="color:#ffba00;font-weight:bold;">Not Found</span>'; ?></td>
|
803 |
-
<td><?php echo ( $ex ) === false ? '<span style="color:green;font-weight:bold;">Ok</span>' : '<span style="color:#fb8004;font-weight:bold;">Functionality
|
804 |
</tr>
|
805 |
<tr>
|
806 |
<th scope="row">Disabled Functions</th>
|
800 |
<?php $ex = $c['ex']; ?>
|
801 |
<td><?php echo ( $ex ) === false ? 'All present' : '<span style="color:#ffba00;font-weight:bold;">' . implode(", ", $ex) . '</span>'; ?></td>
|
802 |
<td><?php echo ( $ex ) === false ? 'Found' : '<span style="color:#ffba00;font-weight:bold;">Not Found</span>'; ?></td>
|
803 |
+
<td><?php echo ( $ex ) === false ? '<span style="color:green;font-weight:bold;">Ok</span>' : '<span style="color:#fb8004;font-weight:bold;">Functionality is not guaranteed.</span>'; ?></td>
|
804 |
</tr>
|
805 |
<tr>
|
806 |
<th scope="row">Disabled Functions</th>
|
main/wpadm-class-wp.php
CHANGED
@@ -154,7 +154,7 @@
|
|
154 |
}
|
155 |
public static function saveSetting()
|
156 |
{
|
157 |
-
if (isset($_POST['is_admin']) || isset($_POST['is_optimization']) || isset($_POST['is_local_backup_delete'])) {
|
158 |
|
159 |
$dropbox_options = get_option(PREFIX_BACKUP_ . 'dropbox-setting');
|
160 |
if ($dropbox_options) {
|
@@ -168,7 +168,10 @@
|
|
168 |
}
|
169 |
if (isset($_POST['is_local_backup_delete'])) {
|
170 |
$dropbox_options['is_local_backup_delete'] = (int) $_POST['is_local_backup_delete'];
|
171 |
-
}
|
|
|
|
|
|
|
172 |
update_option(PREFIX_BACKUP_ . 'dropbox-setting', base64_encode( serialize( $dropbox_options ) ) );
|
173 |
}
|
174 |
}
|
@@ -197,11 +200,12 @@
|
|
197 |
}
|
198 |
WPAdm_Core::mkdir(DROPBOX_BACKUP_DIR_BACKUP);
|
199 |
WPAdm_Running::init_params_default();
|
200 |
-
if ( WPAdm_Core::dir_writeble(DROPBOX_BACKUP_DIR_BACKUP)) {
|
201 |
WPAdm_Running::delCommandResultData("local_backup");
|
202 |
$dropbox_options = self::getSettings();
|
203 |
$optimization = (isset($dropbox_options['is_optimization']) && $dropbox_options['is_optimization'] == 1) || (!isset($dropbox_options['is_optimization'])) ? 1 : 0;
|
204 |
-
$
|
|
|
205 |
if (WPAdm_Core::$cron === false) {
|
206 |
$res = $backup->getResult()->toArray();
|
207 |
$res['md5_data'] = md5( print_r($res, 1) );
|
@@ -491,8 +495,7 @@
|
|
491 |
if (file_exists(WPAdm_Core::getTmpDir() . "/log.log")) {
|
492 |
file_put_contents(WPAdm_Core::getTmpDir() . "/log.log", '');
|
493 |
}
|
494 |
-
if ( WPAdm_Core::dir_writeble(DROPBOX_BACKUP_DIR_BACKUP)
|
495 |
-
file_put_contents(WPAdm_Core::getTmpDir() . "/create-backup", 1);
|
496 |
$dropbox_options = get_option(PREFIX_BACKUP_ . 'dropbox-setting');
|
497 |
$send_to_dropbox = true;
|
498 |
if ($dropbox_options) {
|
@@ -521,7 +524,8 @@
|
|
521 |
WPAdm_Running::delCommandResultData("local_backup");
|
522 |
$dropbox_options = self::getSettings();
|
523 |
$optimization = (isset($dropbox_options['is_optimization']) && $dropbox_options['is_optimization'] == 1) || (!isset($dropbox_options['is_optimization'])) ? 1 : 0;
|
524 |
-
$
|
|
|
525 |
$res = array();
|
526 |
if (WPAdm_Core::$cron === false) {
|
527 |
$res = $backup->getResult()->toArray();
|
@@ -563,9 +567,6 @@
|
|
563 |
$res['data'] = array();
|
564 |
$res['size'] = 0;
|
565 |
}
|
566 |
-
if (file_exists(WPAdm_Core::getTmpDir() . "/create-backup")) {
|
567 |
-
@unlink( WPAdm_Core::getTmpDir() . "/create-backup" );
|
568 |
-
}
|
569 |
}
|
570 |
} else {
|
571 |
$res['result'] = 'error';
|
@@ -581,6 +582,9 @@
|
|
581 |
{
|
582 |
$folder_project = str_ireplace( array("http://", "https://"), '', home_url() );
|
583 |
$folder_project = str_ireplace( array( "-", '/', '.'), '_', $folder_project );
|
|
|
|
|
|
|
584 |
return $folder_project;
|
585 |
}
|
586 |
|
154 |
}
|
155 |
public static function saveSetting()
|
156 |
{
|
157 |
+
if (isset($_POST['is_admin']) || isset($_POST['is_optimization']) || isset($_POST['is_local_backup_delete']) || isset($_POST['is_repair']) ) {
|
158 |
|
159 |
$dropbox_options = get_option(PREFIX_BACKUP_ . 'dropbox-setting');
|
160 |
if ($dropbox_options) {
|
168 |
}
|
169 |
if (isset($_POST['is_local_backup_delete'])) {
|
170 |
$dropbox_options['is_local_backup_delete'] = (int) $_POST['is_local_backup_delete'];
|
171 |
+
}
|
172 |
+
if (isset($_POST['is_repair'])) {
|
173 |
+
$dropbox_options['is_repair'] = (int) $_POST['is_repair'];
|
174 |
+
}
|
175 |
update_option(PREFIX_BACKUP_ . 'dropbox-setting', base64_encode( serialize( $dropbox_options ) ) );
|
176 |
}
|
177 |
}
|
200 |
}
|
201 |
WPAdm_Core::mkdir(DROPBOX_BACKUP_DIR_BACKUP);
|
202 |
WPAdm_Running::init_params_default();
|
203 |
+
if ( WPAdm_Core::dir_writeble(DROPBOX_BACKUP_DIR_BACKUP) ) {
|
204 |
WPAdm_Running::delCommandResultData("local_backup");
|
205 |
$dropbox_options = self::getSettings();
|
206 |
$optimization = (isset($dropbox_options['is_optimization']) && $dropbox_options['is_optimization'] == 1) || (!isset($dropbox_options['is_optimization'])) ? 1 : 0;
|
207 |
+
$repair = (isset($dropbox_options['is_repair']) && $dropbox_options['is_repair'] == 1) ? 1 : 0;
|
208 |
+
$backup = new WPAdm_Core(array('method' => "local_backup", 'params' => array('optimize' => $optimization, 'repair' => $repair, 'limit' => 0, 'time' => @$_POST['time'], 'types' => array('db', 'files') )), 'full_backup_dropbox', WPAdm_Core::$pl_dir);
|
209 |
if (WPAdm_Core::$cron === false) {
|
210 |
$res = $backup->getResult()->toArray();
|
211 |
$res['md5_data'] = md5( print_r($res, 1) );
|
495 |
if (file_exists(WPAdm_Core::getTmpDir() . "/log.log")) {
|
496 |
file_put_contents(WPAdm_Core::getTmpDir() . "/log.log", '');
|
497 |
}
|
498 |
+
if ( WPAdm_Core::dir_writeble(DROPBOX_BACKUP_DIR_BACKUP) ) {
|
|
|
499 |
$dropbox_options = get_option(PREFIX_BACKUP_ . 'dropbox-setting');
|
500 |
$send_to_dropbox = true;
|
501 |
if ($dropbox_options) {
|
524 |
WPAdm_Running::delCommandResultData("local_backup");
|
525 |
$dropbox_options = self::getSettings();
|
526 |
$optimization = (isset($dropbox_options['is_optimization']) && $dropbox_options['is_optimization'] == 1) || (!isset($dropbox_options['is_optimization'])) ? 1 : 0;
|
527 |
+
$repair = (isset($dropbox_options['is_repair']) && $dropbox_options['is_repair'] == 1) ? 1 : 0;
|
528 |
+
$backup_local = new WPAdm_Core(array('method' => "local_backup", 'params' => array('optimize' => $optimization, 'repair' => $repair, 'limit' => 0, 'time' => @$_POST['time'], 'types' => array('db', 'files') )), 'full_backup_dropbox', WPAdm_Core::$pl_dir);
|
529 |
$res = array();
|
530 |
if (WPAdm_Core::$cron === false) {
|
531 |
$res = $backup->getResult()->toArray();
|
567 |
$res['data'] = array();
|
568 |
$res['size'] = 0;
|
569 |
}
|
|
|
|
|
|
|
570 |
}
|
571 |
} else {
|
572 |
$res['result'] = 'error';
|
582 |
{
|
583 |
$folder_project = str_ireplace( array("http://", "https://"), '', home_url() );
|
584 |
$folder_project = str_ireplace( array( "-", '/', '.'), '_', $folder_project );
|
585 |
+
$folder_project = str_ireplace( array( 'Ä', 'ä', 'Ö', 'ö', 'ß', 'Ü', 'ü', 'å'),
|
586 |
+
array('ae', 'ae', 'oe', 'oe', 's', 'ue', 'ue', 'a'),
|
587 |
+
$folder_project );
|
588 |
return $folder_project;
|
589 |
}
|
590 |
|
methods/class-wpadm-method-backup.php
CHANGED
@@ -55,6 +55,9 @@ if (!class_exists('WPadm_Method_Backup')) {
|
|
55 |
$name = str_replace("http://", '', $name);
|
56 |
$name = str_replace("https://", '', $name);
|
57 |
$name = preg_replace("|\W|", "_", $name);
|
|
|
|
|
|
|
58 |
$name .= '-' . $this->type . '-' . date("Y_m_d_H_i");
|
59 |
$this->name = $name;
|
60 |
|
55 |
$name = str_replace("http://", '', $name);
|
56 |
$name = str_replace("https://", '', $name);
|
57 |
$name = preg_replace("|\W|", "_", $name);
|
58 |
+
$name = str_ireplace( array( 'Ä', 'ä', 'Ö', 'ö', 'ß', 'Ü', 'ü', 'å'),
|
59 |
+
array('ae', 'ae', 'oe', 'oe', 's', 'ue', 'ue', 'a'),
|
60 |
+
$name );
|
61 |
$name .= '-' . $this->type . '-' . date("Y_m_d_H_i");
|
62 |
$this->name = $name;
|
63 |
|
methods/class-wpadm-method-full-backup-dropbox.php
CHANGED
@@ -54,6 +54,9 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
54 |
|
55 |
$name = str_replace("http://", '', $name);
|
56 |
$name = str_replace("https://", '', $name);
|
|
|
|
|
|
|
57 |
$name = preg_replace("|\W|", "_", $name);
|
58 |
$name .= '-' . $this->type . '-' . date("Y_m_d_H_i");
|
59 |
$this->name = $name;
|
54 |
|
55 |
$name = str_replace("http://", '', $name);
|
56 |
$name = str_replace("https://", '', $name);
|
57 |
+
$name = str_ireplace( array( 'Ä', 'ä', 'Ö', 'ö', 'ß', 'Ü', 'ü', 'å'),
|
58 |
+
array('ae', 'ae', 'oe', 'oe', 's', 'ue', 'ue', 'a'),
|
59 |
+
$name );
|
60 |
$name = preg_replace("|\W|", "_", $name);
|
61 |
$name .= '-' . $this->type . '-' . date("Y_m_d_H_i");
|
62 |
$this->name = $name;
|
methods/class-wpadm-method-local-backup.php
CHANGED
@@ -22,6 +22,9 @@ if (!class_exists('WPAdm_Method_Local_Backup')) {
|
|
22 |
|
23 |
$name = str_replace("http://", '', $name);
|
24 |
$name = str_replace("https://", '', $name);
|
|
|
|
|
|
|
25 |
$name = preg_replace("|\W|", "_", $name);
|
26 |
if (isset($params['time']) && !empty($params['time'])) { // time 1432751372
|
27 |
$this->time = date("Y-m-d H:i", $params['time']);
|
@@ -86,8 +89,24 @@ if (!class_exists('WPAdm_Method_Local_Backup')) {
|
|
86 |
unlink($mysql_dump_file);
|
87 |
}
|
88 |
$wp_mysql_params = $this->getWpMysqlParams();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
-
if (isset($this->params['optimize']) && ($this->params['optimize']==1)) {
|
91 |
$opt_db = WPAdm_Running::getCommandResultData('db', $proc_data);
|
92 |
if (!isset($opt_db['optimize'])) {
|
93 |
WPAdm_Core::log(__('Optimize Database Tables','dropbox-backup'));
|
@@ -101,7 +120,9 @@ if (!class_exists('WPAdm_Method_Local_Backup')) {
|
|
101 |
->add($commandContext);
|
102 |
unset($commandContext);
|
103 |
}
|
104 |
-
}
|
|
|
|
|
105 |
|
106 |
$commandContext = new WPAdm_Command_Context();
|
107 |
$commandContext ->addParam('command','mysqldump')
|
22 |
|
23 |
$name = str_replace("http://", '', $name);
|
24 |
$name = str_replace("https://", '', $name);
|
25 |
+
$name = str_ireplace( array( 'Ä', 'ä', 'Ö', 'ö', 'ß', 'Ü', 'ü', 'å'),
|
26 |
+
array('ae', 'ae', 'oe', 'oe', 's', 'ue', 'ue', 'a'),
|
27 |
+
$name );
|
28 |
$name = preg_replace("|\W|", "_", $name);
|
29 |
if (isset($params['time']) && !empty($params['time'])) { // time 1432751372
|
30 |
$this->time = date("Y-m-d H:i", $params['time']);
|
89 |
unlink($mysql_dump_file);
|
90 |
}
|
91 |
$wp_mysql_params = $this->getWpMysqlParams();
|
92 |
+
|
93 |
+
if ( isset($this->params['repair']) && ( $this->params['repair'] == 1 ) ) {
|
94 |
+
require_once WPAdm_Core::getPluginDir() . '/modules/class-wpadm-mysqldump.php';
|
95 |
+
$mysql = new WPAdm_Mysqldump();
|
96 |
+
$mysql->host = $wp_mysql_params['host'];
|
97 |
+
$mysql->user = $wp_mysql_params['user'];
|
98 |
+
$mysql->password = $wp_mysql_params['password'];
|
99 |
+
try {
|
100 |
+
$mysql->repair($wp_mysql_params['db']);
|
101 |
+
} catch (Exception $e) {
|
102 |
+
$this->result->setError( $e->getMessage() );
|
103 |
+
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
104 |
+
return false;
|
105 |
+
}
|
106 |
+
|
107 |
+
}
|
108 |
|
109 |
+
if (isset($this->params['optimize']) && ($this->params['optimize']==1 ) ) {
|
110 |
$opt_db = WPAdm_Running::getCommandResultData('db', $proc_data);
|
111 |
if (!isset($opt_db['optimize'])) {
|
112 |
WPAdm_Core::log(__('Optimize Database Tables','dropbox-backup'));
|
120 |
->add($commandContext);
|
121 |
unset($commandContext);
|
122 |
}
|
123 |
+
}
|
124 |
+
|
125 |
+
|
126 |
|
127 |
$commandContext = new WPAdm_Command_Context();
|
128 |
$commandContext ->addParam('command','mysqldump')
|
modules/class-wpadm-core.php
CHANGED
@@ -303,11 +303,15 @@ if (!class_exists('WPAdm_Core')) {
|
|
303 |
{
|
304 |
$error = self::mkdir($dir);
|
305 |
$ret = true;
|
306 |
-
if (empty($dir)) {
|
307 |
@file_put_contents($dir . "/test", "Hello World!!!");
|
308 |
-
|
309 |
-
|
310 |
-
|
|
|
|
|
|
|
|
|
311 |
@unlink($dir . "/test");
|
312 |
}
|
313 |
return $ret;
|
303 |
{
|
304 |
$error = self::mkdir($dir);
|
305 |
$ret = true;
|
306 |
+
if (!empty($dir)) {
|
307 |
@file_put_contents($dir . "/test", "Hello World!!!");
|
308 |
+
if (file_exists($dir . "/test")) {
|
309 |
+
if (!@is_writable($dir . "/test") && @filesize($dir . "/test") == 0) {
|
310 |
+
$ret = false;
|
311 |
+
}
|
312 |
+
} else {
|
313 |
+
$ret = false;
|
314 |
+
}
|
315 |
@unlink($dir . "/test");
|
316 |
}
|
317 |
return $ret;
|
modules/class-wpadm-mysqldump.php
CHANGED
@@ -77,6 +77,43 @@ if (!class_exists('WPAdm_Mysqldump')) {
|
|
77 |
}
|
78 |
}
|
79 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
public function mysqldump($db, $filename)
|
82 |
{
|
77 |
}
|
78 |
}
|
79 |
}
|
80 |
+
public function repair($db)
|
81 |
+
{
|
82 |
+
$proc_data = WPAdm_Running::getCommandResultData('repair');
|
83 |
+
if (!isset($proc_data['work'])) {
|
84 |
+
$link = $this->connect($db);
|
85 |
+
|
86 |
+
WPAdm_Core::log( __('MySQL of repair was started' ,'dropbox-backup') );
|
87 |
+
$n = $link->query('SHOW TABLE STATUS;');
|
88 |
+
$result = $link->last_result;
|
89 |
+
if (!empty( $link->last_error )) {
|
90 |
+
$this->setError($link->last_error);
|
91 |
+
return false;
|
92 |
+
}
|
93 |
+
if ($link->last_result === null) {
|
94 |
+
$this->setError(print_r(implode("\n", $link->error->errors), 1));
|
95 |
+
return false;
|
96 |
+
}
|
97 |
+
$tables = array();
|
98 |
+
for($i = 0; $i < $n; $i++ ) {
|
99 |
+
$row = get_object_vars( $result[$i] );
|
100 |
+
$tables[] = $row;
|
101 |
+
WPAdm_Core::log('Start repair table `' . $row['Name'] . '`' );
|
102 |
+
$res = $link->query("REPAIR TABLE {$row['Name']};");
|
103 |
+
if ($res == 1) {
|
104 |
+
$proc_data = WPAdm_Running::getCommandResultData('repair');
|
105 |
+
$proc_data['repair'][$table] = 1;
|
106 |
+
WPAdm_Running::setCommandResultData('repair', $proc_data);
|
107 |
+
} else {
|
108 |
+
$this->setError($link->last_error);
|
109 |
+
}
|
110 |
+
WPAdm_Core::log('Finish repair table `' . $row['Name'] . '`');
|
111 |
+
}
|
112 |
+
$proc_data = WPAdm_Running::getCommandResultData('repair');
|
113 |
+
$proc_data['work'] = 1;
|
114 |
+
WPAdm_Running::setCommandResultData('repair', $proc_data);
|
115 |
+
}
|
116 |
+
}
|
117 |
|
118 |
public function mysqldump($db, $filename)
|
119 |
{
|
modules/class-wpadm-running.php
CHANGED
@@ -34,6 +34,7 @@ if (!class_exists('WPAdm_Running')) {
|
|
34 |
WPAdm_Core::rmdir($path . "/command_dropbox");
|
35 |
WPAdm_Core::rmdir($path . "/errors_sending");
|
36 |
WPAdm_Core::rmdir($path . "/tabledb");
|
|
|
37 |
WPAdm_Core::rmdir($path . "/restore-backup");
|
38 |
WPAdm_Core::rmdir($path . "/log-restore.log");
|
39 |
WPAdm_Core::rmdir($path . "/log-restore2");
|
34 |
WPAdm_Core::rmdir($path . "/command_dropbox");
|
35 |
WPAdm_Core::rmdir($path . "/errors_sending");
|
36 |
WPAdm_Core::rmdir($path . "/tabledb");
|
37 |
+
WPAdm_Core::rmdir($path . "/repair");
|
38 |
WPAdm_Core::rmdir($path . "/restore-backup");
|
39 |
WPAdm_Core::rmdir($path . "/log-restore.log");
|
40 |
WPAdm_Core::rmdir($path . "/log-restore2");
|
modules/restore-class.php
CHANGED
@@ -14,18 +14,52 @@ if (!class_exists('dbr_database')) {
|
|
14 |
private static $db = null;
|
15 |
private static $db_prefix = '';
|
16 |
public static $error = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
public static function inc_wp_config()
|
19 |
{
|
20 |
if (!defined('DB_NAME') && !defined('DB_USER') && !defined('DB_PASSWORD') && !defined('DB_HOST') && is_null(self::$connect) ) {
|
21 |
|
22 |
-
include ABSPATH . 'wp-config.php';
|
|
|
23 |
if ( !defined('WP_CONTENT_DIR') )
|
24 |
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
30 |
}
|
31 |
public static function db_insert($table, $vars = array())
|
@@ -80,7 +114,7 @@ if (!class_exists('dbr_database')) {
|
|
80 |
}
|
81 |
return false;
|
82 |
}
|
83 |
-
public static function db_get($table, $var_key = null, $var_search = null, $limit = -1, $res_type =
|
84 |
{
|
85 |
if (!isset($var_key)) $d = "*";
|
86 |
else {
|
@@ -132,7 +166,7 @@ if (!class_exists('dbr_database')) {
|
|
132 |
return mysqli_num_rows($res);
|
133 |
|
134 |
}
|
135 |
-
private static function returnArray($query, $limit = 1, $res_type =
|
136 |
{
|
137 |
if ($query && self::num($query) > 0) {
|
138 |
$res = false;
|
@@ -171,8 +205,13 @@ if (!class_exists('dbr_database')) {
|
|
171 |
}
|
172 |
return false;
|
173 |
}
|
174 |
-
private static function fetch ($res, $res_type =
|
175 |
{
|
|
|
|
|
|
|
|
|
|
|
176 |
return mysqli_fetch_array($res, $res_type);
|
177 |
}
|
178 |
|
@@ -209,15 +248,16 @@ if ( !class_exists('dbr_api') ) {
|
|
209 |
$result = '';
|
210 |
if (function_exists("curl_init") && function_exists("curl_setopt") && function_exists("curl_exec") && function_exists("curl_close")) {
|
211 |
$curl = curl_init($url);
|
|
|
212 |
$post = http_build_query($post, '', '&');
|
213 |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
214 |
curl_setopt($curl, CURLOPT_POST, true);
|
|
|
215 |
if (!empty($options)) {
|
216 |
if(isset($options['timelimit'])) {
|
217 |
curl_setopt($curl, CURLOPT_TIMEOUT, $options['timelimit']);
|
218 |
}
|
219 |
}
|
220 |
-
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
|
221 |
$result = curl_exec($curl);
|
222 |
$info = curl_getinfo($curl);
|
223 |
curl_close($curl);
|
@@ -405,7 +445,7 @@ if ( !class_exists('dbr_helper') ) {
|
|
405 |
if ( !class_exists('dbr_log') ) {
|
406 |
class dbr_log {
|
407 |
|
408 |
-
public static function log($txt = '')
|
409 |
{
|
410 |
if (!empty($txt)) {
|
411 |
dbr_helper::mkdir(DBP_PATH_TMP);
|
@@ -572,7 +612,7 @@ if ( !class_exists('dbr_methods') ) {
|
|
572 |
dbr_helper::is_work(time(), 'start');
|
573 |
|
574 |
if (!empty($file_md5)) {
|
575 |
-
|
576 |
if (file_exists($file_md5)) {
|
577 |
$this->md5_info = explode ("\n", file_get_contents( $file_md5 ) ); // delemiter \t (1 - file name, 2 - md5_file, 3 - zip file)
|
578 |
dbr_helper::setCommand('md5_info-restore', $this->md5_info);
|
@@ -754,6 +794,7 @@ if (!class_exists('dbr_route')) {
|
|
754 |
if ( isset($_POST['key']) ) {
|
755 |
$this->parsMethod();
|
756 |
} elseif( !isset($_POST['key']) && isset($_POST['name']) ) {
|
|
|
757 |
dbr_helper::clearTMP();
|
758 |
dbr_database::inc_wp_config();
|
759 |
$setting = dbr_database::db_get('options', array('option_value'), array('option_name' => 'wpadm_backup_dropbox-setting'), 1);
|
@@ -774,29 +815,35 @@ if (!class_exists('dbr_route')) {
|
|
774 |
$plugin_name = 'dropbox-backup-pro';
|
775 |
}
|
776 |
}
|
777 |
-
$data = array('actApi' => 'setPluginCode', $plugin_name . '_request' => array('action' => 'restore', 'site' =>
|
778 |
$res = dbr_api::post(WPADM_URL_BASE . 'api/', $data);
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
|
|
|
|
|
|
795 |
}
|
796 |
-
dbr_database::db_update('options', array('option_value' => dbr_helper::pack( $this->setting ) ), array('option_name' => 'wpadm_backup_dropbox-setting') ) ;
|
797 |
-
dbr_helper::setCommand('restore-backup', $_POST);
|
798 |
-
echo json_encode(array('result' => 'work'));
|
799 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
800 |
}
|
801 |
}
|
802 |
}
|
@@ -811,6 +858,7 @@ if (!class_exists('dbr_route')) {
|
|
811 |
if (!dbr_helper::is_work() || in_array($_POST['method'], $this->method_access ) ) {
|
812 |
if (isset($_POST['key'])) {
|
813 |
dbr_database::inc_wp_config();
|
|
|
814 |
$setting = dbr_database::db_get('options', array('option_value'), array('option_name' => 'wpadm_backup_dropbox-setting'), 1);
|
815 |
$this->setting = dbr_helper::unpack( $setting['option_value'] );
|
816 |
if (file_exists(DROPBOX_BACKUP_DIR_BACKUP . '/local-key')) {
|
14 |
private static $db = null;
|
15 |
private static $db_prefix = '';
|
16 |
public static $error = '';
|
17 |
+
public static $db_params = '';
|
18 |
+
|
19 |
+
|
20 |
+
private static function getWpMysqlParams()
|
21 |
+
{
|
22 |
+
$db_params = array(
|
23 |
+
'password' => 'DB_PASSWORD',
|
24 |
+
'db' => 'DB_NAME',
|
25 |
+
'user' => 'DB_USER',
|
26 |
+
'host' => 'DB_HOST',
|
27 |
+
'charset' => 'DB_CHARSET',
|
28 |
+
);
|
29 |
+
|
30 |
+
$r = "/define\('(.*)', '(.*)'\)/";
|
31 |
+
preg_match_all($r, file_get_contents(ABSPATH . "wp-config.php"), $m);
|
32 |
+
preg_match("/table_prefix[\s]{0,}=[\s]{0,}[\"']{1}(.*)[\"']{1}/U", file_get_contents(ABSPATH . "wp-config.php"), $pr);
|
33 |
+
$params = array_combine($m[1], $m[2]);
|
34 |
+
foreach($db_params as $k => $p) {
|
35 |
+
$db_params[$k] = $params[$p];
|
36 |
+
}
|
37 |
+
self::$db_params = $db_params;
|
38 |
+
if (isset($pr[1])) {
|
39 |
+
self::$db_prefix = $pr[1];
|
40 |
+
}
|
41 |
+
return $db_params;
|
42 |
+
}
|
43 |
|
44 |
public static function inc_wp_config()
|
45 |
{
|
46 |
if (!defined('DB_NAME') && !defined('DB_USER') && !defined('DB_PASSWORD') && !defined('DB_HOST') && is_null(self::$connect) ) {
|
47 |
|
48 |
+
//include ABSPATH . 'wp-config.php';
|
49 |
+
self::getWpMysqlParams();
|
50 |
if ( !defined('WP_CONTENT_DIR') )
|
51 |
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
|
52 |
+
|
53 |
+
if (strpos(self::$db_params['host'], ':') !== false) {
|
54 |
+
$host = explode(":", self::$db_params['host']);
|
55 |
+
self::$connect = mysqli_connect($host[0], self::$db_params['user'], self::$db_params['password'], self::$db_params['db'], $host[1]) or die(mysqli_error());
|
56 |
+
mysqli_set_charset(self::$connect, self::$db_params['charset']) or die(mysql_error());
|
57 |
+
} else {
|
58 |
+
self::$connect = mysqli_connect(self::$db_params['host'], self::$db_params['user'], self::$db_params['password']) or die(mysqli_error());
|
59 |
+
mysqli_set_charset(self::$connect, self::$db_params['charset']) or die(mysql_error());
|
60 |
+
mysqli_select_db(self::$connect, self::$db_params['db']) or die(mysql_error());
|
61 |
+
}
|
62 |
+
//self::$db_prefix = $table_prefix;
|
63 |
}
|
64 |
}
|
65 |
public static function db_insert($table, $vars = array())
|
114 |
}
|
115 |
return false;
|
116 |
}
|
117 |
+
public static function db_get($table, $var_key = null, $var_search = null, $limit = -1, $res_type = '', $keys_array = "", $value_array = "" )
|
118 |
{
|
119 |
if (!isset($var_key)) $d = "*";
|
120 |
else {
|
166 |
return mysqli_num_rows($res);
|
167 |
|
168 |
}
|
169 |
+
private static function returnArray($query, $limit = 1, $res_type = '', $key = "", $value = "")
|
170 |
{
|
171 |
if ($query && self::num($query) > 0) {
|
172 |
$res = false;
|
205 |
}
|
206 |
return false;
|
207 |
}
|
208 |
+
private static function fetch ($res, $res_type = '')
|
209 |
{
|
210 |
+
if (defined('MYSQL_BOTH') && empty( $res_type ) ) {
|
211 |
+
$res_type = MYSQL_BOTH;
|
212 |
+
} elseif( defined('MYSQLI_BOTH') && empty( $res_type ) ) {
|
213 |
+
$res_type = MYSQLI_BOTH;
|
214 |
+
}
|
215 |
return mysqli_fetch_array($res, $res_type);
|
216 |
}
|
217 |
|
248 |
$result = '';
|
249 |
if (function_exists("curl_init") && function_exists("curl_setopt") && function_exists("curl_exec") && function_exists("curl_close")) {
|
250 |
$curl = curl_init($url);
|
251 |
+
|
252 |
$post = http_build_query($post, '', '&');
|
253 |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
254 |
curl_setopt($curl, CURLOPT_POST, true);
|
255 |
+
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
|
256 |
if (!empty($options)) {
|
257 |
if(isset($options['timelimit'])) {
|
258 |
curl_setopt($curl, CURLOPT_TIMEOUT, $options['timelimit']);
|
259 |
}
|
260 |
}
|
|
|
261 |
$result = curl_exec($curl);
|
262 |
$info = curl_getinfo($curl);
|
263 |
curl_close($curl);
|
445 |
if ( !class_exists('dbr_log') ) {
|
446 |
class dbr_log {
|
447 |
|
448 |
+
public static function log($txt = '', $class = '')
|
449 |
{
|
450 |
if (!empty($txt)) {
|
451 |
dbr_helper::mkdir(DBP_PATH_TMP);
|
612 |
dbr_helper::is_work(time(), 'start');
|
613 |
|
614 |
if (!empty($file_md5)) {
|
615 |
+
|
616 |
if (file_exists($file_md5)) {
|
617 |
$this->md5_info = explode ("\n", file_get_contents( $file_md5 ) ); // delemiter \t (1 - file name, 2 - md5_file, 3 - zip file)
|
618 |
dbr_helper::setCommand('md5_info-restore', $this->md5_info);
|
794 |
if ( isset($_POST['key']) ) {
|
795 |
$this->parsMethod();
|
796 |
} elseif( !isset($_POST['key']) && isset($_POST['name']) ) {
|
797 |
+
|
798 |
dbr_helper::clearTMP();
|
799 |
dbr_database::inc_wp_config();
|
800 |
$setting = dbr_database::db_get('options', array('option_value'), array('option_name' => 'wpadm_backup_dropbox-setting'), 1);
|
815 |
$plugin_name = 'dropbox-backup-pro';
|
816 |
}
|
817 |
}
|
818 |
+
$data = array('actApi' => 'setPluginCode', $plugin_name . '_request' => array('action' => 'restore', 'site' => SITE_HOME, 'pl' => $plugin_name, 'key' => $this->setting['restore-key'], 'pl_v' => $version, ) );
|
819 |
$res = dbr_api::post(WPADM_URL_BASE . 'api/', $data);
|
820 |
+
try {
|
821 |
+
if ( !empty( $res['res'] ) ) {
|
822 |
+
$result = json_decode($res['res'], true);
|
823 |
+
if (isset($result['code'])) {
|
824 |
+
switch($result['code']) {
|
825 |
+
case 101 :
|
826 |
+
dbr_helper::setError('The restoring method has an error');
|
827 |
+
break;
|
828 |
+
case 108 :
|
829 |
+
dbr_helper::setError('Error of the post/request data');
|
830 |
+
break;
|
831 |
+
case 109 :
|
832 |
+
dbr_helper::setError('Error of the params data');
|
833 |
+
break;
|
834 |
+
case 110 :
|
835 |
+
dbr_helper::setError('Unknown error');
|
836 |
+
break;
|
837 |
+
}
|
838 |
+
|
839 |
}
|
|
|
|
|
|
|
840 |
}
|
841 |
+
dbr_database::db_update('options', array('option_value' => dbr_helper::pack( $this->setting ) ), array('option_name' => 'wpadm_backup_dropbox-setting') ) ;
|
842 |
+
dbr_helper::setCommand('restore-backup', $_POST);
|
843 |
+
echo json_encode(array('result' => 'work'));
|
844 |
+
} catch(Exception $e) {
|
845 |
+
dbr_log::log($e->getMessage());
|
846 |
+
dbr_helper::setCommand('result-restore', array('name' => $_POST['name'], 'result' => 'error', 'message' => $e->getMessage() ) );
|
847 |
}
|
848 |
}
|
849 |
}
|
858 |
if (!dbr_helper::is_work() || in_array($_POST['method'], $this->method_access ) ) {
|
859 |
if (isset($_POST['key'])) {
|
860 |
dbr_database::inc_wp_config();
|
861 |
+
include 'constant.php';
|
862 |
$setting = dbr_database::db_get('options', array('option_value'), array('option_name' => 'wpadm_backup_dropbox-setting'), 1);
|
863 |
$this->setting = dbr_helper::unpack( $setting['option_value'] );
|
864 |
if (file_exists(DROPBOX_BACKUP_DIR_BACKUP . '/local-key')) {
|
readme.txt
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
-
===
|
2 |
-
Plugin Name:
|
3 |
-
Version: 1.4.
|
4 |
Donate link: http://www.wpadm.com/donate
|
5 |
URI: http://www.wpadm.com/dropbox-backup
|
6 |
Tags: dropbox, backup, dropbox backup, database, file, full backup, manage, sicherung, database backup, file backup, page backup, page, web, web backup, web page, synchronize, clone, duplicate, move, web page backup, site, site backup, back up, cloud, Cloud Files, cloud backup, db backup, dump, german, migrate, multisite, German, schedule, storage, time, upload, data bank, zip, archive, backups, restore, db, recover, recovery, restoration, wp backup, wordpress backup, wordpress backup to dropbox, plugin wordpress backup, wpadm, wpadm.com, website, website backup, website back up, wp backup, wordpress backup, scheduled backup, backup scheduler, tool, backup tool
|
7 |
Requires at least: 3.9
|
8 |
-
Tested up to: 4.
|
9 |
Stable tag: trunk
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
Author: WPAdm.com
|
13 |
Contributors: WPAdm.com
|
14 |
|
15 |
-
|
16 |
|
17 |
== Description ==
|
18 |
|
@@ -391,11 +391,27 @@ Please, keep your Dropbox Backup and Restore plugin up-to-date.
|
|
391 |
|
392 |
**Rev.** / **Description** <br />
|
393 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
394 |
Tested up to WordPress version 4.4.2<br />
|
395 |
Answers for questions about dropbox back up and restore plugin window.<br />
|
396 |
Changes of features list for dropbox back up and restore plugin.<br />
|
397 |
@1335797 Performing back up or restore.<br />
|
398 |
-
@1335797 New version(1.4.2) added: corrected view
|
399 |
@1334899 Dependencies for back up creation.<br />
|
400 |
@1334070 New version(1.4.1) added: better functionality by working with the file lock.<br />
|
401 |
@1332931 Bug fixes. Plugin Dropbox backup and restore revision added 1.4<br />
|
1 |
+
=== Backup & Restore Dropbox ===
|
2 |
+
Plugin Name: Backup & Restore Dropbox
|
3 |
+
Version: 1.4.6.2
|
4 |
Donate link: http://www.wpadm.com/donate
|
5 |
URI: http://www.wpadm.com/dropbox-backup
|
6 |
Tags: dropbox, backup, dropbox backup, database, file, full backup, manage, sicherung, database backup, file backup, page backup, page, web, web backup, web page, synchronize, clone, duplicate, move, web page backup, site, site backup, back up, cloud, Cloud Files, cloud backup, db backup, dump, german, migrate, multisite, German, schedule, storage, time, upload, data bank, zip, archive, backups, restore, db, recover, recovery, restoration, wp backup, wordpress backup, wordpress backup to dropbox, plugin wordpress backup, wpadm, wpadm.com, website, website backup, website back up, wp backup, wordpress backup, scheduled backup, backup scheduler, tool, backup tool
|
7 |
Requires at least: 3.9
|
8 |
+
Tested up to: 4.5
|
9 |
Stable tag: trunk
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
Author: WPAdm.com
|
13 |
Contributors: WPAdm.com
|
14 |
|
15 |
+
Backup & Restore Dropbox Plugin to create Dropbox Full Backup (Files + Database) or Restore, Duplicate, Clone or Migrate of your Website
|
16 |
|
17 |
== Description ==
|
18 |
|
391 |
|
392 |
**Rev.** / **Description** <br />
|
393 |
|
394 |
+
check permission of backup folder
|
395 |
+
@1400462 filter for ajax text(html)
|
396 |
+
@1393861 Dropbox backup and restore tested up to WordPress 4.5
|
397 |
+
@1390219 Dropbox backup and restore fixes.<br />
|
398 |
+
@1390174 "Dropbox Backup & restore" - add new version(1.4.6.1). Repairing database.<br />
|
399 |
+
@1360807 Update of form view.<br />
|
400 |
+
@1358919 Index files added.<br />
|
401 |
+
@1357740 New restoration method in "Dropbox backup & restore" plugin version 1.4.6<br />
|
402 |
+
@1357444 Plugin template updated.<br />
|
403 |
+
@1355833 Account on Dropbox updated.<br />
|
404 |
+
@1354789 Grammatical errors corrected.<br />
|
405 |
+
@1353550 Working process of backup was corrected. Bug fixes. Backup redesign.<br />
|
406 |
+
@1351929 "Dropbox backup & restore" new version(1.4.4) added - fixed methods etc.<br />
|
407 |
+
@1349865 The folders of locally created backup and folder of backup.<br />
|
408 |
+
@1348145 How to clone WordPress with Dropbox backup and restore. Question and Answer.<br />
|
409 |
+
|
410 |
Tested up to WordPress version 4.4.2<br />
|
411 |
Answers for questions about dropbox back up and restore plugin window.<br />
|
412 |
Changes of features list for dropbox back up and restore plugin.<br />
|
413 |
@1335797 Performing back up or restore.<br />
|
414 |
+
@1335797 New version(1.4.2) added: corrected view JS with styles during Dropbox backup creating create.<br />
|
415 |
@1334899 Dependencies for back up creation.<br />
|
416 |
@1334070 New version(1.4.1) added: better functionality by working with the file lock.<br />
|
417 |
@1332931 Bug fixes. Plugin Dropbox backup and restore revision added 1.4<br />
|
template/expsys.php
CHANGED
@@ -22,7 +22,7 @@
|
|
22 |
data: data,
|
23 |
success: function(data) {
|
24 |
if(data){
|
25 |
-
jQuery(form_id).html(data);
|
26 |
}
|
27 |
}
|
28 |
});
|
22 |
data: data,
|
23 |
success: function(data) {
|
24 |
if(data){
|
25 |
+
jQuery(form_id).html( textReplace(data, '') );
|
26 |
}
|
27 |
}
|
28 |
});
|
template/js/admin-wpadm.js
CHANGED
@@ -6,6 +6,11 @@ function showTab (elem, type)
|
|
6 |
jQuery('#cf_' + type).fadeIn();
|
7 |
}
|
8 |
|
|
|
|
|
|
|
|
|
|
|
9 |
var shows_id = ""
|
10 |
var shows_t = ""
|
11 |
function shows(id, t)
|
6 |
jQuery('#cf_' + type).fadeIn();
|
7 |
}
|
8 |
|
9 |
+
function textReplace(text, addStr)
|
10 |
+
{
|
11 |
+
return text.replace(/([\w])(\'|’)([\w])/gm, "$1$3") + addStr;
|
12 |
+
}
|
13 |
+
|
14 |
var shows_id = ""
|
15 |
var shows_t = ""
|
16 |
function shows(id, t)
|
template/wpadm_show_backup.php
CHANGED
@@ -103,10 +103,11 @@
|
|
103 |
if (data.result != 'work') {
|
104 |
process_flag = 0;
|
105 |
showData(data);
|
|
|
|
|
|
|
|
|
106 |
}
|
107 |
-
process_flag = 1
|
108 |
-
processBar(type_backup);
|
109 |
-
showTime();
|
110 |
|
111 |
},
|
112 |
error: function(jqXHR, textStatus, errorThrown){
|
@@ -199,16 +200,21 @@
|
|
199 |
jQuery('.title-status').css({'display':'block', 'color':'green'});
|
200 |
jQuery('.title-status').html('<?php _e('Dropbox Backup was created successfully','dropbox-backup'); ?>');
|
201 |
} else {
|
|
|
|
|
|
|
|
|
202 |
jQuery('.title-logs').css('display', 'none');
|
203 |
jQuery('.title-status').css({'display':'block', 'color':'red'});
|
204 |
-
jQuery('.title-status').html("<?php _e('Dropbox Backup wasn\'t created. ','dropbox-backup'); ?>" +
|
205 |
}
|
206 |
showData(data);
|
207 |
jQuery('.table').css('display', 'table');
|
|
|
|
|
|
|
|
|
208 |
}
|
209 |
-
process_flag = 1
|
210 |
-
processBar('send-to-dropbox');
|
211 |
-
showTime();
|
212 |
|
213 |
},
|
214 |
error: function(jqXHR, textStatus, errorThrown) {
|
@@ -249,9 +255,14 @@
|
|
249 |
jQuery('.title-status').css({'display':'block', 'color':'green'});
|
250 |
jQuery('.title-status').html('<?php _e('Local Backup was created successfully','dropbox-backup'); ?>');
|
251 |
} else {
|
|
|
|
|
|
|
|
|
252 |
jQuery('.title-logs').css('display', 'none');
|
253 |
jQuery('.title-status').css({'display':'block', 'color':'red'});
|
254 |
-
jQuery('.title-status').html("<?php _e('Local Backup wasn\'t created','dropbox-backup'); ?>");
|
|
|
255 |
}
|
256 |
} else {
|
257 |
if (data.result == 'success') {
|
@@ -263,9 +274,14 @@
|
|
263 |
location.reload();
|
264 |
}
|
265 |
} else {
|
|
|
|
|
|
|
|
|
266 |
jQuery('.title-logs').css('display', 'none');
|
267 |
jQuery('.title-status').css({'display':'block', 'color':'red'});
|
268 |
-
jQuery('.title-status').html("<?php _e('Dropbox Backup wasn\'t created. ','dropbox-backup'); ?>" +
|
|
|
269 |
}
|
270 |
}
|
271 |
if (command_running === false) {
|
@@ -877,9 +893,9 @@
|
|
877 |
}?>
|
878 |
<div id="is-dropbox-auth" style="display: none; width: 380px; text-align: center; background: #fff; border: 2px solid #dde4ff; border-radius: 5px;">
|
879 |
<div class="title-description" style="font-size: 20px; text-align: center;padding-top:45px; line-height: 30px;">
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
<strong><?php _e('"App key"','dropbox-backup'); ?></strong> & <strong><?php _e('"App secret"','dropbox-backup'); ?></strong> <br />
|
884 |
<?php _e('in the Setting Form','dropbox-backup'); ?>
|
885 |
</div>
|
@@ -1211,6 +1227,10 @@
|
|
1211 |
<input type="checkbox" <?php echo (isset($dropbox_options['is_local_backup_delete']) && $dropbox_options['is_local_backup_delete'] == 1) ? 'checked="checked"' : ''; ?> name="is_local_backup_delete" value="1" id="is_local_backup_delete" onclick="saveSetting('is_local_backup_delete')" />
|
1212 |
<label for="is_local_backup_delete" style="font-size: 13px;"><?php _e('Don\'t delete a local backup copy after uploading to dropbox','dropbox-backup'); ?></label>
|
1213 |
</div>
|
|
|
|
|
|
|
|
|
1214 |
</div>
|
1215 |
</form>
|
1216 |
</div>
|
103 |
if (data.result != 'work') {
|
104 |
process_flag = 0;
|
105 |
showData(data);
|
106 |
+
} else {
|
107 |
+
process_flag = 1
|
108 |
+
processBar(type_backup);
|
109 |
+
showTime();
|
110 |
}
|
|
|
|
|
|
|
111 |
|
112 |
},
|
113 |
error: function(jqXHR, textStatus, errorThrown){
|
200 |
jQuery('.title-status').css({'display':'block', 'color':'green'});
|
201 |
jQuery('.title-status').html('<?php _e('Dropbox Backup was created successfully','dropbox-backup'); ?>');
|
202 |
} else {
|
203 |
+
var error_log = '';
|
204 |
+
if (data.error && data.error != 'undefined') {
|
205 |
+
error_log = ': ' + data.error;
|
206 |
+
}
|
207 |
jQuery('.title-logs').css('display', 'none');
|
208 |
jQuery('.title-status').css({'display':'block', 'color':'red'});
|
209 |
+
jQuery('.title-status').html("<?php _e('Dropbox Backup wasn\'t created. ','dropbox-backup'); ?>" + error_log);
|
210 |
}
|
211 |
showData(data);
|
212 |
jQuery('.table').css('display', 'table');
|
213 |
+
} else {
|
214 |
+
process_flag = 1
|
215 |
+
processBar('send-to-dropbox');
|
216 |
+
showTime();
|
217 |
}
|
|
|
|
|
|
|
218 |
|
219 |
},
|
220 |
error: function(jqXHR, textStatus, errorThrown) {
|
255 |
jQuery('.title-status').css({'display':'block', 'color':'green'});
|
256 |
jQuery('.title-status').html('<?php _e('Local Backup was created successfully','dropbox-backup'); ?>');
|
257 |
} else {
|
258 |
+
var error_log = '';
|
259 |
+
if (data.error && data.error != 'undefined') {
|
260 |
+
error_log = ': ' + data.error;
|
261 |
+
}
|
262 |
jQuery('.title-logs').css('display', 'none');
|
263 |
jQuery('.title-status').css({'display':'block', 'color':'red'});
|
264 |
+
jQuery('.title-status').html("<?php _e('Local Backup wasn\'t created', 'dropbox-backup'); ?>" + error_log) ;
|
265 |
+
return false;
|
266 |
}
|
267 |
} else {
|
268 |
if (data.result == 'success') {
|
274 |
location.reload();
|
275 |
}
|
276 |
} else {
|
277 |
+
var error_log = '';
|
278 |
+
if (data.error && data.error != 'undefined') {
|
279 |
+
error_log = ': ' + data.error;
|
280 |
+
}
|
281 |
jQuery('.title-logs').css('display', 'none');
|
282 |
jQuery('.title-status').css({'display':'block', 'color':'red'});
|
283 |
+
jQuery('.title-status').html("<?php _e('Dropbox Backup wasn\'t created. ','dropbox-backup'); ?>" + error_log);
|
284 |
+
return false;
|
285 |
}
|
286 |
}
|
287 |
if (command_running === false) {
|
893 |
}?>
|
894 |
<div id="is-dropbox-auth" style="display: none; width: 380px; text-align: center; background: #fff; border: 2px solid #dde4ff; border-radius: 5px;">
|
895 |
<div class="title-description" style="font-size: 20px; text-align: center;padding-top:45px; line-height: 30px;">
|
896 |
+
<?php _e('Your Dropbox account must be connected before backup to Dropbox.', 'dropbox-backup'); ?> <br />
|
897 |
+
<?php _e('To do this, please, click the button "Connect to Dropbox" in the settings', 'dropbox-backup'); ?> <br />
|
898 |
+
<?php _e('or add your own Dropbox credentials:', 'dropbox-backup'); ?> <br />
|
899 |
<strong><?php _e('"App key"','dropbox-backup'); ?></strong> & <strong><?php _e('"App secret"','dropbox-backup'); ?></strong> <br />
|
900 |
<?php _e('in the Setting Form','dropbox-backup'); ?>
|
901 |
</div>
|
1227 |
<input type="checkbox" <?php echo (isset($dropbox_options['is_local_backup_delete']) && $dropbox_options['is_local_backup_delete'] == 1) ? 'checked="checked"' : ''; ?> name="is_local_backup_delete" value="1" id="is_local_backup_delete" onclick="saveSetting('is_local_backup_delete')" />
|
1228 |
<label for="is_local_backup_delete" style="font-size: 13px;"><?php _e('Don\'t delete a local backup copy after uploading to dropbox','dropbox-backup'); ?></label>
|
1229 |
</div>
|
1230 |
+
<div class="setting-checkbox">
|
1231 |
+
<input type="checkbox" <?php echo (isset($dropbox_options['is_repair']) && $dropbox_options['is_repair'] == 1) ? 'checked="checked"' : ''; ?> name="is_repair" value="1" id="is_repair" onclick="saveSetting('is_repair')" />
|
1232 |
+
<label for="is_repair" style="font-size: 13px;"><?php _e('Try database repair','dropbox-backup'); ?></label>
|
1233 |
+
</div>
|
1234 |
</div>
|
1235 |
</form>
|
1236 |
</div>
|