WP Engine Automated Migration - Version 4.78

Version Description

Download this release

Release Info

Developer ritesh.soni36
Plugin Icon 128x128 WP Engine Automated Migration
Version 4.78
Comparing to
See all releases

Code changes from version 4.68 to 4.78

account.php CHANGED
@@ -191,7 +191,6 @@ if (!class_exists('WPEAccount')) :
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)) {
@@ -202,7 +201,14 @@ if (!class_exists('WPEAccount')) :
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'];
191
 
192
  public function updateInfo($info) {
193
  $accounts = self::allAccounts($this->settings);
 
194
  $account_type = $info["account_type"];
195
  $pubkey = $info['pubkey'];
196
  if (!array_key_exists($pubkey, $accounts)) {
201
  }
202
  $accounts[$pubkey]['account_gid'] = $info['account_gid'];
203
  $accounts[$pubkey]['lastbackuptime'] = time();
204
+ if (isset($info["speed_plugname"])) {
205
+ $speed_plugname = $info["speed_plugname"];
206
+ $accounts[$pubkey][$speed_plugname] = true;
207
+ }
208
+ if (isset($info["plugname"])) {
209
+ $plugname = $info["plugname"];
210
+ $accounts[$pubkey][$plugname] = true;
211
+ }
212
  $accounts[$pubkey]['account_type'] = $account_type;
213
  $accounts[$pubkey]['url'] = $info['url'];
214
  $accounts[$pubkey]['email'] = $info['email'];
callback/base.php CHANGED
@@ -6,11 +6,11 @@ if (!class_exists('BVCallbackBase')) :
6
  class BVCallbackBase {
7
 
8
  public static $wing_infos = array("BRAND_WING_VERSION" => '1.0',
9
- "DB_WING_VERSION" => '1.0',
10
- "ACCOUNT_WING_VERSION" => '1.0',
11
- "MISC_WING_VERSION" => '1.1',
12
- "FS_WING_VERSION" => '1.0',
13
- "INFO_WING_VERSION" => '1.0',
14
  );
15
 
16
  public function objectToArray($obj) {
6
  class BVCallbackBase {
7
 
8
  public static $wing_infos = array("BRAND_WING_VERSION" => '1.0',
9
+ "DB_WING_VERSION" => '1.1',
10
+ "ACCOUNT_WING_VERSION" => '1.1',
11
+ "MISC_WING_VERSION" => '1.2',
12
+ "FS_WING_VERSION" => '1.2',
13
+ "INFO_WING_VERSION" => '1.5',
14
  );
15
 
16
  public function objectToArray($obj) {
callback/wings/account.php CHANGED
@@ -6,13 +6,41 @@ class BVAccountCallback extends BVCallbackBase {
6
  public $account;
7
  public $settings;
8
 
9
- const ACCOUNT_WING_VERSION = 1.0;
10
 
11
  public function __construct($callback_handler) {
12
  $this->account = $callback_handler->account;
13
  $this->settings = $callback_handler->settings;
14
  }
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  function process($request) {
17
  $params = $request->params;
18
  $account = $this->account;
@@ -48,6 +76,9 @@ class BVAccountCallback extends BVCallbackBase {
48
  case "fetch":
49
  $resp = array("status" => WPEAccount::allAccounts($this->settings));
50
  break;
 
 
 
51
  default:
52
  $resp = false;
53
  }
6
  public $account;
7
  public $settings;
8
 
9
+ const ACCOUNT_WING_VERSION = 1.1;
10
 
11
  public function __construct($callback_handler) {
12
  $this->account = $callback_handler->account;
13
  $this->settings = $callback_handler->settings;
14
  }
15
 
16
+ function updateInfo($args) {
17
+ $result = array();
18
+
19
+ if (array_key_exists('update_info', $args)) {
20
+ $this->account->updateInfo($args['update_info']);
21
+ $result['update_info'] = array(
22
+ "status" => WPEAccount::exists($this->settings, $args['update_info']['pubkey'])
23
+ );
24
+ }
25
+
26
+ if (array_key_exists('update_api_key', $args)) {
27
+ WPEAccount::updateApiPublicKey($this->settings, $args['update_api_key']['pubkey']);
28
+ $result['update_api_key'] = array(
29
+ "status" => $this->settings->getOption(WPEAccount::$api_public_key)
30
+ );
31
+ }
32
+
33
+ if (array_key_exists('update_options', $args))
34
+ $result['update_options'] = $this->settings->updateOptions($args['update_options']);
35
+
36
+ if (array_key_exists('delete_options', $args))
37
+ $result['delete_options'] = $this->settings->deleteOptions($args['delete_options']);
38
+
39
+ $result['status'] = true;
40
+
41
+ return $result;
42
+ }
43
+
44
  function process($request) {
45
  $params = $request->params;
46
  $account = $this->account;
76
  case "fetch":
77
  $resp = array("status" => WPEAccount::allAccounts($this->settings));
78
  break;
79
+ case "updtinfo":
80
+ $resp = $this->updateInfo($params);
81
+ break;
82
  default:
83
  $resp = false;
84
  }
callback/wings/db.php CHANGED
@@ -11,7 +11,7 @@ class BVDBCallback extends BVCallbackBase {
11
 
12
  public static $bvTables = array("fw_requests", "lp_requests", "ip_store");
13
 
14
- const DB_WING_VERSION = 1.0;
15
 
16
  public function __construct($callback_handler) {
17
  $this->db = $callback_handler->db;
@@ -284,6 +284,22 @@ class BVDBCallback extends BVCallbackBase {
284
  break;
285
  case "altrtbl":
286
  $resp = array("altrtbl" => $db->alterBVTable($params['query'], $params['query']));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  break;
288
  default:
289
  $resp = false;
11
 
12
  public static $bvTables = array("fw_requests", "lp_requests", "ip_store");
13
 
14
+ const DB_WING_VERSION = 1.1;
15
 
16
  public function __construct($callback_handler) {
17
  $this->db = $callback_handler->db;
284
  break;
285
  case "altrtbl":
286
  $resp = array("altrtbl" => $db->alterBVTable($params['query'], $params['query']));
287
+ break;
288
+ case "tbls":
289
+ $resp = array();
290
+
291
+ if (array_key_exists('truncate', $params))
292
+ $resp['truncate'] = $db->truncateTables($params['truncate']);
293
+
294
+ if (array_key_exists('drop', $params))
295
+ $resp['drop'] = $db->dropTables($params['drop']);
296
+
297
+ if (array_key_exists('create', $params))
298
+ $resp['create'] = $db->createTables($params['create']);
299
+
300
+ if (array_key_exists('alter', $params))
301
+ $resp['alter'] = $db->alterTables($params['alter']);
302
+
303
  break;
304
  default:
305
  $resp = false;
callback/wings/fs.php CHANGED
@@ -9,7 +9,7 @@ class BVFSCallback extends BVCallbackBase {
9
  public $account;
10
 
11
  public static $cwAllowedFiles = array(".htaccess", ".user.ini", "malcare-waf.php");
12
- const FS_WING_VERSION = 1.0;
13
 
14
  public function __construct($callback_handler) {
15
  $this->account = $callback_handler->account;
@@ -357,6 +357,39 @@ class BVFSCallback extends BVCallbackBase {
357
  $files = $params['files'];
358
  $withContent = array_key_exists('withcontent', $params) ? $params['withcontent'] : true;
359
  $resp = array("files_content" => $this->getFilesContent($files, $withContent));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  break;
361
  default:
362
  $resp = false;
9
  public $account;
10
 
11
  public static $cwAllowedFiles = array(".htaccess", ".user.ini", "malcare-waf.php");
12
+ const FS_WING_VERSION = 1.2;
13
 
14
  public function __construct($callback_handler) {
15
  $this->account = $callback_handler->account;
357
  $files = $params['files'];
358
  $withContent = array_key_exists('withcontent', $params) ? $params['withcontent'] : true;
359
  $resp = array("files_content" => $this->getFilesContent($files, $withContent));
360
+ break;
361
+ case "gtfls":
362
+ $resp = array();
363
+
364
+ if (array_key_exists('get_files_content', $params)) {
365
+ $args = $params['get_files_content'];
366
+ $with_content = array_key_exists('withcontent', $args) ? $args['withcontent'] : true;
367
+ $resp['get_files_content'] = $this->getFilesContent($args['files'], $with_content);
368
+ }
369
+
370
+ if (array_key_exists('get_files_stats', $params)) {
371
+ $args = $params['get_files_stats'];
372
+ $md5 = array_key_exists('md5', $args) ? $args['md5'] : false;
373
+ $stats = $this->getFilesStats(
374
+ $args['files'], $args['offset'], $args['limit'], $args['bsize'], $md5
375
+ );
376
+
377
+ $result = array();
378
+
379
+ if (array_key_exists('stats', $stats)) {
380
+ $result['stats'] = array();
381
+ foreach ($stats['stats'] as $stat) {
382
+ $result['stats'][$stat['filename']] = $stat;
383
+ }
384
+ }
385
+
386
+ if (array_key_exists('missingfiles', $stats)) {
387
+ $result['missingfiles'] = $stats['missingfiles'];
388
+ }
389
+
390
+ $resp['get_files_stats'] = $result;
391
+ }
392
+
393
  break;
394
  default:
395
  $resp = false;
callback/wings/info.php CHANGED
@@ -8,14 +8,16 @@ class BVInfoCallback extends BVCallbackBase {
8
  public $settings;
9
  public $siteinfo;
10
  public $bvinfo;
 
11
 
12
- const INFO_WING_VERSION = 1.0;
13
 
14
  public function __construct($callback_handler) {
15
  $this->db = $callback_handler->db;
16
  $this->siteinfo = $callback_handler->siteinfo;
17
  $this->settings = $callback_handler->settings;
18
  $this->bvinfo = new WPEInfo($this->settings);
 
19
  }
20
 
21
  public function getPosts($post_type, $count = 5) {
@@ -118,7 +120,7 @@ class BVInfoCallback extends BVCallbackBase {
118
  $sys_info['webuid'] = posix_getuid();
119
  $sys_info['webgid'] = posix_getgid();
120
  }
121
- return array("sys" => $sys_info);
122
  }
123
 
124
  public function getWpInfo() {
@@ -155,7 +157,7 @@ class BVInfoCallback extends BVCallbackBase {
155
  'wp_local_string' => $wp_local_package,
156
  'charset_collate' => $db->getCharsetCollate()
157
  );
158
- return array("wp" => $wp_info);
159
  }
160
 
161
  public function getUsers($full, $args = array()) {
@@ -178,7 +180,7 @@ class BVInfoCallback extends BVCallbackBase {
178
  $results[] = $result;
179
  }
180
  }
181
- return array("users" => $results);
182
  }
183
 
184
  public function availableFunctions(&$info) {
@@ -223,21 +225,21 @@ class BVInfoCallback extends BVCallbackBase {
223
  }
224
 
225
  public function cookieInfo() {
226
- $resp = array();
227
  if (defined('COOKIEPATH'))
228
- $resp['cookiepath'] = COOKIEPATH;
229
  if (defined('COOKIE_DOMAIN'))
230
- $resp['cookiedomain'] = COOKIE_DOMAIN;
231
- return array('cookieinfo' => $resp);
232
  }
233
 
234
  public function activate() {
235
- $resp = array();
236
- $this->siteinfo->basic($resp);
237
- $this->servicesInfo($resp);
238
- $this->dbconf($resp);
239
- $this->availableFunctions($resp);
240
- return array('actinfo' => $resp);
241
  }
242
 
243
  public function getHostInfo() {
@@ -255,7 +257,193 @@ class BVInfoCallback extends BVCallbackBase {
255
  $host_info['WPE_APIKEY'] = WPE_APIKEY;
256
  }
257
 
258
- return array('host_info' => $host_info);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  }
260
 
261
  public function process($request) {
@@ -263,10 +451,10 @@ class BVInfoCallback extends BVCallbackBase {
263
  $params = $request->params;
264
  switch ($request->method) {
265
  case "activateinfo":
266
- $resp = $this->activate();
267
  break;
268
  case "ckeyinfo":
269
- $resp = $this->cookieInfo();
270
  break;
271
  case "gtpsts":
272
  $count = 5;
@@ -284,10 +472,10 @@ class BVInfoCallback extends BVCallbackBase {
284
  $resp = $this->getThemes();
285
  break;
286
  case "gtsym":
287
- $resp = $this->getSystemInfo();
288
  break;
289
  case "gtwp":
290
- $resp = $this->getWpInfo();
291
  break;
292
  case "gtallhdrs":
293
  $data = (function_exists('getallheaders')) ? getallheaders() : false;
@@ -303,17 +491,14 @@ class BVInfoCallback extends BVCallbackBase {
303
  $full = false;
304
  if (array_key_exists('full', $params))
305
  $full = true;
306
- $resp = $this->getUsers($full, $params['args']);
307
  break;
308
  case "gttrnsnt":
309
- $transient = $this->settings->getTransient($params['name']);
310
- if ($transient && array_key_exists('asarray', $params))
311
- $transient = $this->objectToArray($transient);
312
- $resp = array("transient" => $transient);
313
  break;
314
  case "gthost":
315
- $resp = $this->getHostInfo();
316
- break;
317
  case "gtplinfo":
318
  $args = array(
319
  'slug' => wp_unslash($params['slug'])
@@ -324,6 +509,15 @@ class BVInfoCallback extends BVCallbackBase {
324
  $data = apply_filters('plugins_api', false, $action, $args);
325
  $resp = array("plugins_info" => $data);
326
  break;
 
 
 
 
 
 
 
 
 
327
  default:
328
  $resp = false;
329
  }
8
  public $settings;
9
  public $siteinfo;
10
  public $bvinfo;
11
+ public $bvapi;
12
 
13
+ const INFO_WING_VERSION = 1.5;
14
 
15
  public function __construct($callback_handler) {
16
  $this->db = $callback_handler->db;
17
  $this->siteinfo = $callback_handler->siteinfo;
18
  $this->settings = $callback_handler->settings;
19
  $this->bvinfo = new WPEInfo($this->settings);
20
+ $this->bvapi = new WPEWPAPI($this->settings);
21
  }
22
 
23
  public function getPosts($post_type, $count = 5) {
120
  $sys_info['webuid'] = posix_getuid();
121
  $sys_info['webgid'] = posix_getgid();
122
  }
123
+ return $sys_info;
124
  }
125
 
126
  public function getWpInfo() {
157
  'wp_local_string' => $wp_local_package,
158
  'charset_collate' => $db->getCharsetCollate()
159
  );
160
+ return $wp_info;
161
  }
162
 
163
  public function getUsers($full, $args = array()) {
180
  $results[] = $result;
181
  }
182
  }
183
+ return $results;
184
  }
185
 
186
  public function availableFunctions(&$info) {
225
  }
226
 
227
  public function cookieInfo() {
228
+ $info = array();
229
  if (defined('COOKIEPATH'))
230
+ $info['cookiepath'] = COOKIEPATH;
231
  if (defined('COOKIE_DOMAIN'))
232
+ $info['cookiedomain'] = COOKIE_DOMAIN;
233
+ return $info;
234
  }
235
 
236
  public function activate() {
237
+ $info = array();
238
+ $this->siteinfo->basic($info);
239
+ $this->servicesInfo($info);
240
+ $this->dbconf($info);
241
+ $this->availableFunctions($info);
242
+ return $info;
243
  }
244
 
245
  public function getHostInfo() {
257
  $host_info['WPE_APIKEY'] = WPE_APIKEY;
258
  }
259
 
260
+ return $host_info;
261
+ }
262
+
263
+ public function serverConfig() {
264
+ return array(
265
+ 'software' => $_SERVER['SERVER_SOFTWARE'],
266
+ 'sapi' => (function_exists('php_sapi_name')) ? php_sapi_name() : false,
267
+ 'has_apache_get_modules' => function_exists('apache_get_modules'),
268
+ 'posix_getuid' => (function_exists('posix_getuid')) ? posix_getuid() : null,
269
+ 'uid' => (function_exists('getmyuid')) ? getmyuid() : null,
270
+ 'user_ini' => ini_get('user_ini.filename'),
271
+ 'php_major_version' => PHP_MAJOR_VERSION
272
+ );
273
+ }
274
+
275
+ function refreshUpdatesInfo() {
276
+ global $wp_current_filter;
277
+ $wp_current_filter[] = 'load-update-core.php';
278
+
279
+ if (function_exists('wp_clean_update_cache')) {
280
+ wp_clean_update_cache();
281
+ } else {
282
+ $this->settings->deleteTransient('update_plugins');
283
+ $this->settings->deleteTransient('update_themes');
284
+ $this->settings->deleteTransient('update_core');
285
+ }
286
+
287
+ wp_update_plugins();
288
+ wp_update_themes();
289
+
290
+ array_pop($wp_current_filter);
291
+
292
+ wp_update_plugins();
293
+ wp_update_themes();
294
+
295
+ wp_version_check();
296
+ wp_version_check(array(), true);
297
+
298
+ return true;
299
+ }
300
+
301
+ function getUsersHandler($args = array()) {
302
+ $db = $this->db;
303
+ $table = "{$db->dbprefix()}users";
304
+ $count = $db->rowsCount($table);
305
+ $result = array("count" => $count);
306
+
307
+ $max_users = array_key_exists('max_users', $args) ? $args['max_users'] : 500;
308
+ $roles = array_key_exists('roles', $args) ? $args['roles'] : array();
309
+
310
+ $users = array();
311
+ if (($count > $max_users) && !empty($roles)) {
312
+ foreach ($roles as $role) {
313
+ if ($max_users <= 0)
314
+ break;
315
+ $args['number'] = $max_users;
316
+ $args['role'] = $role;
317
+ $fetched = $this->getUsers($args['full'], $args);
318
+ $max_users -= sizeof($fetched);
319
+ $users = array_merge($users, $fetched);
320
+ }
321
+ } else {
322
+ $args['number'] = $max_users;
323
+ $users = $this->getUsers($args['full'], $args);
324
+ }
325
+ $result['users_info'] = $users;
326
+
327
+ return $result;
328
+ }
329
+
330
+ function getTransient($name, $asarray = true) {
331
+ $transient = $this->settings->getTransient($name);
332
+ if ($transient && $asarray)
333
+ $transient = $this->objectToArray($transient);
334
+ return array("transient" => $transient);
335
+ }
336
+
337
+ function getPluginsHandler($args = array()) {
338
+ $result = array_merge($this->getPlugins(), $this->getTransient('update_plugins'));
339
+
340
+ if (array_key_exists('clear_filters', $args)) {
341
+ $filters = $args['clear_filters'];
342
+ foreach ($filters as $filter)
343
+ remove_all_filters($filter);
344
+ $transient_without_filters = $this->getTransient('update_plugins');
345
+ $result['transient_without_filters'] = $transient_without_filters['transient'];
346
+ }
347
+
348
+ return $result;
349
+ }
350
+
351
+ function getThemesHandler($args = array()) {
352
+ $result = array_merge($this->getThemes(), $this->getTransient('update_themes'));
353
+
354
+ if (array_key_exists('clear_filters', $args)) {
355
+ $filters = $args['clear_filters'];
356
+ foreach ($filters as $filter)
357
+ remove_all_filters($filter);
358
+ $transient_without_filters = $this->getTransient('update_themes');
359
+ $result['transient_without_filters'] = $transient_without_filters['transient'];
360
+ }
361
+
362
+ return $result;
363
+ }
364
+
365
+ function getSiteInfo($args) {
366
+ $result = array();
367
+
368
+ if (array_key_exists('pre_refresh_get_options', $args)) {
369
+ $result['pre_refresh_get_options'] = $this->settings->getOptions(
370
+ $args['pre_refresh_get_options']
371
+ );
372
+ }
373
+
374
+ if (array_key_exists('refresh', $args))
375
+ $result['refreshed'] = $this->refreshUpdatesInfo();
376
+
377
+ if (array_key_exists('users', $args))
378
+ $result['users'] = $this->getUsersHandler($args['users']);
379
+
380
+ if (array_key_exists('plugins', $args))
381
+ $result['plugins'] = $this->getPluginsHandler($args['plugins']);
382
+
383
+ if (array_key_exists('themes', $args))
384
+ $result['themes'] = $this->getThemesHandler($args['themes']);
385
+
386
+ if (array_key_exists('core', $args))
387
+ $result['core'] = $this->getTransient('update_core');
388
+
389
+ if (array_key_exists('sys', $args))
390
+ $result['sys'] = $this->getSystemInfo();
391
+
392
+ if (array_key_exists('get_options', $args))
393
+ $result['get_options'] = $this->settings->getOptions($args['get_options']);
394
+
395
+ return $result;
396
+ }
397
+
398
+ function pingBV() {
399
+ $info = array();
400
+ $this->siteinfo->basic($info);
401
+ $this->bvapi->pingbv('/bvapi/pingbv', $info);
402
+ return true;
403
+ }
404
+
405
+ function getPostActivateInfo($args) {
406
+ $result = array();
407
+
408
+ if (array_key_exists('pingbv', $args))
409
+ $result['pingbv'] = array('status' => $this->pingBV());
410
+
411
+ if (array_key_exists('activate_info', $args))
412
+ $result['activate_info'] = $this->activate();
413
+
414
+ if (array_key_exists('cookie_info', $args))
415
+ $result['cookie_info'] = $this->cookieInfo();
416
+
417
+ if (array_key_exists('get_host', $args))
418
+ $result['get_host'] = $this->getHostInfo();
419
+
420
+ if (array_key_exists('get_wp', $args))
421
+ $result['get_wp'] = $this->getWpInfo();
422
+
423
+ if (array_key_exists('get_options', $args))
424
+ $result['get_options'] = $this->settings->getOptions($args['get_options']);
425
+
426
+ if (array_key_exists('get_tables', $args))
427
+ $result['get_tables'] = $this->db->showTables();
428
+
429
+ $result['status'] = true;
430
+
431
+ return $result;
432
+ }
433
+
434
+ function getPluginServicesInfo($args) {
435
+ $result = array();
436
+
437
+ if (array_key_exists('get_options', $args))
438
+ $result['get_options'] = $this->settings->getOptions($args['get_options']);
439
+
440
+ if (array_key_exists('pingbv', $args))
441
+ $result['pingbv'] = array('status' => $this->pingBV());
442
+
443
+ if (array_key_exists('server_config', $args))
444
+ $result['server_config'] = $this->serverConfig();
445
+
446
+ return $result;
447
  }
448
 
449
  public function process($request) {
451
  $params = $request->params;
452
  switch ($request->method) {
453
  case "activateinfo":
454
+ $resp = array('actinfo' => $this->activate());
455
  break;
456
  case "ckeyinfo":
457
+ $resp = array('cookieinfo' => $this->cookieInfo());
458
  break;
459
  case "gtpsts":
460
  $count = 5;
472
  $resp = $this->getThemes();
473
  break;
474
  case "gtsym":
475
+ $resp = array('sys' => $this->getSystemInfo());
476
  break;
477
  case "gtwp":
478
+ $resp = array('wp' => $this->getWpInfo());
479
  break;
480
  case "gtallhdrs":
481
  $data = (function_exists('getallheaders')) ? getallheaders() : false;
491
  $full = false;
492
  if (array_key_exists('full', $params))
493
  $full = true;
494
+ $resp = array('users' => $this->getUsers($full, $params['args']));
495
  break;
496
  case "gttrnsnt":
497
+ $resp = $this->getTransient($params['name'], array_key_exists('asarray', $params));
 
 
 
498
  break;
499
  case "gthost":
500
+ $resp = array('host_info' => $this->getHostInfo());
501
+ break;
502
  case "gtplinfo":
503
  $args = array(
504
  'slug' => wp_unslash($params['slug'])
509
  $data = apply_filters('plugins_api', false, $action, $args);
510
  $resp = array("plugins_info" => $data);
511
  break;
512
+ case "gtpostactinfo":
513
+ $resp = $this->getPostActivateInfo($params);
514
+ break;
515
+ case "gtsteinfo":
516
+ $resp = $this->getSiteInfo($params);
517
+ break;
518
+ case "psinfo":
519
+ $resp = $this->getPluginServicesInfo($params);
520
+ break;
521
  default:
522
  $resp = false;
523
  }
callback/wings/misc.php CHANGED
@@ -11,7 +11,7 @@ class BVMiscCallback extends BVCallbackBase {
11
  public $bvapi;
12
  public $db;
13
 
14
- const MISC_WING_VERSION = 1.1;
15
 
16
  public function __construct($callback_handler) {
17
  $this->settings = $callback_handler->settings;
@@ -154,6 +154,19 @@ class BVMiscCallback extends BVCallbackBase {
154
  break;
155
  case "dlttrsnt":
156
  $resp = array("dlttrsnt" => $settings->deleteTransient($params['key']));
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  break;
158
  case "setbvss":
159
  $resp = array("status" => $settings->updateOption('bv_site_settings', $params['bv_site_settings']));
11
  public $bvapi;
12
  public $db;
13
 
14
+ const MISC_WING_VERSION = 1.2;
15
 
16
  public function __construct($callback_handler) {
17
  $this->settings = $callback_handler->settings;
154
  break;
155
  case "dlttrsnt":
156
  $resp = array("dlttrsnt" => $settings->deleteTransient($params['key']));
157
+ break;
158
+ case "optns":
159
+ $resp = array();
160
+
161
+ if (array_key_exists("get_options", $params))
162
+ $resp["get_options"] = $settings->getOptions($params["get_options"]);
163
+
164
+ if (array_key_exists("update_options", $params))
165
+ $resp["update_options"] = $settings->updateOptions($params["update_options"]);
166
+
167
+ if (array_key_exists("delete_options", $params))
168
+ $resp["delete_options"] = $settings->deleteOptions($params["delete_options"]);
169
+
170
  break;
171
  case "setbvss":
172
  $resp = array("status" => $settings->updateOption('bv_site_settings', $params['bv_site_settings']));
info.php CHANGED
@@ -10,7 +10,7 @@ if (!class_exists('WPEInfo')) :
10
  public $badgeinfo = 'wpebadge';
11
  public $ip_header_option = 'wpeipheader';
12
  public $brand_option = 'wpebrand';
13
- public $version = '4.68';
14
  public $webpage = 'https://wpengine.com';
15
  public $appurl = 'https://wpengine.blogvault.net';
16
  public $slug = 'wp-site-migrate/wpengine.php';
@@ -103,8 +103,19 @@ if (!class_exists('WPEInfo')) :
103
  return ($this->getWatchTime() > $expiry_time);
104
  }
105
 
 
 
 
 
 
 
 
 
 
 
 
106
  public function isProtectModuleEnabled() {
107
- return $this->isServiceActive("protect");
108
  }
109
 
110
  public function isDynSyncModuleEnabled() {
@@ -130,7 +141,7 @@ if (!class_exists('WPEInfo')) :
130
  }
131
 
132
  public function isMalcare() {
133
- return $this->getBrandName() === 'MalCare - Pro';
134
  }
135
 
136
  public function isBlogvault() {
10
  public $badgeinfo = 'wpebadge';
11
  public $ip_header_option = 'wpeipheader';
12
  public $brand_option = 'wpebrand';
13
+ public $version = '4.78';
14
  public $webpage = 'https://wpengine.com';
15
  public $appurl = 'https://wpengine.blogvault.net';
16
  public $slug = 'wp-site-migrate/wpengine.php';
103
  return ($this->getWatchTime() > $expiry_time);
104
  }
105
 
106
+ public function isValidEnvironment(){
107
+ $bvsiteinfo = new WPEWPSiteInfo();
108
+ $siteurl = $bvsiteinfo->siteurl();
109
+ $bvconfig = $this->config;
110
+ if ($bvconfig && array_key_exists("abspath", $bvconfig) &&
111
+ array_key_exists("siteurl", $bvconfig) && !empty($siteurl)) {
112
+ return ($bvconfig["abspath"] == ABSPATH && $bvconfig["siteurl"] == $siteurl);
113
+ }
114
+ return true;
115
+ }
116
+
117
  public function isProtectModuleEnabled() {
118
+ return $this->isServiceActive("protect") && $this->isValidEnvironment();
119
  }
120
 
121
  public function isDynSyncModuleEnabled() {
141
  }
142
 
143
  public function isMalcare() {
144
+ return $this->getBrandName() === 'MalCare';
145
  }
146
 
147
  public function isBlogvault() {
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: wpengine, blogvault, akshatc, taylor4484
3
  Tags: wpe, wpengine, migration
4
  Requires at least: 4.0
5
- Tested up to: 5.9
6
  Requires PHP: 5.4.0
7
- Stable tag: 4.68
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -79,6 +79,13 @@ That's easy! [Signup here](http://wpengine.com/plans/).
79
  2. BlogVault dashboard showing live updates.
80
 
81
  == Changelog ==
 
 
 
 
 
 
 
82
  = 4.68 =
83
  * Removing use of constants for arrays for PHP 5.4 support.
84
  * Post type fetch improvement.
2
  Contributors: wpengine, blogvault, akshatc, taylor4484
3
  Tags: wpe, wpengine, migration
4
  Requires at least: 4.0
5
+ Tested up to: 6.1
6
  Requires PHP: 5.4.0
7
+ Stable tag: 4.78
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
79
  2. BlogVault dashboard showing live updates.
80
 
81
  == Changelog ==
82
+ = 4.72 =
83
+ * Better handling for plugin, theme infos
84
+ * Sync Improvements
85
+
86
+ = 4.69 =
87
+ * Improved network call efficiency for site info callbacks.
88
+
89
  = 4.68 =
90
  * Removing use of constants for arrays for PHP 5.4 support.
91
  * Post type fetch improvement.
wp_actions.php CHANGED
@@ -27,11 +27,13 @@ if (!class_exists('WPEWPAction')) :
27
  } else {
28
  WPEAccount::setup($this->settings);
29
  }
 
30
  }
31
 
32
  public function deactivate() {
33
  $info = array();
34
  $this->siteinfo->basic($info);
 
35
  $this->bvapi->pingbv('/bvapi/deactivate', $info);
36
  }
37
 
@@ -39,6 +41,7 @@ if (!class_exists('WPEWPAction')) :
39
  ##CLEARPTCONFIG##
40
  ##CLEARIPSTORE##
41
  ##CLEARDYNSYNCCONFIG##
 
42
  do_action('clear_bv_services_config');
43
  }
44
 
@@ -46,6 +49,8 @@ if (!class_exists('WPEWPAction')) :
46
  $this->settings->deleteOption($this->bvinfo->services_option_name);
47
  }
48
 
 
 
49
  public function footerHandler() {
50
  $bvfooter = $this->settings->getOption($this->bvinfo->badgeinfo);
51
  if ($bvfooter) {
27
  } else {
28
  WPEAccount::setup($this->settings);
29
  }
30
+ ##ENABLECACHE##
31
  }
32
 
33
  public function deactivate() {
34
  $info = array();
35
  $this->siteinfo->basic($info);
36
+ ##DISABLECACHE##
37
  $this->bvapi->pingbv('/bvapi/deactivate', $info);
38
  }
39
 
41
  ##CLEARPTCONFIG##
42
  ##CLEARIPSTORE##
43
  ##CLEARDYNSYNCCONFIG##
44
+ ##CLEARCACHECONFIG##
45
  do_action('clear_bv_services_config');
46
  }
47
 
49
  $this->settings->deleteOption($this->bvinfo->services_option_name);
50
  }
51
 
52
+ ##SOUNINSTALLFUNCTION##
53
+
54
  public function footerHandler() {
55
  $bvfooter = $this->settings->getOption($this->bvinfo->badgeinfo);
56
  if ($bvfooter) {
wp_api.php CHANGED
@@ -11,11 +11,11 @@ if (!class_exists('WPEWPAPI')) :
11
 
12
  public function pingbv($method, $body, $public = false) {
13
  if ($public) {
14
- $this->do_request($method, $body, $public);
15
  } else {
16
  $api_public_key = $this->settings->getOption('bvApiPublic');
17
  if (!empty($api_public_key) && (strlen($api_public_key) >= 32)) {
18
- $this->do_request($method, $body, $api_public_key);
19
  }
20
  }
21
  }
@@ -24,7 +24,7 @@ if (!class_exists('WPEWPAPI')) :
24
  $account = WPEAccount::find($this->settings, $pubkey);
25
  if (isset($account)) {
26
  $url = $account->authenticatedUrl($method);
27
- $this->http_request($url, $body);
28
  }
29
  }
30
 
11
 
12
  public function pingbv($method, $body, $public = false) {
13
  if ($public) {
14
+ return $this->do_request($method, $body, $public);
15
  } else {
16
  $api_public_key = $this->settings->getOption('bvApiPublic');
17
  if (!empty($api_public_key) && (strlen($api_public_key) >= 32)) {
18
+ return $this->do_request($method, $body, $api_public_key);
19
  }
20
  }
21
  }
24
  $account = WPEAccount::find($this->settings, $pubkey);
25
  if (isset($account)) {
26
  $url = $account->authenticatedUrl($method);
27
+ return $this->http_request($url, $body);
28
  }
29
  }
30
 
wp_db.php CHANGED
@@ -92,6 +92,14 @@ class WPEWPDb {
92
  return $this->isTablePresent($table);
93
  }
94
 
 
 
 
 
 
 
 
 
95
  public function alterBVTable($query, $name) {
96
  $resp = false;
97
  $table = $this->getBVTable($name);
@@ -101,6 +109,14 @@ class WPEWPDb {
101
  return $resp;
102
  }
103
 
 
 
 
 
 
 
 
 
104
  public function getTableContent($table, $fields = '*', $filter = '', $limit = 0, $offset = 0) {
105
  $query = "SELECT $fields from $table $filter";
106
  if ($limit > 0)
@@ -154,6 +170,22 @@ class WPEWPDb {
154
  return !$this->isTablePresent($table);
155
  }
156
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  public function deleteRowsFromtable($name, $count = 1) {
158
  $table = $this->getBVTable($name);
159
  if ($this->isTablePresent($table)) {
92
  return $this->isTablePresent($table);
93
  }
94
 
95
+ public function createTables($tables, $usedbdelta = false) {
96
+ $result = array();
97
+ foreach ($tables as $table => $query) {
98
+ $result[$table] = $this->createTable($query, $table, $usedbdelta);
99
+ }
100
+ return $result;
101
+ }
102
+
103
  public function alterBVTable($query, $name) {
104
  $resp = false;
105
  $table = $this->getBVTable($name);
109
  return $resp;
110
  }
111
 
112
+ public function alterTables($tables) {
113
+ $result = array();
114
+ foreach ($tables as $table => $query) {
115
+ $result[$table] = $this->alterBVTable($query, $table);
116
+ }
117
+ return $result;
118
+ }
119
+
120
  public function getTableContent($table, $fields = '*', $filter = '', $limit = 0, $offset = 0) {
121
  $query = "SELECT $fields from $table $filter";
122
  if ($limit > 0)
170
  return !$this->isTablePresent($table);
171
  }
172
 
173
+ public function dropTables($tables) {
174
+ $result = array();
175
+ foreach ($tables as $table) {
176
+ $result[$table] = $this->dropBVTable($table);
177
+ }
178
+ return $result;
179
+ }
180
+
181
+ public function truncateTables($tables) {
182
+ $result = array();
183
+ foreach ($tables as $table) {
184
+ $result[$table] = $this->truncateBVTable($table);
185
+ }
186
+ return $result;
187
+ }
188
+
189
  public function deleteRowsFromtable($name, $count = 1) {
190
  $table = $this->getBVTable($name);
191
  if ($this->isTablePresent($table)) {
wp_settings.php CHANGED
@@ -30,6 +30,37 @@ if (!class_exists('WPEWPSettings')) :
30
  }
31
  }
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  public function setTransient($name, $value, $time) {
34
  if (function_exists('set_site_transient')) {
35
  return set_site_transient($name, $value, $time);
30
  }
31
  }
32
 
33
+ public function getOptions($options = array()) {
34
+ $result = array();
35
+
36
+ foreach ($options as $option)
37
+ $result[$option] = $this->getOption($option);
38
+
39
+ return $result;
40
+ }
41
+
42
+ public function updateOptions($args) {
43
+ $result = array();
44
+
45
+ foreach ($args as $option => $value) {
46
+ $this->updateOption($option, $value);
47
+ $result[$option] = $this->getOption($option);
48
+ }
49
+
50
+ return $result;
51
+ }
52
+
53
+ public function deleteOptions($options) {
54
+ $result = array();
55
+
56
+ foreach ($options as $option) {
57
+ $this->deleteOption($option);
58
+ $result[$option] = !$this->getOption($option);
59
+ }
60
+
61
+ return $result;
62
+ }
63
+
64
  public function setTransient($name, $value, $time) {
65
  if (function_exists('set_site_transient')) {
66
  return set_site_transient($name, $value, $time);
wpengine.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://wpengine.com
5
  Description: The easiest way to migrate your site to WP Engine
6
  Author: WPEngine
7
  Author URI: https://wpengine.com
8
- Version: 4.68
9
  Network: True
10
  */
11
 
@@ -37,6 +37,7 @@ require_once dirname( __FILE__ ) . '/wp_api.php';
37
  require_once dirname( __FILE__ ) . '/wp_actions.php';
38
  require_once dirname( __FILE__ ) . '/info.php';
39
  require_once dirname( __FILE__ ) . '/account.php';
 
40
 
41
 
42
  $bvsettings = new WPEWPSettings();
@@ -54,6 +55,7 @@ register_deactivation_hook(__FILE__, array($wp_action, 'deactivate'));
54
 
55
  add_action('wp_footer', array($wp_action, 'footerHandler'), 100);
56
  add_action('clear_bv_services_config', array($wp_action, 'clear_bv_services_config'));
 
57
 
58
  ##WPCLIMODULE##
59
  if (is_admin()) {
@@ -71,6 +73,7 @@ if (is_admin()) {
71
  add_action('admin_head', array($wpadmin, 'removeAdminNotices'), 3);
72
  ##ACTIVATEWARNING##
73
  add_action('admin_enqueue_scripts', array($wpadmin, 'wpesecAdminMenu'));
 
74
  }
75
 
76
 
5
  Description: The easiest way to migrate your site to WP Engine
6
  Author: WPEngine
7
  Author URI: https://wpengine.com
8
+ Version: 4.78
9
  Network: True
10
  */
11
 
37
  require_once dirname( __FILE__ ) . '/wp_actions.php';
38
  require_once dirname( __FILE__ ) . '/info.php';
39
  require_once dirname( __FILE__ ) . '/account.php';
40
+ ##WPCACHEMODULE##
41
 
42
 
43
  $bvsettings = new WPEWPSettings();
55
 
56
  add_action('wp_footer', array($wp_action, 'footerHandler'), 100);
57
  add_action('clear_bv_services_config', array($wp_action, 'clear_bv_services_config'));
58
+ ##SOADDUNINSTALLACTION##
59
 
60
  ##WPCLIMODULE##
61
  if (is_admin()) {
73
  add_action('admin_head', array($wpadmin, 'removeAdminNotices'), 3);
74
  ##ACTIVATEWARNING##
75
  add_action('admin_enqueue_scripts', array($wpadmin, 'wpesecAdminMenu'));
76
+ ##SOADMINMENU##
77
  }
78
 
79