| @@ -4,9 +4,9 @@ | ||
| 4 | 4 | Plugin URI: https://wpremote.com |
| 5 | 5 | Description: Manage your WordPress site with <a href="https://wpremote.com/">WP Remote</a>. |
| 6 | 6 | Author: WP Remote |
| 7 | 7 | Author URI: https://wpremote.com |
| 8 | -Version: 5.38 | |
| 8 | +Version: 5.09 | |
| 9 | 9 | Network: True |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | /* Copyright 2017 WP Remote (email : support@wpremote.com) |
| @@ -108,12 +108,12 @@ | ||
| 108 | 108 | } else { |
| 109 | 109 | $account = WPRAccount::find($bvsettings, $pubkey); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - $request = new BVCallbackRequest($account, $_REQUEST, $bvsettings); | |
| 112 | + $request = new BVCallbackRequest($account, $_REQUEST); | |
| 113 | 113 | $response = new BVCallbackResponse($request->bvb64cksize); |
| 114 | 114 | |
| 115 | - if ($request->authenticate() === 1) { | |
| 115 | + if ($account && (1 === $account->authenticate($request))) { | |
| 116 | 116 | define('WPRBASEPATH', plugin_dir_path(__FILE__)); |
| 117 | 117 | |
| 118 | 118 | |
| 119 | 119 | require_once dirname( __FILE__ ) . '/callback/handler.php'; |
| @@ -119,9 +119,15 @@ | ||
| 119 | 119 | require_once dirname( __FILE__ ) . '/callback/handler.php'; |
| 120 | 120 | |
| 121 | 121 | $params = $request->processParams($_REQUEST); |
| 122 | 122 | if ($params === false) { |
| 123 | - $response->terminate($request->corruptedParamsResp()); | |
| 123 | + $resp = array( | |
| 124 | + "account_info" => $account->info(), | |
| 125 | + "request_info" => $request->info(), | |
| 126 | + "bvinfo" => $bvinfo->info(), | |
| 127 | + "statusmsg" => "BVPRMS_CORRUPTED" | |
| 128 | + ); | |
| 129 | + $response->terminate($resp); | |
| 124 | 130 | } |
| 125 | 131 | $request->params = $params; |
| 126 | 132 | $callback_handler = new BVCallbackHandler($bvdb, $bvsettings, $bvsiteinfo, $request, $account, $response); |
| 127 | 133 | if ($request->is_afterload) { |
| @@ -132,19 +138,28 @@ | ||
| 132 | 138 | } else { |
| 133 | 139 | $callback_handler->execute(); |
| 134 | 140 | } |
| 135 | 141 | } else { |
| 136 | - $response->terminate($request->authFailedResp()); | |
| 142 | + $resp = array( | |
| 143 | + "account_info" => $account ? $account->info() : array("error" => "ACCOUNT_NOT_FOUND"), | |
| 144 | + "request_info" => $request->info(), | |
| 145 | + "bvinfo" => $bvinfo->info(), | |
| 146 | + "statusmsg" => "FAILED_AUTH", | |
| 147 | + "api_pubkey" => substr(WPRAccount::getApiPublicKey($bvsettings), 0, 8), | |
| 148 | + "def_sigmatch" => substr(WPRAccount::getSigMatch($request, WPRRecover::getDefaultSecret($bvsettings)), 0, 8) | |
| 149 | + ); | |
| 150 | + $response->terminate($resp); | |
| 137 | 151 | } |
| 138 | 152 | } else { |
| 139 | 153 | if ($bvinfo->hasValidDBVersion()) { |
| 140 | 154 | if ($bvinfo->isProtectModuleEnabled()) { |
| 141 | - require_once dirname( __FILE__ ) . '/protect/protect.php'; | |
| 142 | - add_action('clear_pt_config', array('MCProtect', 'uninstall')); | |
| 143 | - if ($bvinfo->isActivePlugin() && !(defined( 'WP_CLI' ) && WP_CLI)) { | |
| 144 | - MCProtect::init(MCProtect::MODE_WP); | |
| 145 | - } | |
| 155 | + require_once dirname( __FILE__ ) . '/protect/wp/protect.php'; | |
| 156 | + $bvprotect = new BVProtect($bvdb, $bvsettings); | |
| 157 | + $bvprotect->init(); | |
| 158 | + if ($bvinfo->isActivePlugin() && !(defined( 'WP_CLI' ) && WP_CLI)) { | |
| 159 | + $bvprotect->run(); | |
| 146 | 160 | } |
| 161 | + } | |
| 147 | 162 | |
| 148 | 163 | if ($bvinfo->isDynSyncModuleEnabled()) { |
| 149 | 164 | require_once dirname( __FILE__ ) . '/wp_dynsync.php'; |
| 150 | 165 | $bvconfig = $bvinfo->config; |
| @@ -177,6 +192,5 @@ | ||
| 177 | 192 | if (is_admin()) { |
| 178 | 193 | add_filter('site_transient_update_plugins', array($wpadmin, 'hidePluginUpdate')); |
| 179 | 194 | } |
| 180 | 195 | |
| 181 | - ##THIRDPARTYCACHINGMODULE## | |
| 182 | -} | |
| 196 | +} | |