function mainwp_upgradewp() { if (!mainwp_current_user_can("dashboard", "update_wordpress")) { die(json_encode(array('error' => mainwp_do_not_have_permissions("update Wordpress", $echo = false)))); } $this->secure_request('mainwp_upgradewp'); try { $id = null; if (isset($_POST['id'])) { $id = $_POST['id']; } die(json_encode(array('result' => MainWPRightNow::upgradeSite($id)))); } catch (MainWPException $e) { die(json_encode(array('error' => array('message' => $e->getMessage(), 'extra' => $e->getMessageExtra())))); } }