Version Description
- Better Handling of error message from Server on signup
- Added Support for Multi Table Callbacks
Download this release
Release Info
Developer | ritesh.soni36 |
Plugin | Migrate Guru: Migrate & Clone WordPress Free |
Version | 4.58 |
Comparing to | |
See all releases |
Code changes from version 4.35 to 4.58
- account.php +64 -3
- callback/handler.php +4 -0
- callback/wings/account.php +3 -7
- callback/wings/db.php +83 -5
- callback/wings/fs.php +3 -5
- callback/wings/info.php +7 -0
- callback/wings/misc.php +28 -2
- info.php +47 -6
- migrateguru.php +9 -3
- readme.txt +5 -1
- wp_actions.php +6 -1
- wp_admin.php +1 -1
- wp_site_info.php +6 -0
account.php
CHANGED
@@ -84,6 +84,39 @@ if (!class_exists('MGAccount')) :
|
|
84 |
return $accountsByPlugname;
|
85 |
}
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
public static function isConfigured($settings) {
|
88 |
$accounts = self::accountsByPlugname($settings);
|
89 |
return (sizeof($accounts) >= 1);
|
@@ -150,21 +183,27 @@ if (!class_exists('MGAccount')) :
|
|
150 |
}
|
151 |
$this->sig_match = self::getSigMatch($request, $this->secret);
|
152 |
if ($this->sig_match !== $request->sig) {
|
153 |
-
return
|
154 |
}
|
155 |
$this->settings->updateOption('bvLastRecvTime', $time);
|
156 |
return 1;
|
157 |
}
|
158 |
-
|
159 |
public function updateInfo($info) {
|
160 |
$accounts = self::allAccounts($this->settings);
|
161 |
-
$plugname =
|
|
|
162 |
$pubkey = $info['pubkey'];
|
163 |
if (!array_key_exists($pubkey, $accounts)) {
|
164 |
$accounts[$pubkey] = array();
|
165 |
}
|
|
|
|
|
|
|
|
|
166 |
$accounts[$pubkey]['lastbackuptime'] = time();
|
167 |
$accounts[$pubkey][$plugname] = true;
|
|
|
168 |
$accounts[$pubkey]['url'] = $info['url'];
|
169 |
$accounts[$pubkey]['email'] = $info['email'];
|
170 |
self::update($this->settings, $accounts);
|
@@ -180,6 +219,28 @@ if (!class_exists('MGAccount')) :
|
|
180 |
return false;
|
181 |
}
|
182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
public static function exists($settings, $pubkey) {
|
184 |
$accounts = self::allAccounts($settings);
|
185 |
return array_key_exists($pubkey, $accounts);
|
84 |
return $accountsByPlugname;
|
85 |
}
|
86 |
|
87 |
+
public static function accountsByType($settings, $account_type) {
|
88 |
+
$accounts = self::allAccounts($settings);
|
89 |
+
$accounts_by_type = array();
|
90 |
+
foreach ($accounts as $pubkey => $value) {
|
91 |
+
if (array_key_exists('account_type', $value) && $value['account_type'] === $account_type) {
|
92 |
+
$accounts_by_type[$pubkey] = $value;
|
93 |
+
}
|
94 |
+
}
|
95 |
+
return $accounts_by_type;
|
96 |
+
}
|
97 |
+
|
98 |
+
public static function accountsByGid($settings, $account_gid) {
|
99 |
+
$accounts = self::allAccounts($settings);
|
100 |
+
$accounts_by_gid = array();
|
101 |
+
foreach ($accounts as $pubkey => $value) {
|
102 |
+
if (array_key_exists('account_gid', $value) && $value['account_gid'] === $account_gid) {
|
103 |
+
$accounts_by_gid[$pubkey] = $value;
|
104 |
+
}
|
105 |
+
}
|
106 |
+
return $accounts_by_gid;
|
107 |
+
}
|
108 |
+
|
109 |
+
public static function accountsByPattern($settings, $search_key, $search_pattern) {
|
110 |
+
$accounts = self::allAccounts($settings);
|
111 |
+
$accounts_by_pattern = array();
|
112 |
+
foreach ($accounts as $pubkey => $value) {
|
113 |
+
if (array_key_exists($search_key, $value) && preg_match($search_pattern, $value[$search_key]) == 1) {
|
114 |
+
$accounts_by_pattern[$pubkey] = $value;
|
115 |
+
}
|
116 |
+
}
|
117 |
+
return $accounts_by_pattern;
|
118 |
+
}
|
119 |
+
|
120 |
public static function isConfigured($settings) {
|
121 |
$accounts = self::accountsByPlugname($settings);
|
122 |
return (sizeof($accounts) >= 1);
|
183 |
}
|
184 |
$this->sig_match = self::getSigMatch($request, $this->secret);
|
185 |
if ($this->sig_match !== $request->sig) {
|
186 |
+
return false;
|
187 |
}
|
188 |
$this->settings->updateOption('bvLastRecvTime', $time);
|
189 |
return 1;
|
190 |
}
|
191 |
+
|
192 |
public function updateInfo($info) {
|
193 |
$accounts = self::allAccounts($this->settings);
|
194 |
+
$plugname = $info["plugname"];
|
195 |
+
$account_type = $info["account_type"];
|
196 |
$pubkey = $info['pubkey'];
|
197 |
if (!array_key_exists($pubkey, $accounts)) {
|
198 |
$accounts[$pubkey] = array();
|
199 |
}
|
200 |
+
if (array_key_exists('secret', $info)) {
|
201 |
+
$accounts[$pubkey]['secret'] = $info['secret'];
|
202 |
+
}
|
203 |
+
$accounts[$pubkey]['account_gid'] = $info['account_gid'];
|
204 |
$accounts[$pubkey]['lastbackuptime'] = time();
|
205 |
$accounts[$pubkey][$plugname] = true;
|
206 |
+
$accounts[$pubkey]['account_type'] = $account_type;
|
207 |
$accounts[$pubkey]['url'] = $info['url'];
|
208 |
$accounts[$pubkey]['email'] = $info['email'];
|
209 |
self::update($this->settings, $accounts);
|
219 |
return false;
|
220 |
}
|
221 |
|
222 |
+
public static function removeByAccountType($settings, $account_type) {
|
223 |
+
$accounts = MGAccount::accountsByType($settings, $account_type);
|
224 |
+
if (sizeof($accounts) >= 1) {
|
225 |
+
foreach ($accounts as $pubkey => $value) {
|
226 |
+
MGAccount::remove($settings, $pubkey);
|
227 |
+
}
|
228 |
+
return true;
|
229 |
+
}
|
230 |
+
return false;
|
231 |
+
}
|
232 |
+
|
233 |
+
public static function removeByAccountGid($settings, $account_gid) {
|
234 |
+
$accounts = MGAccount::accountsByGid($settings, $account_gid);
|
235 |
+
if (sizeof($accounts) >= 1) {
|
236 |
+
foreach ($accounts as $pubkey => $value) {
|
237 |
+
MGAccount::remove($settings, $pubkey);
|
238 |
+
}
|
239 |
+
return true;
|
240 |
+
}
|
241 |
+
return false;
|
242 |
+
}
|
243 |
+
|
244 |
public static function exists($settings, $pubkey) {
|
245 |
$accounts = self::allAccounts($settings);
|
246 |
return array_key_exists($pubkey, $accounts);
|
callback/handler.php
CHANGED
@@ -88,6 +88,10 @@ if (!class_exists('BVCallbackHandler')) :
|
|
88 |
require_once dirname( __FILE__ ) . '/wings/fs_write.php';
|
89 |
$module = new BVFSWriteCallback();
|
90 |
break;
|
|
|
|
|
|
|
|
|
91 |
default:
|
92 |
require_once dirname( __FILE__ ) . '/wings/misc.php';
|
93 |
$module = new BVMiscCallback($this);
|
88 |
require_once dirname( __FILE__ ) . '/wings/fs_write.php';
|
89 |
$module = new BVFSWriteCallback();
|
90 |
break;
|
91 |
+
case 'actlg':
|
92 |
+
require_once dirname( __FILE__ ) . '/wings/actlog.php';
|
93 |
+
$module = new BVActLogCallback($this);
|
94 |
+
break;
|
95 |
default:
|
96 |
require_once dirname( __FILE__ ) . '/wings/misc.php';
|
97 |
$module = new BVMiscCallback($this);
|
callback/wings/account.php
CHANGED
@@ -24,19 +24,15 @@ class BVAccountCallback extends BVCallbackBase {
|
|
24 |
$resp = array("status" => MGAccount::remove($this->settings, $params['public']));
|
25 |
break;
|
26 |
case "updt":
|
27 |
-
$
|
28 |
-
$info['email'] = $params['email'];
|
29 |
-
$info['url'] = $params['url'];
|
30 |
-
$info['pubkey'] = $params['pubkey'];
|
31 |
-
$account->updateInfo($info);
|
32 |
$resp = array("status" => MGAccount::exists($this->settings, $params['pubkey']));
|
33 |
break;
|
34 |
case "updtapikey":
|
35 |
MGAccount::updateApiPublicKey($this->settings, $params['pubkey']);
|
36 |
$resp = array("status" => $this->settings->getOption(MGAccount::$api_public_key));
|
37 |
break;
|
38 |
-
case "
|
39 |
-
$resp = array("status" => $settings->deleteOption('
|
40 |
break;
|
41 |
case "rmbvkeys":
|
42 |
$resp = array("status" => $settings->deleteOption('bvKeys'));
|
24 |
$resp = array("status" => MGAccount::remove($this->settings, $params['public']));
|
25 |
break;
|
26 |
case "updt":
|
27 |
+
$account->updateInfo($params);
|
|
|
|
|
|
|
|
|
28 |
$resp = array("status" => MGAccount::exists($this->settings, $params['pubkey']));
|
29 |
break;
|
30 |
case "updtapikey":
|
31 |
MGAccount::updateApiPublicKey($this->settings, $params['pubkey']);
|
32 |
$resp = array("status" => $this->settings->getOption(MGAccount::$api_public_key));
|
33 |
break;
|
34 |
+
case "rmbvscrt":
|
35 |
+
$resp = array("status" => $settings->deleteOption('bvSecretKey'));
|
36 |
break;
|
37 |
case "rmbvkeys":
|
38 |
$resp = array("status" => $settings->deleteOption('bvKeys'));
|
callback/wings/db.php
CHANGED
@@ -15,7 +15,6 @@ class BVDBCallback extends BVCallbackBase {
|
|
15 |
$this->db = $callback_handler->db;
|
16 |
$this->account = $callback_handler->account;
|
17 |
$this->siteinfo = $callback_handler->siteinfo;
|
18 |
-
$this->bvinfo = $callback_handler->bvinfo;
|
19 |
}
|
20 |
|
21 |
public function getLastID($pkeys, $end_row) {
|
@@ -43,7 +42,9 @@ class BVDBCallback extends BVCallbackBase {
|
|
43 |
$data = array();
|
44 |
$data["offset"] = $offset;
|
45 |
$data["size"] = $srows;
|
46 |
-
$
|
|
|
|
|
47 |
array_push($tinfo, $data);
|
48 |
if (!empty($pkeys) && $srows > 0) {
|
49 |
$end_row = end($rows);
|
@@ -64,13 +65,65 @@ class BVDBCallback extends BVCallbackBase {
|
|
64 |
return $result;
|
65 |
}
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
public function process($request) {
|
68 |
$db = $this->db;
|
69 |
$params = $request->params;
|
70 |
$stream_init_info = BVStream::startStream($this->account, $request);
|
71 |
|
72 |
-
|
73 |
-
|
74 |
if (array_key_exists('stream', $stream_init_info)) {
|
75 |
$this->stream = $stream_init_info['stream'];
|
76 |
switch ($request->method) {
|
@@ -101,6 +154,31 @@ class BVDBCallback extends BVCallbackBase {
|
|
101 |
$table = urldecode($params['table']);
|
102 |
$resp = array("create" => $db->showTableCreate($table));
|
103 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
case "getrowscount":
|
105 |
$table = urldecode($params['table']);
|
106 |
$resp = array("count" => $db->rowsCount($table));
|
@@ -175,4 +253,4 @@ class BVDBCallback extends BVCallbackBase {
|
|
175 |
return $resp;
|
176 |
}
|
177 |
}
|
178 |
-
endif;
|
15 |
$this->db = $callback_handler->db;
|
16 |
$this->account = $callback_handler->account;
|
17 |
$this->siteinfo = $callback_handler->siteinfo;
|
|
|
18 |
}
|
19 |
|
20 |
public function getLastID($pkeys, $end_row) {
|
42 |
$data = array();
|
43 |
$data["offset"] = $offset;
|
44 |
$data["size"] = $srows;
|
45 |
+
$serialized_rows = serialize($rows);
|
46 |
+
$data['md5'] = md5($serialized_rows);
|
47 |
+
$data['length'] = strlen($serialized_rows);
|
48 |
array_push($tinfo, $data);
|
49 |
if (!empty($pkeys) && $srows > 0) {
|
50 |
$end_row = end($rows);
|
65 |
return $result;
|
66 |
}
|
67 |
|
68 |
+
public function getCreateTableQueries($tables) {
|
69 |
+
$resp = array();
|
70 |
+
foreach($tables as $table) {
|
71 |
+
$tname = urldecode($table);
|
72 |
+
$resp[$tname] = array("create" => $this->db->showTableCreate($table));
|
73 |
+
}
|
74 |
+
return $resp;
|
75 |
+
}
|
76 |
+
|
77 |
+
public function checkTables($tables, $type) {
|
78 |
+
$resp = array();
|
79 |
+
foreach($tables as $table) {
|
80 |
+
$tname = urldecode($table);
|
81 |
+
$resp[$tname] = array("status" => $this->db->checkTable($table, $type));
|
82 |
+
}
|
83 |
+
return $resp;
|
84 |
+
}
|
85 |
+
|
86 |
+
public function describeTables($tables) {
|
87 |
+
$resp = array();
|
88 |
+
foreach($tables as $table) {
|
89 |
+
$tname = urldecode($table);
|
90 |
+
$resp[$tname] = array("description" => $this->db->describeTable($table));
|
91 |
+
}
|
92 |
+
return $resp;
|
93 |
+
}
|
94 |
+
|
95 |
+
public function checkTablesExist($tables) {
|
96 |
+
$resp = array();
|
97 |
+
foreach($tables as $table) {
|
98 |
+
$tname = urldecode($table);
|
99 |
+
$resp[$tname] = array("tblexists" => $this->db->isTablePresent($table));
|
100 |
+
}
|
101 |
+
return $resp;
|
102 |
+
}
|
103 |
+
|
104 |
+
public function getTablesRowCount($tables) {
|
105 |
+
$resp = array();
|
106 |
+
foreach($tables as $table) {
|
107 |
+
$tname = urldecode($table);
|
108 |
+
$resp[$tname] = array("count" => $this->db->rowsCount($table));
|
109 |
+
}
|
110 |
+
return $resp;
|
111 |
+
}
|
112 |
+
|
113 |
+
public function getTablesKeys($tables) {
|
114 |
+
$resp = array();
|
115 |
+
foreach($tables as $table) {
|
116 |
+
$tname = urldecode($table);
|
117 |
+
$resp[$tname] = array("keys" => $this->db->tableKeys($table));
|
118 |
+
}
|
119 |
+
return $resp;
|
120 |
+
}
|
121 |
+
|
122 |
public function process($request) {
|
123 |
$db = $this->db;
|
124 |
$params = $request->params;
|
125 |
$stream_init_info = BVStream::startStream($this->account, $request);
|
126 |
|
|
|
|
|
127 |
if (array_key_exists('stream', $stream_init_info)) {
|
128 |
$this->stream = $stream_init_info['stream'];
|
129 |
switch ($request->method) {
|
154 |
$table = urldecode($params['table']);
|
155 |
$resp = array("create" => $db->showTableCreate($table));
|
156 |
break;
|
157 |
+
case "tblskys":
|
158 |
+
$tables = $params['tables'];
|
159 |
+
$resp = $this->getTablesKeys($tables);
|
160 |
+
break;
|
161 |
+
case "getmlticrt":
|
162 |
+
$tables = $params['tables'];
|
163 |
+
$resp = $this->getCreateTableQueries($tables);
|
164 |
+
break;
|
165 |
+
case "desctbls":
|
166 |
+
$tables = $params['tables'];
|
167 |
+
$resp = $this->describeTables($tables);
|
168 |
+
break;
|
169 |
+
case "mltirwscount":
|
170 |
+
$tables = $params['tables'];
|
171 |
+
$resp = $this->getTablesRowCount($tables);
|
172 |
+
break;
|
173 |
+
case "chktabls":
|
174 |
+
$tables = $params['tables'];
|
175 |
+
$type = urldecode($params['type']);
|
176 |
+
$resp = $this->checkTables($tables, $type);
|
177 |
+
break;
|
178 |
+
case "chktablsxist":
|
179 |
+
$tables = $params['tables'];
|
180 |
+
$resp = $this->checkTablesExist($tables);
|
181 |
+
break;
|
182 |
case "getrowscount":
|
183 |
$table = urldecode($params['table']);
|
184 |
$resp = array("count" => $db->rowsCount($table));
|
253 |
return $resp;
|
254 |
}
|
255 |
}
|
256 |
+
endif;
|
callback/wings/fs.php
CHANGED
@@ -26,7 +26,7 @@ class BVFSCallback extends BVCallbackBase {
|
|
26 |
if (is_link($absfile)) {
|
27 |
$fdata["link"] = @readlink($absfile);
|
28 |
}
|
29 |
-
if ($md5 === true) {
|
30 |
$fdata["md5"] = $this->calculateMd5($absfile, array(), 0, 0, 0);
|
31 |
}
|
32 |
} else {
|
@@ -168,7 +168,7 @@ class BVFSCallback extends BVCallbackBase {
|
|
168 |
if (is_dir($absfile) && !is_link($absfile)) {
|
169 |
$fdata['is_dir'] = true;
|
170 |
} else {
|
171 |
-
if (!is_readable($
|
172 |
$fdata['error'] = 'file not readable';
|
173 |
} else {
|
174 |
if ($withContent === true) {
|
@@ -196,7 +196,7 @@ class BVFSCallback extends BVCallbackBase {
|
|
196 |
$result["missingfiles"][] = $file;
|
197 |
continue;
|
198 |
}
|
199 |
-
if ($md5 === true) {
|
200 |
$fdata["md5"] = $this->calculateMd5($absfile, $fdata, $offset, $limit, $bsize);
|
201 |
}
|
202 |
$result["stats"][] = $fdata;
|
@@ -245,8 +245,6 @@ class BVFSCallback extends BVCallbackBase {
|
|
245 |
function process($request) {
|
246 |
$params = $request->params;
|
247 |
$stream_init_info = BVStream::startStream($this->account, $request);
|
248 |
-
|
249 |
-
|
250 |
|
251 |
if (array_key_exists('stream', $stream_init_info)) {
|
252 |
$this->stream = $stream_init_info['stream'];
|
26 |
if (is_link($absfile)) {
|
27 |
$fdata["link"] = @readlink($absfile);
|
28 |
}
|
29 |
+
if ($md5 === true && !is_dir($absfile)) {
|
30 |
$fdata["md5"] = $this->calculateMd5($absfile, array(), 0, 0, 0);
|
31 |
}
|
32 |
} else {
|
168 |
if (is_dir($absfile) && !is_link($absfile)) {
|
169 |
$fdata['is_dir'] = true;
|
170 |
} else {
|
171 |
+
if (!is_readable($absfile)) {
|
172 |
$fdata['error'] = 'file not readable';
|
173 |
} else {
|
174 |
if ($withContent === true) {
|
196 |
$result["missingfiles"][] = $file;
|
197 |
continue;
|
198 |
}
|
199 |
+
if ($md5 === true && !is_dir($absfile)) {
|
200 |
$fdata["md5"] = $this->calculateMd5($absfile, $fdata, $offset, $limit, $bsize);
|
201 |
}
|
202 |
$result["stats"][] = $fdata;
|
245 |
function process($request) {
|
246 |
$params = $request->params;
|
247 |
$stream_init_info = BVStream::startStream($this->account, $request);
|
|
|
|
|
248 |
|
249 |
if (array_key_exists('stream', $stream_init_info)) {
|
250 |
$this->stream = $stream_init_info['stream'];
|
callback/wings/info.php
CHANGED
@@ -129,6 +129,7 @@ class BVInfoCallback extends BVCallbackBase {
|
|
129 |
'dbprefix' => $db->dbprefix(),
|
130 |
'wpmu' => $siteinfo->isMultisite(),
|
131 |
'mainsite' => $siteinfo->isMainSite(),
|
|
|
132 |
'name' => get_bloginfo('name'),
|
133 |
'siteurl' => $siteinfo->siteurl(),
|
134 |
'homeurl' => $siteinfo->homeurl(),
|
@@ -210,6 +211,7 @@ class BVInfoCallback extends BVCallbackBase {
|
|
210 |
$data['protect'] = $settings->getOption('bvptconf');
|
211 |
$data['brand'] = $settings->getOption($this->bvinfo->brand_option);
|
212 |
$data['badgeinfo'] = $settings->getOption($this->bvinfo->badgeinfo);
|
|
|
213 |
}
|
214 |
|
215 |
public function dbconf(&$info) {
|
@@ -245,6 +247,11 @@ class BVInfoCallback extends BVCallbackBase {
|
|
245 |
if (array_key_exists('IS_PRESSABLE', get_defined_constants())) {
|
246 |
$host_info['IS_PRESSABLE'] = true;
|
247 |
}
|
|
|
|
|
|
|
|
|
|
|
248 |
return array('host_info' => $host_info);
|
249 |
}
|
250 |
|
129 |
'dbprefix' => $db->dbprefix(),
|
130 |
'wpmu' => $siteinfo->isMultisite(),
|
131 |
'mainsite' => $siteinfo->isMainSite(),
|
132 |
+
'main_site_id' => $siteinfo->getMainSiteId(),
|
133 |
'name' => get_bloginfo('name'),
|
134 |
'siteurl' => $siteinfo->siteurl(),
|
135 |
'homeurl' => $siteinfo->homeurl(),
|
211 |
$data['protect'] = $settings->getOption('bvptconf');
|
212 |
$data['brand'] = $settings->getOption($this->bvinfo->brand_option);
|
213 |
$data['badgeinfo'] = $settings->getOption($this->bvinfo->badgeinfo);
|
214 |
+
$data[$this->bvinfo->services_option_name] = $this->bvinfo->config;
|
215 |
}
|
216 |
|
217 |
public function dbconf(&$info) {
|
247 |
if (array_key_exists('IS_PRESSABLE', get_defined_constants())) {
|
248 |
$host_info['IS_PRESSABLE'] = true;
|
249 |
}
|
250 |
+
|
251 |
+
if (array_key_exists('GRIDPANE', get_defined_constants())) {
|
252 |
+
$host_info['IS_GRIDPANE'] = true;
|
253 |
+
}
|
254 |
+
|
255 |
return array('host_info' => $host_info);
|
256 |
}
|
257 |
|
callback/wings/misc.php
CHANGED
@@ -8,12 +8,14 @@ class BVMiscCallback extends BVCallbackBase {
|
|
8 |
public $bvinfo;
|
9 |
public $siteinfo;
|
10 |
public $account;
|
|
|
11 |
|
12 |
public function __construct($callback_handler) {
|
13 |
$this->settings = $callback_handler->settings;
|
14 |
$this->siteinfo = $callback_handler->siteinfo;
|
15 |
$this->account = $callback_handler->account;
|
16 |
$this->bvinfo = new MGInfo($callback_handler->settings);
|
|
|
17 |
}
|
18 |
|
19 |
public function refreshPluginUpdates() {
|
@@ -53,6 +55,12 @@ class BVMiscCallback extends BVCallbackBase {
|
|
53 |
$resp = array_merge($resp, $this->account->info());
|
54 |
$resp = array_merge($resp, $this->bvinfo->info());
|
55 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
case "enablebadge":
|
57 |
$option = $bvinfo->badgeinfo;
|
58 |
$badgeinfo = array();
|
@@ -94,8 +102,26 @@ class BVMiscCallback extends BVCallbackBase {
|
|
94 |
case "dlttrsnt":
|
95 |
$resp = array("dlttrsnt" => $settings->deleteTransient($params['key']));
|
96 |
break;
|
97 |
-
case "
|
98 |
-
$resp = array("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
break;
|
100 |
default:
|
101 |
$resp = false;
|
8 |
public $bvinfo;
|
9 |
public $siteinfo;
|
10 |
public $account;
|
11 |
+
public $bvapi;
|
12 |
|
13 |
public function __construct($callback_handler) {
|
14 |
$this->settings = $callback_handler->settings;
|
15 |
$this->siteinfo = $callback_handler->siteinfo;
|
16 |
$this->account = $callback_handler->account;
|
17 |
$this->bvinfo = new MGInfo($callback_handler->settings);
|
18 |
+
$this->bvapi = new MGWPAPI($callback_handler->settings);
|
19 |
}
|
20 |
|
21 |
public function refreshPluginUpdates() {
|
55 |
$resp = array_merge($resp, $this->account->info());
|
56 |
$resp = array_merge($resp, $this->bvinfo->info());
|
57 |
break;
|
58 |
+
case "pngbv":
|
59 |
+
$info = array();
|
60 |
+
$this->siteinfo->basic($info);
|
61 |
+
$this->bvapi->pingbv('/bvapi/pingbv', $info);
|
62 |
+
$resp = array("status" => true);
|
63 |
+
break;
|
64 |
case "enablebadge":
|
65 |
$option = $bvinfo->badgeinfo;
|
66 |
$badgeinfo = array();
|
102 |
case "dlttrsnt":
|
103 |
$resp = array("dlttrsnt" => $settings->deleteTransient($params['key']));
|
104 |
break;
|
105 |
+
case "setbvss":
|
106 |
+
$resp = array("status" => $settings->updateOption('bv_site_settings', $params['bv_site_settings']));
|
107 |
+
break;
|
108 |
+
case "stsrvcs":
|
109 |
+
$resp = array();
|
110 |
+
$deleted_configs = array();
|
111 |
+
$updated_configs = array();
|
112 |
+
if (array_key_exists("configs_to_delete", $params)) {
|
113 |
+
foreach($params["configs_to_delete"] as $config_name) {
|
114 |
+
$deleted_configs[$config_name] = $settings->deleteOption($config_name);
|
115 |
+
}
|
116 |
+
}
|
117 |
+
if (array_key_exists("configs_to_update", $params)) {
|
118 |
+
foreach($params["configs_to_update"] as $config_name => $config_value) {
|
119 |
+
$settings->updateOption($config_name, $config_value);
|
120 |
+
$updated_configs[$config_name] = $settings->getOption($config_name);
|
121 |
+
}
|
122 |
+
}
|
123 |
+
$resp["updated_configs"] = $updated_configs;
|
124 |
+
$resp["deleted_configs"] = $deleted_configs;
|
125 |
break;
|
126 |
default:
|
127 |
$resp = false;
|
info.php
CHANGED
@@ -4,26 +4,60 @@ if (!defined('ABSPATH')) exit;
|
|
4 |
if (!class_exists('MGInfo')) :
|
5 |
class MGInfo {
|
6 |
public $settings;
|
|
|
7 |
public $plugname = 'migrateguru';
|
8 |
public $brandname = 'Migrate Guru';
|
9 |
public $badgeinfo = 'bvmgbadge';
|
10 |
public $ip_header_option = 'bvmgipheader';
|
11 |
public $brand_option = 'bvmgbrand';
|
12 |
-
public $version = '4.
|
13 |
public $webpage = 'https://www.migrateguru.com';
|
14 |
public $appurl = 'https://mg.blogvault.net';
|
15 |
public $slug = 'migrate-guru/migrateguru.php';
|
16 |
public $plug_redirect = 'bvmgredirect';
|
17 |
public $logo = '../img/migrateguru.png';
|
18 |
public $brand_icon = '/img/icon.png';
|
|
|
|
|
|
|
19 |
|
20 |
public function __construct($settings) {
|
21 |
$this->settings = $settings;
|
|
|
22 |
}
|
23 |
|
24 |
-
public function
|
25 |
-
$
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
}
|
28 |
|
29 |
public function getBrandInfo() {
|
@@ -70,8 +104,7 @@ if (!class_exists('MGInfo')) :
|
|
70 |
}
|
71 |
|
72 |
public function isProtectModuleEnabled() {
|
73 |
-
return
|
74 |
-
$this->isActivePlugin();
|
75 |
}
|
76 |
|
77 |
public function isDynSyncModuleEnabled() {
|
@@ -79,6 +112,14 @@ if (!class_exists('MGInfo')) :
|
|
79 |
$this->isActivePlugin();
|
80 |
}
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
public function isActivateRedirectSet() {
|
83 |
return ($this->settings->getOption($this->plug_redirect) === 'yes') ? true : false;
|
84 |
}
|
4 |
if (!class_exists('MGInfo')) :
|
5 |
class MGInfo {
|
6 |
public $settings;
|
7 |
+
public $config;
|
8 |
public $plugname = 'migrateguru';
|
9 |
public $brandname = 'Migrate Guru';
|
10 |
public $badgeinfo = 'bvmgbadge';
|
11 |
public $ip_header_option = 'bvmgipheader';
|
12 |
public $brand_option = 'bvmgbrand';
|
13 |
+
public $version = '4.58';
|
14 |
public $webpage = 'https://www.migrateguru.com';
|
15 |
public $appurl = 'https://mg.blogvault.net';
|
16 |
public $slug = 'migrate-guru/migrateguru.php';
|
17 |
public $plug_redirect = 'bvmgredirect';
|
18 |
public $logo = '../img/migrateguru.png';
|
19 |
public $brand_icon = '/img/icon.png';
|
20 |
+
public $services_option_name = 'BVSERVICESOPTIONNAME';
|
21 |
+
|
22 |
+
const DB_VERSION = '2';
|
23 |
|
24 |
public function __construct($settings) {
|
25 |
$this->settings = $settings;
|
26 |
+
$this->config = $this->settings->getOption($this->services_option_name);
|
27 |
}
|
28 |
|
29 |
+
public function getCurrentDBVersion() {
|
30 |
+
$bvconfig = $this->config;
|
31 |
+
if ($bvconfig && array_key_exists('db_version', $bvconfig)) {
|
32 |
+
return $bvconfig['db_version'];
|
33 |
+
}
|
34 |
+
return false;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function hasValidDBVersion() {
|
38 |
+
return MGInfo::DB_VERSION === $this->getCurrentDBVersion();
|
39 |
+
}
|
40 |
+
|
41 |
+
public static function getRequestID() {
|
42 |
+
if (!defined("BV_REQUEST_ID")) {
|
43 |
+
define("BV_REQUEST_ID", uniqid(mt_rand()));
|
44 |
+
}
|
45 |
+
return BV_REQUEST_ID;
|
46 |
+
}
|
47 |
+
|
48 |
+
public function canSetCWBranding() {
|
49 |
+
if (MGWPSiteInfo::isCWServer()) {
|
50 |
+
|
51 |
+
$bot_protect_accounts = MGAccount::accountsByType($this->settings, 'botprotect');
|
52 |
+
if (sizeof($bot_protect_accounts) >= 1)
|
53 |
+
return true;
|
54 |
+
|
55 |
+
$bot_protect_accounts = MGAccount::accountsByPattern($this->settings, 'email', '/@cw_user\.com$/');
|
56 |
+
if (sizeof($bot_protect_accounts) >= 1)
|
57 |
+
return true;
|
58 |
+
}
|
59 |
+
|
60 |
+
return false;
|
61 |
}
|
62 |
|
63 |
public function getBrandInfo() {
|
104 |
}
|
105 |
|
106 |
public function isProtectModuleEnabled() {
|
107 |
+
return $this->isServiceActive("protect");
|
|
|
108 |
}
|
109 |
|
110 |
public function isDynSyncModuleEnabled() {
|
112 |
$this->isActivePlugin();
|
113 |
}
|
114 |
|
115 |
+
public function isServiceActive($service) {
|
116 |
+
$bvconfig = $this->config;
|
117 |
+
if ($bvconfig && array_key_exists('services', $bvconfig)) {
|
118 |
+
return in_array($service, $bvconfig['services']) && $this->isActivePlugin();
|
119 |
+
}
|
120 |
+
return false;
|
121 |
+
}
|
122 |
+
|
123 |
public function isActivateRedirectSet() {
|
124 |
return ($this->settings->getOption($this->plug_redirect) === 'yes') ? true : false;
|
125 |
}
|
migrateguru.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://www.migrateguru.com
|
|
5 |
Description: Migrating your site(s) to any WordPress Hosting platform has never been so easy.
|
6 |
Author: Migrate Guru
|
7 |
Author URI: http://www.migrateguru.com
|
8 |
-
Version: 4.
|
9 |
Network: True
|
10 |
*/
|
11 |
|
@@ -52,6 +52,7 @@ register_activation_hook(__FILE__, array($wp_action, 'activate'));
|
|
52 |
register_deactivation_hook(__FILE__, array($wp_action, 'deactivate'));
|
53 |
|
54 |
add_action('wp_footer', array($wp_action, 'footerHandler'), 100);
|
|
|
55 |
|
56 |
##WPCLIMODULE##
|
57 |
if (is_admin()) {
|
@@ -69,6 +70,7 @@ if (is_admin()) {
|
|
69 |
add_action('admin_head', array($wpadmin, 'removeAdminNotices'), 3);
|
70 |
##ACTIVATEWARNING##
|
71 |
add_action('admin_enqueue_scripts', array($wpadmin, 'mgsecAdminMenu'));
|
|
|
72 |
}
|
73 |
|
74 |
|
@@ -129,6 +131,10 @@ if ((array_key_exists('bvplugname', $_REQUEST)) && ($_REQUEST['bvplugname'] == "
|
|
129 |
$response->terminate($resp);
|
130 |
}
|
131 |
} else {
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
|
|
134 |
}
|
5 |
Description: Migrating your site(s) to any WordPress Hosting platform has never been so easy.
|
6 |
Author: Migrate Guru
|
7 |
Author URI: http://www.migrateguru.com
|
8 |
+
Version: 4.58
|
9 |
Network: True
|
10 |
*/
|
11 |
|
52 |
register_deactivation_hook(__FILE__, array($wp_action, 'deactivate'));
|
53 |
|
54 |
add_action('wp_footer', array($wp_action, 'footerHandler'), 100);
|
55 |
+
add_action('clear_bv_services_config', array($wp_action, 'clear_bv_services_config'));
|
56 |
|
57 |
##WPCLIMODULE##
|
58 |
if (is_admin()) {
|
70 |
add_action('admin_head', array($wpadmin, 'removeAdminNotices'), 3);
|
71 |
##ACTIVATEWARNING##
|
72 |
add_action('admin_enqueue_scripts', array($wpadmin, 'mgsecAdminMenu'));
|
73 |
+
##REMOVEDEACTIVATIONLINK##
|
74 |
}
|
75 |
|
76 |
|
131 |
$response->terminate($resp);
|
132 |
}
|
133 |
} else {
|
134 |
+
if ($bvinfo->hasValidDBVersion()) {
|
135 |
+
##PROTECTMODULE##
|
136 |
+
##DYNSYNCMODULE##
|
137 |
+
##ACTLOGMODULE##
|
138 |
+
}
|
139 |
+
##WPAUTOUPDATEBLOCKMODULE##
|
140 |
}
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Donate link: https://www.migrateguru.com/
|
|
6 |
Requires at least: 4.0
|
7 |
Tested up to: 5.7
|
8 |
Requires PHP: 5.4.0
|
9 |
-
Stable tag: 4.
|
10 |
License: GPLv2 or later
|
11 |
License URI: [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)
|
12 |
|
@@ -132,6 +132,10 @@ Yes, we do. You can access it here: https://migrateguru.freshdesk.com/support/ho
|
|
132 |
6. Click ‘Migrate’.
|
133 |
|
134 |
== Changelog =
|
|
|
|
|
|
|
|
|
135 |
= 4.35 =
|
136 |
* scanlist and filelist functions improved
|
137 |
|
6 |
Requires at least: 4.0
|
7 |
Tested up to: 5.7
|
8 |
Requires PHP: 5.4.0
|
9 |
+
Stable tag: 4.58
|
10 |
License: GPLv2 or later
|
11 |
License URI: [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)
|
12 |
|
132 |
6. Click ‘Migrate’.
|
133 |
|
134 |
== Changelog =
|
135 |
+
= 4.58 =
|
136 |
+
* Better Handling of error message from Server on signup
|
137 |
+
* Added Support for Multi Table Callbacks
|
138 |
+
|
139 |
= 4.35 =
|
140 |
* scanlist and filelist functions improved
|
141 |
|
wp_actions.php
CHANGED
@@ -38,7 +38,12 @@ if (!class_exists('MGWPAction')) :
|
|
38 |
public static function uninstall() {
|
39 |
##CLEARPTCONFIG##
|
40 |
##CLEARIPSTORE##
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
|
44 |
public function footerHandler() {
|
38 |
public static function uninstall() {
|
39 |
##CLEARPTCONFIG##
|
40 |
##CLEARIPSTORE##
|
41 |
+
##CLEARDYNSYNCCONFIG##
|
42 |
+
do_action('clear_bv_services_config');
|
43 |
+
}
|
44 |
+
|
45 |
+
public function clear_bv_services_config() {
|
46 |
+
$this->settings->deleteOption($this->bvinfo->services_option_name);
|
47 |
}
|
48 |
|
49 |
public function footerHandler() {
|
wp_admin.php
CHANGED
@@ -109,7 +109,7 @@ class MGWPAdmin {
|
|
109 |
echo '<div style="padding-bottom:0.5px; color:red;"><p>Incorrect Email.</p></div>';
|
110 |
}
|
111 |
else if (($error == "custom") && isset($_REQUEST['bvnonce']) && wp_verify_nonce($_REQUEST['bvnonce'], "bvnonce")) {
|
112 |
-
echo '<div style="padding-bottom:0.5px;color: red;"><p>'.base64_decode($_REQUEST['message']).'</p></div>';
|
113 |
}
|
114 |
}
|
115 |
|
109 |
echo '<div style="padding-bottom:0.5px; color:red;"><p>Incorrect Email.</p></div>';
|
110 |
}
|
111 |
else if (($error == "custom") && isset($_REQUEST['bvnonce']) && wp_verify_nonce($_REQUEST['bvnonce'], "bvnonce")) {
|
112 |
+
echo '<div style="padding-bottom:0.5px;color: red;"><p>'.esc_html(base64_decode($_REQUEST['message'])).'</p></div>';
|
113 |
}
|
114 |
}
|
115 |
|
wp_site_info.php
CHANGED
@@ -39,6 +39,12 @@ class MGWPSiteInfo {
|
|
39 |
return is_main_site();
|
40 |
}
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
public function info() {
|
43 |
$info = array();
|
44 |
$this->basic($info);
|
39 |
return is_main_site();
|
40 |
}
|
41 |
|
42 |
+
public function getMainSiteId() {
|
43 |
+
if (!function_exists('get_main_site_id'))
|
44 |
+
return 0;
|
45 |
+
return get_main_site_id();
|
46 |
+
}
|
47 |
+
|
48 |
public function info() {
|
49 |
$info = array();
|
50 |
$this->basic($info);
|