| @@ -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.53 | |
| 8 | +Version: 4.97 | |
| 9 | 9 | Network: True |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | /* Copyright 2017 WP Remote (email : support@wpremote.com) |
| @@ -36,9 +36,8 @@ | ||
| 36 | 36 | require_once dirname( __FILE__ ) . '/wp_api.php'; |
| 37 | 37 | require_once dirname( __FILE__ ) . '/wp_actions.php'; |
| 38 | 38 | require_once dirname( __FILE__ ) . '/info.php'; |
| 39 | 39 | require_once dirname( __FILE__ ) . '/account.php'; |
| 40 | -require_once dirname( __FILE__ ) . '/helper.php'; | |
| 41 | 40 | ##WPCACHEMODULE## |
| 42 | 41 | |
| 43 | 42 | |
| 44 | 43 | $bvsettings = new WPRWPSettings(); |
| @@ -64,9 +63,9 @@ | ||
| 64 | 63 | if (is_admin()) { |
| 65 | 64 | require_once dirname( __FILE__ ) . '/wp_admin.php'; |
| 66 | 65 | $wpadmin = new WPRWPAdmin($bvsettings, $bvsiteinfo); |
| 67 | 66 | add_action('admin_init', array($wpadmin, 'initHandler')); |
| 68 | - add_filter('all_plugins', array($wpadmin, 'initWhitelabel')); | |
| 67 | + add_filter('all_plugins', array($wpadmin, 'initBranding')); | |
| 69 | 68 | add_filter('plugin_row_meta', array($wpadmin, 'hidePluginDetails'), 10, 2); |
| 70 | 69 | add_filter('debug_information', array($wpadmin, 'handlePluginHealthInfo'), 10, 1); |
| 71 | 70 | if ($bvsiteinfo->isMultisite()) { |
| 72 | 71 | add_action('network_admin_menu', array($wpadmin, 'menu')); |
| @@ -92,15 +91,8 @@ | ||
| 92 | 91 | $actlog = new BVWPActLog($bvdb, $bvsettings, $bvinfo, $bvconfig['activity_log']); |
| 93 | 92 | $actlog->init(); |
| 94 | 93 | } |
| 95 | 94 | |
| 96 | - if ($bvinfo->isServiceActive('maintenance_mode')) { | |
| 97 | - require_once dirname( __FILE__ ). '/maintenance/wp_maintenance.php'; | |
| 98 | - $bvconfig = $bvinfo->config; | |
| 99 | - $maintenance = new BVWPMaintenance($bvconfig['maintenance_mode']); | |
| 100 | - $maintenance->init(); | |
| 101 | - } | |
| 102 | - | |
| 103 | 95 | } |
| 104 | 96 | |
| 105 | 97 | if ((array_key_exists('bvplugname', $_REQUEST)) && ($_REQUEST['bvplugname'] == "wpremote")) { |
| 106 | 98 | require_once dirname( __FILE__ ) . '/callback/base.php'; |
| @@ -115,54 +107,58 @@ | ||
| 115 | 107 | } else { |
| 116 | 108 | $account = WPRAccount::find($bvsettings, $pubkey); |
| 117 | 109 | } |
| 118 | 110 | |
| 119 | - $request = new BVCallbackRequest($account, $_REQUEST, $bvsettings); | |
| 111 | + $request = new BVCallbackRequest($account, $_REQUEST); | |
| 120 | 112 | $response = new BVCallbackResponse($request->bvb64cksize); |
| 121 | 113 | |
| 122 | - if ($request->authenticate() === 1) { | |
| 123 | - if (array_key_exists('bv_ignr_frm_cptch', $_REQUEST)) { | |
| 124 | - #handling of Contact Forms 7 | |
| 125 | - add_filter('wpcf7_skip_spam_check', '__return_true', PHP_INT_MAX, 2); | |
| 114 | + if ($account && (1 === $account->authenticate($request))) { | |
| 115 | + define('WPRBASEPATH', plugin_dir_path(__FILE__)); | |
| 126 | 116 | |
| 127 | - #handling of Formidable plugin | |
| 128 | - add_filter('frm_is_field_hidden', '__return_true', PHP_INT_MAX, 3); | |
| 129 | 117 | |
| 130 | - #handling of WP Forms plugin | |
| 131 | - add_filter('wpforms_process_bypass_captcha', '__return_true', PHP_INT_MAX, 3); | |
| 118 | + require_once dirname( __FILE__ ) . '/callback/handler.php'; | |
| 119 | + | |
| 120 | + $params = $request->processParams($_REQUEST); | |
| 121 | + if ($params === false) { | |
| 122 | + $resp = array( | |
| 123 | + "account_info" => $account->info(), | |
| 124 | + "request_info" => $request->info(), | |
| 125 | + "bvinfo" => $bvinfo->info(), | |
| 126 | + "statusmsg" => "BVPRMS_CORRUPTED" | |
| 127 | + ); | |
| 128 | + $response->terminate($resp); | |
| 129 | + } | |
| 130 | + $request->params = $params; | |
| 131 | + $callback_handler = new BVCallbackHandler($bvdb, $bvsettings, $bvsiteinfo, $request, $account, $response); | |
| 132 | + if ($request->is_afterload) { | |
| 133 | + add_action('wp_loaded', array($callback_handler, 'execute')); | |
| 134 | + } else if ($request->is_admin_ajax) { | |
| 135 | + add_action('wp_ajax_bvadm', array($callback_handler, 'bvAdmExecuteWithUser')); | |
| 136 | + add_action('wp_ajax_nopriv_bvadm', array($callback_handler, 'bvAdmExecuteWithoutUser')); | |
| 132 | 137 | } else { |
| 133 | - define('WPRBASEPATH', plugin_dir_path(__FILE__)); | |
| 134 | - | |
| 135 | - | |
| 136 | - require_once dirname( __FILE__ ) . '/callback/handler.php'; | |
| 137 | - | |
| 138 | - $params = $request->processParams($_REQUEST); | |
| 139 | - if ($params === false) { | |
| 140 | - $response->terminate($request->corruptedParamsResp()); | |
| 141 | - } | |
| 142 | - $request->params = $params; | |
| 143 | - $callback_handler = new BVCallbackHandler($bvdb, $bvsettings, $bvsiteinfo, $request, $account, $response); | |
| 144 | - if ($request->is_afterload) { | |
| 145 | - add_action('wp_loaded', array($callback_handler, 'execute')); | |
| 146 | - } else if ($request->is_admin_ajax) { | |
| 147 | - add_action('wp_ajax_bvadm', array($callback_handler, 'bvAdmExecuteWithUser')); | |
| 148 | - add_action('wp_ajax_nopriv_bvadm', array($callback_handler, 'bvAdmExecuteWithoutUser')); | |
| 149 | - } else { | |
| 150 | - $callback_handler->execute(); | |
| 151 | - } | |
| 138 | + $callback_handler->execute(); | |
| 152 | 139 | } |
| 153 | 140 | } else { |
| 154 | - $response->terminate($request->authFailedResp()); | |
| 141 | + $resp = array( | |
| 142 | + "account_info" => $account ? $account->info() : array("error" => "ACCOUNT_NOT_FOUND"), | |
| 143 | + "request_info" => $request->info(), | |
| 144 | + "bvinfo" => $bvinfo->info(), | |
| 145 | + "statusmsg" => "FAILED_AUTH", | |
| 146 | + "api_pubkey" => substr(WPRAccount::getApiPublicKey($bvsettings), 0, 8), | |
| 147 | + "def_sigmatch" => substr(WPRAccount::getSigMatch($request, WPRRecover::getDefaultSecret($bvsettings)), 0, 8) | |
| 148 | + ); | |
| 149 | + $response->terminate($resp); | |
| 155 | 150 | } |
| 156 | 151 | } else { |
| 157 | 152 | if ($bvinfo->hasValidDBVersion()) { |
| 158 | 153 | if ($bvinfo->isProtectModuleEnabled()) { |
| 159 | - require_once dirname( __FILE__ ) . '/protect/protect.php'; | |
| 160 | - add_action('clear_pt_config', array('WPRProtect_V553', 'uninstall')); | |
| 161 | - if ($bvinfo->isActivePlugin() && !(defined( 'WP_CLI' ) && WP_CLI)) { | |
| 162 | - WPRProtect_V553::init(WPRProtect_V553::MODE_WP); | |
| 163 | - } | |
| 154 | + require_once dirname( __FILE__ ) . '/protect/wp/protect.php'; | |
| 155 | + $bvprotect = new BVProtect($bvdb, $bvsettings); | |
| 156 | + $bvprotect->init(); | |
| 157 | + if ($bvinfo->isActivePlugin() && !(defined( 'WP_CLI' ) && WP_CLI)) { | |
| 158 | + $bvprotect->run(); | |
| 164 | 159 | } |
| 160 | + } | |
| 165 | 161 | |
| 166 | 162 | if ($bvinfo->isDynSyncModuleEnabled()) { |
| 167 | 163 | require_once dirname( __FILE__ ) . '/wp_dynsync.php'; |
| 168 | 164 | $bvconfig = $bvinfo->config; |
| @@ -195,6 +191,5 @@ | ||
| 195 | 191 | if (is_admin()) { |
| 196 | 192 | add_filter('site_transient_update_plugins', array($wpadmin, 'hidePluginUpdate')); |
| 197 | 193 | } |
| 198 | 194 | |
| 199 | - ##THIRDPARTYCACHINGMODULE## | |
| 200 | 195 | } |