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