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.3.3.6 |
Comparing to | |
See all releases |
Code changes from version 1.1 to 1.3.3.6
- class-wpadm-method-class.php +0 -26
- commands/class-wpadm-command-archive.php +56 -44
- commands/class-wpadm-command-mysqloptimize.php +22 -22
- commands/class-wpadm-command-restore-backup.php +5 -6
- commands/class-wpadm-command-send-to-dropbox.php +47 -6
- css/admin-style-wpadm.css +0 -702
- dropbox-backup.php +13 -11
- functions/index.php +1 -0
- functions/wpadm.php +157 -0
- img/dropbox.png +0 -0
- img/stars-5.png +0 -0
- wpadm-logo.png → img/wpadm-logo.png +0 -0
- img/wpadmload.gif +0 -0
- libs/error.class.php +40 -0
- libs/index.php +1 -0
- libs/lang.class.php +106 -0
- libs/lang/index.php +1 -0
- libs/wpadm.server.main.class.php +904 -0
- main/index.php +1 -0
- main/wpadm-class-wp.php +744 -0
- methods/class-wpadm-method-backup-delete.php +27 -27
- methods/class-wpadm-method-backup-list.php +44 -44
- methods/class-wpadm-method-backup.php +406 -450
- methods/class-wpadm-method-full-backup-dropbox.php +65 -44
- methods/class-wpadm-method-local-backup.php +210 -141
- methods/class-wpadm-method-local-restore.php +43 -24
- methods/class-wpadm-method-queue-controller.php +5 -16
- methods/class-wpadm-method-send-to-dropbox.php +63 -21
- methods/class-wpadm-method-update.php +5 -4
- modules/class-wpadm-archive.php +49 -41
- modules/class-wpadm-command-context.php +31 -27
- class-wpadm-command.php → modules/class-wpadm-command.php +13 -13
- class-wpadm-core.php → modules/class-wpadm-core.php +85 -39
- modules/class-wpadm-method-class.php +38 -0
- modules/class-wpadm-mysqldump.php +178 -188
- modules/class-wpadm-queue.php +15 -3
- class-wpadm-result.php → modules/class-wpadm-result.php +126 -116
- modules/class-wpadm-running.php +182 -0
- modules/constant.php +58 -0
- modules/dropbox.class.php +1 -0
- errorHandler.php → modules/errorHandler.php +0 -0
- readme.txt +503 -15
- template/css/admin-style-wpadm.css +996 -0
- template/css/folder.png +0 -0
- template/css/icon-folder-open.gif +0 -0
- template/css/index.php +2 -0
- template/dropbox_pro_logo_box1.png +0 -0
- template/expsys.php +25 -0
- template/index.php +1 -0
- template/js/admin-wpadm.js +63 -0
- template/js/index.php +2 -0
- template/js/jquery.arcticmodal-0.3.css +8 -0
- template/js/jquery.arcticmodal-0.3.min.js +22 -0
- template/not-ok.png +0 -0
- template/notice.php +8 -0
- template/notice5.php +11 -0
- template/ok-icon.png +0 -0
- template/ok.png +0 -0
- template/wpadm_show_backup.php +1331 -0
- wpadm.php +0 -249
class-wpadm-method-class.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
if (!class_exists('WPAdm_Method_Class')) {
|
5 |
-
abstract class WPAdm_Method_Class {
|
6 |
-
/**
|
7 |
-
* @var mixed
|
8 |
-
*/
|
9 |
-
protected $params;
|
10 |
-
|
11 |
-
/**
|
12 |
-
* @var WPAdm_result
|
13 |
-
*/
|
14 |
-
protected $result;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* @param mixed $params
|
18 |
-
*/
|
19 |
-
public function __construct($params) {
|
20 |
-
$this->params = $params;
|
21 |
-
$this->result = new WPAdm_Result();
|
22 |
-
}
|
23 |
-
|
24 |
-
abstract function getResult();
|
25 |
-
}
|
26 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
commands/class-wpadm-command-archive.php
CHANGED
@@ -1,45 +1,57 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
class WPadm_Command_Archive extends WPAdm_Сommand{
|
5 |
-
public function execute(WPAdm_Command_Context $context)
|
6 |
-
{
|
7 |
-
|
8 |
-
|
9 |
-
$
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
if (file_exists($af
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
$
|
19 |
-
$archive
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
$
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
$
|
42 |
-
$
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class WPadm_Command_Archive extends WPAdm_Сommand{
|
5 |
+
public function execute(WPAdm_Command_Context $context)
|
6 |
+
{
|
7 |
+
ini_set("memory_limit", "256M");
|
8 |
+
require_once WPAdm_Core::getPluginDir() . '/modules/class-wpadm-archive.php';
|
9 |
+
$af = $this->getArchiveName($context->get('to_file'));
|
10 |
+
ini_set("memory_limit", "256M");
|
11 |
+
$archive = new WPAdm_Archive($af, $context->get('to_file') . '.md5');
|
12 |
+
$archive->setRemovePath($context->get('remove_path'));
|
13 |
+
$files = $context->get('files');
|
14 |
+
if ( !file_exists( $af ) ) {
|
15 |
+
WPAdm_Core::log(langWPADM::get('Create part ', false) . basename( $af ) );
|
16 |
+
}
|
17 |
+
if (file_exists($af) && filesize($af) > $context->get('max_file_size')) {
|
18 |
+
$af = $this->getNextArchiveName($context->get('to_file'));
|
19 |
+
unset($archive);
|
20 |
+
if ( !file_exists( $af ) ) {
|
21 |
+
WPAdm_Core::log(langWPADM::get('Create part ', false) . basename( $af ) );
|
22 |
+
}
|
23 |
+
$archive = new WPAdm_Archive($af, $context->get('to_file') . '.md5');
|
24 |
+
$archive->setRemovePath($context->get('remove_path'));
|
25 |
+
}
|
26 |
+
$files_str = implode(',', $files);
|
27 |
+
$files_archive = WPAdm_Running::getCommandResultData('archive');
|
28 |
+
if (!in_array($files_str, $files_archive)) {
|
29 |
+
$archive->add($files_str);
|
30 |
+
$files_archive = WPAdm_Running::getCommandResultData('archive');
|
31 |
+
$files_archive[] = $files_str;
|
32 |
+
if (!empty($files_archive)) {
|
33 |
+
WPAdm_Running::setCommandResultData('archive', $files_archive);
|
34 |
+
}
|
35 |
+
}
|
36 |
+
return true;
|
37 |
+
}
|
38 |
+
|
39 |
+
private function getArchiveName($name)
|
40 |
+
{
|
41 |
+
$archives = glob("{$name}-*.zip");
|
42 |
+
if (empty($archives)) {
|
43 |
+
return "{$name}-1.zip";
|
44 |
+
}
|
45 |
+
$n = count($archives);
|
46 |
+
$f = "{$name}-{$n}.zip";
|
47 |
+
return $f;
|
48 |
+
}
|
49 |
+
|
50 |
+
private function getNextArchiveName($name)
|
51 |
+
{
|
52 |
+
$archives = glob("{$name}-*.zip");
|
53 |
+
$n = 1 + count($archives);
|
54 |
+
$a = "{$name}-{$n}.zip";
|
55 |
+
return $a;
|
56 |
+
}
|
57 |
}
|
commands/class-wpadm-command-mysqloptimize.php
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
<?php
|
2 |
-
if (!class_exists('WPadm_Command_Mysqloptimize')) {
|
3 |
-
class WPadm_Command_Mysqloptimize extends WPAdm_Сommand{
|
4 |
-
public function execute(WPAdm_Command_Context $context)
|
5 |
-
{
|
6 |
-
//WPAdm_Core::log(print_r($context, true));
|
7 |
-
require_once WPAdm_Core::getPluginDir() . '/modules/class-wpadm-mysqldump.php';
|
8 |
-
$mysqldump = new WPAdm_Mysqldump();
|
9 |
-
$mysqldump->host = $context->get('host');
|
10 |
-
$mysqldump->user = $context->get('user');
|
11 |
-
$mysqldump->password = $context->get('password');
|
12 |
-
|
13 |
-
try {
|
14 |
-
$mysqldump->optimize($context->get('db'));
|
15 |
-
} catch (Exception $e) {
|
16 |
-
$context->setError($e->getMessage());
|
17 |
-
return false;
|
18 |
-
}
|
19 |
-
return true;
|
20 |
-
}
|
21 |
-
}
|
22 |
-
}
|
1 |
+
<?php
|
2 |
+
if (!class_exists('WPadm_Command_Mysqloptimize')) {
|
3 |
+
class WPadm_Command_Mysqloptimize extends WPAdm_Сommand{
|
4 |
+
public function execute(WPAdm_Command_Context $context)
|
5 |
+
{
|
6 |
+
//WPAdm_Core::log(print_r($context, true));
|
7 |
+
require_once WPAdm_Core::getPluginDir() . '/modules/class-wpadm-mysqldump.php';
|
8 |
+
$mysqldump = new WPAdm_Mysqldump();
|
9 |
+
$mysqldump->host = $context->get('host');
|
10 |
+
$mysqldump->user = $context->get('user');
|
11 |
+
$mysqldump->password = $context->get('password');
|
12 |
+
|
13 |
+
try {
|
14 |
+
$mysqldump->optimize($context->get('db'));
|
15 |
+
} catch (Exception $e) {
|
16 |
+
$context->setError($e->getMessage());
|
17 |
+
return false;
|
18 |
+
}
|
19 |
+
return true;
|
20 |
+
}
|
21 |
+
}
|
22 |
+
}
|
commands/class-wpadm-command-restore-backup.php
CHANGED
@@ -10,7 +10,7 @@ if (!class_exists('WPadm_Command_Restore_Backup')) {
|
|
10 |
$file = $context->get('file');
|
11 |
$is_dump = $file && strpos($file, "mysqldump.sql");
|
12 |
|
13 |
-
WPAdm_Core::log( "
|
14 |
if ($is_dump !== false) {
|
15 |
$inzip = str_replace(ABSPATH, "", $file);
|
16 |
$file_in_zip = $this->archive->extract(PCLZIP_OPT_BY_NAME, $inzip);
|
@@ -19,8 +19,8 @@ if (!class_exists('WPadm_Command_Restore_Backup')) {
|
|
19 |
}
|
20 |
|
21 |
if ($file_in_zip == 0) {
|
22 |
-
WPAdm_Core::log( "
|
23 |
-
$context->setError( "
|
24 |
return false;
|
25 |
}
|
26 |
//WPAdm_Core::log(print_r($file_in_zip, 1));
|
@@ -40,10 +40,9 @@ if (!class_exists('WPadm_Command_Restore_Backup')) {
|
|
40 |
}
|
41 |
}
|
42 |
}
|
43 |
-
|
44 |
} else {
|
45 |
-
$context->setError("
|
46 |
-
WPAdm_Core::log( "
|
47 |
return false;
|
48 |
}
|
49 |
return true;
|
10 |
$file = $context->get('file');
|
11 |
$is_dump = $file && strpos($file, "mysqldump.sql");
|
12 |
|
13 |
+
WPAdm_Core::log( "Data decompression " . basename($context->get('zip_file')) );
|
14 |
if ($is_dump !== false) {
|
15 |
$inzip = str_replace(ABSPATH, "", $file);
|
16 |
$file_in_zip = $this->archive->extract(PCLZIP_OPT_BY_NAME, $inzip);
|
19 |
}
|
20 |
|
21 |
if ($file_in_zip == 0) {
|
22 |
+
WPAdm_Core::log( langWPADM::get("Website \"%d\" returned an error during archive extracting: ", false, "%d", SITE_HOME) . $this->archive->errorInfo(true) );
|
23 |
+
$context->setError( langWPADM::get("Website \"%d\" returned an error during archive extracting: ", false, "%d", SITE_HOME) . $this->archive->errorInfo(true) );
|
24 |
return false;
|
25 |
}
|
26 |
//WPAdm_Core::log(print_r($file_in_zip, 1));
|
40 |
}
|
41 |
}
|
42 |
}
|
|
|
43 |
} else {
|
44 |
+
$context->setError( langWPADM::get("Website \"%d\" returned an error: The necessary file of archive \"%f\" wasn't found ", false, array('%d', '%f'), array(SITE_HOME, $context->get('zip_file') ) ) );
|
45 |
+
WPAdm_Core::log( langWPADM::get("Website \"%d\" returned an error: The necessary file of archive \"%f\" wasn't found ", false, array('%d', '%f'), array(SITE_HOME, $context->get('zip_file') ) ) );
|
46 |
return false;
|
47 |
}
|
48 |
return true;
|
commands/class-wpadm-command-send-to-dropbox.php
CHANGED
@@ -8,15 +8,16 @@ if (!class_exists('WPadm_Command_Send_To_Dropbox')) {
|
|
8 |
@session_start();
|
9 |
require_once WPAdm_Core::getPluginDir() . '/modules/dropbox.class.php';
|
10 |
|
11 |
-
WPAdm_Core::log('Send
|
12 |
$dropbox = new dropbox($context->get('key'), $context->get('secret'), $context->get('token'));
|
13 |
|
14 |
if (!$dropbox->isAuth()) {
|
15 |
-
$context->setError("
|
|
|
|
|
16 |
return false;
|
17 |
}
|
18 |
$files = $context->get('files');
|
19 |
-
|
20 |
$file = explode("/", $files);
|
21 |
$file_name = array_pop($file);
|
22 |
$folder_project_temp = $context->get('folder_project');
|
@@ -31,15 +32,55 @@ if (!class_exists('WPadm_Command_Send_To_Dropbox')) {
|
|
31 |
|
32 |
$fromFile = str_replace('//', '/', $files);
|
33 |
$toFile = str_replace('//', '/', $folder_project . $context->get('folder') . '/' . $file_name);
|
34 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
if (isset($res['error']) && isset($res['text']) && $res['error'] == 1) {
|
36 |
-
$context->setError(
|
37 |
return false;
|
38 |
}
|
39 |
if (isset($res['size']) && isset($res['client_mtime'])) {
|
40 |
-
WPAdm_Core::log(
|
|
|
41 |
}
|
42 |
return true;
|
43 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
}
|
8 |
@session_start();
|
9 |
require_once WPAdm_Core::getPluginDir() . '/modules/dropbox.class.php';
|
10 |
|
11 |
+
WPAdm_Core::log( langWPADM::get('Send to dropbox files' , false) );
|
12 |
$dropbox = new dropbox($context->get('key'), $context->get('secret'), $context->get('token'));
|
13 |
|
14 |
if (!$dropbox->isAuth()) {
|
15 |
+
$context->setError( langWPADM::get('Website "%d" can\'t authorize on Dropbox with using of "app key: %k" and "app secret: %s"' , false,
|
16 |
+
array('%d', '%k', '%s'),
|
17 |
+
array( SITE_HOME, $context->get('key'), $context->get('secret') ) ) );
|
18 |
return false;
|
19 |
}
|
20 |
$files = $context->get('files');
|
|
|
21 |
$file = explode("/", $files);
|
22 |
$file_name = array_pop($file);
|
23 |
$folder_project_temp = $context->get('folder_project');
|
32 |
|
33 |
$fromFile = str_replace('//', '/', $files);
|
34 |
$toFile = str_replace('//', '/', $folder_project . $context->get('folder') . '/' . $file_name);
|
35 |
+
$local = $context->get('local');
|
36 |
+
$file_dropbox = $dropbox->listing($folder_project . $context->get('folder') . '/' . $file_name);
|
37 |
+
$send = true;
|
38 |
+
if ( !isset($file_dropbox['error']) ) {
|
39 |
+
if ($file_dropbox['bytes'] != filesize($fromFile)) {
|
40 |
+
$delete_file = $dropbox->deleteFile($folder_project . $context->get('folder') . '/' . $file_name);
|
41 |
+
if (isset($delete_file['error'])) {
|
42 |
+
$context->setError( langWPADM::get('Dropbox returned an error during file sending: ' , false) . '"' . $delete_file['text'] . '"');
|
43 |
+
return false;
|
44 |
+
}
|
45 |
+
$data_error_command = WPAdm_Running::getCommandResultData('errors_sending');
|
46 |
+
if (isset($data_command[$fromFile])) {
|
47 |
+
$data_error_command[$fromFile]['count'] += 1;
|
48 |
+
} else {
|
49 |
+
$data_error_command[$fromFile] = array();
|
50 |
+
$data_error_command[$fromFile]['count'] = 1;
|
51 |
+
}
|
52 |
+
WPAdm_Running::setCommandResultData('errors_sending', $data_error_command);
|
53 |
+
} else {
|
54 |
+
$send = false;
|
55 |
+
}
|
56 |
+
}
|
57 |
+
if ( $local ) {
|
58 |
+
$data_command = WPAdm_Running::getCommandResultData('command_dropbox');
|
59 |
+
if (empty($data_command) || !in_array($fromFile ,$data_command) ) {
|
60 |
+
if ($send) {
|
61 |
+
$res = $dropbox->uploadFile($fromFile, $toFile, true);
|
62 |
+
} else {
|
63 |
+
$this->saveDataCommand($fromFile);
|
64 |
+
}
|
65 |
+
}
|
66 |
+
} else {
|
67 |
+
$res = $dropbox->uploadFile($fromFile, $toFile, true);
|
68 |
+
}
|
69 |
if (isset($res['error']) && isset($res['text']) && $res['error'] == 1) {
|
70 |
+
$context->setError( langWPADM::get('Dropbox returned an error during file sending: ' , false) . '"' . $res['text'] . '"');
|
71 |
return false;
|
72 |
}
|
73 |
if (isset($res['size']) && isset($res['client_mtime'])) {
|
74 |
+
WPAdm_Core::log( langWPADM::get('File upload: ' , false) . basename( $files ) . langWPADM::get(' size: ' , false) . $res['size']);
|
75 |
+
$this->saveDataCommand($fromFile);
|
76 |
}
|
77 |
return true;
|
78 |
}
|
79 |
+
private function saveDataCommand($file)
|
80 |
+
{
|
81 |
+
$data_command = WPAdm_Running::getCommandResultData('command_dropbox');
|
82 |
+
$data_command[] = $file;
|
83 |
+
WPAdm_Running::setCommandResultData('command_dropbox', $data_command);
|
84 |
+
}
|
85 |
}
|
86 |
}
|
css/admin-style-wpadm.css
DELETED
@@ -1,702 +0,0 @@
|
|
1 |
-
|
2 |
-
.wpadm-notice {
|
3 |
-
background: #fff;
|
4 |
-
border-left: 4px solid #dd3d36;
|
5 |
-
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
|
6 |
-
font-size: 16px;
|
7 |
-
overflow: hidden;
|
8 |
-
position: relative;
|
9 |
-
text-align: left;
|
10 |
-
clear: both;
|
11 |
-
height: 60px;
|
12 |
-
margin-top: 15px;
|
13 |
-
width: 95%;
|
14 |
-
}
|
15 |
-
.button-link {
|
16 |
-
background:none!important;
|
17 |
-
border:none;
|
18 |
-
padding:0!important;
|
19 |
-
font: inherit;
|
20 |
-
color:#0074a2;
|
21 |
-
border-bottom:1px solid #0074a2;
|
22 |
-
padding-bottom: 1px;
|
23 |
-
cursor: pointer;
|
24 |
-
line-height: 15px;
|
25 |
-
}
|
26 |
-
.button-link:hover {
|
27 |
-
color:#2ea2cc;
|
28 |
-
border-bottom:1px solid #2ea2cc;
|
29 |
-
}
|
30 |
-
.wpadm-notice div.registr {
|
31 |
-
margin-top : 20px;
|
32 |
-
font-size: 16px;
|
33 |
-
margin-left: 15px;
|
34 |
-
}
|
35 |
-
|
36 |
-
.form-counter {
|
37 |
-
background: #0096d6;
|
38 |
-
border: 1px solid #fff;
|
39 |
-
width: 95%;
|
40 |
-
margin-bottom: 20px;
|
41 |
-
margin-top: 20px;
|
42 |
-
color:#fff;
|
43 |
-
}
|
44 |
-
|
45 |
-
.form-counter table tr td{
|
46 |
-
padding: 10px;
|
47 |
-
}
|
48 |
-
.color-picker {
|
49 |
-
margin:10px;
|
50 |
-
}
|
51 |
-
.stat_title {
|
52 |
-
text-align: center;
|
53 |
-
font-size: 24px;
|
54 |
-
margin-top: 20px;
|
55 |
-
}
|
56 |
-
.cfTabsContainer {
|
57 |
-
background-color: #0096d6;
|
58 |
-
overflow: hidden;
|
59 |
-
width:95%;
|
60 |
-
padding: 15px;
|
61 |
-
margin-bottom: 40px;
|
62 |
-
margin-top: 30px;
|
63 |
-
-webkit-font-smoothing: antialiased;
|
64 |
-
}
|
65 |
-
|
66 |
-
|
67 |
-
.button-wpadm {
|
68 |
-
background: none repeat scroll 0 0 #00d2b8;
|
69 |
-
border-color: #cdcdcd;
|
70 |
-
box-shadow: 0 1px 0 #00d2b8 inset, 0 1px 0 rgba(0, 0, 0, 0.08);
|
71 |
-
color: #fff;
|
72 |
-
vertical-align: top;
|
73 |
-
border-radius: 3px;
|
74 |
-
border-style: solid;
|
75 |
-
border-width: 1px;
|
76 |
-
box-sizing: border-box;
|
77 |
-
cursor: pointer;
|
78 |
-
display: inline-block;
|
79 |
-
font-size: 13px;
|
80 |
-
height: 28px;
|
81 |
-
line-height: 26px;
|
82 |
-
margin: 0;
|
83 |
-
padding: 0 10px 1px;
|
84 |
-
text-decoration: none;
|
85 |
-
white-space: nowrap;
|
86 |
-
}
|
87 |
-
.wpadm-info {
|
88 |
-
font-size: 15px;
|
89 |
-
width: 30%;
|
90 |
-
margin-top:10px;
|
91 |
-
margin-left: 20px;
|
92 |
-
margin-bottom: 20px;
|
93 |
-
border-left: 1px solid #fff;
|
94 |
-
padding-left:20px;
|
95 |
-
padding-top: 20px;
|
96 |
-
height:200px;
|
97 |
-
}
|
98 |
-
.wpadm-info-title {
|
99 |
-
text-align:center;
|
100 |
-
padding:5px;
|
101 |
-
color:#fff;
|
102 |
-
font-size:20px;
|
103 |
-
}
|
104 |
-
.wpadm-registr-info {
|
105 |
-
width: 65%;
|
106 |
-
}
|
107 |
-
.wpadm-registr-info label {
|
108 |
-
color:#fff;
|
109 |
-
}
|
110 |
-
.wpadm-plugins-info {
|
111 |
-
width: 95%;
|
112 |
-
}
|
113 |
-
.services-info {
|
114 |
-
background: #fff; width: 95%; margin-top: 20px;
|
115 |
-
}
|
116 |
-
.title-services {
|
117 |
-
text-align: center; font-size: 20px; font-weight: 800; padding-bottom: 30px; padding-top: 20px;
|
118 |
-
}
|
119 |
-
|
120 |
-
.tmpl_line_body {
|
121 |
-
float: left;
|
122 |
-
margin: 0;
|
123 |
-
padding: 0;
|
124 |
-
position: relative;
|
125 |
-
width: 100%;
|
126 |
-
}
|
127 |
-
.wpadm-info-auth {
|
128 |
-
font-size: 11px;
|
129 |
-
padding-left:20px;
|
130 |
-
height:30px;
|
131 |
-
color:#fff;
|
132 |
-
margin-top: -5px;
|
133 |
-
}
|
134 |
-
#header_navigation_line {
|
135 |
-
background-color: #21759b;
|
136 |
-
background-image: linear-gradient(to bottom, #2a95c5, #21759b);
|
137 |
-
box-shadow: 0 2px 7px 2px rgba(50, 50, 50, 0.5);
|
138 |
-
height: 68px;
|
139 |
-
left: 0;
|
140 |
-
top: 0;
|
141 |
-
z-index: 1000;
|
142 |
-
}
|
143 |
-
#header_navigation_line #main_menu ul li {
|
144 |
-
display: inline-block;
|
145 |
-
float: none;
|
146 |
-
font-size: 14px;
|
147 |
-
font-weight: bold;
|
148 |
-
list-style: outside none none;
|
149 |
-
margin: 0;
|
150 |
-
padding: 0;
|
151 |
-
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
|
152 |
-
}
|
153 |
-
.inline {
|
154 |
-
float:left;
|
155 |
-
margin-top:10px;
|
156 |
-
margin-left:10px;
|
157 |
-
}
|
158 |
-
#header_navigation_line #main_menu ul li a {
|
159 |
-
background: -moz-linear-gradient(center top , #2e9ed2 5%, #21749b 100%) repeat scroll 0 0 #2e9ed2;
|
160 |
-
border: 1px solid #1b5f7f;
|
161 |
-
border-radius: 3px;
|
162 |
-
box-shadow: 1px 1px 0 0 #78c9e6 inset;
|
163 |
-
color: #dddddd;
|
164 |
-
display: inline-block;
|
165 |
-
float: left;
|
166 |
-
height: 43px;
|
167 |
-
line-height: 16px;
|
168 |
-
margin: 0 2px 0 0;
|
169 |
-
overflow: hidden;
|
170 |
-
padding: 5px 0;
|
171 |
-
text-decoration: none;
|
172 |
-
width: 90px;
|
173 |
-
}
|
174 |
-
#header_navigation_line #main_menu ul li:hover a {
|
175 |
-
background-image: linear-gradient(to bottom, #2fb1e5, #22759c);
|
176 |
-
color: #fff;
|
177 |
-
}
|
178 |
-
#header_navigation_line #main_menu {
|
179 |
-
float: left;
|
180 |
-
margin: 6px 0 0;
|
181 |
-
width: 100%;
|
182 |
-
}
|
183 |
-
#header_navigation_line #logo {
|
184 |
-
float: left;
|
185 |
-
left: 0;
|
186 |
-
position: absolute;
|
187 |
-
top: 9px;
|
188 |
-
width: auto;
|
189 |
-
}
|
190 |
-
#header_navigation_line #main_menu ul {
|
191 |
-
float: left;
|
192 |
-
list-style: outside none none;
|
193 |
-
margin: 0 0 0 20px;
|
194 |
-
padding: 0;
|
195 |
-
text-align: center;
|
196 |
-
width: 100%;
|
197 |
-
}
|
198 |
-
#header_navigation_line #main_menu ul li .nav_icon {
|
199 |
-
float: left;
|
200 |
-
height: 24px;
|
201 |
-
margin: 0;
|
202 |
-
padding: 0 0 3px;
|
203 |
-
width: 100%;
|
204 |
-
}
|
205 |
-
#header_navigation_line #main_menu ul li.active a, #header_navigation_line #main_menu ul li a:active {
|
206 |
-
background-image: linear-gradient(to bottom, #2cc4f5, #228bb4);
|
207 |
-
border: 1px solid #fff;
|
208 |
-
box-shadow: 0 1px 0 rgba(95, 157, 186, 0.6);
|
209 |
-
color: #fff;
|
210 |
-
}
|
211 |
-
.clear {
|
212 |
-
clear:both;
|
213 |
-
}
|
214 |
-
.plugins-info {
|
215 |
-
width:320px;
|
216 |
-
}
|
217 |
-
.plugin-box {
|
218 |
-
background: #0096d6;
|
219 |
-
border: 1px solid #e5e5e5;
|
220 |
-
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
221 |
-
min-width: 255px;
|
222 |
-
position: relative;
|
223 |
-
line-height: 1;
|
224 |
-
margin-bottom: 20px;
|
225 |
-
padding: 0;
|
226 |
-
}
|
227 |
-
|
228 |
-
.plugins-info-content {
|
229 |
-
display:none;
|
230 |
-
border-top: 1px solid #fff;
|
231 |
-
margin-top:8px;
|
232 |
-
padding-top: 7px;
|
233 |
-
}
|
234 |
-
h3.plugins-title {
|
235 |
-
font-size: 14px;
|
236 |
-
line-height: 1.4;
|
237 |
-
margin: 0;
|
238 |
-
}
|
239 |
-
.plugins-title a {
|
240 |
-
color:#fff;
|
241 |
-
text-decoration: none;
|
242 |
-
|
243 |
-
}
|
244 |
-
.wpadm-registr-info, .wpadm-info, .wpadm-info-auth {
|
245 |
-
float:left;
|
246 |
-
color:#fff;
|
247 |
-
}
|
248 |
-
.button-wpadm:hover {
|
249 |
-
border-color:#cdcdcd;
|
250 |
-
background-color: #009583;
|
251 |
-
}
|
252 |
-
.wpadm-red:hover {
|
253 |
-
border-color:#737373 ;
|
254 |
-
background-color: #ff706c;
|
255 |
-
}
|
256 |
-
.wpadm-red {
|
257 |
-
background: none repeat scroll 0 0 #f21111;
|
258 |
-
border-color: #c7c6ce;
|
259 |
-
box-shadow: 0 1px 0 #ff2c26 inset, 0 1px 0 rgba(0, 0, 0, 0.08);
|
260 |
-
}
|
261 |
-
.info-detail {
|
262 |
-
background:#bee7e7;
|
263 |
-
}
|
264 |
-
.table {
|
265 |
-
margin:0px;padding:0px;
|
266 |
-
width:100%;
|
267 |
-
border:0px;
|
268 |
-
border-collapse: collapse;
|
269 |
-
border-spacing: 0;
|
270 |
-
width:100%;
|
271 |
-
height:100%;
|
272 |
-
border: 1px solid #b7c6ff;
|
273 |
-
border-radius: 3px;
|
274 |
-
margin-top: 60px;
|
275 |
-
|
276 |
-
}
|
277 |
-
.table th {
|
278 |
-
padding: 7px;
|
279 |
-
background-color:#dde4ff;
|
280 |
-
font-size:16px;
|
281 |
-
|
282 |
-
}
|
283 |
-
.table td {
|
284 |
-
background: #fff;
|
285 |
-
font-size: 14px;
|
286 |
-
padding: 5px 0;
|
287 |
-
border-bottom:1px solid #b7c6ff;
|
288 |
-
text-align: center;
|
289 |
-
}
|
290 |
-
.info-path td {
|
291 |
-
font-size: 11px;
|
292 |
-
padding:0px;
|
293 |
-
}
|
294 |
-
.table tr:last td {
|
295 |
-
|
296 |
-
border-bottom: 0px;
|
297 |
-
}
|
298 |
-
.header-table {
|
299 |
-
font-size:20px;
|
300 |
-
}
|
301 |
-
|
302 |
-
.stat {
|
303 |
-
width: 200px;
|
304 |
-
}
|
305 |
-
|
306 |
-
.w1{
|
307 |
-
width:5%;
|
308 |
-
}
|
309 |
-
.w2{
|
310 |
-
width:13%;
|
311 |
-
}
|
312 |
-
.w3{
|
313 |
-
width:7%;
|
314 |
-
}
|
315 |
-
.table-stat-moovdiv {
|
316 |
-
background: none repeat scroll 0 0 #FFFFFF;
|
317 |
-
border-spacing: 0;
|
318 |
-
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.3);
|
319 |
-
left: 0px;
|
320 |
-
margin-top: 0;
|
321 |
-
padding: 10px 15px;
|
322 |
-
top: 0px;
|
323 |
-
width: 400px;
|
324 |
-
}
|
325 |
-
|
326 |
-
.table-stat-moovdiv tr td{
|
327 |
-
border-right: 0px;
|
328 |
-
margin-bottom: 1px;
|
329 |
-
margin-top: 1px;
|
330 |
-
padding-bottom: 1px;
|
331 |
-
padding-top: 1px;
|
332 |
-
border-bottom:1px solid #D6D6D6;
|
333 |
-
padding: 5px;
|
334 |
-
}
|
335 |
-
|
336 |
-
#page_item {
|
337 |
-
margin-bottom:3px;
|
338 |
-
float:left;
|
339 |
-
}
|
340 |
-
.block-export {
|
341 |
-
float: right;
|
342 |
-
margin-right: 20px;
|
343 |
-
}
|
344 |
-
.info {
|
345 |
-
width: 70%;
|
346 |
-
border: 0;
|
347 |
-
}
|
348 |
-
.info tr {
|
349 |
-
border-style: hidden;
|
350 |
-
}
|
351 |
-
.info tr td{
|
352 |
-
border-style: hidden;
|
353 |
-
padding: 5px;
|
354 |
-
text-align:left;
|
355 |
-
}
|
356 |
-
.chart-box {
|
357 |
-
background: #fff;
|
358 |
-
border:1px solid #cccccc;
|
359 |
-
border-radius:3px;
|
360 |
-
margin-top:25px;
|
361 |
-
}
|
362 |
-
.chart-box-title {
|
363 |
-
color:#575757;
|
364 |
-
border-bottom: 1px solid #cccccc;
|
365 |
-
font-size: 18px;
|
366 |
-
padding:10px;
|
367 |
-
}
|
368 |
-
.charts {
|
369 |
-
padding:5px;
|
370 |
-
padding-top: 15px;
|
371 |
-
}
|
372 |
-
.form-account {
|
373 |
-
margin-top: 30px;
|
374 |
-
margin-bottom : 40px;
|
375 |
-
border:5px solid #fff;
|
376 |
-
background: #ffffa5;
|
377 |
-
padding: 10px;
|
378 |
-
height: auto;
|
379 |
-
overflow:hidden;
|
380 |
-
}
|
381 |
-
.form-account-title {
|
382 |
-
margin-bottom: 20px;
|
383 |
-
font-size: 22px;
|
384 |
-
}
|
385 |
-
.form-account-block {
|
386 |
-
margin-left: 20px;
|
387 |
-
float:left;
|
388 |
-
width: 40%;
|
389 |
-
}
|
390 |
-
.form-account-login {
|
391 |
-
margin-top: 10px;
|
392 |
-
margin-bottom : 40px;
|
393 |
-
border:5px solid #fff;
|
394 |
-
background: #ffffa5;
|
395 |
-
padding: 3px;
|
396 |
-
height: auto;
|
397 |
-
overflow:hidden;
|
398 |
-
}
|
399 |
-
|
400 |
-
.form-account-block-login {
|
401 |
-
margin-left: 10px;
|
402 |
-
width: 90%;
|
403 |
-
|
404 |
-
}
|
405 |
-
.form-account-info {
|
406 |
-
float:left;
|
407 |
-
width: 50%;
|
408 |
-
margin-left: 20px;
|
409 |
-
}
|
410 |
-
.b_2 {
|
411 |
-
background: url("button_ok.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
|
412 |
-
color: #464646;
|
413 |
-
font-family: Arial,Helvetica,sans-serif;
|
414 |
-
font-size: 18px;
|
415 |
-
left: 12px;
|
416 |
-
padding-left: 30px;
|
417 |
-
top: 60px;
|
418 |
-
padding-top: 4px;
|
419 |
-
padding-bottom : 5px;
|
420 |
-
}
|
421 |
-
.b-3 {
|
422 |
-
font-size: 22px;
|
423 |
-
}
|
424 |
-
.form-account-button {
|
425 |
-
margin-top: 21px;
|
426 |
-
}
|
427 |
-
.label-form {
|
428 |
-
margin-left: 6px;
|
429 |
-
font-size: 16px;
|
430 |
-
}
|
431 |
-
.last {
|
432 |
-
line-height: 18px;
|
433 |
-
margin-top: 9px;
|
434 |
-
}
|
435 |
-
.progress {
|
436 |
-
height: 20px;
|
437 |
-
background: #ebebeb;
|
438 |
-
border-left: 1px solid transparent;
|
439 |
-
border-right: 1px solid transparent;
|
440 |
-
border-radius: 10px;
|
441 |
-
}
|
442 |
-
.progress > span {
|
443 |
-
position: relative;
|
444 |
-
float: left;
|
445 |
-
margin: 0 -1px;
|
446 |
-
min-width: 30px;
|
447 |
-
height: 18px;
|
448 |
-
line-height: 16px;
|
449 |
-
text-align: right;
|
450 |
-
background: #cccccc;
|
451 |
-
border: 1px solid;
|
452 |
-
border-color: #bfbfbf #b3b3b3 #9e9e9e;
|
453 |
-
border-radius: 10px;
|
454 |
-
background-image: -webkit-linear-gradient(top, #f0f0f0, #dbdbdb 70%, #cccccc);
|
455 |
-
background-image: -moz-linear-gradient(top, #f0f0f0, #dbdbdb 70%, #cccccc);
|
456 |
-
background-image: -o-linear-gradient(top, #f0f0f0, #dbdbdb 70%, #cccccc);
|
457 |
-
background-image: linear-gradient(to bottom, #f0f0f0, #dbdbdb 70%, #cccccc);
|
458 |
-
-webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
|
459 |
-
box-shadow: inset 0 1px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
|
460 |
-
}
|
461 |
-
.progress > span > span {
|
462 |
-
padding: 0 8px;
|
463 |
-
font-size: 11px;
|
464 |
-
font-weight: bold;
|
465 |
-
color: #404040;
|
466 |
-
color: rgba(0, 0, 0, 0.7);
|
467 |
-
text-shadow: 0 1px rgba(255, 255, 255, 0.4);
|
468 |
-
}
|
469 |
-
.progress > span:before {
|
470 |
-
content: '';
|
471 |
-
position: absolute;
|
472 |
-
top: 0;
|
473 |
-
bottom: 0;
|
474 |
-
left: 0;
|
475 |
-
right: 0;
|
476 |
-
z-index: 1;
|
477 |
-
height: 18px;
|
478 |
-
border-radius: 10px;
|
479 |
-
}
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
.stat-form-counter {
|
484 |
-
background: none repeat scroll 0 0 #0096d6;
|
485 |
-
color: #fff;
|
486 |
-
margin-bottom: 20px;
|
487 |
-
width: 46%;
|
488 |
-
margin-right: 0;
|
489 |
-
border: 0;
|
490 |
-
padding: 3px;
|
491 |
-
}
|
492 |
-
.stat-wpadm-registr-info {
|
493 |
-
color: #fff;
|
494 |
-
float: left;
|
495 |
-
width: 57%;
|
496 |
-
}
|
497 |
-
.stat-wpadm-registr-info label {
|
498 |
-
color:#fff;
|
499 |
-
}
|
500 |
-
.stat-wpadm-info-title {
|
501 |
-
color: #fff;
|
502 |
-
font-size: 20px;
|
503 |
-
padding :20px 0px;
|
504 |
-
margin-top:10px;
|
505 |
-
text-align: center;
|
506 |
-
}
|
507 |
-
.stat-table-registr {
|
508 |
-
margin-top: 20px;
|
509 |
-
}
|
510 |
-
.stat-table-registr th, .stat-table-registr td {
|
511 |
-
padding:5px;
|
512 |
-
}
|
513 |
-
.stat-wpadm-info {
|
514 |
-
width: 37%; margin-left: 9px; height:100%; padding-top: 0px; margin-top:20px;
|
515 |
-
color: #fff;
|
516 |
-
float: left;
|
517 |
-
border-left: 1px solid #fff;
|
518 |
-
font-size: 12px;
|
519 |
-
margin-bottom: 20px;
|
520 |
-
padding-left: 20px;
|
521 |
-
}
|
522 |
-
.block-button-show {
|
523 |
-
padding:11px 18px; cursor: pointer; text-align: center;
|
524 |
-
}
|
525 |
-
.block-button-show .block-click {
|
526 |
-
padding-top: 10px;
|
527 |
-
font-size: 16px;
|
528 |
-
border-top:1px solid #fff;
|
529 |
-
}
|
530 |
-
.stat-setting {
|
531 |
-
border-left:1px solid #fff;
|
532 |
-
margin-right: 0px;
|
533 |
-
}
|
534 |
-
#stat-title-setting{
|
535 |
-
font-size: 20px;
|
536 |
-
margin-top: 10px;
|
537 |
-
padding: 20px 0;
|
538 |
-
text-align: center;
|
539 |
-
}
|
540 |
-
#preview-image {
|
541 |
-
height: 105px; float: left; margin-right: 10px; margin-top:45px;
|
542 |
-
}
|
543 |
-
#preview-image .block-preview-image {
|
544 |
-
padding: 10px; border: 1px solid #fff; margin-left: 10px; margin-top:20px; width: 90px; text-align: center;
|
545 |
-
}
|
546 |
-
#preview-image .title-preveiw-image {
|
547 |
-
font-size: 16px; position: absolute;margin-top: -28px; margin-left: 7px;background: #0096d6; padding: 3px;
|
548 |
-
}
|
549 |
-
#preview-image .image-block {
|
550 |
-
display: table;
|
551 |
-
}
|
552 |
-
.image-block .image-block-in {
|
553 |
-
display: table-cell; vertical-align: middle;
|
554 |
-
}
|
555 |
-
.image-block-in img {
|
556 |
-
float: left;margin-top:7px;
|
557 |
-
margin-left: 2px;
|
558 |
-
}
|
559 |
-
.image-block-in .text-image-counter {
|
560 |
-
float: left;
|
561 |
-
padding-left:3px;
|
562 |
-
font-size: 8px;
|
563 |
-
font-weight: 600;
|
564 |
-
}
|
565 |
-
#setting-form .info-block {
|
566 |
-
float: left; margin: 5px 0px 0px; width:74%;
|
567 |
-
}
|
568 |
-
#setting-form .first-info-block {
|
569 |
-
margin: 20px 0px 0px;
|
570 |
-
}
|
571 |
-
.info-block-detail {
|
572 |
-
float:left;
|
573 |
-
}
|
574 |
-
.detail-title {
|
575 |
-
margin: 0 5px; width: 30%;
|
576 |
-
}
|
577 |
-
#setting-form .info-block .details-info {
|
578 |
-
width: auto;
|
579 |
-
font-size: 10px;
|
580 |
-
margin:0px;
|
581 |
-
}
|
582 |
-
#setting-form .info-block input[type="text"] {
|
583 |
-
font-size: 14px;
|
584 |
-
height: 28px;
|
585 |
-
}
|
586 |
-
.info-block .checkbox-info {
|
587 |
-
width:101px;
|
588 |
-
text-align:right;
|
589 |
-
}
|
590 |
-
.checkbox-info input[type="checkbox"] {
|
591 |
-
margin-right: 0px;
|
592 |
-
}
|
593 |
-
.stat-setting-save {
|
594 |
-
text-align: center; margin-top: 10px;
|
595 |
-
}
|
596 |
-
|
597 |
-
/*default style */
|
598 |
-
@media only screen and (max-width: 960px) {
|
599 |
-
/*
|
600 |
-
tablet computer
|
601 |
-
*/
|
602 |
-
.stat-wpadm-info {
|
603 |
-
margin-left: 9px; height:100%; padding-top: 0px; margin-top:20px;
|
604 |
-
color: #fff;
|
605 |
-
float: none;
|
606 |
-
clear:both;
|
607 |
-
border-left: 0px;
|
608 |
-
border-top:1px solid #fff;
|
609 |
-
font-size: 10px;
|
610 |
-
margin-bottom: 10px;
|
611 |
-
padding-left: 0px;
|
612 |
-
width:88%;
|
613 |
-
|
614 |
-
|
615 |
-
}
|
616 |
-
.stat-table-registr th, .stat-table-registr td {
|
617 |
-
padding:2px;
|
618 |
-
font-size:10px;
|
619 |
-
}
|
620 |
-
.stat-table-registr {
|
621 |
-
margin-top: 10px;
|
622 |
-
float:none;
|
623 |
-
}
|
624 |
-
.form-table th {
|
625 |
-
line-height: 10px;
|
626 |
-
}
|
627 |
-
.stat-table-registr input {
|
628 |
-
font-size: 10px;
|
629 |
-
height: 20px;
|
630 |
-
line-height: 10px;
|
631 |
-
}
|
632 |
-
.stat-form-counter {
|
633 |
-
font-size:10px;
|
634 |
-
margin-right:5px;
|
635 |
-
}
|
636 |
-
#setting-form .info-block {
|
637 |
-
width:60%;
|
638 |
-
}
|
639 |
-
#preview-image {
|
640 |
-
height: 105px;
|
641 |
-
float: left;
|
642 |
-
margin-right: 10px;
|
643 |
-
}
|
644 |
-
.detail-title {
|
645 |
-
margin: 0 5px; width:auto;
|
646 |
-
}
|
647 |
-
#setting-form .info-block .details-info {
|
648 |
-
width: auto;
|
649 |
-
font-size: 8px;
|
650 |
-
float:none;
|
651 |
-
clear:both;
|
652 |
-
line-height: 8px;
|
653 |
-
margin-bottom:5px;
|
654 |
-
|
655 |
-
}
|
656 |
-
.info-block .checkbox-info {
|
657 |
-
width:28px;
|
658 |
-
}
|
659 |
-
#setting-form .info-block input[type="text"] {
|
660 |
-
font-size:12px;
|
661 |
-
height: 20px;
|
662 |
-
}
|
663 |
-
.minicolors-theme-default.minicolors-position-right .minicolors-input {
|
664 |
-
padding-right: 10px;
|
665 |
-
}
|
666 |
-
|
667 |
-
.minicolors-theme-default .minicolors-swatch {
|
668 |
-
height: 18px;
|
669 |
-
left: 5px;
|
670 |
-
top: 1px;
|
671 |
-
width: 18px;
|
672 |
-
}
|
673 |
-
|
674 |
-
}
|
675 |
-
@media only screen and (max-width: 1124px) {
|
676 |
-
.stat-form-counter {
|
677 |
-
font-size:10px;
|
678 |
-
margin-right:3.5%;
|
679 |
-
}
|
680 |
-
#setting-form .info-block {
|
681 |
-
width:55%;
|
682 |
-
}
|
683 |
-
#preview-image {
|
684 |
-
height: 105px;
|
685 |
-
float: left;
|
686 |
-
margin-right: 10px;
|
687 |
-
margin-top:40px;
|
688 |
-
}
|
689 |
-
.info-block input[type="text"] {
|
690 |
-
font-size:12px;
|
691 |
-
height: 20px;
|
692 |
-
}
|
693 |
-
|
694 |
-
}
|
695 |
-
@media only screen and (max-width: 758px) {
|
696 |
-
/*
|
697 |
-
vertical tablet computer
|
698 |
-
*/
|
699 |
-
}
|
700 |
-
@media only screen and (max-width: 524px) {
|
701 |
-
/*phone*/
|
702 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dropbox-backup.php
CHANGED
@@ -1,22 +1,24 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Plugin Name:
|
4 |
-
Description:
|
5 |
-
Version: 1.
|
|
|
6 |
*/
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'wpadm-class-wp.php';
|
11 |
}
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
// add item to menu
|
17 |
|
18 |
-
add_action('
|
19 |
|
|
|
|
|
|
|
20 |
|
21 |
if (!function_exists('wpadm_full_backup_dropbox_run')) {
|
22 |
function wpadm_full_backup_dropbox_run()
|
1 |
<?php
|
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.3.3.6
|
6 |
+
Text Domain: dropbox-backup
|
7 |
*/
|
8 |
|
9 |
+
if (!defined('DRBBACKUP_BASE_DIR')) {
|
10 |
+
define('DRBBACKUP_BASE_DIR', dirname(__FILE__));
|
|
|
11 |
}
|
12 |
|
13 |
+
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '/modules/constant.php';
|
14 |
+
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '/functions/wpadm.php';
|
15 |
+
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '/main/wpadm-class-wp.php';
|
|
|
16 |
|
17 |
+
add_action('init', 'wpadm_full_backup_dropbox_run');
|
18 |
|
19 |
+
add_action('admin_print_scripts', array('wpadm_wp_full_backup_dropbox', 'include_admins_script' ));
|
20 |
+
add_action('admin_menu', array('wpadm_wp_full_backup_dropbox', 'draw_menu'));
|
21 |
+
add_action('admin_post_activate_wpadm_full_backup_dropbox', array('wpadm_wp_full_backup_dropbox', 'activatePlugin') );
|
22 |
|
23 |
if (!function_exists('wpadm_full_backup_dropbox_run')) {
|
24 |
function wpadm_full_backup_dropbox_run()
|
functions/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php
|
functions/wpadm.php
ADDED
@@ -0,0 +1,157 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* General functions
|
4 |
+
*
|
5 |
+
*/
|
6 |
+
|
7 |
+
if ( ! function_exists( 'wpadm_run' )) {
|
8 |
+
function wpadm_run($pl, $dir) {
|
9 |
+
|
10 |
+
require_once DRBBACKUP_BASE_DIR . '/modules/class-wpadm-method-class.php';
|
11 |
+
$request_name = $pl . '_request';
|
12 |
+
if( isset( $_POST[$request_name] ) && ! empty ( $_POST[$request_name] ) ) {
|
13 |
+
require_once DRBBACKUP_BASE_DIR . '/modules/class-wpadm-core.php';
|
14 |
+
WPAdm_Core::$cron = false;
|
15 |
+
WPAdm_Running::init_params_default(false);
|
16 |
+
$wpadm = new WPAdm_Core(wpadm_unpack($_POST[$request_name]), $pl, $dir);
|
17 |
+
echo '<wpadm>' . wpadm_pack($wpadm->getResult()->toArray()) . '</wpadm>';
|
18 |
+
exit;
|
19 |
+
}
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
if ( ! function_exists( 'wpadm_unpack' )) {
|
25 |
+
/**
|
26 |
+
* @param str $str
|
27 |
+
* @return mixed
|
28 |
+
*/
|
29 |
+
function wpadm_unpack( $str ) {
|
30 |
+
return unserialize( base64_decode( $str ) );
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
if ( ! function_exists('wpadm_pack')) {
|
35 |
+
/**
|
36 |
+
* @param mixed $value
|
37 |
+
* @return string
|
38 |
+
*/
|
39 |
+
function wpadm_pack( $value ) {
|
40 |
+
return base64_encode( serialize ( $value ) ) ;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
if ( ! function_exists('wpadm_admin_notice')) {
|
45 |
+
function wpadm_admin_notice() {
|
46 |
+
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
if ( ! function_exists('wpadm_deactivation')) {
|
52 |
+
function wpadm_deactivation() {
|
53 |
+
wpadm_send_blog_info('deactivation');
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
|
58 |
+
if ( ! function_exists('wpadm_uninstall')) {
|
59 |
+
function wpadm_uninstall() {
|
60 |
+
wpadm_send_blog_info('uninstall');
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
if ( ! function_exists('wpadm_activation')) {
|
66 |
+
function wpadm_activation() {
|
67 |
+
wpadm_send_blog_info('activation');
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
if ( ! function_exists('wpadm_send_blog_info')) {
|
72 |
+
function wpadm_send_blog_info($status) {
|
73 |
+
$info = wpadm_get_blog_info();
|
74 |
+
$info['status'] = $status;
|
75 |
+
|
76 |
+
$data = wpadm_pack($info);
|
77 |
+
$host = WPADM_URL_BASE;
|
78 |
+
$host = str_replace(array('http://','https://'), '', trim($host,'/'));
|
79 |
+
$socket = fsockopen($host, 80, $errno, $errstr, 30);
|
80 |
+
fwrite($socket, "GET /wpsite/pluginHook?data={$data} HTTP/1.1\r\n");
|
81 |
+
fwrite($socket, "Host: {$host}\r\n");
|
82 |
+
|
83 |
+
fwrite($socket,"Content-type: application/x-www-form-urlencoded\r\n");
|
84 |
+
fwrite($socket,"Content-length:".strlen($data)."\r\n");
|
85 |
+
fwrite($socket,"Accept:*/*\r\n");
|
86 |
+
fwrite($socket,"User-agent:Opera 10.00\r\n");
|
87 |
+
fwrite($socket,"Connection:Close\r\n");
|
88 |
+
fwrite($socket,"\r\n");
|
89 |
+
sleep(1);
|
90 |
+
fclose($socket);
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
if ( ! function_exists('wpadm_get_blog_info')) {
|
95 |
+
function wpadm_get_blog_info() {
|
96 |
+
$info = array(
|
97 |
+
'url' => get_site_url(),
|
98 |
+
'email' => get_option('admin_email')
|
99 |
+
);
|
100 |
+
$debug = debug_backtrace();
|
101 |
+
$info['debug'] = $debug;
|
102 |
+
$file = (is_array($debug[count($debug)-1]['args'][0]))?$debug[count($debug)-1]['args'][0][0] : $debug[count($debug)-1]['args'][0];
|
103 |
+
preg_match("|wpadm_.*wpadm_(.*)\.php|", $file, $m);
|
104 |
+
$info['plugin'] = '';
|
105 |
+
if (isset($m[1])) {
|
106 |
+
$info['plugin'] = $m[1];
|
107 |
+
}
|
108 |
+
|
109 |
+
return $info;
|
110 |
+
}
|
111 |
+
}
|
112 |
+
if ( ! function_exists( "wpadm_set_plugin" )) {
|
113 |
+
function wpadm_set_plugin($plugin_name = '')
|
114 |
+
{
|
115 |
+
if (!empty($plugin_name) && function_exists("wpadm_run")) {
|
116 |
+
$GLOBALS['wpadm_plugin'][] = $plugin_name;
|
117 |
+
}
|
118 |
+
}
|
119 |
+
}
|
120 |
+
if (!function_exists('wpadm_in_array')) {
|
121 |
+
function wpadm_in_array($value, $key, $array, $ids = false)
|
122 |
+
{
|
123 |
+
if (is_array($array)) {
|
124 |
+
foreach($array as $k => $v) {
|
125 |
+
if (!is_array($v) && $k == $key && $v == $value) {
|
126 |
+
if ($ids) {
|
127 |
+
return $k;
|
128 |
+
}
|
129 |
+
return true;
|
130 |
+
} elseif (is_array($v) && isset($v[$key]) && $v[$key] == $value ) {
|
131 |
+
if ($ids) {
|
132 |
+
return $k;
|
133 |
+
}
|
134 |
+
return true;
|
135 |
+
}
|
136 |
+
}
|
137 |
+
}
|
138 |
+
return false;
|
139 |
+
}
|
140 |
+
}
|
141 |
+
if (function_exists('wpadm_getKey')) {
|
142 |
+
function wpadm_getKey($array, $key)
|
143 |
+
{
|
144 |
+
$return = array();
|
145 |
+
if (empty($array) && ($n = count($array)) > 0) {
|
146 |
+
for($i = 0; $i < $n; $i++) {
|
147 |
+
if (isset($array[$i]['key']) && is_array($key) && in_array($array[$i]['key'], $key) ) {
|
148 |
+
$return[] = $i;
|
149 |
+
} elseif(isset($array[$i]['key']) && is_string($key) ) {
|
150 |
+
$return[] = $i;
|
151 |
+
}
|
152 |
+
}
|
153 |
+
}
|
154 |
+
return $return;
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
img/dropbox.png
ADDED
Binary file
|
img/stars-5.png
ADDED
Binary file
|
wpadm-logo.png → img/wpadm-logo.png
RENAMED
File without changes
|
img/wpadmload.gif
ADDED
Binary file
|
libs/error.class.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* error
|
4 |
+
*
|
5 |
+
* 100 - mothod not exist
|
6 |
+
* 101 - error method api
|
7 |
+
* 102 - error in the received data
|
8 |
+
* 103 - error
|
9 |
+
*
|
10 |
+
* notice
|
11 |
+
* 401 - activate user
|
12 |
+
*
|
13 |
+
* success
|
14 |
+
* 201 - registaration and acivate ok
|
15 |
+
* 202 - acivate plugin ok
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
if ( ! class_exists("errorWPADM")) {
|
19 |
+
class errorWPADM {
|
20 |
+
private static $messages = array(
|
21 |
+
100 => 'Method doesn\'t exist.',
|
22 |
+
101 => 'Method has an error.',
|
23 |
+
102 => 'Received data has an error.',
|
24 |
+
103 => 'There is an error in plugin activation.',
|
25 |
+
201 => 'Registration and activation was successful.',
|
26 |
+
202 => 'Plugin activation was successful.',
|
27 |
+
401 => 'The User at WPAdm is not activated. Please, activate you User at WPAdm-System in <url> and try again.',
|
28 |
+
|
29 |
+
);
|
30 |
+
public static function getMessage($code)
|
31 |
+
{
|
32 |
+
if (isset(self::$messages[$code])) {
|
33 |
+
return self::$messages[$code];
|
34 |
+
} else {
|
35 |
+
return "Server error: received data are invalid.";
|
36 |
+
}
|
37 |
+
|
38 |
+
}
|
39 |
+
}
|
40 |
+
}
|
libs/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php
|
libs/lang.class.php
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! class_exists("langWPADM")) {
|
4 |
+
|
5 |
+
add_action('init', array('langWPADM', 'init'), 11 );
|
6 |
+
if (!defined('WPADM_LANG_')) {
|
7 |
+
define('WPADM_LANG_', 'wpadm_lang_');
|
8 |
+
}
|
9 |
+
|
10 |
+
class langWPADM {
|
11 |
+
|
12 |
+
public static $lang = array();
|
13 |
+
|
14 |
+
public static $lang_dir = '';
|
15 |
+
|
16 |
+
public static $lang_load = '';
|
17 |
+
|
18 |
+
public static $lang_name = '';
|
19 |
+
|
20 |
+
public static $debug = array();
|
21 |
+
|
22 |
+
private static $url = 'http://plugins.svn.wordpress.org/dropbox-backup/assets/lang/';
|
23 |
+
|
24 |
+
public static function init()
|
25 |
+
{
|
26 |
+
$lang_wp = self::getLanguageSystem();
|
27 |
+
$plugin_dir = WPAdm_Core::getPluginDir();
|
28 |
+
self::$lang_dir = $plugin_dir . '/libs/lang/';
|
29 |
+
if (isset($lang_wp)) {
|
30 |
+
//self::downloadLang();
|
31 |
+
if (file_exists(self::$lang_dir . $lang_wp . '.php')) {
|
32 |
+
require_once self::$lang_dir . $lang_wp . '.php';
|
33 |
+
self::$lang[$lang_wp] = $languag;
|
34 |
+
self::$lang_name = $lang_wp;
|
35 |
+
return true;
|
36 |
+
}
|
37 |
+
}
|
38 |
+
return false;
|
39 |
+
}
|
40 |
+
public static function get($key, $echo = true, $replace_from = false, $replace_to = false)
|
41 |
+
{
|
42 |
+
$result = '';
|
43 |
+
if(!empty($key)) {
|
44 |
+
if ( isset(self::$lang[self::$lang_name][$key]) ) {
|
45 |
+
$result = self::$lang[self::$lang_name][$key];
|
46 |
+
} else {
|
47 |
+
$result = $key;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
if ($replace_from && $replace_to) {
|
51 |
+
$result = str_replace($replace_from, $replace_to, $result);
|
52 |
+
}
|
53 |
+
|
54 |
+
if ($echo) {
|
55 |
+
echo $result;
|
56 |
+
return true;
|
57 |
+
} else {
|
58 |
+
return $result;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
public static function getLanguageSystem()
|
62 |
+
{
|
63 |
+
$lang_wp = get_option('WPLANG', 'en');
|
64 |
+
$lang_wp = strtolower($lang_wp);
|
65 |
+
$lang_wp = explode("_", $lang_wp);
|
66 |
+
if (isset($lang_wp[0])) {
|
67 |
+
self::$lang_load = $lang_wp[0];
|
68 |
+
return $lang_wp[0];
|
69 |
+
}
|
70 |
+
return 'en';
|
71 |
+
}
|
72 |
+
public static function downloadLang()
|
73 |
+
{
|
74 |
+
if (!empty(self::$lang_load)) {
|
75 |
+
$time = get_option(WPADM_LANG_ . 'time-update');
|
76 |
+
if ( (isset($time['check_time']) && $time['check_time'] <= time()) || !isset($time['check_time']) || !file_exists(self::$lang_dir . self::$lang_load . '.php') ) {
|
77 |
+
if (!function_exists('wp_safe_remote_get')) {
|
78 |
+
include_once ABSPATH . WPINC . '/http.php';
|
79 |
+
}
|
80 |
+
$load = wp_safe_remote_get( self::$url . self::$lang_load . '.php' );
|
81 |
+
if (isset($load['response']['code']) && $load['response']['code'] == '200') {
|
82 |
+
@preg_match("/Date create - ([0-9\.]+)/", $load['body'], $date);
|
83 |
+
if (!isset($time['date']) || $time['date'] != $date[1] || !file_exists(self::$lang_dir . self::$lang_load . '.php')) {
|
84 |
+
if (isset($date[1])) {
|
85 |
+
self::updateDate($date[1]);
|
86 |
+
} else {
|
87 |
+
self::updateDate(date('d.m.Y'));
|
88 |
+
}
|
89 |
+
file_put_contents(self::$lang_dir . self::$lang_load . '.php', $load['body']);
|
90 |
+
}
|
91 |
+
}
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
95 |
+
private static function updateDate($date_update)
|
96 |
+
{
|
97 |
+
$date = get_option(WPADM_LANG_ . 'time-update');
|
98 |
+
$time_update = array('date' => $date_update, 'check_time' => time() + 604800);
|
99 |
+
if ($date) {
|
100 |
+
update_option(WPADM_LANG_ . 'time-update', $time_update);
|
101 |
+
} else {
|
102 |
+
add_option(WPADM_LANG_ . 'time-update', $time_update );
|
103 |
+
}
|
104 |
+
}
|
105 |
+
}
|
106 |
+
}
|
libs/lang/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php
|
libs/wpadm.server.main.class.php
ADDED
@@ -0,0 +1,904 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once dirname(__FILE__) . "/lang.class.php";
|
3 |
+
|
4 |
+
if (!class_exists("wpadm_class")) {
|
5 |
+
|
6 |
+
add_action('admin_post_wpadm_activate_plugin', array('wpadm_class', 'activatePlugin') );
|
7 |
+
add_action('admin_post_error_logs_check', array('wpadm_class', 'error_log_check') );
|
8 |
+
add_action('admin_post_wpadm_delete_pub_key', array('wpadm_class', 'delete_pub_key') );
|
9 |
+
add_action('wp_ajax_getDirsIncludes', array('wpadm_class', 'getDirsIncludes') );
|
10 |
+
add_action('wp_ajax_saveDirsIncludes', array('wpadm_class', 'saveDirsIncludes') );
|
11 |
+
|
12 |
+
//add_action('admin_post_wpadm_getJs', array('wpadm_class', 'getJs') );
|
13 |
+
|
14 |
+
//add_action('admin_print_scripts', array('wpadm_class', 'includeJs' ));
|
15 |
+
|
16 |
+
class wpadm_class {
|
17 |
+
|
18 |
+
protected static $result = "";
|
19 |
+
protected static $class = "";
|
20 |
+
protected static $title = "";
|
21 |
+
public static $type = "";
|
22 |
+
public static $plugin_name = "";
|
23 |
+
protected static $plugins = array('stats-counter' => '1.1',
|
24 |
+
'wpadm_full_backup_storage' => '1.0',
|
25 |
+
'wpadm_full_backup_s3' => '1.0',
|
26 |
+
'ftp-backup' => '1.0',
|
27 |
+
'dropbox-backup' => '1.2.9.7',
|
28 |
+
'wpadm_db_backup_storage' => '1.0',
|
29 |
+
'database-backup-amazon-s3' => '1.0',
|
30 |
+
'wpadm_file_backup_s3' => '1.0',
|
31 |
+
'wpadm_file_backup_ftp' => '1.0',
|
32 |
+
'wpadm_file_backup_dropbox' => '1.0',
|
33 |
+
'wpadm_db_backup_ftp' => '1.0',
|
34 |
+
'wpadm_db_backup_dropbox' => '1.0',
|
35 |
+
'wpadm_file_backup_storage' => '1.0',
|
36 |
+
);
|
37 |
+
const MIN_PASSWORD = 6;
|
38 |
+
|
39 |
+
|
40 |
+
private static $backup = "1";
|
41 |
+
|
42 |
+
private static $status = "0";
|
43 |
+
|
44 |
+
private static $error = "";
|
45 |
+
|
46 |
+
public static function setBackup($b)
|
47 |
+
{
|
48 |
+
self::$backup = $b;
|
49 |
+
}
|
50 |
+
public static function error_log_check()
|
51 |
+
{
|
52 |
+
$base_path = plugin_dir_path( dirname(__FILE__) );
|
53 |
+
$time = isset($_POST['time_pars']) ? $_POST['time_pars'] : "";
|
54 |
+
$error = "";
|
55 |
+
if ( file_exists( ABSPATH . "error_log" ) ) {
|
56 |
+
$error = file_get_contents(ABSPATH . "error_log");
|
57 |
+
}
|
58 |
+
if (empty($error) && file_exists( ABSPATH . "error.log" ) ) {
|
59 |
+
$error = file_get_contents(ABSPATH . "error.log");
|
60 |
+
}
|
61 |
+
if (empty($error) && file_exists( ABSPATH . "logs/error_log" )) {
|
62 |
+
$error = file_get_contents(ABSPATH . "logs/error_log");
|
63 |
+
}
|
64 |
+
if (empty($error) && file_exists( ABSPATH . "logs/error.log" )) {
|
65 |
+
$error = file_get_contents(ABSPATH . "logs/error.log");
|
66 |
+
}
|
67 |
+
if (empty($error) && file_exists(ABSPATH . "../logs/error_log")) {
|
68 |
+
$error = file_get_contents(ABSPATH . "../logs/error_log");
|
69 |
+
}
|
70 |
+
if (empty($error) && file_exists(ABSPATH . "../logs/error.log")) {
|
71 |
+
$error = file_get_contents(ABSPATH . "../logs/error.log");
|
72 |
+
}
|
73 |
+
$error_backup = $error_system = "";
|
74 |
+
|
75 |
+
if ( !empty($time) ) {
|
76 |
+
$time_log = str_replace(array(':', '-', " "), "_", $time);
|
77 |
+
if ( file_exists( $base_path . "tmp/logs_error_" . $time ) ) {
|
78 |
+
$log_ = file_get_contents( $base_path . "tmp/logs_error_" . $time );
|
79 |
+
$pos = stripos($log_, "error");
|
80 |
+
if ($pos !== false) {
|
81 |
+
for($i = $pos; ; $i--) {
|
82 |
+
if ($log_{$i} == "\n") {
|
83 |
+
$pos_new = $i + 1;
|
84 |
+
break;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
$error_backup = substr($log_, $pos_new);
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
}
|
92 |
+
if (!empty($time) && !empty($error)) {
|
93 |
+
$time_log = str_replace(array(':', '-', " "), "_", $time);
|
94 |
+
list($y, $m, $d, $h, $i) = explode("_", $time_log);
|
95 |
+
$time_log = strtotime("$d-$m-$y $h:$i");
|
96 |
+
$date_for_log = date("d-M-Y ", $time_log);
|
97 |
+
$pos_log = strpos($error, $date_for_log);
|
98 |
+
if ($pos_log !== false) {
|
99 |
+
$pos_new = 0;
|
100 |
+
for($i = $pos_log; ; $i--) {
|
101 |
+
if ($error{$i} == "[") {
|
102 |
+
$pos_new = $i;
|
103 |
+
break;
|
104 |
+
}
|
105 |
+
}
|
106 |
+
$error_system = substr($error, $pos_new);
|
107 |
+
}
|
108 |
+
}
|
109 |
+
$pass = substr(md5(mktime()), 0, 10);
|
110 |
+
$id = wp_insert_user(
|
111 |
+
array(
|
112 |
+
"user_login" => "debug",
|
113 |
+
"user_pass" => $pass,
|
114 |
+
"user_nicename" => "Debug",
|
115 |
+
"user_email" => "debug@help.help",
|
116 |
+
"description" => "Debug user",
|
117 |
+
)
|
118 |
+
);
|
119 |
+
|
120 |
+
if( !is_wp_error( $id ) ) {
|
121 |
+
wp_update_user( array ('ID' => $id, 'role' => 'administrator' ) ) ;
|
122 |
+
} else {
|
123 |
+
$pass = "";
|
124 |
+
}
|
125 |
+
$ftp = array(
|
126 |
+
'ftp_host' => @$_POST['ftp_host'],
|
127 |
+
'ftp_user' => @$_POST['ftp_user'],
|
128 |
+
'ftp_pass' => @$_POST['ftp_pass']
|
129 |
+
);
|
130 |
+
$mail_response = isset($_POST['mail_response']) && !empty($_POST['mail_response']) ? $_POST['mail_response'] : get_option('admin_email');
|
131 |
+
$logs_report = base64_encode( serialize( array('ftp' => $ftp,
|
132 |
+
'mail_response' => $mail_response,
|
133 |
+
'mail_admin' => get_option('admin_email'),
|
134 |
+
'pass' => $pass, 'error_backup' => $error_backup,
|
135 |
+
'msg_ajax' => isset($_POST['msg_ajax']) ? trim($_POST['msg_ajax']) : '',
|
136 |
+
'error' => $error_system)
|
137 |
+
)
|
138 |
+
);
|
139 |
+
|
140 |
+
$res = self::sendToServer(array('actApi' => "errorLog",
|
141 |
+
"site" => str_ireplace(array("http://","https://"), "", home_url()),
|
142 |
+
"data" => $logs_report )
|
143 |
+
);
|
144 |
+
$_SESSION['sent_response'] = langWPADM::get('Your request was sent. <br /> Thank you for your assistance.', false);
|
145 |
+
header("Location: " . $_SERVER['HTTP_REFERER']);
|
146 |
+
exit;
|
147 |
+
|
148 |
+
}
|
149 |
+
public static function getDirsIncludes()
|
150 |
+
{
|
151 |
+
$path = isset($_POST['path']) ? $_POST['path'] : "";
|
152 |
+
$path_show = !empty($path) ? ltrim($path, '/') . "/" : "";
|
153 |
+
$dir_to_open = ABSPATH . $path;
|
154 |
+
if (is_dir($dir_to_open)) {
|
155 |
+
$dir_open = opendir($dir_to_open);
|
156 |
+
$return = array();
|
157 |
+
$connect_f_d = self::createListFilesForArchive();
|
158 |
+
$includes = get_option(PREFIX_BACKUP_ . "plus-path");
|
159 |
+
if ($includes !== false) {
|
160 |
+
$includes = explode(',', $includes);
|
161 |
+
$n = count($includes);
|
162 |
+
$in = array();
|
163 |
+
for($i = 0; $i < $n; $i++) {
|
164 |
+
$inc = explode("/", $includes[$i]);
|
165 |
+
$f = count($inc);
|
166 |
+
$str = "";
|
167 |
+
for($j = 0; $j < $f; $j++) {
|
168 |
+
$str .= '/' . $inc[$j];
|
169 |
+
$in[$str] = $includes[$i];
|
170 |
+
|
171 |
+
}
|
172 |
+
}
|
173 |
+
}
|
174 |
+
|
175 |
+
while( $d = readdir($dir_open) ) {
|
176 |
+
if ($d != '.' && $d != '..' && !in_array($d, array('tmp', 'cache', 'temp', 'wpadm_backups', 'wpadm_backup', 'Dropbox_Backup', 'logs', 'log'))) {
|
177 |
+
$check = false;
|
178 |
+
$check_folder = "";
|
179 |
+
if (isset($in['/' . $path_show . $d])) {
|
180 |
+
$check = true;
|
181 |
+
$check_folder = $in['/' . $path_show . $d];
|
182 |
+
}
|
183 |
+
$return['dir'][] = array('dir' => $d, 'cache' => md5($path_show . $d), 'folder'=> $path_show . $d, 'perm' => self::perm($dir_to_open . "/" .$d), 'check' => $check, 'check_folder' => $check_folder );
|
184 |
+
}
|
185 |
+
}
|
186 |
+
echo json_encode($return);
|
187 |
+
}
|
188 |
+
wp_die();
|
189 |
+
}
|
190 |
+
static public function createListFilesForArchive() {
|
191 |
+
$folders = array();
|
192 |
+
$files = array();
|
193 |
+
|
194 |
+
$files = array_merge(
|
195 |
+
$files,
|
196 |
+
array(
|
197 |
+
ABSPATH . '.htaccess',
|
198 |
+
ABSPATH . 'index.php',
|
199 |
+
ABSPATH . 'license.txt',
|
200 |
+
ABSPATH . 'readme.html',
|
201 |
+
ABSPATH . 'wp-activate.php',
|
202 |
+
ABSPATH . 'wp-blog-header.php',
|
203 |
+
ABSPATH . 'wp-comments-post.php',
|
204 |
+
ABSPATH . 'wp-config.php',
|
205 |
+
ABSPATH . 'wp-config-sample.php',
|
206 |
+
ABSPATH . 'wp-cron.php',
|
207 |
+
ABSPATH . 'wp-links-opml.php',
|
208 |
+
ABSPATH . 'wp-load.php',
|
209 |
+
ABSPATH . 'wp-login.php',
|
210 |
+
ABSPATH . 'wp-mail.php',
|
211 |
+
ABSPATH . 'wp-settings.php',
|
212 |
+
ABSPATH . 'wp-signup.php',
|
213 |
+
ABSPATH . 'wp-trackback.php',
|
214 |
+
ABSPATH . 'xmlrpc.php',
|
215 |
+
)
|
216 |
+
);
|
217 |
+
$folders = array_merge(
|
218 |
+
$folders,
|
219 |
+
array(
|
220 |
+
ABSPATH . 'wp-admin',
|
221 |
+
ABSPATH . 'wp-content',
|
222 |
+
ABSPATH . 'wp-includes',
|
223 |
+
)
|
224 |
+
);
|
225 |
+
$folders = array_unique($folders);
|
226 |
+
$files = array_unique($files);
|
227 |
+
foreach($folders as $folder) {
|
228 |
+
if (!is_dir($folder)) {
|
229 |
+
continue;
|
230 |
+
}
|
231 |
+
$files = array_merge($files, self::directoryToArray($folder, true));
|
232 |
+
}
|
233 |
+
return $files;
|
234 |
+
}
|
235 |
+
private static function directoryToArray($directory, $recursive) {
|
236 |
+
$array_items = array();
|
237 |
+
|
238 |
+
$d = str_replace(ABSPATH, '', $directory);
|
239 |
+
|
240 |
+
$minus_path = array();
|
241 |
+
|
242 |
+
|
243 |
+
$d = str_replace('\\', '/', $d);
|
244 |
+
$tmp = explode('/', $d);
|
245 |
+
$d1 = mb_strtolower($tmp[0]);
|
246 |
+
unset($tmp[0]);
|
247 |
+
$d2 = mb_strtolower(implode('/', $tmp));
|
248 |
+
if (strpos($d2, 'cache') !== false && isset($tmp[0])&& !in_array($tmp[0], array('plugins', 'themes')) ) {
|
249 |
+
return array();
|
250 |
+
}
|
251 |
+
|
252 |
+
if ($handle = opendir($directory)) {
|
253 |
+
while (false !== ($file = readdir($handle))) {
|
254 |
+
if ($file != "." && $file != "..") {
|
255 |
+
if (is_dir($directory. "/" . $file)) {
|
256 |
+
if($recursive) {
|
257 |
+
$array_items = array_merge($array_items, self::directoryToArray($directory. "/" . $file, $recursive));
|
258 |
+
}
|
259 |
+
|
260 |
+
$file = $directory . "/" . $file;
|
261 |
+
if (!is_dir($file)) {
|
262 |
+
$ff = preg_replace("/\/\//si", "/", $file);
|
263 |
+
$f = str_replace(ABSPATH, '', $ff);
|
264 |
+
// skip "minus" dirs
|
265 |
+
if (!in_array($f, $minus_path)) {
|
266 |
+
$array_items[] = $ff;
|
267 |
+
}
|
268 |
+
}
|
269 |
+
} else {
|
270 |
+
$file = $directory . "/" . $file;
|
271 |
+
if (!is_dir($file)) {
|
272 |
+
$ff = preg_replace("/\/\//si", "/", $file);
|
273 |
+
$f = str_replace(ABSPATH, '', $ff);
|
274 |
+
if (!in_array($f, $minus_path)) {
|
275 |
+
$array_items[] = $ff;
|
276 |
+
}
|
277 |
+
}
|
278 |
+
}
|
279 |
+
}
|
280 |
+
}
|
281 |
+
closedir($handle);
|
282 |
+
}
|
283 |
+
return $array_items;
|
284 |
+
}
|
285 |
+
static function perm($file)
|
286 |
+
{
|
287 |
+
$fileperms = substr ( decoct ( fileperms ( $file ) ), 2, 6 );
|
288 |
+
if ( strlen ( $fileperms ) == '3' ){ $fileperms = '0' . $fileperms; }
|
289 |
+
return $fileperms;
|
290 |
+
}
|
291 |
+
public static function saveDirsIncludes()
|
292 |
+
{
|
293 |
+
if (isset($_POST['save']) && isset($_POST['data'])) {
|
294 |
+
$_POST['data'] = array_map('ltrimslashes', array_unique( $_POST['data'] ) );
|
295 |
+
$data_save = implode(',', $_POST['data'] );
|
296 |
+
$inludes = get_option(PREFIX_BACKUP_ . "plus-path");
|
297 |
+
if ($inludes !== false) {
|
298 |
+
update_option(PREFIX_BACKUP_ . "plus-path", $data_save);
|
299 |
+
} else {
|
300 |
+
add_option(PREFIX_BACKUP_ . "plus-path", $data_save);
|
301 |
+
}
|
302 |
+
}
|
303 |
+
wp_die();
|
304 |
+
}
|
305 |
+
|
306 |
+
|
307 |
+
public static function setStatus($s)
|
308 |
+
{
|
309 |
+
self::$status = $s;
|
310 |
+
}
|
311 |
+
public static function setErrors($e)
|
312 |
+
{
|
313 |
+
self::$error = $e;
|
314 |
+
}
|
315 |
+
|
316 |
+
public static function getDateInName($name)
|
317 |
+
{
|
318 |
+
$date_ = explode(self::$type . '-', $name);
|
319 |
+
if (isset($date_[1])) {
|
320 |
+
$date = explode('_', $date_[1]);
|
321 |
+
$d = "{$date[0]}-{$date[1]}-{$date[2]} {$date[3]}:" . preg_replace("/\([0-9]+\)/", '', $date[4]);
|
322 |
+
}
|
323 |
+
return $d;
|
324 |
+
|
325 |
+
}
|
326 |
+
public static function backupSend()
|
327 |
+
{
|
328 |
+
$data['status'] = self::$backup . self::$status;
|
329 |
+
$data['error'] = self::$error;
|
330 |
+
$data['pl'] = WPAdm_Core::$plugin_name;
|
331 |
+
$data['site'] = get_option('siteurl');
|
332 |
+
$data['actApi'] = 'setBackup';
|
333 |
+
self::sendToServer($data);
|
334 |
+
}
|
335 |
+
|
336 |
+
|
337 |
+
|
338 |
+
static function delete_pub_key()
|
339 |
+
{
|
340 |
+
delete_option('wpadm_pub_key');
|
341 |
+
header("Location: " . $_SERVER['HTTP_REFERER']);
|
342 |
+
}
|
343 |
+
public static function checkInstallWpadmPlugins()
|
344 |
+
{
|
345 |
+
$return = false;
|
346 |
+
$i = 1;
|
347 |
+
foreach(self::$plugins as $plugin => $version) {
|
348 |
+
if (self::check_plugin($plugin)) {
|
349 |
+
$i ++;
|
350 |
+
}
|
351 |
+
}
|
352 |
+
if ($i > 2) {
|
353 |
+
$return = true;
|
354 |
+
}
|
355 |
+
return $return;
|
356 |
+
}
|
357 |
+
|
358 |
+
static function setResponse($data)
|
359 |
+
{
|
360 |
+
$msg = errorWPADM::getMessage($data['code']);
|
361 |
+
if(isset($data['data'])) {
|
362 |
+
if (isset($data['data']['replace'])) {
|
363 |
+
foreach($data['data']['replace'] as $key => $value) {
|
364 |
+
$msg = str_replace("<$key>", $value, $msg);
|
365 |
+
}
|
366 |
+
}
|
367 |
+
}
|
368 |
+
if ($data['status'] == 'success') {
|
369 |
+
self::setMessage($msg);
|
370 |
+
} else {
|
371 |
+
self::setError($msg);
|
372 |
+
}
|
373 |
+
|
374 |
+
return isset($data['data']) ? $data['data'] : array();
|
375 |
+
|
376 |
+
}
|
377 |
+
|
378 |
+
|
379 |
+
protected static function setError($msg = "")
|
380 |
+
{
|
381 |
+
if (!empty($msg)) {
|
382 |
+
$_SESSION['errorMsgWpadm'] = isset($_SESSION['errorMsgWpadm']) ? $_SESSION['errorMsgWpadm'] . '<br />' . $msg : $msg;
|
383 |
+
}
|
384 |
+
}
|
385 |
+
protected static function getError($del = false)
|
386 |
+
{
|
387 |
+
$error = "";
|
388 |
+
if (isset($_SESSION['errorMsgWpadm'])) {
|
389 |
+
$error = $_SESSION['errorMsgWpadm'];
|
390 |
+
if($del) {
|
391 |
+
unset($_SESSION['errorMsgWpadm']);
|
392 |
+
}
|
393 |
+
}
|
394 |
+
return $error;
|
395 |
+
}
|
396 |
+
|
397 |
+
protected static function setMessage($msg)
|
398 |
+
{
|
399 |
+
if (!empty($msg)) {
|
400 |
+
$_SESSION['msgWpadm'] = isset($_SESSION['msgWpadm']) ? $_SESSION['msgWpadm'] . '<br />' . $msg : $msg;
|
401 |
+
}
|
402 |
+
}
|
403 |
+
protected static function getMessage($del = false)
|
404 |
+
{
|
405 |
+
$msg = "";
|
406 |
+
if (isset($_SESSION['msgWpadm'])) {
|
407 |
+
$msg = $_SESSION['msgWpadm'];
|
408 |
+
if($del) {
|
409 |
+
unset($_SESSION['msgWpadm']);
|
410 |
+
}
|
411 |
+
}
|
412 |
+
return $msg;
|
413 |
+
}
|
414 |
+
|
415 |
+
|
416 |
+
|
417 |
+
public static function sendToServer($postdata = array(), $stat = false)
|
418 |
+
{
|
419 |
+
if (count($postdata) > 0) {
|
420 |
+
|
421 |
+
if ($stat) {
|
422 |
+
if ($counter_id = get_option(_PREFIX_STAT . 'counter_id')) {
|
423 |
+
$postdata['counter_id'] = $counter_id;
|
424 |
+
}
|
425 |
+
}
|
426 |
+
$postdata = http_build_query($postdata, '', '&');
|
427 |
+
|
428 |
+
$length = strlen($postdata);
|
429 |
+
|
430 |
+
|
431 |
+
if (function_exists("curl_init") && function_exists("curl_setopt") && function_exists("curl_exec") && function_exists("curl_close")) {
|
432 |
+
if ($stat) {
|
433 |
+
$url = SERVER_URL_VISIT_STAT . "/Api.php";
|
434 |
+
} else {
|
435 |
+
$url = WPADM_URL_BASE . "api/";
|
436 |
+
}
|
437 |
+
$curl = curl_init($url);
|
438 |
+
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
439 |
+
curl_setopt($curl, CURLOPT_POST, true);
|
440 |
+
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
|
441 |
+
self::$result = curl_exec($curl);
|
442 |
+
curl_close($curl);
|
443 |
+
if ($stat) {
|
444 |
+
return unserialize(self::$result);
|
445 |
+
} else {
|
446 |
+
return json_decode(self::$result, true);
|
447 |
+
}
|
448 |
+
} elseif (function_exists("fsockopen")) {
|
449 |
+
if ($stat) {
|
450 |
+
$url = SERVER_URL_STAT;
|
451 |
+
$req = '/Api.php';
|
452 |
+
} else {
|
453 |
+
$url = substr(WPADM_URL_BASE, 7);
|
454 |
+
$req = '/api/';
|
455 |
+
}
|
456 |
+
$out = "POST " . $req . " HTTP/1.1\r\n";
|
457 |
+
$out.= "HOST: " . $url . "\r\n";
|
458 |
+
$out.= "Content-Type: application/x-www-form-urlencoded\r\n";
|
459 |
+
$out.= "Content-Length: ".$length."\r\n";
|
460 |
+
$out.= "Connection:Close\r\n\r\n";
|
461 |
+
$out.= $postdata."\r\n\r\n";
|
462 |
+
try {
|
463 |
+
$errno='';
|
464 |
+
$errstr = '';
|
465 |
+
$socket = @fsockopen($url, 80, $errno, $errstr, 30);
|
466 |
+
if($socket) {
|
467 |
+
if(!fwrite($socket, $out)) {
|
468 |
+
throw new Exception("unable to write fsockopen");
|
469 |
+
} else {
|
470 |
+
while ($in = @fgets ($socket, 1024)) {
|
471 |
+
self::$result .= $in;
|
472 |
+
}
|
473 |
+
}
|
474 |
+
self::$result = explode("\r\n\r\n", self::$result);
|
475 |
+
if ($stat) {
|
476 |
+
return unserialize(self::$result);
|
477 |
+
} else {
|
478 |
+
return json_decode(self::$result, true);
|
479 |
+
}
|
480 |
+
throw new Exception("error in data");
|
481 |
+
} else {
|
482 |
+
throw new Exception("unable to create socket");
|
483 |
+
}
|
484 |
+
fclose($socket);
|
485 |
+
} catch(exception $e) {
|
486 |
+
return false;
|
487 |
+
}
|
488 |
+
}
|
489 |
+
}
|
490 |
+
}
|
491 |
+
|
492 |
+
public static function activatePlugin()
|
493 |
+
{
|
494 |
+
if (isset($_POST['email']) && isset($_POST['password']) && isset($_POST['password-confirm'])) {
|
495 |
+
$email = trim(stripslashes(strip_tags($_POST['email'])));
|
496 |
+
$password = trim(strip_tags($_POST['password']));
|
497 |
+
$password_confirm = trim(strip_tags($_POST['password-confirm']));
|
498 |
+
$sent = true;
|
499 |
+
if (empty($email)) {
|
500 |
+
self::setError("Error, Email is empty.");
|
501 |
+
$sent = false;
|
502 |
+
}
|
503 |
+
if (!preg_match("/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,4}$/i", $email)) {
|
504 |
+
self::setError("Error, Incorrect Email");
|
505 |
+
$sent = false;
|
506 |
+
}
|
507 |
+
if (empty($password)) {
|
508 |
+
self::setError("Error, Password is empty.");
|
509 |
+
$sent = false;
|
510 |
+
}
|
511 |
+
if (strlen($password) < self::MIN_PASSWORD) {
|
512 |
+
self::setError("Error, the minimum number of characters for the password \"" . self::MIN_PASSWORD . "\".");
|
513 |
+
$sent = false;
|
514 |
+
}
|
515 |
+
|
516 |
+
if ($password != $password_confirm) {
|
517 |
+
self::setError("Error, passwords do not match");
|
518 |
+
$sent = false;
|
519 |
+
}
|
520 |
+
if ($sent) {
|
521 |
+
$info = self::$plugin_name;
|
522 |
+
$mail = get_option(PREFIX_BACKUP_ . "email");
|
523 |
+
if ($mail) {
|
524 |
+
add_option(PREFIX_BACKUP_ . "email", $email);
|
525 |
+
} else {
|
526 |
+
update_option(PREFIX_BACKUP_ . "email",$email);
|
527 |
+
}
|
528 |
+
$data = self::sendToServer(
|
529 |
+
array(
|
530 |
+
'actApi' => "activate",
|
531 |
+
'email' => $email,
|
532 |
+
'password' => $password,
|
533 |
+
'url' => get_option("siteurl"),
|
534 |
+
'plugin' => $info,
|
535 |
+
)
|
536 |
+
);
|
537 |
+
$res = self::setResponse($data);
|
538 |
+
}
|
539 |
+
}
|
540 |
+
if (isset($res['url']) && !empty($res['url'])) {
|
541 |
+
header("Location: " . $res['url']);
|
542 |
+
} else {
|
543 |
+
header("Location: " . admin_url("admin.php?page=wpadm_plugins"));
|
544 |
+
}
|
545 |
+
}
|
546 |
+
|
547 |
+
public static function include_admins_script()
|
548 |
+
{
|
549 |
+
wp_enqueue_style('css-admin-wpadm-db', plugins_url( "/template/css/admin-style-wpadm.css", dirname(__FILE__) ) );
|
550 |
+
|
551 |
+
wp_enqueue_script( 'js-admin-wpadm-db', plugins_url( "/template/js/admin-wpadm.js", dirname(__FILE__) ) );
|
552 |
+
wp_enqueue_script( 'postbox' );
|
553 |
+
|
554 |
+
}
|
555 |
+
protected static function read_backups($dirs_read = false)
|
556 |
+
{
|
557 |
+
$name = get_option('siteurl');
|
558 |
+
|
559 |
+
$name = str_replace("http://", '', $name);
|
560 |
+
$name = str_replace("https://", '', $name);
|
561 |
+
$name = preg_replace("|\W|", "_", $name);
|
562 |
+
$name .= '-' . self::$type . '-' . date("Y_m_d_H_i");
|
563 |
+
|
564 |
+
$dir_backup = DROPBOX_BACKUP_DIR_BACKUP ;
|
565 |
+
|
566 |
+
$backups = array('data' => array(), 'md5' => '');
|
567 |
+
|
568 |
+
$backups['data'] = self::getBackups($dir_backup, $dirs_read);
|
569 |
+
|
570 |
+
$backups['data'] = array_merge($backups['data'], self::getBackups(ABSPATH . WPADM_DIR_NAME, $dirs_read) );
|
571 |
+
$backups['data'] = array_merge($backups['data'], self::getBackups(WPADM_DIR_BACKUP, $dirs_read) );
|
572 |
+
|
573 |
+
$backups['md5'] = md5( print_r($backups['data'] , 1) );
|
574 |
+
return $backups;
|
575 |
+
}
|
576 |
+
|
577 |
+
protected static function getBackups($dir_backup, $dirs_read)
|
578 |
+
{
|
579 |
+
$backups = array();
|
580 |
+
if (is_dir($dir_backup)) {
|
581 |
+
$i = 0;
|
582 |
+
$dir_open = opendir($dir_backup);
|
583 |
+
while($d = readdir($dir_open)) {
|
584 |
+
if ($d != '.' && $d != '..' && is_dir($dir_backup . "/$d") && strpos($d, self::$type) !== false) {
|
585 |
+
$backups[$i]['dt'] = self::getDateInName($d);
|
586 |
+
$backups[$i]['name'] = "$d";
|
587 |
+
if ($dirs_read === false) {
|
588 |
+
$size = 0;
|
589 |
+
$dir_b = opendir($dir_backup . "/$d");
|
590 |
+
$count_zip = 0;
|
591 |
+
$backups[$i]['files'] = "[";
|
592 |
+
while($d_b = readdir($dir_b)) {
|
593 |
+
if ($d_b != '.' && $d_b != '..' && file_exists($dir_backup . "/$d/$d_b") && substr($d_b, -3) != "php") {
|
594 |
+
$backups[$i]['files'] .= "$d_b,";
|
595 |
+
$size += filesize($dir_backup . "/$d/$d_b");
|
596 |
+
$count_zip = $count_zip + 1;
|
597 |
+
}
|
598 |
+
}
|
599 |
+
$backups[$i]['files'] .= ']';
|
600 |
+
$backups[$i]['size'] = $size;
|
601 |
+
$backups[$i]['type'] = 'local';
|
602 |
+
$backups[$i]['count'] = $count_zip;
|
603 |
+
}
|
604 |
+
$i += 1;
|
605 |
+
}
|
606 |
+
}
|
607 |
+
}
|
608 |
+
return $backups;
|
609 |
+
}
|
610 |
+
public static function check_plugin($name = "", $version = false)
|
611 |
+
{
|
612 |
+
if (!empty($name)) {
|
613 |
+
if ( ! function_exists( 'get_plugins' ) ) {
|
614 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
615 |
+
}
|
616 |
+
$name2 = str_replace("-", "_", $name);
|
617 |
+
$plugin = get_plugins("/$name");
|
618 |
+
if (empty($plugin)) {
|
619 |
+
$plugin = get_plugins("/$name2");
|
620 |
+
}
|
621 |
+
if (count($plugin) > 0) {
|
622 |
+
if (isset(self::$plugins[$name]) && (isset($plugin["$name.php"]) || isset($plugin["$name2.php"]))) {
|
623 |
+
if ($version) {
|
624 |
+
if (self::$plugins[$name] == $plugin["$name.php"]['Version']) {
|
625 |
+
return true;
|
626 |
+
}
|
627 |
+
if (self::$plugins[$name] == $plugin["$name2.php"]['Version']) {
|
628 |
+
return true;
|
629 |
+
}
|
630 |
+
} else {
|
631 |
+
if (is_plugin_active("$name/$name.php") || is_plugin_active("$name/$name2.php") || is_plugin_active("$name2/$name2.php")) {
|
632 |
+
return true;
|
633 |
+
}
|
634 |
+
}
|
635 |
+
}
|
636 |
+
}
|
637 |
+
return false;
|
638 |
+
}
|
639 |
+
}
|
640 |
+
}
|
641 |
+
}
|
642 |
+
|
643 |
+
if (! function_exists('wpadm_plugins')) {
|
644 |
+
function wpadm_plugins()
|
645 |
+
{
|
646 |
+
global $wp_version;
|
647 |
+
|
648 |
+
$c = get_system_data();
|
649 |
+
$phpVersion = $c['php_verion'];
|
650 |
+
$maxExecutionTime = $c['maxExecutionTime'];
|
651 |
+
$maxMemoryLimit = $c['maxMemoryLimit'];
|
652 |
+
$extensions = $c['extensions'];
|
653 |
+
$disabledFunctions = $c['disabledFunctions'];
|
654 |
+
//try set new max time
|
655 |
+
|
656 |
+
$newMaxExecutionTime = $c['newMaxExecutionTime'];
|
657 |
+
$upMaxExecutionTime = $c['upMaxExecutionTime'];
|
658 |
+
$maxExecutionTime = $c['maxExecutionTime'];
|
659 |
+
|
660 |
+
//try set new memory limit
|
661 |
+
$upMemoryLimit = $c['upMemoryLimit'];
|
662 |
+
$newMemoryLimit = $c['newMemoryLimit'];
|
663 |
+
$maxMemoryLimit = $c['maxMemoryLimit'];
|
664 |
+
|
665 |
+
//try get mysql version
|
666 |
+
$mysqlVersion = $c['mysqlVersion'];
|
667 |
+
|
668 |
+
$show = !get_option('wpadm_pub_key') || (!is_super_admin() || !is_admin()) || !@get_option(_PREFIX_STAT . 'counter_id');
|
669 |
+
?>
|
670 |
+
|
671 |
+
|
672 |
+
<?php if (!$show) {?>
|
673 |
+
<div class="cfTabsContainer">
|
674 |
+
<div id="cf_signin" class="cfContentContainer" style="display: block;">
|
675 |
+
<form method="post" action="<?php echo WPADM_URL_BASE . "user/login" ; ?>" autocomplete="off" target="_blank">
|
676 |
+
<div class="inline" style="width: 52%; margin-top: 0; color: #fff;">
|
677 |
+
WPAdm Sign-In:
|
678 |
+
<input class="input-small" type="email" required="required" name="username" placeholder="Email">
|
679 |
+
<input class="input-small" type="password" required="required" name="password" placeholder="Password">
|
680 |
+
<input class="button-wpadm" type="submit" value="Sign-In" name="submit" style="margin-top:1px;">
|
681 |
+
</div>
|
682 |
+
<div class="wpadm-info-auth" style="width: 45%;">
|
683 |
+
Enter your email and password from an account at <a href="http://www.wpadm.com" target="_blank" style="color: #fff;" >www.wpadm.com</a>.<br /> After submitting user credentials you will be redirected to your Admin area on <a href="http://www.wpadm.com" style="color: #fff;" target="_blank">www.wpadm.com</a>.
|
684 |
+
</div>
|
685 |
+
</form>
|
686 |
+
</div>
|
687 |
+
</div>
|
688 |
+
<?php } else {?>
|
689 |
+
<div class="cfTabsContainer" style="display: none;">
|
690 |
+
<div id="cf_activate" class="cfContentContainer">
|
691 |
+
<form method="post" action="<?php echo admin_url( 'admin-post.php?action=wpadm_activate_plugin' )?>" >
|
692 |
+
<div class="wpadm-info-title">
|
693 |
+
Free Sign Up to use more functionality...
|
694 |
+
</div>
|
695 |
+
<div class="wpadm-registr-info">
|
696 |
+
<table class="form-table">
|
697 |
+
<tbody>
|
698 |
+
<tr valign="top">
|
699 |
+
<th scope="row">
|
700 |
+
<label for="email">E-mail</label>
|
701 |
+
</th>
|
702 |
+
<td>
|
703 |
+
<input id="email" class="regular-text" type="text" name="email" value="">
|
704 |
+
</td>
|
705 |
+
</tr>
|
706 |
+
<tr valign="top">
|
707 |
+
<th scope="row">
|
708 |
+
<label for="password">Password</label>
|
709 |
+
</th>
|
710 |
+
<td>
|
711 |
+
<input id="password" class="regular-text" type="password" name="password" value="">
|
712 |
+
</td>
|
713 |
+
</tr>
|
714 |
+
<tr valign="top">
|
715 |
+
<th scope="row">
|
716 |
+
<label for="password-confirm">Password confirm</label>
|
717 |
+
</th>
|
718 |
+
<td>
|
719 |
+
<input id="password-confirm" class="regular-text" type="password" name="password-confirm" value="">
|
720 |
+
</td>
|
721 |
+
</tr>
|
722 |
+
<tr valign="top">
|
723 |
+
<th scope="row">
|
724 |
+
</th>
|
725 |
+
<td>
|
726 |
+
<input class="button-wpadm" type="submit" value="Register & Activate" name="submit">
|
727 |
+
</td>
|
728 |
+
</tr>
|
729 |
+
</tbody>
|
730 |
+
</table>
|
731 |
+
</div>
|
732 |
+
<div class="wpadm-info">
|
733 |
+
<span style="font-weight:bold; font-size: 14px;">If you are NOT registered at WPAdm,</span> enter your email and password to use as your Account Data for authorization on WPAdm. <br /><span style="font-weight: bold;font-size: 14px;">If you already have an account at WPAdm</span> and you want to Sign-In, so please, enter your registered credential data (email and password twice).
|
734 |
+
</div>
|
735 |
+
</form>
|
736 |
+
</div>
|
737 |
+
</div>
|
738 |
+
<?php } ?>
|
739 |
+
|
740 |
+
<script>
|
741 |
+
jQuery(document).ready(function() {
|
742 |
+
jQuery('.plugins-icon').click(function() {
|
743 |
+
title = jQuery(this).parent('.plugins-title');
|
744 |
+
box = title.parent('.plugins-box');
|
745 |
+
content = box.find('.plugins-info-content');
|
746 |
+
display = content.css('display');
|
747 |
+
if (display == 'none') {
|
748 |
+
content.show('slow');
|
749 |
+
} else {
|
750 |
+
content.hide('slow');
|
751 |
+
}
|
752 |
+
})
|
753 |
+
})
|
754 |
+
function showRegistartion(show)
|
755 |
+
{
|
756 |
+
if (show) {
|
757 |
+
jQuery('.cfTabsContainer').show('slow');
|
758 |
+
} else {
|
759 |
+
jQuery('.cfTabsContainer').hide('slow');
|
760 |
+
}
|
761 |
+
}
|
762 |
+
</script>
|
763 |
+
|
764 |
+
<div class="clear" style="margin-bottom: 50px;"></div>
|
765 |
+
<table class="wp-list-table widefat fixed" >
|
766 |
+
<thead>
|
767 |
+
<tr>
|
768 |
+
<th></th>
|
769 |
+
<th>Recommended value</th>
|
770 |
+
<th>Your value</th>
|
771 |
+
<th>Status</th>
|
772 |
+
</tr>
|
773 |
+
</thead>
|
774 |
+
<tbody>
|
775 |
+
<tr>
|
776 |
+
<th scope="row">PHP Version</th>
|
777 |
+
<td><?php echo PHP_VERSION_DEFAULT ?> or greater</td>
|
778 |
+
<td><?php echo check_version($phpVersion , PHP_VERSION_DEFAULT) === false ? '<span style="color:#fb8004;font-weight:bold;">' . $phpVersion .'</span>' : $phpVersion ?></td>
|
779 |
+
<td><?php echo (check_version($phpVersion , PHP_VERSION_DEFAULT) ? '<span style="color:green;font-weight:bold;">OK</span>' : '<span style="color:#fb8004;font-weight:bold;">Please update your PHP version to get it working correctly</span>') ?></td>
|
780 |
+
</tr>
|
781 |
+
<tr>
|
782 |
+
<th scope="row">MySQL Version</th>
|
783 |
+
<td><?php echo MYSQL_VERSION_DEFAULT ?> or greater</td>
|
784 |
+
<td><?php echo check_version($mysqlVersion , MYSQL_VERSION_DEFAULT) === false ? '<span style="color:#fb8004;font-weight:bold;">' . $mysqlVersion .'</span>' : $mysqlVersion; ?></td>
|
785 |
+
<td><?php echo (check_version($mysqlVersion , MYSQL_VERSION_DEFAULT) ? '<span style="color:green;font-weight:bold;">OK</span>' : '<span style="color:#fb8004;font-weight:bold;">Please update your MySQL version to get it working correctly</span>') ?></td>
|
786 |
+
</tr>
|
787 |
+
<tr>
|
788 |
+
<th scope="row">Max Execution Time</th>
|
789 |
+
<td><?php echo $newMaxExecutionTime ?></td>
|
790 |
+
<td><?php echo ($upMaxExecutionTime == 0) ? '<span style="color:#fb8004;font-weight:bold;">' . $maxExecutionTime .'</span>' : $maxExecutionTime; ?></td>
|
791 |
+
<td><?php echo ($upMaxExecutionTime == 1) ? '<span style="color:green; font-weight:bold;">OK</span>' : '<span style="color:#fb8004;font-weight:bold;">Correct operation of the plugin can not be guaranteed.</span>'; ?></td>
|
792 |
+
</tr>
|
793 |
+
<tr>
|
794 |
+
<th scope="row">Max Memory Limit</th>
|
795 |
+
<td><?php echo $newMemoryLimit . 'M' ?></td>
|
796 |
+
<td><?php echo ($upMemoryLimit == 0) ? '<span style="color:#fb8004;font-weight:bold;">' . $maxMemoryLimit .'</span>' : $maxMemoryLimit ?></td>
|
797 |
+
<td><?php echo ($upMemoryLimit == 1) ? '<span style="color:green;font-weight:bold;">OK</span>' : '<span style="color:#fb8004;font-weight:bold;">Correct operation of the plugin can not be guaranteed.</span>'; ?></td>
|
798 |
+
</tr>
|
799 |
+
<tr>
|
800 |
+
<th scope="row">PHP Extensions</th>
|
801 |
+
<?php $ex = $c['ex']; ?>
|
802 |
+
<td><?php echo ( $ex ) === false ? 'All present' : '<span style="color:#ffba00;font-weight:bold;">' . implode(", ", $ex) . '</span>'; ?></td>
|
803 |
+
<td><?php echo ( $ex ) === false ? 'Found' : '<span style="color:#ffba00;font-weight:bold;">Not Found</span>'; ?></td>
|
804 |
+
<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>
|
805 |
+
</tr>
|
806 |
+
<tr>
|
807 |
+
<th scope="row">Disabled Functions</th>
|
808 |
+
<td colspan="3" align="left"><?php echo ( $func = $c['func']) === false ? '<span style="color:green;font-weight:bold;">All necessary functions are enabled</span>' : '<span style="color:#fb8004;font-weight:bold;">Please enable these functions to get plugin working correctly: ' . implode(", ", $func) . '</span>'; ?></td>
|
809 |
+
</tr>
|
810 |
+
<tr>
|
811 |
+
<th scope="row">Plugin Access</th>
|
812 |
+
<td colspan="3" align="left"><?php echo ( ( is_admin() && is_super_admin() ) ? "<span style=\"color:green; font-weight:bold;\">Granted</span>" : "<span style=\"color:red; font-weight:bold;\">To administrate this Plugin(s) is an 'Admin' right required.</span>")?></td>
|
813 |
+
</tr>
|
814 |
+
</tbody>
|
815 |
+
</table>
|
816 |
+
<?php
|
817 |
+
}
|
818 |
+
}
|
819 |
+
|
820 |
+
if (! function_exists('check_function')) {
|
821 |
+
function check_function($func, $search, $type = false)
|
822 |
+
{
|
823 |
+
if (is_string($func)) {
|
824 |
+
$func = explode(", ", $func);
|
825 |
+
}
|
826 |
+
if (is_string($search)) {
|
827 |
+
$search = explode(", ", $search);
|
828 |
+
}
|
829 |
+
$res = false;
|
830 |
+
$n = count($search);
|
831 |
+
for($i = 0; $i < $n; $i++) {
|
832 |
+
if (in_array($search[$i], $func) === $type) {
|
833 |
+
$res[] = $search[$i];
|
834 |
+
}
|
835 |
+
}
|
836 |
+
return $res;
|
837 |
+
}
|
838 |
+
}
|
839 |
+
|
840 |
+
if (! function_exists('check_version')) {
|
841 |
+
function check_version($ver, $ver2)
|
842 |
+
{
|
843 |
+
return version_compare($ver, $ver2, ">");
|
844 |
+
}
|
845 |
+
}
|
846 |
+
if (!function_exists('ltrimslashes')) {
|
847 |
+
function ltrimslashes($var)
|
848 |
+
{
|
849 |
+
return ltrim($var, '/');
|
850 |
+
}
|
851 |
+
}
|
852 |
+
if (!function_exists("get_system_data")) {
|
853 |
+
function get_system_data()
|
854 |
+
{
|
855 |
+
|
856 |
+
global $wp_version;
|
857 |
+
|
858 |
+
$phpVersion = phpversion();
|
859 |
+
$maxExecutionTime = ini_get('max_execution_time');
|
860 |
+
$maxMemoryLimit = ini_get('memory_limit');
|
861 |
+
$extensions = implode(', ', get_loaded_extensions());
|
862 |
+
$disabledFunctions = ini_get('disable_functions');
|
863 |
+
$mysqlVersion = '';
|
864 |
+
if (! class_exists('wpdb')) {
|
865 |
+
require_once ABSPATH . '/' . WPINC . '/wp-db.php';
|
866 |
+
}
|
867 |
+
$mysqli = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );
|
868 |
+
$errors = $mysqli->last_error;
|
869 |
+
if (empty($errors)) {
|
870 |
+
$mysqlVersion = $mysqli->db_version();
|
871 |
+
}
|
872 |
+
$upMaxExecutionTime = 0;
|
873 |
+
$newMaxExecutionTime = intval($maxExecutionTime) + 60;
|
874 |
+
@set_time_limit( $newMaxExecutionTime );
|
875 |
+
if( ini_get('max_execution_time') == $newMaxExecutionTime ){
|
876 |
+
$upMaxExecutionTime = 1;
|
877 |
+
$maxExecutionTime = ini_get('max_execution_time');
|
878 |
+
}
|
879 |
+
$upMemoryLimit = 0;
|
880 |
+
$newMemoryLimit = intval($maxMemoryLimit) + 60;
|
881 |
+
ini_set('memory_limit', $newMemoryLimit.'M');
|
882 |
+
if( ini_get('memory_limit') == $newMemoryLimit ){
|
883 |
+
$upMemoryLimit = 1;
|
884 |
+
$maxMemoryLimit = ini_get('memory_limit');
|
885 |
+
}
|
886 |
+
$extensions_search = array('curl', 'json', 'mysqli', 'sockets', 'zip', 'ftp');
|
887 |
+
$disabledFunctions_search = array('set_time_limit', 'curl_init', 'fsockopen', 'ftp_connect');
|
888 |
+
|
889 |
+
$ex = check_function($extensions, $extensions_search);
|
890 |
+
$func = check_function($disabledFunctions, $disabledFunctions_search, true);
|
891 |
+
|
892 |
+
return array('wp_version' => $wp_version, 'php_verion' => phpversion(),
|
893 |
+
'maxExecutionTime' => $maxExecutionTime, 'maxMemoryLimit' => $maxMemoryLimit,
|
894 |
+
'extensions' => $extensions, 'disabledFunctions' => $disabledFunctions,
|
895 |
+
'mysqlVersion' => $mysqlVersion, 'upMaxExecutionTime' => $upMaxExecutionTime,
|
896 |
+
'newMaxExecutionTime' => $newMaxExecutionTime, 'upMemoryLimit' => $upMemoryLimit,
|
897 |
+
'newMemoryLimit' => $newMaxExecutionTime, 'maxMemoryLimit' => $maxMemoryLimit,
|
898 |
+
'ex' => $ex, 'func' => $func, 'wp_lang' => get_option('WPLANG'),
|
899 |
+
);
|
900 |
+
|
901 |
+
}
|
902 |
+
}
|
903 |
+
|
904 |
+
?>
|
main/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php
|
main/wpadm-class-wp.php
ADDED
@@ -0,0 +1,744 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(@session_id() == '') {
|
3 |
+
@session_start();
|
4 |
+
}
|
5 |
+
|
6 |
+
require_once DRBBACKUP_BASE_DIR . "/libs/error.class.php";
|
7 |
+
require_once DRBBACKUP_BASE_DIR . "/libs/wpadm.server.main.class.php";
|
8 |
+
if (! class_exists("wpadm_wp_full_backup_dropbox") ) {
|
9 |
+
|
10 |
+
add_action('wp_ajax_wpadm_local_restore', array('wpadm_wp_full_backup_dropbox', 'restore_backup') );
|
11 |
+
add_action('wp_ajax_wpadm_restore_dropbox', array('wpadm_wp_full_backup_dropbox', 'wpadm_restore_dropbox') );
|
12 |
+
add_action('wp_ajax_wpadm_logs', array('wpadm_wp_full_backup_dropbox', 'getLog') );
|
13 |
+
add_action('wp_ajax_wpadm_local_backup', array('wpadm_wp_full_backup_dropbox', 'local_backup') );
|
14 |
+
add_action('wp_ajax_wpadm_dropbox_create', array('wpadm_wp_full_backup_dropbox', 'dropbox_backup_create') );
|
15 |
+
add_action('wp_ajax_set_user_mail', array('wpadm_wp_full_backup_dropbox', 'setUserMail') );
|
16 |
+
add_action('wp_ajax_stop_backup', array('wpadm_wp_full_backup_dropbox', 'stopBackup') );
|
17 |
+
add_action('wp_ajax_saveSetting', array('wpadm_wp_full_backup_dropbox', 'saveSetting') );
|
18 |
+
|
19 |
+
|
20 |
+
add_action('admin_post_wpadm_delete_backup', array('wpadm_wp_full_backup_dropbox', 'delete_backup') );
|
21 |
+
add_action('admin_post_dropboxConnect', array('wpadm_wp_full_backup_dropbox', 'dropboxConnect') );
|
22 |
+
|
23 |
+
add_action('admin_post_login-process', array('wpadm_wp_full_backup_dropbox', 'auth_user') );
|
24 |
+
|
25 |
+
add_action('admin_post_wpadm_download', array('wpadm_wp_full_backup_dropbox', 'download') );
|
26 |
+
add_action('init', array('wpadm_wp_full_backup_dropbox', 'init'), 10 );
|
27 |
+
|
28 |
+
add_action('admin_notices', array('wpadm_wp_full_backup_dropbox', 'notice'));
|
29 |
+
add_action('admin_notices', array('wpadm_wp_full_backup_dropbox', 'notice_stars'));
|
30 |
+
add_action('admin_post_hide_notice', array('wpadm_wp_full_backup_dropbox', 'hide_notice') );
|
31 |
+
add_action( 'admin_bar_menu', array('wpadm_wp_full_backup_dropbox', 'add_link_to_admin_bar') ,999 );
|
32 |
+
|
33 |
+
@set_time_limit(0);
|
34 |
+
|
35 |
+
class wpadm_wp_full_backup_dropbox extends wpadm_class {
|
36 |
+
|
37 |
+
private static $default_optimization = 1;
|
38 |
+
|
39 |
+
const MIN_PASSWORD = 6;
|
40 |
+
|
41 |
+
static function stopBackup()
|
42 |
+
{
|
43 |
+
WPAdm_Running::init_params_default();
|
44 |
+
}
|
45 |
+
|
46 |
+
static function add_link_to_admin_bar($wp_admin_bar)
|
47 |
+
{
|
48 |
+
$show = true;
|
49 |
+
$dropbox_options = get_option(PREFIX_BACKUP_ . 'dropbox-setting');
|
50 |
+
if ($dropbox_options) {
|
51 |
+
$dropbox_options = unserialize( base64_decode( $dropbox_options ) );
|
52 |
+
}
|
53 |
+
if ( ( isset($dropbox_options['is_admin']) && $dropbox_options['is_admin'] == 1 ) || !isset($dropbox_options['is_admin']) ) {
|
54 |
+
if (!is_admin() || !is_super_admin()) {
|
55 |
+
$show = false;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
if ($show) {
|
59 |
+
$wp_admin_bar->add_node( array(
|
60 |
+
'id' => 'dropbox-backup',
|
61 |
+
'title' => 'Dropbox backup',
|
62 |
+
'href' => esc_url( admin_url("admin.php?page=wpadm_wp_full_backup_dropbox") ),
|
63 |
+
'meta' => array('class' => 'dropbox-image-toolbar')
|
64 |
+
));
|
65 |
+
}
|
66 |
+
|
67 |
+
}
|
68 |
+
|
69 |
+
public static function notice_stars()
|
70 |
+
{
|
71 |
+
if ( file_exists(WPAdm_Core::getTmpDir() . "/notice-star") ) {
|
72 |
+
$star = file_get_contents(WPAdm_Core::getTmpDir() . "/notice-star");
|
73 |
+
if ($star != 0) {
|
74 |
+
$d = explode("_", $star);
|
75 |
+
$time = $hide = '';
|
76 |
+
if (isset($d[1])) {
|
77 |
+
if ($d[1] == '1d' && ( (int)$d[0] + WPADM_1DAY ) <= time() ) {
|
78 |
+
$time = langWPADM::get("1 day", false);
|
79 |
+
$hide = '1d';
|
80 |
+
} elseif ($d[1] == 'w' && ( (int)$d[0] + WPADM_1WEEK ) <= time() ) {
|
81 |
+
$time = langWPADM::get("1 week", false);
|
82 |
+
$hide = 'week';
|
83 |
+
}
|
84 |
+
}
|
85 |
+
if (!empty($time) && !empty($hide) && file_exists(DRBBACKUP_BASE_DIR . DIRECTORY_SEPARATOR . "template" . DIRECTORY_SEPARATOR . "notice5.php")) {
|
86 |
+
ob_start();
|
87 |
+
require_once DRBBACKUP_BASE_DIR . DIRECTORY_SEPARATOR . "template" . DIRECTORY_SEPARATOR . "notice5.php";
|
88 |
+
echo ob_get_clean();
|
89 |
+
}
|
90 |
+
}
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
public static function setFlagToTmp($flag = '', $data = false)
|
95 |
+
{
|
96 |
+
if ( !empty($flag) ) {
|
97 |
+
if (!class_exists('WPAdm_Core')) {
|
98 |
+
require_once DRBBACKUP_BASE_DIR . "/libs/class-wpadm-core.php" ;
|
99 |
+
WPAdm_Core::$pl_dir = DRBBACKUP_BASE_DIR;
|
100 |
+
}
|
101 |
+
file_put_contents( WPAdm_Core::getTmpDir() . "/$flag" , $data );
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
public static function auth_user()
|
106 |
+
{
|
107 |
+
if (isset($_POST['username']) && $_POST['password']) {
|
108 |
+
if(!function_exists("wp_safe_remote_post")) {
|
109 |
+
include ABSPATH . "/http.php";
|
110 |
+
}
|
111 |
+
$res = wp_safe_remote_post(SERVER_URL_INDEX, array('username' => $_POST['username'], 'password' => $_POST['password'], 'plugin' => 'dropbox-backup'));
|
112 |
+
if (!Empty($res['body'])) {
|
113 |
+
$data_res = json_decode($res['body']);
|
114 |
+
if (isset($data_res['url'])) {
|
115 |
+
header("Location: " . $data_res['url']);
|
116 |
+
exit;
|
117 |
+
}
|
118 |
+
}
|
119 |
+
}
|
120 |
+
header("Location: " . admin_url("admin.php?page=wpadm_wp_full_backup_dropbox") );
|
121 |
+
exit;
|
122 |
+
}
|
123 |
+
|
124 |
+
public static function init()
|
125 |
+
{
|
126 |
+
parent::$plugin_name = 'dropbox-backup';
|
127 |
+
require_once DRBBACKUP_BASE_DIR . '/modules/class-wpadm-core.php';
|
128 |
+
WPAdm_Core::$pl_dir = DRBBACKUP_BASE_DIR ;
|
129 |
+
}
|
130 |
+
|
131 |
+
static function include_admins_script()
|
132 |
+
{
|
133 |
+
wp_enqueue_style('css-admin-wpadm', plugins_url( "/template/css/admin-style-wpadm.css", dirname( __FILE__ )) );
|
134 |
+
wp_enqueue_script( 'js-admin-wpadm', plugins_url( "/template/js/admin-wpadm.js", dirname( __FILE__ ) ) );
|
135 |
+
wp_enqueue_script( 'postbox' );
|
136 |
+
}
|
137 |
+
|
138 |
+
public static function setUserMail()
|
139 |
+
{
|
140 |
+
if (isset($_POST['email'])) {
|
141 |
+
$email = trim($_POST['email']);
|
142 |
+
$mail = get_option(PREFIX_BACKUP_ . "email");
|
143 |
+
if ($mail) {
|
144 |
+
add_option(PREFIX_BACKUP_ . "email", $email);
|
145 |
+
} else {
|
146 |
+
update_option(PREFIX_BACKUP_ . "email",$email);
|
147 |
+
}
|
148 |
+
}
|
149 |
+
echo 'true';
|
150 |
+
wp_die();
|
151 |
+
}
|
152 |
+
public static function saveSetting()
|
153 |
+
{
|
154 |
+
if (isset($_POST['is_admin']) || isset($_POST['is_optimization'])) {
|
155 |
+
|
156 |
+
$dropbox_options = get_option(PREFIX_BACKUP_ . 'dropbox-setting');
|
157 |
+
if ($dropbox_options) {
|
158 |
+
$dropbox_options = unserialize( base64_decode( $dropbox_options ) );
|
159 |
+
}
|
160 |
+
if (isset($_POST['is_admin'])) {
|
161 |
+
$dropbox_options['is_admin'] = (int) $_POST['is_admin'];
|
162 |
+
}
|
163 |
+
if (isset($_POST['is_optimization'])) {
|
164 |
+
$dropbox_options['is_optimization'] = (int) $_POST['is_optimization'];
|
165 |
+
}
|
166 |
+
update_option(PREFIX_BACKUP_ . 'dropbox-setting', base64_encode( serialize( $dropbox_options ) ) );
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
public static function getSettings()
|
171 |
+
{
|
172 |
+
$dropbox_options = get_option(PREFIX_BACKUP_ . 'dropbox-setting');
|
173 |
+
if ($dropbox_options) {
|
174 |
+
$dropbox_options = unserialize( base64_decode( $dropbox_options ) );
|
175 |
+
} else {
|
176 |
+
$dropbox_options = array();
|
177 |
+
}
|
178 |
+
return $dropbox_options;
|
179 |
+
}
|
180 |
+
|
181 |
+
public static function local_backup()
|
182 |
+
{
|
183 |
+
require_once DRBBACKUP_BASE_DIR . "/modules/class-wpadm-core.php";
|
184 |
+
@session_write_close();
|
185 |
+
parent::$type = 'full';
|
186 |
+
if (file_exists(WPAdm_Core::getTmpDir() . "/logs2")) {
|
187 |
+
@unlink(WPAdm_Core::getTmpDir() . "/logs2");
|
188 |
+
}
|
189 |
+
if (file_exists(WPAdm_Core::getTmpDir() . "/log.log")) {
|
190 |
+
file_put_contents(WPAdm_Core::getTmpDir() . "/log.log", '');
|
191 |
+
}
|
192 |
+
WPAdm_Core::mkdir(DROPBOX_BACKUP_DIR_BACKUP);
|
193 |
+
WPAdm_Running::init_params_default();
|
194 |
+
if ( WPAdm_Core::dir_writeble(DROPBOX_BACKUP_DIR_BACKUP)) {
|
195 |
+
WPAdm_Running::delCommandResultData("local_backup");
|
196 |
+
$dropbox_options = self::getSettings();
|
197 |
+
$optimization = (isset($dropbox_options['is_optimization']) && $dropbox_options['is_optimization'] == 1) || (!isset($dropbox_options['is_optimization'])) ? 1 : 0;
|
198 |
+
$backup = new WPAdm_Core(array('method' => "local_backup", 'params' => array('optimize' => $optimization, 'limit' => 0, 'time' => @$_POST['time'], 'types' => array('db', 'files') )), 'full_backup_dropbox', WPAdm_Core::$pl_dir);
|
199 |
+
if (WPAdm_Core::$cron === false) {
|
200 |
+
$res = $backup->getResult()->toArray();
|
201 |
+
$res['md5_data'] = md5( print_r($res, 1) );
|
202 |
+
$res['name'] = $backup->name;
|
203 |
+
$res['time'] = $backup->time;
|
204 |
+
$res['type'] = 'local';
|
205 |
+
$res['counts'] = count($res['data']);
|
206 |
+
} else {
|
207 |
+
$res['result'] = 'work';
|
208 |
+
$res['error'] = '';
|
209 |
+
$res['data'] = array();
|
210 |
+
$res['size'] = 0;
|
211 |
+
}
|
212 |
+
} else {
|
213 |
+
$res['result'] = 'error';
|
214 |
+
$res['error'] = langWPADM::get('Website "%domain" returned an error during file creation: Failed to create file, please check the permissions on the folder "%dir-backup".', false, array('%domain', '%dir-backup'), array(SITE_HOME, DROPBOX_BACKUP_DIR_BACKUP) );
|
215 |
+
$res['data'] = array();
|
216 |
+
$res['size'] = 0;
|
217 |
+
}
|
218 |
+
|
219 |
+
@session_start();
|
220 |
+
echo json_encode($res);
|
221 |
+
wp_die();
|
222 |
+
|
223 |
+
}
|
224 |
+
public static function getLog()
|
225 |
+
{
|
226 |
+
@session_write_close();
|
227 |
+
@session_start();
|
228 |
+
require_once DRBBACKUP_BASE_DIR . "/modules/class-wpadm-core.php";
|
229 |
+
$backup = new WPAdm_Core(array('method' => "local"), 'full_backup_dropbox', WPAdm_Core::$pl_dir);
|
230 |
+
$log = WPAdm_Core::getLog();
|
231 |
+
$log2 = WPAdm_Core::getTmpDir() . "/logs2";
|
232 |
+
if (file_exists($log2)) {
|
233 |
+
$text = @file_get_contents($log2);
|
234 |
+
file_put_contents($log2, $log);
|
235 |
+
$log = str_replace($text, "", $log);
|
236 |
+
} else {
|
237 |
+
file_put_contents($log2, $log);
|
238 |
+
}
|
239 |
+
$log = explode("\n", $log);
|
240 |
+
krsort($log);
|
241 |
+
$log_array = array('log' => $log );
|
242 |
+
$data_result = WPAdm_Running::getCommandResultData($_POST['type-backup']);
|
243 |
+
if (!empty($data_result)) {
|
244 |
+
$log_array['data'] = $data_result;
|
245 |
+
}
|
246 |
+
echo json_encode( $log_array );
|
247 |
+
exit;
|
248 |
+
}
|
249 |
+
public static function restore_backup()
|
250 |
+
{
|
251 |
+
require_once DRBBACKUP_BASE_DIR . "/modules/class-wpadm-core.php";
|
252 |
+
@session_write_close();
|
253 |
+
parent::$type = 'full';
|
254 |
+
if (file_exists(WPAdm_Core::getTmpDir() . "/logs2")) {
|
255 |
+
@unlink(WPAdm_Core::getTmpDir() . "/logs2");
|
256 |
+
}
|
257 |
+
$name_backup = isset($_POST['name']) ? trim($_POST['name']) : "";
|
258 |
+
$backup = new WPAdm_Core(array('method' => "local_restore", 'params' => array('types' => array('files', 'db'), 'name_backup' => $name_backup )), 'full_backup_dropbox', WPAdm_Core::$pl_dir);
|
259 |
+
$res = $backup->getResult()->toArray();
|
260 |
+
@session_start();
|
261 |
+
echo json_encode($res);
|
262 |
+
wp_die();
|
263 |
+
}
|
264 |
+
public static function wpadm_restore_dropbox()
|
265 |
+
{
|
266 |
+
require_once DRBBACKUP_BASE_DIR . "/modules/class-wpadm-core.php";
|
267 |
+
@session_write_close();
|
268 |
+
$log_class = new WPAdm_Core(array('method' => "local"), 'full_backup_dropbox', WPAdm_Core::$pl_dir);
|
269 |
+
if (file_exists(WPAdm_Core::getTmpDir() . "/logs2")) {
|
270 |
+
@unlink(WPAdm_Core::getTmpDir() . "/logs2");
|
271 |
+
}
|
272 |
+
if (file_exists(WPAdm_Core::getTmpDir() . "/log.log")) {
|
273 |
+
@unlink(WPAdm_Core::getTmpDir() . "/log.log");
|
274 |
+
}
|
275 |
+
WPAdm_Core::log( langWPADM::get('Start Restore from Dropbox cloud' , false) );
|
276 |
+
$dropbox_options = get_option(PREFIX_BACKUP_ . 'dropbox-setting');
|
277 |
+
if ($dropbox_options) {
|
278 |
+
require_once DRBBACKUP_BASE_DIR. "/modules/dropbox.class.php";
|
279 |
+
$dropbox_options = unserialize( base64_decode( $dropbox_options ) );
|
280 |
+
$folder_project = self::getNameProject();
|
281 |
+
$dropbox = new dropbox($dropbox_options['app_key'], $dropbox_options['app_secret'], $dropbox_options['auth_token_secret']);
|
282 |
+
if ($dropbox->isAuth()) {
|
283 |
+
WPAdm_Core::mkdir(DROPBOX_BACKUP_DIR_BACKUP);
|
284 |
+
$name_backup = isset($_POST['name']) ? trim($_POST['name']) : "";
|
285 |
+
$dir_backup = DROPBOX_BACKUP_DIR_BACKUP . "/$name_backup";
|
286 |
+
$error = WPAdm_Core::mkdir($dir_backup);
|
287 |
+
if (!empty($error)) {
|
288 |
+
WPAdm_Core::log($error);
|
289 |
+
$res['result'] = WPAdm_Result::WPADM_RESULT_ERROR;
|
290 |
+
$res['error'] = $error;
|
291 |
+
$res['data'] = array();
|
292 |
+
$res['size'] = 0;
|
293 |
+
|
294 |
+
} else {
|
295 |
+
$files = $dropbox->listing("$folder_project/$name_backup");
|
296 |
+
if (isset($files['items'])) {
|
297 |
+
$n = count($files['items']);
|
298 |
+
for($i = 0; $i < $n; $i++) {
|
299 |
+
$res = $dropbox->downloadFile("$folder_project/$name_backup/{$files['items'][$i]['name']}", "$dir_backup/{$files['items'][$i]['name']}");
|
300 |
+
if ($res != "$dir_backup/{$files['items'][$i]['name']}" && isset($res['text'])) {
|
301 |
+
WPAdm_Core::log(langWPADM::get('Error: ' , false) . $res['text'] );
|
302 |
+
} else {
|
303 |
+
$log = str_replace('%s', $files['items'][$i]['name'], langWPADM::get('Download file (%s) with Dropbox' , false) );
|
304 |
+
WPAdm_Core::log($log);
|
305 |
+
}
|
306 |
+
}
|
307 |
+
parent::$type = 'full';
|
308 |
+
$backup = new WPAdm_Core(array('method' => "local_restore", 'params' => array('types' => array('files', 'db'), 'name_backup' => $name_backup )), 'full_backup_dropbox', WPAdm_Core::$pl_dir);
|
309 |
+
$res = $backup->getResult()->toArray();
|
310 |
+
WPAdm_Core::rmdir($dir_backup);
|
311 |
+
}
|
312 |
+
}
|
313 |
+
} else {
|
314 |
+
WPAdm_Core::log( langWPADM::get('Website "%d" can\'t authorize on Dropbox with using of "app key: %k" and "app secret: %s"' , false,
|
315 |
+
array('%d', '%k', '%s'),
|
316 |
+
array( SITE_HOME, $dropbox_options['app_key'], $dropbox_options['app_secret'] ) ) );
|
317 |
+
}
|
318 |
+
} else {
|
319 |
+
WPAdm_Core::log( langWPADM::get('Website "%d" returned an error during connection to Dropbox: "app key" and "app secret" wasn\'t found. Please, check your Dropbox settings.' , false, '%d', SITE_HOME) );
|
320 |
+
}
|
321 |
+
@session_start();
|
322 |
+
echo json_encode($res);
|
323 |
+
wp_die();
|
324 |
+
}
|
325 |
+
public static function download()
|
326 |
+
{
|
327 |
+
if (isset($_REQUEST['backup'])) {
|
328 |
+
require_once DRBBACKUP_BASE_DIR . "/class-wpadm-core.php";
|
329 |
+
require_once DRBBACKUP_BASE_DIR . '/modules/pclzip.lib.php';
|
330 |
+
$backup = new WPAdm_Core(array('method' => "local"), 'full_backup_dropbox', WPAdm_Core::$pl_dir);
|
331 |
+
$filename = $_REQUEST['backup'] . ".zip";
|
332 |
+
$file = WPAdm_Core::getTmpDir() . "/" . $filename;
|
333 |
+
if (file_exists($file)) {
|
334 |
+
@unlink($file);
|
335 |
+
}
|
336 |
+
$archive = new PclZip($file);
|
337 |
+
$dir_backup = DROPBOX_BACKUP_DIR_BACKUP . '/' . $_REQUEST['backup'];
|
338 |
+
|
339 |
+
$backups = array('data' => array(), 'md5' => '');
|
340 |
+
if (is_dir($dir_backup)) {
|
341 |
+
$i = 0;
|
342 |
+
$dir_open = opendir($dir_backup);
|
343 |
+
while($d = readdir($dir_open)) {
|
344 |
+
if ($d != '.' && $d != '..' && file_exists($dir_backup . "/$d") && substr($d, -3) != "php") {
|
345 |
+
$archive->add($dir_backup . "/$d", PCLZIP_OPT_REMOVE_PATH, DROPBOX_BACKUP_DIR_BACKUP );
|
346 |
+
}
|
347 |
+
}
|
348 |
+
}
|
349 |
+
|
350 |
+
|
351 |
+
$now = gmdate("D, d M Y H:i:s");
|
352 |
+
header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
|
353 |
+
header("Cache-Control: max-age=0, no-cache, must-revalidate, proxy-revalidate");
|
354 |
+
header("Last-Modified: {$now} GMT");
|
355 |
+
|
356 |
+
// force download
|
357 |
+
header("Content-Type: application/force-download");
|
358 |
+
header("Content-Type: application/octet-stream");
|
359 |
+
header("Content-Type: application/download");
|
360 |
+
|
361 |
+
// disposition / encoding on response body
|
362 |
+
header("Content-Disposition: attachment;filename={$filename}");
|
363 |
+
header("Content-Transfer-Encoding: binary");
|
364 |
+
|
365 |
+
ob_start();
|
366 |
+
$df = fopen("php://output", 'w');
|
367 |
+
echo file_get_contents($file);
|
368 |
+
fclose($df);
|
369 |
+
echo ob_get_clean();
|
370 |
+
@unlink($file);
|
371 |
+
exit;
|
372 |
+
}
|
373 |
+
}
|
374 |
+
|
375 |
+
public static function delete_backup()
|
376 |
+
{
|
377 |
+
if (isset($_POST['backup-type']) ) {
|
378 |
+
if ($_POST['backup-type'] == 'local') {
|
379 |
+
require_once DRBBACKUP_BASE_DIR . "/modules/class-wpadm-core.php";
|
380 |
+
$dir = DROPBOX_BACKUP_DIR_BACKUP . '/' . $_POST['backup-name'] ;
|
381 |
+
$delete = false;
|
382 |
+
if (is_dir($dir)) {
|
383 |
+
WPAdm_Core::rmdir($dir);
|
384 |
+
$delete = true;
|
385 |
+
}
|
386 |
+
$dir = ABSPATH . WPADM_DIR_NAME . '/' . $_POST['backup-name'] ;
|
387 |
+
if (is_dir($dir)) {
|
388 |
+
WPAdm_Core::rmdir($dir);
|
389 |
+
$delete = true;
|
390 |
+
}
|
391 |
+
$dir = WPADM_DIR_BACKUP . '/' . $_POST['backup-name'] ;
|
392 |
+
if (is_dir($dir)) {
|
393 |
+
WPAdm_Core::rmdir($dir);
|
394 |
+
$delete = true;
|
395 |
+
}
|
396 |
+
if ($delete) {
|
397 |
+
parent::setMessage( str_replace('%s', $_POST['backup-name'], langWPADM::get('Backup(%s) was deleted', false) ) );
|
398 |
+
}
|
399 |
+
} elseif ($_POST['backup-type'] == 'dropbox') {
|
400 |
+
require_once DRBBACKUP_BASE_DIR . "/modules/dropbox.class.php";
|
401 |
+
$dropbox_options = get_option(PREFIX_BACKUP_ . 'dropbox-setting');
|
402 |
+
if ($dropbox_options) {
|
403 |
+
$dropbox_options = unserialize( base64_decode( $dropbox_options ) );
|
404 |
+
$dropbox = new dropbox($dropbox_options['app_key'], $dropbox_options['app_secret'], $dropbox_options['auth_token_secret']);
|
405 |
+
$folder_project = self::getNameProject();
|
406 |
+
$res = $dropbox->deleteFile("$folder_project/{$_POST['backup-name']}");
|
407 |
+
if ($res['is_deleted'] === true) {
|
408 |
+
parent::setMessage( str_replace('%s', $_POST['backup-name'], langWPADM::get('Backup(%s) was deleted', false) ) );
|
409 |
+
}
|
410 |
+
}
|
411 |
+
}
|
412 |
+
}
|
413 |
+
header("Location: " . admin_url("admin.php?page=wpadm_wp_full_backup_dropbox"));
|
414 |
+
}
|
415 |
+
|
416 |
+
protected static function getPluginName()
|
417 |
+
{
|
418 |
+
|
419 |
+
preg_match("|wpadm_wp_(.*)|", __CLASS__, $m);
|
420 |
+
return $m[1];
|
421 |
+
}
|
422 |
+
protected static function getPathPlugin()
|
423 |
+
{
|
424 |
+
return "wpadm_full_backup_dropbox";
|
425 |
+
}
|
426 |
+
|
427 |
+
public static function dropboxConnect()
|
428 |
+
{
|
429 |
+
require_once DRBBACKUP_BASE_DIR . "/modules/dropbox.class.php";
|
430 |
+
if (isset($_GET['app_key']) && isset($_GET['app_secret'])) {
|
431 |
+
if (empty($_GET['app_key']) && empty($_GET['app_secret'])) {
|
432 |
+
$_GET['app_key'] = WPADM_APP_KEY;
|
433 |
+
$_GET['app_secret'] = WPADM_APP_SECRET;
|
434 |
+
}
|
435 |
+
$dropbox = new dropbox($_GET['app_key'], $_GET['app_secret']);
|
436 |
+
$_SESSION['dropbox_key'] = $_GET['app_key'];
|
437 |
+
$_SESSION['dropbox_secret'] = $_GET['app_secret'];
|
438 |
+
$_SESSION['dropbox_request_token'] = $dropbox->getRequestToken();
|
439 |
+
echo '<script>window.location.href="' . $dropbox->generateAuthUrl( admin_url('admin-post.php?action=dropboxConnect') ) . '";</script>';
|
440 |
+
} elseif (isset($_GET['oauth_token']) && isset($_GET['uid'])) {
|
441 |
+
$dropbox_options = get_option(PREFIX_BACKUP_ . 'dropbox-setting');
|
442 |
+
if ($dropbox_options) {
|
443 |
+
$dropbox_options = unserialize( base64_decode( $dropbox_options ) );
|
444 |
+
} else {
|
445 |
+
$dropbox_options = array();
|
446 |
+
add_option(PREFIX_BACKUP_ . 'dropbox-setting', base64_encode(serialize( $dropbox_options ) ) );
|
447 |
+
}
|
448 |
+
$dropbox = new dropbox(@$_SESSION['dropbox_key'], @$_SESSION['dropbox_secret']);
|
449 |
+
$access_token = $dropbox->getAccessToken($_SESSION['dropbox_request_token']);
|
450 |
+
$dropbox_options['app_key'] = @$_SESSION['dropbox_key'] ;
|
451 |
+
$dropbox_options['app_secret'] = @$_SESSION['dropbox_secret'] ;
|
452 |
+
$dropbox_options['auth_token_secret'] = $access_token;
|
453 |
+
$dropbox_options['oauth_token'] = @$_GET['oauth_token'] ;
|
454 |
+
$dropbox_options['uid'] = @$_GET['uid'] ;
|
455 |
+
update_option(PREFIX_BACKUP_ . 'dropbox-setting', base64_encode( serialize( $dropbox_options ) ) );
|
456 |
+
echo '<script>
|
457 |
+
if(window.opener){
|
458 |
+
window.opener.connectDropbox(null, null, "'.htmlspecialchars($access_token['oauth_token_secret']).'", "'.htmlspecialchars($access_token['oauth_token']).'", "'.htmlspecialchars($access_token['uid']).'");window.close();
|
459 |
+
}else{
|
460 |
+
window.location.href="' . admin_url("admin.php?page=wpadm_wp_full_backup_dropbox") . '";
|
461 |
+
}
|
462 |
+
</script>';
|
463 |
+
echo '<script>window.close();</script>';exit;
|
464 |
+
} elseif (isset($_GET['not_approved'])) {
|
465 |
+
if( $_GET['not_approved'] == 'true' ){
|
466 |
+
echo '<script>window.close();</script>';exit;
|
467 |
+
}
|
468 |
+
} else {
|
469 |
+
WPAdm_Core::log( langWPADM::get('Website "%d" returned an error during connection to Dropbox: "app key" and "app secret" wasn\'t found. Please, check your Dropbox settings.' , true, '%d', SITE_HOME) );
|
470 |
+
}
|
471 |
+
exit;
|
472 |
+
}
|
473 |
+
|
474 |
+
public static function dropbox_backup_create()
|
475 |
+
{
|
476 |
+
require_once DRBBACKUP_BASE_DIR . "/modules/class-wpadm-core.php";
|
477 |
+
@session_write_close();
|
478 |
+
|
479 |
+
$log = new WPAdm_Core(array('method' => "local"), 'full_backup_dropbox', WPAdm_Core::$pl_dir);
|
480 |
+
if (file_exists(WPAdm_Core::getTmpDir() . "/logs2")) {
|
481 |
+
@unlink(WPAdm_Core::getTmpDir() . "/logs2");
|
482 |
+
}
|
483 |
+
if (file_exists(WPAdm_Core::getTmpDir() . "/log.log")) {
|
484 |
+
file_put_contents(WPAdm_Core::getTmpDir() . "/log.log", '');
|
485 |
+
}
|
486 |
+
if ( WPAdm_Core::dir_writeble(DROPBOX_BACKUP_DIR_BACKUP) && !file_exists(WPAdm_Core::getTmpDir() . "/create-backup") ) {
|
487 |
+
file_put_contents(WPAdm_Core::getTmpDir() . "/create-backup", 1);
|
488 |
+
$dropbox_options = get_option(PREFIX_BACKUP_ . 'dropbox-setting');
|
489 |
+
$send_to_dropbox = true;
|
490 |
+
if ($dropbox_options) {
|
491 |
+
$dropbox_options = unserialize( base64_decode( $dropbox_options ) );
|
492 |
+
if (!isset($dropbox_options['app_key'])) {
|
493 |
+
WPAdm_Core::log( langWPADM::get('Website "%d" returned an error during connection to Dropbox: "App Key" wasn\'t found. Please, check your Dropbox settings.' , false, '%d', SITE_HOME) );
|
494 |
+
$send_to_dropbox = false;
|
495 |
+
}
|
496 |
+
if (!isset($dropbox_options['app_secret'])) {
|
497 |
+
WPAdm_Core::log( langWPADM::get('Website "%d" returned an error during connection to Dropbox: "App Secret" wasn\'t found. Please, check your Dropbox settings.' , false, '%d', SITE_HOME) );
|
498 |
+
$send_to_dropbox = false;
|
499 |
+
}
|
500 |
+
if (!isset($dropbox_options['oauth_token'])) {
|
501 |
+
WPAdm_Core::log( langWPADM::get('Website "%d" returned an error during file sending to Dropbox: "Auth Token not exist. Files cannot be sent to Dropbox cloud. Please, check your Dropbox settings."' , false, '%d', SITE_HOME) );
|
502 |
+
$send_to_dropbox = false;
|
503 |
+
}
|
504 |
+
} else {
|
505 |
+
WPAdm_Core::log( langWPADM::get('Website "%d" returned an error during connection to Dropbox: "app key" and "app secret" wasn\'t found. Please, check your Dropbox settings.' , false, '%d', SITE_HOME) );
|
506 |
+
$res['type'] = 'local';
|
507 |
+
$send_to_dropbox = false;
|
508 |
+
}
|
509 |
+
|
510 |
+
if ($send_to_dropbox) {
|
511 |
+
parent::$type = 'full';
|
512 |
+
WPAdm_Running::init_params_default();
|
513 |
+
WPAdm_Running::delCommandResultData("local_backup");
|
514 |
+
$dropbox_options = self::getSettings();
|
515 |
+
$optimization = (isset($dropbox_options['is_optimization']) && $dropbox_options['is_optimization'] == 1) || (!isset($dropbox_options['is_optimization'])) ? 1 : 0;
|
516 |
+
$backup_local = new WPAdm_Core(array('method' => "local_backup", 'params' => array('optimize' => $optimization, 'limit' => 0, 'time' => @$_POST['time'], 'types' => array('db', 'files') )), 'full_backup_dropbox', WPAdm_Core::$pl_dir);
|
517 |
+
$res = array();
|
518 |
+
if (WPAdm_Core::$cron === false) {
|
519 |
+
$res = $backup->getResult()->toArray();
|
520 |
+
$res['md5_data'] = md5( print_r($res, 1) );
|
521 |
+
$res['name'] = $backup->name;
|
522 |
+
$res['time'] = $backup->time;
|
523 |
+
$res['type'] = 'dropbox';
|
524 |
+
$res['counts'] = count($res['data']);
|
525 |
+
}
|
526 |
+
unset($backup_local);
|
527 |
+
$folder_project = self::getNameProject();
|
528 |
+
WPAdm_Running::delCommandResultData("send-to-dropbox");
|
529 |
+
$backup = new WPAdm_Core(array('method' => "send-to-dropbox",
|
530 |
+
'params' => array('files' => isset($res['data']) ? $res['data'] : '',
|
531 |
+
'local' => true,
|
532 |
+
'access_details' => array('key' => $dropbox_options['app_key'],
|
533 |
+
'secret' => $dropbox_options['app_secret'],
|
534 |
+
'token' => $dropbox_options['auth_token_secret'],
|
535 |
+
'dir' => isset($res['name']) ? $res['name'] : '',
|
536 |
+
'folder' => $folder_project),
|
537 |
+
)
|
538 |
+
),
|
539 |
+
'full_backup_dropbox', WPAdm_Core::$pl_dir) ;
|
540 |
+
if (WPAdm_Core::$cron === false) {
|
541 |
+
$result_send = $backup->getResult()->toArray();
|
542 |
+
if ($result_send['result'] == 'error') {
|
543 |
+
$res = array();
|
544 |
+
$res['error'] = $result_send['error'];
|
545 |
+
$res['result'] = 'error';
|
546 |
+
@rename(WPAdm_Core::getTmpDir() . "/logs2", WPAdm_Core::getTmpDir() . "/logs_error_" . $backup_local->time);
|
547 |
+
}
|
548 |
+
WPAdm_Core::rmdir( DROPBOX_BACKUP_DIR_BACKUP . "/{$res['name']}");
|
549 |
+
} else {
|
550 |
+
$res['result'] = 'work';
|
551 |
+
$res['error'] = '';
|
552 |
+
$res['data'] = array();
|
553 |
+
$res['size'] = 0;
|
554 |
+
}
|
555 |
+
if (file_exists(WPAdm_Core::getTmpDir() . "/create-backup")) {
|
556 |
+
@unlink( WPAdm_Core::getTmpDir() . "/create-backup" );
|
557 |
+
}
|
558 |
+
}
|
559 |
+
} else {
|
560 |
+
$res['result'] = 'error';
|
561 |
+
$res['error'] = langWPADM::get('Website "%domain" returned an error during file creation: Failed to create file, please check the permissions on the folder "%dir-backup".', false, array('%domain', '%dir-backup'), array(SITE_HOME, DROPBOX_BACKUP_DIR_BACKUP) );
|
562 |
+
$res['data'] = array();
|
563 |
+
$res['size'] = 0;
|
564 |
+
}
|
565 |
+
@session_start();
|
566 |
+
echo json_encode($res);
|
567 |
+
wp_die();
|
568 |
+
}
|
569 |
+
public static function getNameProject()
|
570 |
+
{
|
571 |
+
$folder_project = str_ireplace( array("http://", "https://"), '', home_url() );
|
572 |
+
$folder_project = str_ireplace( array( "-", '/', '.'), '_', $folder_project );
|
573 |
+
return $folder_project;
|
574 |
+
}
|
575 |
+
|
576 |
+
|
577 |
+
public static function wpadm_show_backup()
|
578 |
+
{
|
579 |
+
|
580 |
+
require_once DRBBACKUP_BASE_DIR. "/modules/dropbox.class.php";
|
581 |
+
parent::$type = 'full';
|
582 |
+
$dropbox_options = get_option(PREFIX_BACKUP_ . 'dropbox-setting');
|
583 |
+
if ($dropbox_options) {
|
584 |
+
$dropbox_options = unserialize( base64_decode( $dropbox_options ) );
|
585 |
+
if (isset($dropbox_options['app_key']) && isset($dropbox_options['app_secret']) && isset($dropbox_options['auth_token_secret'])) {
|
586 |
+
$dropbox = new dropbox($dropbox_options['app_key'], $dropbox_options['app_secret'], $dropbox_options['auth_token_secret']);
|
587 |
+
$folder_project = self::getNameProject();
|
588 |
+
$backups = $dropbox->listing($folder_project);
|
589 |
+
$n = count($backups['items']);
|
590 |
+
$data['data'] = array();
|
591 |
+
for($i = 0; $i < $n; $i++) {
|
592 |
+
$backup = $dropbox->listing($folder_project . "/" . $backups['items'][$i]['name']);
|
593 |
+
$data['data'][$i]['name'] = $backups['items'][$i]['name'];
|
594 |
+
$data['data'][$i]['size'] = (float)$backup['size'] * 1024 * 1024;
|
595 |
+
$data['data'][$i]['dt'] = parent::getDateInName($backups['items'][$i]['name']);
|
596 |
+
$data['data'][$i]['count'] = count($backup['items']);
|
597 |
+
$data['data'][$i]['type'] = 'dropbox';
|
598 |
+
$k = $data['data'][$i]['count'];
|
599 |
+
$data['data'][$i]['files'] = '[';
|
600 |
+
for($j = 0; $j < $k; $j++) {
|
601 |
+
$data['data'][$i]['files'] .= $backup['items'][$j]['name'] . ',';
|
602 |
+
}
|
603 |
+
}
|
604 |
+
}
|
605 |
+
}
|
606 |
+
if (isset($_GET['pay']) && $_GET['pay'] == 'success') {
|
607 |
+
if (!file_exists(WPAdm_Core::getTmpDir() . "/pay_success")) {
|
608 |
+
file_put_contents(WPAdm_Core::getTmpDir() . "/pay_success", 1);
|
609 |
+
parent::setMessage( langWPADM::get('', false) );
|
610 |
+
}
|
611 |
+
}
|
612 |
+
if (isset($_GET['pay']) && $_GET['pay'] == 'cancel') {
|
613 |
+
parent::setError( langWPADM::get('Checkout was canceled', false) );
|
614 |
+
}
|
615 |
+
$data_local = parent::read_backups();
|
616 |
+
if (isset($data['data'])) {
|
617 |
+
$data['data'] = array_merge($data_local['data'], $data['data']);
|
618 |
+
$data['md5'] = md5( print_r( $data['data'] , 1 ) );
|
619 |
+
} else {
|
620 |
+
$data = $data_local;
|
621 |
+
}
|
622 |
+
if (file_exists(WPAdm_Core::getTmpDir() . "/pay_success")) {
|
623 |
+
$plugin_info = get_plugins("/" . parent::$plugin_name);
|
624 |
+
$plugin_version = (isset($plugin_info[parent::$plugin_name . '.php']['Version']) ? $plugin_info[parent::$plugin_name . '.php']['Version'] : '');
|
625 |
+
$data_server = parent::sendToServer(
|
626 |
+
array(
|
627 |
+
'actApi' => "proBackupCheck",
|
628 |
+
'site' => home_url(),
|
629 |
+
'email' => get_option('admin_email'),
|
630 |
+
'plugin' => parent::$plugin_name,
|
631 |
+
'key' => '',
|
632 |
+
'plugin_version' => $plugin_version
|
633 |
+
)
|
634 |
+
);
|
635 |
+
if (isset($data_server['status']) && $data_server['status'] == 'success' && isset($data_server['key'])) {
|
636 |
+
update_option(PREFIX_BACKUP_ . 'pro-key', $data_server['key']);
|
637 |
+
if (isset($data_server['url']) && !empty($data_server['url'])) {
|
638 |
+
parent::setMessage( str_replace('&s', $data_server['url'], langWPADM::get('The "Dropbox backup & restore RRO" version can be downloaded here <a href="&s">download</a>', false) ) );
|
639 |
+
}
|
640 |
+
}
|
641 |
+
}
|
642 |
+
if ( ! function_exists( 'get_plugins' ) ) {
|
643 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
644 |
+
}
|
645 |
+
$plugin_data = array_values( get_plugins('/dropbox-backup') );
|
646 |
+
$show = !get_option('wpadm_pub_key') && is_super_admin();
|
647 |
+
$error = parent::getError(true);
|
648 |
+
$msg = parent::getMessage(true);
|
649 |
+
$base_path = DRBBACKUP_BASE_DIR ;
|
650 |
+
ob_start();
|
651 |
+
require_once $base_path . DIRECTORY_SEPARATOR . "template" . DIRECTORY_SEPARATOR . "wpadm_show_backup.php";
|
652 |
+
echo ob_get_clean();
|
653 |
+
}
|
654 |
+
|
655 |
+
|
656 |
+
public static function draw_menu()
|
657 |
+
{
|
658 |
+
$show = true;
|
659 |
+
$dropbox_options = get_option(PREFIX_BACKUP_ . 'dropbox-setting');
|
660 |
+
if ($dropbox_options) {
|
661 |
+
$dropbox_options = unserialize( base64_decode( $dropbox_options ) );
|
662 |
+
}
|
663 |
+
if ( ( isset($dropbox_options['is_admin']) && $dropbox_options['is_admin'] == 1 ) || !isset($dropbox_options['is_admin']) ) {
|
664 |
+
if (!is_admin() || !is_super_admin()) {
|
665 |
+
$show = false;
|
666 |
+
}
|
667 |
+
}
|
668 |
+
if ($show) {
|
669 |
+
$menu_position = '1.9998887771';
|
670 |
+
if(self::checkInstallWpadmPlugins()) {
|
671 |
+
$page = add_menu_page(
|
672 |
+
'WPAdm',
|
673 |
+
'WPAdm',
|
674 |
+
"read",
|
675 |
+
'wpadm_plugins',
|
676 |
+
'wpadm_plugins',
|
677 |
+
plugins_url('/img/wpadm-logo.png', dirname( __FILE__ )),
|
678 |
+
$menu_position
|
679 |
+
);
|
680 |
+
add_submenu_page(
|
681 |
+
'wpadm_plugins',
|
682 |
+
"Dropbox Full Backup",
|
683 |
+
"Dropbox Full Backup",
|
684 |
+
'read',
|
685 |
+
'wpadm_wp_full_backup_dropbox',
|
686 |
+
array('wpadm_wp_full_backup_dropbox', 'wpadm_show_backup')
|
687 |
+
);
|
688 |
+
} else {
|
689 |
+
$page = add_menu_page(
|
690 |
+
'Dropbox Full Backup',
|
691 |
+
'Dropbox Full Backup',
|
692 |
+
"read",
|
693 |
+
'wpadm_wp_full_backup_dropbox',
|
694 |
+
array('wpadm_wp_full_backup_dropbox', 'wpadm_show_backup'),
|
695 |
+
plugins_url('/img/wpadm-logo.png', dirname( __FILE__ ) ),
|
696 |
+
$menu_position
|
697 |
+
);
|
698 |
+
|
699 |
+
add_submenu_page(
|
700 |
+
'wpadm_wp_full_backup_dropbox',
|
701 |
+
"WPAdm",
|
702 |
+
"WPAdm",
|
703 |
+
'read',
|
704 |
+
'wpadm_plugins',
|
705 |
+
'wpadm_plugins'
|
706 |
+
);
|
707 |
+
}
|
708 |
+
|
709 |
+
}
|
710 |
+
}
|
711 |
+
public static function notice()
|
712 |
+
{
|
713 |
+
if (!isset($_GET['page']) || ( isset($_GET['page']) && $_GET['page'] != 'wpadm_wp_full_backup_dropbox' ) ) {
|
714 |
+
$notice_file = DRBBACKUP_BASE_DIR . DIRECTORY_SEPARATOR . "template" . DIRECTORY_SEPARATOR . "notice.php";
|
715 |
+
if (!file_exists(WPAdm_Core::getTmpDir() . "/notice") && file_exists($notice_file)) {
|
716 |
+
ob_start();
|
717 |
+
include_once $notice_file;
|
718 |
+
echo ob_get_clean();
|
719 |
+
}
|
720 |
+
}
|
721 |
+
}
|
722 |
+
public static function hide_notice()
|
723 |
+
{
|
724 |
+
if (isset($_GET['type'])) {
|
725 |
+
switch($_GET['type']) {
|
726 |
+
case 'preview' :
|
727 |
+
file_put_contents(WPAdm_Core::getTmpDir() . "/notice", 1);
|
728 |
+
break;
|
729 |
+
case 'star' :
|
730 |
+
if (isset($_GET['hide']) && $_GET['hide'] == '1d') {
|
731 |
+
file_put_contents(WPAdm_Core::getTmpDir() . "/notice-star", time() . '_w');
|
732 |
+
} elseif ( ( isset($_GET['hide']) && $_GET['hide'] == 'week' ) || !isset($_GET['hide']) ) {
|
733 |
+
file_put_contents(WPAdm_Core::getTmpDir() . "/notice-star", 0);
|
734 |
+
}
|
735 |
+
break;
|
736 |
+
}
|
737 |
+
}
|
738 |
+
header('location:' . $_SERVER['HTTP_REFERER']);
|
739 |
+
exit;
|
740 |
+
}
|
741 |
+
}
|
742 |
+
}
|
743 |
+
|
744 |
+
?>
|
methods/class-wpadm-method-backup-delete.php
CHANGED
@@ -1,28 +1,28 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Delete backup
|
4 |
-
* Class WPAdm_Method_Backup_Delete
|
5 |
-
*/
|
6 |
-
if (!class_exists('WPAdm_Method_Backup_Delete')) {
|
7 |
-
class WPAdm_Method_Backup_Delete extends WPAdm_Method_Class {
|
8 |
-
public function getResult()
|
9 |
-
{
|
10 |
-
$backups_dir = realpath(
|
11 |
-
if(strpos($backups_dir, DIRECTORY_SEPARATOR . '
|
12 |
-
$this->result->setResult = WPAdm_result::WPADM_RESULT_ERROR;
|
13 |
-
$this->result->setError('Wrong name backup');
|
14 |
-
} else {
|
15 |
-
if (is_dir($backups_dir)) {
|
16 |
-
WPAdm_Core::rmdir($backups_dir);
|
17 |
-
if (!is_dir($backups_dir)) {
|
18 |
-
$this->result->setResult = WPAdm_result::WPADM_RESULT_SUCCESS;
|
19 |
-
} else {
|
20 |
-
$this->result->setResult = WPAdm_result::WPADM_RESULT_ERROR;
|
21 |
-
$this->result->setError('Failed to remove backup');
|
22 |
-
}
|
23 |
-
}
|
24 |
-
}
|
25 |
-
return $this->result;
|
26 |
-
}
|
27 |
-
}
|
28 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Delete backup
|
4 |
+
* Class WPAdm_Method_Backup_Delete
|
5 |
+
*/
|
6 |
+
if (!class_exists('WPAdm_Method_Backup_Delete')) {
|
7 |
+
class WPAdm_Method_Backup_Delete extends WPAdm_Method_Class {
|
8 |
+
public function getResult()
|
9 |
+
{
|
10 |
+
$backups_dir = realpath(DROPBOX_BACKUP_DIR_BACKUP . '/' . $this->params['name']);
|
11 |
+
if(strpos($backups_dir, DIRECTORY_SEPARATOR . 'DROPBOX_BACKUP_DIR_NAME' . DIRECTORY_SEPARATOR) === false || !is_dir($backups_dir)) {
|
12 |
+
$this->result->setResult = WPAdm_result::WPADM_RESULT_ERROR;
|
13 |
+
$this->result->setError('Wrong name backup');
|
14 |
+
} else {
|
15 |
+
if (is_dir($backups_dir)) {
|
16 |
+
WPAdm_Core::rmdir($backups_dir);
|
17 |
+
if (!is_dir($backups_dir)) {
|
18 |
+
$this->result->setResult = WPAdm_result::WPADM_RESULT_SUCCESS;
|
19 |
+
} else {
|
20 |
+
$this->result->setResult = WPAdm_result::WPADM_RESULT_ERROR;
|
21 |
+
$this->result->setError('Failed to remove backup');
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
25 |
+
return $this->result;
|
26 |
+
}
|
27 |
+
}
|
28 |
}
|
methods/class-wpadm-method-backup-list.php
CHANGED
@@ -1,45 +1,45 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Return a list of backups
|
4 |
-
* Class WPAdm_Method_Exec
|
5 |
-
*/
|
6 |
-
if (!class_exists('WPAdm_Method_Backup_List')) {
|
7 |
-
class WPAdm_Method_Backup_List extends WPAdm_Method_Class {
|
8 |
-
public function getResult()
|
9 |
-
{
|
10 |
-
$backups_dir =
|
11 |
-
$dirs = glob($backups_dir . '*');
|
12 |
-
|
13 |
-
$backups = array();
|
14 |
-
foreach($dirs as $dir) {
|
15 |
-
if (preg_match("|(.*)\-(.*)\-(.*)|", $dir, $mm)) {
|
16 |
-
$tmp = explode('/', $dir);
|
17 |
-
$name = array_pop($tmp);
|
18 |
-
list($y,$m,$d, $h,$i) = explode('_', $mm[3]);
|
19 |
-
$dt = "$y-$m-$d $h:$i";
|
20 |
-
$backup = array(
|
21 |
-
'name' => $name,
|
22 |
-
'type' => $mm[2],
|
23 |
-
'dt' => $dt,
|
24 |
-
);
|
25 |
-
$files = glob($dir . '/*.zip');
|
26 |
-
$size = 0;
|
27 |
-
foreach($files as $k=>$v) {
|
28 |
-
$size += (int)filesize($v);
|
29 |
-
$files[$k] = str_replace(ABSPATH, '', $v);
|
30 |
-
}
|
31 |
-
$backup['files'] = $files;
|
32 |
-
$backup['size'] = $size;
|
33 |
-
if ($size > 0) {
|
34 |
-
$backups[] = $backup;
|
35 |
-
}
|
36 |
-
|
37 |
-
}
|
38 |
-
}
|
39 |
-
$this->result->setData($backups);
|
40 |
-
$this->result->setResult(WPAdm_result::WPADM_RESULT_SUCCESS);
|
41 |
-
return $this->result;
|
42 |
-
}
|
43 |
-
|
44 |
-
}
|
45 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Return a list of backups
|
4 |
+
* Class WPAdm_Method_Exec
|
5 |
+
*/
|
6 |
+
if (!class_exists('WPAdm_Method_Backup_List')) {
|
7 |
+
class WPAdm_Method_Backup_List extends WPAdm_Method_Class {
|
8 |
+
public function getResult()
|
9 |
+
{
|
10 |
+
$backups_dir = DROPBOX_BACKUP_DIR_BACKUP . '/';
|
11 |
+
$dirs = glob($backups_dir . '*');
|
12 |
+
|
13 |
+
$backups = array();
|
14 |
+
foreach($dirs as $dir) {
|
15 |
+
if (preg_match("|(.*)\-(.*)\-(.*)|", $dir, $mm)) {
|
16 |
+
$tmp = explode('/', $dir);
|
17 |
+
$name = array_pop($tmp);
|
18 |
+
list($y,$m,$d, $h,$i) = explode('_', $mm[3]);
|
19 |
+
$dt = "$y-$m-$d $h:$i";
|
20 |
+
$backup = array(
|
21 |
+
'name' => $name,
|
22 |
+
'type' => $mm[2],
|
23 |
+
'dt' => $dt,
|
24 |
+
);
|
25 |
+
$files = glob($dir . '/*.zip');
|
26 |
+
$size = 0;
|
27 |
+
foreach($files as $k=>$v) {
|
28 |
+
$size += (int)filesize($v);
|
29 |
+
$files[$k] = str_replace(ABSPATH, '', $v);
|
30 |
+
}
|
31 |
+
$backup['files'] = $files;
|
32 |
+
$backup['size'] = $size;
|
33 |
+
if ($size > 0) {
|
34 |
+
$backups[] = $backup;
|
35 |
+
}
|
36 |
+
|
37 |
+
}
|
38 |
+
}
|
39 |
+
$this->result->setData($backups);
|
40 |
+
$this->result->setResult(WPAdm_result::WPADM_RESULT_SUCCESS);
|
41 |
+
return $this->result;
|
42 |
+
}
|
43 |
+
|
44 |
+
}
|
45 |
}
|
methods/class-wpadm-method-backup.php
CHANGED
@@ -1,451 +1,407 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
if (!class_exists('WPadm_Method_Backup')) {
|
7 |
-
class WPadm_Method_Backup extends WPAdm_Method_Class {
|
8 |
-
/**
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
private $id;
|
13 |
-
|
14 |
-
/**
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
private $stime;
|
19 |
-
|
20 |
-
/**
|
21 |
-
|
22 |
-
|
23 |
-
private $queue;
|
24 |
-
|
25 |
-
/**
|
26 |
-
|
27 |
-
|
28 |
-
private $dir;
|
29 |
-
|
30 |
-
/**
|
31 |
-
|
32 |
-
|
33 |
-
private $tmp_dir;
|
34 |
-
|
35 |
-
/**
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
private $type = 'full';
|
40 |
-
|
41 |
-
private $name = '';
|
42 |
-
|
43 |
-
public function __construct($params) {
|
44 |
-
parent::__construct($params);
|
45 |
-
$this->init(
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
);
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
$name
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
$
|
63 |
-
$
|
64 |
-
$
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
WPAdm_Core::mkdir(
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
$
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
unlink(dirname(__FILE__) . '/../tmp/log.log');
|
83 |
-
|
84 |
-
|
85 |
-
WPAdm_Core::log('
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
$
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
$
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
$
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
$errors[] =
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
WPAdm_Core::log(
|
130 |
-
}
|
131 |
-
unset($commandContext);
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
$files =
|
139 |
-
}
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
$
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
$
|
161 |
-
}
|
162 |
-
$
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
$
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
$
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
$
|
210 |
-
$
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
$
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
$
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
)
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
} else {
|
408 |
-
WPAdm_Core::log('Пропускаем файл ' . $ff);
|
409 |
-
}
|
410 |
-
}
|
411 |
-
}
|
412 |
-
}
|
413 |
-
}
|
414 |
-
closedir($handle);
|
415 |
-
}
|
416 |
-
return $array_items;
|
417 |
-
}
|
418 |
-
|
419 |
-
|
420 |
-
/*
|
421 |
-
* Берем реквизиты доступа к MySQL из параметров WP
|
422 |
-
* return Array()
|
423 |
-
*/
|
424 |
-
private function getWpMysqlParams()
|
425 |
-
{
|
426 |
-
$db_params = array(
|
427 |
-
'password' => 'DB_PASSWORD',
|
428 |
-
'db' => 'DB_NAME',
|
429 |
-
'user' => 'DB_USER',
|
430 |
-
'host' => 'DB_HOST',
|
431 |
-
);
|
432 |
-
|
433 |
-
$r = "/define\('(.*)', '(.*)'\)/";
|
434 |
-
preg_match_all($r, file_get_contents(ABSPATH . "wp-config.php"), $m);
|
435 |
-
$params = array_combine($m[1], $m[2]);
|
436 |
-
foreach($db_params as $k=>$p) {
|
437 |
-
$db_params[$k] = $params[$p];
|
438 |
-
}
|
439 |
-
return $db_params;
|
440 |
-
}
|
441 |
-
|
442 |
-
|
443 |
-
private function init(array $conf) {
|
444 |
-
//todo: нормализация
|
445 |
-
$this->id = $conf['id'];
|
446 |
-
$this->stime = $conf['stime'];
|
447 |
-
$this->queue = new WPAdm_Queue($this->id);
|
448 |
-
$this->type = $conf['type'];
|
449 |
-
}
|
450 |
-
}
|
451 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Бэкап сайта
|
4 |
+
* Class WPadm_Method_Backup
|
5 |
+
*/
|
6 |
+
if (!class_exists('WPadm_Method_Backup')) {
|
7 |
+
class WPadm_Method_Backup extends WPAdm_Method_Class {
|
8 |
+
/**
|
9 |
+
* Уникальный идентификатор текущего объекта
|
10 |
+
* @var String
|
11 |
+
*/
|
12 |
+
private $id;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Unixtimestamp, когда был запущен метод
|
16 |
+
* @var Int
|
17 |
+
*/
|
18 |
+
private $stime;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @var WPAdm_Queue
|
22 |
+
*/
|
23 |
+
private $queue;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @var string
|
27 |
+
*/
|
28 |
+
private $dir;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @var string
|
32 |
+
*/
|
33 |
+
private $tmp_dir;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Тип бэкапа
|
37 |
+
* @var string [full|db]
|
38 |
+
*/
|
39 |
+
private $type = 'full';
|
40 |
+
|
41 |
+
private $name = '';
|
42 |
+
|
43 |
+
public function __construct($params) {
|
44 |
+
parent::__construct($params);
|
45 |
+
$this->init(
|
46 |
+
array(
|
47 |
+
'id' => uniqid('wpadm_method_backup__'),
|
48 |
+
'stime' => time(),
|
49 |
+
'type' => $params['type'],
|
50 |
+
)
|
51 |
+
);
|
52 |
+
|
53 |
+
$name = get_option('siteurl');
|
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;
|
60 |
+
|
61 |
+
// папка для бэкапа
|
62 |
+
$this->dir = DROPBOX_BACKUP_DIR_BACKUP . '/' . $this->name;
|
63 |
+
$error = WPAdm_Core::mkdir(DROPBOX_BACKUP_DIR_BACKUP);
|
64 |
+
if (!empty($error)) {
|
65 |
+
$this->result->setError($error);
|
66 |
+
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
67 |
+
}
|
68 |
+
$error = WPAdm_Core::mkdir($this->dir);
|
69 |
+
if (!empty($error)) {
|
70 |
+
$this->result->setError($error);
|
71 |
+
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
public function getResult()
|
76 |
+
{
|
77 |
+
$errors = array();
|
78 |
+
|
79 |
+
$this->result->setResult(WPAdm_Result::WPADM_RESULT_SUCCESS);
|
80 |
+
$this->result->setError('');
|
81 |
+
|
82 |
+
@unlink(dirname(__FILE__) . '/../tmp/log.log');
|
83 |
+
|
84 |
+
WPAdm_Core::log('Start backup create');
|
85 |
+
WPAdm_Core::log('Create dump Data Base');
|
86 |
+
|
87 |
+
$mysql_dump_file = DROPBOX_BACKUP_DIR_BACKUP . '/mysqldump.sql';
|
88 |
+
if (file_exists($mysql_dump_file)) {
|
89 |
+
unlink($mysql_dump_file);
|
90 |
+
}
|
91 |
+
$wp_mysql_params = $this->getWpMysqlParams();
|
92 |
+
|
93 |
+
if (isset($this->params['optimize']) && ($this->params['optimize']==1)) {
|
94 |
+
WPAdm_Core::log('optimization Database');
|
95 |
+
$commandContext = new WPAdm_Command_Context();
|
96 |
+
$commandContext ->addParam('command','mysqloptimize')
|
97 |
+
->addParam('host', $wp_mysql_params['host'])
|
98 |
+
->addParam('db', $wp_mysql_params['db'])
|
99 |
+
->addParam('user', $wp_mysql_params['user'])
|
100 |
+
->addParam('password', $wp_mysql_params['password']);
|
101 |
+
$this->queue->clear()
|
102 |
+
->add($commandContext);
|
103 |
+
unset($commandContext);
|
104 |
+
}
|
105 |
+
|
106 |
+
$commandContext = new WPAdm_Command_Context();
|
107 |
+
$commandContext ->addParam('command','mysqldump')
|
108 |
+
->addParam('host', $wp_mysql_params['host'])
|
109 |
+
->addParam('db', $wp_mysql_params['db'])
|
110 |
+
->addParam('user', $wp_mysql_params['user'])
|
111 |
+
->addParam('password', $wp_mysql_params['password'])
|
112 |
+
->addParam('tables', '')
|
113 |
+
->addParam('to_file', $mysql_dump_file);
|
114 |
+
$res = $this->queue->add($commandContext)
|
115 |
+
->save()
|
116 |
+
->execute();
|
117 |
+
|
118 |
+
if (!$res) {
|
119 |
+
$log = langWPADM::get('Website "%domain" returned an error during database dump creation: \'Dump of Database wasn\'t created: "%s"\'. To solve this problem, please check your database system logs or send to us your FTP access data. You can send to us support request using "Help" button on plugin page.', false, array('%domain', '%s'), array(SITE_HOME, $this->queue->getError() ) );
|
120 |
+
WPAdm_Core::log($log);
|
121 |
+
$errors[] = $log;
|
122 |
+
} elseif (0 == (int)filesize($mysql_dump_file)) {
|
123 |
+
$log = langWPADM::get('Website "%domain" returned an error during database dump creation: Database-Dump file is emplty. To solve this problem, please check permissions to folder: "%dir".', false, array('%domain', '%dir'), array(SITE_HOME, DROPBOX_BACKUP_DIR_BACKUP));
|
124 |
+
$errors[] = $log;
|
125 |
+
WPAdm_Core::log($log);
|
126 |
+
} else {
|
127 |
+
$size_dump = round( (filesize($mysql_dump_file) / 1024 / 1024) , 2);
|
128 |
+
$log = str_replace("%s", $size_dump , langWPADM::get('Database Dump was successfully created ( %s Mb) : ', false) ) ;
|
129 |
+
WPAdm_Core::log($log . ' '. str_replace(ABSPATH, '', $mysql_dump_file) );
|
130 |
+
}
|
131 |
+
unset($commandContext);
|
132 |
+
|
133 |
+
|
134 |
+
WPAdm_Core::log('Start Created List Files');
|
135 |
+
if ($this->type == 'full') {
|
136 |
+
$files = $this->createListFilesForArchive();
|
137 |
+
} else {
|
138 |
+
$files = array();
|
139 |
+
}
|
140 |
+
if (file_exists($mysql_dump_file) && filesize($mysql_dump_file) > 0) {
|
141 |
+
$files[] = $mysql_dump_file;
|
142 |
+
}
|
143 |
+
|
144 |
+
if (empty($files)) {
|
145 |
+
$errors[] = 'Empty list files';
|
146 |
+
}
|
147 |
+
|
148 |
+
$files2 = array();
|
149 |
+
$files2[0] = array();
|
150 |
+
$i = 0;
|
151 |
+
$size = 0;
|
152 |
+
foreach($files as $f) {
|
153 |
+
if ($size > 170000) {//~170kbyte
|
154 |
+
$i ++;
|
155 |
+
$size = 0;
|
156 |
+
$files2[$i] = array();
|
157 |
+
}
|
158 |
+
$f_size =(int)filesize($f);
|
159 |
+
if ($f_size == 0 || $f_size > 1000000) {
|
160 |
+
WPAdm_Core::log('file '. $f .' size ' . $f_size);
|
161 |
+
}
|
162 |
+
$size += $f_size;
|
163 |
+
$files2[$i][] = $f;
|
164 |
+
}
|
165 |
+
|
166 |
+
WPAdm_Core::log('Сreated List Files is successfully');
|
167 |
+
$this->queue->clear();
|
168 |
+
|
169 |
+
foreach($files2 as $files) {
|
170 |
+
$commandContext = new WPAdm_Command_Context();
|
171 |
+
$commandContext ->addParam('command','archive')
|
172 |
+
->addParam('files', $files)
|
173 |
+
->addParam('to_file', $this->dir . '/'.$this->name)
|
174 |
+
->addParam('max_file_size', 900000)
|
175 |
+
->addParam('remove_path', ABSPATH);
|
176 |
+
|
177 |
+
$this->queue->add($commandContext);
|
178 |
+
unset($commandContext);
|
179 |
+
}
|
180 |
+
WPAdm_Core::log('Start archived files');
|
181 |
+
// сохраним и выполним
|
182 |
+
$this->queue->save()
|
183 |
+
->execute();
|
184 |
+
WPAdm_Core::log('End archived files');
|
185 |
+
|
186 |
+
$files = glob($this->dir . '/'.$this->name . '*');
|
187 |
+
$urls = array();
|
188 |
+
foreach($files as $file) {
|
189 |
+
$urls[] = str_replace(ABSPATH, '', $file);
|
190 |
+
}
|
191 |
+
$this->result->setData($urls);
|
192 |
+
|
193 |
+
WPAdm_Core::rmdir(DROPBOX_BACKUP_DIR_BACKUP . '/mysqldump.sql');
|
194 |
+
|
195 |
+
if ($this->params['limit'] != 0) {
|
196 |
+
WPAdm_Core::log('Start deleted old backup');
|
197 |
+
$files = glob(DROPBOX_BACKUP_DIR_BACKUP . '/*');
|
198 |
+
if (count($files) > $this->params['limit']) {
|
199 |
+
$files2 = array();
|
200 |
+
foreach($files as $f) {
|
201 |
+
$fa = explode('-', $f);
|
202 |
+
if (count($fa) != 3) {
|
203 |
+
continue;
|
204 |
+
}
|
205 |
+
$files2[$fa[2]] = $f;
|
206 |
+
|
207 |
+
}
|
208 |
+
ksort($files2);
|
209 |
+
$d = count($files2) - $this->params['limit'];
|
210 |
+
$del = array_slice($files2, 0, $d);
|
211 |
+
foreach($del as $d) {
|
212 |
+
WPAdm_Core::rmdir($d);
|
213 |
+
}
|
214 |
+
}
|
215 |
+
WPAdm_Core::log('Finish deleted old backups');
|
216 |
+
}
|
217 |
+
WPAdm_Core::log('Finish create');
|
218 |
+
|
219 |
+
if (!empty($errors)) {
|
220 |
+
$this->result->setError(implode("\n", $errors));
|
221 |
+
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
222 |
+
}
|
223 |
+
|
224 |
+
return $this->result;
|
225 |
+
|
226 |
+
|
227 |
+
}
|
228 |
+
|
229 |
+
|
230 |
+
|
231 |
+
public function createListFilesForArchive() {
|
232 |
+
$folders = array();
|
233 |
+
$files = array();
|
234 |
+
|
235 |
+
$files = array_merge(
|
236 |
+
$files,
|
237 |
+
array(
|
238 |
+
ABSPATH .'/.htaccess',
|
239 |
+
ABSPATH .'/index.php',
|
240 |
+
ABSPATH .'/license.txt',
|
241 |
+
ABSPATH .'/readme.html',
|
242 |
+
ABSPATH .'/wp-activate.php',
|
243 |
+
ABSPATH .'/wp-blog-header.php',
|
244 |
+
ABSPATH .'/wp-comments-post.php',
|
245 |
+
ABSPATH .'/wp-config.php',
|
246 |
+
ABSPATH .'/wp-config-sample.php',
|
247 |
+
ABSPATH .'/wp-cron.php',
|
248 |
+
ABSPATH .'/wp-links-opml.php',
|
249 |
+
ABSPATH .'/wp-load.php',
|
250 |
+
ABSPATH .'/wp-login.php',
|
251 |
+
ABSPATH .'/wp-mail.php',
|
252 |
+
ABSPATH .'/wp-settings.php',
|
253 |
+
ABSPATH .'/wp-signup.php',
|
254 |
+
ABSPATH .'/wp-trackback.php',
|
255 |
+
ABSPATH .'/xmlrpc.php',
|
256 |
+
)
|
257 |
+
);
|
258 |
+
|
259 |
+
if (!empty($this->params['minus-path'])) {
|
260 |
+
foreach($files as $k=>$v) {
|
261 |
+
$v = str_replace(ABSPATH .'/' , '', $v);
|
262 |
+
if (in_array($v, $this->params['minus-path'])) {
|
263 |
+
unset($files[$k]);
|
264 |
+
WPAdm_Core::log('Пропускаем файл ' . $v);
|
265 |
+
}
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
$folders = array_merge(
|
270 |
+
$folders,
|
271 |
+
array(
|
272 |
+
ABSPATH .'/wp-admin',
|
273 |
+
ABSPATH .'/wp-content',
|
274 |
+
ABSPATH .'/wp-includes',
|
275 |
+
)
|
276 |
+
);
|
277 |
+
|
278 |
+
foreach($this->params['plus-path'] as $p) {
|
279 |
+
if (empty($p)) {
|
280 |
+
continue;
|
281 |
+
}
|
282 |
+
$p = ABSPATH .'/' . $p;
|
283 |
+
if (file_exists($p)) {
|
284 |
+
if (is_dir($p)) {
|
285 |
+
$folders[] = $p;
|
286 |
+
} else{
|
287 |
+
$files[] = $p;
|
288 |
+
}
|
289 |
+
}
|
290 |
+
}
|
291 |
+
|
292 |
+
$folders = array_unique($folders);
|
293 |
+
$files = array_unique($files);
|
294 |
+
|
295 |
+
foreach($folders as $folder) {
|
296 |
+
if (!is_dir($folder)) {
|
297 |
+
continue;
|
298 |
+
}
|
299 |
+
$files = array_merge($files, $this->directoryToArray($folder, true));
|
300 |
+
}
|
301 |
+
return $files;
|
302 |
+
}
|
303 |
+
|
304 |
+
|
305 |
+
private function directoryToArray($directory, $recursive) {
|
306 |
+
$array_items = array();
|
307 |
+
|
308 |
+
$d = str_replace(ABSPATH . '/', '', $directory);
|
309 |
+
// пропускаем ненужные директории
|
310 |
+
|
311 |
+
if (
|
312 |
+
in_array($d, $this->params['minus-path'])
|
313 |
+
) {
|
314 |
+
WPAdm_Core::log('Пропускаем папку ' . $directory);
|
315 |
+
return array();
|
316 |
+
}
|
317 |
+
|
318 |
+
$d = str_replace('\\', '/', $d);
|
319 |
+
$tmp = explode('/', $d);
|
320 |
+
$d1 = mb_strtolower($tmp[0]);
|
321 |
+
unset($tmp[0]);
|
322 |
+
$d2 = mb_strtolower(implode('/', $tmp));
|
323 |
+
// if (strpos($d1, 'cache') !== false || ($d1 == 'wp-includes' && strpos($d2, 'cache') !== false)) {
|
324 |
+
// if (($d1 == 'wp-includes' && strpos($d2, 'cache') !== false)
|
325 |
+
// || ($d1 == 'wp-content' || !in_array($tmp[0], array('plugins', 'themes')))
|
326 |
+
if (strpos($d2, 'cache') !== false
|
327 |
+
&& !in_array($tmp[0], array('plugins', 'themes'))
|
328 |
+
) {
|
329 |
+
WPAdm_Core::log('Пропускаем папку(cache) ' . $directory);
|
330 |
+
return array();
|
331 |
+
}
|
332 |
+
if(strpos($directory, 'wpadm_backups') !== false) {
|
333 |
+
return array();
|
334 |
+
}
|
335 |
+
|
336 |
+
if ($handle = opendir($directory)) {
|
337 |
+
while (false !== ($file = readdir($handle))) {
|
338 |
+
if ($file != "." && $file != "..") {
|
339 |
+
if (is_dir($directory. "/" . $file)) {
|
340 |
+
if($recursive) {
|
341 |
+
$array_items = array_merge($array_items, $this->directoryToArray($directory. "/" . $file, $recursive));
|
342 |
+
}
|
343 |
+
|
344 |
+
$file = $directory . "/" . $file;
|
345 |
+
if (!is_dir($file)) {
|
346 |
+
$ff = preg_replace("/\/\//si", "/", $file);
|
347 |
+
$f = str_replace(ABSPATH . '/', '', $ff);
|
348 |
+
// пропускаем ненужные директории
|
349 |
+
if (!in_array($f, $this->params['minus-path'])) {
|
350 |
+
$array_items[] = $ff;
|
351 |
+
} else {
|
352 |
+
WPAdm_Core::log('Пропускаем файл ' . $ff);
|
353 |
+
}
|
354 |
+
}
|
355 |
+
} else {
|
356 |
+
$file = $directory . "/" . $file;
|
357 |
+
if (!is_dir($file)) {
|
358 |
+
$ff = preg_replace("/\/\//si", "/", $file);
|
359 |
+
$f = str_replace(ABSPATH . '/', '', $ff);
|
360 |
+
// пропускаем ненужные директории
|
361 |
+
if (!in_array($f, $this->params['minus-path'])) {
|
362 |
+
$array_items[] = $ff;
|
363 |
+
} else {
|
364 |
+
WPAdm_Core::log('Пропускаем файл ' . $ff);
|
365 |
+
}
|
366 |
+
}
|
367 |
+
}
|
368 |
+
}
|
369 |
+
}
|
370 |
+
closedir($handle);
|
371 |
+
}
|
372 |
+
return $array_items;
|
373 |
+
}
|
374 |
+
|
375 |
+
|
376 |
+
/*
|
377 |
+
* Берем реквизиты доступа к MySQL из параметров WP
|
378 |
+
* return Array()
|
379 |
+
*/
|
380 |
+
private function getWpMysqlParams()
|
381 |
+
{
|
382 |
+
$db_params = array(
|
383 |
+
'password' => 'DB_PASSWORD',
|
384 |
+
'db' => 'DB_NAME',
|
385 |
+
'user' => 'DB_USER',
|
386 |
+
'host' => 'DB_HOST',
|
387 |
+
);
|
388 |
+
|
389 |
+
$r = "/define\('(.*)', '(.*)'\)/";
|
390 |
+
preg_match_all($r, file_get_contents(ABSPATH . "wp-config.php"), $m);
|
391 |
+
$params = array_combine($m[1], $m[2]);
|
392 |
+
foreach($db_params as $k=>$p) {
|
393 |
+
$db_params[$k] = $params[$p];
|
394 |
+
}
|
395 |
+
return $db_params;
|
396 |
+
}
|
397 |
+
|
398 |
+
|
399 |
+
private function init(array $conf) {
|
400 |
+
//todo: нормализация
|
401 |
+
$this->id = $conf['id'];
|
402 |
+
$this->stime = $conf['stime'];
|
403 |
+
$this->queue = new WPAdm_Queue($this->id);
|
404 |
+
$this->type = $conf['type'];
|
405 |
+
}
|
406 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
407 |
}
|
methods/class-wpadm-method-full-backup-dropbox.php
CHANGED
@@ -59,9 +59,17 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
59 |
$this->name = $name;
|
60 |
|
61 |
// folder for backup
|
62 |
-
$this->dir =
|
63 |
-
WPAdm_Core::mkdir(
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
66 |
|
67 |
public function getResult()
|
@@ -71,19 +79,24 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
71 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_SUCCESS);
|
72 |
$this->result->setError('');
|
73 |
|
74 |
-
WPAdm_Core::log('Start backup');
|
75 |
|
76 |
# create db dump
|
77 |
-
WPAdm_Core::log('Start create db dump');
|
78 |
-
WPAdm_Core::mkdir(
|
79 |
-
$
|
|
|
|
|
|
|
|
|
|
|
80 |
if (file_exists($mysql_dump_file)) {
|
81 |
unlink($mysql_dump_file);
|
82 |
}
|
83 |
$wp_mysql_params = $this->getWpMysqlParams();
|
84 |
|
85 |
if (isset($this->params['optimize']) && ($this->params['optimize']==1)) {
|
86 |
-
WPAdm_Core::log('Table optimization');
|
87 |
$commandContext = new WPAdm_Command_Context();
|
88 |
$commandContext ->addParam('command','mysqloptimize')
|
89 |
->addParam('host', $wp_mysql_params['host'])
|
@@ -107,26 +120,29 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
107 |
->save()
|
108 |
->execute();
|
109 |
if (!$res) {
|
110 |
-
|
111 |
-
$
|
112 |
-
|
113 |
-
|
114 |
-
|
|
|
115 |
} else {
|
116 |
-
|
|
|
|
|
117 |
}
|
118 |
unset($commandContext);
|
119 |
|
120 |
|
121 |
#ЗАРХИВИРУЕМ ФАЙЛЫ
|
122 |
-
WPAdm_Core::log('Create a list of files');
|
123 |
$files = $this->createListFilesForArchive();
|
124 |
if (file_exists($mysql_dump_file) && filesize($mysql_dump_file) > 0) {
|
125 |
$files[] = $mysql_dump_file;
|
126 |
}
|
127 |
|
128 |
if (empty($files)) {
|
129 |
-
$errors[] = '
|
130 |
}
|
131 |
|
132 |
// split the file list by 170kbayt lists, To break one big task into smaller
|
@@ -140,7 +156,7 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
140 |
$size = 0;
|
141 |
$files2[$i] = array();
|
142 |
}
|
143 |
-
$f_size =(int)
|
144 |
if ($f_size == 0 || $f_size > 1000000) {
|
145 |
WPAdm_Core::log('file '. $f .' size ' . $f_size);
|
146 |
}
|
@@ -148,7 +164,7 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
148 |
$files2[$i][] = $f;
|
149 |
}
|
150 |
|
151 |
-
WPAdm_Core::log('List of
|
152 |
|
153 |
$this->queue->clear();
|
154 |
|
@@ -163,10 +179,10 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
163 |
$this->queue->add($commandContext);
|
164 |
unset($commandContext);
|
165 |
}
|
166 |
-
WPAdm_Core::log('
|
167 |
$this->queue->save()
|
168 |
->execute();
|
169 |
-
WPAdm_Core::log('End of
|
170 |
|
171 |
$files = glob($this->dir . '/'.$this->name . '*');
|
172 |
$urls = array();
|
@@ -183,7 +199,7 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
183 |
if (isset($this->params['storage'])) {
|
184 |
foreach($this->params['storage'] as $storage) {
|
185 |
if ($storage['type'] == 'ftp') {
|
186 |
-
WPAdm_Core::log('Begin copying files to FTP');
|
187 |
$this->queue->clear();
|
188 |
$files = glob($this->dir . '/'.$this->name . '*');
|
189 |
//$this->getResult()->setData($files);
|
@@ -206,15 +222,16 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
206 |
$res = $this->queue->save()
|
207 |
->execute();
|
208 |
if (!$res) {
|
209 |
-
|
210 |
-
$
|
|
|
211 |
}
|
212 |
-
WPAdm_Core::log('Finished copying files to FTP');
|
213 |
if (isset($storage['remove_from_server']) && $storage['remove_from_server'] == 1 ) {
|
214 |
$remove_from_server = $storage['remove_from_server'];
|
215 |
}
|
216 |
} elseif ($storage['type'] == 's3') {
|
217 |
-
WPAdm_Core::log('Begin coping files to S3');
|
218 |
$this->queue->clear();
|
219 |
$files = glob($this->dir . '/'.$this->name . '*');
|
220 |
//$this->getResult()->setData($files);
|
@@ -238,7 +255,7 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
238 |
WPAdm_Core::log('S3: ' . $this->queue->getError());
|
239 |
$errors[] = 'S3: '.$this->queue->getError();
|
240 |
}
|
241 |
-
WPAdm_Core::log('Finished copying files to S3');
|
242 |
if (isset($storage['remove_from_server']) && $storage['remove_from_server'] == 1 ) {
|
243 |
$remove_from_server = $storage['remove_from_server'];
|
244 |
}
|
@@ -246,7 +263,7 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
246 |
}
|
247 |
if ($remove_from_server) {
|
248 |
// удаляем файлы на сервере
|
249 |
-
WPAdm_Core::log('Remove the backup server');
|
250 |
WPAdm_Core::rmdir($this->dir);
|
251 |
}
|
252 |
|
@@ -255,7 +272,7 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
255 |
$this->queue->clear();
|
256 |
$files = glob($this->dir . '/' . $this->name . '*');
|
257 |
$files = array_merge_recursive(array($mysql_dump_file), $files);
|
258 |
-
WPAdm_Core::log('files to google: ' . print_r($files, true));
|
259 |
$n = count($files);
|
260 |
for($i = 0; $i <$n; $i++) {
|
261 |
$commandContext = new WPAdm_Command_Context();
|
@@ -272,7 +289,7 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
272 |
$res = $this->queue->save()
|
273 |
->execute();
|
274 |
if (!$res) {
|
275 |
-
WPAdm_Core::log('Google drive: ' . $this->queue->getError());
|
276 |
}
|
277 |
//WPAdm_Core::log('google drive' . print_r($this->params, true));
|
278 |
}
|
@@ -280,7 +297,7 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
280 |
$this->queue->clear();
|
281 |
$files = glob($this->dir . '/' . $this->name . '*');
|
282 |
$files = array_merge_recursive(array($mysql_dump_file), $files);
|
283 |
-
WPAdm_Core::log('files to dropbox: ' . print_r($files, true));
|
284 |
$n = count($files);
|
285 |
for($i = 0; $i <$n; $i++) {
|
286 |
$commandContext = new WPAdm_Command_Context();
|
@@ -297,17 +314,17 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
297 |
$this->queue->save()
|
298 |
->execute();
|
299 |
if (!$res) {
|
300 |
-
WPAdm_Core::log('Dropbox: ' . $this->queue->getError());
|
301 |
}
|
302 |
}
|
303 |
|
304 |
#Removing TMP-files
|
305 |
-
WPAdm_Core::rmdir(
|
306 |
|
307 |
#Removind old backups(if limit the number of stored backups)
|
308 |
-
WPAdm_Core::log('Start removing old backups');
|
309 |
if ($this->params['limit'] != 0) {
|
310 |
-
$files = glob(
|
311 |
if (count($files) > $this->params['limit']) {
|
312 |
$files2 = array();
|
313 |
foreach($files as $f) {
|
@@ -326,22 +343,23 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
326 |
}
|
327 |
}
|
328 |
}
|
329 |
-
WPAdm_Core::log('Finished removing old backups');
|
330 |
|
331 |
-
WPAdm_Core::log('Creating a backup is completed');
|
332 |
|
|
|
333 |
if (!empty($errors)) {
|
334 |
$this->result->setError(implode("\n", $errors));
|
335 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
|
|
|
|
|
|
|
|
336 |
}
|
337 |
-
|
338 |
return $this->result;
|
339 |
-
|
340 |
-
|
341 |
}
|
342 |
|
343 |
-
|
344 |
-
|
345 |
public function createListFilesForArchive() {
|
346 |
$folders = array();
|
347 |
$files = array();
|
@@ -376,7 +394,7 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
376 |
$v = str_replace(ABSPATH , '', $v);
|
377 |
if (in_array($v, $minus_path)) {
|
378 |
unset($files[$k]);
|
379 |
-
WPAdm_Core::log('Skip file ' . $v);
|
380 |
}
|
381 |
}
|
382 |
}
|
@@ -439,6 +457,9 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
439 |
WPAdm_Core::log('Skip dir(cache) ' . $directory);
|
440 |
return array();
|
441 |
}
|
|
|
|
|
|
|
442 |
|
443 |
if ($handle = opendir($directory)) {
|
444 |
while (false !== ($file = readdir($handle))) {
|
@@ -468,7 +489,7 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
468 |
if (!in_array($f, $minus_path)) {
|
469 |
$array_items[] = $ff;
|
470 |
} else {
|
471 |
-
WPAdm_Core::log('Skip dir ' . $ff);
|
472 |
}
|
473 |
}
|
474 |
}
|
@@ -494,7 +515,7 @@ if (!class_exists('WPadm_Method_Full_Backup_Dropbox')) {
|
|
494 |
);
|
495 |
|
496 |
$r = "/define\('(.*)', '(.*)'\)/";
|
497 |
-
preg_match_all($r, file_get_contents(ABSPATH . "wp-config.php"), $m);
|
498 |
$params = array_combine($m[1], $m[2]);
|
499 |
foreach($db_params as $k=>$p) {
|
500 |
$db_params[$k] = $params[$p];
|
59 |
$this->name = $name;
|
60 |
|
61 |
// folder for backup
|
62 |
+
$this->dir = DROPBOX_BACKUP_DIR_BACKUP . '/' . $this->name;
|
63 |
+
$error = WPAdm_Core::mkdir(DROPBOX_BACKUP_DIR_BACKUP);
|
64 |
+
if (!empty($error)) {
|
65 |
+
$this->result->setError($error);
|
66 |
+
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
67 |
+
}
|
68 |
+
$error = WPAdm_Core::mkdir($this->dir);
|
69 |
+
if (!empty($error)) {
|
70 |
+
$this->result->setError($error);
|
71 |
+
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
72 |
+
}
|
73 |
}
|
74 |
|
75 |
public function getResult()
|
79 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_SUCCESS);
|
80 |
$this->result->setError('');
|
81 |
|
82 |
+
WPAdm_Core::log( langWPADM::get('Start backup', false) );
|
83 |
|
84 |
# create db dump
|
85 |
+
WPAdm_Core::log( langWPADM::get('Start create db dump', false) );
|
86 |
+
$error = WPAdm_Core::mkdir(DROPBOX_BACKUP_DIR_BACKUP);
|
87 |
+
if (!empty($error)) {
|
88 |
+
$this->result->setError($error);
|
89 |
+
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
90 |
+
return $this->result;
|
91 |
+
}
|
92 |
+
$mysql_dump_file = DROPBOX_BACKUP_DIR_BACKUP . '/mysqldump.sql';
|
93 |
if (file_exists($mysql_dump_file)) {
|
94 |
unlink($mysql_dump_file);
|
95 |
}
|
96 |
$wp_mysql_params = $this->getWpMysqlParams();
|
97 |
|
98 |
if (isset($this->params['optimize']) && ($this->params['optimize']==1)) {
|
99 |
+
WPAdm_Core::log( langWPADM::get('Table optimization', false) );
|
100 |
$commandContext = new WPAdm_Command_Context();
|
101 |
$commandContext ->addParam('command','mysqloptimize')
|
102 |
->addParam('host', $wp_mysql_params['host'])
|
120 |
->save()
|
121 |
->execute();
|
122 |
if (!$res) {
|
123 |
+
$log = str_replace('%s', $this->queue->getError(), langWPADM::get('Error: Dump of Database wasn\'t created (%s)', false) );
|
124 |
+
WPAdm_Core::log($log);
|
125 |
+
$errors[] = $log;
|
126 |
+
} elseif (0 == (int)@filesize($mysql_dump_file)) {
|
127 |
+
$errors[] = langWPADM::get('MySQL Error: Database-Dump File is empty', false);
|
128 |
+
WPAdm_Core::log(langWPADM::get('Dump of Database wasn\'t created (File of Database-Dump is empty!)', false));
|
129 |
} else {
|
130 |
+
$size_dump = round( (filesize($mysql_dump_file) / 1024 / 1024) , 2);
|
131 |
+
$log = str_replace("%s", $size_dump , langWPADM::get('Database Dump was successfully created ( %s Mb) : ', false) ) ;
|
132 |
+
WPAdm_Core::log($log . $mysql_dump_file);
|
133 |
}
|
134 |
unset($commandContext);
|
135 |
|
136 |
|
137 |
#ЗАРХИВИРУЕМ ФАЙЛЫ
|
138 |
+
WPAdm_Core::log( langWPADM::get('Create a list of files for Backup', false) );
|
139 |
$files = $this->createListFilesForArchive();
|
140 |
if (file_exists($mysql_dump_file) && filesize($mysql_dump_file) > 0) {
|
141 |
$files[] = $mysql_dump_file;
|
142 |
}
|
143 |
|
144 |
if (empty($files)) {
|
145 |
+
$errors[] = langWPADM::get('Error: the list of Backup files is empty', false);
|
146 |
}
|
147 |
|
148 |
// split the file list by 170kbayt lists, To break one big task into smaller
|
156 |
$size = 0;
|
157 |
$files2[$i] = array();
|
158 |
}
|
159 |
+
$f_size =(int)filesize($f);
|
160 |
if ($f_size == 0 || $f_size > 1000000) {
|
161 |
WPAdm_Core::log('file '. $f .' size ' . $f_size);
|
162 |
}
|
164 |
$files2[$i][] = $f;
|
165 |
}
|
166 |
|
167 |
+
WPAdm_Core::log( langWPADM::get('List of Backup-Files was successfully created', false) );
|
168 |
|
169 |
$this->queue->clear();
|
170 |
|
179 |
$this->queue->add($commandContext);
|
180 |
unset($commandContext);
|
181 |
}
|
182 |
+
WPAdm_Core::log( langWPADM::get('Backup of Files was started', false) );
|
183 |
$this->queue->save()
|
184 |
->execute();
|
185 |
+
WPAdm_Core::log( langWPADM::get('End of File Backup', false) );
|
186 |
|
187 |
$files = glob($this->dir . '/'.$this->name . '*');
|
188 |
$urls = array();
|
199 |
if (isset($this->params['storage'])) {
|
200 |
foreach($this->params['storage'] as $storage) {
|
201 |
if ($storage['type'] == 'ftp') {
|
202 |
+
WPAdm_Core::log( langWPADM::get('Begin copying files to FTP', false) );
|
203 |
$this->queue->clear();
|
204 |
$files = glob($this->dir . '/'.$this->name . '*');
|
205 |
//$this->getResult()->setData($files);
|
222 |
$res = $this->queue->save()
|
223 |
->execute();
|
224 |
if (!$res) {
|
225 |
+
$log = langWPADM::get('FTP: ' , false);
|
226 |
+
WPAdm_Core::log($log . $this->queue->getError());
|
227 |
+
$errors[] = $log . $this->queue->getError();
|
228 |
}
|
229 |
+
WPAdm_Core::log( langWPADM::get('Finished copying files to FTP' , false) );
|
230 |
if (isset($storage['remove_from_server']) && $storage['remove_from_server'] == 1 ) {
|
231 |
$remove_from_server = $storage['remove_from_server'];
|
232 |
}
|
233 |
} elseif ($storage['type'] == 's3') {
|
234 |
+
WPAdm_Core::log( langWPADM::get('Begin coping files to S3' , false) );
|
235 |
$this->queue->clear();
|
236 |
$files = glob($this->dir . '/'.$this->name . '*');
|
237 |
//$this->getResult()->setData($files);
|
255 |
WPAdm_Core::log('S3: ' . $this->queue->getError());
|
256 |
$errors[] = 'S3: '.$this->queue->getError();
|
257 |
}
|
258 |
+
WPAdm_Core::log( langWPADM::get('Finished copying files to S3' , false) );
|
259 |
if (isset($storage['remove_from_server']) && $storage['remove_from_server'] == 1 ) {
|
260 |
$remove_from_server = $storage['remove_from_server'];
|
261 |
}
|
263 |
}
|
264 |
if ($remove_from_server) {
|
265 |
// удаляем файлы на сервере
|
266 |
+
WPAdm_Core::log( langWPADM::get('Remove the backup server' , false) );
|
267 |
WPAdm_Core::rmdir($this->dir);
|
268 |
}
|
269 |
|
272 |
$this->queue->clear();
|
273 |
$files = glob($this->dir . '/' . $this->name . '*');
|
274 |
$files = array_merge_recursive(array($mysql_dump_file), $files);
|
275 |
+
WPAdm_Core::log( langWPADM::get('files to google: ' , false) . print_r($files, true));
|
276 |
$n = count($files);
|
277 |
for($i = 0; $i <$n; $i++) {
|
278 |
$commandContext = new WPAdm_Command_Context();
|
289 |
$res = $this->queue->save()
|
290 |
->execute();
|
291 |
if (!$res) {
|
292 |
+
WPAdm_Core::log( langWPADM::get('Google drive: ' , false) . $this->queue->getError());
|
293 |
}
|
294 |
//WPAdm_Core::log('google drive' . print_r($this->params, true));
|
295 |
}
|
297 |
$this->queue->clear();
|
298 |
$files = glob($this->dir . '/' . $this->name . '*');
|
299 |
$files = array_merge_recursive(array($mysql_dump_file), $files);
|
300 |
+
WPAdm_Core::log( langWPADM::get('files to dropbox: ' , false) . print_r($files, true));
|
301 |
$n = count($files);
|
302 |
for($i = 0; $i <$n; $i++) {
|
303 |
$commandContext = new WPAdm_Command_Context();
|
314 |
$this->queue->save()
|
315 |
->execute();
|
316 |
if (!$res) {
|
317 |
+
WPAdm_Core::log(langWPADM::get('Dropbox: ' , false) . $this->queue->getError());
|
318 |
}
|
319 |
}
|
320 |
|
321 |
#Removing TMP-files
|
322 |
+
WPAdm_Core::rmdir(DROPBOX_BACKUP_DIR_BACKUP . '/mysqldump.sql');
|
323 |
|
324 |
#Removind old backups(if limit the number of stored backups)
|
325 |
+
WPAdm_Core::log( langWPADM::get('Start removing old backups' , false) );
|
326 |
if ($this->params['limit'] != 0) {
|
327 |
+
$files = glob(DROPBOX_BACKUP_DIR_BACKUP . '/*');
|
328 |
if (count($files) > $this->params['limit']) {
|
329 |
$files2 = array();
|
330 |
foreach($files as $f) {
|
343 |
}
|
344 |
}
|
345 |
}
|
346 |
+
WPAdm_Core::log( langWPADM::get('Finished removing old backups' , false) );
|
347 |
|
348 |
+
WPAdm_Core::log( langWPADM::get('Creating a backup is completed' , false) );
|
349 |
|
350 |
+
wpadm_class::setBackup(2);
|
351 |
if (!empty($errors)) {
|
352 |
$this->result->setError(implode("\n", $errors));
|
353 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
354 |
+
wpadm_class::setStatus(0);
|
355 |
+
wpadm_class::setErrors( implode(", ", $errors) );
|
356 |
+
} else {
|
357 |
+
wpadm_class::setStatus(1);
|
358 |
}
|
359 |
+
wpadm_class::backupSend();
|
360 |
return $this->result;
|
|
|
|
|
361 |
}
|
362 |
|
|
|
|
|
363 |
public function createListFilesForArchive() {
|
364 |
$folders = array();
|
365 |
$files = array();
|
394 |
$v = str_replace(ABSPATH , '', $v);
|
395 |
if (in_array($v, $minus_path)) {
|
396 |
unset($files[$k]);
|
397 |
+
WPAdm_Core::log( langWPADM::get('Skip file ' , false) . $v);
|
398 |
}
|
399 |
}
|
400 |
}
|
457 |
WPAdm_Core::log('Skip dir(cache) ' . $directory);
|
458 |
return array();
|
459 |
}
|
460 |
+
if(strpos($directory, DROPBOX_BACKUP_DIR_NAME) !== false) {
|
461 |
+
return array();
|
462 |
+
}
|
463 |
|
464 |
if ($handle = opendir($directory)) {
|
465 |
while (false !== ($file = readdir($handle))) {
|
489 |
if (!in_array($f, $minus_path)) {
|
490 |
$array_items[] = $ff;
|
491 |
} else {
|
492 |
+
WPAdm_Core::log( langWPADM::get('Skip dir ' , false) . $ff);
|
493 |
}
|
494 |
}
|
495 |
}
|
515 |
);
|
516 |
|
517 |
$r = "/define\('(.*)', '(.*)'\)/";
|
518 |
+
preg_match_all($r, file_get_contents( ABSPATH . "wp-config.php"), $m);
|
519 |
$params = array_combine($m[1], $m[2]);
|
520 |
foreach($db_params as $k=>$p) {
|
521 |
$db_params[$k] = $params[$p];
|
methods/class-wpadm-method-local-backup.php
CHANGED
@@ -3,36 +3,63 @@
|
|
3 |
if (!class_exists('WPAdm_Method_Local_Backup')) {
|
4 |
class WPAdm_Method_Local_Backup extends WPAdm_Method_Class {
|
5 |
|
|
|
|
|
6 |
public function __construct($params)
|
7 |
{
|
8 |
parent::__construct($params);
|
9 |
$this->init(
|
10 |
array(
|
11 |
-
'id' => uniqid('
|
12 |
'stime' => time(),
|
13 |
)
|
14 |
);
|
15 |
-
|
16 |
-
|
17 |
-
unlink($file_log);
|
18 |
-
}
|
19 |
-
WPAdm_Core::log('Create Unique Id '. $this->id);
|
20 |
|
21 |
|
22 |
$name = get_option('siteurl');
|
23 |
|
24 |
$name = str_replace("http://", '', $name);
|
25 |
$name = str_replace("https://", '', $name);
|
26 |
-
$name = preg_replace("|\W|", "_", $name);
|
27 |
-
$
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
29 |
$this->name = $name;
|
30 |
-
|
31 |
|
32 |
// folder for backup
|
33 |
-
$this->dir =
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
public function getResult()
|
38 |
{
|
@@ -41,161 +68,200 @@ if (!class_exists('WPAdm_Method_Local_Backup')) {
|
|
41 |
|
42 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_SUCCESS);
|
43 |
$this->result->setError('');
|
44 |
-
|
45 |
-
WPAdm_Core::log('Start Backup process...');
|
46 |
|
47 |
# create db dump
|
48 |
if (in_array('db', $this->params['types']) ) {
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
-
// Table Optimization
|
58 |
-
if (isset($this->params['optimize']) && ($this->params['optimize']==1)) {
|
59 |
-
WPAdm_Core::log('Optimize Database Tables');
|
60 |
$commandContext = new WPAdm_Command_Context();
|
61 |
-
$commandContext ->addParam('command','
|
62 |
->addParam('host', $wp_mysql_params['host'])
|
63 |
->addParam('db', $wp_mysql_params['db'])
|
64 |
->addParam('user', $wp_mysql_params['user'])
|
65 |
-
->addParam('password', $wp_mysql_params['password'])
|
66 |
-
|
67 |
-
->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
unset($commandContext);
|
|
|
69 |
}
|
70 |
-
// Creating of Database Backup
|
71 |
-
$commandContext = new WPAdm_Command_Context();
|
72 |
-
$commandContext ->addParam('command','mysqldump')
|
73 |
-
->addParam('host', $wp_mysql_params['host'])
|
74 |
-
->addParam('db', $wp_mysql_params['db'])
|
75 |
-
->addParam('user', $wp_mysql_params['user'])
|
76 |
-
->addParam('password', $wp_mysql_params['password'])
|
77 |
-
->addParam('tables', '')
|
78 |
-
->addParam('to_file', $mysql_dump_file);
|
79 |
-
$res = $this->queue->add($commandContext)
|
80 |
-
->save()
|
81 |
-
->execute();
|
82 |
-
if (!$res) {
|
83 |
-
WPAdm_Core::log('Error: Dump of Database wasn\'t created('.$this->queue->getError().')');
|
84 |
-
$errors[] = 'MySQL Error: '.$this->queue->getError();
|
85 |
-
} elseif (0 == (int)filesize($mysql_dump_file)) {
|
86 |
-
$errors[] = 'MySQL Error: Database-Dump File is empty';
|
87 |
-
WPAdm_Core::log('Dump of Database wasn\'t created (File of Database-Dump is empty!)');
|
88 |
-
} else {
|
89 |
-
WPAdm_Core::log('Database Dump was successfully created('.filesize($mysql_dump_file).'b):' . $mysql_dump_file);
|
90 |
-
}
|
91 |
-
unset($commandContext);
|
92 |
}
|
93 |
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
}
|
102 |
-
|
103 |
-
if (empty($files)) {
|
104 |
-
$errors[] = 'Error: the list of Backup files is empty';
|
105 |
-
}
|
106 |
-
|
107 |
-
// split the file list by 170kbayt lists, To break one big task into smaller
|
108 |
-
$files2 = array();
|
109 |
-
$files2[0] = array();
|
110 |
-
$i = 0;
|
111 |
-
$size = 0;
|
112 |
-
foreach($files as $f) {
|
113 |
-
if ($size > 170000) {//~170kbyte
|
114 |
-
$i ++;
|
115 |
-
$size = 0;
|
116 |
-
$files2[$i] = array();
|
117 |
}
|
118 |
-
$
|
119 |
-
|
120 |
-
WPAdm_Core::log('File '. $f .' Size ' . $f_size);
|
121 |
}
|
122 |
-
$size += $f_size;
|
123 |
-
$files2[$i][] = $f;
|
124 |
-
}
|
125 |
-
|
126 |
-
WPAdm_Core::log('List of Backup-Files was successfully created');
|
127 |
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
$commandContext = new WPAdm_Command_Context();
|
132 |
-
$commandContext ->addParam('command', 'archive')
|
133 |
-
->addParam('files', $files)
|
134 |
-
->addParam('to_file', $this->dir . '/'.$this->name)
|
135 |
-
->addParam('max_file_size', 900000)
|
136 |
-
->addParam('remove_path', ABSPATH);
|
137 |
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
WPAdm_Core::log('Backup of Files was started');
|
142 |
-
$this->queue->save()
|
143 |
-
->execute();
|
144 |
-
WPAdm_Core::log('End of File Backup');
|
145 |
-
|
146 |
-
$files = glob($this->dir . '/'.$this->name . '*');
|
147 |
-
$urls = array();
|
148 |
-
$totalSize = 0;
|
149 |
-
foreach($files as $file) {
|
150 |
-
$urls[] = str_replace(ABSPATH, '', $file);
|
151 |
-
$totalSize += @intval( filesize($file) );
|
152 |
-
}
|
153 |
-
$this->result->setData($urls);
|
154 |
-
$this->result->setSize($totalSize);
|
155 |
-
$size = $totalSize / 1024 / 1024; /// MByte
|
156 |
-
$size = round($size, 2);
|
157 |
-
WPAdm_Core::log('Backup Size ' . $size . " Mb");
|
158 |
-
|
159 |
-
$remove_from_server = 0;
|
160 |
-
#Removing TMP-files
|
161 |
-
WPAdm_Core::rmdir(ABSPATH . 'wpadm_backup');
|
162 |
-
|
163 |
-
#Removind old backups(if limit the number of stored backups)
|
164 |
-
if ($this->params['limit'] != 0) {
|
165 |
-
WPAdm_Core::log('Limits of Backups ' . $this->params['limit']);
|
166 |
-
WPAdm_Core::log('Removing of old Backups was started');
|
167 |
-
$files = glob(ABSPATH . 'wpadm_backups/*');
|
168 |
-
if (count($files) > $this->params['limit']) {
|
169 |
$files2 = array();
|
|
|
|
|
|
|
170 |
foreach($files as $f) {
|
171 |
-
$
|
172 |
-
|
173 |
-
|
|
|
|
|
|
|
|
|
|
|
174 |
}
|
175 |
-
$
|
|
|
|
|
|
|
|
|
|
|
176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
}
|
178 |
-
|
179 |
-
$
|
180 |
-
|
181 |
-
|
182 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
}
|
|
|
184 |
}
|
185 |
-
WPAdm_Core::log('Removing of old Backups was Finished');
|
186 |
}
|
|
|
187 |
if (!empty($errors)) {
|
188 |
$this->result->setError(implode("\n", $errors));
|
189 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
|
|
|
|
|
|
190 |
} else {
|
191 |
-
|
|
|
192 |
}
|
|
|
193 |
|
194 |
return $this->result;
|
195 |
|
196 |
}
|
197 |
-
|
198 |
-
|
199 |
$folders = array();
|
200 |
$files = array();
|
201 |
|
@@ -229,7 +295,7 @@ if (!class_exists('WPAdm_Method_Local_Backup')) {
|
|
229 |
$v = str_replace(ABSPATH , '', $v);
|
230 |
if (in_array($v, $minus_path)) {
|
231 |
unset($files[$k]);
|
232 |
-
WPAdm_Core::log('Skip of File ' . $v);
|
233 |
}
|
234 |
}
|
235 |
}
|
@@ -280,7 +346,7 @@ if (!class_exists('WPAdm_Method_Local_Backup')) {
|
|
280 |
if (isset($this->params['minus-path'])) {
|
281 |
$minus_path = explode(",", $this->params['minus-path']);
|
282 |
if (in_array($d, $minus_path) ) {
|
283 |
-
WPAdm_Core::log('Skip of Folder ' . $directory);
|
284 |
return array();
|
285 |
}
|
286 |
} else {
|
@@ -292,8 +358,11 @@ if (!class_exists('WPAdm_Method_Local_Backup')) {
|
|
292 |
$d1 = mb_strtolower($tmp[0]);
|
293 |
unset($tmp[0]);
|
294 |
$d2 = mb_strtolower(implode('/', $tmp));
|
295 |
-
if (strpos($d2, 'cache') !== false && isset($tmp[0])&& !in_array($tmp[0], array('plugins', 'themes')) ) {
|
296 |
-
WPAdm_Core::log('Skip of Cache-Folder ' . $directory);
|
|
|
|
|
|
|
297 |
return array();
|
298 |
}
|
299 |
|
@@ -313,7 +382,7 @@ if (!class_exists('WPAdm_Method_Local_Backup')) {
|
|
313 |
if (!in_array($f, $minus_path)) {
|
314 |
$array_items[] = $ff;
|
315 |
} else {
|
316 |
-
WPAdm_Core::log('Skip of File ' . $ff);
|
317 |
}
|
318 |
}
|
319 |
} else {
|
@@ -325,7 +394,7 @@ if (!class_exists('WPAdm_Method_Local_Backup')) {
|
|
325 |
if (!in_array($f, $minus_path)) {
|
326 |
$array_items[] = $ff;
|
327 |
} else {
|
328 |
-
WPAdm_Core::log('Skip of Folder ' . $ff);
|
329 |
}
|
330 |
}
|
331 |
}
|
3 |
if (!class_exists('WPAdm_Method_Local_Backup')) {
|
4 |
class WPAdm_Method_Local_Backup extends WPAdm_Method_Class {
|
5 |
|
6 |
+
private $start = true;
|
7 |
+
|
8 |
public function __construct($params)
|
9 |
{
|
10 |
parent::__construct($params);
|
11 |
$this->init(
|
12 |
array(
|
13 |
+
'id' => uniqid('wpadm_method__local_backup__'),
|
14 |
'stime' => time(),
|
15 |
)
|
16 |
);
|
17 |
+
|
18 |
+
WPAdm_Core::log(langWPADM::get('Create Unique Id ', false) . $this->id);
|
|
|
|
|
|
|
19 |
|
20 |
|
21 |
$name = get_option('siteurl');
|
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']);
|
28 |
+
$name .= '-' . wpadm_class::$type . '-' . date("Y_m_d_H_i", $params['time']);
|
29 |
+
} else {
|
30 |
+
$this->time = date("Y-m-d H:i"); //23.04.2015 13:45
|
31 |
+
$name .= '-' . wpadm_class::$type . '-' . date("Y_m_d_H_i");
|
32 |
+
}
|
33 |
$this->name = $name;
|
|
|
34 |
|
35 |
// folder for backup
|
36 |
+
$this->dir = DROPBOX_BACKUP_DIR_BACKUP . '/' . $name;
|
37 |
+
if (($f = $this->checkBackup()) !== false) {
|
38 |
+
$this->dir = DROPBOX_BACKUP_DIR_BACKUP . '/' . $f;
|
39 |
+
}
|
40 |
+
$error = WPAdm_Core::mkdir(DROPBOX_BACKUP_DIR_BACKUP);
|
41 |
+
if (!empty($error)) {
|
42 |
+
$this->result->setError($error);
|
43 |
+
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
44 |
+
}
|
45 |
+
$error = WPAdm_Core::mkdir($this->dir);
|
46 |
+
if (!empty($error)) {
|
47 |
+
$this->result->setError($error);
|
48 |
+
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
49 |
+
}
|
50 |
+
}
|
51 |
+
public function checkBackup()
|
52 |
+
{
|
53 |
+
if (WPAdm_Running::getCommand('local_backup') !== false) {
|
54 |
+
$archives = glob("{$this->dir}");
|
55 |
+
if (empty($archives) && count($archives) <= 1) {
|
56 |
+
return false;
|
57 |
+
}
|
58 |
+
$n = count($archives);
|
59 |
+
$f = "{$this->name}({$n})";
|
60 |
+
return $f;
|
61 |
+
}
|
62 |
+
return false;
|
63 |
}
|
64 |
public function getResult()
|
65 |
{
|
68 |
|
69 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_SUCCESS);
|
70 |
$this->result->setError('');
|
71 |
+
WPAdm_Core::log(langWPADM::get('Start Backup process...', false));
|
|
|
72 |
|
73 |
# create db dump
|
74 |
if (in_array('db', $this->params['types']) ) {
|
75 |
+
$mysql_dump_file = DROPBOX_BACKUP_DIR_BACKUP . '/mysqldump.sql';
|
76 |
+
if ( !WPAdm_Running::getCommandResult('db') ) {
|
77 |
+
WPAdm_Running::setCommandResult('db');
|
78 |
+
WPAdm_Core::log(langWPADM::get('Creating Database Dump', false));
|
79 |
+
$error = WPAdm_Core::mkdir(DROPBOX_BACKUP_DIR_BACKUP);
|
80 |
+
if (!empty($error)) {
|
81 |
+
$this->result->setError($error);
|
82 |
+
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
83 |
+
return $this->result;
|
84 |
+
}
|
85 |
+
if (file_exists($mysql_dump_file) && !file_exists(WPAdm_Core::getTmpDir() . "/db")) {
|
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(langWPADM::get('Optimize Database Tables', false));
|
94 |
+
$commandContext = new WPAdm_Command_Context();
|
95 |
+
$commandContext ->addParam('command','mysqloptimize')
|
96 |
+
->addParam('host', $wp_mysql_params['host'])
|
97 |
+
->addParam('db', $wp_mysql_params['db'])
|
98 |
+
->addParam('user', $wp_mysql_params['user'])
|
99 |
+
->addParam('password', $wp_mysql_params['password']);
|
100 |
+
$this->queue->clear()
|
101 |
+
->add($commandContext);
|
102 |
+
unset($commandContext);
|
103 |
+
}
|
104 |
+
}
|
105 |
|
|
|
|
|
|
|
106 |
$commandContext = new WPAdm_Command_Context();
|
107 |
+
$commandContext ->addParam('command','mysqldump')
|
108 |
->addParam('host', $wp_mysql_params['host'])
|
109 |
->addParam('db', $wp_mysql_params['db'])
|
110 |
->addParam('user', $wp_mysql_params['user'])
|
111 |
+
->addParam('password', $wp_mysql_params['password'])
|
112 |
+
->addParam('tables', '')
|
113 |
+
->addParam('to_file', $mysql_dump_file);
|
114 |
+
$res = $this->queue->add($commandContext)
|
115 |
+
->save()
|
116 |
+
->execute();
|
117 |
+
if (!$res) {
|
118 |
+
$log = langWPADM::get('Website "%domain" returned an error during database dump creation: \'Dump of Database wasn\'t created: "%s"\'. To solve this problem, please check your database system logs or send to us your FTP access data. You can send to us support request using "Help" button on plugin page.', false, array('%domain', '%s'), array(SITE_HOME, $this->queue->getError() ) );
|
119 |
+
WPAdm_Core::log($log);
|
120 |
+
$errors[] = $log;
|
121 |
+
} elseif (0 == (int)filesize($mysql_dump_file)) {
|
122 |
+
$log = langWPADM::get('Website "%domain" returned an error during database dump creation: Database-Dump file is emplty. To solve this problem, please check permissions to folder: "%dir".', false, array('%domain', '%dir'), array(SITE_HOME, DROPBOX_BACKUP_DIR_BACKUP));
|
123 |
+
$errors[] = $log;
|
124 |
+
WPAdm_Core::log($log);
|
125 |
+
} else {
|
126 |
+
$size_dump = round( (filesize($mysql_dump_file) / 1024 / 1024) , 2);
|
127 |
+
$log = str_replace("%size", $size_dump , langWPADM::get('Database Dump was successfully created ( %size Mb) : ', false) ) ;
|
128 |
+
WPAdm_Core::log($log . $mysql_dump_file);
|
129 |
+
}
|
130 |
unset($commandContext);
|
131 |
+
WPAdm_Running::setCommandResult('db', true);
|
132 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
}
|
134 |
|
135 |
+
if (count($errors) == 0) {
|
136 |
+
$command_files_list = WPAdm_Running::getCommandResultData('files');
|
137 |
+
if (in_array('files', $this->params['types']) && empty($command_files_list) ) {
|
138 |
+
$files = $this->createListFilesForArchive();
|
139 |
+
WPAdm_Running::setCommandResultData('files', $files);
|
140 |
+
} else {
|
141 |
+
$files = $command_files_list;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
}
|
143 |
+
if (isset($mysql_dump_file) && file_exists($mysql_dump_file) && filesize($mysql_dump_file) > 0) {
|
144 |
+
$files[] = $mysql_dump_file;
|
|
|
145 |
}
|
|
|
|
|
|
|
|
|
|
|
146 |
|
147 |
+
if (empty($files)) {
|
148 |
+
$errors[] = langWPADM::get( 'Website "%d" returned an error during creation of the list of files for a backup: list of files for a backup is empty. To solve this problem, please check files and folders permissions for website "%d".' , false, array('%d'), array(SITE_HOME));
|
149 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
|
151 |
+
// split the file list by 170kbayt lists, To break one big task into smaller
|
152 |
+
$files2 = WPAdm_Running::getCommandResultData('files2');
|
153 |
+
if (empty($files2)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
$files2 = array();
|
155 |
+
$files2[0] = array();
|
156 |
+
$i = 0;
|
157 |
+
$size = 0;
|
158 |
foreach($files as $f) {
|
159 |
+
if ($size > 170000) {//~170kbyte
|
160 |
+
$i ++;
|
161 |
+
$size = 0;
|
162 |
+
$files2[$i] = array();
|
163 |
+
}
|
164 |
+
$f_size =(int)@filesize($f);
|
165 |
+
if ($f_size == 0 || $f_size > 1000000) {
|
166 |
+
WPAdm_Core::log('File ' . $f . ' Size ' . $f_size);
|
167 |
}
|
168 |
+
$size += $f_size;
|
169 |
+
$files2[$i][] = $f;
|
170 |
+
}
|
171 |
+
WPAdm_Running::setCommandResultData('files2', $files2);
|
172 |
+
}
|
173 |
+
|
174 |
|
175 |
+
WPAdm_Core::log( langWPADM::get('List of Backup-Files was successfully created', false) );
|
176 |
+
$this->queue->clear();
|
177 |
+
if ( !WPAdm_Running::getCommandResult('archive') ) {
|
178 |
+
WPAdm_Running::setCommandResult('archive');
|
179 |
+
$files_archive = WPAdm_Running::getCommandResultData('archive');
|
180 |
+
foreach($files2 as $files) {
|
181 |
+
$files_str = implode(',', $files);
|
182 |
+
if (!in_array($files_str, $files_archive)) {
|
183 |
+
$commandContext = new WPAdm_Command_Context();
|
184 |
+
$commandContext ->addParam('command', 'archive')
|
185 |
+
->addParam('files', $files)
|
186 |
+
->addParam('to_file', $this->dir . '/' . $this->name)
|
187 |
+
->addParam('max_file_size', 900000)
|
188 |
+
->addParam('remove_path', ABSPATH);
|
189 |
+
|
190 |
+
$this->queue->add($commandContext);
|
191 |
+
unset($commandContext);
|
192 |
+
}
|
193 |
}
|
194 |
+
WPAdm_Core::log( langWPADM::get('Backup of Files was started', false) );
|
195 |
+
$this->queue->save()->execute();
|
196 |
+
WPAdm_Core::log( langWPADM::get('End of File Backup', false) );
|
197 |
+
WPAdm_Running::setCommandResult('archive', true);
|
198 |
+
}
|
199 |
+
$files = glob($this->dir . '/'.$this->name . '*');
|
200 |
+
$urls = array();
|
201 |
+
$totalSize = 0;
|
202 |
+
foreach($files as $file) {
|
203 |
+
$urls[] = str_replace(ABSPATH, '', $file);
|
204 |
+
$totalSize += @intval( filesize($file) );
|
205 |
+
}
|
206 |
+
$this->result->setData($urls);
|
207 |
+
$this->result->setSize($totalSize);
|
208 |
+
$this->result->setValue('md5_data', md5 ( print_r($this->result->toArray(), 1 ) ) );
|
209 |
+
$this->result->setValue('name', $this->name );
|
210 |
+
$this->result->setValue('time', $this->time);
|
211 |
+
$this->result->setValue('type', 'local');
|
212 |
+
$this->result->setValue('counts', count($urls) );
|
213 |
+
$size = $totalSize / 1024 / 1024; /// MByte
|
214 |
+
$size = round($size, 2);
|
215 |
+
$log = str_replace("%s", $size , langWPADM::get('Backup Size %s Mb', false) ) ;
|
216 |
+
WPAdm_Core::log($log);
|
217 |
+
|
218 |
+
$remove_from_server = 0;
|
219 |
+
#Removing TMP-files
|
220 |
+
WPAdm_Core::rmdir($mysql_dump_file);
|
221 |
+
|
222 |
+
#Removind old backups(if limit the number of stored backups)
|
223 |
+
if ($this->params['limit'] != 0) {
|
224 |
+
WPAdm_Core::log( langWPADM::get('Limits of Backups ', false) . $this->params['limit'] );
|
225 |
+
WPAdm_Core::log( langWPADM::get('Removing of old Backups was started', false) );
|
226 |
+
$files = glob(DROPBOX_BACKUP_DIR_BACKUP . '/*');
|
227 |
+
if (count($files) > $this->params['limit']) {
|
228 |
+
$files2 = array();
|
229 |
+
foreach($files as $f) {
|
230 |
+
$fa = explode('-', $f);
|
231 |
+
if (count($fa) != 3) {
|
232 |
+
continue;
|
233 |
+
}
|
234 |
+
$files2[$fa[2]] = $f;
|
235 |
+
|
236 |
+
}
|
237 |
+
ksort($files2);
|
238 |
+
$d = count($files2) - $this->params['limit'];
|
239 |
+
$del = array_slice($files2, 0, $d);
|
240 |
+
foreach($del as $d) {
|
241 |
+
WPAdm_Core::rmdir($d);
|
242 |
+
}
|
243 |
}
|
244 |
+
WPAdm_Core::log( langWPADM::get('Removing of old Backups was Finished', false) );
|
245 |
}
|
|
|
246 |
}
|
247 |
+
wpadm_class::setBackup(1);
|
248 |
if (!empty($errors)) {
|
249 |
$this->result->setError(implode("\n", $errors));
|
250 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
251 |
+
WPAdm_Core::rmdir($this->dir);
|
252 |
+
wpadm_class::setStatus(0);
|
253 |
+
wpadm_class::setErrors( implode(", ", $errors) );
|
254 |
} else {
|
255 |
+
wpadm_class::setStatus(1);
|
256 |
+
WPAdm_Core::log( langWPADM::get('Backup creation was complete successfully!', false) );
|
257 |
}
|
258 |
+
wpadm_class::backupSend();
|
259 |
|
260 |
return $this->result;
|
261 |
|
262 |
}
|
263 |
+
public function createListFilesForArchive()
|
264 |
+
{
|
265 |
$folders = array();
|
266 |
$files = array();
|
267 |
|
295 |
$v = str_replace(ABSPATH , '', $v);
|
296 |
if (in_array($v, $minus_path)) {
|
297 |
unset($files[$k]);
|
298 |
+
WPAdm_Core::log( langWPADM::get('Skip of File ', false) . $v);
|
299 |
}
|
300 |
}
|
301 |
}
|
346 |
if (isset($this->params['minus-path'])) {
|
347 |
$minus_path = explode(",", $this->params['minus-path']);
|
348 |
if (in_array($d, $minus_path) ) {
|
349 |
+
WPAdm_Core::log(langWPADM::get('Skip of Folder ', false) . $directory);
|
350 |
return array();
|
351 |
}
|
352 |
} else {
|
358 |
$d1 = mb_strtolower($tmp[0]);
|
359 |
unset($tmp[0]);
|
360 |
$d2 = mb_strtolower(implode('/', $tmp));
|
361 |
+
if (strpos($d2, 'cache') !== false && isset($tmp[0]) && !in_array($tmp[0], array('plugins', 'themes')) ) {
|
362 |
+
WPAdm_Core::log(langWPADM::get('Skip of Cache-Folder ', false) . $directory);
|
363 |
+
return array();
|
364 |
+
}
|
365 |
+
if(strpos($directory, 'wpadm_backups') !== false || strpos($directory, 'Dropbox_Backup') !== false) {
|
366 |
return array();
|
367 |
}
|
368 |
|
382 |
if (!in_array($f, $minus_path)) {
|
383 |
$array_items[] = $ff;
|
384 |
} else {
|
385 |
+
WPAdm_Core::log(langWPADM::get('Skip of File ', false) . $ff);
|
386 |
}
|
387 |
}
|
388 |
} else {
|
394 |
if (!in_array($f, $minus_path)) {
|
395 |
$array_items[] = $ff;
|
396 |
} else {
|
397 |
+
WPAdm_Core::log( langWPADM::get('Skip of Folder ', false) . $ff);
|
398 |
}
|
399 |
}
|
400 |
}
|
methods/class-wpadm-method-local-restore.php
CHANGED
@@ -25,7 +25,7 @@ if (!class_exists('WPAdm_Method_Local_Restore')) {
|
|
25 |
if (file_exists($file_log)) {
|
26 |
unlink($file_log);
|
27 |
}
|
28 |
-
WPAdm_Core::log('Create Unique Id '. $this->id);
|
29 |
if (count($this->files_resotre) > 0) {
|
30 |
$this->restore = true;
|
31 |
}
|
@@ -33,27 +33,42 @@ if (!class_exists('WPAdm_Method_Local_Restore')) {
|
|
33 |
}
|
34 |
private function getFiles()
|
35 |
{
|
|
|
36 |
if (isset($this->params['name_backup']) && !empty($this->params['name_backup'])) {
|
37 |
-
$
|
38 |
-
if (
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
}
|
50 |
-
return true;
|
51 |
}
|
52 |
-
|
53 |
-
|
54 |
-
$this->setError('Error: folder is not exist (' . $this->params['name_backup'] . ')');
|
55 |
return false;
|
56 |
-
|
57 |
}
|
58 |
private function setError($errors)
|
59 |
{
|
@@ -72,11 +87,9 @@ if (!class_exists('WPAdm_Method_Local_Restore')) {
|
|
72 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_SUCCESS);
|
73 |
$this->result->setError('');
|
74 |
|
75 |
-
WPAdm_Core::log('Start Restore process');
|
76 |
$n = count($this->md5_info);
|
77 |
-
|
78 |
-
|
79 |
-
}
|
80 |
if (in_array('files', $this->params['types']) ) {
|
81 |
foreach($this->files_resotre as $key => $file) {
|
82 |
if (file_exists($file)) {
|
@@ -108,16 +121,22 @@ if (!class_exists('WPAdm_Method_Local_Restore')) {
|
|
108 |
->add($commandContext)->save()
|
109 |
->execute();
|
110 |
unset($commandContext);
|
|
|
|
|
|
|
111 |
} else {
|
112 |
-
$
|
113 |
-
|
|
|
114 |
break;
|
115 |
}
|
116 |
}
|
117 |
}
|
118 |
}
|
119 |
} else {
|
120 |
-
WPAdm_Core::log(
|
|
|
|
|
121 |
}
|
122 |
return $this->result;
|
123 |
}
|
25 |
if (file_exists($file_log)) {
|
26 |
unlink($file_log);
|
27 |
}
|
28 |
+
WPAdm_Core::log(langWPADM::get('Create Unique Id ', false) . $this->id);
|
29 |
if (count($this->files_resotre) > 0) {
|
30 |
$this->restore = true;
|
31 |
}
|
33 |
}
|
34 |
private function getFiles()
|
35 |
{
|
36 |
+
$res = false;
|
37 |
if (isset($this->params['name_backup']) && !empty($this->params['name_backup'])) {
|
38 |
+
$res = self::readFiles( DROPBOX_BACKUP_DIR_BACKUP . '/' . $this->params['name_backup'] );
|
39 |
+
if ($res === false) {
|
40 |
+
$res = self::readFiles(WPADM_DIR_BACKUP . '/' . $this->params['name_backup']);
|
41 |
+
}
|
42 |
+
if ($res === false) {
|
43 |
+
$res = self::readFiles(ABSPATH . WPADM_DIR_NAME . '/' . $this->params['name_backup']);
|
44 |
+
}
|
45 |
+
}
|
46 |
+
if ($res === false) {
|
47 |
+
$str = langWPADM::get('Website "%d" returned an error during backup restoration: Archive of Backup wasn\'t found "%s"', false, array('%d', '%s'), array(SITE_HOME, $this->params['name_backup']) );
|
48 |
+
WPAdm_Core::log($str);
|
49 |
+
$this->setError($str);
|
50 |
+
}
|
51 |
+
return $res;
|
52 |
+
|
53 |
+
}
|
54 |
+
|
55 |
+
private function readFiles($dir_backup)
|
56 |
+
{
|
57 |
+
if (is_dir($dir_backup)) {
|
58 |
+
WPAdm_Core::log('Read of Backup Files for Restore (' . $this->params['name_backup'] . ')');
|
59 |
+
$dir_open = opendir($dir_backup);
|
60 |
+
while($d = readdir($dir_open)) {
|
61 |
+
if ($d != "." && $d != '..') {
|
62 |
+
if(strpos($d, ".md5") !== false) {
|
63 |
+
$this->md5_info = explode ("\n", file_get_contents( $dir_backup . "/$d" ) );
|
64 |
+
} elseif(strpos($d, ".zip") !== false) {
|
65 |
+
$this->files_resotre[$d] = $dir_backup . "/$d";
|
66 |
}
|
67 |
}
|
|
|
68 |
}
|
69 |
+
return true;
|
70 |
+
}
|
|
|
71 |
return false;
|
|
|
72 |
}
|
73 |
private function setError($errors)
|
74 |
{
|
87 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_SUCCESS);
|
88 |
$this->result->setError('');
|
89 |
|
90 |
+
WPAdm_Core::log(langWPADM::get('Start Restore process', false));
|
91 |
$n = count($this->md5_info);
|
92 |
+
|
|
|
|
|
93 |
if (in_array('files', $this->params['types']) ) {
|
94 |
foreach($this->files_resotre as $key => $file) {
|
95 |
if (file_exists($file)) {
|
121 |
->add($commandContext)->save()
|
122 |
->execute();
|
123 |
unset($commandContext);
|
124 |
+
if (file_exists(DROPBOX_BACKUP_DIR_BACKUP . "/mysqldump.sql")) {
|
125 |
+
@unlink(DROPBOX_BACKUP_DIR_BACKUP . "/mysqldump.sql");
|
126 |
+
}
|
127 |
} else {
|
128 |
+
$log = langWPADM::get('Website "%d" returned an error during backup restoration: Part Backup is not exist "%s" ', false, array('%d', '%s'), array(SITE_HOME, $data[2]) );
|
129 |
+
$this->setError($log);
|
130 |
+
WPAdm_Core::log($log);
|
131 |
break;
|
132 |
}
|
133 |
}
|
134 |
}
|
135 |
}
|
136 |
} else {
|
137 |
+
WPAdm_Core::log(
|
138 |
+
langWPADM::get('Website "%d" returned an error during restore backup: Files for restore is not exist, check permission your backup data or You can send to us support request using "Help" button on plugin page.', false, array('%d'), array(SITE_HOME) )
|
139 |
+
);
|
140 |
}
|
141 |
return $this->result;
|
142 |
}
|
methods/class-wpadm-method-queue-controller.php
CHANGED
@@ -46,7 +46,6 @@ if (!class_exists('WPAdm_Method_Queue_Controller')) {
|
|
46 |
private $id = '';
|
47 |
|
48 |
public function __construct($params) {
|
49 |
-
//WPAdm_Core::log("Запуск очереди. Параметры: " . print_r($params, true));
|
50 |
$this->stime = time();
|
51 |
parent::__construct($params);
|
52 |
$this->queue_file = WPAdm_Core::getTmpDir() . '/' . $this->params['id'] . '.queue';
|
@@ -54,9 +53,7 @@ if (!class_exists('WPAdm_Method_Queue_Controller')) {
|
|
54 |
$this->log("queue-file not exists: {$this->queue_file}");
|
55 |
exit;
|
56 |
}
|
57 |
-
//WPAdm_Core::log('Открываем файл очереди ' . $this->queue_file);
|
58 |
$queue = unserialize(file_get_contents($this->queue_file));
|
59 |
-
//WPAdm_Core::log(print_r($queue, true));
|
60 |
$this->id = $queue['id'];
|
61 |
$this->step = (isset($queue['step']) && (int)$queue['step'] > 1) ? (int)$queue['step']+1 : 1;
|
62 |
$this->contexts = $queue['contexts'];
|
@@ -65,27 +62,24 @@ if (!class_exists('WPAdm_Method_Queue_Controller')) {
|
|
65 |
|
66 |
public function getResult()
|
67 |
{
|
68 |
-
// пока время не закончилось и есть задачи - выполняем
|
69 |
while(!$this->timeIsOver() && $context = $this->getNextContext()) {
|
70 |
$com = $context->get('command');
|
71 |
$cmd = WPAdm_Command_Factory::getCommand($com);
|
72 |
if ($cmd === null) {
|
73 |
-
$this->result->setError('
|
74 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
75 |
array_unshift($this->contexts, $context);
|
76 |
$this->done();
|
77 |
return $this->result;
|
78 |
} elseif (!$cmd->execute($context)) {
|
79 |
-
$this->result->setError('
|
80 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
81 |
array_unshift($this->contexts, $context);
|
82 |
$this->done();
|
83 |
return $this->result;
|
84 |
} else {
|
85 |
-
|
86 |
-
//WPAdm_Core::log("Команда выполнена: {$com}");
|
87 |
}
|
88 |
-
//продолжаем работу
|
89 |
}
|
90 |
|
91 |
if ($this->step >= self::MAX_COUNT_STEPS) {
|
@@ -124,7 +118,6 @@ if (!class_exists('WPAdm_Method_Queue_Controller')) {
|
|
124 |
}
|
125 |
|
126 |
private function restart() {
|
127 |
-
$this->log('restart(' . $this->step .'): ' . $this->id);
|
128 |
$this->step ++;
|
129 |
$url = get_option('siteurl');
|
130 |
$pu = parse_url($url);
|
@@ -139,13 +132,9 @@ if (!class_exists('WPAdm_Method_Queue_Controller')) {
|
|
139 |
'sign' => '',
|
140 |
|
141 |
);
|
142 |
-
|
143 |
-
*
|
144 |
-
* request to itself to predict multitasking
|
145 |
-
*
|
146 |
-
*/
|
147 |
$socket = fsockopen($host, 80, $errno, $errstr, 30);
|
148 |
-
|
149 |
$dp = explode(DIRECTORY_SEPARATOR,dirname(dirname(__FILE__)));
|
150 |
$pl = array_pop($dp) . '_';
|
151 |
// $data = 'wpadm_'.$pl.'request='.base64_encode(serialize($data));
|
46 |
private $id = '';
|
47 |
|
48 |
public function __construct($params) {
|
|
|
49 |
$this->stime = time();
|
50 |
parent::__construct($params);
|
51 |
$this->queue_file = WPAdm_Core::getTmpDir() . '/' . $this->params['id'] . '.queue';
|
53 |
$this->log("queue-file not exists: {$this->queue_file}");
|
54 |
exit;
|
55 |
}
|
|
|
56 |
$queue = unserialize(file_get_contents($this->queue_file));
|
|
|
57 |
$this->id = $queue['id'];
|
58 |
$this->step = (isset($queue['step']) && (int)$queue['step'] > 1) ? (int)$queue['step']+1 : 1;
|
59 |
$this->contexts = $queue['contexts'];
|
62 |
|
63 |
public function getResult()
|
64 |
{
|
|
|
65 |
while(!$this->timeIsOver() && $context = $this->getNextContext()) {
|
66 |
$com = $context->get('command');
|
67 |
$cmd = WPAdm_Command_Factory::getCommand($com);
|
68 |
if ($cmd === null) {
|
69 |
+
$this->result->setError( langWPADM::get('Website "%d" returned an error: Command "%com" not found. To solve this problem, we need to access the system logs of your hosting/server and/or from your backup, that you tried to create or simply send to us your FTP access data. You can send to us support request using "Help" button on plugin page.', false, array('%d', '%com'), array(SITE_HOME, $com ) ) );
|
70 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
71 |
array_unshift($this->contexts, $context);
|
72 |
$this->done();
|
73 |
return $this->result;
|
74 |
} elseif (!$cmd->execute($context)) {
|
75 |
+
$this->result->setError( langWPADM::get('Website "%d" returned some unknown error during command "%com" was running. To solve this problem, we need to access the system logs of your hosting/server and/or from your backup, that you tried to create or simply send to us your FTP access data. You can send to us support request using "Help" button on plugin page.', false, array('%d', '%com'), array(SITE_HOME, $com ) ) );
|
76 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
77 |
array_unshift($this->contexts, $context);
|
78 |
$this->done();
|
79 |
return $this->result;
|
80 |
} else {
|
81 |
+
|
|
|
82 |
}
|
|
|
83 |
}
|
84 |
|
85 |
if ($this->step >= self::MAX_COUNT_STEPS) {
|
118 |
}
|
119 |
|
120 |
private function restart() {
|
|
|
121 |
$this->step ++;
|
122 |
$url = get_option('siteurl');
|
123 |
$pu = parse_url($url);
|
132 |
'sign' => '',
|
133 |
|
134 |
);
|
135 |
+
|
|
|
|
|
|
|
|
|
136 |
$socket = fsockopen($host, 80, $errno, $errstr, 30);
|
137 |
+
// $pl = (defined('WPADM_PLUGIN')) ? WPADM_PLUGIN . '_' : '';
|
138 |
$dp = explode(DIRECTORY_SEPARATOR,dirname(dirname(__FILE__)));
|
139 |
$pl = array_pop($dp) . '_';
|
140 |
// $data = 'wpadm_'.$pl.'request='.base64_encode(serialize($data));
|
methods/class-wpadm-method-send-to-dropbox.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
if (!class_exists('WPadm_Method_Send_To_Dropbox')) {
|
7 |
class WPadm_Method_Send_To_Dropbox extends WPAdm_Method_Class {
|
8 |
/**
|
9 |
-
|
10 |
-
|
11 |
private $queue;
|
12 |
|
13 |
private $id;
|
@@ -21,44 +21,86 @@ if (!class_exists('WPadm_Method_Send_To_Dropbox')) {
|
|
21 |
|
22 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_SUCCESS);
|
23 |
$this->result->setError('');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
$this->queue = new WPAdm_Queue($this->id);
|
26 |
|
27 |
$ad = $this->params['access_details'];
|
28 |
-
WPAdm_Core::log('Copying of Files to Dropbox');
|
29 |
$this->queue->clear();
|
30 |
$files = $this->params['files'];
|
31 |
//$this->getResult()->setData($files);
|
32 |
|
33 |
$dir = (isset($ad['dir'])) ? $ad['dir'] : '/';
|
34 |
-
|
35 |
-
|
36 |
-
$
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
->addParam('key', $ad['key'])
|
39 |
->addParam('secret', $ad['secret'])
|
40 |
->addParam('token', $ad['token'])
|
41 |
-
->addParam('folder_project'
|
42 |
->addParam('folder', $dir)
|
43 |
->addParam('files', ABSPATH . $file);
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
-
$res
|
48 |
-
->
|
49 |
-
|
50 |
-
WPAdm_Core::log('Dropbox: ' . $this->queue->getError());
|
51 |
-
$errors[] = 'Dropbox: '.$this->queue->getError();
|
52 |
}
|
53 |
-
|
54 |
if (count($errors) > 0) {
|
55 |
$this->result->setError(implode("\n", $errors));
|
56 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
|
59 |
return $this->result;
|
60 |
-
|
61 |
-
|
62 |
}
|
63 |
|
64 |
private function init(array $conf) {
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Бэкап сайта
|
4 |
+
* Class WPadm_Method_Send_To_Dropbox
|
5 |
+
*/
|
6 |
if (!class_exists('WPadm_Method_Send_To_Dropbox')) {
|
7 |
class WPadm_Method_Send_To_Dropbox extends WPAdm_Method_Class {
|
8 |
/**
|
9 |
+
* @var WPAdm_Queue
|
10 |
+
*/
|
11 |
private $queue;
|
12 |
|
13 |
private $id;
|
21 |
|
22 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_SUCCESS);
|
23 |
$this->result->setError('');
|
24 |
+
if (isset($this->params['local']) && $this->params['local']) {
|
25 |
+
$params_data_cron = WPAdm_Running::getCommandResultData('local_backup');
|
26 |
+
$this->params['files'] = $params_data_cron['data'];
|
27 |
+
$this->params['access_details']['dir'] = $params_data_cron['name'];
|
28 |
+
WPAdm_Core::log( langWPADM::get('' , false) );
|
29 |
+
}
|
30 |
+
|
31 |
|
32 |
$this->queue = new WPAdm_Queue($this->id);
|
33 |
|
34 |
$ad = $this->params['access_details'];
|
|
|
35 |
$this->queue->clear();
|
36 |
$files = $this->params['files'];
|
37 |
//$this->getResult()->setData($files);
|
38 |
|
39 |
$dir = (isset($ad['dir'])) ? $ad['dir'] : '/';
|
40 |
+
//$dir = trim($dir, '/') . '/' . $this->name;
|
41 |
+
if (is_array($files)) {
|
42 |
+
$send = false;
|
43 |
+
|
44 |
+
foreach($files as $file) {
|
45 |
+
if (isset($this->params['local']) && $this->params['local']) {
|
46 |
+
$data_command = WPAdm_Running::getCommandResultData('command_dropbox');
|
47 |
+
$data_error_command = WPAdm_Running::getCommandResultData('errors_sending');
|
48 |
+
if (isset($data_error_command[ABSPATH . $file]) && $data_error_command[ABSPATH . $file]['count'] > WPADM_COUNT_LIMIT_SEND_TO_DROPBOX) {
|
49 |
+
$msg = langWPADM::get('Not perhaps sending file: "%file%". If you wish make upload file, increase execution time code or speed internet provider is small for upload file.' , false, '%file%', $file);
|
50 |
+
WPAdm_Core::log( $msg );
|
51 |
+
$errors[] = $msg;
|
52 |
+
break;
|
53 |
+
}
|
54 |
+
if ( !empty($data_command) && in_array(ABSPATH . $file, $data_command) ) {
|
55 |
+
continue;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
$commandContext = new WPAdm_Command_Context();
|
59 |
+
$commandContext->addParam('command', 'send_to_dropbox')
|
60 |
->addParam('key', $ad['key'])
|
61 |
->addParam('secret', $ad['secret'])
|
62 |
->addParam('token', $ad['token'])
|
63 |
+
->addParam('folder_project', $ad['folder'])
|
64 |
->addParam('folder', $dir)
|
65 |
->addParam('files', ABSPATH . $file);
|
66 |
+
if (isset($this->params['local']) && $this->params['local']) {
|
67 |
+
$commandContext->addParam('local', true);
|
68 |
+
}
|
69 |
+
$this->queue->add($commandContext);
|
70 |
+
unset($commandContext);
|
71 |
+
$send = true;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
if ($send) {
|
75 |
+
WPAdm_Core::log( langWPADM::get('Start copy to Dropbox Cloud' , false) );
|
76 |
+
$res = $this->queue->save()->execute();
|
77 |
+
WPAdm_Core::log( langWPADM::get('End Copy Files to Dropbox' , false) );
|
78 |
}
|
79 |
+
if (isset($res) && !$res) {
|
80 |
+
WPAdm_Core::log(langWPADM::get('Answer from Dropbox ' , false) . $this->queue->getError());
|
81 |
+
$errors[] = langWPADM::get('Answer from Dropbox ' , false) . $this->queue->getError();
|
|
|
|
|
82 |
}
|
83 |
+
|
84 |
if (count($errors) > 0) {
|
85 |
$this->result->setError(implode("\n", $errors));
|
86 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_ERROR);
|
87 |
+
} else {
|
88 |
+
if (class_exists('wpadm_wp_full_backup_dropbox') && !file_exists( WPAdm_Core::getTmpDir() . "/notice-star") ) {
|
89 |
+
wpadm_wp_full_backup_dropbox::setFlagToTmp( 'notice-star', time() . "_1d" );
|
90 |
+
}
|
91 |
+
if (isset($this->params['local']) && $this->params['local'] && isset($params_data_cron)) {
|
92 |
+
$this->result->setData($this->params['files']);
|
93 |
+
$this->result->setSize($params_data_cron['size']);
|
94 |
+
$this->result->setValue('md5_data', md5 ( print_r($this->result->toArray(), 1 ) ) );
|
95 |
+
$this->result->setValue('name', $params_data_cron['name']);
|
96 |
+
$this->result->setValue('time', $params_data_cron['time']);
|
97 |
+
$this->result->setValue('type', 'dropbox');
|
98 |
+
$this->result->setValue('counts', $params_data_cron['counts'] );
|
99 |
+
WPAdm_Core::rmdir( DROPBOX_BACKUP_DIR_BACKUP . "/{$params_data_cron['name']}");
|
100 |
+
}
|
101 |
}
|
102 |
|
103 |
return $this->result;
|
|
|
|
|
104 |
}
|
105 |
|
106 |
private function init(array $conf) {
|
methods/class-wpadm-method-update.php
CHANGED
@@ -13,10 +13,10 @@ if (!class_exists('WPAdm_Method_Update')) {
|
|
13 |
$n = count($this->params['files']);
|
14 |
for($i = 0; $i < $n; $i++) {
|
15 |
if ( ( $f = $this->dl($this->params['files'][$i]) ) === false ) {
|
16 |
-
$error[] = 'Error to copy file ' . $this->params['files'][$i]['file'];
|
17 |
} else {
|
18 |
if ( is_string($f) && $this->unpack($f, $this->params['files'][$i]['to']) === false ) {
|
19 |
-
$error[] = 'Error to extract file ' . $f;
|
20 |
}
|
21 |
if (file_exists($f)) {
|
22 |
unlink($f);
|
@@ -56,8 +56,9 @@ if (!class_exists('WPAdm_Method_Update')) {
|
|
56 |
$b = $file['to'];
|
57 |
}
|
58 |
if (!empty($d_)) {
|
59 |
-
|
60 |
$f = wp_remote_get($file['file'], array('headers' => $headers));
|
|
|
61 |
if (isset($f['body']) && !empty($f['body'])) {
|
62 |
file_put_contents($d_ . "/" . $b, $f['body']);
|
63 |
if (file_exists($d_ . "/" . $b)) {
|
@@ -83,10 +84,10 @@ if (!class_exists('WPAdm_Method_Update')) {
|
|
83 |
PCLZIP_OPT_REPLACE_NEWER,
|
84 |
PCLZIP_OPT_REMOVE_PATH, WPAdm_Core::$plugin_name
|
85 |
);
|
|
|
86 |
if ( $res ) {
|
87 |
return true;
|
88 |
}
|
89 |
-
WPAdm_Core::log($this->archive->errorInfo(true));
|
90 |
return false;
|
91 |
}
|
92 |
}
|
13 |
$n = count($this->params['files']);
|
14 |
for($i = 0; $i < $n; $i++) {
|
15 |
if ( ( $f = $this->dl($this->params['files'][$i]) ) === false ) {
|
16 |
+
$error[] = langWPADM::get('Error to copy file ' , false) . $this->params['files'][$i]['file'];
|
17 |
} else {
|
18 |
if ( is_string($f) && $this->unpack($f, $this->params['files'][$i]['to']) === false ) {
|
19 |
+
$error[] = langWPADM::get('Error to extract file ' , false) . $f;
|
20 |
}
|
21 |
if (file_exists($f)) {
|
22 |
unlink($f);
|
56 |
$b = $file['to'];
|
57 |
}
|
58 |
if (!empty($d_)) {
|
59 |
+
//$headers = array( 'Authorization' => 'Basic ' . base64_encode( "admin24:admin24" ) );
|
60 |
$f = wp_remote_get($file['file'], array('headers' => $headers));
|
61 |
+
WPAdm_Core::log(serialize($f));
|
62 |
if (isset($f['body']) && !empty($f['body'])) {
|
63 |
file_put_contents($d_ . "/" . $b, $f['body']);
|
64 |
if (file_exists($d_ . "/" . $b)) {
|
84 |
PCLZIP_OPT_REPLACE_NEWER,
|
85 |
PCLZIP_OPT_REMOVE_PATH, WPAdm_Core::$plugin_name
|
86 |
);
|
87 |
+
WPAdm_Core::log($this->archive->errorInfo(true));
|
88 |
if ( $res ) {
|
89 |
return true;
|
90 |
}
|
|
|
91 |
return false;
|
92 |
}
|
93 |
}
|
modules/class-wpadm-archive.php
CHANGED
@@ -1,42 +1,50 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
$this->
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
1 |
+
<?php
|
2 |
+
if ( !class_exists("PclZip") ) {
|
3 |
+
require_once dirname(__FILE__) . '/pclzip.lib.php';
|
4 |
+
}
|
5 |
+
if (!class_exists('WPAdm_Archive')) {
|
6 |
+
class WPAdm_Archive {
|
7 |
+
private $remove_path = '';
|
8 |
+
private $files = array();
|
9 |
+
/**
|
10 |
+
* @var PclZip
|
11 |
+
*/
|
12 |
+
private $archive;
|
13 |
+
private $md5_file = '';
|
14 |
+
|
15 |
+
public function __construct($file, $md5_file = '') {
|
16 |
+
$this->archive = new PclZip($file);
|
17 |
+
$this->files[] = $file;
|
18 |
+
$this->md5_file = $md5_file;
|
19 |
+
}
|
20 |
+
|
21 |
+
public function add($file)
|
22 |
+
{
|
23 |
+
$this->packed($file);
|
24 |
+
}
|
25 |
+
public function packed($file)
|
26 |
+
{
|
27 |
+
ini_set("memory_limit", "256M");
|
28 |
+
if (empty($this->remove_path)) {
|
29 |
+
$this->archive->add($file);
|
30 |
+
} else {
|
31 |
+
$this->archive->add($file, PCLZIP_OPT_REMOVE_PATH, $this->remove_path);
|
32 |
+
}
|
33 |
+
$this->saveMd5($file);
|
34 |
+
}
|
35 |
+
|
36 |
+
protected function saveMd5($file) {
|
37 |
+
if ($this->md5_file) {
|
38 |
+
$files = explode(',', $file); {
|
39 |
+
foreach($files as $f) {
|
40 |
+
file_put_contents($this->md5_file, $f . "\t" . @md5_file($f) . "\t" . basename($this->archive->zipname) . "\n", FILE_APPEND);
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
public function setRemovePath($remove_path) {
|
47 |
+
$this->remove_path = $remove_path;
|
48 |
+
}
|
49 |
+
}
|
50 |
}
|
modules/class-wpadm-command-context.php
CHANGED
@@ -1,28 +1,32 @@
|
|
1 |
-
<?php
|
2 |
-
if (!class_exists('WPAdm_Command_Context')) {
|
3 |
-
class WPAdm_Command_Context {
|
4 |
-
private $params = array();
|
5 |
-
private $error = '';
|
6 |
-
|
7 |
-
public function addParam($key, $val)
|
8 |
-
{
|
9 |
-
$this->params[$key] = $val;
|
10 |
-
return $this;
|
11 |
-
}
|
12 |
-
|
13 |
-
public function get($key)
|
14 |
-
{
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
return $this
|
26 |
-
}
|
27 |
-
|
|
|
|
|
|
|
|
|
28 |
}
|
1 |
+
<?php
|
2 |
+
if (!class_exists('WPAdm_Command_Context')) {
|
3 |
+
class WPAdm_Command_Context {
|
4 |
+
private $params = array();
|
5 |
+
private $error = '';
|
6 |
+
|
7 |
+
public function addParam($key, $val)
|
8 |
+
{
|
9 |
+
$this->params[$key] = $val;
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
public function get($key)
|
14 |
+
{
|
15 |
+
if (isset($this->params[$key])) {
|
16 |
+
return $this->params[$key];
|
17 |
+
} else {
|
18 |
+
return false;
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
public function setError($error)
|
23 |
+
{
|
24 |
+
$this->error = $error;
|
25 |
+
return $this;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getError() {
|
29 |
+
return $this->error;
|
30 |
+
}
|
31 |
+
}
|
32 |
}
|
class-wpadm-command.php → modules/class-wpadm-command.php
RENAMED
@@ -1,14 +1,14 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Class WPAdm_Сommand
|
4 |
-
*/
|
5 |
-
if (!class_exists('WPAdm_Сommand')) {
|
6 |
-
abstract class WPAdm_Сommand {
|
7 |
-
/**
|
8 |
-
* @param WPAdm_Command_Context $context
|
9 |
-
* @return boolean
|
10 |
-
*/
|
11 |
-
abstract function execute(WPAdm_Command_Context $context);
|
12 |
-
|
13 |
-
}
|
14 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class WPAdm_Сommand
|
4 |
+
*/
|
5 |
+
if (!class_exists('WPAdm_Сommand')) {
|
6 |
+
abstract class WPAdm_Сommand {
|
7 |
+
/**
|
8 |
+
* @param WPAdm_Command_Context $context
|
9 |
+
* @return boolean
|
10 |
+
*/
|
11 |
+
abstract function execute(WPAdm_Command_Context $context);
|
12 |
+
|
13 |
+
}
|
14 |
}
|
class-wpadm-core.php → modules/class-wpadm-core.php
RENAMED
@@ -1,38 +1,48 @@
|
|
1 |
<?php
|
2 |
-
require_once
|
3 |
-
require_once
|
4 |
-
require_once
|
5 |
-
require_once
|
6 |
-
require_once
|
|
|
7 |
|
8 |
|
9 |
if (!class_exists('WPAdm_Core')) {
|
10 |
class WPAdm_Core {
|
11 |
|
12 |
/*
|
13 |
-
*
|
14 |
* @var array
|
15 |
*/
|
16 |
private $request = array();
|
17 |
|
18 |
/*
|
19 |
-
*
|
20 |
* @var string
|
21 |
*/
|
22 |
private $pub_key;
|
23 |
|
24 |
/*
|
25 |
-
*
|
26 |
* @var WPAdm_Result
|
27 |
*/
|
28 |
private $result;
|
29 |
|
30 |
private $plugin;
|
31 |
|
|
|
|
|
|
|
|
|
|
|
32 |
public static $pl_dir;
|
33 |
|
|
|
|
|
34 |
public static $plugin_name;
|
35 |
|
|
|
|
|
36 |
|
37 |
public function __construct(array $request, $plugin = '', $plugin_dir = '') {
|
38 |
$this->result = new WPAdm_Result();
|
@@ -41,22 +51,26 @@ if (!class_exists('WPAdm_Core')) {
|
|
41 |
$this->plugin = $plugin;
|
42 |
self::$pl_dir = $plugin_dir;
|
43 |
self::$plugin_name = $plugin;
|
44 |
-
//
|
45 |
if (!$this->auth()) {
|
46 |
return;
|
47 |
-
}
|
48 |
if ('connect' == $request['method']) {
|
49 |
$this->connect();
|
50 |
} elseif ('local' == $request['method']){
|
51 |
|
52 |
} elseif($obj = $this->getObject($request['method'], $request['params'])) {
|
53 |
-
if (
|
54 |
-
$this->
|
55 |
-
}
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
-
$this->result = $obj->getResult();
|
60 |
} else {
|
61 |
$this->result->setError('Unknown method "' . $request['method'] . '"');
|
62 |
}
|
@@ -64,7 +78,7 @@ if (!class_exists('WPAdm_Core')) {
|
|
64 |
|
65 |
|
66 |
/**
|
67 |
-
*
|
68 |
* @return string
|
69 |
*/
|
70 |
static public function getTmpDir() {
|
@@ -76,10 +90,6 @@ if (!class_exists('WPAdm_Core')) {
|
|
76 |
return $tmp_dir;
|
77 |
}
|
78 |
|
79 |
-
/**
|
80 |
-
* Возвращает путь до папки временных файлов
|
81 |
-
* @return string
|
82 |
-
*/
|
83 |
static public function getPluginDir() {
|
84 |
return self::$pl_dir;
|
85 |
}
|
@@ -90,13 +100,11 @@ if (!class_exists('WPAdm_Core')) {
|
|
90 |
* @return null|WPAdm_Method_Class
|
91 |
*/
|
92 |
private function getObject($method, $params) {
|
93 |
-
if (!preg_match("|[a-zA-Z0-9_]|", $method)) {
|
94 |
return null;
|
95 |
}
|
96 |
-
$method = mb_strtolower($method);
|
97 |
-
|
98 |
$class_file = self::$pl_dir . "/methods/class-wpadm-method-" . str_replace('_', '-', $method) . ".php";
|
99 |
-
|
100 |
if (file_exists($class_file)) {
|
101 |
require_once $class_file;
|
102 |
$tmp = explode('_', str_replace('-', '_', $method));
|
@@ -111,12 +119,21 @@ if (!class_exists('WPAdm_Core')) {
|
|
111 |
$this->getResult()->setResult(WPAdm_result::WPADM_RESULT_ERROR);
|
112 |
return null;
|
113 |
}
|
114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
}
|
116 |
return null;
|
117 |
|
118 |
}
|
119 |
|
|
|
120 |
public static function getLog()
|
121 |
{
|
122 |
$file_log = self::getTmpDir() . '/log.log';
|
@@ -127,23 +144,23 @@ if (!class_exists('WPAdm_Core')) {
|
|
127 |
}
|
128 |
|
129 |
private function connect() {
|
130 |
-
|
131 |
add_option('wpadm_pub_key', $this->pub_key);
|
132 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_SUCCESS);
|
133 |
-
|
134 |
$sendData['system_data'] = get_system_data();
|
135 |
$data['actApi'] = 'setStats';
|
136 |
$data['site'] = get_option('siteurl');
|
137 |
$data['data'] = wpadm_pack($sendData);
|
138 |
if (!class_exists('WP_Http')) {
|
139 |
-
include_once ABSPATH.WPINC.'/class-http.php';
|
140 |
}
|
141 |
|
142 |
$remote = array();
|
143 |
$remote['body'] = $data;
|
144 |
$remote['timeout'] = 20;
|
145 |
|
146 |
-
$result = wp_remote_post(WPADM_URL_BASE, $remote);
|
147 |
}
|
148 |
public static function setPluginDIr($dir)
|
149 |
{
|
@@ -155,14 +172,16 @@ if (!class_exists('WPAdm_Core')) {
|
|
155 |
*/
|
156 |
private function auth() {
|
157 |
$this->pub_key = get_option('wpadm_pub_key');
|
158 |
-
|
|
|
159 |
return true;
|
160 |
}
|
|
|
161 |
if (empty($this->pub_key)) {
|
162 |
if ('connect' == $this->request['method']) {
|
163 |
$this->pub_key = $this->request['params']['pub_key'];
|
164 |
} else {
|
165 |
-
$this->getResult()->setError('
|
166 |
return false;
|
167 |
}
|
168 |
} elseif ('connect' == $this->request['method']) {
|
@@ -195,10 +214,18 @@ if (!class_exists('WPAdm_Core')) {
|
|
195 |
*/
|
196 |
static public function mkdir($dir) {
|
197 |
if(!file_exists($dir)) {
|
198 |
-
mkdir($dir, 0755);
|
199 |
-
|
200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
}
|
|
|
202 |
}
|
203 |
|
204 |
/**
|
@@ -236,8 +263,10 @@ if (!class_exists('WPAdm_Core')) {
|
|
236 |
|
237 |
|
238 |
static public function log($txt, $class='') {
|
239 |
-
|
240 |
-
|
|
|
|
|
241 |
}
|
242 |
|
243 |
/**
|
@@ -254,10 +283,27 @@ if (!class_exists('WPAdm_Core')) {
|
|
254 |
if (is_dir($f)) {
|
255 |
self::rmdir($f);
|
256 |
}
|
257 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
}
|
259 |
-
|
260 |
}
|
|
|
261 |
}
|
262 |
}
|
263 |
}
|
1 |
<?php
|
2 |
+
require_once DRBBACKUP_BASE_DIR . '/modules/class-wpadm-result.php';
|
3 |
+
require_once DRBBACKUP_BASE_DIR . '/modules/class-wpadm-command.php';
|
4 |
+
require_once DRBBACKUP_BASE_DIR . '/modules/class-wpadm-command-context.php';
|
5 |
+
require_once DRBBACKUP_BASE_DIR . '/modules/class-wpadm-queue.php';
|
6 |
+
require_once DRBBACKUP_BASE_DIR . '/modules/class-wpadm-running.php';
|
7 |
+
require_once DRBBACKUP_BASE_DIR . '/modules/class-wpadm-command-factory.php';
|
8 |
|
9 |
|
10 |
if (!class_exists('WPAdm_Core')) {
|
11 |
class WPAdm_Core {
|
12 |
|
13 |
/*
|
14 |
+
* "fly" POST from server
|
15 |
* @var array
|
16 |
*/
|
17 |
private $request = array();
|
18 |
|
19 |
/*
|
20 |
+
* public key for auth
|
21 |
* @var string
|
22 |
*/
|
23 |
private $pub_key;
|
24 |
|
25 |
/*
|
26 |
+
* work result
|
27 |
* @var WPAdm_Result
|
28 |
*/
|
29 |
private $result;
|
30 |
|
31 |
private $plugin;
|
32 |
|
33 |
+
public $name = '',
|
34 |
+
$time = '';
|
35 |
+
|
36 |
+
public static $cron = true;
|
37 |
+
|
38 |
public static $pl_dir;
|
39 |
|
40 |
+
public static $error = '';
|
41 |
+
|
42 |
public static $plugin_name;
|
43 |
|
44 |
+
private static $cron_method = array('local_backup', 'send_to_dropbox', 'full_backup_dropbox');
|
45 |
+
|
46 |
|
47 |
public function __construct(array $request, $plugin = '', $plugin_dir = '') {
|
48 |
$this->result = new WPAdm_Result();
|
51 |
$this->plugin = $plugin;
|
52 |
self::$pl_dir = $plugin_dir;
|
53 |
self::$plugin_name = $plugin;
|
54 |
+
// auth request
|
55 |
if (!$this->auth()) {
|
56 |
return;
|
57 |
+
}
|
58 |
if ('connect' == $request['method']) {
|
59 |
$this->connect();
|
60 |
} elseif ('local' == $request['method']){
|
61 |
|
62 |
} elseif($obj = $this->getObject($request['method'], $request['params'])) {
|
63 |
+
if (!is_null($obj) && !is_bool($obj) && $obj->isError()) {
|
64 |
+
$this->result = $obj->get_results();
|
65 |
+
} elseif(!is_null($obj) && !is_bool($obj)) {
|
66 |
+
if (isset($obj->name)) {
|
67 |
+
$this->name = $obj->name;
|
68 |
+
}
|
69 |
+
if (isset($obj->time)) {
|
70 |
+
$this->time = $obj->time;
|
71 |
+
}
|
72 |
+
$this->result = $obj->getResult();
|
73 |
}
|
|
|
74 |
} else {
|
75 |
$this->result->setError('Unknown method "' . $request['method'] . '"');
|
76 |
}
|
78 |
|
79 |
|
80 |
/**
|
81 |
+
* return path to tmp dir
|
82 |
* @return string
|
83 |
*/
|
84 |
static public function getTmpDir() {
|
90 |
return $tmp_dir;
|
91 |
}
|
92 |
|
|
|
|
|
|
|
|
|
93 |
static public function getPluginDir() {
|
94 |
return self::$pl_dir;
|
95 |
}
|
100 |
* @return null|WPAdm_Method_Class
|
101 |
*/
|
102 |
private function getObject($method, $params) {
|
103 |
+
if (!preg_match("|[a-zA-Z0-9_\-]|", $method)) {
|
104 |
return null;
|
105 |
}
|
106 |
+
$method = mb_strtolower($method);
|
|
|
107 |
$class_file = self::$pl_dir . "/methods/class-wpadm-method-" . str_replace('_', '-', $method) . ".php";
|
|
|
108 |
if (file_exists($class_file)) {
|
109 |
require_once $class_file;
|
110 |
$tmp = explode('_', str_replace('-', '_', $method));
|
119 |
$this->getResult()->setResult(WPAdm_result::WPADM_RESULT_ERROR);
|
120 |
return null;
|
121 |
}
|
122 |
+
if (in_array( strtolower( $method ), self::$cron_method) && self::$cron) {
|
123 |
+
WPAdm_Running::setCommand( strtolower($this->request['method']), $params );
|
124 |
+
WPAdm_Running::run();
|
125 |
+
self::$cron = true;
|
126 |
+
return true;
|
127 |
+
} else {
|
128 |
+
return new $class_name($params);
|
129 |
+
}
|
130 |
+
|
131 |
}
|
132 |
return null;
|
133 |
|
134 |
}
|
135 |
|
136 |
+
|
137 |
public static function getLog()
|
138 |
{
|
139 |
$file_log = self::getTmpDir() . '/log.log';
|
144 |
}
|
145 |
|
146 |
private function connect() {
|
147 |
+
|
148 |
add_option('wpadm_pub_key', $this->pub_key);
|
149 |
$this->result->setResult(WPAdm_Result::WPADM_RESULT_SUCCESS);
|
150 |
+
|
151 |
$sendData['system_data'] = get_system_data();
|
152 |
$data['actApi'] = 'setStats';
|
153 |
$data['site'] = get_option('siteurl');
|
154 |
$data['data'] = wpadm_pack($sendData);
|
155 |
if (!class_exists('WP_Http')) {
|
156 |
+
include_once ABSPATH . WPINC . '/class-http.php';
|
157 |
}
|
158 |
|
159 |
$remote = array();
|
160 |
$remote['body'] = $data;
|
161 |
$remote['timeout'] = 20;
|
162 |
|
163 |
+
$result = wp_remote_post(WPADM_URL_BASE . "/api/", $remote);
|
164 |
}
|
165 |
public static function setPluginDIr($dir)
|
166 |
{
|
172 |
*/
|
173 |
private function auth() {
|
174 |
$this->pub_key = get_option('wpadm_pub_key');
|
175 |
+
$methods_local = array('local_backup', 'send-to-dropbox', 'local_restore', 'local', 'queue_controller', 'local_send_to_s3');
|
176 |
+
if ( in_array($this->request['method'], $methods_local) ) {
|
177 |
return true;
|
178 |
}
|
179 |
+
self::log($this->request['method']);
|
180 |
if (empty($this->pub_key)) {
|
181 |
if ('connect' == $this->request['method']) {
|
182 |
$this->pub_key = $this->request['params']['pub_key'];
|
183 |
} else {
|
184 |
+
$this->getResult()->setError('Activate site in WPAdm.com for work to plugins.');
|
185 |
return false;
|
186 |
}
|
187 |
} elseif ('connect' == $this->request['method']) {
|
214 |
*/
|
215 |
static public function mkdir($dir) {
|
216 |
if(!file_exists($dir)) {
|
217 |
+
@mkdir($dir, 0755);
|
218 |
+
if (!is_dir($dir)) {
|
219 |
+
self::$error = str_replace("&s", $dir, langWPADM::get('Failed to create a file, please check the permissions on the folders "&s".', false) );
|
220 |
+
} else {
|
221 |
+
//todo: права доступа
|
222 |
+
@file_put_contents($dir . '/index.php', '<?php echo "Hello World!"; ');
|
223 |
+
if ( !is_writable($dir . '/index.php') ) {
|
224 |
+
self::$error = str_replace("&s", $dir, langWPADM::get('Failed to create a file, please check the permissions on the folders "&s".', false) );
|
225 |
+
}
|
226 |
+
}
|
227 |
}
|
228 |
+
return self::$error;
|
229 |
}
|
230 |
|
231 |
/**
|
263 |
|
264 |
|
265 |
static public function log($txt, $class='') {
|
266 |
+
if (!empty($txt)) {
|
267 |
+
$log_file = self::getTmpDir() . '/log.log';
|
268 |
+
file_put_contents($log_file, date("Y-m-d H:i:s") ."\t{$class}\t{$txt}\n", FILE_APPEND);
|
269 |
+
}
|
270 |
}
|
271 |
|
272 |
/**
|
283 |
if (is_dir($f)) {
|
284 |
self::rmdir($f);
|
285 |
}
|
286 |
+
if (file_exists($f)) {
|
287 |
+
@unlink($f);
|
288 |
+
}
|
289 |
+
}
|
290 |
+
@rmdir($dir);
|
291 |
+
} elseif (is_file($dir)) {
|
292 |
+
@unlink($dir);
|
293 |
+
}
|
294 |
+
}
|
295 |
+
static function dir_writeble($dir)
|
296 |
+
{
|
297 |
+
$error = self::mkdir($dir);
|
298 |
+
$ret = true;
|
299 |
+
if (empty($dir)) {
|
300 |
+
@file_put_contents($dir . "/test", "Hello World!!!");
|
301 |
+
if (!@is_writable($dir . "/test") && @filesize($dir . "/test") == 0) {
|
302 |
+
$ret = false;
|
303 |
}
|
304 |
+
@unlink($dir . "/test");
|
305 |
}
|
306 |
+
return $ret;
|
307 |
}
|
308 |
}
|
309 |
}
|
modules/class-wpadm-method-class.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
if (!class_exists('WPAdm_Method_Class')) {
|
5 |
+
abstract class WPAdm_Method_Class {
|
6 |
+
/**
|
7 |
+
* @var mixed
|
8 |
+
*/
|
9 |
+
protected $params;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* @var WPAdm_result
|
13 |
+
*/
|
14 |
+
protected $result;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @param mixed $params
|
18 |
+
*/
|
19 |
+
public function __construct($params) {
|
20 |
+
$this->params = $params;
|
21 |
+
$this->result = new WPAdm_Result();
|
22 |
+
$this->result->setResult(WPAdm_Result::WPADM_RESULT_SUCCESS);
|
23 |
+
$this->result->setError('');
|
24 |
+
}
|
25 |
+
|
26 |
+
abstract function getResult();
|
27 |
+
|
28 |
+
public function isError()
|
29 |
+
{
|
30 |
+
$error = $this->result->getError();
|
31 |
+
return isset($this->result) && !empty( $error );
|
32 |
+
}
|
33 |
+
public function get_results()
|
34 |
+
{
|
35 |
+
return $this->result;
|
36 |
+
}
|
37 |
+
}
|
38 |
+
}
|
modules/class-wpadm-mysqldump.php
CHANGED
@@ -8,222 +8,212 @@ if (!class_exists('WPAdm_Mysqldump')) {
|
|
8 |
public $host = '';
|
9 |
public $user = '';
|
10 |
public $password = '';
|
11 |
-
public $dbh ;
|
|
|
12 |
|
13 |
private function connect($db = '') {
|
14 |
WPAdm_Core::log("----------------------------------------------------");
|
15 |
-
WPAdm_Core::log(
|
16 |
-
if (
|
17 |
-
|
18 |
-
}
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
-
$this->dbh
|
25 |
-
$this->init_charset($link);
|
26 |
-
$this->set_charset($link);
|
27 |
-
return $link;
|
28 |
-
|
29 |
}
|
30 |
|
31 |
-
public function
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
if (
|
39 |
-
|
40 |
} else {
|
41 |
-
$
|
42 |
-
|
43 |
-
$
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
-
|
47 |
}
|
48 |
}
|
49 |
-
|
|
|
50 |
{
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
-
} elseif ( defined( 'DB_COLLATE' ) ) {
|
59 |
-
$this->collate = DB_COLLATE;
|
60 |
-
}
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
65 |
|
66 |
-
if ( ( ! ( $link instanceof mysqli ) )
|
67 |
-
|| ( empty( $link ) || ! ( $link instanceof mysqli ) ) ) {
|
68 |
-
return;
|
69 |
-
}
|
70 |
|
71 |
-
|
72 |
-
|
73 |
-
|
|
|
|
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
case 'utf8mb4' : // @since 4.1.0
|
90 |
-
if ( version_compare( $version, '5.5.3', '<' ) ) {
|
91 |
-
return false;
|
92 |
-
}
|
93 |
-
$client_version = mysqli_get_client_info();
|
94 |
-
if ( false !== strpos( $client_version, 'mysqlnd' ) ) {
|
95 |
-
$client_version = preg_replace( '/^\D+([\d.]+).*/', '$1', $client_version );
|
96 |
-
return version_compare( $client_version, '5.0.9', '>=' );
|
97 |
-
} else {
|
98 |
-
return version_compare( $client_version, '5.5.3', '>=' );
|
99 |
}
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
$this->setError(mysqli_error($link));
|
154 |
-
};
|
155 |
-
while($row = mysqli_fetch_row($result))
|
156 |
-
{
|
157 |
-
$tables[] = $row[0];
|
158 |
-
}
|
159 |
-
|
160 |
-
//cycle through
|
161 |
-
|
162 |
-
$return = '';
|
163 |
-
$charset = mysqli_get_charset($link);
|
164 |
-
if (isset($charset->charset)) {
|
165 |
-
$return .= "SET NAMES '{$charset->charset}';\n\n";
|
166 |
-
WPAdm_Core::log("SET NAMES Database {$charset->charset};");
|
167 |
-
}
|
168 |
-
foreach($tables as $table)
|
169 |
-
{
|
170 |
-
WPAdm_Core::log("Add a table {$table} in the database dump");
|
171 |
-
mysqli_close($link);
|
172 |
-
$link = $this->connect($db);
|
173 |
-
if (!$result = mysqli_query($link, 'SELECT * FROM ' . $table)) {
|
174 |
-
$this->setError(mysqli_error($link));
|
175 |
-
};
|
176 |
-
$num_fields = mysqli_num_fields($result);
|
177 |
-
|
178 |
-
$return.= 'DROP TABLE '.$table.';';
|
179 |
-
if (!$ress = mysqli_query($link, 'SHOW CREATE TABLE ' . $table)) {
|
180 |
-
$this->setError(mysqli_error($link));
|
181 |
-
};
|
182 |
-
|
183 |
-
$row2 = mysqli_fetch_row($ress);
|
184 |
-
$return.= "\n\n".$row2[1].";\n\n";
|
185 |
-
|
186 |
-
for ($i = 0; $i < $num_fields; $i++)
|
187 |
-
{
|
188 |
-
while($row = mysqli_fetch_row($result))
|
189 |
-
{
|
190 |
-
$return.= 'INSERT INTO '.$table.' VALUES(';
|
191 |
-
for($j=0; $j<$num_fields; $j++)
|
192 |
-
{
|
193 |
-
//$row[$j] = mb_convert_encoding($row[$j], 'UTF-8', 'auto');
|
194 |
-
$row[$j] = addslashes($row[$j]);
|
195 |
-
$row[$j] = str_replace("\n","\\n",$row[$j]);
|
196 |
-
if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; }
|
197 |
-
if ($j<($num_fields-1)) { $return.= ','; }
|
198 |
}
|
199 |
-
|
|
|
|
|
|
|
200 |
}
|
201 |
}
|
202 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
}
|
204 |
-
|
205 |
-
mysqli_close($link);
|
206 |
-
$handle = fopen($filename,'w+');
|
207 |
-
fwrite($handle,$return);
|
208 |
-
fclose($handle);
|
209 |
-
WPAdm_Core::log("MySQL of Dump was finished");
|
210 |
-
return true;
|
211 |
}
|
212 |
|
213 |
private function setError($txt)
|
214 |
{
|
215 |
-
//WPAdm_Core::log($txt);
|
216 |
throw new Exception($txt);
|
217 |
}
|
218 |
|
219 |
public function restore($db, $file)
|
220 |
{
|
221 |
$link = $this->connect($db);
|
222 |
-
WPAdm_Core::log(
|
223 |
$fo = fopen($file, "r");
|
224 |
if (!$fo) {
|
225 |
-
WPAdm_Core::log(
|
226 |
-
$this->setError(
|
227 |
return false;
|
228 |
}
|
229 |
$sql = "";
|
@@ -234,17 +224,17 @@ if (!class_exists('WPAdm_Mysqldump')) {
|
|
234 |
if ($char_new !== false && $char_new != "\n") {
|
235 |
$sql .= $char_new;
|
236 |
} else {
|
237 |
-
$ress =
|
238 |
-
if (
|
239 |
-
$this->setError(
|
240 |
-
WPAdm_Core::log(
|
241 |
break;
|
242 |
};
|
243 |
$sql = "";
|
244 |
}
|
245 |
}
|
246 |
}
|
247 |
-
WPAdm_Core::log(
|
248 |
}
|
249 |
}
|
250 |
}
|
8 |
public $host = '';
|
9 |
public $user = '';
|
10 |
public $password = '';
|
11 |
+
public $dbh = null ;
|
12 |
+
public $rows = 1000;
|
13 |
|
14 |
private function connect($db = '') {
|
15 |
WPAdm_Core::log("----------------------------------------------------");
|
16 |
+
WPAdm_Core::log( langWPADM::get('Connecting to MySQL...' , false) );
|
17 |
+
if (! class_exists('wpdb')) {
|
18 |
+
require_once ABSPATH . '/' . WPINC . '/wp-db.php';
|
19 |
+
}
|
20 |
+
if ($this->dbh === null) {
|
21 |
+
global $wpdb;
|
22 |
+
if (is_object($wpdb)) {
|
23 |
+
$this->dbh = $wpdb;
|
24 |
+
} else {
|
25 |
+
$this->dbh = new wpdb( $this->user, $this->password, $db, $this->host );
|
26 |
+
$errors = $this->dbh->last_error;
|
27 |
+
if ($errors) {
|
28 |
+
$this->setError( langWPADM::get('MySQL Connect failed: ' , false) . $errors);
|
29 |
+
}
|
30 |
+
if (isset($this->dbh->error->errors) && count($this->dbh->error->errors) > 0 ) {
|
31 |
+
$error = '';
|
32 |
+
foreach($this->dbh->error->errors as $key => $err) {
|
33 |
+
if ($key === 'db_connect_fail') {
|
34 |
+
$error .= "Connect fail: Check the number of connections to the database or \n";
|
35 |
+
}
|
36 |
+
$error .= strip_tags( implode("\n", ($err) ) );
|
37 |
+
}
|
38 |
+
$this->setError( $error );
|
39 |
+
}
|
40 |
+
}
|
41 |
}
|
42 |
+
return $this->dbh;
|
|
|
|
|
|
|
|
|
43 |
}
|
44 |
|
45 |
+
public function optimize($db) {
|
46 |
+
$proc_data = WPAdm_Running::getCommandResultData('db');
|
47 |
+
if (!isset($proc_data['optimize'])) {
|
48 |
+
$link = $this->connect($db);
|
49 |
+
WPAdm_Core::log( langWPADM::get('Optimize Database Tables was started' , false) );
|
50 |
+
$n = $link->query('SHOW TABLES');
|
51 |
+
$result = $link->last_result;
|
52 |
+
if (!empty( $link->last_error ) && $n > 0) {
|
53 |
+
$this->setError($link->last_error);
|
54 |
} else {
|
55 |
+
for($i = 0; $i < $n; $i++ ) {
|
56 |
+
$res = array_values( get_object_vars( $result[$i] ) );
|
57 |
+
$proc_data = WPAdm_Running::getCommandResultData('db');
|
58 |
+
if (!isset($proc_data['optimize_table'][$res[0]])) {
|
59 |
+
$link->query('OPTIMIZE TABLE '. $res[0]);
|
60 |
+
if (!empty( $link->last_error ) ) {
|
61 |
+
$tables = isset($proc_data['optimize_table']) ? $proc_data['optimize_table'] : array();
|
62 |
+
$tables[$res[0]] = 1;
|
63 |
+
$proc_data['optimize_table'] = $tables;
|
64 |
+
WPAdm_Running::setCommandResultData('db', $proc_data);
|
65 |
+
$log = str_replace('%s', $res[0], langWPADM::get('Error to Optimize Table `%s`' , false) );
|
66 |
+
WPAdm_Core::log($log);
|
67 |
+
} else {
|
68 |
+
$log = str_replace('%s', $res[0], langWPADM::get('Optimize Table `%s` was successfully' , false) );
|
69 |
+
WPAdm_Core::log($log);
|
70 |
+
}
|
71 |
+
}
|
72 |
+
}
|
73 |
+
WPAdm_Core::log( langWPADM::get('Optimize Database Tables was Finished' , false) );
|
74 |
+
$proc_data = WPAdm_Running::getCommandResultData('db');
|
75 |
+
$proc_data['optimize'] = true;
|
76 |
+
WPAdm_Running::setCommandResultData('db', $proc_data);
|
77 |
}
|
|
|
78 |
}
|
79 |
}
|
80 |
+
|
81 |
+
public function mysqldump($db, $filename)
|
82 |
{
|
83 |
+
$proc_data = WPAdm_Running::getCommandResultData('db');
|
84 |
+
if (!isset($proc_data['mysqldump'])) {
|
85 |
+
$link = $this->connect($db);
|
86 |
+
WPAdm_Core::log( langWPADM::get('MySQL of Dump was started' , false) );
|
87 |
+
$tables = array();
|
88 |
+
$n = $link->query('SHOW TABLES');
|
89 |
+
$result = $link->last_result;
|
90 |
+
if (!empty( $link->last_error )) {
|
91 |
+
$this->setError($link->last_error);
|
92 |
+
return false;
|
93 |
+
}
|
94 |
+
if ($link->last_result === null) {
|
95 |
+
/* foreach($link->error->errors as $key => $errors) {
|
96 |
+
if ($key == db_connect_fail)
|
97 |
+
}*/
|
98 |
+
$this->setError(print_r(implode("\n", $link->error->errors), 1));
|
99 |
+
return false;
|
100 |
+
}
|
101 |
+
for($i = 0; $i < $n; $i++ ) {
|
102 |
+
$row = array_values( get_object_vars( $result[$i] ) );
|
103 |
+
$tables[] = $row[0];
|
104 |
}
|
|
|
|
|
|
|
105 |
|
106 |
+
foreach($tables as $table) {
|
107 |
+
$return = '';
|
108 |
+
$proc_data = WPAdm_Running::getCommandResultData('db');
|
109 |
+
if (!isset($proc_data['mysqldump_table'][$table])) {
|
110 |
|
|
|
|
|
|
|
|
|
111 |
|
112 |
+
$result = $link->last_result;
|
113 |
+
if (!empty( $link->last_error ) && $n > 0) {
|
114 |
+
$this->setError($link->last_error);
|
115 |
+
}
|
116 |
+
$return.= 'DROP TABLE IF EXISTS ' . $table . ';';
|
117 |
|
118 |
+
$ress = $link->query('SHOW CREATE TABLE ' . $table);
|
119 |
+
$result2 = $link->last_result;
|
120 |
+
if (!empty( $link->last_error ) && $n > 0) {
|
121 |
+
$this->setError($link->last_error);
|
122 |
+
}
|
123 |
+
$row2 = array_values( get_object_vars( $result2[0] ) );
|
124 |
+
$return.= "\n\n".$row2[1].";\n\n";
|
125 |
+
|
126 |
+
file_put_contents($filename, $return, FILE_APPEND);
|
127 |
+
$proc_data = WPAdm_Running::getCommandResultData('db');
|
128 |
+
$proc_data['mysqldump_table'][$table] = 1;
|
129 |
+
WPAdm_Running::setCommandResultData('db', $proc_data);
|
130 |
+
$log = str_replace('%s', $table, langWPADM::get('Add a table "%s" in the database dump' , false) );
|
131 |
+
WPAdm_Core::log( $log );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
}
|
133 |
+
$while = true;
|
134 |
+
while($while) {
|
135 |
+
$table_db = WPAdm_Running::getCommandResultData('tabledb');
|
136 |
+
if (isset($table_db[$table])) {
|
137 |
+
if (isset($table_db[$table]['work']) && $table_db[$table]['work'] == true) {
|
138 |
+
$from = $table_db[$table]['from']; // value from
|
139 |
+
$to = $table_db[$table]['to']; // value to
|
140 |
+
}
|
141 |
+
} else {
|
142 |
+
$from = 0;
|
143 |
+
$to = $this->rows;
|
144 |
+
}
|
145 |
+
if (isset($from) && !empty($to) && $from >= 0 && $to >= 0) {
|
146 |
+
$num_fields = $link->query( 'SELECT * FROM ' . $table . " LIMIT {$from}, {$to}" );
|
147 |
+
if ($num_fields > 0) {
|
148 |
+
|
149 |
+
$result2 = $link->last_result;
|
150 |
+
for ($i = 0; $i < $num_fields; $i++) {
|
151 |
+
$return = '';
|
152 |
+
$row = array_values( get_object_vars( $result2[$i] ) );
|
153 |
+
//WPAdm_Core::log('row' . print_r($row, 1));
|
154 |
+
$rows_num = count($row);
|
155 |
+
if ($rows_num > 0) {
|
156 |
+
$return.= 'INSERT INTO ' . $table . ' VALUES(';
|
157 |
+
for($j=0; $j < $rows_num; $j++) {
|
158 |
+
$row[$j] = addslashes($row[$j]);
|
159 |
+
$row[$j] = str_replace("\n","\\n",$row[$j]);
|
160 |
+
if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; }
|
161 |
+
if ($j<($rows_num-1)) { $return.= ','; }
|
162 |
+
}
|
163 |
+
$return .= ");\n";
|
164 |
+
file_put_contents($filename, $return, FILE_APPEND);
|
165 |
+
$from += 1;
|
166 |
+
$to += 1;
|
167 |
+
$table_db[$table]['from'] = $from;
|
168 |
+
$table_db[$table]['to'] = $to;
|
169 |
+
$table_db[$table]['work'] = true;
|
170 |
+
WPAdm_Running::setCommandResultData('tabledb', $table_db);
|
171 |
+
}
|
172 |
+
|
173 |
+
}
|
174 |
+
$log = str_replace(array('%s', '%from%', '%to%'), array($table, $from, $to), langWPADM::get('Add a table rows "%s" in the database dump from %from% to %to%' , false) );
|
175 |
+
WPAdm_Core::log( $log );
|
176 |
+
|
177 |
+
} else {
|
178 |
+
$while = false;
|
179 |
+
$table_db[$table]['work'] = false;
|
180 |
+
WPAdm_Running::setCommandResultData('tabledb', $table_db);
|
181 |
+
}
|
182 |
+
} else {
|
183 |
+
$while = false;
|
184 |
+
$table_db[$table]['work'] = false;
|
185 |
+
WPAdm_Running::setCommandResultData('tabledb', $table_db);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
}
|
187 |
+
}
|
188 |
+
if (!isset($proc_data['mysqldump_table'][$table])) {
|
189 |
+
$return ="\n\n\n";
|
190 |
+
file_put_contents($filename, $return, FILE_APPEND);
|
191 |
}
|
192 |
}
|
193 |
+
unset($link);
|
194 |
+
WPAdm_Core::log( langWPADM::get('MySQL of Dump was finished' , false) );
|
195 |
+
$proc_data = WPAdm_Running::getCommandResultData('db');
|
196 |
+
$proc_data['mysqldump'] = true;
|
197 |
+
WPAdm_Running::setCommandResultData('db', $proc_data);
|
198 |
+
return true;
|
199 |
+
} else {
|
200 |
+
return false;
|
201 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
}
|
203 |
|
204 |
private function setError($txt)
|
205 |
{
|
|
|
206 |
throw new Exception($txt);
|
207 |
}
|
208 |
|
209 |
public function restore($db, $file)
|
210 |
{
|
211 |
$link = $this->connect($db);
|
212 |
+
WPAdm_Core::log( langWPADM::get('Restore Database was started' , false) );
|
213 |
$fo = fopen($file, "r");
|
214 |
if (!$fo) {
|
215 |
+
WPAdm_Core::log( langWPADM::get('Error in open file dump' , false) );
|
216 |
+
$this->setError( langWPADM::get('Error in open file dump' , false) );
|
217 |
return false;
|
218 |
}
|
219 |
$sql = "";
|
224 |
if ($char_new !== false && $char_new != "\n") {
|
225 |
$sql .= $char_new;
|
226 |
} else {
|
227 |
+
$ress = $link->query($sql);
|
228 |
+
if (!empty( $link->last_error ) && $n > 0) {
|
229 |
+
$this->setError($link->last_error);
|
230 |
+
WPAdm_Core::log(langWPADM::get('MySQL Error: ' , false) . $link->last_error);
|
231 |
break;
|
232 |
};
|
233 |
$sql = "";
|
234 |
}
|
235 |
}
|
236 |
}
|
237 |
+
WPAdm_Core::log(langWPADM::get('Restore Database was finished' , false));
|
238 |
}
|
239 |
}
|
240 |
}
|
modules/class-wpadm-queue.php
CHANGED
@@ -39,6 +39,7 @@ if (!class_exists('WPAdm_Queue')) {
|
|
39 |
}
|
40 |
|
41 |
public function add(WPAdm_Command_Context $context) {
|
|
|
42 |
$this->contexts[] = $context;
|
43 |
return $this;
|
44 |
}
|
@@ -64,7 +65,6 @@ if (!class_exists('WPAdm_Queue')) {
|
|
64 |
$host = $pu['host'];
|
65 |
$path = isset($pu['path']) ? $pu['path'] . "/" : "/" ;
|
66 |
|
67 |
-
//WPAdm_Core::log('execute on host ' . $host);
|
68 |
$data = array(
|
69 |
'method' => 'queue_controller',
|
70 |
'params' => array(
|
@@ -118,21 +118,33 @@ if (!class_exists('WPAdm_Queue')) {
|
|
118 |
}
|
119 |
if (!file_exists($done_file)) {
|
120 |
$this->error = 'No result of the command';
|
121 |
-
return false;
|
122 |
} else {
|
123 |
$queue = unserialize(file_get_contents($done_file));
|
124 |
if (isset($queue['contexts'][0])) {
|
125 |
$this->error = $queue['contexts'][0]->getError();
|
126 |
-
return false;
|
127 |
}
|
128 |
}
|
129 |
if (file_exists($done_file)) {
|
130 |
unlink($done_file);
|
131 |
}
|
|
|
|
|
|
|
132 |
return true;
|
133 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
public function save() {
|
|
|
|
|
136 |
$file = WPAdm_Core::getTmpDir() . '/' . $this->id. '.queue';
|
137 |
$txt = serialize(
|
138 |
array(
|
39 |
}
|
40 |
|
41 |
public function add(WPAdm_Command_Context $context) {
|
42 |
+
ini_set("memory_limit", "256M");
|
43 |
$this->contexts[] = $context;
|
44 |
return $this;
|
45 |
}
|
65 |
$host = $pu['host'];
|
66 |
$path = isset($pu['path']) ? $pu['path'] . "/" : "/" ;
|
67 |
|
|
|
68 |
$data = array(
|
69 |
'method' => 'queue_controller',
|
70 |
'params' => array(
|
118 |
}
|
119 |
if (!file_exists($done_file)) {
|
120 |
$this->error = 'No result of the command';
|
|
|
121 |
} else {
|
122 |
$queue = unserialize(file_get_contents($done_file));
|
123 |
if (isset($queue['contexts'][0])) {
|
124 |
$this->error = $queue['contexts'][0]->getError();
|
|
|
125 |
}
|
126 |
}
|
127 |
if (file_exists($done_file)) {
|
128 |
unlink($done_file);
|
129 |
}
|
130 |
+
if (!empty($this->error) ) {
|
131 |
+
return false;
|
132 |
+
}
|
133 |
return true;
|
134 |
}
|
135 |
+
private function deleteCommands()
|
136 |
+
{
|
137 |
+
$files = glob(WPAdm_Core::getTmpDir() . "/wpadm_method_*");
|
138 |
+
if (!empty($files)) {
|
139 |
+
for($i = 0; $i < $n; $i++) {
|
140 |
+
WPAdm_Core::rmdir($files[$i]);
|
141 |
+
}
|
142 |
+
}
|
143 |
+
}
|
144 |
|
145 |
public function save() {
|
146 |
+
ini_set("memory_limit", "256M");
|
147 |
+
$this->deleteCommands();
|
148 |
$file = WPAdm_Core::getTmpDir() . '/' . $this->id. '.queue';
|
149 |
$txt = serialize(
|
150 |
array(
|
class-wpadm-result.php → modules/class-wpadm-result.php
RENAMED
@@ -1,117 +1,127 @@
|
|
1 |
-
<?php
|
2 |
-
if (!class_exists('WPAdm_Result')) {
|
3 |
-
class WPAdm_Result {
|
4 |
-
/*
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
private $result;
|
11 |
-
|
12 |
-
/*
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
private $error = '';
|
17 |
-
|
18 |
-
/*
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
private $data;
|
23 |
-
|
24 |
-
/*
|
25 |
-
|
26 |
-
|
27 |
-
private $size;
|
28 |
-
|
29 |
-
const WPADM_RESULT_SUCCESS = 'success';
|
30 |
-
const WPADM_RESULT_ERROR = 'error';
|
31 |
-
|
32 |
-
public function __construct() {
|
33 |
-
$this->result = WPAdm_Result::WPADM_RESULT_ERROR;
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
|
38 |
-
|
39 |
-
public function setData($data)
|
40 |
-
{
|
41 |
-
$this->data = $data;
|
42 |
-
}
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
public function
|
102 |
-
|
103 |
-
$this->
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
}
|
1 |
+
<?php
|
2 |
+
if (!class_exists('WPAdm_Result')) {
|
3 |
+
class WPAdm_Result {
|
4 |
+
/*
|
5 |
+
* Status of the request.
|
6 |
+
* Can be either a "success" - the request is successful,
|
7 |
+
* or "error" - in an error was encountered
|
8 |
+
* @var string
|
9 |
+
*/
|
10 |
+
private $result;
|
11 |
+
|
12 |
+
/*
|
13 |
+
* Text of the error that occurred during query execution
|
14 |
+
* @var string
|
15 |
+
*/
|
16 |
+
private $error = '';
|
17 |
+
|
18 |
+
/*
|
19 |
+
* Data obtained during query execution
|
20 |
+
* @var mixed
|
21 |
+
*/
|
22 |
+
private $data;
|
23 |
+
|
24 |
+
/*
|
25 |
+
* Total size of backup
|
26 |
+
*/
|
27 |
+
private $size;
|
28 |
+
|
29 |
+
const WPADM_RESULT_SUCCESS = 'success';
|
30 |
+
const WPADM_RESULT_ERROR = 'error';
|
31 |
+
|
32 |
+
public function __construct() {
|
33 |
+
$this->result = WPAdm_Result::WPADM_RESULT_ERROR;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* @param mixed $data
|
38 |
+
*/
|
39 |
+
public function setData($data)
|
40 |
+
{
|
41 |
+
$this->data = $data;
|
42 |
+
}
|
43 |
+
|
44 |
+
public function setValue($val, $data)
|
45 |
+
{
|
46 |
+
$this->$val = $data;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @return mixed
|
51 |
+
*/
|
52 |
+
public function getData()
|
53 |
+
{
|
54 |
+
return $this->data;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @param string $error
|
59 |
+
*/
|
60 |
+
public function setError($error)
|
61 |
+
{
|
62 |
+
WPAdm_Core::log($error);
|
63 |
+
$this->error = $error;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* @return string
|
68 |
+
*/
|
69 |
+
public function getError()
|
70 |
+
{
|
71 |
+
return $this->error;
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* @param int $size
|
76 |
+
*/
|
77 |
+
public function setSize($size)
|
78 |
+
{
|
79 |
+
$this->size = $size;
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* @return int
|
84 |
+
*/
|
85 |
+
public function getSize()
|
86 |
+
{
|
87 |
+
return $this->size;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* @param string $result
|
92 |
+
*/
|
93 |
+
public function setResult($result)
|
94 |
+
{
|
95 |
+
$this->result = $result;
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* @return string
|
100 |
+
*/
|
101 |
+
public function getResult()
|
102 |
+
{
|
103 |
+
return $this->result;
|
104 |
+
}
|
105 |
+
|
106 |
+
public function exchangeArray(array $a) {
|
107 |
+
$this->result = (isset($a['result'])) ? $a['result'] : '';
|
108 |
+
$this->data = (isset($a['data'])) ? $a['data'] : '';
|
109 |
+
$this->error = (isset($a['error'])) ? $a['error'] : '';
|
110 |
+
$this->size = (isset($a['size'])) ? $a['size'] : '';
|
111 |
+
}
|
112 |
+
|
113 |
+
public function toArray($all = false) {
|
114 |
+
|
115 |
+
if ($all) {
|
116 |
+
return get_object_vars( $this );
|
117 |
+
} else {
|
118 |
+
return array(
|
119 |
+
'result' => $this->getResult(),
|
120 |
+
'error' => $this->getError(),
|
121 |
+
'data' => $this->getData(),
|
122 |
+
'size' => $this->getSize()
|
123 |
+
);
|
124 |
+
}
|
125 |
+
}
|
126 |
+
}
|
127 |
}
|
modules/class-wpadm-running.php
ADDED
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class WPAdm_Running
|
4 |
+
*/
|
5 |
+
if (!class_exists('WPAdm_Running')) {
|
6 |
+
|
7 |
+
@set_time_limit(0);
|
8 |
+
|
9 |
+
add_action('drb_run_backup', array('wpadm_running', 'init') );
|
10 |
+
|
11 |
+
class WPAdm_Running {
|
12 |
+
|
13 |
+
private static $command_result_data = array();
|
14 |
+
private static $command_result = '';
|
15 |
+
private static $command_result_id = false;
|
16 |
+
|
17 |
+
static function init_params_default($method = true)
|
18 |
+
{
|
19 |
+
update_option(PREFIX_BACKUP_ . "_commands", array());
|
20 |
+
update_option(PREFIX_BACKUP_ . "proccess-command", array());
|
21 |
+
$path = WPAdm_Core::getTmpDir();
|
22 |
+
if (!empty($path)) {
|
23 |
+
WPAdm_Core::rmdir($path . "/db");
|
24 |
+
WPAdm_Core::rmdir($path . "/files");
|
25 |
+
WPAdm_Core::rmdir($path . "/files2");
|
26 |
+
WPAdm_Core::rmdir($path . "/archive");
|
27 |
+
WPAdm_Core::rmdir($path . "/command_dropbox");
|
28 |
+
WPAdm_Core::rmdir($path . "/errors_sending");
|
29 |
+
WPAdm_Core::rmdir($path . "/tabledb");
|
30 |
+
if ($method) {
|
31 |
+
$files = glob($path ."/wpadm_method*.queue");
|
32 |
+
if (!empty($files)) {
|
33 |
+
$n = count($files);
|
34 |
+
for($i = 0; $i < $n; $i++) {
|
35 |
+
WPAdm_Core::rmdir($files[$i]);
|
36 |
+
}
|
37 |
+
}
|
38 |
+
$files = glob($path ."/wpadm_method*.done");
|
39 |
+
if (!empty($files)) {
|
40 |
+
$n = count($files);
|
41 |
+
for($i = 0; $i < $n; $i++) {
|
42 |
+
WPAdm_Core::rmdir($files[$i]);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
static function init()
|
50 |
+
{
|
51 |
+
$command = self::getCommand();
|
52 |
+
if ($command) {
|
53 |
+
WPAdm_Core::$cron = false;
|
54 |
+
wpadm_class::$type = 'full';
|
55 |
+
$time_load = ini_get("max_execution_time");
|
56 |
+
if ($time_load != 0) {
|
57 |
+
self::run($time_load - 20);
|
58 |
+
} else {
|
59 |
+
self::run(90);
|
60 |
+
}
|
61 |
+
$core = new WPAdm_Core($command, 'full_backup_dropbox', DRBBACKUP_BASE_DIR);
|
62 |
+
if ( $result = $core->getResult()->toArray(true) ) {
|
63 |
+
if ($result['result'] == 'success') {
|
64 |
+
self::delCommand($command['method']);
|
65 |
+
self::stop();
|
66 |
+
self::setCommandResultData($command['method'], $result);
|
67 |
+
self::init();
|
68 |
+
} elseif ($result['result'] == 'error') {
|
69 |
+
self::setCommandResultData($command['method'], $result);
|
70 |
+
self::stop();
|
71 |
+
self::init_params_default();
|
72 |
+
}
|
73 |
+
}
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
+
static function getCommand($command = '')
|
78 |
+
{
|
79 |
+
$commands = get_option(PREFIX_BACKUP_ . "_commands");
|
80 |
+
if ($commands !== false && is_array($commands) && isset($commands[0]) && empty($command) ) {
|
81 |
+
return $commands[0];
|
82 |
+
} elseif (!empty($command) && $commands !== false && is_array($commands)) {
|
83 |
+
$id = wpadm_in_array($command, 'method', $commands, true );
|
84 |
+
}
|
85 |
+
return false;
|
86 |
+
}
|
87 |
+
static function setCommand($method, $params = array() )
|
88 |
+
{
|
89 |
+
$commands = get_option(PREFIX_BACKUP_ . "_commands");
|
90 |
+
if ( ( $commands === false ) || !wpadm_in_array($method, 'method', $commands ) ) {
|
91 |
+
$commands[] = array('method' => $method, 'params' => $params, 'work' => 0 );
|
92 |
+
update_option(PREFIX_BACKUP_ . "_commands", $commands);
|
93 |
+
}
|
94 |
+
}
|
95 |
+
static function delCommand($method)
|
96 |
+
{
|
97 |
+
$commands = get_option(PREFIX_BACKUP_ . "_commands");
|
98 |
+
if ($commands !== false && is_array($commands)) {
|
99 |
+
$id = wpadm_in_array($method, 'method', $commands, true);
|
100 |
+
unset($commands[$id]);
|
101 |
+
if (!empty($commands)) {
|
102 |
+
$commands = array_values($commands);
|
103 |
+
} else {
|
104 |
+
$commands = array();
|
105 |
+
}
|
106 |
+
update_option(PREFIX_BACKUP_ . "_commands", $commands);
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
static function run($time = false)
|
111 |
+
{
|
112 |
+
if ($time) {
|
113 |
+
$time = $time + time();
|
114 |
+
} else {
|
115 |
+
$time = time();
|
116 |
+
}
|
117 |
+
wp_schedule_single_event($time, 'drb_run_backup', array() );
|
118 |
+
}
|
119 |
+
|
120 |
+
static function stop()
|
121 |
+
{
|
122 |
+
wp_clear_scheduled_hook( 'drb_run_backup', array() );
|
123 |
+
}
|
124 |
+
|
125 |
+
static function setCommandResult($command, $work = false )
|
126 |
+
{
|
127 |
+
$options = get_option( PREFIX_BACKUP_ . "proccess-command" );
|
128 |
+
$id = wpadm_in_array($command, 'command', $options, true );
|
129 |
+
self::$command_result = $command;
|
130 |
+
if ($options === false || $id === false ) {
|
131 |
+
$options[] = array('command' => $command, 'work' => 0);
|
132 |
+
self::$command_result_id = wpadm_in_array($command, 'command', $options, true );
|
133 |
+
self::$command_result_data = array();
|
134 |
+
update_option(PREFIX_BACKUP_ . "proccess-command", $options);
|
135 |
+
} else {
|
136 |
+
if ($work) {
|
137 |
+
$options[$id]['work'] = 1;
|
138 |
+
update_option(PREFIX_BACKUP_ . "proccess-command", $options);
|
139 |
+
}
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
static function setCommandResultData($command, $data = array())
|
144 |
+
{
|
145 |
+
$path = WPAdm_Core::getTmpDir();
|
146 |
+
self::$command_result_data = $data;
|
147 |
+
file_put_contents($path ."/$command", wpadm_pack( $data ) );
|
148 |
+
}
|
149 |
+
static function delCommandResultData($command)
|
150 |
+
{
|
151 |
+
$path = WPAdm_Core::getTmpDir();
|
152 |
+
if (!empty($path)) {
|
153 |
+
WPAdm_Core::rmdir($path . "/$command");
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
static function getCommandResult($command)
|
158 |
+
{
|
159 |
+
$options = get_option( PREFIX_BACKUP_ . "proccess-command" );
|
160 |
+
if ($options !== false) {
|
161 |
+
$id = wpadm_in_array($command, 'command', $options, true );
|
162 |
+
if ($id !== false && $options[$id]['work'] == 1) {
|
163 |
+
return true;
|
164 |
+
}
|
165 |
+
}
|
166 |
+
return false;
|
167 |
+
}
|
168 |
+
static function getCommandResultData($command)
|
169 |
+
{
|
170 |
+
if (self::$command_result == $command) {
|
171 |
+
return self::$command_result_data;
|
172 |
+
} else {
|
173 |
+
$path = WPAdm_Core::getTmpDir();
|
174 |
+
if (file_exists($path . "/$command")) {
|
175 |
+
self::$command_result_data = wpadm_unpack( file_get_contents( $path . "/$command" ) );
|
176 |
+
return self::$command_result_data;
|
177 |
+
}
|
178 |
+
}
|
179 |
+
return array();
|
180 |
+
}
|
181 |
+
}
|
182 |
+
}
|
modules/constant.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if( !defined('WPADM_DIR_NAME') ) {
|
3 |
+
define('WPADM_DIR_NAME', 'wpadm_backups');
|
4 |
+
}
|
5 |
+
|
6 |
+
if( !defined('DROPBOX_BACKUP_DIR_NAME') ) {
|
7 |
+
define('DROPBOX_BACKUP_DIR_NAME', 'Dropbox_Backup');
|
8 |
+
}
|
9 |
+
|
10 |
+
if( !defined('DROPBOX_BACKUP_DIR_BACKUP') ) {
|
11 |
+
define('DROPBOX_BACKUP_DIR_BACKUP', WP_CONTENT_DIR . '/' . DROPBOX_BACKUP_DIR_NAME);
|
12 |
+
}
|
13 |
+
|
14 |
+
if (!defined('WPADM_DIR_BACKUP')) {
|
15 |
+
define('WPADM_DIR_BACKUP', WP_CONTENT_DIR . '/' . WPADM_DIR_NAME );
|
16 |
+
}
|
17 |
+
|
18 |
+
if (! defined("WPADM_URL_BASE")) {
|
19 |
+
define("WPADM_URL_BASE", 'http://secure.webpage-backup.com/');
|
20 |
+
}
|
21 |
+
if (! defined("WPADM_URL_PRO_VERSION")) {
|
22 |
+
define("WPADM_URL_PRO_VERSION", 'https://secure.wpadm.com/');
|
23 |
+
}
|
24 |
+
|
25 |
+
if (! defined("WPADM_APP_KEY")) {
|
26 |
+
define("WPADM_APP_KEY", 'nv751n84w2nif6j');
|
27 |
+
}
|
28 |
+
|
29 |
+
if (! defined("WPADM_APP_SECRET")) {
|
30 |
+
define("WPADM_APP_SECRET", 'qllasd4tbnqh4oi');
|
31 |
+
}
|
32 |
+
|
33 |
+
if (!defined("SERVER_URL_INDEX")) {
|
34 |
+
define("SERVER_URL_INDEX", "http://www.webpage-backup.com/");
|
35 |
+
}
|
36 |
+
if (!defined("PHP_VERSION_DEFAULT")) {
|
37 |
+
define("PHP_VERSION_DEFAULT", '5.2.4' );
|
38 |
+
}
|
39 |
+
if (!defined("MYSQL_VERSION_DEFAULT")) {
|
40 |
+
define("MYSQL_VERSION_DEFAULT", '5.0' );
|
41 |
+
}
|
42 |
+
|
43 |
+
if (!defined("PREFIX_BACKUP_")) {
|
44 |
+
define("PREFIX_BACKUP_", "wpadm_backup_");
|
45 |
+
}
|
46 |
+
if (!defined("WPADM_1DAY")) {
|
47 |
+
define("WPADM_1DAY", 86400); // 86400 sec = 1 day = 24 hours
|
48 |
+
}
|
49 |
+
if (!defined("WPADM_1WEEK")) {
|
50 |
+
define("WPADM_1WEEK", WPADM_1DAY * 7);
|
51 |
+
}
|
52 |
+
if (!defined("WPADM_COUNT_LIMIT_SEND_TO_DROPBOX")) {
|
53 |
+
define("WPADM_COUNT_LIMIT_SEND_TO_DROPBOX", 5);
|
54 |
+
}
|
55 |
+
|
56 |
+
if (!defined("SITE_HOME")) {
|
57 |
+
define("SITE_HOME", str_ireplace( array( 'http://', 'https://' ), '', home_url() ) );
|
58 |
+
}
|
modules/dropbox.class.php
CHANGED
@@ -152,6 +152,7 @@ class dropbox
|
|
152 |
elseif (!$dir['is_dir']) {
|
153 |
return array (
|
154 |
"size" => $dir['size'],
|
|
|
155 |
"date" => $dir['modified'],
|
156 |
"name" => $dir['path']
|
157 |
);
|
152 |
elseif (!$dir['is_dir']) {
|
153 |
return array (
|
154 |
"size" => $dir['size'],
|
155 |
+
"bytes" => $dir['bytes'],
|
156 |
"date" => $dir['modified'],
|
157 |
"name" => $dir['path']
|
158 |
);
|
errorHandler.php → modules/errorHandler.php
RENAMED
File without changes
|
readme.txt
CHANGED
@@ -1,46 +1,534 @@
|
|
1 |
-
===
|
2 |
-
Plugin Name:
|
3 |
-
Version: 1.
|
4 |
Donate link: http://www.wpadm.com/donate
|
5 |
URI: http://www.wpadm.com/dropbox-backup
|
6 |
-
Tags:
|
7 |
-
Requires at least:
|
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 |
|
19 |
-
Supports WordPress
|
20 |
|
21 |
-
|
22 |
-
|
23 |
|
|
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
If you need help with the plugin or you want to report a bug please refer to http://www.wpadm.com/support/
|
|
|
|
|
|
|
|
|
27 |
|
28 |
== Installation ==
|
29 |
|
30 |
-
|
|
|
31 |
2. Activate the plugin through the `Plugins` menu in WordPress
|
32 |
|
33 |
|
|
|
34 |
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
== Other ==
|
39 |
|
|
|
|
|
40 |
Usefull additional functions can be found at www.wpadm.com in the User profile.
|
41 |
-
DropBox Backup is a new plugin, so we
|
42 |
|
43 |
Information about privacy: AFTER the user has been registered at WPAdm service AND has confirmed their registration,
|
44 |
our plugin will get the minimum requirements of php and mysql configuration, version and language of wordpress.
|
45 |
This data will be send to WPAdm service, to get the plugin work correctly, to extend supported configurations of user sites with wpadm-extensions and support.
|
46 |
-
WE DO NOT COLLECT AND DO NOT STORE THE PERSONAL DATA OF USERS FROM THIS PLUGIN!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Dropbox Backup & Restore ===
|
2 |
+
Plugin Name: Dropbox Backup & Restore
|
3 |
+
Version: 1.3.3.5
|
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.4.1
|
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 |
+
Dropbox Backup & Restore Plugin to create Dropbox Full Backup (Files + Database) or Restore, Duplicate, Clone or Migrate of your Website
|
16 |
|
17 |
== Description ==
|
18 |
|
19 |
+
Supports WordPress Backup and Restore to/from Local Storage or upload Backups to Dropbox.
|
20 |
|
21 |
+
If you do not understand something or you have a questions, <br />
|
22 |
+
please, make a [support request](http://www.wpadm.com/support/) first!
|
23 |
|
24 |
+
**Features of website backup & website restore plugin:**
|
25 |
|
26 |
+
* Unlimited dropbox backups;
|
27 |
+
* Unlimited dropbox restores;
|
28 |
+
* Unlimited local backups;
|
29 |
+
* Unlimited local restores;
|
30 |
+
* Local Backup: create the Full Backup of Web Page (Files + Database) and store this at Local Storage of the Site;
|
31 |
+
* Dropbox Backup: create the Full Backup (Files + Database) of Web Page at Local Storage and upload this to Dropbox;
|
32 |
+
* Local Restore: restoration from Local backup at your website (web hosting);
|
33 |
+
* Dropbox Restore: restoration from Dropbox backup;
|
34 |
+
* With "dropbox backup & restore" plugin you can backup and restore WooCommerce shop inkl. Database with products;
|
35 |
+
* Notification loging on screen and in file;
|
36 |
+
* Use your own App key and App secret;
|
37 |
+
* Supports backup on "Low Memory" Hosting or Server;
|
38 |
+
* Possibility to make Dropbox backup and restore interface hidden with all listed backups (only Admins can access the backup plugin page);
|
39 |
+
* Automatic database optimization before backup;
|
40 |
+
* Database or Table repair functionality before backup (coming soon);
|
41 |
+
* Administrate ALL of Backups for ALL of your sites from one place – WPAdm-account (Account is FREE);
|
42 |
+
|
43 |
+
**Account creation is optional, but we suggest to do this.<br /> Why create [www.wpadm.com](http://www.wpadm.com/) account?**<br />
|
44 |
+
Your website can be down, not available or admin back-end can be without response. There are many reasons for this, for example:<br />
|
45 |
+
|
46 |
+
* Some plugin or some theme (template) has an error;
|
47 |
+
* Plugin or theme (template) was installed incorrectly (wrong installation of WordPress plugins and WordPress themes);
|
48 |
+
* Vulnerabilities of user files, WordPress files, WordPress plugin- and theme- files;
|
49 |
+
* Websites Hacking (web page hacks), Websites Trojans etc.;
|
50 |
+
* Server or hosting misconfiguration. For example: files and folder rights, like "owner" rights, "read", "write" and "execution" rights;
|
51 |
+
* Web Server or web hosting misconfiguration, like wrong Apache or nginx configuration, mod_rewrite rules (rewriting rules) configuration;<br />
|
52 |
+
etc.
|
53 |
+
|
54 |
+
You can create your WPAdm account also for **central Backup administration** at http://www.wpadm.com <br />
|
55 |
+
WPAdm account is FULLY FREE.<br /><br />
|
56 |
+
|
57 |
+
**PLEASE, READ CAREFULLY!** <br />
|
58 |
+
**If you like our plugin - please, make your own [review](https://wordpress.org/support/view/plugin-reviews/dropbox-backup). It will help us to develop and update website backup and website restore plugin for you!**<br />
|
59 |
+
**This is one of few WordPress backup plugins, who does a fully free support (plugin support!) for all of our users.<br />
|
60 |
+
Dropbox backup and restore plugin ask for FTP if your website (not this plugin!) have some troubles, in order that we could make support for you.<br />
|
61 |
+
Providing of these FTP DATA IS NOT OBLIGATORY, but if you do this, - our support staff will check your backup process and you will receive a feedback about results.<br />
|
62 |
+
It can take a while and some patience from you.<br /><br />
|
63 |
+
We are not responsible for any 5хх-errors! Such errors caused in most cases (99,9%) by your server/hosting.<br />
|
64 |
+
For a little fee, we can help you solve problems of your server or hosting (to do this, we will need your FTP website access).<br />
|
65 |
+
Thank you for your understanding!**
|
66 |
+
|
67 |
+
|
68 |
+
**ALL INFORMATION, PROVIDED BY OUR USERS IS IN SAFETY AND USED FOR SUPPORT ONLY!**
|
69 |
|
70 |
If you need help with the plugin or you want to report a bug please refer to http://www.wpadm.com/support/
|
71 |
+
<br />
|
72 |
+
|
73 |
+
If your website has basic authorisation (basic_auth), it can call some exclusions during backup executing. We are working on this issue.
|
74 |
+
|
75 |
|
76 |
== Installation ==
|
77 |
|
78 |
+
### Perform a new installation using FTP
|
79 |
+
1. Upload the plugin folder `Dropbox Backup` to the `/wp-content/plugins/` directory of your WordPress installation.
|
80 |
2. Activate the plugin through the `Plugins` menu in WordPress
|
81 |
|
82 |
|
83 |
+
### Perform a new manual installation of Dropbox backup and restore plugin
|
84 |
|
85 |
+
After downloading the ZIP file of the Dropbox back up and restoration plugin,
|
86 |
+
|
87 |
+
1. Log in to your administrator panel;<br />
|
88 |
+
2. Go to Plugins Add > New > Click the button "Upload";<br />
|
89 |
+
3. Click on "Choose file" (or "Browse", to browse the plugin zip-archive) and select the downloaded zip file of the Dropbox back up and restoration plugin;<br />
|
90 |
+
*For Mac Users*<br />
|
91 |
+
*Go to your Downloads folder and locate the folder with the name "dropbox backup". Right-click on this folder and select Compress. Now you have a newly created .zip file which can be installed as described here.*<br />
|
92 |
+
4. Click on "Install Now" button. Dropbox back up and restore pugin will be installed;<br />
|
93 |
+
5. Click on link "Activate Plugin" to activate the "Dropbox backup and restore" plugin;<br />
|
94 |
+
<br />
|
95 |
+
*If the installation does not succeed, please contact http://www.wpadm.com support staff or refer to your system administrator.*<br />
|
96 |
+
|
97 |
+
|
98 |
+
Dropbox Backup Plugin have a settings section on WordPress plugin page.
|
99 |
+
If you need help with the plugin or you want to report a bug, so please, also refer to http://www.wpadm.com/support/
|
100 |
|
101 |
== Other ==
|
102 |
|
103 |
+
= Very easy and secure Dropbox Backup and Restoration (website / web page restore from backup) =
|
104 |
+
|
105 |
Usefull additional functions can be found at www.wpadm.com in the User profile.
|
106 |
+
DropBox Backup is a new plugin, so we tried to provide a bug-free plugin/widget. We are maintain this project.
|
107 |
|
108 |
Information about privacy: AFTER the user has been registered at WPAdm service AND has confirmed their registration,
|
109 |
our plugin will get the minimum requirements of php and mysql configuration, version and language of wordpress.
|
110 |
This data will be send to WPAdm service, to get the plugin work correctly, to extend supported configurations of user sites with wpadm-extensions and support.
|
111 |
+
WE DO NOT COLLECT AND DO NOT STORE THE PERSONAL DATA OF USERS FROM THIS PLUGIN!
|
112 |
+
|
113 |
+
|
114 |
+
|
115 |
+
= Website Backup on Dropbox =
|
116 |
+
|
117 |
+
For security of your sites, webs hops or online portals is backup a must. With backup from www.webpage-backup.com you can secure backup and restore all your projects independent if it website or woocommerce shop as to make restoring from your backups. From security reasons it is impotent to schedule your backups, thereby your information or comments from your databases no go lost. Of course the more important for the security are (frequently) backups for woocommerce shops or multisite backups and there one click to restores from your backup drive. The woocommerce backups need more storage in cloud due to large files.<br />
|
118 |
+
But in most cases it isn't needed to make full backup. With help of our service webpage-backup.com you can select the folder or special databases that you must backup or to backup single website inside your hosting. But for our service it does not matter if the files are large or small, in case of the restoration it is the same. As well as for your local backup. Local backup are done on your hosting. If your hosting have enough space for backup it is ok, but it is not recommended. In most cases for storage your full backup on space of your hosting it is not enough space otherwise it is not safe enough, especially if something happen with your hosting or after some time you want to change your hosting provider. Additional if your make automate schedule backups or data base backups ever after some time the space on your backup drive will be full. For this reason the best is to use the Dropbox storage. Dropbox storage is scalable. Of course the scheduler dropbox backup it is not a must. You can make it manually and for free, but it easy to forget and the danger to lose your backup data are big. You must not to upload your dropbox backup on your PC or desktop you can directly restoring your website from dropbox drive. Independently of our service it is possible to downloading, uploading the data from the dropbox account. By dropbox backup with www.webpage-backup.com you can make exclusions of folders or by restoring import archives or whole bundle of archives. By dropbox backup or wep page cloning or migration of the sites it is important that all folders have permissions to write it is the same how permission to access the folder or to uploading it. For backup on dropbox it is does not matter if your site have ssl certificate or it is normal woocommerce shop without SSL certificate the same goes for migrating or for website clone. For our service www.webpage-backup.com it is important that our servise have permissions to the folders and to backup drive.
|
119 |
+
|
120 |
+
= Special functions =
|
121 |
+
|
122 |
+
To the special functions of our website backup doesn’t belong the migration, scheduler backup, cron backup, wpmu backup, shop backup and encryption by cloning, if you make some clone of your website or multisite clone. It is all normal functions of our plugin or service at our website www.webpage-backup.com. The most of this tools are free of charge, especially if you do it manually. But inside our multisite tools are other addons and functions. Addons for your pages or multisite (WPMU) peges you can add inside of your service account if you want. But for some of this function it is required to register on www.webpage-backup.com. For manage of multisites or just for one page menaging, for cron and scheduled dropbox backup as for full restoration of you WooCommerce shop, website or multisite as well as for migration - to register it is must. It is not possible to do full restoration of website from dropbox backup without the WordPress site self.
|
123 |
+
|
124 |
+
= Easy backup =
|
125 |
+
|
126 |
+
By draw up of our dropbox backup tools we try to do the backup or restoring ever for not experts and multisites owners, but with the same tools how for experts. For experts we have Buckup explorer where the expert can select or to do exclusion of files and webpages. As the register user you can use multiple dropbox account or create other multisite buckup drive clouds, how FTP or you can do the local backup on the site of your host. All automatically functions are inside of our service. To automatically tools belong: cron and scheduler, migrator and remote. Scheduled jobs for dropbox you can set in our calendar, it gives overview.
|
127 |
+
|
128 |
+
= Back Up, Cloning, duplicate or migrate of websites =
|
129 |
+
|
130 |
+
Cloning, duplicate or migrate in principal all the function a same. It gives you the possibility quickly to create site clone with as “templates” for multiple site. This clone tool is very useful, if you have more than one website or, if you want to clone or duplicate your web page. With full backup of your old site or WooCommerce shop you can clone or duplicate, and create new clone (due back up) of webshop or website with one click. All multisite backups functions are available from one dashboard of cloning tool, how multisite backup, as well as WPMU backup in the same cloud or in several cloud storages of hosting provider or just server. From same dashboard available clone restorations functions separate or in bundle, depend of your multisite backup settings. If your do so much settings you can remove not needed settings or clone of backup. The settings must be removed separately ever for multisite or clone. The backup dropbox storages must be removed separately too. Although it seems complicated to do automatic backup. With our backup plugin for backup, clone or migrate - you can make it without expert knowledge. Clone add-ons allow your easy backup or migrate your website or WPMU (multisite). "Dropbox backup" is just ultimate tool for WordPress that can worst your productivity by cloning of web pages, allowing you to do efficiently manage of cloned pages through clone or multisite installations.
|
131 |
+
|
132 |
+
= Easy data restoring =
|
133 |
+
|
134 |
+
For restoring your website (or multisite websites) selected files from the dashboard and then select files to restore. In backup list you see the type, date and size. From the list you can remove and select appropriate restoring file. In settings your can add or remove the cloud storage. In case of cloning you must restore your old website backup on other webpage. Cloning is the same how resorting but in more steps. The same bee meant for migrating of multisite and shops and there restore. With our file explorer you can match every file separately for restoration. In case of restoration only this files will be restore. You can restore one file than the next, but it easy to make restoring in bundle or directly to recover whole full backup. The restoration time depend from your hosting and upload rate as well as restoration depend from the file size witch must be restore. Scheduled restoring and recovering isn’t possible, unless somebody have special inquiry on our service to do scheduled recovering. The recover from the Dropbox cloud storage take time, depend from the web site size and right permissions of the folders of your hosting provider.
|
135 |
+
|
136 |
+
= What to do if recovering failed? =
|
137 |
+
|
138 |
+
First of all check the data spelling. It is most common mistake. Other common mistakes by recovering are:
|
139 |
+
|
140 |
+
* to recover from wrong cloud storage;
|
141 |
+
* if done alone database back up – not full and you can't see the recover sites;
|
142 |
+
* by recovering process there was internet connection interrupted;
|
143 |
+
* In your database are file exclusions;
|
144 |
+
* your database back up was not consistent;
|
145 |
+
* file archive of back up with a broken checksum;
|
146 |
+
* back up or restore from damaged cloud storage or from damaged back up archive;
|
147 |
+
* misspelled back up due user failed restore;
|
148 |
+
|
149 |
+
Large file and big size databases need more time to back up or recover website. It can take until two hours or more, depend from the size of your back up database, but for our recovery service it doesn’t matter for uploading of large files or small files. The difference between recover the large files and small is the time. <br />
|
150 |
+
After check all of this figures please write an email to our support team http://www.webpage-backup.com and we will try to answer as soon as possible and to give you’re the best solution how easy to recover your site.
|
151 |
+
|
152 |
+
If you see some of 5xx error codes, as return of your backup:<br />
|
153 |
+
please, feel free to contact your own system administrator (admins, support etc.), because this type of errors come from your server.<br />
|
154 |
+
|
155 |
+
**The timely backup protects from viruses.**
|
156 |
+
|
157 |
+
There are some requirements for creating a reliable backup:<br />
|
158 |
+
• Make copies of your files regularly and as often as you can;<br />
|
159 |
+
• Rank your data by importance and back up essential information first. Generally, temporary files only add up to the back up volume and carry no significance, so get rid of them;<br />
|
160 |
+
• Do not store your file copies on the same hard drives;<br />
|
161 |
+
• Make sure you can access your backups any time and from any place;<br />
|
162 |
+
• Schedule your backups and ensure you get informed on their status;<br />
|
163 |
+
• If your medium capacity or bandwidth is limited use compression tools;<br />
|
164 |
+
A good solution is to have a separate server for remote backups although it is not fail-safe. If the server is unavailable restoration will be impossible. To ensure high accessibility and data safety use cloud storage services.<br />
|
165 |
+
There are a lot of services providing free but limited cloud storage capacity for backups like Google Drive, Amazon S3 (AWS) or Dropbox. The problem is they do not support FTP protocol which sometimes is the most adequate way of data transfer. In comparison, virtually every host company supports this protocol.
|
166 |
+
|
167 |
+
|
168 |
+
|
169 |
+
== Frequently Asked Questions ==
|
170 |
+
|
171 |
+
= Where can I get my app key & secret? =
|
172 |
+
|
173 |
+
You can get an API app key and secret by creating an app on the <a href="https://www.dropbox.com/developers/apps/create?app_type_checked=api" target="_blank">app creation page</a>.
|
174 |
+
Once you have an app created, the app key and secret will be available on the app's page on the <a href="https://www.dropbox.com/developers/apps" target="_blank">App Console</a>.
|
175 |
+
Note that Drop-ins have app keys but no app secrets.
|
176 |
+
|
177 |
+
= I clicked on the "Backup to Dropbox" button, but nothing happens. What's wrong? =
|
178 |
+
|
179 |
+
Before you try to make a backup of your website to dropbox, please make sure, that you have created the connection to dropbox. Also you must be sure, that you are connected to dropbox.<br />
|
180 |
+
To do this, please, open the "Settings" block in your "Dropbox backup and restore" plugin. There you must see your Dropbox UID (User ID on Dropbox). If you didn't see your Dropbox connection App UID - your Dropbox plugin is NOT CONNECTED to your Dropbox and you can't do the backup of your website.<br />
|
181 |
+
So please, at first connect yourself to Dropbox and then, try to make your backup to dropbox.
|
182 |
+
|
183 |
+
= How to restore my site from dropbox backup? =
|
184 |
+
|
185 |
+
- First of all, install the Dropbox backup & restore plugin;<br />
|
186 |
+
- In Dropbox backup & restore plugin check your connection to dropbox as "dropbox app" or as connection with using of app key & app secret from your dropbox account;
|
187 |
+
|
188 |
+
|
189 |
+
= My web page completely crashed and not available. How can I restore my web page from dropbox backup? =
|
190 |
+
|
191 |
+
Just login or Register at WPAdm www.wpadm.com If your web page wasn't added and verified - just do it. Add your domain and verified this on WPAdm account.
|
192 |
+
|
193 |
+
You must see all of your backups, that you have made.
|
194 |
+
|
195 |
+
= Should I upgrade my old version of Dropbox Backup and Restore plugin? =
|
196 |
+
|
197 |
+
Yes. We recommended to update or upgrade to a newest versions.
|
198 |
+
|
199 |
+
= How can I manage my backups? =
|
200 |
+
|
201 |
+
Manage of multiple back ups is possible from your account on webpage-backup.com
|
202 |
+
|
203 |
+
= I use multisite WordPress and I would like to manage my backups from one place. How can I do that? =
|
204 |
+
|
205 |
+
Multisite WP can be supported too, but you have to login in your account at www.webpage-backup.com
|
206 |
+
|
207 |
+
= Can I use the Dropbox Backup and Restore plugin to clone my website? =
|
208 |
+
|
209 |
+
Yes. If you have some back up, created with our Dropbox Backup and Restore plugin, then you can use it for migration or doing some clone to another place (server / web hosting).
|
210 |
+
|
211 |
+
= I didn't see my back up at my Dropbox. Why? How can I find it at my Dropbox? =
|
212 |
+
|
213 |
+
Simple check your app key and app secret, that you use it from a correct app do you created before you start make a backup.
|
214 |
+
|
215 |
+
= Is it possible to migrate my website with your Dropbox back up tool? =
|
216 |
+
|
217 |
+
Many people stay us this question and our answer is - YES! It's good possibility to use our back up plugin specially for migration of websites. Also you can migrate your website locally. If you does a local backup, then you can download it to your PC, upload to another place and make recovery there.
|
218 |
+
|
219 |
+
= How to do a recovery of my website? =
|
220 |
+
|
221 |
+
Dropbox Backup and Restore plugin work autonomously. In case, if your page (website) not available, you may use www.webpage-backup.com to recover website from backup on dropbox.
|
222 |
+
|
223 |
+
= I want schedule backup. How can I schedule backup of my website? =
|
224 |
+
|
225 |
+
To schedule backup of your webpage (website backup), you may use an account at www.webpage-backup.com to schedule backup.
|
226 |
+
|
227 |
+
= Can I make a schedule backup of my multisite WordPress? =
|
228 |
+
|
229 |
+
Please, see the previous question "I want schedule backup. How can I schedule backup of my website?".
|
230 |
+
Generally - YES, you can create a scheduled backup, but you may sign in to account at www.webpage-backup.com to make a scheduled backup.
|
231 |
+
|
232 |
+
= Should I register to make a back up of my site? =
|
233 |
+
|
234 |
+
Our plugin for back up is completely autonomous plugin for back up, so you don't need to register to make a back up of your site.
|
235 |
+
|
236 |
+
= How can I manually restore my website from one place to another? =
|
237 |
+
|
238 |
+
You can restore your website on another place with two ways:<br />
|
239 |
+
* manually website restoration<br />
|
240 |
+
* automatically website restoration<br />
|
241 |
+
|
242 |
+
For automatically website restoration you may need an account at webpage-backup.com
|
243 |
+
|
244 |
+
= Is it possible to duplicate my website like Duplicator Plugin do that? =
|
245 |
+
|
246 |
+
Backups & Restoring plugin can Duplicate more simply as Duplicator.<br />
|
247 |
+
If you want to duplicate your website, you may backup it first at some storage (for example Dropbox or Amazon, or just on your FTP). You can start duplicate website if the backup process was finished successfully. If isn't - don't try to duplicate, because wrong or incorrect backup can crash your website during duplicating.
|
248 |
+
|
249 |
+
= Duplicate and clone is the same thing? =
|
250 |
+
|
251 |
+
It has distinction in each of the duplicate and clone plugins. In both cases, as with duplicate and also with clone, this is in fact a website copy.
|
252 |
+
|
253 |
+
= How can I manage or coordinate my duplicate website? =
|
254 |
+
|
255 |
+
To managing your duplicate website you need to have an account at webpage-backup.com. So, you will see all of target (original) and source (duplicate) websites. At your account on webpage-backup.com you have a possibility to make one duplicate from another duplicate website, that was duplicated before.
|
256 |
+
|
257 |
+
= What does make your "duplicate" plugin, which doesn't make another (e.g. Duplicator plugin)? =
|
258 |
+
|
259 |
+
Duplicating is a very complex process. We will explain the website duplicate in the next our explanations about "duplicate website".
|
260 |
+
|
261 |
+
= Is it possible to make an Incremental Backup with Dropbox Backup & Restore plugin? =
|
262 |
+
|
263 |
+
Incremental backup expect many of our users. Incremental backup can help solve many problems for the implementation of the backup in complex systems. Create an incremental backup, that's what we're working. In the next versions it will be also possible to create incremental backups for websites.<br /><br />
|
264 |
+
(PS: Autor german language)<br />
|
265 |
+
Inkrementelle Sicherung (Incremental backup) erwarten viele unser Nutzer. Inkrementelle Sicherung (Incremental backup) kann helfen viele Probleme für die Durchführung der Sicherung in komplexen Systemen zu lösen. Erstellung eines inkrementelles Backup, das ist, was wir eben noch planen zu implementieren in der Dropbox Backup & Restore Plugin. In den Zukünftigen Versionen wird es auch möglich, inkrementelle Backups zu erstellen.<br /><br />
|
266 |
+
|
267 |
+
We must understand that when you use incremental backups perform operations such as website clone (clons creating), multisite clone, migrate of websites or website duplicate will be difficult, but possible.
|
268 |
+
|
269 |
+
= Just to do a MySQL backup. How to do that? =
|
270 |
+
|
271 |
+
In this version of plugin supported a MySQL backup (database backup or simple "db backup") together with a filesystem backup. To do a mysql backup, you can do it with a file system or just use another version of our plugin.<br />
|
272 |
+
The version for mysql backup (DB Backup) is available due control panel at http://www.webpage-backup.com
|
273 |
+
|
274 |
+
= We want to make an SCP Backup from our rackspace (Full Rackspace Backup). For this operation we would like to use your Dropbox plugin. =
|
275 |
+
|
276 |
+
Ok, if you want to use an SCP Backup, please, wait for some versions of this plugin over their, and we will make an scp backup for you.
|
277 |
+
|
278 |
+
= FTP Backup? =
|
279 |
+
|
280 |
+
The name of this plugin is "Dropbox" Backup and Restore. From control panel at http://www.webpage-backup.com you can do also an FTP Backup. Please, checkout an FTP Backup so.
|
281 |
+
|
282 |
+
= Is dropbox backup and restoration plugin really free? =
|
283 |
+
|
284 |
+
Yes, dropbox backup and dropbox restoration are free with plugin "Dropbox Backup and Restore"!
|
285 |
+
|
286 |
+
= Whether I need to create an account on the wpadm.com? =
|
287 |
+
|
288 |
+
You shouldn't create an account on the www.wpadm.com, but you are able to do it since further it can really help you at restoration time of your site. For example, if your website is completely down and not available.
|
289 |
+
|
290 |
+
= Whether there are WordPress templates of my web site in a full backup archive? =
|
291 |
+
|
292 |
+
Full backup include templates of your site.
|
293 |
+
|
294 |
+
= I try to create a dropbox backup. I enter the app key and app secret. Then I was asked for permission to access dropbox, so I hit "allow" and then I'm given an "Internal server error".<br /> What is causing this and how might I fix it? =
|
295 |
+
|
296 |
+
Please, just wait for some time and try again later.<br />
|
297 |
+
We know this issue about "Internal Server Error" on Dropbox, that comes from the Dropbox servers. Best thing to do is be patient and give it another try.
|
298 |
+
We cannot recommended you more, than just had to wait it out and problem went away after a while.
|
299 |
+
|
300 |
+
= I want to move my website to the new hosting/server. How can I do this? =
|
301 |
+
|
302 |
+
Sure, it is possible to use this Dropbox Backup & Restore plugin, but we suggest to try [cloner](https://wordpress.org/plugins/duplicator-clone/). With it you can much easily clone, migrate or easy duplicate your website from one hosting or server to another.
|
303 |
+
|
304 |
+
= My website has a very BIG files, like photos, videos and so on. If I do my backup to dropbox it's return this message "Maximum execution time of XXX seconds exceeded" and sometimes some other messages while uploading to dropbox. I've tried to do my backups with some of known WordPress plugins like "BackWPup", "UpdraftPlus Backup and Restoration", "WordPress Backup to Dropbox", "BackUpWordPress" but it's all without success. Can you please advise me after all these failures, why I have to trust in "Dropbox Backup & Restore" plugin? =
|
305 |
+
|
306 |
+
OK, this is a complex question, but we'll try to answer this by comparing of "BackWPup", "UpdraftPlus Backup and Restoration", "WordPress Backup to Dropbox", "BackUpWordPress" with "Dropbox backup & restore" plugin.<br />
|
307 |
+
All of this backup plugins like "Dropbox backup & restore", "BackWPup", "UpdraftPlus Backup and Restoration", "WordPress Backup to Dropbox" or "BackUpWordPress" has functionality not only for a backup, but also for restoration (restore or restoring process for website). There are a lot of parameters which are required to be compared.
|
308 |
+
|
309 |
+
= Why I cannot create local back up? =
|
310 |
+
There are many reasons for failed local back up. For example, you may to sure, that you have enough free space on you hard drive (hosting contingent, with other words: you have a free space) for new back up. Also you may to sure, that you permission for script running, file or folder creation are not limited.<br />
|
311 |
+
You've corrected these problems and still can't make a local back up - please, contact www.webpage-backup.com support.
|
312 |
+
|
313 |
+
= Hi, I made a Local Backup and it created 23 zip files, 1 MD5 file and 1 SQL file. How I can validate that this backup ended correctly? =
|
314 |
+
At the end of successfully created backup you will receive a results message like "success" or "error" and the .MD5 file will be created. The .md5 file is a checksum for your created backup.
|
315 |
+
|
316 |
+
= I was using your free version of Dropbox Backup without problem. I just paid for the Pro version and downloaded the files to my computer. What do I do now to activate the Pro version on my WP site and automate dropbox backups? =
|
317 |
+
The PRO version of plugin was activated during of payment process, so if you already downloaded the PRO version – it's already activated. Just install the plugin.
|
318 |
+
To automate backup to Dropbox (scheduled backup to Dropbox), please look at settings block of an installed PRO plugin.
|
319 |
+
|
320 |
+
= Can do back up get this message Dropbox Backup wasn't created. Website "XXXXXXXX" returned an error during file creation: Failed to create file, please check the permissions on the folder "/web1/user/website/XXXXXXXX/wp-content/Dropbox_Backup". Please can you advise? =
|
321 |
+
Sure, the folder “Dropbox_Backup” with this path on you website hosting or website server "/web1/user/website/XXXXXXXX/wp-content/Dropbox_Backup" must be created, if this wasn’t created yet<br />
|
322 |
+
AND this folder must be also writable (For example within permission 777 on this folder).<br />
|
323 |
+
You can check this permissions using some FTP client like "WinSCP" or "FileZilla". You can google and download this software. This program is free of charge.<br />
|
324 |
+
If you have any difficulties, our support staff can do it for you, but in this way you'll need send FTP access credentials for your website to our support.
|
325 |
+
|
326 |
+
= I have tried several times to perform a Dropbox backup of my wordpress site. It says that is performs, but the backup counter shows 0 even after being refreshed. The Dropbox folder is showing no items in it. What am I missing to do? =
|
327 |
+
1. One of the possible thing you can try to do is the web browser cache refresh. Try to load you backup plugin page in WordPress without browser cache by clicking of buttons combination Ctrl+F5.<br />
|
328 |
+
|
329 |
+
= I've been trying to back up a site and I just noticed that it stopped progressing about an hour ago at this line: yyyy-mm-dd xx:xx:xx Add a table "wp_tablexxx" in the database dump. Any idea what happened? =
|
330 |
+
The Dropbox backup and restore plugin does an automatic database optimization before backup, <br />but if you have some broken table in database of your website,<br />
|
331 |
+
then you can try to repair the database before backup creation.<br />
|
332 |
+
|
333 |
+
= Hallo, ich habe eben versucht über Ihre Webseite ein Backup in meine Dropbox zum machen - es wurde aber nicht ausgeführt. Das Geld wurde aber von meinem Guthaben bereits abgebucht. Im Scheduler stand auch "WAITING" und dann "PERFORMED" aber die Dropbox ist noch leer. Bitte um Hilfe. =
|
334 |
+
|
335 |
+
Die Abbuchung erfolgt nicht, falls Ihr Backup ohne Erfolg abgeschlossen wurde.<br />
|
336 |
+
In diesem Fall handelt es sich um gelieferte vom Server des Website diese Antwort:<br /><br />
|
337 |
+
*504 Gateway Time-out*<br />
|
338 |
+
*The gateway did not receive a timely response from the upstream server or application.*<br /><br />
|
339 |
+
Dies ist eine interne Fehlermeldung auf Ihrem Server/Hosting, für den wir nicht verantworten können. <br />
|
340 |
+
Ist es möglich, dass Sie uns Ihr System Logs-Dateien zukommen lassen <br />
|
341 |
+
*oder*<br />
|
342 |
+
geben uns den FTP Zugriff von Ihrer Website, damit wir versuchen Ihnen zu helfen.<br />
|
343 |
+
|
344 |
+
= Makes me mad that I thought I was protected. Couldn't have went another way. I want create my website backup to dropbox. =
|
345 |
+
Your website is protected, if you have successfully created website backup.<br />
|
346 |
+
Just try to create website backup from you own admin area (from you own WordPress). Backup creating from your own website is fully free!<br />
|
347 |
+
|
348 |
+
= Seems to be missing something: PHP Extensions sockets, ftp Not Found Functionality are not guaranteed. =
|
349 |
+
Yes, to create backup successfully you'll need such PHP extensions like Sockets or Curl, otherwise we can't guaranteed functionality for Dropbox back up and restoration plugin.
|
350 |
+
|
351 |
+
= I've moved my website to the new hosting provider. Where can I find my PHP Extensions like sockets, ftp or curl to do a backup? Because the Dropbox plugin says me, that functionality for Dropbox back up and restoration plugin can't guaranteed... =
|
352 |
+
You can activate PHP Extensions on you cPanel or Plesk of provider hosting administration panel.
|
353 |
+
**If you use cPanel,** <br />
|
354 |
+
login in cPanel and scroll down to "Software and Services" or "Advanced" block and open "PHP configuration" or "PHP PEAR packages".<br />
|
355 |
+
Check on the corresponding checkboxes to your php extensions, that you want activate.<br />
|
356 |
+
Save the PHP configuration by clicking the button on bottom (in most cases on the bottom) of this page.<br />
|
357 |
+
**If you use Plesk dashboard or Plesk (Version 12) administration panel,** <br />
|
358 |
+
Login to Plesk and in main menu open "Tools & Settings" > "PHP Settings" > *any PHP 5.6 handler*<br />
|
359 |
+
Clear the checkbox, to have the PHP extension appear on the customers "phpinfo" pages, and click "OK". Wait for the changes in list with PHP extensions to be applied, then select the checkbox and apply the changes once again.<br />
|
360 |
+
|
361 |
+
|
362 |
+
== Changelog ==
|
363 |
+
|
364 |
+
Please, keep your Dropbox Backup and Restore plugin up-to-date.
|
365 |
+
|
366 |
+
**Rev.** / **Description** <br />
|
367 |
+
|
368 |
+
Configuration of PHP extensions in Plesk panel.<br />
|
369 |
+
Dropbox backup and restore was successfully tested up to 4.4.1 WordPress version.<br />
|
370 |
+
Small text fix in description about activating of PHP extensions in cPanel for back up plugin.<br />
|
371 |
+
Use of FTP protocol to create backup.<br />
|
372 |
+
Solutions for storage back up.<br />
|
373 |
+
Use separate server for remote backups<br />
|
374 |
+
The list of requirements to backup website.<br />
|
375 |
+
Requirements for creating back up.<br />
|
376 |
+
Find and activate PHP Extensions for Dropbox website back up and restore.<br />
|
377 |
+
@1314341 Dropbox website backup and restoration answer explained.<br />
|
378 |
+
Website backup on "Low Memory" Hostings or Servers.<br />
|
379 |
+
Website backup to Dropbox naming corrected to "Website backup".<br />
|
380 |
+
Website backup to Dropbox syntax corrected and one tag "Website back up" added.<br />
|
381 |
+
Website backup to Dropbox FAQ.<br />
|
382 |
+
@1309174 Dropbox back up and restoration features list in plugin description changed.<br />
|
383 |
+
@1308460 Added new version 1.3.3.5 - update user interface.<br />
|
384 |
+
@1307504 PHP extensions to create back up and restoring for Dropbox back up and restoration.<br />
|
385 |
+
In FAQ carriage return corrected.<br />
|
386 |
+
Installation instructions for Dropbox back up and restoration plugin.<br />
|
387 |
+
Try to make a repairing before backup.<br />
|
388 |
+
Dropbox backup and restore question - "Stopped progressing about an hour ago".<br />
|
389 |
+
Dropbox backup and restore slug was changed in plugin header for language translation.<br />
|
390 |
+
Browser cache refresh in back up and restore plugin page under WordPress.<br />
|
391 |
+
Carriage return in installation instructions.<br />
|
392 |
+
Request about "what to do, if back up not working"<br />
|
393 |
+
Revision lines was added to back up and restoration.<br />
|
394 |
+
@1293495 Answer in FAQ about folder permission.<br />
|
395 |
+
@1292981 Question about folder permission was added to FAQ.<br />
|
396 |
+
@1291392 Tags was added.<br />
|
397 |
+
@1290489 Switching from FREE to PRO plugin version.<br />
|
398 |
+
@1289603 Web Server basic_auth issue will be solved.<br />
|
399 |
+
@1288063 Installation instructions for users about Dropbox Back up and Restore plugin descripted.<br />
|
400 |
+
@1287201 New tags was added in plugin description.<br />
|
401 |
+
@1286120 Database repairing coming soon in description.<br />
|
402 |
+
@1285459 Database optimization in Dropbox back up and restoration.<br />
|
403 |
+
@1284056 update wpadm function for search key<br />
|
404 |
+
@1283439 Dropbox backup and restoration change log corrected.<br />
|
405 |
+
@1281224 Version 1.3.3.4; WPAdm method corrected, message to recovery Dropbox Back up and restoration<br />
|
406 |
+
@1279735 Version 1.3.3.3; Algorithm changed to create MySQL dump of Dropbox back up and restoration<br />
|
407 |
+
@1277537 Dropbox back up and restoration plugin description was changed.<br />
|
408 |
+
@1276653 Version 1.3.3.2; Performance improvement. Trying to avoid 5xx and 4xx system errors. Bug fixes. <br />
|
409 |
+
@1274884 Checkbox for admins was fixed <br />
|
410 |
+
@1274875 Fixed bug: checkbox to hide Dropbox backup and restore plugin from all users except admin <br />
|
411 |
+
@1273510 add new version 1.3.3 <br />
|
412 |
+
@1273409 add expsys template <br />
|
413 |
+
@1279408 Explanation in description of dropbox backup and restoration plugin was added.<br />
|
414 |
+
@1273303 added index files <br />
|
415 |
+
@1272797 Validate that dropbox backup was ended correctly. <br />
|
416 |
+
@1272337 example in a question for registration in dropbox back up and restore <br />
|
417 |
+
@1271819 added index to folder template <br />
|
418 |
+
@1271744 question with answer about failed local back up <br />
|
419 |
+
@1271154 "if exists" to database dump <br />
|
420 |
+
@1270137 styling of text for 5xx errors <br />
|
421 |
+
@1269473 js moved <br />
|
422 |
+
@1268234 small changes in faq <br />
|
423 |
+
@1267847 small changes in readme <br />
|
424 |
+
@1267005 syntax <br />
|
425 |
+
@1266928 update messages in dropbox backup and restore plugin<br />
|
426 |
+
@1266703 syntax WP<br />
|
427 |
+
@1265985 update version 1.3.2<br />
|
428 |
+
@1265068 update js (shows forms)<br />
|
429 |
+
@1264052 add function search element<br />
|
430 |
+
@1262500 explanation about support for plugin and hosting<br />
|
431 |
+
@1261881 function for plugins<br />
|
432 |
+
@1261222 updated version 1.3.1(auth form)<br />
|
433 |
+
@1261188 small changes in readme<br />
|
434 |
+
@1260383 update styles for mobile devices<br />
|
435 |
+
@1260365 updated version 1.3<br />
|
436 |
+
@1260019 add new version 1.2.9.9<br />
|
437 |
+
@1259835 add new version 1.2.9.8<br />
|
438 |
+
@1259518 to compare<br />
|
439 |
+
@1259217 answer fur super question about backup and restore plugins<br />
|
440 |
+
@1259203 question is corrected to dropbox backup and restoration<br />
|
441 |
+
@1259182 FAQ question added to dropbox backup / restore plugin<br />
|
442 |
+
@1257732 added comments database backup file<br />
|
443 |
+
@1255849 update styles (button)<br />
|
444 |
+
@1254709 Backup as Virus protection<br />
|
445 |
+
@1253582 other notes 5xx errors<br />
|
446 |
+
@1252805 Answer for question "how to clone my site" was added.<br />
|
447 |
+
@1251866 dropbox backup, dropbox restore: question added<br />
|
448 |
+
@1250954 explanation about dropbox connection request<br />
|
449 |
+
@1250437 update styles (buttons)<br />
|
450 |
+
@1249411 CR added<br />
|
451 |
+
@1249102 syntax backup and restoration description<br />
|
452 |
+
@1248616 add new version 1.2.9.7(update folder backup)<br />
|
453 |
+
@1248057 features list<br />
|
454 |
+
@1247607 tested up 4.3.1<br />
|
455 |
+
@1246330 wordpress website backup and wordpress website restore plugin dashboard …<br />
|
456 |
+
@1245871 dropbox backup and restore (website restore and website backup) update<br />
|
457 |
+
@1245510 Added logging<br />
|
458 |
+
@1244896 update sync<br />
|
459 |
+
@1244885 description updated<br />
|
460 |
+
@1244750 Dropbox backup and restore obligations<br />
|
461 |
+
@1242514 pik @<br />
|
462 |
+
@1241879 text update<br />
|
463 |
+
@1241570 add new version 1.2.9.6(update form setting)<br />
|
464 |
+
@1239293 description and tag changed<br />
|
465 |
+
@1238734 tags update<br />
|
466 |
+
@1237086 syntax faq<br />
|
467 |
+
@1237081 FAQ question and answer<br />
|
468 |
+
@1236213 readme description changed<br />
|
469 |
+
@1235445 webpage changed to website<br />
|
470 |
+
@1233859 user notice added<br />
|
471 |
+
@1233133 update styles(form info)<br />
|
472 |
+
@1232321 syntax<br />
|
473 |
+
@1230213 styles mobile devices(form)<br />
|
474 |
+
@1229216 update style(button-send)<br />
|
475 |
+
@1227611 tested version 4.3<br />
|
476 |
+
@1227201 update styles(form info)<br />
|
477 |
+
@1223663 update styles (form)<br />
|
478 |
+
@1222885 update styles<br />
|
479 |
+
@1221294 syntax<br />
|
480 |
+
@1220833 update styles (button)<br />
|
481 |
+
@1219935 update styles (form)<br />
|
482 |
+
@1217702 version changed<br />
|
483 |
+
@1217168 syntax<br />
|
484 |
+
@1216872 small spell checking<br />
|
485 |
+
@1214947 update styles (form)<br />
|
486 |
+
@1214116 exclude cache folder<br />
|
487 |
+
@1214080 add new version 1.2.9.5<br />
|
488 |
+
@1213546 update version of WordPress<br />
|
489 |
+
@1212423 restore description question<br />
|
490 |
+
@1212013 new version 1.2.9.4<br />
|
491 |
+
@1210498 update dropbox connect<br />
|
492 |
+
@1210495 new version 1.2.9.3<br />
|
493 |
+
@1210306 update styles<br />
|
494 |
+
@1209297 update styles<br />
|
495 |
+
@1209294 update styles<br />
|
496 |
+
@1208999 new version 1.2.9.2<br />
|
497 |
+
@1208987 Template update<br />
|
498 |
+
@1208918 Update version Wordpress<br />
|
499 |
+
@1208262 faq answer<br />
|
500 |
+
@1207546 faq question<br />
|
501 |
+
@1206897 faq answer and question<br />
|
502 |
+
@1206675 faq question<br />
|
503 |
+
@1206472 faq answer<br />
|
504 |
+
@1206316 faq question<br />
|
505 |
+
@1205075 syntax<br />
|
506 |
+
@1203513 syntax corrected<br />
|
507 |
+
@1203312 version changed to 1.2.9.1<br />
|
508 |
+
@1203168 new version 1.2.9a<br />
|
509 |
+
@1203093 syntax<br />
|
510 |
+
@1203089 Screenshots description<br />
|
511 |
+
@1202467 Screenshot description <br />
|
512 |
+
|
513 |
+
== Upgrade Notice ==
|
514 |
+
|
515 |
+
Please, keep your Dropbox Backup and Restore plugin up-to-date.
|
516 |
+
|
517 |
+
== Screenshots ==
|
518 |
+
|
519 |
+
= Step-by-step & HOWTOs in Dropbox Backup and Restore plugin =
|
520 |
+
|
521 |
+
1. **Main window of Dropbox Full Backup plugin.** Dropbox Backup and Restore plugin window after installation and activation.
|
522 |
+
2. To open the main window of the plug-in, click on the item "**Dropbox Full Backup**" in main menu of your WordPress installation. WordPress menu in admin area.
|
523 |
+
3. For **local backups** with Dropbox Full Backup plugin (saving of backups locally on server or shared hosting of your site), you do not need to make a connection to dropbox. Therefore, for a local backup is unnecessary to make any settings changes. The Local backup will work.
|
524 |
+
4. The **Settings block of Dropbox Backup and Restore** plugin. Fill out App key and App secret to get the dropbox plugin connected with your dropbox account.<br />
|
525 |
+
**Make sure**, you use the right App key and App secret pair and this pair correspond to your right dropbox application.<br />
|
526 |
+
**This is one of the most common mistakes of our users!**
|
527 |
+
5. **Don't forget** to click on **"Connect"** button to get the dropbox plugin connected with your dropbox account.
|
528 |
+
6. Click **"Create Dropbox Backup"** to create backup and upload this to your dropbox account using your pair of App key and App secret.
|
529 |
+
7. Click **"Create Local Backup"** to create local backup. The local backup will be saved locally at your shared hosting / server.
|
530 |
+
8. Table **list of backups** (local backups and dropbox backups), that was created with Dropbox Full Backup and Restore plugin.
|
531 |
+
9. Screen9
|
532 |
+
10. Screen10
|
533 |
+
|
534 |
+
|
template/css/admin-style-wpadm.css
ADDED
@@ -0,0 +1,996 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
.list-dropbox-backup-pro {
|
3 |
+
margin-top:10px;
|
4 |
+
margin-bottom:0;
|
5 |
+
}
|
6 |
+
.list-dropbox-backup-pro li {
|
7 |
+
margin-bottom: 0;
|
8 |
+
font-size:14px;
|
9 |
+
margin-left:35px;
|
10 |
+
}
|
11 |
+
.list-dropbox-backup-pro .text {
|
12 |
+
line-height: 25px;
|
13 |
+
}
|
14 |
+
.image-dropbox-pro {
|
15 |
+
width: 183px;
|
16 |
+
height: 187px;
|
17 |
+
border:2px solid #ddd;
|
18 |
+
cursor: pointer;
|
19 |
+
text-align: center;
|
20 |
+
float:left;
|
21 |
+
}
|
22 |
+
.dropbox-image-toolbar a:before {
|
23 |
+
content: url('./../../img/wpadm-logo.png');
|
24 |
+
/*background-image: ;*/
|
25 |
+
}
|
26 |
+
|
27 |
+
|
28 |
+
.folder-class {
|
29 |
+
text-align: left;
|
30 |
+
font-size: 14px;
|
31 |
+
font-weight: 400;
|
32 |
+
color:#444444;
|
33 |
+
}
|
34 |
+
.folder-class .first, .folder-class .second {
|
35 |
+
margin-left:3px;
|
36 |
+
}
|
37 |
+
.folder-class .first:after, .folder-class .second:after {
|
38 |
+
content:"/";
|
39 |
+
}
|
40 |
+
|
41 |
+
.backup_button {
|
42 |
+
-moz-box-shadow:inset 0px 1px 0px 0px #9fb4f2;
|
43 |
+
-webkit-box-shadow:inset 0px 1px 0px 0px #9fb4f2;
|
44 |
+
box-shadow:inset 0px 1px 0px 0px #9fb4f2;
|
45 |
+
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #7892c2), color-stop(1, #476e9e));
|
46 |
+
background:-moz-linear-gradient(top, #7892c2 5%, #476e9e 100%);
|
47 |
+
background:-webkit-linear-gradient(top, #7892c2 5%, #476e9e 100%);
|
48 |
+
background:-o-linear-gradient(top, #7892c2 5%, #476e9e 100%);
|
49 |
+
background:-ms-linear-gradient(top, #7892c2 5%, #476e9e 100%);
|
50 |
+
background:linear-gradient(to bottom, #7892c2 5%, #476e9e 100%);
|
51 |
+
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7892c2', endColorstr='#476e9e',GradientType=0);
|
52 |
+
background-color:#7892c2;
|
53 |
+
-moz-border-radius:3px;
|
54 |
+
-webkit-border-radius:3px;
|
55 |
+
border-radius:3px;
|
56 |
+
border:1px solid #4e6096;
|
57 |
+
display:inline-block;
|
58 |
+
cursor:pointer;
|
59 |
+
color:#ffffff;
|
60 |
+
font-family:Arial;
|
61 |
+
font-size:17px;
|
62 |
+
font-weight:bold;
|
63 |
+
padding:10px 20px;
|
64 |
+
text-decoration:none;
|
65 |
+
text-shadow:0px 1px 0px #283966;
|
66 |
+
}
|
67 |
+
.backup_button:hover {
|
68 |
+
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #476e9e), color-stop(1, #7892c2));
|
69 |
+
background:-moz-linear-gradient(top, #476e9e 5%, #7892c2 100%);
|
70 |
+
background:-webkit-linear-gradient(top, #476e9e 5%, #7892c2 100%);
|
71 |
+
background:-o-linear-gradient(top, #476e9e 5%, #7892c2 100%);
|
72 |
+
background:-ms-linear-gradient(top, #476e9e 5%, #7892c2 100%);
|
73 |
+
background:linear-gradient(to bottom, #476e9e 5%, #7892c2 100%);
|
74 |
+
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#476e9e', endColorstr='#7892c2',GradientType=0);
|
75 |
+
background-color:#476e9e;
|
76 |
+
color:#fff;
|
77 |
+
}
|
78 |
+
.backup_button:active {
|
79 |
+
position:relative;
|
80 |
+
top:1px;
|
81 |
+
}
|
82 |
+
.form-counter {
|
83 |
+
background: #0096d6;
|
84 |
+
border: 1px solid #fff;
|
85 |
+
width: 95%;
|
86 |
+
margin-bottom: 20px;
|
87 |
+
margin-top: 20px;
|
88 |
+
color:#fff;
|
89 |
+
}
|
90 |
+
.log-dropbox {
|
91 |
+
background-repeat: no-repeat; background-position:center;
|
92 |
+
background-color: #fff;
|
93 |
+
height: 211px;
|
94 |
+
width: 170px;
|
95 |
+
float: left;
|
96 |
+
margin-top:-4px;
|
97 |
+
border: 1px solid #47a3ec;
|
98 |
+
border-radius:3px;
|
99 |
+
}
|
100 |
+
.block-content {
|
101 |
+
background-color: #fff;
|
102 |
+
border: 1px solid #e8e8e8;
|
103 |
+
padding: 10px;
|
104 |
+
}
|
105 |
+
#logs-form, #reviews-dropbox, #action-buttons {
|
106 |
+
float:left;
|
107 |
+
}
|
108 |
+
#logs-form, #reviews-dropbox {
|
109 |
+
padding: 10px; background: #ffffc8; border: 1px solid #0096d6; position: relative; height: 100px; text-align: center;
|
110 |
+
}
|
111 |
+
#reviews-dropbox {
|
112 |
+
float: right;
|
113 |
+
height: 150px;
|
114 |
+
width: 25%;
|
115 |
+
}
|
116 |
+
#action-buttons {
|
117 |
+
margin-right: 10px;
|
118 |
+
float:left;
|
119 |
+
margin-top:130px;
|
120 |
+
}
|
121 |
+
.form-field {
|
122 |
+
padding-top: 0px;
|
123 |
+
margin-bottom: 5px;
|
124 |
+
float: left;
|
125 |
+
margin-left:5px;
|
126 |
+
}
|
127 |
+
|
128 |
+
.title-reviews {
|
129 |
+
font-size: 20px;
|
130 |
+
margin-bottom: 24px;
|
131 |
+
margin-top:23px;
|
132 |
+
}
|
133 |
+
.desc-reviews {
|
134 |
+
font-size: 16px;
|
135 |
+
margin-top:10px;
|
136 |
+
margin-bottom: 20px;
|
137 |
+
}
|
138 |
+
|
139 |
+
.btn-danger {
|
140 |
+
background-color: #da4f49;
|
141 |
+
background-image: linear-gradient(to bottom, #ee5f5b, #bd362f);
|
142 |
+
background-repeat: repeat-x;
|
143 |
+
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
144 |
+
color: #fff;
|
145 |
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
146 |
+
border-radius: 3px;
|
147 |
+
font-size: 11.9px;
|
148 |
+
padding: 2px 10px;
|
149 |
+
cursor: pointer;
|
150 |
+
}
|
151 |
+
.btn-orange {
|
152 |
+
background-color: #f48326;
|
153 |
+
background-image: linear-gradient(to bottom, #cc5d00, #cc5d00);
|
154 |
+
background-repeat: repeat-x;
|
155 |
+
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
156 |
+
color: #fff;
|
157 |
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
158 |
+
border-radius: 3px;
|
159 |
+
font-size: 11.9px;
|
160 |
+
padding: 2px 10px;
|
161 |
+
cursor: pointer;
|
162 |
+
}
|
163 |
+
.btn-orange:hover {
|
164 |
+
color:#fff;
|
165 |
+
background-color: #f38325 ;
|
166 |
+
background-position: 0 -30px;
|
167 |
+
text-decoration: none;
|
168 |
+
transition: background-position 0.1s linear 0s;
|
169 |
+
}
|
170 |
+
.desc-wpadm {
|
171 |
+
clear: both;
|
172 |
+
color: #fff;
|
173 |
+
font-size: 13px;
|
174 |
+
/*font-style: italic;*/
|
175 |
+
}
|
176 |
+
.btn-danger:hover {
|
177 |
+
color:#fff;
|
178 |
+
background-color: #db362f ;
|
179 |
+
background-position: 0 -30px;
|
180 |
+
text-decoration: none;
|
181 |
+
transition: background-position 0.1s linear 0s;
|
182 |
+
}
|
183 |
+
|
184 |
+
.form-counter table tr td{
|
185 |
+
padding: 10px;
|
186 |
+
}
|
187 |
+
.color-picker {
|
188 |
+
margin:10px;
|
189 |
+
}
|
190 |
+
.stat_title {
|
191 |
+
text-align: center;
|
192 |
+
font-size: 24px;
|
193 |
+
margin-top: 20px;
|
194 |
+
}
|
195 |
+
.cfTabsContainer {
|
196 |
+
background-color: #0096d6;
|
197 |
+
overflow: hidden;
|
198 |
+
width:95%;
|
199 |
+
padding: 15px;
|
200 |
+
margin-bottom: 40px;
|
201 |
+
margin-top: 14px;
|
202 |
+
-webkit-font-smoothing: antialiased;
|
203 |
+
}
|
204 |
+
|
205 |
+
|
206 |
+
.button-wpadm {
|
207 |
+
background: none repeat scroll 0 0 #00d2b8;
|
208 |
+
border-color: #cdcdcd;
|
209 |
+
box-shadow: 0 1px 0 #00d2b8 inset, 0 1px 0 rgba(0, 0, 0, 0.08);
|
210 |
+
color: #fff;
|
211 |
+
vertical-align: top;
|
212 |
+
border-radius: 3px;
|
213 |
+
border-style: solid;
|
214 |
+
border-width: 1px;
|
215 |
+
box-sizing: border-box;
|
216 |
+
cursor: pointer;
|
217 |
+
display: inline-block;
|
218 |
+
font-size: 13px;
|
219 |
+
height: 28px;
|
220 |
+
line-height: 26px;
|
221 |
+
margin: 0;
|
222 |
+
padding: 0 10px 1px;
|
223 |
+
text-decoration: none;
|
224 |
+
white-space: nowrap;
|
225 |
+
}
|
226 |
+
.wpadm-info {
|
227 |
+
font-size: 15px;
|
228 |
+
width: 30%;
|
229 |
+
margin-top:10px;
|
230 |
+
margin-left: 20px;
|
231 |
+
margin-bottom: 20px;
|
232 |
+
border-left: 1px solid #fff;
|
233 |
+
padding-left:20px;
|
234 |
+
padding-top: 20px;
|
235 |
+
height:200px;
|
236 |
+
}
|
237 |
+
.wpadm-info-title {
|
238 |
+
text-align:center;
|
239 |
+
padding:5px;
|
240 |
+
color:#fff;
|
241 |
+
font-size:20px;
|
242 |
+
}
|
243 |
+
.wpadm-registr-info {
|
244 |
+
width: 65%;
|
245 |
+
}
|
246 |
+
.wpadm-registr-info label {
|
247 |
+
color:#fff;
|
248 |
+
}
|
249 |
+
.wpadm-plugins-info {
|
250 |
+
width: 95%;
|
251 |
+
}
|
252 |
+
.services-info {
|
253 |
+
background: #fff; width: 95%; margin-top: 20px;
|
254 |
+
}
|
255 |
+
.title-services {
|
256 |
+
text-align: center; font-size: 20px; font-weight: 800; padding-bottom: 30px; padding-top: 20px;
|
257 |
+
}
|
258 |
+
|
259 |
+
.tmpl_line_body {
|
260 |
+
float: left;
|
261 |
+
margin: 0;
|
262 |
+
padding: 0;
|
263 |
+
position: relative;
|
264 |
+
width: 100%;
|
265 |
+
}
|
266 |
+
.wpadm-info-auth {
|
267 |
+
font-size: 11px;
|
268 |
+
padding-left:20px;
|
269 |
+
height:30px;
|
270 |
+
color:#fff;
|
271 |
+
margin-top: -5px;
|
272 |
+
}
|
273 |
+
#header_navigation_line {
|
274 |
+
background-color: #21759b;
|
275 |
+
background-image: linear-gradient(to bottom, #2a95c5, #21759b);
|
276 |
+
box-shadow: 0 2px 7px 2px rgba(50, 50, 50, 0.5);
|
277 |
+
height: 68px;
|
278 |
+
left: 0;
|
279 |
+
top: 0;
|
280 |
+
z-index: 1000;
|
281 |
+
}
|
282 |
+
#header_navigation_line #main_menu ul li {
|
283 |
+
display: inline-block;
|
284 |
+
float: none;
|
285 |
+
font-size: 14px;
|
286 |
+
font-weight: bold;
|
287 |
+
list-style: outside none none;
|
288 |
+
margin: 0;
|
289 |
+
padding: 0;
|
290 |
+
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
|
291 |
+
}
|
292 |
+
.inline-right {
|
293 |
+
float:right;
|
294 |
+
}
|
295 |
+
.inline {
|
296 |
+
float:left;
|
297 |
+
}
|
298 |
+
.inline-right, .inline {
|
299 |
+
margin-top:10px;
|
300 |
+
margin-left:10px;
|
301 |
+
}
|
302 |
+
#header_navigation_line #main_menu ul li a {
|
303 |
+
background: -moz-linear-gradient(center top , #2e9ed2 5%, #21749b 100%) repeat scroll 0 0 #2e9ed2;
|
304 |
+
border: 1px solid #1b5f7f;
|
305 |
+
border-radius: 3px;
|
306 |
+
box-shadow: 1px 1px 0 0 #78c9e6 inset;
|
307 |
+
color: #dddddd;
|
308 |
+
display: inline-block;
|
309 |
+
float: left;
|
310 |
+
height: 43px;
|
311 |
+
line-height: 16px;
|
312 |
+
margin: 0 2px 0 0;
|
313 |
+
overflow: hidden;
|
314 |
+
padding: 5px 0;
|
315 |
+
text-decoration: none;
|
316 |
+
width: 90px;
|
317 |
+
}
|
318 |
+
#header_navigation_line #main_menu ul li:hover a {
|
319 |
+
background-image: linear-gradient(to bottom, #2fb1e5, #22759c);
|
320 |
+
color: #fff;
|
321 |
+
}
|
322 |
+
#header_navigation_line #main_menu {
|
323 |
+
float: left;
|
324 |
+
margin: 6px 0 0;
|
325 |
+
width: 100%;
|
326 |
+
}
|
327 |
+
#header_navigation_line #logo {
|
328 |
+
float: left;
|
329 |
+
left: 0;
|
330 |
+
position: absolute;
|
331 |
+
top: 9px;
|
332 |
+
width: auto;
|
333 |
+
}
|
334 |
+
#header_navigation_line #main_menu ul {
|
335 |
+
float: left;
|
336 |
+
list-style: outside none none;
|
337 |
+
margin: 0 0 0 20px;
|
338 |
+
padding: 0;
|
339 |
+
text-align: center;
|
340 |
+
width: 100%;
|
341 |
+
}
|
342 |
+
#header_navigation_line #main_menu ul li .nav_icon {
|
343 |
+
float: left;
|
344 |
+
height: 24px;
|
345 |
+
margin: 0;
|
346 |
+
padding: 0 0 3px;
|
347 |
+
width: 100%;
|
348 |
+
}
|
349 |
+
#header_navigation_line #main_menu ul li.active a, #header_navigation_line #main_menu ul li a:active {
|
350 |
+
background-image: linear-gradient(to bottom, #2cc4f5, #228bb4);
|
351 |
+
border: 1px solid #fff;
|
352 |
+
box-shadow: 0 1px 0 rgba(95, 157, 186, 0.6);
|
353 |
+
color: #fff;
|
354 |
+
}
|
355 |
+
.clear {
|
356 |
+
clear:both;
|
357 |
+
}
|
358 |
+
.plugins-info {
|
359 |
+
width:320px;
|
360 |
+
}
|
361 |
+
.plugin-box {
|
362 |
+
background: #0096d6;
|
363 |
+
border: 1px solid #e5e5e5;
|
364 |
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
365 |
+
min-width: 255px;
|
366 |
+
position: relative;
|
367 |
+
line-height: 1;
|
368 |
+
margin-bottom: 20px;
|
369 |
+
padding: 0;
|
370 |
+
}
|
371 |
+
|
372 |
+
.plugins-info-content {
|
373 |
+
display:none;
|
374 |
+
border-top: 1px solid #fff;
|
375 |
+
margin-top:8px;
|
376 |
+
padding-top: 7px;
|
377 |
+
}
|
378 |
+
h3.plugins-title {
|
379 |
+
font-size: 14px;
|
380 |
+
line-height: 1.4;
|
381 |
+
margin: 0;
|
382 |
+
}
|
383 |
+
.plugins-title a {
|
384 |
+
color:#fff;
|
385 |
+
text-decoration: none;
|
386 |
+
|
387 |
+
}
|
388 |
+
.wpadm-registr-info, .wpadm-info, .wpadm-info-auth {
|
389 |
+
float:left;
|
390 |
+
color:#fff;
|
391 |
+
}
|
392 |
+
.button-wpadm:hover {
|
393 |
+
border-color:#cdcdcd;
|
394 |
+
background-color: #009583;
|
395 |
+
}
|
396 |
+
.wpadm-red:hover {
|
397 |
+
border-color:#737373 ;
|
398 |
+
background-color: #ff706c;
|
399 |
+
}
|
400 |
+
.wpadm-red {
|
401 |
+
background: none repeat scroll 0 0 #f21111;
|
402 |
+
border-color: #c7c6ce;
|
403 |
+
box-shadow: 0 1px 0 #ff2c26 inset, 0 1px 0 rgba(0, 0, 0, 0.08);
|
404 |
+
}
|
405 |
+
.info-detail {
|
406 |
+
background:#bee7e7;
|
407 |
+
}
|
408 |
+
.table {
|
409 |
+
margin:0px;padding:0px;
|
410 |
+
width:100%;
|
411 |
+
border:0px;
|
412 |
+
border-collapse: collapse;
|
413 |
+
border-spacing: 0;
|
414 |
+
width:100%;
|
415 |
+
height:100%;
|
416 |
+
border: 1px solid #b7c6ff;
|
417 |
+
border-radius: 3px;
|
418 |
+
margin-top: 60px;
|
419 |
+
|
420 |
+
}
|
421 |
+
.table th {
|
422 |
+
padding: 7px;
|
423 |
+
background-color:#dde4ff;
|
424 |
+
font-size:16px;
|
425 |
+
|
426 |
+
}
|
427 |
+
.title-logs, .title-status {
|
428 |
+
margin-bottom: 10px;
|
429 |
+
}
|
430 |
+
.help-key-secret {
|
431 |
+
font-size: 11px;
|
432 |
+
text-align: right;
|
433 |
+
color:#fff;
|
434 |
+
cursor: pointer;
|
435 |
+
}
|
436 |
+
.help-key-secret:hover {
|
437 |
+
color:#fff;
|
438 |
+
text-decoration:underline;
|
439 |
+
}
|
440 |
+
#log-backup div {
|
441 |
+
font-size:12px;
|
442 |
+
}
|
443 |
+
.table td {
|
444 |
+
background: #fff;
|
445 |
+
font-size: 12px;
|
446 |
+
padding: 5px 0;
|
447 |
+
border-bottom:1px solid #b7c6ff;
|
448 |
+
text-align: center;
|
449 |
+
}
|
450 |
+
.info-path td {
|
451 |
+
font-size: 11px;
|
452 |
+
padding:0px;
|
453 |
+
}
|
454 |
+
.table tr:last td {
|
455 |
+
|
456 |
+
border-bottom: 0px;
|
457 |
+
}
|
458 |
+
.header-table {
|
459 |
+
font-size:20px;
|
460 |
+
}
|
461 |
+
|
462 |
+
.stat {
|
463 |
+
width: 200px;
|
464 |
+
}
|
465 |
+
|
466 |
+
.w1{
|
467 |
+
width:5%;
|
468 |
+
}
|
469 |
+
.w2{
|
470 |
+
width:13%;
|
471 |
+
}
|
472 |
+
.w3{
|
473 |
+
width:7%;
|
474 |
+
}
|
475 |
+
.table-stat-moovdiv {
|
476 |
+
background: none repeat scroll 0 0 #FFFFFF;
|
477 |
+
border-spacing: 0;
|
478 |
+
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.3);
|
479 |
+
left: 0px;
|
480 |
+
margin-top: 0;
|
481 |
+
padding: 10px 15px;
|
482 |
+
top: 0px;
|
483 |
+
width: 400px;
|
484 |
+
}
|
485 |
+
|
486 |
+
.table-stat-moovdiv tr td{
|
487 |
+
border-right: 0px;
|
488 |
+
margin-bottom: 1px;
|
489 |
+
margin-top: 1px;
|
490 |
+
padding-bottom: 1px;
|
491 |
+
padding-top: 1px;
|
492 |
+
border-bottom:1px solid #D6D6D6;
|
493 |
+
padding: 5px;
|
494 |
+
}
|
495 |
+
|
496 |
+
#page_item {
|
497 |
+
margin-bottom:3px;
|
498 |
+
float:left;
|
499 |
+
}
|
500 |
+
.block-export {
|
501 |
+
float: right;
|
502 |
+
margin-right: 20px;
|
503 |
+
}
|
504 |
+
.info {
|
505 |
+
width: 70%;
|
506 |
+
border: 0;
|
507 |
+
}
|
508 |
+
.setting-checkbox {
|
509 |
+
padding-left: 5px;margin-top: 5px;
|
510 |
+
}
|
511 |
+
.form-help-send-error input[type="text"], .form-help-send-error input[type="text"] {
|
512 |
+
padding: 0px;
|
513 |
+
border: 1px solid #999;
|
514 |
+
box-shadow:0px;
|
515 |
+
font-size: 12px;
|
516 |
+
height: 24px;
|
517 |
+
width: 250px;
|
518 |
+
}
|
519 |
+
|
520 |
+
.form-help-send-error, .form-help-mail-response {
|
521 |
+
float:left;
|
522 |
+
}
|
523 |
+
.form-help-mail-response .button-description {
|
524 |
+
text-align: center;
|
525 |
+
}
|
526 |
+
.show-includes {
|
527 |
+
text-align: left;
|
528 |
+
margin-left:20px;
|
529 |
+
margin-right:20px;
|
530 |
+
background: #fff;
|
531 |
+
padding: 20px;
|
532 |
+
}
|
533 |
+
#sent-error-report {
|
534 |
+
background: #fff;
|
535 |
+
width: 400px;
|
536 |
+
height: 200px;
|
537 |
+
text-align: center;
|
538 |
+
border-radius:4px;
|
539 |
+
border: 2px solid #00d2b8;
|
540 |
+
position: relative;
|
541 |
+
}
|
542 |
+
#sent-error-report .text-view {
|
543 |
+
text-align: center;
|
544 |
+
font-size: 20px;
|
545 |
+
padding-top: 50px;
|
546 |
+
line-height: 27px;
|
547 |
+
margin-bottom: 30px;
|
548 |
+
}
|
549 |
+
#sent-error-report .button-sent-report .button-wpadm {
|
550 |
+
padding: 1px 20px;
|
551 |
+
height: auto;
|
552 |
+
}
|
553 |
+
#sent-error-report .button-sent-report {
|
554 |
+
position: absolute;
|
555 |
+
bottom:0px;
|
556 |
+
padding-bottom: 30px;
|
557 |
+
width: 100%;
|
558 |
+
}
|
559 |
+
|
560 |
+
.show-includes input.input-folder[type="checkbox"] + label {
|
561 |
+
font: 18px bold;
|
562 |
+
color: #444;
|
563 |
+
cursor: pointer;
|
564 |
+
}
|
565 |
+
.show-includes input.input-folder[type="checkbox"] + label::before {
|
566 |
+
content: "";
|
567 |
+
display: inline-block;
|
568 |
+
height: 15px;
|
569 |
+
width: 18px;
|
570 |
+
margin: 0 5px 0 0;
|
571 |
+
background-image: url(folder.png);
|
572 |
+
}
|
573 |
+
.loading-img {
|
574 |
+
text-align: center;
|
575 |
+
height: 23px;
|
576 |
+
margin: 0 auto;
|
577 |
+
}
|
578 |
+
.show-includes input.checkbox-send[type="checkbox"] {
|
579 |
+
margin-top:0px;
|
580 |
+
}
|
581 |
+
.show-includes input.input-folder[type="checkbox"]:checked + label::before {
|
582 |
+
background-image: url(icon-folder-open.gif);
|
583 |
+
}
|
584 |
+
.show-includes input.input-folder[type="checkbox"]:checked:disabled + label::before {
|
585 |
+
background-image: url(icon-folder-open.gif);
|
586 |
+
}
|
587 |
+
.show-includes input.input-folder[type="checkbox"] {
|
588 |
+
display:none;
|
589 |
+
}
|
590 |
+
.tree-includes {
|
591 |
+
margin-left: 25px;
|
592 |
+
}
|
593 |
+
|
594 |
+
.form-help-mail-response {
|
595 |
+
margin-left: 20px;
|
596 |
+
}
|
597 |
+
.form-help-send-error .label-help {
|
598 |
+
float:left; width: 100px;
|
599 |
+
padding-top: 8px;
|
600 |
+
}
|
601 |
+
.border-shadow-bottom {
|
602 |
+
-webkit-box-shadow: 0 2px 7px -2px rgba(50, 50, 50, 0.5);
|
603 |
+
-moz-box-shadow: 0 2px 7px -2px rgba(50, 50, 50, 0.5);
|
604 |
+
box-shadow: 0 2px 7px -2px rgba(50, 50, 50, 0.5);
|
605 |
+
}
|
606 |
+
.info tr {
|
607 |
+
border-style: hidden;
|
608 |
+
}
|
609 |
+
.info tr td{
|
610 |
+
border-style: hidden;
|
611 |
+
padding: 5px;
|
612 |
+
text-align:left;
|
613 |
+
}
|
614 |
+
.chart-box {
|
615 |
+
background: #fff;
|
616 |
+
border:1px solid #cccccc;
|
617 |
+
border-radius:3px;
|
618 |
+
margin-top:25px;
|
619 |
+
}
|
620 |
+
.chart-box-title {
|
621 |
+
color:#575757;
|
622 |
+
border-bottom: 1px solid #cccccc;
|
623 |
+
font-size: 18px;
|
624 |
+
padding:10px;
|
625 |
+
}
|
626 |
+
.charts {
|
627 |
+
padding:5px;
|
628 |
+
padding-top: 15px;
|
629 |
+
}
|
630 |
+
.form-account {
|
631 |
+
margin-top: 30px;
|
632 |
+
margin-bottom : 40px;
|
633 |
+
border:5px solid #fff;
|
634 |
+
background: #ffffa5;
|
635 |
+
padding: 10px;
|
636 |
+
height: auto;
|
637 |
+
overflow:hidden;
|
638 |
+
}
|
639 |
+
.form-account-title {
|
640 |
+
margin-bottom: 20px;
|
641 |
+
font-size: 22px;
|
642 |
+
}
|
643 |
+
.form-account-block {
|
644 |
+
margin-left: 20px;
|
645 |
+
float:left;
|
646 |
+
width: 40%;
|
647 |
+
}
|
648 |
+
.form-account-login {
|
649 |
+
margin-top: 10px;
|
650 |
+
margin-bottom : 40px;
|
651 |
+
border:5px solid #fff;
|
652 |
+
background: #ffffa5;
|
653 |
+
padding: 3px;
|
654 |
+
height: auto;
|
655 |
+
overflow:hidden;
|
656 |
+
}
|
657 |
+
|
658 |
+
.form-account-block-login {
|
659 |
+
margin-left: 10px;
|
660 |
+
width: 90%;
|
661 |
+
|
662 |
+
}
|
663 |
+
.form-account-info {
|
664 |
+
float:left;
|
665 |
+
width: 50%;
|
666 |
+
margin-left: 20px;
|
667 |
+
}
|
668 |
+
.b_2 {
|
669 |
+
background: url("button_ok.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
|
670 |
+
color: #464646;
|
671 |
+
font-family: Arial,Helvetica,sans-serif;
|
672 |
+
font-size: 18px;
|
673 |
+
left: 12px;
|
674 |
+
padding-left: 30px;
|
675 |
+
top: 60px;
|
676 |
+
padding-top: 4px;
|
677 |
+
padding-bottom : 5px;
|
678 |
+
}
|
679 |
+
.b-3 {
|
680 |
+
font-size: 22px;
|
681 |
+
}
|
682 |
+
.form-account-button {
|
683 |
+
margin-top: 21px;
|
684 |
+
}
|
685 |
+
.label-form {
|
686 |
+
margin-left: 6px;
|
687 |
+
font-size: 16px;
|
688 |
+
}
|
689 |
+
.last {
|
690 |
+
line-height: 18px;
|
691 |
+
margin-top: 9px;
|
692 |
+
}
|
693 |
+
.progress {
|
694 |
+
height: 20px;
|
695 |
+
background: #ebebeb;
|
696 |
+
border-left: 1px solid transparent;
|
697 |
+
border-right: 1px solid transparent;
|
698 |
+
border-radius: 10px;
|
699 |
+
}
|
700 |
+
.progress > span {
|
701 |
+
position: relative;
|
702 |
+
float: left;
|
703 |
+
margin: 0 -1px;
|
704 |
+
min-width: 30px;
|
705 |
+
height: 18px;
|
706 |
+
line-height: 16px;
|
707 |
+
text-align: right;
|
708 |
+
background: #cccccc;
|
709 |
+
border: 1px solid;
|
710 |
+
border-color: #bfbfbf #b3b3b3 #9e9e9e;
|
711 |
+
border-radius: 10px;
|
712 |
+
background-image: -webkit-linear-gradient(top, #f0f0f0, #dbdbdb 70%, #cccccc);
|
713 |
+
background-image: -moz-linear-gradient(top, #f0f0f0, #dbdbdb 70%, #cccccc);
|
714 |
+
background-image: -o-linear-gradient(top, #f0f0f0, #dbdbdb 70%, #cccccc);
|
715 |
+
background-image: linear-gradient(to bottom, #f0f0f0, #dbdbdb 70%, #cccccc);
|
716 |
+
-webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
|
717 |
+
box-shadow: inset 0 1px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
|
718 |
+
}
|
719 |
+
.progress > span > span {
|
720 |
+
padding: 0 8px;
|
721 |
+
font-size: 11px;
|
722 |
+
font-weight: bold;
|
723 |
+
color: #404040;
|
724 |
+
color: rgba(0, 0, 0, 0.7);
|
725 |
+
text-shadow: 0 1px rgba(255, 255, 255, 0.4);
|
726 |
+
}
|
727 |
+
.progress > span:before {
|
728 |
+
content: '';
|
729 |
+
position: absolute;
|
730 |
+
top: 0;
|
731 |
+
bottom: 0;
|
732 |
+
left: 0;
|
733 |
+
right: 0;
|
734 |
+
z-index: 1;
|
735 |
+
height: 18px;
|
736 |
+
border-radius: 10px;
|
737 |
+
}
|
738 |
+
|
739 |
+
|
740 |
+
|
741 |
+
.stat-form-counter {
|
742 |
+
background: none repeat scroll 0 0 #0096d6;
|
743 |
+
color: #fff;
|
744 |
+
margin-bottom: 20px;
|
745 |
+
width: 46%;
|
746 |
+
margin-right: 0;
|
747 |
+
border: 0;
|
748 |
+
padding: 3px;
|
749 |
+
}
|
750 |
+
.stat-wpadm-registr-info {
|
751 |
+
color: #fff;
|
752 |
+
float: left;
|
753 |
+
width: 57%;
|
754 |
+
}
|
755 |
+
.stat-wpadm-registr-info label {
|
756 |
+
color:#fff;
|
757 |
+
}
|
758 |
+
.stat-wpadm-info-title {
|
759 |
+
color: #fff;
|
760 |
+
font-size: 20px;
|
761 |
+
padding :20px 0px;
|
762 |
+
margin-top:10px;
|
763 |
+
text-align: center;
|
764 |
+
}
|
765 |
+
.stat-table-registr {
|
766 |
+
margin-top: 20px;
|
767 |
+
}
|
768 |
+
.stat-table-registr th, .stat-table-registr td {
|
769 |
+
padding:5px;
|
770 |
+
}
|
771 |
+
.stat-wpadm-info {
|
772 |
+
width: 37%; margin-left: 9px; height:100%; padding-top: 0px; margin-top:20px;
|
773 |
+
color: #fff;
|
774 |
+
float: left;
|
775 |
+
border-left: 1px solid #fff;
|
776 |
+
font-size: 12px;
|
777 |
+
margin-bottom: 20px;
|
778 |
+
padding-left: 20px;
|
779 |
+
}
|
780 |
+
.block-button-show {
|
781 |
+
padding:11px 18px; cursor: pointer; text-align: center;
|
782 |
+
}
|
783 |
+
.block-button-show .block-click {
|
784 |
+
padding-top: 10px;
|
785 |
+
font-size: 16px;
|
786 |
+
border-top:1px solid #fff;
|
787 |
+
}
|
788 |
+
.stat-setting {
|
789 |
+
border-left:1px solid #fff;
|
790 |
+
margin-right: 0px;
|
791 |
+
}
|
792 |
+
#stat-title-setting{
|
793 |
+
font-size: 20px;
|
794 |
+
margin-top: 10px;
|
795 |
+
padding: 20px 0;
|
796 |
+
text-align: center;
|
797 |
+
}
|
798 |
+
#preview-image {
|
799 |
+
height: 105px; float: left; margin-right: 10px; margin-top:45px;
|
800 |
+
}
|
801 |
+
#preview-image .block-preview-image {
|
802 |
+
padding: 10px; border: 1px solid #fff; margin-left: 10px; margin-top:20px; width: 90px; text-align: center;
|
803 |
+
}
|
804 |
+
#preview-image .title-preveiw-image {
|
805 |
+
font-size: 16px; position: absolute;margin-top: -28px; margin-left: 7px;background: #0096d6; padding: 3px;
|
806 |
+
}
|
807 |
+
#preview-image .image-block {
|
808 |
+
display: table;
|
809 |
+
}
|
810 |
+
.image-block .image-block-in {
|
811 |
+
display: table-cell; vertical-align: middle;
|
812 |
+
}
|
813 |
+
.image-block-in img {
|
814 |
+
float: left;margin-top:7px;
|
815 |
+
margin-left: 2px;
|
816 |
+
}
|
817 |
+
.image-block-in .text-image-counter {
|
818 |
+
float: left;
|
819 |
+
padding-left:3px;
|
820 |
+
font-size: 8px;
|
821 |
+
font-weight: 600;
|
822 |
+
}
|
823 |
+
#setting-form .info-block {
|
824 |
+
float: left; margin: 5px 0px 0px; width:74%;
|
825 |
+
}
|
826 |
+
#setting-form .first-info-block {
|
827 |
+
margin: 20px 0px 0px;
|
828 |
+
}
|
829 |
+
.info-block-detail {
|
830 |
+
float:left;
|
831 |
+
}
|
832 |
+
.detail-title {
|
833 |
+
margin: 0 5px; width: 30%;
|
834 |
+
}
|
835 |
+
#setting-form .info-block .details-info {
|
836 |
+
width: auto;
|
837 |
+
font-size: 10px;
|
838 |
+
margin:0px;
|
839 |
+
}
|
840 |
+
#setting-form .info-block input[type="text"] {
|
841 |
+
font-size: 14px;
|
842 |
+
height: 28px;
|
843 |
+
}
|
844 |
+
.info-block .checkbox-info {
|
845 |
+
width:101px;
|
846 |
+
text-align:right;
|
847 |
+
}
|
848 |
+
.checkbox-info input[type="checkbox"] {
|
849 |
+
margin-right: 0px;
|
850 |
+
}
|
851 |
+
.stat-setting-save {
|
852 |
+
text-align: center; margin-top: 10px;
|
853 |
+
}
|
854 |
+
|
855 |
+
/*default style */
|
856 |
+
@media only screen and (max-width: 960px) {
|
857 |
+
/*
|
858 |
+
tablet computer
|
859 |
+
*/
|
860 |
+
.stat-wpadm-info {
|
861 |
+
margin-left: 9px; height:100%; padding-top: 0px; margin-top:20px;
|
862 |
+
color: #fff;
|
863 |
+
float: none;
|
864 |
+
clear:both;
|
865 |
+
border-left: 0px;
|
866 |
+
border-top:1px solid #fff;
|
867 |
+
font-size: 10px;
|
868 |
+
margin-bottom: 10px;
|
869 |
+
padding-left: 0px;
|
870 |
+
width:88%;
|
871 |
+
}
|
872 |
+
|
873 |
+
.stat-table-registr th, .stat-table-registr td {
|
874 |
+
padding:2px;
|
875 |
+
font-size:10px;
|
876 |
+
}
|
877 |
+
.stat-table-registr {
|
878 |
+
margin-top: 10px;
|
879 |
+
float:none;
|
880 |
+
}
|
881 |
+
.form-table label {
|
882 |
+
color:#fff;
|
883 |
+
}
|
884 |
+
.form-table th {
|
885 |
+
line-height: 10px;
|
886 |
+
}
|
887 |
+
.stat-table-registr input {
|
888 |
+
font-size: 10px;
|
889 |
+
height: 20px;
|
890 |
+
line-height: 10px;
|
891 |
+
}
|
892 |
+
.stat-form-counter {
|
893 |
+
font-size:10px;
|
894 |
+
margin-right:5px;
|
895 |
+
}
|
896 |
+
#setting-form .info-block {
|
897 |
+
width:60%;
|
898 |
+
}
|
899 |
+
#preview-image {
|
900 |
+
height: 105px;
|
901 |
+
float: left;
|
902 |
+
margin-right: 10px;
|
903 |
+
}
|
904 |
+
.detail-title {
|
905 |
+
margin: 0 5px; width:auto;
|
906 |
+
}
|
907 |
+
#setting-form .info-block .details-info {
|
908 |
+
width: auto;
|
909 |
+
font-size: 8px;
|
910 |
+
float:none;
|
911 |
+
clear:both;
|
912 |
+
line-height: 8px;
|
913 |
+
margin-bottom:5px;
|
914 |
+
|
915 |
+
}
|
916 |
+
.info-block .checkbox-info {
|
917 |
+
width:28px;
|
918 |
+
}
|
919 |
+
#setting-form .info-block input[type="text"] {
|
920 |
+
font-size:12px;
|
921 |
+
height: 20px;
|
922 |
+
}
|
923 |
+
.minicolors-theme-default.minicolors-position-right .minicolors-input {
|
924 |
+
padding-right: 10px;
|
925 |
+
}
|
926 |
+
|
927 |
+
.minicolors-theme-default .minicolors-swatch {
|
928 |
+
height: 18px;
|
929 |
+
left: 5px;
|
930 |
+
top: 1px;
|
931 |
+
width: 18px;
|
932 |
+
}
|
933 |
+
|
934 |
+
}
|
935 |
+
@media only screen and (max-width: 1124px) {
|
936 |
+
.stat-form-counter {
|
937 |
+
font-size:10px;
|
938 |
+
margin-right:3.5%;
|
939 |
+
}
|
940 |
+
#setting-form .info-block {
|
941 |
+
width:55%;
|
942 |
+
}
|
943 |
+
#preview-image {
|
944 |
+
height: 105px;
|
945 |
+
float: left;
|
946 |
+
margin-right: 10px;
|
947 |
+
margin-top:40px;
|
948 |
+
}
|
949 |
+
.info-block input[type="text"] {
|
950 |
+
font-size:12px;
|
951 |
+
height: 20px;
|
952 |
+
}
|
953 |
+
.dbb-info-details-form {
|
954 |
+
line-height: 16px;
|
955 |
+
margin:7px;
|
956 |
+
padding:7px 11px;
|
957 |
+
font-size:14px;
|
958 |
+
}
|
959 |
+
.dbb-info-details-form .button-submit {
|
960 |
+
padding:5px;
|
961 |
+
margin-top:11px;
|
962 |
+
margin-bottom:18px;
|
963 |
+
|
964 |
+
}
|
965 |
+
|
966 |
+
}
|
967 |
+
@media only screen and (max-width: 758px) {
|
968 |
+
/*
|
969 |
+
vertical tablet computer
|
970 |
+
*/
|
971 |
+
.dbb-info-details-form {
|
972 |
+
font-size:10px;
|
973 |
+
line-height: 10px;
|
974 |
+
margin:5px;
|
975 |
+
padding:5px 9px;
|
976 |
+
}
|
977 |
+
.dbb-info-details-form .button-submit {
|
978 |
+
padding:3px;
|
979 |
+
margin-top:7px;
|
980 |
+
margin-bottom:15px;
|
981 |
+
}
|
982 |
+
}
|
983 |
+
@media only screen and (max-width: 524px) {
|
984 |
+
/*phone*/
|
985 |
+
.dbb-info-details-form {
|
986 |
+
font-size:8px;
|
987 |
+
line-height: 8px;
|
988 |
+
margin:6px;
|
989 |
+
padding:5px 7px;
|
990 |
+
}
|
991 |
+
.dbb-info-details-form .button-submit {
|
992 |
+
padding:1px;
|
993 |
+
margin-top:5px;
|
994 |
+
margin-bottom:8px;
|
995 |
+
}
|
996 |
+
}
|
template/css/folder.png
ADDED
Binary file
|
template/css/icon-folder-open.gif
ADDED
Binary file
|
template/css/index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// bla-bla-bla-bla
|
template/dropbox_pro_logo_box1.png
ADDED
Binary file
|
template/expsys.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$str = '';
|
3 |
+
foreach($data['sys'] as $key => $value) {
|
4 |
+
$str .= $value['function'];
|
5 |
+
}
|
6 |
+
?>
|
7 |
+
<script>
|
8 |
+
function showView()
|
9 |
+
{
|
10 |
+
if(jQuery('.body-functions-view').css('display') == 'none') {
|
11 |
+
jQuery('.body-functions-view').show('slow');
|
12 |
+
} else {
|
13 |
+
jQuery('.body-functions-view').hide('slow');
|
14 |
+
}
|
15 |
+
}
|
16 |
+
</script>
|
17 |
+
<div class="functions-view">
|
18 |
+
<div class="title-functions-view" onclick="showView();">
|
19 |
+
<?php echo $str; ?>
|
20 |
+
</div>
|
21 |
+
<div class="body-functions-view">
|
22 |
+
<?php echo $functions_need; ?>
|
23 |
+
</div>
|
24 |
+
</div>
|
25 |
+
<?php
|
template/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php
|
template/js/admin-wpadm.js
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function showTab (elem, type)
|
2 |
+
{
|
3 |
+
jQuery('.cfTab').removeClass('selected');
|
4 |
+
jQuery('.cfContentContainer').hide();
|
5 |
+
jQuery(elem).addClass('selected');
|
6 |
+
jQuery('#cf_' + type).fadeIn();
|
7 |
+
}
|
8 |
+
|
9 |
+
var shows_id = ""
|
10 |
+
var shows_t = ""
|
11 |
+
function shows(id, t)
|
12 |
+
{
|
13 |
+
if(document.getElementById(id).style.display == "none") {
|
14 |
+
document.getElementById(id).style.display = "table-row";
|
15 |
+
jQuery(t).parent("tr").addClass('border-shadow-bottom');
|
16 |
+
if (shows_id == "") {
|
17 |
+
shows_id = id;
|
18 |
+
shows_t = t;
|
19 |
+
} else {
|
20 |
+
if(shows_id != id) {
|
21 |
+
document.getElementById(shows_id).style.display = "none";
|
22 |
+
jQuery(shows_t).parent("tr").removeClass('border-shadow-bottom');
|
23 |
+
}
|
24 |
+
shows_id = id;
|
25 |
+
shows_t = t;
|
26 |
+
}
|
27 |
+
} else if(document.getElementById(id).style.display == "table-row") {
|
28 |
+
document.getElementById(id).style.display = "none";
|
29 |
+
jQuery(t).parent("tr").removeClass('border-shadow-bottom');
|
30 |
+
}
|
31 |
+
}
|
32 |
+
var bl = false;
|
33 |
+
function show_form_auth(file_val)
|
34 |
+
{
|
35 |
+
if (file_val == 'registr') {
|
36 |
+
showRegistInfo(false);
|
37 |
+
if (bl === false) {
|
38 |
+
blick('container-user');
|
39 |
+
bl = true;
|
40 |
+
}
|
41 |
+
} else {
|
42 |
+
html = '<input type="hidden" value="' + file_val +'" name="internal_identifier">';
|
43 |
+
jQuery('#form_auth_backup').html(html);
|
44 |
+
document.form_auth_backup.submit();
|
45 |
+
}
|
46 |
+
}
|
47 |
+
var blick_form = true;
|
48 |
+
function blick(id, border_)
|
49 |
+
{
|
50 |
+
if (border_ == 'undefined') {
|
51 |
+
border_ = 10;
|
52 |
+
}
|
53 |
+
jQuery('#' + id).css({
|
54 |
+
outline: "0px solid #cd433d",
|
55 |
+
border: "0px"
|
56 |
+
}).animate({
|
57 |
+
outlineWidth: border_ + 'px',
|
58 |
+
outlineColor: '#cd433d'
|
59 |
+
}, 400).animate({outlineWidth: '0px',outlineColor: '#cd433d' } , 400);
|
60 |
+
if (blick_form) {
|
61 |
+
setTimeout('blick("' + id + '", ' + border_ + ')', 800);
|
62 |
+
}
|
63 |
+
}
|
template/js/index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// bla-bla-bla-bla
|
template/js/jquery.arcticmodal-0.3.css
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.arcticmodal-overlay,
|
2 |
+
.arcticmodal-container { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 99999; }
|
3 |
+
.arcticmodal-container { overflow: auto; margin: 0; padding: 0; border: 0; border-collapse: collapse; }
|
4 |
+
*:first-child+html .arcticmodal-container { height: 100% }
|
5 |
+
.arcticmodal-container_i { height: 100%; margin: 0 auto;background: none;border:none; }
|
6 |
+
.arcticmodal-container_i2 { padding: 24px; margin: 0; border: 0; vertical-align: middle; }
|
7 |
+
.arcticmodal-error { padding: 20px; border-radius: 10px; background: #000; color: #fff; }
|
8 |
+
.arcticmodal-loading { width: 80px; height: 80px; border-radius: 10px; background: #000 url(loading.gif) no-repeat 50% 50%; }
|
template/js/jquery.arcticmodal-0.3.min.js
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
|
3 |
+
arcticModal — jQuery plugin
|
4 |
+
Version: 0.3
|
5 |
+
Author: Sergey Predvoditelev (sergey.predvoditelev@gmail.com)
|
6 |
+
Company: Arctic Laboratory (http://arcticlab.ru/)
|
7 |
+
|
8 |
+
Docs & Examples: http://arcticlab.ru/arcticmodal/
|
9 |
+
|
10 |
+
*/
|
11 |
+
(function(d){var g={type:"html",content:"",url:"",ajax:{},ajax_request:null,closeOnEsc:!0,closeOnOverlayClick:!0,clone:!1,overlay:{block:void 0,tpl:'<div class="arcticmodal-overlay"></div>',css:{backgroundColor:"#000",opacity:0.6}},container:{block:void 0,tpl:'<div class="arcticmodal-container"><table class="arcticmodal-container_i"><tr><td class="arcticmodal-container_i2"></td></tr></table></div>'},wrap:void 0,body:void 0,errors:{tpl:'<div class="arcticmodal-error arcticmodal-close"></div>',autoclose_delay:2E3,
|
12 |
+
ajax_unsuccessful_load:"Error"},openEffect:{type:"fade",speed:400},closeEffect:{type:"fade",speed:400},beforeOpen:d.noop,afterOpen:d.noop,beforeClose:d.noop,afterClose:d.noop,afterLoading:d.noop,afterLoadingOnShow:d.noop,errorLoading:d.noop},j=0,e=d([]),m={isEventOut:function(a,b){var c=!0;d(a).each(function(){d(b.target).get(0)==d(this).get(0)&&(c=!1);0==d(b.target).closest("HTML",d(this).get(0)).length&&(c=!1)});return c}},f={getParentEl:function(a){var b=d(a);return b.data("arcticmodal")?b:(b=
|
13 |
+
d(a).closest(".arcticmodal-container").data("arcticmodalParentEl"))?b:!1},transition:function(a,b,c,e){e=void 0==e?d.noop:e;switch(c.type){case "fade":"show"==b?a.fadeIn(c.speed,e):a.fadeOut(c.speed,e);break;case "none":"show"==b?a.show():a.hide(),e()}},prepare_body:function(a,b){d(".arcticmodal-close",a.body).unbind("click.arcticmodal").bind("click.arcticmodal",function(){b.arcticmodal("close");return!1})},init_el:function(a,b){var c=a.data("arcticmodal");if(!c){c=b;j++;c.modalID=j;c.overlay.block=
|
14 |
+
d(c.overlay.tpl);c.overlay.block.css(c.overlay.css);c.container.block=d(c.container.tpl);c.body=d(".arcticmodal-container_i2",c.container.block);b.clone?c.body.html(a.clone(!0)):(a.before('<div id="arcticmodalReserve'+c.modalID+'" style="display: none" />'),c.body.html(a));f.prepare_body(c,a);c.closeOnOverlayClick&&c.overlay.block.add(c.container.block).click(function(b){m.isEventOut(d(">*",c.body),b)&&a.arcticmodal("close")});c.container.block.data("arcticmodalParentEl",a);a.data("arcticmodal",c);
|
15 |
+
e=d.merge(e,a);d.proxy(h.show,a)();if("html"==c.type)return a;if(void 0!=c.ajax.beforeSend){var k=c.ajax.beforeSend;delete c.ajax.beforeSend}if(void 0!=c.ajax.success){var g=c.ajax.success;delete c.ajax.success}if(void 0!=c.ajax.error){var l=c.ajax.error;delete c.ajax.error}var n=d.extend(!0,{url:c.url,beforeSend:function(){void 0==k?c.body.html('<div class="arcticmodal-loading" />'):k(c,a)},success:function(b){a.trigger("afterLoading");c.afterLoading(c,a,b);void 0==g?c.body.html(b):g(c,a,b);f.prepare_body(c,
|
16 |
+
a);a.trigger("afterLoadingOnShow");c.afterLoadingOnShow(c,a,b)},error:function(){a.trigger("errorLoading");c.errorLoading(c,a);void 0==l?(c.body.html(c.errors.tpl),d(".arcticmodal-error",c.body).html(c.errors.ajax_unsuccessful_load),d(".arcticmodal-close",c.body).click(function(){a.arcticmodal("close");return!1}),c.errors.autoclose_delay&&setTimeout(function(){a.arcticmodal("close")},c.errors.autoclose_delay)):l(c,a)}},c.ajax);c.ajax_request=d.ajax(n);a.data("arcticmodal",c)}},init:function(a){a=
|
17 |
+
d.extend(!0,{},g,a);if(d.isFunction(this))if(void 0==a)d.error("jquery.arcticmodal: Uncorrect parameters");else if(""==a.type)d.error('jquery.arcticmodal: Don\'t set parameter "type"');else switch(a.type){case "html":if(""==a.content){d.error('jquery.arcticmodal: Don\'t set parameter "content"');break}var b=a.content;a.content="";return f.init_el(d(b),a);case "ajax":if(""==a.url){d.error('jquery.arcticmodal: Don\'t set parameter "url"');break}return f.init_el(d("<div />"),a)}else return this.each(function(){f.init_el(d(this),
|
18 |
+
d.extend(!0,{},a))})}},h={show:function(){var a=f.getParentEl(this);if(!1===a)d.error("jquery.arcticmodal: Uncorrect call");else{var b=a.data("arcticmodal");b.overlay.block.hide();b.container.block.hide();d("BODY").append(b.overlay.block);d("BODY").append(b.container.block);b.beforeOpen(b,a);a.trigger("beforeOpen");if("hidden"!=b.wrap.css("overflow")){b.wrap.data("arcticmodalOverflow",b.wrap.css("overflow"));var c=b.wrap.outerWidth(!0);b.wrap.css("overflow","hidden");var g=b.wrap.outerWidth(!0);g!=
|
19 |
+
c&&b.wrap.css("marginRight",g-c+"px")}e.not(a).each(function(){d(this).data("arcticmodal").overlay.block.hide()});f.transition(b.overlay.block,"show",1<e.length?{type:"none"}:b.openEffect);f.transition(b.container.block,"show",1<e.length?{type:"none"}:b.openEffect,function(){b.afterOpen(b,a);a.trigger("afterOpen")});return a}},close:function(){if(d.isFunction(this))e.each(function(){d(this).arcticmodal("close")});else return this.each(function(){var a=f.getParentEl(this);if(!1===a)d.error("jquery.arcticmodal: Uncorrect call");
|
20 |
+
else{var b=a.data("arcticmodal");!1!==b.beforeClose(b,a)&&(a.trigger("beforeClose"),e.not(a).last().each(function(){d(this).data("arcticmodal").overlay.block.show()}),f.transition(b.overlay.block,"hide",1<e.length?{type:"none"}:b.closeEffect),f.transition(b.container.block,"hide",1<e.length?{type:"none"}:b.closeEffect,function(){b.afterClose(b,a);a.trigger("afterClose");b.clone||d("#arcticmodalReserve"+b.modalID).replaceWith(b.body.find(">*"));b.overlay.block.remove();b.container.block.remove();a.data("arcticmodal",
|
21 |
+
null);d(".arcticmodal-container").length||(b.wrap.data("arcticmodalOverflow")&&b.wrap.css("overflow",b.wrap.data("arcticmodalOverflow")),b.wrap.css("marginRight",0))}),"ajax"==b.type&&b.ajax_request.abort(),e=e.not(a))}})},setDefault:function(a){d.extend(!0,g,a)}};d(function(){g.wrap=d(document.all&&!document.querySelector?"html":"body")});d(document).bind("keyup.arcticmodal",function(a){var b=e.last();b.length&&b.data("arcticmodal").closeOnEsc&&27===a.keyCode&&b.arcticmodal("close")});d.arcticmodal=
|
22 |
+
d.fn.arcticmodal=function(a){if(h[a])return h[a].apply(this,Array.prototype.slice.call(arguments,1));if("object"===typeof a||!a)return f.init.apply(this,arguments);d.error("jquery.arcticmodal: Method "+a+" does not exist")}})(jQuery);
|
template/not-ok.png
ADDED
Binary file
|
template/notice.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="clear"></div>
|
2 |
+
<div class="update-nag" style="width: 95%;">
|
3 |
+
<?php langWPADM::get('Professional version of'); ?>
|
4 |
+
"<a href="<?php echo admin_url("admin.php?page=wpadm_wp_full_backup_dropbox"); ?>" title="<?php langWPADM::get('Dropbox backup and restore"')?>" alt="<?php langWPADM::get('Dropbox backup and restore')?>"><?php langWPADM::get('Dropbox backup and restore')?></a>"
|
5 |
+
<?php langWPADM::get(' plugin is now available!'); ?>
|
6 |
+
<a href="<?php echo admin_url("admin.php?page=wpadm_wp_full_backup_dropbox"); ?>" title="<?php langWPADM::get('Read more...')?>" alt="<?php langWPADM::get('Read more...')?>"><?php langWPADM::get('Read more...')?></a>
|
7 |
+
<a href="<?php echo admin_url( 'admin-post.php?action=hide_notice&type=preview' ); ?>" style="float: right; font-size: 12px;">[<?php langWPADM::get('hide this message')?>]</a>
|
8 |
+
</div>
|
template/notice5.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="clear"></div>
|
2 |
+
<div class="updated notice" style="width: 95%;">
|
3 |
+
<p>
|
4 |
+
<?php echo str_replace("%s", $time, langWPADM::get('You use Dropbox backup and restore plugin successfully for more than %s. Please, leave a 5 star review for our development team, because it inspires us to develop this plugin for you.', false )) ; ?><br />
|
5 |
+
<?php langWPADM::get('Thank you!')?>
|
6 |
+
<br />
|
7 |
+
<a href="https://wordpress.org/support/view/plugin-reviews/dropbox-backup?filter=5" ><?php langWPADM::get('Leave review'); ?></a><br />
|
8 |
+
<a href="<?php echo admin_url( 'admin-post.php?action=hide_notice&type=star' );?>"><?php langWPADM::get('I already left a review'); ?></a><br />
|
9 |
+
<a href="<?php echo admin_url( 'admin-post.php?action=hide_notice&type=star&hide=' . $hide );?>"><?php langWPADM::get('Hide this message'); ?></a><br />
|
10 |
+
</p>
|
11 |
+
</div>
|
template/ok-icon.png
ADDED
Binary file
|
template/ok.png
ADDED
Binary file
|
template/wpadm_show_backup.php
ADDED
@@ -0,0 +1,1331 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="wrap">
|
2 |
+
<script src="<?php echo plugin_dir_url(__FILE__) . 'js/jquery.arcticmodal-0.3.min.js'?>" type="text/javascript"></script>
|
3 |
+
<link rel='stylesheet' href='<?php echo plugin_dir_url(__FILE__) . 'js/jquery.arcticmodal-0.3.css'?>' type='text/css' media='all' />
|
4 |
+
<style>
|
5 |
+
.pointer {
|
6 |
+
cursor: pointer;
|
7 |
+
}
|
8 |
+
</style>
|
9 |
+
<script>
|
10 |
+
var home_url = '<?php echo SITE_HOME; ?>';
|
11 |
+
var type_backup = '';
|
12 |
+
function blickForm(id, t)
|
13 |
+
{
|
14 |
+
if(t.checked == true) {
|
15 |
+
t.checked = false;
|
16 |
+
}
|
17 |
+
l = jQuery('#' + id).length;
|
18 |
+
showRegistInfo(false);
|
19 |
+
if (l > 0) {
|
20 |
+
blick(id);
|
21 |
+
}
|
22 |
+
}
|
23 |
+
function showRegistInfo(show)
|
24 |
+
{
|
25 |
+
display = jQuery('#cf_activate').css('display');
|
26 |
+
if (display == 'none') {
|
27 |
+
jQuery('#cf_activate').show('slow');
|
28 |
+
jQuery('#registr-show').html("<?php langWPADM::get('Hide'); ?>");
|
29 |
+
jQuery('#title-regisr').css("padding" , "0px 0px");
|
30 |
+
jQuery('#registr-choice-icon').removeClass("dashicons-arrow-down").addClass('dashicons-arrow-up');
|
31 |
+
} else {
|
32 |
+
if (show) {
|
33 |
+
jQuery('#cf_activate').hide('slow');
|
34 |
+
jQuery('#registr-show').html("<?php langWPADM::get('Show'); ?>");
|
35 |
+
jQuery('#title-regisr').css("padding" , "20px 0px");
|
36 |
+
jQuery('#registr-choice-icon').removeClass("dashicons-arrow-up").addClass('dashicons-arrow-down');
|
37 |
+
}
|
38 |
+
}
|
39 |
+
}
|
40 |
+
function showSetting(show)
|
41 |
+
{
|
42 |
+
display = jQuery('#setting_active').css('display');
|
43 |
+
if (display == 'none') {
|
44 |
+
jQuery('#setting_active').show(1000);
|
45 |
+
jQuery('#setting-show').html("<?php langWPADM::get('Hide'); ?>");
|
46 |
+
jQuery('#title-setting').css("padding" , "0px 0px");
|
47 |
+
jQuery('#setting-choice-icon').removeClass("dashicons-arrow-down").addClass('dashicons-arrow-up');
|
48 |
+
} else {
|
49 |
+
if (show) {
|
50 |
+
jQuery('#setting_active').hide('slow');
|
51 |
+
jQuery('#setting-show').html("<?php langWPADM::get('Show'); ?>");
|
52 |
+
jQuery('#title-setting').css("padding" , "20px 0px");
|
53 |
+
jQuery('#setting-choice-icon').removeClass("dashicons-arrow-up").addClass('dashicons-arrow-down');
|
54 |
+
}
|
55 |
+
}
|
56 |
+
}
|
57 |
+
process_flag = 0;
|
58 |
+
function start_local_backup()
|
59 |
+
{
|
60 |
+
d = new Date();
|
61 |
+
var data_backup = {
|
62 |
+
'action': 'wpadm_local_backup',
|
63 |
+
'time': Math.ceil( (d.getTime() + (-d.getTimezoneOffset() * 60000 ) ) / 1000 )
|
64 |
+
};
|
65 |
+
jQuery("#logs-form").show("slow");
|
66 |
+
jQuery("#action-buttons").css('margin-top', '8px');
|
67 |
+
jQuery("#support-button").css('margin-top', '8px');
|
68 |
+
jQuery("#log-backup").html('');
|
69 |
+
jQuery(".title-logs").css('display', 'block');
|
70 |
+
jQuery(".title-status").css('display', 'none');
|
71 |
+
type_backup = 'local_backup';
|
72 |
+
jQuery.ajax({
|
73 |
+
type: "POST",
|
74 |
+
url: ajaxurl,
|
75 |
+
data: data_backup,
|
76 |
+
success: function(data){
|
77 |
+
if (data.result != 'work') {
|
78 |
+
process_flag = 0;
|
79 |
+
showData(data);
|
80 |
+
}
|
81 |
+
process_flag = 1
|
82 |
+
processBar(type_backup);
|
83 |
+
showTime();
|
84 |
+
|
85 |
+
},
|
86 |
+
error: function(jqXHR, textStatus, errorThrown){
|
87 |
+
processStop();
|
88 |
+
AjaxAlert(jqXHR, textStatus, errorThrown);
|
89 |
+
},
|
90 |
+
dataType: 'json'
|
91 |
+
});
|
92 |
+
}
|
93 |
+
function AjaxAlert(jqXHR, textStatus, errorThrown)
|
94 |
+
{
|
95 |
+
var msg = 'Website "' + home_url + '" returned an error during operation with return:<br /><br /> <span style="font-size:13px; font-style: italic;">code: ' + jqXHR.status + ', text status: ' + textStatus + ', text: ' + errorThrown + "</span>";
|
96 |
+
jQuery("#ajax-message").html(msg);
|
97 |
+
jQuery("#msg_ajax").val(msg);
|
98 |
+
jQuery('#ajax-alert').arcticmodal({
|
99 |
+
beforeOpen: function(data, el) {
|
100 |
+
jQuery('#ajax-alert').css('display','block');
|
101 |
+
},
|
102 |
+
afterClose: function(data, el) {
|
103 |
+
jQuery('#ajax-alert').css('display','none');
|
104 |
+
}
|
105 |
+
});
|
106 |
+
}
|
107 |
+
|
108 |
+
function stopBackup()
|
109 |
+
{
|
110 |
+
|
111 |
+
var data_backup = {
|
112 |
+
'action': 'stop_backup',
|
113 |
+
'type-backup': type_backup,
|
114 |
+
};
|
115 |
+
jQuery.ajax({
|
116 |
+
type: "POST",
|
117 |
+
url: ajaxurl,
|
118 |
+
data: data_backup,
|
119 |
+
dataType: 'json',
|
120 |
+
success: function(data){
|
121 |
+
|
122 |
+
},
|
123 |
+
error: function(jqXHR, textStatus, errorThrown) {
|
124 |
+
processStop();
|
125 |
+
AjaxAlert(jqXHR, textStatus, errorThrown);
|
126 |
+
},
|
127 |
+
});
|
128 |
+
|
129 |
+
}
|
130 |
+
|
131 |
+
var auth_param = <?php echo isset($dropbox_options['app_key']) && isset($dropbox_options['app_secret']) && isset($dropbox_options['uid']) && $dropbox_options['uid'] != '' ? 'false' : 'true' ?>;
|
132 |
+
function start_dropbox_backup()
|
133 |
+
{
|
134 |
+
if (auth_param === false) {
|
135 |
+
d = new Date();
|
136 |
+
process_flag = 0;
|
137 |
+
|
138 |
+
var data_backup = {
|
139 |
+
'action': 'wpadm_dropbox_create',
|
140 |
+
'time': Math.ceil( (d.getTime() + (-d.getTimezoneOffset() * 60000 ) ) / 1000 ),
|
141 |
+
};
|
142 |
+
jQuery("#logs-form").show("slow");
|
143 |
+
jQuery("#action-buttons").css('margin-top', '8px');
|
144 |
+
jQuery("#support-button").css('margin-top', '8px');
|
145 |
+
jQuery("#log-backup").html('');
|
146 |
+
jQuery(".title-logs").css('display', 'block');
|
147 |
+
jQuery(".title-status").css('display', 'none');
|
148 |
+
type_backup = 'send-to-dropbox';
|
149 |
+
jQuery.ajax({
|
150 |
+
type: "POST",
|
151 |
+
url: ajaxurl,
|
152 |
+
data: data_backup,
|
153 |
+
success: function(data){
|
154 |
+
if (data.result !== 'work') {
|
155 |
+
process_flag = 0;
|
156 |
+
if (data.result == 'success') {
|
157 |
+
jQuery('.title-logs').css('display', 'none');
|
158 |
+
jQuery('.title-status').css({'display':'block', 'color':'green'});
|
159 |
+
jQuery('.title-status').html('<?php langWPADM::get('Dropbox Backup was created successfully'); ?>');
|
160 |
+
} else {
|
161 |
+
jQuery('.title-logs').css('display', 'none');
|
162 |
+
jQuery('.title-status').css({'display':'block', 'color':'red'});
|
163 |
+
jQuery('.title-status').html("<?php langWPADM::get('Dropbox Backup wasn\'t created. '); ?>" + data.error);
|
164 |
+
}
|
165 |
+
showData(data);
|
166 |
+
jQuery('.table').css('display', 'table');
|
167 |
+
}
|
168 |
+
process_flag = 1
|
169 |
+
processBar('send-to-dropbox');
|
170 |
+
showTime();
|
171 |
+
|
172 |
+
},
|
173 |
+
error: function(jqXHR, textStatus, errorThrown) {
|
174 |
+
processStop();
|
175 |
+
AjaxAlert(jqXHR, textStatus, errorThrown);
|
176 |
+
},
|
177 |
+
dataType: 'json'
|
178 |
+
});
|
179 |
+
} else {
|
180 |
+
jQuery('#is-dropbox-auth').arcticmodal({
|
181 |
+
beforeOpen: function(data, el) {
|
182 |
+
jQuery('#is-dropbox-auth').css('display','block');
|
183 |
+
|
184 |
+
},
|
185 |
+
afterClose: function(data, el) {
|
186 |
+
jQuery('#is-dropbox-auth').css('display','none');
|
187 |
+
showSetting(false);
|
188 |
+
blick('app_key', 4);
|
189 |
+
blick('app_secret', 4);
|
190 |
+
}
|
191 |
+
});
|
192 |
+
}
|
193 |
+
}
|
194 |
+
function showData(data)
|
195 |
+
{
|
196 |
+
jQuery('.table').css('display', 'table');
|
197 |
+
if (type_backup == 'local_backup') {
|
198 |
+
if (data.result == 'success') {
|
199 |
+
jQuery('.title-logs').css('display', 'none');
|
200 |
+
jQuery('.title-status').css({'display':'block', 'color':'green'});
|
201 |
+
jQuery('.title-status').html('<?php langWPADM::get('Local Backup was created successfully'); ?>');
|
202 |
+
} else {
|
203 |
+
jQuery('.title-logs').css('display', 'none');
|
204 |
+
jQuery('.title-status').css({'display':'block', 'color':'red'});
|
205 |
+
jQuery('.title-status').html("<?php langWPADM::get('Local Backup wasn\'t created'); ?>");
|
206 |
+
}
|
207 |
+
} else {
|
208 |
+
if (data.result == 'success') {
|
209 |
+
jQuery('.title-logs').css('display', 'none');
|
210 |
+
jQuery('.title-status').css({'display':'block', 'color':'green'});
|
211 |
+
jQuery('.title-status').html('<?php langWPADM::get('Dropbox Backup was created successfully'); ?>');
|
212 |
+
} else {
|
213 |
+
jQuery('.title-logs').css('display', 'none');
|
214 |
+
jQuery('.title-status').css({'display':'block', 'color':'red'});
|
215 |
+
jQuery('.title-status').html("<?php langWPADM::get('Dropbox Backup wasn\'t created. '); ?>" + data.error);
|
216 |
+
}
|
217 |
+
}
|
218 |
+
size_backup = data.size / 1024 / 1024;
|
219 |
+
if (data.size != 0 || data.result != 'error') {
|
220 |
+
var img_table =
|
221 |
+
'<img src="<?php echo plugin_dir_url(__FILE__) . "ok.png" ;?>" title="Successful" alt="Successful" style="float: left; width: 20px; height: 20px;" />' +
|
222 |
+
'<div style="margin-top :1px;float: left;"><?php echo langWPADM::get('Successful', false);?></div>';
|
223 |
+
name_backup = data.name;
|
224 |
+
} else {
|
225 |
+
var img_table =
|
226 |
+
'<img src="<?php echo plugin_dir_url(__FILE__) . "not-ok.png" ;?>" title="fail" alt="fail" style="float: left; width: 20px; height: 20px;" />' +
|
227 |
+
'<div style="margin-top :1px;float: left;"><?php echo langWPADM::get('Fail', false);?> (<a style="text-decoration:underline;"><?php echo langWPADM::get('Show Details', false);?></a>)</div>';
|
228 |
+
name_backup = '<?php echo langWPADM::get('Not available', false);?>';
|
229 |
+
}
|
230 |
+
info = "";
|
231 |
+
if (data.data) {
|
232 |
+
for(i = 0; i < data.data.length; i++) {
|
233 |
+
e = data.data[i].split('/');
|
234 |
+
info += '<tr style="border: 0;">' +
|
235 |
+
'<td style="border: 0;padding: 0px;"><a href="<?php echo content_url(DROPBOX_BACKUP_DIR_NAME) . '/'; ?>' + data.name + '/' + e[e.length - 1] + '">' + e[e.length - 1] + '</td>' +
|
236 |
+
'</tr>' ;
|
237 |
+
}
|
238 |
+
|
239 |
+
co = jQuery('.number-backup').length + 1;
|
240 |
+
jQuery('.table > tbody:last').after(
|
241 |
+
'<tr>'+
|
242 |
+
'<td class="number-backup" onclick="shows(\'' + data.md5_data + '\', this)">' +
|
243 |
+
co +
|
244 |
+
'</td>' +
|
245 |
+
'<td class="pointer" onclick="shows(\'' + data.md5_data + '\', this)" style="text-align: left; padding-left: 7px;" >' +
|
246 |
+
data.time +
|
247 |
+
'</td>' +
|
248 |
+
'<td class="pointer" onclick="shows(\'' + data.md5_data + '\', this)">' +
|
249 |
+
name_backup +
|
250 |
+
'</td>' +
|
251 |
+
'<td class="pointer" onclick="shows(\'' + data.md5_data + '\',this)">' +
|
252 |
+
data.counts +
|
253 |
+
'</td>' +
|
254 |
+
'<td class="pointer" onclick="shows(\'' + data.md5_data + '\', this)">' +
|
255 |
+
img_table +
|
256 |
+
'</td>' +
|
257 |
+
'<td class="pointer" onclick="shows(\'' + data.md5_data + '\', this)">' +
|
258 |
+
data.type + ' <?php langWPADM::get('backup')?>' +
|
259 |
+
'</td>' +
|
260 |
+
'<td class="pointer" onclick="shows(\'' + data.md5_data + '\', this)">' +
|
261 |
+
size_backup.toFixed(2) + "<?php langWPADM::get('Mb')?>" +
|
262 |
+
'</td>' +
|
263 |
+
'<td>' +
|
264 |
+
'<a href="javascript:void(0)" class="button-wpadm" title="<?php langWPADM::get('Restore')?>" onclick="show_recovery_form(\'' + data.type + '\', \'' + data.name + '\')"><span class="pointer dashicons dashicons-backup"></span><?php langWPADM::get('Restore')?></a> ' +
|
265 |
+
'<a href="javascript:void(0)" class="button-wpadm" title="<?php langWPADM::get('Delete')?>" onclick="delete_backup(\'' + data.name + '\', \'' + data.type + '\')"><span class="pointer dashicons dashicons-trash"></span><?php langWPADM::get('Delete')?></a> ' +
|
266 |
+
'</td>' +
|
267 |
+
'</tr>'+
|
268 |
+
'<tr id="' + data.md5_data + '" style="display: none;">'+
|
269 |
+
'<td colspan="2">' +
|
270 |
+
'</td>' +
|
271 |
+
'<td align="center" style="padding: 0px; width: 350px;">' +
|
272 |
+
'<div style="overflow: auto; max-height: 150px;">' +
|
273 |
+
'<table border="0" align="center" style="width: 100%;" class="info-path">' +
|
274 |
+
info +
|
275 |
+
'</table>' +
|
276 |
+
'</div>' +
|
277 |
+
'</td>' +
|
278 |
+
'<td colspan="6"></td>' +
|
279 |
+
'</tr>')
|
280 |
+
}
|
281 |
+
}
|
282 |
+
var logs = [];
|
283 |
+
function processBar(method)
|
284 |
+
{
|
285 |
+
if (method == 'undefined') {
|
286 |
+
method = type_backup;
|
287 |
+
}
|
288 |
+
var data_log = {
|
289 |
+
'action': 'wpadm_logs',
|
290 |
+
'type-backup' : method,
|
291 |
+
};
|
292 |
+
jQuery.ajax({
|
293 |
+
type: "POST",
|
294 |
+
url: ajaxurl,
|
295 |
+
data: data_log,
|
296 |
+
success: function(response){
|
297 |
+
eval("var data=" + response);
|
298 |
+
for(s in data.log) {
|
299 |
+
if (jQuery.inArray(s , logs) == -1) {
|
300 |
+
l = jQuery("#log-backup").html();
|
301 |
+
l = "<div>" + data.log[s] + "</div>" + l;
|
302 |
+
jQuery("#log-backup").html(l);
|
303 |
+
}
|
304 |
+
}
|
305 |
+
if (process_flag == 1) {
|
306 |
+
if (data.data) {
|
307 |
+
showData(data.data);
|
308 |
+
processStop();
|
309 |
+
} else {
|
310 |
+
setTimeout('processBar("' + method + '")', 3000);
|
311 |
+
}
|
312 |
+
}
|
313 |
+
},
|
314 |
+
error: function(jqXHR, textStatus, errorThrown){
|
315 |
+
processStop();
|
316 |
+
AjaxAlert(jqXHR, textStatus, errorThrown);
|
317 |
+
},
|
318 |
+
});
|
319 |
+
}
|
320 |
+
|
321 |
+
function showTime(t)
|
322 |
+
{
|
323 |
+
if (process_flag == 1) {
|
324 |
+
if ( (typeof t) == 'undefined') {
|
325 |
+
t = 1;
|
326 |
+
} else {
|
327 |
+
t = t + 1;
|
328 |
+
}
|
329 |
+
time = t + " <?php langWPADM::get('sec.'); ?>";
|
330 |
+
jQuery("#time_backup").html(time);
|
331 |
+
setTimeout(function() { showTime(t) }, 1000);
|
332 |
+
}
|
333 |
+
}
|
334 |
+
function processStop()
|
335 |
+
{
|
336 |
+
process_flag = 0;
|
337 |
+
}
|
338 |
+
function delete_backup(backup, type)
|
339 |
+
{
|
340 |
+
document.delete_backups.backup_name.value = backup;
|
341 |
+
document.delete_backups.backup_type.value = type;
|
342 |
+
document.delete_backups.submit();
|
343 |
+
}
|
344 |
+
function create_backup (type) {
|
345 |
+
if (type == 'auth') {
|
346 |
+
document.form_auth_backup_create.submit();
|
347 |
+
}
|
348 |
+
}
|
349 |
+
function show_recovery_form(type, name)
|
350 |
+
{
|
351 |
+
var act = '';
|
352 |
+
if (confirm("<?php langWPADM::get('Are you sure you want to start the recovery process?')?>")) {
|
353 |
+
if (type == 'local') {
|
354 |
+
act = 'wpadm_local_restore';
|
355 |
+
} else {
|
356 |
+
act = 'wpadm_restore_dropbox';
|
357 |
+
}
|
358 |
+
var data_backup = {
|
359 |
+
'action': act,
|
360 |
+
'name': name,
|
361 |
+
};
|
362 |
+
jQuery("#log-backup").html('');
|
363 |
+
jQuery("#action-buttons").css('margin-top', '8px');
|
364 |
+
jQuery("#support-button").css('margin-top', '8px');
|
365 |
+
jQuery(".title-logs").css('display', 'block');
|
366 |
+
jQuery(".title-status").css('display', 'none');
|
367 |
+
jQuery("#logs-form").show("slow");
|
368 |
+
jQuery("#action-buttons").css('margin-top', '8px');
|
369 |
+
jQuery.ajax({
|
370 |
+
type: "POST",
|
371 |
+
url: ajaxurl,
|
372 |
+
data: data_backup,
|
373 |
+
beforeSend: function(){
|
374 |
+
process_flag = 1
|
375 |
+
processBar();
|
376 |
+
showTime();
|
377 |
+
|
378 |
+
},
|
379 |
+
success: function(data){
|
380 |
+
process_flag = 0;
|
381 |
+
if (data.result == 'success') {
|
382 |
+
jQuery('.title-logs').css('display', 'none');
|
383 |
+
jQuery('.title-status').css({'display':'block', 'color':'green'});
|
384 |
+
if (type == 'local') {
|
385 |
+
str = '<?php langWPADM::get('Local Backup (%s) was restored successfully'); ?>';
|
386 |
+
str = str.replace('%s', name);
|
387 |
+
jQuery('.title-status').html(str);
|
388 |
+
} else {
|
389 |
+
str = '<?php langWPADM::get('Dropbox Backup (%s) was restored successfully'); ?>';
|
390 |
+
str = str.replace('%s', name);
|
391 |
+
jQuery('.title-status').html(str);
|
392 |
+
}
|
393 |
+
} else {
|
394 |
+
jQuery('.title-logs').css('display', 'none');
|
395 |
+
jQuery('.title-status').css({'display':'block', 'color':'red'});
|
396 |
+
if (type == 'local') {
|
397 |
+
str = "<?php langWPADM::get('Local Backup (%s) wasn\'t restored'); ?>";
|
398 |
+
str = str.replace("%s", name) ;
|
399 |
+
jQuery('.title-status').html(str);
|
400 |
+
} else {
|
401 |
+
str = "<?php langWPADM::get('Dropbox Backup (%s) wasn\'t restored'); ?>";
|
402 |
+
str = str.replace('%s', name);
|
403 |
+
jQuery('.title-status').html(str);
|
404 |
+
}
|
405 |
+
}
|
406 |
+
},
|
407 |
+
error: function(jqXHR, textStatus, errorThrown) {
|
408 |
+
processStop();
|
409 |
+
AjaxAlert(jqXHR, textStatus, errorThrown);
|
410 |
+
},
|
411 |
+
dataType: 'json'
|
412 |
+
});
|
413 |
+
}
|
414 |
+
|
415 |
+
}
|
416 |
+
function auth_form(t)
|
417 |
+
{
|
418 |
+
var button = jQuery(t);
|
419 |
+
var form = button.closest('form');
|
420 |
+
var data = {};
|
421 |
+
|
422 |
+
var reg = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,6})+$/;
|
423 |
+
mail = document.auth.username.value;
|
424 |
+
send = false;
|
425 |
+
if (!reg.test(mail)) {
|
426 |
+
document.auth.username.style.border = "2px solid red";
|
427 |
+
} else {
|
428 |
+
document.auth.username.style.border = "1px solid #5b9dd9";
|
429 |
+
if(document.auth.password.value.length == 0) {
|
430 |
+
document.auth.password.style.border = "2px solid red";
|
431 |
+
} else {
|
432 |
+
send = true;
|
433 |
+
document.auth.password.style.border = "1px solid #5b9dd9";
|
434 |
+
}
|
435 |
+
}
|
436 |
+
if(send) {
|
437 |
+
form.find('#message-form').css('display', 'none');
|
438 |
+
data['password'] = document.auth.password.value;
|
439 |
+
data['username'] = document.auth.username.value;
|
440 |
+
data['plugin'] = document.auth.plugin.value;
|
441 |
+
backup = jQuery("#name_backup_restore").val();
|
442 |
+
jQuery.ajax({
|
443 |
+
url: form.attr('action'),
|
444 |
+
data: data,
|
445 |
+
type: 'POST',
|
446 |
+
dataType: 'json',
|
447 |
+
success: function(data_res) {
|
448 |
+
if( !data_res){
|
449 |
+
alert('error');
|
450 |
+
} else if(data_res.error) {
|
451 |
+
if(form.find('#message-form').length) {
|
452 |
+
form.find('#message-form').html("");
|
453 |
+
form.find('#message-form').css('display', 'block');
|
454 |
+
form.find('#message-form').css('margin', '0');
|
455 |
+
form.find('#message-form').css('margin-top', '6px');
|
456 |
+
form.find('#message-form').html(data_res.error);
|
457 |
+
}
|
458 |
+
} else if(data_res.url) {
|
459 |
+
|
460 |
+
jQuery.ajax({
|
461 |
+
url: ajaxurl,
|
462 |
+
data: {'action' : 'set_user_mail', 'email' : document.auth.username.value},
|
463 |
+
type: 'POST',
|
464 |
+
dataType: 'json',
|
465 |
+
success: function(res) {
|
466 |
+
|
467 |
+
}
|
468 |
+
});
|
469 |
+
form.attr('action', data_res.url);
|
470 |
+
document.auth.submit();
|
471 |
+
//location.reload();
|
472 |
+
}
|
473 |
+
},
|
474 |
+
error: function ( jqXHR, textStatus, errorThrown ) {
|
475 |
+
AjaxAlert(jqXHR, textStatus, errorThrown);
|
476 |
+
}
|
477 |
+
|
478 |
+
});
|
479 |
+
}
|
480 |
+
}
|
481 |
+
function disconnectDropbox()
|
482 |
+
{
|
483 |
+
var form = jQuery('form#dropbox_form');
|
484 |
+
form.find('#oauth_token_secret').val('');
|
485 |
+
form.find('#oauth_token').val('');
|
486 |
+
form.find('#uid').val('');
|
487 |
+
form.find('#dropbox_uid_text').text('');
|
488 |
+
form.find('.disconnect_btn').parents('.form_block_input').removeClass('connected');
|
489 |
+
}
|
490 |
+
|
491 |
+
var winParams = "left=0,top=0,height=600,width=1000,menubar=no,location=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no,directories=no"
|
492 |
+
var dropboxBut, dropboxWin;
|
493 |
+
function connectDropbox(button, href, oauth_token_secret, oauth_token, uid){
|
494 |
+
if( button && href ){
|
495 |
+
dropboxBut = jQuery(button);
|
496 |
+
var form = dropboxBut.parents('form');
|
497 |
+
var url = href;
|
498 |
+
|
499 |
+
// if (jQuery.trim(jQuery('#app_key').val()) != '' || jQuery.trim(jQuery('#app_secret').val()) != '') {
|
500 |
+
url += '&app_key='+jQuery('#app_key').val();
|
501 |
+
url += '&app_secret='+jQuery('#app_secret').val();
|
502 |
+
// }
|
503 |
+
|
504 |
+
dropboxWin = window.open(url, "Dropbox", winParams);
|
505 |
+
if( dropboxWin ){
|
506 |
+
dropboxWin.focus();
|
507 |
+
}else{
|
508 |
+
alert('<?php langWPADM::get('Please, permit the pop-up windows.'); ?>');
|
509 |
+
}
|
510 |
+
}else{
|
511 |
+
var form = dropboxBut.parents('form');
|
512 |
+
if( dropboxWin ){
|
513 |
+
dropboxWin.close();
|
514 |
+
}
|
515 |
+
form.find('#oauth_token_secret').val(oauth_token_secret);
|
516 |
+
form.find('#oauth_token').val(oauth_token);
|
517 |
+
form.find('#uid').val(uid);
|
518 |
+
auth_param = false;
|
519 |
+
form.find('#dropbox_uid_text').html('<?php echo langWPADM::get('Dropbox successfully connected:', false)?> UID ' + uid);
|
520 |
+
blick_form = false;
|
521 |
+
dropboxBut.parents('.form_block_input').addClass('connected');
|
522 |
+
}
|
523 |
+
}
|
524 |
+
function getHelperDropbox()
|
525 |
+
{
|
526 |
+
jQuery('#helper-keys').arcticmodal({
|
527 |
+
beforeOpen: function(data, el) {
|
528 |
+
jQuery('#helper-keys').css('display','block');
|
529 |
+
},
|
530 |
+
afterClose: function(data, el) {
|
531 |
+
jQuery('#helper-keys').css('display','none');
|
532 |
+
}
|
533 |
+
});
|
534 |
+
}
|
535 |
+
|
536 |
+
function setReadOnly(id)
|
537 |
+
{
|
538 |
+
r = jQuery('#' + id).attr('readonly');
|
539 |
+
if (r == 'readonly') {
|
540 |
+
jQuery('#' + id).prop('readonly', false);
|
541 |
+
} else {
|
542 |
+
jQuery('#' + id).prop('readonly', true);
|
543 |
+
|
544 |
+
}
|
545 |
+
}
|
546 |
+
function InludesSetting()
|
547 |
+
{
|
548 |
+
disp = jQuery('#inludes-setting').css('display');
|
549 |
+
if (disp == 'none') {
|
550 |
+
showLoadingImg(true);
|
551 |
+
getIncludesData();
|
552 |
+
jQuery('#inludes-setting').show("slow");
|
553 |
+
} else {
|
554 |
+
jQuery('.show-includes').html("");
|
555 |
+
jQuery('#inludes-setting').hide("slow");
|
556 |
+
}
|
557 |
+
}
|
558 |
+
var level_tree = {};
|
559 |
+
function getIncludesData(type, dir_)
|
560 |
+
{
|
561 |
+
data = {'action' : 'getDirsIncludes'};
|
562 |
+
if (type != 'undefined') {
|
563 |
+
data['files'] = type
|
564 |
+
}
|
565 |
+
if ( ( typeof dir_ ) != 'undefined') {
|
566 |
+
data['path'] = dir_.path;
|
567 |
+
}
|
568 |
+
jQuery.ajax({
|
569 |
+
url: ajaxurl,
|
570 |
+
data: data,
|
571 |
+
type: 'POST',
|
572 |
+
dataType: 'json',
|
573 |
+
success: function(data_res) {
|
574 |
+
showLoadingImg(false);
|
575 |
+
if ((typeof dir_) != 'undefined') {
|
576 |
+
jQuery('#img_load_' + dir_.cache).css('display', 'none');
|
577 |
+
}
|
578 |
+
if (data.path) {
|
579 |
+
showIncludesData(data_res.dir, dir_.id);
|
580 |
+
} else {
|
581 |
+
if (data_res.dir) {
|
582 |
+
showIncludesData(data_res.dir);
|
583 |
+
}
|
584 |
+
}
|
585 |
+
level_tree[level_tree.length] = data_res.dir;
|
586 |
+
},
|
587 |
+
error: function(jqXHR, textStatus, errorThrown) {
|
588 |
+
AjaxAlert(jqXHR, textStatus, errorThrown);
|
589 |
+
}
|
590 |
+
});
|
591 |
+
}
|
592 |
+
function loadInludes(path, cache, t, lvl)
|
593 |
+
{
|
594 |
+
if (t.checked) {
|
595 |
+
showLoadingImg(true);
|
596 |
+
jQuery('#include_' + cache).html('');
|
597 |
+
jQuery('#img_load_' + cache).css({'display':'inline'});
|
598 |
+
getIncludesData('undefined', {'path' : path, 'id' : 'include_' + cache, 'cache' : cache });
|
599 |
+
jQuery('#include_' + cache).show('slow');
|
600 |
+
} else {
|
601 |
+
in_id = jQuery(t).attr('id')
|
602 |
+
if (jQuery('#include_' + in_id).length > 0) {
|
603 |
+
jQuery('#include_' + in_id).hide('slow');
|
604 |
+
}
|
605 |
+
}
|
606 |
+
}
|
607 |
+
function showIncludesData(data, id)
|
608 |
+
{
|
609 |
+
html = "";
|
610 |
+
if ( ( typeof data ) != 'undefined' ) {
|
611 |
+
if (data.length > 0) {
|
612 |
+
for(i = 0; i < data.length; i++) {
|
613 |
+
if (data[i].check) {
|
614 |
+
check = 'checked="checked"' ;
|
615 |
+
send_checked[send_checked.length] = data[i].check_folder;
|
616 |
+
} else {
|
617 |
+
check = '';
|
618 |
+
}
|
619 |
+
html += '<div id="inc_' + data[i].cache + '" data-value="' + data[i].cache + '">' +
|
620 |
+
'<input type="checkbox" ' + check + ' class="checkbox-send" value="' + data[i].folder + '" name="folder-include" id="send-to-' + data[i].cache + '" onclick="connectFolder(this)" />' +
|
621 |
+
'<input type="checkbox" class="input-folder" value="/' + data[i].dir + '" id="' + data[i].cache + '" onclick="loadInludes(\'/' + data[i].folder + '\', \'' + data[i].cache +'\', this, \'' + level_tree.length + '\')" />' +
|
622 |
+
'<label for="' + data[i].cache + '">' + data[i].dir + ' <span style="font-size:10px;">(' + data[i].perm + ')</span>' + '</label>' +
|
623 |
+
'<div id="img_load_' + data[i].cache + '" style="display:none; margin-left:10px;position:relative;">' +
|
624 |
+
'<img style="position:absolute;bottom:0;" src="<?php echo plugins_url('/img/folder-loader.gif', dirname(__FILE__) ); ?>" alt="load" title="load" >' +
|
625 |
+
'</div>'+
|
626 |
+
'<div class="tree-includes" id="include_' + data[i].cache + '">' +
|
627 |
+
'</div>' +
|
628 |
+
'</div>';
|
629 |
+
}
|
630 |
+
if (jQuery("#" + id).length > 0) {
|
631 |
+
jQuery("#" + id).html(html);
|
632 |
+
} else {
|
633 |
+
jQuery('.show-includes').html(html);
|
634 |
+
}
|
635 |
+
}
|
636 |
+
}
|
637 |
+
}
|
638 |
+
|
639 |
+
function saveIncludes()
|
640 |
+
{
|
641 |
+
data = {'action' : 'saveDirsIncludes', 'save' : 1, 'data' : send_checked}
|
642 |
+
if (send_checked.length > 0) {
|
643 |
+
showLoadingImg(true);
|
644 |
+
jQuery.ajax({
|
645 |
+
url: ajaxurl,
|
646 |
+
data: data,
|
647 |
+
type: 'POST',
|
648 |
+
dataType: 'json',
|
649 |
+
success: function(data_res) {
|
650 |
+
showLoadingImg(false);
|
651 |
+
|
652 |
+
},
|
653 |
+
error: function (jqXHR, textStatus, errorThrown) {
|
654 |
+
AjaxAlert(jqXHR, textStatus, errorThrown);
|
655 |
+
}
|
656 |
+
});
|
657 |
+
}
|
658 |
+
}
|
659 |
+
function saveSetting(id)
|
660 |
+
{
|
661 |
+
if (jQuery('#' + id).length > 0) {
|
662 |
+
is_value = 0;
|
663 |
+
if(document.getElementById(id).checked) {
|
664 |
+
is_value = 1;
|
665 |
+
}
|
666 |
+
|
667 |
+
data = {'action' : 'saveSetting'}
|
668 |
+
data[id] = is_value;
|
669 |
+
jQuery.ajax({
|
670 |
+
url: ajaxurl,
|
671 |
+
data: data,
|
672 |
+
type: 'POST',
|
673 |
+
dataType: 'json',
|
674 |
+
success: function(data_res) {
|
675 |
+
},
|
676 |
+
error: function( jqXHR, textStatus, errorThrown ){
|
677 |
+
AjaxAlert(jqXHR, textStatus, errorThrown);
|
678 |
+
}
|
679 |
+
});
|
680 |
+
}
|
681 |
+
}
|
682 |
+
var app_key = app_secret = '';
|
683 |
+
function showApp()
|
684 |
+
{
|
685 |
+
disp = jQuery('#dropbox-app-key').css('display');
|
686 |
+
if (disp == 'none') {
|
687 |
+
jQuery('#dropbox-app-key').show('slow');
|
688 |
+
jQuery('#help-key-pass').show('slow');
|
689 |
+
jQuery('#dropbox-app-secret').show('slow');
|
690 |
+
jQuery('#app_secret').val(app_secret);
|
691 |
+
jQuery('#app_key').val(app_key);
|
692 |
+
jQuery('.stat-table-registr').css('margin-bottom', '25px');
|
693 |
+
} else {
|
694 |
+
jQuery('#dropbox-app-key').hide('slow');
|
695 |
+
jQuery('#help-key-pass').hide('slow');
|
696 |
+
jQuery('#dropbox-app-secret').hide('slow');
|
697 |
+
app_key = jQuery('#app_key').val();
|
698 |
+
app_secret = jQuery('#app_secret').val()
|
699 |
+
jQuery('#app_secret').val('');
|
700 |
+
jQuery('#app_key').val('');
|
701 |
+
jQuery('.stat-table-registr').css('margin-bottom', '0px');
|
702 |
+
}
|
703 |
+
}
|
704 |
+
function showFormAjax()
|
705 |
+
{
|
706 |
+
//form-ajax-ftp-email
|
707 |
+
disp = jQuery('#form-ajax-ftp-email').css('display');
|
708 |
+
if (disp == 'none') {
|
709 |
+
jQuery('#form-ajax-ftp-email').show('slow');
|
710 |
+
} else {
|
711 |
+
jQuery('#form-ajax-ftp-email').hide('slow');
|
712 |
+
}
|
713 |
+
}
|
714 |
+
</script>
|
715 |
+
<?php if (!empty($error)) {
|
716 |
+
echo '<div class="error" style="text-align: center; color: red; font-weight:bold;">
|
717 |
+
<p style="font-size: 16px;">
|
718 |
+
' . $error . '
|
719 |
+
</p></div>';
|
720 |
+
}?>
|
721 |
+
<?php if (!empty($msg)) {
|
722 |
+
echo '<div class="updated" style="text-align: center; font-weight:bold;">
|
723 |
+
<p style="font-size: 16px;">
|
724 |
+
' . $msg . '
|
725 |
+
</p></div>';
|
726 |
+
}?>
|
727 |
+
<div id="is-dropbox-auth" style="display: none; width: 380px; text-align: center; background: #fff; border: 2px solid #dde4ff; border-radius: 5px;">
|
728 |
+
<div class="title-description" style="font-size: 20px; text-align: center;padding-top:45px; line-height: 30px;">
|
729 |
+
<?php langWPADM::get('Please, add your Dropbox credentials:'); ?><br />
|
730 |
+
<strong><?php langWPADM::get('"App key"'); ?></strong> & <strong><?php langWPADM::get('"App secret"'); ?></strong> <br />
|
731 |
+
<?php langWPADM::get('in the Setting Form'); ?>
|
732 |
+
</div>
|
733 |
+
<div class="button-description" style="padding:20px 0;padding-top:45px">
|
734 |
+
<input type="button" value="<?php langWPADM::get('OK'); ?>" onclick="jQuery('#is-dropbox-auth').arcticmodal('close');" style="text-align: center; width: 100px;" class="button-wpadm">
|
735 |
+
</div>
|
736 |
+
</div>
|
737 |
+
<?php
|
738 |
+
if (isset($sent_response)) {
|
739 |
+
?>
|
740 |
+
<script>
|
741 |
+
jQuery(document).ready(function() {
|
742 |
+
jQuery('#sent-error-report').arcticmodal({
|
743 |
+
beforeOpen: function(data, el) {
|
744 |
+
jQuery('#sent-error-report').css('display','block');
|
745 |
+
},
|
746 |
+
afterClose: function(data, el) {
|
747 |
+
jQuery('#sent-error-report').css('display','none');
|
748 |
+
}
|
749 |
+
});
|
750 |
+
})
|
751 |
+
</script>
|
752 |
+
<div id="sent-error-report" style="display: none;" >
|
753 |
+
<div class="text-view">
|
754 |
+
<?php echo $sent_response ;?>
|
755 |
+
</div>
|
756 |
+
<div class="button-sent-report">
|
757 |
+
<input type="button" class="button-wpadm" value="<?php langWPADM::get('OK'); ?>" onclick="jQuery('#sent-error-report').arcticmodal('close')" />
|
758 |
+
</div>
|
759 |
+
</div>
|
760 |
+
<?php
|
761 |
+
}
|
762 |
+
?>
|
763 |
+
<div id="ajax-alert" style="display: none;width: 800px; text-align: center; background: #fff; border: 2px solid #dde4ff; border-radius: 5px;">
|
764 |
+
<div id="ajax-message" style="font-size: 15px; margin-top: 10px; margin-bottom: 30px;"></div>
|
765 |
+
<div style="font-size: 15px; margin-bottom: 30px;"><?php langWPADM::get('To solve this problem, we need to access the system logs of your hosting/server and/or from your backup, <br />that you tried to create or simply send to us your FTP access data.');?></div>
|
766 |
+
|
767 |
+
<form action="<?php echo admin_url( 'admin-post.php?action=error_logs_check' )?>" method="post" style=" text-align: left; margin-left:110px;margin-bottom:20px;">
|
768 |
+
<div style="margin-top: 10px; font-size: 16px; font-weight: bold; margin-bottom: 10px;">
|
769 |
+
<input type="checkbox" onclick="showFormAjax();" style="margin: 0;" id="show-form-ajax" /> <label for="show-form-ajax"><?php langWPADM::get('I want to provide your FTP access to resolve this issue quickly:');?></label>
|
770 |
+
</div>
|
771 |
+
<div id="form-ajax-ftp-email" style="display: none;">
|
772 |
+
<div class="form-help-send-error" >
|
773 |
+
<div style="margin-top: 3px;">
|
774 |
+
<div class="label-help" style="">
|
775 |
+
<label for="ftp-host"><?php langWPADM::get('FTP Host'); ?></label>
|
776 |
+
</div>
|
777 |
+
<div style="float:left; ">
|
778 |
+
<input type="text" id="ftp-host" value="<?php echo str_ireplace(array('http://', 'https://'), '', home_url()) ;?>" name="ftp_host" >
|
779 |
+
</div>
|
780 |
+
</div>
|
781 |
+
<div class="clear"></div>
|
782 |
+
<div style="margin-top: 3px;">
|
783 |
+
<div class="label-help" >
|
784 |
+
<label for="ftp-user"><?php langWPADM::get('FTP User'); ?></label>
|
785 |
+
</div>
|
786 |
+
<div style="float:left; ">
|
787 |
+
<input type="text" id="ftp-user" value="" name="ftp_user">
|
788 |
+
</div>
|
789 |
+
</div>
|
790 |
+
<div class="clear"></div>
|
791 |
+
<div style="margin-top: 3px;">
|
792 |
+
<div class="label-help" >
|
793 |
+
<label for="ftp-pass"><?php langWPADM::get('FTP Password'); ?></label>
|
794 |
+
</div>
|
795 |
+
<div style="float:left; ">
|
796 |
+
<input type="text" id="ftp-pass" value="" name="ftp_pass">
|
797 |
+
</div>
|
798 |
+
</div>
|
799 |
+
<div class="clear"></div>
|
800 |
+
|
801 |
+
</div>
|
802 |
+
<div class="form-help-mail-response">
|
803 |
+
<div style="padding: 20px; border:1px solid #fff; margin-top: 3px;">
|
804 |
+
<div class="label-help" >
|
805 |
+
<label for="email-resp"><?php langWPADM::get('Response Email:'); ?></label>
|
806 |
+
</div>
|
807 |
+
<div style=" ">
|
808 |
+
<input type="text" id="email-resp" value="<?php echo get_option('admin_email');?>" style="padding-left:3px;" name="mail_response">
|
809 |
+
</div>
|
810 |
+
</div>
|
811 |
+
</div>
|
812 |
+
</div>
|
813 |
+
<div class="clear"></div>
|
814 |
+
<div style="text-align: left; margin-left: 100px; margin-top: 10px;">
|
815 |
+
<input value="<?php echo $time_log; ?>" type="hidden" name="time_pars">
|
816 |
+
<input value="" type="hidden" name="msg_ajax" id="msg_ajax">
|
817 |
+
</div>
|
818 |
+
<div class="ajax-button" style="margin-bottom: 10px;">
|
819 |
+
<input type="submit" class="button-wpadm" value="<?php langWPADM::get('SEND TO SUPPORT and close this window'); ?>" />
|
820 |
+
<input type="button" class="button-wpadm" onclick="jQuery('#ajax-message').arcticmodal('close')" value="<?php langWPADM::get('Close this window WITHOUT SENDING TO SUPPORT'); ?>" />
|
821 |
+
</div>
|
822 |
+
</form>
|
823 |
+
</div>
|
824 |
+
<div id="helper-keys" style="display: none;width: 400px; text-align: center; background: #fff; border: 2px solid #dde4ff; border-radius: 5px;">
|
825 |
+
<div class="title-description" style="font-size: 20px; text-align: center;padding-top:20px; line-height: 30px;">
|
826 |
+
<?php langWPADM::get('Where can I find my app key and secret?'); ?>
|
827 |
+
</div>
|
828 |
+
<div class="button-description" style="padding:20px 10px;padding-top:20px; text-align: left;">
|
829 |
+
<?php langWPADM::get('You can get an API app key and secret by creating an app on the'); ?>
|
830 |
+
<a href="https://www.dropbox.com/developers/apps/create?app_type_checked=api" target="_blank"><?php langWPADM::get('app creation page'); ?></a>.
|
831 |
+
<?php langWPADM::get('Once you have an app created, the app key and secret will be available on the app\'s page on the'); ?>
|
832 |
+
<a href="https://www.dropbox.com/developers/apps" target="_blank"><?php langWPADM::get('App Console'); ?></a>
|
833 |
+
. <?php langWPADM::get('Note that Drop-ins have app keys but no app secrets.'); ?>
|
834 |
+
</div>
|
835 |
+
<div class="button-description" style="padding:20px 0;padding-top:10px">
|
836 |
+
<input type="button" value="<?php langWPADM::get('OK'); ?>" onclick="jQuery('#helper-keys').arcticmodal('close');" style="text-align: center; width: 100px;" class="button-wpadm">
|
837 |
+
</div>
|
838 |
+
</div>
|
839 |
+
<!-- <a href="#" onclick="stopBackup();">Stop backup</a> -->
|
840 |
+
<div class="block-content" style="margin-top:20px;">
|
841 |
+
<div class="inline" style="width: 60%">
|
842 |
+
<span style="font-size:16px;">
|
843 |
+
<?php langWPADM::get('Use Professional version of "Dropbox backup and restore" plugin and get:') ; ?>
|
844 |
+
</span>
|
845 |
+
<ul class="list-dropbox-backup-pro">
|
846 |
+
<li><img src="<?php echo plugins_url('/template/ok-icon.png', dirname(__FILE__));?>" title="" alt="" />
|
847 |
+
<span class="text">
|
848 |
+
<?php langWPADM::get('Automated Dropbox backup (Scheduled backup tasks)') ; ?>
|
849 |
+
</span>
|
850 |
+
</li>
|
851 |
+
<li>
|
852 |
+
<img src="<?php echo plugins_url('/template/ok-icon.png', dirname(__FILE__));?>" title="" alt="" />
|
853 |
+
<span class="text">
|
854 |
+
<?php langWPADM::get('Automated Local backup (Scheduled backup tasks)') ; ?>
|
855 |
+
</span>
|
856 |
+
</li>
|
857 |
+
<li>
|
858 |
+
<img src="<?php echo plugins_url('/template/ok-icon.png', dirname(__FILE__));?>" title="" alt="" />
|
859 |
+
<span class="text">
|
860 |
+
<?php langWPADM::get('Backup Status E-Mail Reporting') ; ?>
|
861 |
+
</span>
|
862 |
+
</li>
|
863 |
+
<li>
|
864 |
+
<img src="<?php echo plugins_url('/template/ok-icon.png', dirname(__FILE__));?>" title="" alt="" />
|
865 |
+
<span class="text">
|
866 |
+
<?php langWPADM::get('Online Service "Backup Website Manager" (Copy, Clone or Migrate of websites)') ; ?>
|
867 |
+
</span>
|
868 |
+
</li>
|
869 |
+
<li>
|
870 |
+
<img src="<?php echo plugins_url('/template/ok-icon.png', dirname(__FILE__));?>" title="" alt="" />
|
871 |
+
<span class="text">
|
872 |
+
<?php langWPADM::get('One Year Free Updates for PRO version') ; ?>
|
873 |
+
</span>
|
874 |
+
</li>
|
875 |
+
<li>
|
876 |
+
<img src="<?php echo plugins_url('/template/ok-icon.png', dirname(__FILE__));?>" title="" alt="" />
|
877 |
+
<span class="text">
|
878 |
+
<?php langWPADM::get('One Year Priority support') ; ?>
|
879 |
+
</span>
|
880 |
+
</li>
|
881 |
+
</ul>
|
882 |
+
</div>
|
883 |
+
<div class="inline-right" style="margin-top: 0;">
|
884 |
+
<div class="image-dropbox-pro" onclick="document.dropbox_pro_form.submit();">
|
885 |
+
<img src="<?php echo plugins_url('/template/dropbox_pro_logo_box1.png', dirname(__FILE__));?>" title="<?php langWPADM::get('Get PRO version');?>" alt="<?php langWPADM::get('Get PRO version'); ?>">
|
886 |
+
</div>
|
887 |
+
<div style="margin-top:26%; float: left; margin-left: 20px; margin-right: 15px;">
|
888 |
+
<form action="<?php echo WPADM_URL_PRO_VERSION; ?>api/" method="post" id="dropbox_pro_form" name="dropbox_pro_form" >
|
889 |
+
<input type="hidden" value="<?php echo home_url();?>" name="site">
|
890 |
+
<input type="hidden" value="<?php echo 'proBackupPay'?>" name="actApi">
|
891 |
+
<input type="hidden" value="<?php echo get_option('admin_email');?>" name="email">
|
892 |
+
<input type="hidden" value="<?php echo 'dropbox-backup';?>" name="plugin">
|
893 |
+
<input type="hidden" value="<?php echo admin_url("admin.php?page=wpadm_wp_full_backup_dropbox&pay=success"); ?>" name="success_url">
|
894 |
+
<input type="hidden" value="<?php echo admin_url("admin.php?page=wpadm_wp_full_backup_dropbox&pay=cancel"); ?>" name="cancel_url">
|
895 |
+
<input type="submit" class="backup_button" value="<?php langWPADM::get('Get PRO');?>">
|
896 |
+
</form>
|
897 |
+
</div>
|
898 |
+
</div>
|
899 |
+
|
900 |
+
<div class="clear"></div>
|
901 |
+
</div>
|
902 |
+
<div class="block-content" style="margin-top:2px;">
|
903 |
+
<div style="min-height : 215px; padding: 5px; padding-top: 10px;">
|
904 |
+
<div class="log-dropbox" style="background-image: url(<?php echo plugins_url('/img/dropbox.png', dirname(__FILE__));?>);">
|
905 |
+
</div>
|
906 |
+
<div style="float: bottom; font-size: 40px; font-weight: bold; text-shadow: 1px 2px 2px #666; margin-left: 189px; line-height: 42px; margin-top: -12px;">
|
907 |
+
<?php langWPADM::get('Dropbox Full Backup');?>
|
908 |
+
<span style="font-size: 20px;"><?php langWPADM::get('(files+database)');?></span>
|
909 |
+
|
910 |
+
<span style="font-size: 11px;">
|
911 |
+
<?php echo (isset($plugin_data[0]['Version']) ? 'Version ' . $plugin_data[0]['Version'] : '')?>
|
912 |
+
</span>
|
913 |
+
|
914 |
+
</div>
|
915 |
+
<?php if ($show) {?>
|
916 |
+
<div id="container-user" class="cfTabsContainer" style="width: 48%; padding-bottom: 0px; padding-top: 0px; float: left; margin-left: 20px;">
|
917 |
+
<div class="stat-wpadm-info-title" id="title-regisr" style="padding :20px 0px; margin-top:11px; line-height: 25px;">
|
918 |
+
<?php langWPADM::get('Free Sign Up'); ?> <br /><?php langWPADM::get('to backup more than one website...'); ?>
|
919 |
+
</div>
|
920 |
+
<div id="cf_activate" class="cfContentContainer" style="display: none;">
|
921 |
+
<form method="post" id="dropbox_form" action="<?php echo admin_url( 'admin-post.php?action=wpadm_activate_plugin' )?>" >
|
922 |
+
<div class="stat-wpadm-registr-info" style="margin-bottom: 40px; margin-top: 17px;">
|
923 |
+
<table class="form-table stat-table-registr" style="">
|
924 |
+
<tbody>
|
925 |
+
<tr valign="top">
|
926 |
+
<th scope="row">
|
927 |
+
<label for="email"><?php langWPADM::get('E-mail'); ?></label>
|
928 |
+
</th>
|
929 |
+
<td>
|
930 |
+
<input id="email" class="" type="text" name="email" value="">
|
931 |
+
</td>
|
932 |
+
</tr>
|
933 |
+
<tr valign="top">
|
934 |
+
<th scope="row">
|
935 |
+
<label for="password"><?php langWPADM::get('Password'); ?></label>
|
936 |
+
</th>
|
937 |
+
<td>
|
938 |
+
<input id="password" class="" type="password" name="password" value="">
|
939 |
+
</td>
|
940 |
+
</tr>
|
941 |
+
<tr valign="top">
|
942 |
+
<th scope="row">
|
943 |
+
<label for="password-confirm"><?php langWPADM::get('Password confirm'); ?></label>
|
944 |
+
</th>
|
945 |
+
<td>
|
946 |
+
<input id="password-confirm" class="" type="password" name="password-confirm" value="">
|
947 |
+
</td>
|
948 |
+
</tr>
|
949 |
+
<tr valign="top">
|
950 |
+
<th scope="row">
|
951 |
+
</th>
|
952 |
+
<td>
|
953 |
+
<input class="button-wpadm" type="submit" value="<?php langWPADM::get('Register & Activate'); ?>" name="send">
|
954 |
+
</td>
|
955 |
+
</tr>
|
956 |
+
</tbody>
|
957 |
+
</table>
|
958 |
+
</div>
|
959 |
+
<div class="stat-wpadm-info" id="registr-info" style="margin-bottom: 2px; margin-top: 30px;">
|
960 |
+
<span style="font-weight:bold; font-size: 14px;"><?php langWPADM::get('If you are NOT registered at'); ?> <a target="_blank" style="color: #fff" href="<?php echo SERVER_URL_INDEX; ?>"><?php langWPADM::get('WPAdm'); ?></a>,</span> <?php langWPADM::get('enter your email and password to use as your Account Data for authorization on WPAdm.'); ?> <br /><span style="font-weight: bold;font-size: 14px;"><?php langWPADM::get('If you already have an account at'); ?> <a target="_blank" style="color: #fff" href="<?php echo SERVER_URL_INDEX; ?>"><?php langWPADM::get('WPAdm'); ?></a></span> <?php langWPADM::get('and you want to Sign-In, so please, enter your registered credential data (email and password twice).'); ?>
|
961 |
+
</div>
|
962 |
+
</form>
|
963 |
+
</div>
|
964 |
+
<div class="clear"></div>
|
965 |
+
<div class="block-button-show" style="color: #fff;">
|
966 |
+
<div class="block-click" onclick="showRegistInfo(true);">
|
967 |
+
<span id="registr-show" style="color: #fff;"><?php langWPADM::get('Show'); ?></span>
|
968 |
+
<div id="registr-choice-icon" class="dashicons dashicons-arrow-down" style=""></div>
|
969 |
+
</div>
|
970 |
+
</div>
|
971 |
+
</div>
|
972 |
+
<?php } else { ?>
|
973 |
+
<div id="container-user" class="cfTabsContainer" style="width: 48%; padding-bottom: 0px; padding-top: 0px; float: left; margin-left: 20px;">
|
974 |
+
<div class="stat-wpadm-info-title" id="title-regisr" style="padding :10px 0px; margin-top:11px; line-height: 25px; text-align: left; margin-left: 10px;">
|
975 |
+
<?php langWPADM::get('Sign In to backup more than one website...'); ?>
|
976 |
+
</div>
|
977 |
+
<div>
|
978 |
+
<form method="post" id="auth" name="auth" action="<?php echo SERVER_URL_INDEX . "login-process" ; ?>">
|
979 |
+
<div>
|
980 |
+
<div id="message-form" style="color: red; float: left;margin: 10px;margin-top: 14px;"></div>
|
981 |
+
</div>
|
982 |
+
<div style="padding: 5px; clear: both;">
|
983 |
+
<div class="form-field">
|
984 |
+
<input class="input-small" type="text" id="username" value="<?php echo get_option(PREFIX_BACKUP_ . "email");?>" readonly="readonly" required="required" name="username" placeholder="<?php langWPADM::get('Email'); ?>" />
|
985 |
+
</div>
|
986 |
+
<div class="form-field">
|
987 |
+
<input class="input-small" type="password" required="required" name="password" placeholder="<?php langWPADM::get('Password'); ?>" />
|
988 |
+
</div>
|
989 |
+
<div class="form-field">
|
990 |
+
<input class="button-wpadm" type="button" value="Sign In" onclick="auth_form(this);" />
|
991 |
+
<input type="hidden" value="<?php echo 'dropbox-backup'?>" name="plugin" />
|
992 |
+
</div>
|
993 |
+
</div>
|
994 |
+
<div style="clear:both; padding: 5px; font-size: 11px; color: #fff;">
|
995 |
+
<div class="form-field" style="margin-bottom: 10px;">
|
996 |
+
<input type="checkbox" onclick="setReadOnly('username')" style="margin: 0px;"> <?php langWPADM::get('set new mail'); ?>
|
997 |
+
</div>
|
998 |
+
</div>
|
999 |
+
<div style="clear:both;"></div>
|
1000 |
+
</form>
|
1001 |
+
</div>
|
1002 |
+
</div>
|
1003 |
+
<?php } ?>
|
1004 |
+
<div class="cfTabsContainer" style="width: 28%; float: left; margin-left: 10px; padding-bottom: 0px; padding-top: 0px;">
|
1005 |
+
<div class="stat-wpadm-info-title" id="title-setting" style="padding :20px 0px; margin-top:11px; line-height: 50px;">
|
1006 |
+
<?php langWPADM::get('Settings'); ?>
|
1007 |
+
</div>
|
1008 |
+
<div id="setting_active" class="cfContentContainer" style="display: none;">
|
1009 |
+
<form method="post" action="" >
|
1010 |
+
<div class="stat-wpadm-registr-info" style="width: 100%; margin-bottom: 9px;">
|
1011 |
+
<div style="margin-bottom: 12px; margin-top: 20px; font-size: 15px; text-align: center;">
|
1012 |
+
<input class="btn-orange" type="button" style="padding: 5px 10px; font-size: 15px; font-weight: 500" onclick="connectDropbox(this,'<?php echo admin_url( 'admin-post.php?action=dropboxConnect' )?>')" value="<?php langWPADM::get('Connect to Dropbox'); ?>" name="submit">
|
1013 |
+
<div class="desc-wpadm"><span id="dropbox_uid_text"><?php echo isset($dropbox_options['oauth_token']) && isset($dropbox_options['uid']) ? langWPADM::get('Dropbox successfully connected:', false) . " UID " . $dropbox_options['uid'] : ''; ?></span></div>
|
1014 |
+
</div>
|
1015 |
+
<?php $show_fields = isset($dropbox_options['app_key']) && !empty($dropbox_options['app_key']) && isset($dropbox_options['app_secret']) && !empty($dropbox_options['app_secret']) && $dropbox_options['app_key'] != WPADM_APP_KEY && $dropbox_options['app_secret'] != WPADM_APP_SECRET ; ?>
|
1016 |
+
<div class="setting-checkbox">
|
1017 |
+
<input type="checkbox" onclick="showApp();" <?php echo $show_fields ? 'checked="checked"' : ''?> id="dbconnection-to-app" /><label for="dbconnection-to-app"><?php langWPADM::get('Connect using my Dropbox App');?></label>
|
1018 |
+
</div>
|
1019 |
+
|
1020 |
+
<table class="form-table stat-table-registr" style="margin-top:2px; <?php echo $show_fields ? 'margin-bottom:25px;' : ''?>">
|
1021 |
+
<tbody>
|
1022 |
+
<tr valign="top" id="dropbox-app-key" style="display: <?php echo $show_fields ? 'table-row' : 'none'?>;">
|
1023 |
+
<th scope="row">
|
1024 |
+
<label for="app_key"><?php langWPADM::get('App key'); ?>*</label>
|
1025 |
+
</th>
|
1026 |
+
<td>
|
1027 |
+
<input id="app_key" class="" type="text" name="app_key" value="<?php echo isset($dropbox_options['app_key']) && $dropbox_options['app_key'] != WPADM_APP_KEY ? $dropbox_options['app_key'] : ''?>">
|
1028 |
+
</td>
|
1029 |
+
</tr>
|
1030 |
+
<tr valign="top" id="dropbox-app-secret" style="display: <?php echo $show_fields ? 'table-row' : 'none'?>;">
|
1031 |
+
<th scope="row">
|
1032 |
+
<label for="app_secret"><?php langWPADM::get('App secret'); ?>*</label>
|
1033 |
+
</th>
|
1034 |
+
<td>
|
1035 |
+
<input id="app_secret" class="" type="text" name="app_secret" value="<?php echo isset($dropbox_options['app_secret']) && $dropbox_options['app_secret'] != WPADM_APP_SECRET ? $dropbox_options['app_secret'] : ''?>">
|
1036 |
+
</td>
|
1037 |
+
</tr>
|
1038 |
+
|
1039 |
+
<tr valign="top" id="help-key-pass" style="display: <?php echo $show_fields ? 'table-row' : 'none'?>;">
|
1040 |
+
<td colspan="2" align="center">
|
1041 |
+
<a class="help-key-secret" href="javascript:getHelperDropbox();" ><?php langWPADM::get('Where to get App key & App secret?'); ?></a><br />
|
1042 |
+
</td>
|
1043 |
+
</tr>
|
1044 |
+
</tbody>
|
1045 |
+
</table>
|
1046 |
+
|
1047 |
+
<?php if ( is_super_admin() ) { ?>
|
1048 |
+
<div class="setting-checkbox">
|
1049 |
+
<input type="checkbox" <?php echo isset($dropbox_options['is_admin']) && $dropbox_options['is_admin'] == 1 ? 'checked="checked"' : ''; ?> name="is_admin" value="1" id="is_admin" onclick="saveSetting('is_admin')" />
|
1050 |
+
<label for="is_admin" style="font-size: 13px;"><?php langWPADM::get('Appear in menu for admins only'); ?></label>
|
1051 |
+
</div>
|
1052 |
+
<?php } ?>
|
1053 |
+
<div class="setting-checkbox">
|
1054 |
+
<input type="checkbox" <?php echo (isset($dropbox_options['is_optimization']) && $dropbox_options['is_optimization'] == 1) || (!isset($dropbox_options['is_optimization'])) ? 'checked="checked"' : ''; ?> name="is_optimization" value="1" id="is_optimization" onclick="saveSetting('is_optimization')" />
|
1055 |
+
<label for="is_optimization" style="font-size: 13px;"><?php langWPADM::get('Database Optimization'); ?></label>
|
1056 |
+
</div>
|
1057 |
+
</div>
|
1058 |
+
</form>
|
1059 |
+
</div>
|
1060 |
+
<div class="clear"></div>
|
1061 |
+
<div class="block-button-show" style="color: #fff;">
|
1062 |
+
<div class="block-click" onclick="showSetting(true);">
|
1063 |
+
<span id="setting-show" style="color: #fff;"><?php langWPADM::get('Show'); ?></span>
|
1064 |
+
<div id="setting-choice-icon" class="dashicons dashicons-arrow-down" style=""></div>
|
1065 |
+
</div>
|
1066 |
+
</div>
|
1067 |
+
</div>
|
1068 |
+
</div>
|
1069 |
+
</div>
|
1070 |
+
<div style="clear: both;"></div>
|
1071 |
+
<div class="block-content">
|
1072 |
+
<div class="" style="margin-top:10px;">
|
1073 |
+
<div id="logs-form" style="display: none; float:left; width: 70%;">
|
1074 |
+
<div class="title-logs"><span style="font-size:16px;"><?php langWPADM::get('Please wait...'); ?> <span id="time_backup">0 <?php langWPADM::get('sec.'); ?></span><img style="float: right;" src="<?php echo plugins_url('/img/wpadmload.gif', dirname(__FILE__))?>" alt=""></span></div>
|
1075 |
+
<div class="title-status" style="font-size:16px; display: none;"></div>
|
1076 |
+
<div style="border: 1px solid #ddd; text-align: left; background: #fff; padding: 2px;">
|
1077 |
+
<div id="log-backup" style="overflow: auto; height: 60px; border: 5px solid #fff; "></div>
|
1078 |
+
</div>
|
1079 |
+
</div>
|
1080 |
+
|
1081 |
+
<div id="reviews-dropbox" class="pointer" onclick="window.open('https://wordpress.org/support/view/plugin-reviews/dropbox-backup?filter=5');">
|
1082 |
+
<div class="title-reviews"><?php langWPADM::get('++ Review ++'); ?></div>
|
1083 |
+
<div class="desc-reviews"><?php langWPADM::get('Your review is important for us'); ?></div>
|
1084 |
+
<img src="<?php echo plugins_url('/img/stars-5.png', dirname(__FILE__));?>" alt=""></a>
|
1085 |
+
</div>
|
1086 |
+
<div id="support-button" style="float: right; margin-top: 130px; margin-right: 20px;">
|
1087 |
+
<button onclick="window.open('<?php echo SERVER_URL_INDEX . 'support/?pl=dbp'?>')" class="backup_button" style="padding: 5px 10px; margin-top: 10px; font-size: 15px;bottom: 0px;"><?php langWPADM::get('Help'); ?></button> <br />
|
1088 |
+
</div>
|
1089 |
+
<div id="action-buttons" style="">
|
1090 |
+
<div style="float: left;">
|
1091 |
+
<button onclick="start_dropbox_backup();" class="backup_button" style=""><?php langWPADM::get('Create Dropbox Backup'); ?></button>
|
1092 |
+
</div>
|
1093 |
+
<div style="float: left; margin-top: 2px;">
|
1094 |
+
<button onclick="start_local_backup()" class="backup_button" style="padding: 5px 10px; margin-top: 10px; font-size: 15px;bottom: 0px;"><?php langWPADM::get('Create Local Backup'); ?></button> <br />
|
1095 |
+
</div>
|
1096 |
+
<!-- <div style="float: left; margin-top: 2px;margin-left: 20px;">
|
1097 |
+
<button onclick="InludesSetting();" class="backup_button" style="padding: 5px 10px; margin-top: 10px; font-size: 15px;bottom: 0px;"><?php langWPADM::get('Folders & files'); ?></button> <br />
|
1098 |
+
</div> -->
|
1099 |
+
<div style="clear: both;"></div>
|
1100 |
+
</div>
|
1101 |
+
</div>
|
1102 |
+
<div style="clear: both; margin-bottom: 10px;"></div>
|
1103 |
+
<div>
|
1104 |
+
<form action="<?php echo WPADM_URL_BASE;?>wpsite/recovery-backup" method="post" target="_blank" id="form_auth_backup" name="form_auth_backup">
|
1105 |
+
</form>
|
1106 |
+
<form action="<?php echo WPADM_URL_BASE;?>backup/tasks" method="post" target="_blank" id="form_auth_backup_create" name="form_auth_backup_create">
|
1107 |
+
<input type="hidden" name="url_task_create" value="<?php echo get_option('siteurl');?>">
|
1108 |
+
</form>
|
1109 |
+
<form action="" method="post" id="form_auth_backup" name="form_auth_backup">
|
1110 |
+
</form>
|
1111 |
+
<form action="<?php echo admin_url( 'admin-post.php?action=wpadm_delete_backup' )?>" method="post" id="delete_backups" name="delete_backups">
|
1112 |
+
<input type="hidden" name="backup-name" id="backup_name" value="" />
|
1113 |
+
<input type="hidden" name="backup-type" id="backup_type" value="" />
|
1114 |
+
</form>
|
1115 |
+
<!-- <div id="inludes-setting" class="" style="display: none; position: relative; text-align: center; background: #f1ebeb; border: 2px solid #dde4ff; border-radius: 5px;">
|
1116 |
+
<div>
|
1117 |
+
<div class="title-description" style="font-size: 20px; text-align: center;padding-top:20px; line-height: 30px;">
|
1118 |
+
<?php langWPADM::get('Include/Exclude of Files & Folders to backup'); ?>
|
1119 |
+
<div style="font-size: 14px;">
|
1120 |
+
<?php langWPADM::get('Database of web page will be included automatically'); ?>
|
1121 |
+
</div>
|
1122 |
+
</div>
|
1123 |
+
<div class="loading-img">
|
1124 |
+
<img style="display: none; margin: 0 auto;" src="<?php echo plugins_url('/img/wpadmload.gif', dirname(__FILE__) ); ?>">
|
1125 |
+
</div>
|
1126 |
+
<div class="button-description">
|
1127 |
+
<!-- <input type="radio" value="folder" id="inc-folder" checked="checked"><label for="inc-folder">View folders</label> <input type="radio" value="files" id="inc-files" ><label for="inc-files">View Folders & Files</label>
|
1128 |
+
<div class="show-includes">
|
1129 |
+
|
1130 |
+
</div>
|
1131 |
+
</div>
|
1132 |
+
<div class="clear"></div>
|
1133 |
+
<div class="button-description" style="padding:20px 0; width: 100%;">
|
1134 |
+
<input type="button" value="<?php langWPADM::get('OK'); ?>" onclick="saveIncludes();" style="text-align: center; width: 100px;" class="button-wpadm">
|
1135 |
+
<input type="button" value="<?php langWPADM::get('Cancel'); ?>" onclick="InludesSetting();" style="text-align: center; width: 100px;" class="button-wpadm">
|
1136 |
+
</div>
|
1137 |
+
</div>
|
1138 |
+
|
1139 |
+
</div> -->
|
1140 |
+
|
1141 |
+
<table class="table" style="margin-top: 5px; display: <?php echo isset($data['md5']) && ($n = count($data['data'])) && is_array($data['data'][0]) ? 'table' : 'none'?>;">
|
1142 |
+
<thead>
|
1143 |
+
<tr>
|
1144 |
+
<th>#</th>
|
1145 |
+
<th align="left"><?php langWPADM::get('Create, Date/Time'); ?></th>
|
1146 |
+
<th><?php langWPADM::get('Name of Backup'); ?></th>
|
1147 |
+
<th><?php langWPADM::get('Archive Parts'); ?></th>
|
1148 |
+
<th><?php langWPADM::get('Status'); ?></th>
|
1149 |
+
<th><?php langWPADM::get('Type of Backup'); ?></th>
|
1150 |
+
<th><?php langWPADM::get('Size'); ?></th>
|
1151 |
+
<?php if(is_admin() || is_super_admin()) {?>
|
1152 |
+
<th><?php langWPADM::get('Action'); ?></th>
|
1153 |
+
<?php
|
1154 |
+
}
|
1155 |
+
?>
|
1156 |
+
</tr>
|
1157 |
+
</thead>
|
1158 |
+
<tbody>
|
1159 |
+
<?php if (isset($data['md5']) && ($n = count($data['data'])) && is_array($data['data'][0])) {
|
1160 |
+
for($i = 0; $i < $n; $i++) {
|
1161 |
+
$size = $data['data'][$i]['size'] / 1024 / 1024; /// MByte
|
1162 |
+
$size = round($size, 2);
|
1163 |
+
$files = explode(",", str_replace(array('"', "[", "]"), "", $data['data'][$i]['files'] ) );
|
1164 |
+
$f = count($files);
|
1165 |
+
?>
|
1166 |
+
<tr>
|
1167 |
+
<td class="number-backup"><?php echo ($i + 1);?></td>
|
1168 |
+
<td onclick="shows('<?php echo md5( print_r($data['data'][$i], 1) );?>', this)" class="pointer" style="text-align: left; padding-left: 7px;"><?php echo $data['data'][$i]['dt'];?></td>
|
1169 |
+
<td onclick="shows('<?php echo md5( print_r($data['data'][$i], 1) );?>', this)" class="pointer">
|
1170 |
+
<?php echo ($data['data'][$i]['size'] != 0) ? $data['data'][$i]['name'] : "<strong style=\"color:red;\">". langWPADM::get('Not available', false) . "</strong> (<a style=\"text-decoration:underline;\">".langWPADM::get('Why?', false)."</a>)";?>
|
1171 |
+
<script type="text/javascript">
|
1172 |
+
backup_name = '<?php echo $data['data'][$i]['name']?>';
|
1173 |
+
</script>
|
1174 |
+
</td>
|
1175 |
+
<td onclick="shows('<?php echo md5( print_r($data['data'][$i], 1) );?>', this)" class="pointer"><?php echo isset($data['data'][$i]['count']) ? $data['data'][$i]['count'] : $f ;?></td>
|
1176 |
+
<td onclick="shows('<?php echo md5( print_r($data['data'][$i], 1) );?>', this)" class="pointer" style="padding: 0px;">
|
1177 |
+
<?php if ($data['data'][$i]['size'] != 0) { ?>
|
1178 |
+
<img src="<?php echo plugin_dir_url(__FILE__) . "ok.png" ;?>" title="Successful" alt="Successful" style="float: left; width: 20px; height: 20px;" />
|
1179 |
+
<div style="margin-top :1px;float: left;"><?php echo langWPADM::get('Successful', false);?></div>
|
1180 |
+
<?php } else {
|
1181 |
+
?>
|
1182 |
+
<img src="<?php echo plugin_dir_url(__FILE__) . "not-ok.png" ;?>" title="Successful" alt="Successful" style="float: left; width: 20px; height: 20px;margin-left: 21px;" />
|
1183 |
+
<div style="margin-top :1px;float: left;"><?php echo langWPADM::get('Fail', false);?> (<a style="text-decoration:underline;"><?php echo langWPADM::get('Show Details', false);?></a>)</div>
|
1184 |
+
<?php
|
1185 |
+
}?>
|
1186 |
+
</td>
|
1187 |
+
<td onclick="shows('<?php echo md5( print_r($data['data'][$i], 1) );?>', this)" class="pointer"><?php echo $data['data'][$i]['type'];?> <?php langWPADM::get('backup'); ?></td>
|
1188 |
+
<td onclick="shows('<?php echo md5( print_r($data['data'][$i], 1) );?>', this)" class="pointer"><?php echo $size . langWPADM::get('Mb', false);?></td>
|
1189 |
+
<td>
|
1190 |
+
<?php if(is_admin() || is_super_admin()) {?>
|
1191 |
+
<?php if ($data['data'][$i]['size'] > 0) { ?>
|
1192 |
+
<a class="button-wpadm" href="javascript:void(0)" title="<?php langWPADM::get('Restore'); ?>" onclick="show_recovery_form('<?php echo isset($data['data'][$i]['name']) && $data['data'][$i]['type'] != 'local' ? $data['data'][$i]['name'] : 'local' ?>', '<?php echo $data['data'][$i]['name']?>')" style="color: #fff;"><span class="pointer dashicons dashicons-backup" style="margin-top:3px;"></span><?php langWPADM::get('Restore'); ?></a>
|
1193 |
+
<?php } ?>
|
1194 |
+
<a class="button-wpadm" href="javascript:void(0)" title="<?php langWPADM::get('Delete'); ?>" onclick="delete_backup('<?php echo $data['data'][$i]['name']; ?>', '<?php echo $data['data'][$i]['type'];?>')" style="color: #fff;"><span class="pointer dashicons dashicons-trash" style="margin-top:3px;"></span><?php langWPADM::get('Delete'); ?></a>
|
1195 |
+
<?php
|
1196 |
+
}
|
1197 |
+
?>
|
1198 |
+
</td>
|
1199 |
+
</tr>
|
1200 |
+
<tr id="<?php echo md5( print_r($data['data'][$i], 1) );?>" style="display:none; ">
|
1201 |
+
<?php if ($data['data'][$i]['size'] != 0) {?>
|
1202 |
+
<td colspan="2">
|
1203 |
+
</td>
|
1204 |
+
<td align="center" style="padding: 0px; width: 350px;">
|
1205 |
+
<div style="overflow: auto; max-height: 150px;">
|
1206 |
+
<?php
|
1207 |
+
if ($f > 0) { ?>
|
1208 |
+
<table border="0" align="center" class="info-path"> <?php
|
1209 |
+
for($j = 0; $j < $f; $j++) {
|
1210 |
+
if (!empty($files[$j])) {
|
1211 |
+
?>
|
1212 |
+
<tr style="border: 0;">
|
1213 |
+
<td style="border: 0;">
|
1214 |
+
<?php if ($data['data'][$i]['type'] == 'local') {?>
|
1215 |
+
<a href="<?php echo content_url(DROPBOX_BACKUP_DIR_NAME) . "/{$data['data'][$i]['name']}/{$files[$j]}"?>">
|
1216 |
+
<?php echo $files[$j]; ?>
|
1217 |
+
</a>
|
1218 |
+
<?php
|
1219 |
+
} else {
|
1220 |
+
echo $files[$j];
|
1221 |
+
}
|
1222 |
+
?>
|
1223 |
+
</td>
|
1224 |
+
</tr>
|
1225 |
+
<?php
|
1226 |
+
}
|
1227 |
+
}
|
1228 |
+
?>
|
1229 |
+
</table>
|
1230 |
+
<?php
|
1231 |
+
}
|
1232 |
+
?>
|
1233 |
+
</div>
|
1234 |
+
</td>
|
1235 |
+
<td colspan="6"></td>
|
1236 |
+
<?php
|
1237 |
+
} else { ?>
|
1238 |
+
<td colspan="2">
|
1239 |
+
</td>
|
1240 |
+
<td colspan="4" style="background: #ddecf9;">
|
1241 |
+
<div style="padding-left: 10px; padding-right: 10px;">
|
1242 |
+
<div style="font-size: 12px; text-align: left;">
|
1243 |
+
<?php
|
1244 |
+
$time_log = str_replace(array(':', '-', " "), "_", $data['data'][$i]['dt']);
|
1245 |
+
if ( file_exists( $base_path . "/tmp/logs_error_" . $time_log ) ) {
|
1246 |
+
$log_ = file_get_contents( $base_path . "/tmp/logs_error_" . $time_log );
|
1247 |
+
$pos = stripos($log_, "error");
|
1248 |
+
if ($pos !== false) {
|
1249 |
+
for($p = $pos; ; $p--) {
|
1250 |
+
if ($log_{$p} == "\n") {
|
1251 |
+
$pos_new = $p + 1;
|
1252 |
+
break;
|
1253 |
+
}
|
1254 |
+
}
|
1255 |
+
$error =substr($log_, $pos_new);
|
1256 |
+
echo str_replace("\n", "<br />", $error);
|
1257 |
+
}
|
1258 |
+
} else {
|
1259 |
+
langWPADM::get('Error log wasn\'t Found');
|
1260 |
+
}?>
|
1261 |
+
</div>
|
1262 |
+
|
1263 |
+
<form action="<?php echo admin_url( 'admin-post.php?action=error_logs_check' )?>" method="post" style=" text-align: left;">
|
1264 |
+
<div style="margin-top: 10px; font-size: 16px; font-weight: bold; margin-bottom: 10px;">
|
1265 |
+
<?php langWPADM::get('Please, provide your FTP access to resolve this issue quickly:');?>
|
1266 |
+
</div>
|
1267 |
+
<div class="form-help-send-error" >
|
1268 |
+
<div style="margin-top: 3px;">
|
1269 |
+
<div class="label-help" style="">
|
1270 |
+
<label for="ftp-host"><?php langWPADM::get('FTP Host'); ?></label>
|
1271 |
+
</div>
|
1272 |
+
<div style="float:left; ">
|
1273 |
+
<input type="text" id="ftp-host" value="<?php echo str_ireplace(array('http://', 'https://'), '', home_url()) ;?>" name="ftp_host" >
|
1274 |
+
</div>
|
1275 |
+
</div>
|
1276 |
+
<div class="clear"></div>
|
1277 |
+
<div style="margin-top: 3px;">
|
1278 |
+
<div class="label-help" >
|
1279 |
+
<label for="ftp-user"><?php langWPADM::get('FTP User'); ?></label>
|
1280 |
+
</div>
|
1281 |
+
<div style="float:left; ">
|
1282 |
+
<input type="text" id="ftp-user" value="" name="ftp_user">
|
1283 |
+
</div>
|
1284 |
+
</div>
|
1285 |
+
<div class="clear"></div>
|
1286 |
+
<div style="margin-top: 3px;">
|
1287 |
+
<div class="label-help" >
|
1288 |
+
<label for="ftp-pass"><?php langWPADM::get('FTP Password'); ?></label>
|
1289 |
+
</div>
|
1290 |
+
<div style="float:left; ">
|
1291 |
+
<input type="text" id="ftp-pass" value="" name="ftp_pass">
|
1292 |
+
</div>
|
1293 |
+
</div>
|
1294 |
+
<div class="clear"></div>
|
1295 |
+
|
1296 |
+
</div>
|
1297 |
+
<div class="form-help-mail-response">
|
1298 |
+
<div style="padding: 20px; border:1px solid #fff; margin-top: 3px;">
|
1299 |
+
<div class="label-help" >
|
1300 |
+
<label for="email-resp"><?php langWPADM::get('Response Email:'); ?></label>
|
1301 |
+
</div>
|
1302 |
+
<div style=" ">
|
1303 |
+
<input type="text" id="email-resp" value="<?php echo get_option('admin_email');?>" style="padding-left:3px;" name="mail_response">
|
1304 |
+
</div>
|
1305 |
+
</div>
|
1306 |
+
</div>
|
1307 |
+
<div class="clear"></div>
|
1308 |
+
<div style="text-align: left; margin-left: 100px; margin-top: 10px;">
|
1309 |
+
<input value="<?php echo $time_log; ?>" type="hidden" name="time_pars">
|
1310 |
+
<input class="backup_button" style="font-size: 14px;font-weight: normal;padding: 3px;text-shadow: 0px;" type="submit" value="<?php langWPADM::get('Send request to support'); ?>">
|
1311 |
+
</div>
|
1312 |
+
</form>
|
1313 |
+
|
1314 |
+
</div>
|
1315 |
+
</td>
|
1316 |
+
<td colspan="3">
|
1317 |
+
</td>
|
1318 |
+
<?php
|
1319 |
+
}
|
1320 |
+
?>
|
1321 |
+
</tr>
|
1322 |
+
<?php
|
1323 |
+
} ?>
|
1324 |
+
<?php } ?>
|
1325 |
+
</tbody>
|
1326 |
+
</table>
|
1327 |
+
|
1328 |
+
</div>
|
1329 |
+
</div>
|
1330 |
+
|
1331 |
+
</div>
|
wpadm.php
DELETED
@@ -1,249 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if (! defined("WPADM_URL_BASE")) {
|
3 |
-
define("WPADM_URL_BASE", 'http://secure.wpadm.com/');
|
4 |
-
}
|
5 |
-
/**
|
6 |
-
* General functions
|
7 |
-
*
|
8 |
-
*/
|
9 |
-
|
10 |
-
if ( ! function_exists( 'wpadm_run' )) {
|
11 |
-
function wpadm_run($pl, $dir) {
|
12 |
-
@set_time_limit(0);
|
13 |
-
require_once dirname(__FILE__) . '/class-wpadm-method-class.php';
|
14 |
-
$request_name = $pl . '_request';
|
15 |
-
if( isset( $_POST[$request_name] ) && ! empty ( $_POST[$request_name] ) ) {
|
16 |
-
require_once dirname(__FILE__) . '/class-wpadm-core.php';
|
17 |
-
$wpadm = new WPAdm_Core(wpadm_unpack($_POST[$request_name]), $pl, $dir);
|
18 |
-
echo '<wpadm>'.wpadm_pack($wpadm->getResult()->toArray()).'</wpadm>';
|
19 |
-
exit;
|
20 |
-
}
|
21 |
-
}
|
22 |
-
}
|
23 |
-
if ( ! function_exists('wpadm_include_admins_script') ) {
|
24 |
-
function wpadm_include_admins_script()
|
25 |
-
{
|
26 |
-
wp_enqueue_style('css-admin-wpadm-db', plugins_url( "/css/admin-style-wpadm.css", __FILE__ ) );
|
27 |
-
}
|
28 |
-
}
|
29 |
-
|
30 |
-
|
31 |
-
if ( ! function_exists( 'wpadm_unpack' )) {
|
32 |
-
/**
|
33 |
-
* @param str $str
|
34 |
-
* @return mixed
|
35 |
-
*/
|
36 |
-
function wpadm_unpack( $str ) {
|
37 |
-
return unserialize( base64_decode( $str ) );
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
if ( ! function_exists('wpadm_pack')) {
|
42 |
-
/**
|
43 |
-
* @param mixed $value
|
44 |
-
* @return string
|
45 |
-
*/
|
46 |
-
function wpadm_pack( $value ) {
|
47 |
-
return base64_encode( serialize ( $value ) ) ;
|
48 |
-
}
|
49 |
-
}
|
50 |
-
|
51 |
-
if ( ! function_exists('wpadm_admin_notice')) {
|
52 |
-
function wpadm_admin_notice() {
|
53 |
-
global $status, $page, $s;
|
54 |
-
$context = $status;
|
55 |
-
$plugin = 'dropbox-backup/dropbox-backup.php';
|
56 |
-
$nonce = wp_create_nonce('deactivate-plugin_' . $plugin);
|
57 |
-
$actions = 'plugins.php?action=deactivate&plugin=' . urlencode($plugin) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s . '&_wpnonce=' . $nonce;
|
58 |
-
$wpadm_key = !get_option('wpadm_pub_key');
|
59 |
-
$url = home_url();
|
60 |
-
$url = str_ireplace(array('http://', 'https://'), "", $url);
|
61 |
-
$url = str_ireplace(array('www.'), "", $url);
|
62 |
-
if (substr($url, -1) == "/") {
|
63 |
-
$url = substr($url, 0, strlen($url) );
|
64 |
-
}
|
65 |
-
$plugin = md5('dropbox-backup');
|
66 |
-
|
67 |
-
?>
|
68 |
-
|
69 |
-
|
70 |
-
<?php if ($wpadm_key) { ?>
|
71 |
-
<div class="wpadm-notice">
|
72 |
-
<div class="registr">
|
73 |
-
Please add this site to your
|
74 |
-
<form action="<?php echo WPADM_URL_BASE?>user/registration" target="_blank" style="margin-bottom: 3px; display: inline;" method="post">
|
75 |
-
<input type="hidden" name="site" value="<?php echo md5($url);?>" />
|
76 |
-
<input type="hidden" name="plugin" value="<?php echo md5($plugin);?>" />
|
77 |
-
<input type="submit" value="WPAdm" class="button-wpadm" style="margin-top: -3px;" />
|
78 |
-
</form>
|
79 |
-
account or <a href="<?php echo $actions;?>">deactivate DropBox Backup</a> plugin
|
80 |
-
</div>
|
81 |
-
</div>
|
82 |
-
<?php } else { ?>
|
83 |
-
<div class="wpadm-notice" style="height: 195px">
|
84 |
-
<div class="registr" style="font-size: 14px; margin-top: 10px; line-height: 24px;">
|
85 |
-
<form action="<?php echo WPADM_URL_BASE?>user/registration" target="_blank" style="margin-bottom: 3px; display: inline;" method="post">
|
86 |
-
<input type="hidden" name="site" value="<?php echo md5($url);?>" />
|
87 |
-
<input type="hidden" name="plugin" value="<?php echo md5($plugin);?>" />
|
88 |
-
<input type="hidden" name="u" value="<?php echo 1;?>" />
|
89 |
-
Dear user, <br />
|
90 |
-
all Backups you have made by <strong>Dropbox Backup</strong> plugin are safe and available at their place, but, according to the rules of Wordpress system, we had to update the logic of <strong>Dropbox Backup</strong> plugin.<br />
|
91 |
-
Now, if you want to see the <strong>Dropbox Backup</strong> plugin interface in your admin-panel again, you must upgrade this plugin from
|
92 |
-
<input type="submit" value="our page" class="button-link" />.
|
93 |
-
This is optional feature, you mustn’t do it, but you can. <br />
|
94 |
-
Also, you can administrate all of your Backups for all of your web pages from one place – <input type="submit" value="WPAdm-account" class="button-link" />. This account is FULL FREE.<br />
|
95 |
-
Here you can <input type="submit" value="login" class="button-wpadm" style="margin-top: -3px;" /> to your account or register in the WPAdm system.
|
96 |
-
</form>
|
97 |
-
</div>
|
98 |
-
</div>
|
99 |
-
<?php
|
100 |
-
} ?>
|
101 |
-
|
102 |
-
|
103 |
-
<?php
|
104 |
-
}
|
105 |
-
}
|
106 |
-
|
107 |
-
|
108 |
-
if ( ! function_exists('wpadm_deactivation')) {
|
109 |
-
function wpadm_deactivation() {
|
110 |
-
wpadm_send_blog_info('deactivation');
|
111 |
-
}
|
112 |
-
}
|
113 |
-
|
114 |
-
|
115 |
-
if ( ! function_exists('wpadm_uninstall')) {
|
116 |
-
function wpadm_uninstall() {
|
117 |
-
wpadm_send_blog_info('uninstall');
|
118 |
-
}
|
119 |
-
}
|
120 |
-
|
121 |
-
|
122 |
-
if ( ! function_exists('wpadm_activation')) {
|
123 |
-
function wpadm_activation() {
|
124 |
-
wpadm_send_blog_info('activation');
|
125 |
-
}
|
126 |
-
}
|
127 |
-
|
128 |
-
if ( ! function_exists('wpadm_send_blog_info')) {
|
129 |
-
function wpadm_send_blog_info($status) {
|
130 |
-
$info = wpadm_get_blog_info();
|
131 |
-
$info['status'] = $status;
|
132 |
-
|
133 |
-
$data = wpadm_pack($info);
|
134 |
-
$host = WPADM_URL_BASE;
|
135 |
-
$host = str_replace(array('http://','https://'), '', trim($host,'/'));
|
136 |
-
$socket = fsockopen($host, 80, $errno, $errstr, 30);
|
137 |
-
fwrite($socket, "GET /wpsite/pluginHook?data={$data} HTTP/1.1\r\n");
|
138 |
-
fwrite($socket, "Host: {$host}\r\n");
|
139 |
-
|
140 |
-
fwrite($socket,"Content-type: application/x-www-form-urlencoded\r\n");
|
141 |
-
fwrite($socket,"Content-length:".strlen($data)."\r\n");
|
142 |
-
fwrite($socket,"Accept:*/*\r\n");
|
143 |
-
fwrite($socket,"User-agent:Opera 10.00\r\n");
|
144 |
-
fwrite($socket,"Connection:Close\r\n");
|
145 |
-
fwrite($socket,"\r\n");
|
146 |
-
sleep(1);
|
147 |
-
fclose($socket);
|
148 |
-
}
|
149 |
-
}
|
150 |
-
|
151 |
-
if ( ! function_exists('wpadm_get_blog_info')) {
|
152 |
-
function wpadm_get_blog_info() {
|
153 |
-
$info = array(
|
154 |
-
'url' => get_site_url(),
|
155 |
-
);
|
156 |
-
$debug = debug_backtrace();
|
157 |
-
$info['debug'] = $debug;
|
158 |
-
$file = (is_array($debug[count($debug)-1]['args'][0]))?$debug[count($debug)-1]['args'][0][0] : $debug[count($debug)-1]['args'][0];
|
159 |
-
preg_match("|wpadm_.*wpadm_(.*)\.php|", $file, $m); ;
|
160 |
-
$info['plugin'] = $m[1];
|
161 |
-
|
162 |
-
return $info;
|
163 |
-
}
|
164 |
-
}
|
165 |
-
|
166 |
-
if (!function_exists("get_system_data")) {
|
167 |
-
function get_system_data()
|
168 |
-
{
|
169 |
-
|
170 |
-
global $wp_version;
|
171 |
-
|
172 |
-
/*
|
173 |
-
*
|
174 |
-
* Get the settings of php to show in plugin information-page.
|
175 |
-
* It will get the minimum requirements of php and mysql configuration, version and language of wordpress
|
176 |
-
* additionally, AFTER the user has been registered at WPAdm service AND has confirmed their registration(!) this data
|
177 |
-
* will be send to WPAdm service, to get the plugin work correctly, to extend supported configurations of user sites with wpadm-extensions and support.
|
178 |
-
* Information about sending of this data is published in readme.txt of this plugin
|
179 |
-
* WE DO NOT COLLECT AND DO NOT STORE THE PERSONAL DATA OF USERS FROM THIS PLUGIN!
|
180 |
-
*
|
181 |
-
*/
|
182 |
-
$phpVersion = phpversion();
|
183 |
-
$maxExecutionTime = ini_get('max_execution_time');
|
184 |
-
$maxMemoryLimit = ini_get('memory_limit');
|
185 |
-
$extensions = implode(', ', get_loaded_extensions());
|
186 |
-
$disabledFunctions = ini_get('disable_functions');
|
187 |
-
$mysqlVersion = '';
|
188 |
-
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD);
|
189 |
-
if (!mysqli_connect_errno()) {
|
190 |
-
$mysqlVersion = $mysqli->server_info;
|
191 |
-
}
|
192 |
-
$upMaxExecutionTime = 0;
|
193 |
-
$newMaxExecutionTime = intval($maxExecutionTime) + 60;
|
194 |
-
@set_time_limit( $newMaxExecutionTime );
|
195 |
-
if( ini_get('max_execution_time') == $newMaxExecutionTime ){
|
196 |
-
$upMaxExecutionTime = 1;
|
197 |
-
$maxExecutionTime = ini_get('max_execution_time');
|
198 |
-
}
|
199 |
-
$upMemoryLimit = 0;
|
200 |
-
$newMemoryLimit = intval($maxMemoryLimit) + 60;
|
201 |
-
ini_set('memory_limit', $newMemoryLimit.'M');
|
202 |
-
if( ini_get('memory_limit') == $newMemoryLimit ){
|
203 |
-
$upMemoryLimit = 1;
|
204 |
-
$maxMemoryLimit = ini_get('memory_limit');
|
205 |
-
}
|
206 |
-
$extensions_search = array('curl', 'json', 'mysqli', 'sockets', 'zip', 'ftp');
|
207 |
-
$disabledFunctions_search = array('set_time_limit', 'curl_init', 'fsockopen', 'ftp_connect');
|
208 |
-
|
209 |
-
$ex = check_function($extensions, $extensions_search);
|
210 |
-
$func = check_function($disabledFunctions, $disabledFunctions_search, true);
|
211 |
-
|
212 |
-
return array('wp_version' => $wp_version, 'php_verion' => phpversion(),
|
213 |
-
'maxExecutionTime' => $maxExecutionTime, 'maxMemoryLimit' => $maxMemoryLimit,
|
214 |
-
'extensions' => $extensions, 'disabledFunctions' => $disabledFunctions,
|
215 |
-
'mysqlVersion' => $mysqlVersion, 'upMaxExecutionTime' => $upMaxExecutionTime,
|
216 |
-
'newMaxExecutionTime' => $newMaxExecutionTime, 'upMemoryLimit' => $upMemoryLimit,
|
217 |
-
'newMemoryLimit' => $newMaxExecutionTime, 'maxMemoryLimit' => $maxMemoryLimit,
|
218 |
-
'ex' => $ex, 'func' => $func, 'wp_lang' => get_option('WPLANG'),
|
219 |
-
);
|
220 |
-
|
221 |
-
}
|
222 |
-
}
|
223 |
-
if (! function_exists('check_function')) {
|
224 |
-
function check_function($func, $search, $type = false)
|
225 |
-
{
|
226 |
-
if (is_string($func)) {
|
227 |
-
$func = explode(", ", $func);
|
228 |
-
}
|
229 |
-
if (is_string($search)) {
|
230 |
-
$search = explode(", ", $search);
|
231 |
-
}
|
232 |
-
$res = false;
|
233 |
-
$n = count($search);
|
234 |
-
for($i = 0; $i < $n; $i++) {
|
235 |
-
if (in_array($search[$i], $func) === $type) {
|
236 |
-
$res[] = $search[$i];
|
237 |
-
}
|
238 |
-
}
|
239 |
-
return $res;
|
240 |
-
}
|
241 |
-
}
|
242 |
-
|
243 |
-
if (! function_exists('check_version')) {
|
244 |
-
function check_version($ver, $ver2)
|
245 |
-
{
|
246 |
-
return version_compare($ver, $ver2, ">");
|
247 |
-
}
|
248 |
-
}
|
249 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|