| @@ -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.16 | |
| 8 | +Version: 4.78 | |
| 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(); |
| @@ -57,10 +56,8 @@ | ||
| 57 | 56 | add_action('wp_footer', array($wp_action, 'footerHandler'), 100); |
| 58 | 57 | add_action('clear_bv_services_config', array($wp_action, 'clear_bv_services_config')); |
| 59 | 58 | ##SOADDUNINSTALLACTION## |
| 60 | 59 | |
| 61 | -##DISABLE_OTHER_OPTIMIZATION_PLUGINS## | |
| 62 | - | |
| 63 | 60 | ##WPCLIMODULE## |
| 64 | 61 | if (is_admin()) { |
| 65 | 62 | require_once dirname( __FILE__ ) . '/wp_admin.php'; |
| 66 | 63 | $wpadmin = new WPRWPAdmin($bvsettings, $bvsiteinfo); |
| @@ -66,9 +63,8 @@ | ||
| 66 | 63 | $wpadmin = new WPRWPAdmin($bvsettings, $bvsiteinfo); |
| 67 | 64 | add_action('admin_init', array($wpadmin, 'initHandler')); |
| 68 | 65 | add_filter('all_plugins', array($wpadmin, 'initBranding')); |
| 69 | 66 | add_filter('plugin_row_meta', array($wpadmin, 'hidePluginDetails'), 10, 2); |
| 70 | - add_filter('debug_information', array($wpadmin, 'handlePluginHealthInfo'), 10, 1); | |
| 71 | 67 | if ($bvsiteinfo->isMultisite()) { |
| 72 | 68 | add_action('network_admin_menu', array($wpadmin, 'menu')); |
| 73 | 69 | } else { |
| 74 | 70 | add_action('admin_menu', array($wpadmin, 'menu')); |
| @@ -76,26 +72,16 @@ | ||
| 76 | 72 | add_filter('plugin_action_links', array($wpadmin, 'settingsLink'), 10, 2); |
| 77 | 73 | add_action('admin_head', array($wpadmin, 'removeAdminNotices'), 3); |
| 78 | 74 | add_action('admin_notices', array($wpadmin, 'activateWarning')); |
| 79 | 75 | add_action('admin_enqueue_scripts', array($wpadmin, 'wprsecAdminMenu')); |
| 80 | - ##ALPURGECACHEFUNCTION## | |
| 81 | - ##ALADMINMENU## | |
| 76 | + ##SOADMINMENU## | |
| 82 | 77 | } |
| 83 | 78 | |
| 79 | + | |
| 84 | 80 | if ((array_key_exists('bvreqmerge', $_POST)) || (array_key_exists('bvreqmerge', $_GET))) { |
| 85 | 81 | $_REQUEST = array_merge($_GET, $_POST); |
| 86 | 82 | } |
| 87 | 83 | |
| 88 | -if ($bvinfo->hasValidDBVersion()) { | |
| 89 | - if ($bvinfo->isServiceActive('activity_log')) { | |
| 90 | - require_once dirname( __FILE__ ) . '/wp_actlog.php'; | |
| 91 | - $bvconfig = $bvinfo->config; | |
| 92 | - $actlog = new BVWPActLog($bvdb, $bvsettings, $bvinfo, $bvconfig['activity_log']); | |
| 93 | - $actlog->init(); | |
| 94 | - } | |
| 95 | - | |
| 96 | -} | |
| 97 | - | |
| 98 | 84 | if ((array_key_exists('bvplugname', $_REQUEST)) && ($_REQUEST['bvplugname'] == "wpremote")) { |
| 99 | 85 | require_once dirname( __FILE__ ) . '/callback/base.php'; |
| 100 | 86 | require_once dirname( __FILE__ ) . '/callback/response.php'; |
| 101 | 87 | require_once dirname( __FILE__ ) . '/callback/request.php'; |
| @@ -108,12 +94,12 @@ | ||
| 108 | 94 | } else { |
| 109 | 95 | $account = WPRAccount::find($bvsettings, $pubkey); |
| 110 | 96 | } |
| 111 | 97 | |
| 112 | - $request = new BVCallbackRequest($account, $_REQUEST, $bvsettings); | |
| 98 | + $request = new BVCallbackRequest($account, $_REQUEST); | |
| 113 | 99 | $response = new BVCallbackResponse($request->bvb64cksize); |
| 114 | 100 | |
| 115 | - if ($request->authenticate() === 1) { | |
| 101 | + if ($account && (1 === $account->authenticate($request))) { | |
| 116 | 102 | define('WPRBASEPATH', plugin_dir_path(__FILE__)); |
| 117 | 103 | |
| 118 | 104 | |
| 119 | 105 | require_once dirname( __FILE__ ) . '/callback/handler.php'; |
| @@ -119,9 +105,15 @@ | ||
| 119 | 105 | require_once dirname( __FILE__ ) . '/callback/handler.php'; |
| 120 | 106 | |
| 121 | 107 | $params = $request->processParams($_REQUEST); |
| 122 | 108 | if ($params === false) { |
| 123 | - $response->terminate($request->corruptedParamsResp()); | |
| 109 | + $resp = array( | |
| 110 | + "account_info" => $account->info(), | |
| 111 | + "request_info" => $request->info(), | |
| 112 | + "bvinfo" => $bvinfo->info(), | |
| 113 | + "statusmsg" => "BVPRMS_CORRUPTED" | |
| 114 | + ); | |
| 115 | + $response->terminate($resp); | |
| 124 | 116 | } |
| 125 | 117 | $request->params = $params; |
| 126 | 118 | $callback_handler = new BVCallbackHandler($bvdb, $bvsettings, $bvsiteinfo, $request, $account, $response); |
| 127 | 119 | if ($request->is_afterload) { |
| @@ -132,9 +124,17 @@ | ||
| 132 | 124 | } else { |
| 133 | 125 | $callback_handler->execute(); |
| 134 | 126 | } |
| 135 | 127 | } else { |
| 136 | - $response->terminate($request->authFailedResp()); | |
| 128 | + $resp = array( | |
| 129 | + "account_info" => $account ? $account->info() : array("error" => "ACCOUNT_NOT_FOUND"), | |
| 130 | + "request_info" => $request->info(), | |
| 131 | + "bvinfo" => $bvinfo->info(), | |
| 132 | + "statusmsg" => "FAILED_AUTH", | |
| 133 | + "api_pubkey" => substr(WPRAccount::getApiPublicKey($bvsettings), 0, 8), | |
| 134 | + "def_sigmatch" => substr(WPRAccount::getSigMatch($request, WPRRecover::getDefaultSecret($bvsettings)), 0, 8) | |
| 135 | + ); | |
| 136 | + $response->terminate($resp); | |
| 137 | 137 | } |
| 138 | 138 | } else { |
| 139 | 139 | if ($bvinfo->hasValidDBVersion()) { |
| 140 | 140 | if ($bvinfo->isProtectModuleEnabled()) { |
| @@ -152,9 +152,16 @@ | ||
| 152 | 152 | $dynsync = new BVWPDynSync($bvdb, $bvsettings, $bvconfig['dynsync']); |
| 153 | 153 | $dynsync->init(); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | + if ($bvinfo->isServiceActive('activity_log')) { | |
| 157 | + require_once dirname( __FILE__ ) . '/wp_actlog.php'; | |
| 158 | + $bvconfig = $bvinfo->config; | |
| 159 | + $actlog = new BVWPActLog($bvdb, $bvsettings, $bvinfo, $bvconfig['activity_log']); | |
| 160 | + $actlog->init(); | |
| 156 | 161 | } |
| 162 | + | |
| 163 | + } | |
| 157 | 164 | $bv_site_settings = $bvsettings->getOption('bv_site_settings'); |
| 158 | 165 | if (isset($bv_site_settings)) { |
| 159 | 166 | if (isset($bv_site_settings['wp_auto_updates'])) { |
| 160 | 167 | $wp_auto_updates = $bv_site_settings['wp_auto_updates']; |
| @@ -172,11 +179,7 @@ | ||
| 172 | 179 | if (array_key_exists('block_auto_update_translation', $wp_auto_updates)) { |
| 173 | 180 | add_filter('auto_update_translation', '__return_false' ); |
| 174 | 181 | } |
| 175 | 182 | } |
| 176 | - } | |
| 177 | - | |
| 178 | - if (is_admin()) { | |
| 179 | - add_filter('site_transient_update_plugins', array($wpadmin, 'hidePluginUpdate')); | |
| 180 | 183 | } |
| 181 | 184 | |
| 182 | 185 | } |