WP Engine Automated Migration - Version 3.9

Version Description

  • .htaccess Warning Added in Main Page
Download this release

Release Info

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

Code changes from version 3.4 to 3.9

account.php CHANGED
@@ -118,7 +118,7 @@ if (!class_exists('WPEAccount')) :
118
  self::update($settings, $accounts);
119
  }
120
 
121
- public function respInfo() {
122
  return array(
123
  "public" => substr($this->public, 0, 6),
124
  "sigmatch" => substr($this->sig_match, 0, 6)
118
  self::update($settings, $accounts);
119
  }
120
 
121
+ public function info() {
122
  return array(
123
  "public" => substr($this->public, 0, 6),
124
  "sigmatch" => substr($this->sig_match, 0, 6)
admin/main_page.php CHANGED
@@ -20,6 +20,7 @@
20
  your previous hosting service to WP Engine for free.</p>
21
  <p>Take the information from the migration page of your <a href="http://my.wpengine.com">WP Engine User Portal</a>, and paste
22
  those values into the fields below, and click "Migrate".</p>
 
23
  <?php if ($_error == "email") {
24
  echo '<div class="error" style="padding-bottom:0.5%;"><p>There is already an account with this email.</p></div>';
25
  } else if ($_error == "blog") {
20
  your previous hosting service to WP Engine for free.</p>
21
  <p>Take the information from the migration page of your <a href="http://my.wpengine.com">WP Engine User Portal</a>, and paste
22
  those values into the fields below, and click "Migrate".</p>
23
+ <p style="color:red">The .htaccess file will not be supported on our platform on PHP 7.4 and up (PHP 7.4 is currently default). We will continue to support .htaccess as normal on all previous versions of PHP until they are deprecated. For more information regarding these .htaccess changes, or to find/change your environment’s PHP version, <a href="https://wpengine.com/support/php-guide/">check out our PHP guide!</a></p>
24
  <?php if ($_error == "email") {
25
  echo '<div class="error" style="padding-bottom:0.5%;"><p>There is already an account with this email.</p></div>';
26
  } else if ($_error == "blog") {
callback/handler.php CHANGED
@@ -10,6 +10,7 @@ if (!class_exists('BVCallbackHandler')) :
10
  public $request;
11
  public $account;
12
  public $response;
 
13
 
14
  public function __construct($db, $settings, $siteinfo, $request, $account, $response) {
15
  $this->db = $db;
@@ -18,6 +19,7 @@ if (!class_exists('BVCallbackHandler')) :
18
  $this->request = $request;
19
  $this->account = $account;
20
  $this->response = $response;
 
21
  }
22
 
23
  public function bvAdmExecuteWithoutUser() {
@@ -30,17 +32,16 @@ if (!class_exists('BVCallbackHandler')) :
30
 
31
  public function execute($resp = array()) {
32
  $this->routeRequest();
33
- $bvinfo = new WPEInfo($this->settings);
34
  $resp = array(
35
- "request_info" => $this->request->respInfo(),
36
- "site_info" => $this->siteinfo->respInfo(),
37
- "account_info" => $this->account->respInfo(),
38
- "bvinfo" => $bvinfo->respInfo(),
39
  "api_pubkey" => substr(WPEAccount::getApiPublicKey($this->settings), 0, 8)
40
  );
41
  $this->response->terminate($resp);
42
  }
43
-
44
  public function routeRequest() {
45
  switch ($this->request->wing) {
46
  case 'manage':
@@ -67,17 +68,9 @@ if (!class_exists('BVCallbackHandler')) :
67
  require_once dirname( __FILE__ ) . '/wings/ipstore.php';
68
  $module = new BVIPStoreCallback($this);
69
  break;
70
- case 'fw':
71
- require_once dirname( __FILE__ ) . '/wings/fw.php';
72
- $module = new BVFirewallCallback($this);
73
- break;
74
- case 'lp':
75
- require_once dirname( __FILE__ ) . '/wings/lp.php';
76
- $module = new BVLoginProtectCallback($this);
77
- break;
78
- case 'monit':
79
- require_once dirname( __FILE__ ) . '/wings/monit.php';
80
- $module = new BVMonitCallback($this);
81
  break;
82
  case 'brand':
83
  require_once dirname( __FILE__ ) . '/wings/brand.php';
@@ -111,4 +104,4 @@ if (!class_exists('BVCallbackHandler')) :
111
  return 1;
112
  }
113
  }
114
- endif;
10
  public $request;
11
  public $account;
12
  public $response;
13
+ public $bvinfo;
14
 
15
  public function __construct($db, $settings, $siteinfo, $request, $account, $response) {
16
  $this->db = $db;
19
  $this->request = $request;
20
  $this->account = $account;
21
  $this->response = $response;
22
+ $this->bvinfo = new WPEInfo($this->settings);
23
  }
24
 
25
  public function bvAdmExecuteWithoutUser() {
32
 
33
  public function execute($resp = array()) {
34
  $this->routeRequest();
 
35
  $resp = array(
36
+ "request_info" => $this->request->info(),
37
+ "site_info" => $this->siteinfo->info(),
38
+ "account_info" => $this->account->info(),
39
+ "bvinfo" => $this->bvinfo->info(),
40
  "api_pubkey" => substr(WPEAccount::getApiPublicKey($this->settings), 0, 8)
41
  );
42
  $this->response->terminate($resp);
43
  }
44
+
45
  public function routeRequest() {
46
  switch ($this->request->wing) {
47
  case 'manage':
68
  require_once dirname( __FILE__ ) . '/wings/ipstore.php';
69
  $module = new BVIPStoreCallback($this);
70
  break;
71
+ case 'wtch':
72
+ require_once dirname( __FILE__ ) . '/wings/watch.php';
73
+ $module = new BVWatchCallback($this);
 
 
 
 
 
 
 
 
74
  break;
75
  case 'brand':
76
  require_once dirname( __FILE__ ) . '/wings/brand.php';
104
  return 1;
105
  }
106
  }
107
+ endif;
callback/request.php CHANGED
@@ -40,7 +40,7 @@ if (!class_exists('BVCallbackRequest')) :
40
  return array_key_exists('apicall', $this->params);
41
  }
42
 
43
- public function respInfo() {
44
  $info = array(
45
  "requestedsig" => $this->sig,
46
  "requestedtime" => $this->time,
@@ -176,4 +176,4 @@ if (!class_exists('BVCallbackRequest')) :
176
  return $data;
177
  }
178
  }
179
- endif;
40
  return array_key_exists('apicall', $this->params);
41
  }
42
 
43
+ public function info() {
44
  $info = array(
45
  "requestedsig" => $this->sig,
46
  "requestedtime" => $this->time,
176
  return $data;
177
  }
178
  }
179
+ endif;
callback/wings/account.php CHANGED
@@ -21,7 +21,7 @@ class BVAccountCallback extends BVCallbackBase {
21
  $resp = array("status" => WPEAccount::exists($this->settings, $params['public']));
22
  break;
23
  case "rmacc":
24
- $resp = array("status" => $account->remove($params['public']));
25
  break;
26
  case "updt":
27
  $info = array();
@@ -32,7 +32,8 @@ class BVAccountCallback extends BVCallbackBase {
32
  $resp = array("status" => WPEAccount::exists($this->settings, $params['pubkey']));
33
  break;
34
  case "updtapikey":
35
- $resp = array("status" => WPEAccount::updateApiPublicKey($this->settings, $params['pubkey']));
 
36
  break;
37
  case "rmdefsec":
38
  $resp = array("status" => $settings->deleteOption('bvDefaultSecret'));
21
  $resp = array("status" => WPEAccount::exists($this->settings, $params['public']));
22
  break;
23
  case "rmacc":
24
+ $resp = array("status" => WPEAccount::remove($this->settings, $params['public']));
25
  break;
26
  case "updt":
27
  $info = array();
32
  $resp = array("status" => WPEAccount::exists($this->settings, $params['pubkey']));
33
  break;
34
  case "updtapikey":
35
+ WPEAccount::updateApiPublicKey($this->settings, $params['pubkey']);
36
+ $resp = array("status" => $this->settings->getOption(WPEAccount::$api_public_key));
37
  break;
38
  case "rmdefsec":
39
  $resp = array("status" => $settings->deleteOption('bvDefaultSecret'));
callback/wings/db.php CHANGED
@@ -9,9 +9,13 @@ class BVDBCallback extends BVCallbackBase {
9
  public $stream;
10
  public $account;
11
 
 
 
12
  public function __construct($callback_handler) {
13
  $this->db = $callback_handler->db;
14
  $this->account = $callback_handler->account;
 
 
15
  }
16
 
17
  public function getLastID($pkeys, $end_row) {
@@ -64,6 +68,9 @@ class BVDBCallback extends BVCallbackBase {
64
  $db = $this->db;
65
  $params = $request->params;
66
  $stream_init_info = BVStream::startStream($this->account, $request);
 
 
 
67
  if (array_key_exists('stream', $stream_init_info)) {
68
  $this->stream = $stream_init_info['stream'];
69
  switch ($request->method) {
@@ -140,17 +147,17 @@ class BVDBCallback extends BVCallbackBase {
140
  $resp = $this->getTableData($table, $tname, $rcount, $offset, $limit, $bsize, $filter, $pkeys, true);
141
  break;
142
  case "tblexists":
143
- $resp = array("tblexists" => $db->isTablePresent($params['tablename']));
144
  break;
145
  case "crttbl":
146
  $usedbdelta = array_key_exists('usedbdelta', $params);
147
- $resp = array("crttbl" => $db->createTable($params['query'], $params['tablename'], $usedbdelta));
148
  break;
149
  case "drptbl":
150
- $resp = array("drptbl" => $db->dropBVTable($params['name']));
151
  break;
152
  case "trttbl":
153
- $resp = array("trttbl" => $db->truncateBVTable($params['name']));
154
  break;
155
  case "altrtbl":
156
  $resp = array("altrtbl" => $db->alterBVTable($params['query'], $params['query']));
9
  public $stream;
10
  public $account;
11
 
12
+ public static $bvTables = array("fw_requests", "lp_requests", "ip_store");
13
+
14
  public function __construct($callback_handler) {
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) {
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) {
147
  $resp = $this->getTableData($table, $tname, $rcount, $offset, $limit, $bsize, $filter, $pkeys, true);
148
  break;
149
  case "tblexists":
150
+ $resp = array("tblexists" => $db->isTablePresent($params['table']));
151
  break;
152
  case "crttbl":
153
  $usedbdelta = array_key_exists('usedbdelta', $params);
154
+ $resp = array("crttbl" => $db->createTable($params['query'], $params['table'], $usedbdelta));
155
  break;
156
  case "drptbl":
157
+ $resp = array("drptbl" => $db->dropBVTable($params['table']));
158
  break;
159
  case "trttbl":
160
+ $resp = array("trttbl" => $db->truncateBVTable($params['table']));
161
  break;
162
  case "altrtbl":
163
  $resp = array("altrtbl" => $db->alterBVTable($params['query'], $params['query']));
callback/wings/fs.php CHANGED
@@ -8,8 +8,12 @@ class BVFSCallback extends BVCallbackBase {
8
  public $stream;
9
  public $account;
10
 
 
 
11
  public function __construct($callback_handler) {
12
  $this->account = $callback_handler->account;
 
 
13
  }
14
 
15
  function fileStat($relfile) {
@@ -149,6 +153,34 @@ class BVFSCallback extends BVCallbackBase {
149
  return $md5;
150
  }
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  function getFilesStats($files, $offset = 0, $limit = 0, $bsize = 102400, $md5 = false) {
153
  $result = array();
154
  foreach ($files as $file) {
@@ -204,9 +236,39 @@ class BVFSCallback extends BVCallbackBase {
204
  return $result;
205
  }
206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  function process($request) {
208
  $params = $request->params;
209
  $stream_init_info = BVStream::startStream($this->account, $request);
 
 
 
210
  if (array_key_exists('stream', $stream_init_info)) {
211
  $this->stream = $stream_init_info['stream'];
212
  switch ($request->method) {
@@ -264,6 +326,30 @@ class BVFSCallback extends BVCallbackBase {
264
  $directoryList = glob($initdir.$regex, $glob_option);
265
  $resp = $this->getFilesStats($directoryList);
266
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  default:
268
  $resp = false;
269
  }
8
  public $stream;
9
  public $account;
10
 
11
+ public static $cwAllowedFiles = array(".htaccess", ".user.ini", "malcare-waf.php");
12
+
13
  public function __construct($callback_handler) {
14
  $this->account = $callback_handler->account;
15
+ $this->siteinfo = $callback_handler->siteinfo;
16
+ $this->bvinfo = $callback_handler->bvinfo;
17
  }
18
 
19
  function fileStat($relfile) {
153
  return $md5;
154
  }
155
 
156
+ function getFilesContent($files, $withContent = true) {
157
+ $result = array();
158
+ foreach ($files as $file) {
159
+ $fdata = $this->fileStat($file);
160
+ $absfile = ABSPATH.$file;
161
+
162
+ if (is_dir($absfile) && !is_link($absfile)) {
163
+ $fdata['is_dir'] = true;
164
+ } else {
165
+ if (!is_readable($file)) {
166
+ $fdata['error'] = 'file not readable';
167
+ } else {
168
+ if ($withContent === true) {
169
+ if ($content = file_get_contents($absfile)) {
170
+ $fdata['content'] = $content;
171
+ } else {
172
+ $fdata['error'] = 'unable to read file';
173
+ }
174
+ }
175
+ }
176
+ }
177
+
178
+ $result[$file] = $fdata;
179
+ }
180
+
181
+ return $result;
182
+ }
183
+
184
  function getFilesStats($files, $offset = 0, $limit = 0, $bsize = 102400, $md5 = false) {
185
  $result = array();
186
  foreach ($files as $file) {
236
  return $result;
237
  }
238
 
239
+ function mkdir($path, $permissions) {
240
+ $result = array();
241
+ $path = ABSPATH.$path;
242
+
243
+ if (!file_exists($path)) {
244
+ if (!mkdir($path)) {
245
+ $result['status'] = 'Error';
246
+ $result['message'] = 'UNABLE_TO_CREATE_DIR';
247
+ }
248
+ } else {
249
+ $result['already_exists'] = true;
250
+ }
251
+
252
+ if (file_exists($path)) {
253
+ $result['exists'] = true;
254
+
255
+ if (chmod($path, $permissions)) {
256
+ $result['status'] = 'Done';
257
+ } else {
258
+ $result['status'] = 'Error';
259
+ $result['message'] = "UNABLE_TO_SET_PERMISSIONS";
260
+ }
261
+ }
262
+
263
+ return $result;
264
+ }
265
+
266
  function process($request) {
267
  $params = $request->params;
268
  $stream_init_info = BVStream::startStream($this->account, $request);
269
+
270
+
271
+
272
  if (array_key_exists('stream', $stream_init_info)) {
273
  $this->stream = $stream_init_info['stream'];
274
  switch ($request->method) {
326
  $directoryList = glob($initdir.$regex, $glob_option);
327
  $resp = $this->getFilesStats($directoryList);
328
  break;
329
+ case "dirsexists":
330
+ $resp = array();
331
+ $dirs = $params['dirs'];
332
+
333
+ foreach ($dirs as $dir) {
334
+ $path = ABSPATH.$dir;
335
+ if (file_exists($path) && is_dir($path) && !is_link($path)) {
336
+ $resp[$dir] = true;
337
+ } else {
338
+ $resp[$dir] = false;
339
+ }
340
+ }
341
+
342
+ $resp["status"] = "Done";
343
+ break;
344
+ case "gtfilescntent":
345
+ $files = $params['files'];
346
+ $withContent = array_key_exists('withcontent', $params) ? $params['withcontent'] : true;
347
+ $resp = array("files_content" => $this->getFilesContent($files, $withContent));
348
+ break;
349
+ case "mkdr":
350
+ $permissions = array_key_exists('permissions', $params) ? $params['permissions'] : 0777;
351
+ $resp = array('mkdir' => $this->mkdir($params['path'], $permissions));
352
+ break;
353
  default:
354
  $resp = false;
355
  }
callback/wings/info.php CHANGED
@@ -96,11 +96,13 @@ class BVInfoCallback extends BVCallbackBase {
96
 
97
  public function getSystemInfo() {
98
  $sys_info = array(
99
- 'serverip' => $_SERVER['SERVER_ADDR'],
100
  'host' => $_SERVER['HTTP_HOST'],
101
  'phpversion' => phpversion(),
102
  'AF_INET6' => defined('AF_INET6')
103
  );
 
 
 
104
  if (function_exists('get_current_user')) {
105
  $sys_info['user'] = get_current_user();
106
  }
@@ -203,51 +205,11 @@ class BVInfoCallback extends BVCallbackBase {
203
  $data['dynsync'] = $settings->getOption('bvDynSyncActive');
204
  $data['woodyn'] = $settings->getOption('bvWooDynSync');
205
  $data['dynplug'] = $settings->getOption('bvdynplug');
206
- $data['ptplug'] = $settings->getOption('bvptplug');
207
- $data['fw'] = $this->getFWConfig();
208
- $data['lp'] = $this->getLPConfig();
209
  $data['brand'] = $settings->getOption($this->bvinfo->brand_option);
210
  $data['badgeinfo'] = $settings->getOption($this->bvinfo->badgeinfo);
211
  }
212
 
213
- public function getLPConfig() {
214
- $config = array();
215
- $settings = $this->settings;
216
- $mode = $settings->getOption('bvlpmode');
217
- $cplimit = $settings->getOption('bvlpcaptchalimit');
218
- $tplimit = $settings->getOption('bvlptempblocklimit');
219
- $bllimit = $settings->getOption('bvlpblockAllLimit');
220
- $config['mode'] = intval($mode ? $mode : 1);
221
- $config['captcha_limit'] = intval($cplimit ? $cplimit : 3);
222
- $config['temp_block_limit'] = intval($tplimit? $tplimit : 6);
223
- $config['block_all_limit'] = intval($bllimit ? $bllimit : 100);
224
- return $config;
225
- }
226
-
227
- public function getFWConfig() {
228
- $config = array();
229
- $settings = $this->settings;
230
- $mode = $settings->getOption('bvfwmode');
231
- $drules = $settings->getOption('bvfwdisabledrules');
232
- $arules = $settings->getOption('bvfwauditrules');
233
- $rmode = $settings->getOption('bvfwrulesmode');
234
- $reqprofilingmode = $settings->getOption('bvfwreqprofilingmode');
235
- $bypass_level = $settings->getOption('bvfwbypasslevel');
236
- $custom_roles = $settings->getOption('bvfwcustomroles');
237
- $cookiemode = $settings->getOption('bvfwcookiemode');
238
- $cookiekey = (string) $settings->getOption('bvfwcookiekey');
239
- $config['mode'] = intval($mode ? $mode : 1);
240
- $config['disabled_rules'] = $drules ? $drules : array();
241
- $config['audit_rules'] = $arules ? $arules : array();
242
- $config['rules_mode'] = intval($rmode ? $rmode : 1);
243
- $config['req_profiling_mode'] = intval($reqprofilingmode ? $reqprofilingmode : 1);
244
- $config['bypslevl'] = intval($bypass_level ? $bypass_level : 2);
245
- $config['cstmrls'] = $custom_roles ? $custom_roles : array();
246
- $config['cookiemode'] = intval($cookiemode ? $cookiemode : 2);
247
- $config['cookiekey'] = $cookiekey;
248
- return $config;
249
- }
250
-
251
  public function dbconf(&$info) {
252
  $db = $this->db;
253
  if (defined('DB_CHARSET'))
@@ -256,6 +218,15 @@ class BVInfoCallback extends BVCallbackBase {
256
  $info['charset_collate'] = $db->getCharsetCollate();
257
  return $info;
258
  }
 
 
 
 
 
 
 
 
 
259
 
260
  public function activate() {
261
  $resp = array();
@@ -273,6 +244,9 @@ class BVInfoCallback extends BVCallbackBase {
273
  case "activateinfo":
274
  $resp = $this->activate();
275
  break;
 
 
 
276
  case "gtpsts":
277
  $count = 5;
278
  if (array_key_exists('count', $params))
@@ -294,6 +268,13 @@ class BVInfoCallback extends BVCallbackBase {
294
  case "gtwp":
295
  $resp = $this->getWpInfo();
296
  break;
 
 
 
 
 
 
 
297
  case "getoption":
298
  $resp = array("option" => $this->settings->getOption($params['name']));
299
  break;
96
 
97
  public function getSystemInfo() {
98
  $sys_info = array(
 
99
  'host' => $_SERVER['HTTP_HOST'],
100
  'phpversion' => phpversion(),
101
  'AF_INET6' => defined('AF_INET6')
102
  );
103
+ if (array_key_exists('SERVER_ADDR', $_SERVER)) {
104
+ $sys_info['serverip'] = $_SERVER['SERVER_ADDR'];
105
+ }
106
  if (function_exists('get_current_user')) {
107
  $sys_info['user'] = get_current_user();
108
  }
205
  $data['dynsync'] = $settings->getOption('bvDynSyncActive');
206
  $data['woodyn'] = $settings->getOption('bvWooDynSync');
207
  $data['dynplug'] = $settings->getOption('bvdynplug');
208
+ $data['protect'] = $settings->getOption('bvptconf');
 
 
209
  $data['brand'] = $settings->getOption($this->bvinfo->brand_option);
210
  $data['badgeinfo'] = $settings->getOption($this->bvinfo->badgeinfo);
211
  }
212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  public function dbconf(&$info) {
214
  $db = $this->db;
215
  if (defined('DB_CHARSET'))
218
  $info['charset_collate'] = $db->getCharsetCollate();
219
  return $info;
220
  }
221
+
222
+ public function cookieInfo() {
223
+ $resp = array();
224
+ if (defined('COOKIEPATH'))
225
+ $resp['cookiepath'] = COOKIEPATH;
226
+ if (defined('COOKIE_DOMAIN'))
227
+ $resp['cookiedomain'] = COOKIE_DOMAIN;
228
+ return array('cookieinfo' => $resp);
229
+ }
230
 
231
  public function activate() {
232
  $resp = array();
244
  case "activateinfo":
245
  $resp = $this->activate();
246
  break;
247
+ case "ckeyinfo":
248
+ $resp = $this->cookieInfo();
249
+ break;
250
  case "gtpsts":
251
  $count = 5;
252
  if (array_key_exists('count', $params))
268
  case "gtwp":
269
  $resp = $this->getWpInfo();
270
  break;
271
+ case "gtallhdrs":
272
+ $data = (function_exists('getallheaders')) ? getallheaders() : false;
273
+ $resp = array("allhdrs" => $data);
274
+ break;
275
+ case "gtsvr":
276
+ $resp = array("svr" => $_SERVER);
277
+ break;
278
  case "getoption":
279
  $resp = array("option" => $this->settings->getOption($params['name']));
280
  break;
callback/wings/misc.php CHANGED
@@ -23,9 +23,9 @@ class BVMiscCallback extends BVCallbackBase {
23
  switch ($request->method) {
24
  case "dummyping":
25
  $resp = array();
26
- $resp = array_merge($resp, $this->siteinfo->respInfo());
27
- $resp = array_merge($resp, $this->account->respInfo());
28
- $resp = array_merge($resp, $this->bvinfo->respInfo());
29
  break;
30
  case "enablebadge":
31
  $option = $bvinfo->badgeinfo;
@@ -52,14 +52,6 @@ class BVMiscCallback extends BVCallbackBase {
52
  $settings->deleteOption('bvdynplug');
53
  $resp = array("unsetdynplug" => $settings->getOption('bvdynplug'));
54
  break;
55
- case "setptplug":
56
- $settings->updateOption('bvptplug', $params['ptplug']);
57
- $resp = array("setptplug" => $settings->getOption('bvptplug'));
58
- break;
59
- case "unsetptplug":
60
- $settings->deleteOption('bvptlug');
61
- $resp = array("unsetptplug" => $settings->getOption('bvptlug'));
62
- break;
63
  case "wpupplgs":
64
  $resp = array("wpupdateplugins" => wp_update_plugins());
65
  break;
@@ -69,10 +61,6 @@ class BVMiscCallback extends BVCallbackBase {
69
  case "wpupcre":
70
  $resp = array("wpupdatecore" => wp_version_check());
71
  break;
72
- case "rmmonitime":
73
- $this->settings->deleteOption('bvmonittime');
74
- $resp = array("rmmonitime" => !$bvinfo->getMonitTime());
75
- break;
76
  case "phpinfo":
77
  phpinfo();
78
  die();
@@ -86,4 +74,4 @@ class BVMiscCallback extends BVCallbackBase {
86
  return $resp;
87
  }
88
  }
89
- endif;
23
  switch ($request->method) {
24
  case "dummyping":
25
  $resp = array();
26
+ $resp = array_merge($resp, $this->siteinfo->info());
27
+ $resp = array_merge($resp, $this->account->info());
28
+ $resp = array_merge($resp, $this->bvinfo->info());
29
  break;
30
  case "enablebadge":
31
  $option = $bvinfo->badgeinfo;
52
  $settings->deleteOption('bvdynplug');
53
  $resp = array("unsetdynplug" => $settings->getOption('bvdynplug'));
54
  break;
 
 
 
 
 
 
 
 
55
  case "wpupplgs":
56
  $resp = array("wpupdateplugins" => wp_update_plugins());
57
  break;
61
  case "wpupcre":
62
  $resp = array("wpupdatecore" => wp_version_check());
63
  break;
 
 
 
 
64
  case "phpinfo":
65
  phpinfo();
66
  die();
74
  return $resp;
75
  }
76
  }
77
+ endif;
info.php CHANGED
@@ -9,17 +9,23 @@ if (!class_exists('WPEInfo')) :
9
  public $badgeinfo = 'wpebadge';
10
  public $ip_header_option = 'wpeipheader';
11
  public $brand_option = 'wpebrand';
12
- public $version = '3.4';
13
  public $webpage = 'https://wpengine.com';
14
  public $appurl = 'https://wpengine.blogvault.net';
15
  public $slug = 'wp-site-migrate/wpengine.php';
16
  public $plug_redirect = 'wperedirect';
17
  public $logo = '../assets/img/wpengine-logo.png';
 
18
 
19
  public function __construct($settings) {
20
  $this->settings = $settings;
21
  }
22
 
 
 
 
 
 
23
  public function getBrandInfo() {
24
  return $this->settings->getOption($this->brand_option);
25
  }
@@ -29,11 +35,20 @@ if (!class_exists('WPEInfo')) :
29
  if ($brand && array_key_exists('menuname', $brand)) {
30
  return $brand['menuname'];
31
  }
 
32
  return $this->brandname;
33
  }
34
 
35
- public function getMonitTime() {
36
- $time = $this->settings->getOption('bvmonittime');
 
 
 
 
 
 
 
 
37
  return ($time ? $time : 0);
38
  }
39
 
@@ -48,10 +63,10 @@ if (!class_exists('WPEInfo')) :
48
  return $this->appurl;
49
  }
50
  }
51
-
52
  public function isActivePlugin() {
53
  $expiry_time = time() - (3 * 24 * 3600);
54
- return ($this->getMonitTime() > $expiry_time);
55
  }
56
 
57
  public function isProtectModuleEnabled() {
@@ -63,6 +78,7 @@ if (!class_exists('WPEInfo')) :
63
  return ($this->settings->getOption('bvdynplug') === $this->plugname) &&
64
  $this->isActivePlugin();
65
  }
 
66
  public function isActivateRedirectSet() {
67
  return ($this->settings->getOption($this->plug_redirect) === 'yes') ? true : false;
68
  }
@@ -75,10 +91,11 @@ if (!class_exists('WPEInfo')) :
75
  return $this->getBrandName() === 'BlogVault';
76
  }
77
 
78
- public function respInfo() {
79
  return array(
80
  "bvversion" => $this->version,
81
- "sha1" => "true"
 
82
  );
83
  }
84
  }
9
  public $badgeinfo = 'wpebadge';
10
  public $ip_header_option = 'wpeipheader';
11
  public $brand_option = 'wpebrand';
12
+ public $version = '3.9';
13
  public $webpage = 'https://wpengine.com';
14
  public $appurl = 'https://wpengine.blogvault.net';
15
  public $slug = 'wp-site-migrate/wpengine.php';
16
  public $plug_redirect = 'wperedirect';
17
  public $logo = '../assets/img/wpengine-logo.png';
18
+ public $brand_icon = '/assets/img/favicon.ico';
19
 
20
  public function __construct($settings) {
21
  $this->settings = $settings;
22
  }
23
 
24
+ public function canOverrideCW() {
25
+ $scanOption = $this->settings->getOption('bvoverridecw');
26
+ return (isset($scanOption) && $scanOption == 1);
27
+ }
28
+
29
  public function getBrandInfo() {
30
  return $this->settings->getOption($this->brand_option);
31
  }
35
  if ($brand && array_key_exists('menuname', $brand)) {
36
  return $brand['menuname'];
37
  }
38
+
39
  return $this->brandname;
40
  }
41
 
42
+ public function getBrandIcon() {
43
+ $brand = $this->getBrandInfo();
44
+ if ($brand && array_key_exists('brand_icon', $brand)) {
45
+ return $brand['brand_icon'];
46
+ }
47
+ return $this->brand_icon;
48
+ }
49
+
50
+ public function getWatchTime() {
51
+ $time = $this->settings->getOption('bvwatchtime');
52
  return ($time ? $time : 0);
53
  }
54
 
63
  return $this->appurl;
64
  }
65
  }
66
+
67
  public function isActivePlugin() {
68
  $expiry_time = time() - (3 * 24 * 3600);
69
+ return ($this->getWatchTime() > $expiry_time);
70
  }
71
 
72
  public function isProtectModuleEnabled() {
78
  return ($this->settings->getOption('bvdynplug') === $this->plugname) &&
79
  $this->isActivePlugin();
80
  }
81
+
82
  public function isActivateRedirectSet() {
83
  return ($this->settings->getOption($this->plug_redirect) === 'yes') ? true : false;
84
  }
91
  return $this->getBrandName() === 'BlogVault';
92
  }
93
 
94
+ public function info() {
95
  return array(
96
  "bvversion" => $this->version,
97
+ "sha1" => "true",
98
+ "plugname" => $this->plugname
99
  );
100
  }
101
  }
readme.txt CHANGED
@@ -2,8 +2,9 @@
2
  Contributors: wpengine, blogvault, akshatc, taylor4484
3
  Tags: wpe, wpengine, migration
4
  Requires at least: 4.0
5
- Tested up to: 5.3
6
- Stable tag: 3.4
 
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -78,6 +79,9 @@ That's easy! [Signup here](http://wpengine.com/plans/).
78
  2. BlogVault dashboard showing live updates.
79
 
80
  == Changelog ==
 
 
 
81
  = 3.4 =
82
  * Plugin branding fixes
83
 
2
  Contributors: wpengine, blogvault, akshatc, taylor4484
3
  Tags: wpe, wpengine, migration
4
  Requires at least: 4.0
5
+ Tested up to: 5.4
6
+ Requires PHP: 5.4.0
7
+ Stable tag: 3.9
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
+ = 3.9 =
83
+ * .htaccess Warning Added in Main Page
84
+
85
  = 3.4 =
86
  * Plugin branding fixes
87
 
recover.php CHANGED
@@ -44,4 +44,4 @@ if (!class_exists('WPERecover')) :
44
  return $account;
45
  }
46
  }
47
- endif;
44
  return $account;
45
  }
46
  }
47
+ endif;
wp_actions.php CHANGED
@@ -36,8 +36,7 @@ if (!class_exists('WPEWPAction')) :
36
  }
37
 
38
  public static function uninstall() {
39
- ##CLEARLPCONFIG##
40
- ##CLEARFWCONFIG##
41
  ##CLEARIPSTORE##
42
  ##CLEARDYNSYNCCONFIG##
43
  }
36
  }
37
 
38
  public static function uninstall() {
39
+ ##CLEARPTCONFIG##
 
40
  ##CLEARIPSTORE##
41
  ##CLEARDYNSYNCCONFIG##
42
  }
wp_admin.php CHANGED
@@ -2,14 +2,17 @@
2
 
3
  if (!defined('ABSPATH')) exit;
4
  if (!class_exists('WPEWPAdmin')) :
 
5
  class WPEWPAdmin {
6
  public $settings;
7
  public $siteinfo;
8
  public $bvinfo;
 
9
 
10
- function __construct($settings, $siteinfo) {
11
  $this->settings = $settings;
12
  $this->siteinfo = $siteinfo;
 
13
  $this->bvinfo = new WPEInfo($this->settings);
14
  }
15
 
@@ -21,6 +24,13 @@ class WPEWPAdmin {
21
  }
22
  }
23
 
 
 
 
 
 
 
 
24
  public function initHandler() {
25
  if (!current_user_can('activate_plugins'))
26
  return;
@@ -49,8 +59,9 @@ class WPEWPAdmin {
49
  $brand = $this->bvinfo->getBrandInfo();
50
  if (!$brand || (!array_key_exists('hide', $brand) && !array_key_exists('hide_from_menu', $brand))) {
51
  $bname = $this->bvinfo->getBrandName();
 
52
  add_menu_page($bname, $bname, 'manage_options', $this->bvinfo->plugname,
53
- array($this, 'adminPage'), plugins_url('assets/img/favicon.ico', __FILE__ ));
54
  }
55
  }
56
 
2
 
3
  if (!defined('ABSPATH')) exit;
4
  if (!class_exists('WPEWPAdmin')) :
5
+
6
  class WPEWPAdmin {
7
  public $settings;
8
  public $siteinfo;
9
  public $bvinfo;
10
+ public $bvapi;
11
 
12
+ function __construct($settings, $siteinfo, $bvapi) {
13
  $this->settings = $settings;
14
  $this->siteinfo = $siteinfo;
15
+ $this->bvapi = $bvapi;
16
  $this->bvinfo = new WPEInfo($this->settings);
17
  }
18
 
24
  }
25
  }
26
 
27
+ function removeAdminNotices() {
28
+ if (array_key_exists('page', $_REQUEST) && $_REQUEST['page'] == $this->bvinfo->plugname) {
29
+ remove_all_actions('admin_notices');
30
+ remove_all_actions('all_admin_notices');
31
+ }
32
+ }
33
+
34
  public function initHandler() {
35
  if (!current_user_can('activate_plugins'))
36
  return;
59
  $brand = $this->bvinfo->getBrandInfo();
60
  if (!$brand || (!array_key_exists('hide', $brand) && !array_key_exists('hide_from_menu', $brand))) {
61
  $bname = $this->bvinfo->getBrandName();
62
+ $icon = $this->bvinfo->getBrandIcon();
63
  add_menu_page($bname, $bname, 'manage_options', $this->bvinfo->plugname,
64
+ array($this, 'adminPage'), plugins_url($icon, __FILE__ ));
65
  }
66
  }
67
 
wp_api.php CHANGED
@@ -11,27 +11,30 @@ if (!class_exists('WPEWPAPI')) :
11
 
12
  public function pingbv($method, $body, $public = false) {
13
  if ($public) {
14
- $this->create_request_params($method, $public);
15
  } else {
16
  $accounts = WPEAccount::allAccounts($this->settings);
17
  foreach ($accounts as $pubkey => $value ) {
18
- $this->create_request_params($method, $pubkey);
19
  }
20
  }
21
  }
22
 
23
- public function create_request_params($method, $pubkey) {
24
  $account = WPEAccount::find($this->settings, $pubkey);
25
  $url = $account->authenticatedUrl($method);
26
  $this->http_request($url, $body);
27
  }
28
 
29
- public function http_request($url, $body) {
30
  $_body = array(
31
  'method' => 'POST',
32
  'timeout' => 15,
33
- 'body' => $body);
34
-
 
 
 
35
  return wp_remote_post($url, $_body);
36
  }
37
  }
11
 
12
  public function pingbv($method, $body, $public = false) {
13
  if ($public) {
14
+ $this->create_request_params($method, $body, $public);
15
  } else {
16
  $accounts = WPEAccount::allAccounts($this->settings);
17
  foreach ($accounts as $pubkey => $value ) {
18
+ $this->create_request_params($method, $body, $pubkey);
19
  }
20
  }
21
  }
22
 
23
+ public function create_request_params($method, $body, $pubkey) {
24
  $account = WPEAccount::find($this->settings, $pubkey);
25
  $url = $account->authenticatedUrl($method);
26
  $this->http_request($url, $body);
27
  }
28
 
29
+ public function http_request($url, $body, $headers = array()) {
30
  $_body = array(
31
  'method' => 'POST',
32
  'timeout' => 15,
33
+ 'body' => $body
34
+ );
35
+ if (!empty($headers)) {
36
+ $_body['headers'] = $headers;
37
+ }
38
  return wp_remote_post($url, $_body);
39
  }
40
  }
wp_db.php CHANGED
@@ -168,5 +168,19 @@ class WPEWPDb {
168
  $table = $this->getBVTable($name);
169
  return $wpdb->replace($table, $value);
170
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  }
172
- endif;
168
  $table = $this->getBVTable($name);
169
  return $wpdb->replace($table, $value);
170
  }
171
+
172
+ public function tinfo($name) {
173
+ $result = array();
174
+ $table = $this->getBVTable($name);
175
+
176
+ $result['name'] = $table;
177
+
178
+ if ($this->isTablePresent($table)) {
179
+ $result['exists'] = true;
180
+ $result['createquery'] = $this->showTableCreate($table);
181
+ }
182
+
183
+ return $result;
184
+ }
185
  }
186
+ endif;
wp_site_info.php CHANGED
@@ -39,7 +39,7 @@ class WPEWPSiteInfo {
39
  return is_main_site();
40
  }
41
 
42
- public function respInfo() {
43
  $info = array();
44
  $this->basic($info);
45
  $info['dbsig'] = $this->dbsig(false);
@@ -51,12 +51,18 @@ class WPEWPSiteInfo {
51
  $info['wpurl'] = $this->wpurl();
52
  $info['siteurl'] = $this->siteurl();
53
  $info['homeurl'] = $this->homeurl();
54
- $info['serverip'] = $_SERVER['SERVER_ADDR'];
 
 
55
  $info['abspath'] = ABSPATH;
56
  }
57
 
58
  public function serversig($full = false) {
59
- $sig = sha1($_SERVER['SERVER_ADDR'].ABSPATH);
 
 
 
 
60
  if ($full)
61
  return $sig;
62
  else
@@ -75,5 +81,9 @@ class WPEWPSiteInfo {
75
  else
76
  return substr($sig, 0, 6);
77
  }
 
 
 
 
78
  }
79
  endif;
39
  return is_main_site();
40
  }
41
 
42
+ public function info() {
43
  $info = array();
44
  $this->basic($info);
45
  $info['dbsig'] = $this->dbsig(false);
51
  $info['wpurl'] = $this->wpurl();
52
  $info['siteurl'] = $this->siteurl();
53
  $info['homeurl'] = $this->homeurl();
54
+ if (array_key_exists('SERVER_ADDR', $_SERVER)) {
55
+ $info['serverip'] = $_SERVER['SERVER_ADDR'];
56
+ }
57
  $info['abspath'] = ABSPATH;
58
  }
59
 
60
  public function serversig($full = false) {
61
+ $sig_param = ABSPATH;
62
+ if (array_key_exists('SERVER_ADDR', $_SERVER)) {
63
+ $sig_param = $_SERVER['SERVER_ADDR'].ABSPATH;
64
+ }
65
+ $sig = sha1($sig_param);
66
  if ($full)
67
  return $sig;
68
  else
81
  else
82
  return substr($sig, 0, 6);
83
  }
84
+
85
+ public static function isCWServer() {
86
+ return isset($_SERVER['cw_allowed_ip']);
87
+ }
88
  }
89
  endif;
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: 3.4
9
  Network: True
10
  */
11
 
@@ -28,6 +28,7 @@ Network: True
28
  /* Global response array */
29
 
30
  if (!defined('ABSPATH')) exit;
 
31
  require_once dirname( __FILE__ ) . '/wp_settings.php';
32
  require_once dirname( __FILE__ ) . '/wp_site_info.php';
33
  require_once dirname( __FILE__ ) . '/wp_db.php';
@@ -55,7 +56,7 @@ add_action('wp_footer', array($wp_action, 'footerHandler'), 100);
55
  ##WPCLIMODULE##
56
  if (is_admin()) {
57
  require_once dirname( __FILE__ ) . '/wp_admin.php';
58
- $wpadmin = new WPEWPAdmin($bvsettings, $bvsiteinfo);
59
  add_action('admin_init', array($wpadmin, 'initHandler'));
60
  add_filter('all_plugins', array($wpadmin, 'initBranding'));
61
  add_filter('plugin_row_meta', array($wpadmin, 'hidePluginDetails'), 10, 2);
@@ -65,6 +66,7 @@ if (is_admin()) {
65
  add_action('admin_menu', array($wpadmin, 'menu'));
66
  }
67
  add_filter('plugin_action_links', array($wpadmin, 'settingsLink'), 10, 2);
 
68
  ##ACTIVATEWARNING##
69
  add_action('admin_enqueue_scripts', array($wpadmin, 'wpesecAdminMenu'));
70
  }
@@ -92,13 +94,15 @@ if ((array_key_exists('bvplugname', $_REQUEST)) && ($_REQUEST['bvplugname'] == "
92
  $response = new BVCallbackResponse($request->bvb64cksize);
93
 
94
  if ($account && (1 === $account->authenticate($request))) {
 
 
95
  require_once dirname( __FILE__ ) . '/callback/handler.php';
96
  $params = $request->processParams($_REQUEST);
97
  if ($params === false) {
98
  $resp = array(
99
- "account_info" => $account->respInfo(),
100
- "request_info" => $request->respInfo(),
101
- "bvinfo" => $bvinfo->respInfo(),
102
  "statusmsg" => "BVPRMS_CORRUPTED"
103
  );
104
  $response->terminate($resp);
@@ -115,9 +119,9 @@ if ((array_key_exists('bvplugname', $_REQUEST)) && ($_REQUEST['bvplugname'] == "
115
  }
116
  } else {
117
  $resp = array(
118
- "account_info" => $account ? $account->respInfo() : array("error" => "ACCOUNT_NOT_FOUND"),
119
- "request_info" => $request->respInfo(),
120
- "bvinfo" => $bvinfo->respInfo(),
121
  "statusmsg" => "FAILED_AUTH",
122
  "api_pubkey" => substr(WPEAccount::getApiPublicKey($bvsettings), 0, 8),
123
  "def_sigmatch" => substr(WPEAccount::getSigMatch($request, WPERecover::getDefaultSecret($bvsettings)), 0, 8)
5
  Description: The easiest way to migrate your site to WP Engine
6
  Author: WPEngine
7
  Author URI: https://wpengine.com
8
+ Version: 3.9
9
  Network: True
10
  */
11
 
28
  /* Global response array */
29
 
30
  if (!defined('ABSPATH')) exit;
31
+
32
  require_once dirname( __FILE__ ) . '/wp_settings.php';
33
  require_once dirname( __FILE__ ) . '/wp_site_info.php';
34
  require_once dirname( __FILE__ ) . '/wp_db.php';
56
  ##WPCLIMODULE##
57
  if (is_admin()) {
58
  require_once dirname( __FILE__ ) . '/wp_admin.php';
59
+ $wpadmin = new WPEWPAdmin($bvsettings, $bvsiteinfo, $bvapi);
60
  add_action('admin_init', array($wpadmin, 'initHandler'));
61
  add_filter('all_plugins', array($wpadmin, 'initBranding'));
62
  add_filter('plugin_row_meta', array($wpadmin, 'hidePluginDetails'), 10, 2);
66
  add_action('admin_menu', array($wpadmin, 'menu'));
67
  }
68
  add_filter('plugin_action_links', array($wpadmin, 'settingsLink'), 10, 2);
69
+ add_action('admin_head', array($wpadmin, 'removeAdminNotices'), 3);
70
  ##ACTIVATEWARNING##
71
  add_action('admin_enqueue_scripts', array($wpadmin, 'wpesecAdminMenu'));
72
  }
94
  $response = new BVCallbackResponse($request->bvb64cksize);
95
 
96
  if ($account && (1 === $account->authenticate($request))) {
97
+ ##BVBASEPATH##
98
+
99
  require_once dirname( __FILE__ ) . '/callback/handler.php';
100
  $params = $request->processParams($_REQUEST);
101
  if ($params === false) {
102
  $resp = array(
103
+ "account_info" => $account->info(),
104
+ "request_info" => $request->info(),
105
+ "bvinfo" => $bvinfo->info(),
106
  "statusmsg" => "BVPRMS_CORRUPTED"
107
  );
108
  $response->terminate($resp);
119
  }
120
  } else {
121
  $resp = array(
122
+ "account_info" => $account ? $account->info() : array("error" => "ACCOUNT_NOT_FOUND"),
123
+ "request_info" => $request->info(),
124
+ "bvinfo" => $bvinfo->info(),
125
  "statusmsg" => "FAILED_AUTH",
126
  "api_pubkey" => substr(WPEAccount::getApiPublicKey($bvsettings), 0, 8),
127
  "def_sigmatch" => substr(WPEAccount::getSigMatch($request, WPERecover::getDefaultSecret($bvsettings)), 0, 8)