PluginProbe
The WP Remote WordPress Plugin / 5.72
The WP Remote WordPress Plugin v5.72
6.72 6.69 6.65 6.62 6.48 6.47 4.87 4.97 5.05 5.09 5.16 5.22 5.24 5.25 5.38 5.41 5.42 5.45 5.47 5.53 5.56 5.65 5.68 5.72 5.73 All 53 releases
wpremote / plugin.php

plugin.php in The WP Remote WordPress Plugin 5.72, at plugin.php

238 lines 8.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: WP Remote
4 Plugin URI: https://wpremote.com
5 Description: Manage your WordPress site with <a href="https://wpremote.com/">WP Remote</a>.
6 Author: WP Remote
7 Author URI: https://wpremote.com
8 Version: 5.72
9 Network: True
10 */
11
12 /* Copyright 2017 WP Remote (email : support@wpremote.com)
13
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License, version 2, as
16 published by the Free Software Foundation.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 */
27
28 /* Global response array */
29
30 if (!defined('ABSPATH')) exit;
31 ##OLDWPR##
32
33 require_once dirname( __FILE__ ) . '/wp_settings.php';
34 require_once dirname( __FILE__ ) . '/wp_site_info.php';
35 require_once dirname( __FILE__ ) . '/wp_db.php';
36 require_once dirname( __FILE__ ) . '/wp_api.php';
37 require_once dirname( __FILE__ ) . '/wp_actions.php';
38 require_once dirname( __FILE__ ) . '/info.php';
39 require_once dirname( __FILE__ ) . '/account.php';
40 require_once dirname( __FILE__ ) . '/helper.php';
41 require_once dirname( __FILE__ ) . '/wp_2fa/wp_2fa.php';
42
43 ##WPCACHEMODULE##
44
45
46 $bvsettings = new WPRWPSettings();
47 $bvsiteinfo = new WPRWPSiteInfo();
48 $bvdb = new WPRWPDb();
49
50
51 $bvapi = new WPRWPAPI($bvsettings);
52 $bvinfo = new WPRInfo($bvsettings);
53 $wp_action = new WPRWPAction($bvsettings, $bvsiteinfo, $bvapi);
54
55 register_uninstall_hook(__FILE__, array('WPRWPAction', 'uninstall'));
56 register_activation_hook(__FILE__, array($wp_action, 'activate'));
57 register_deactivation_hook(__FILE__, array($wp_action, 'deactivate'));
58
59 add_action('wp_footer', array($wp_action, 'footerHandler'), 100);
60 add_action('wpr_clear_bv_services_config', array($wp_action, 'clear_bv_services_config'));
61 ##SOADDUNINSTALLACTION##
62
63 ##DISABLE_OTHER_OPTIMIZATION_PLUGINS##
64
65 ##WPCLIMODULE##
66 if (is_admin()) {
67 require_once dirname( __FILE__ ) . '/wp_admin.php';
68 $wpadmin = new WPRWPAdmin($bvsettings, $bvsiteinfo);
69 add_action('admin_init', array($wpadmin, 'initHandler'));
70 add_filter('all_plugins', array($wpadmin, 'initWhitelabel'));
71 add_filter('plugin_row_meta', array($wpadmin, 'hidePluginDetails'), 10, 2);
72 add_filter('debug_information', array($wpadmin, 'handlePluginHealthInfo'), 10, 1);
73 if ($bvsiteinfo->isMultisite()) {
74 add_action('network_admin_menu', array($wpadmin, 'menu'));
75 } else {
76 add_action('admin_menu', array($wpadmin, 'menu'));
77 }
78 add_filter('plugin_action_links', array($wpadmin, 'settingsLink'), 10, 2);
79 add_action('admin_head', array($wpadmin, 'removeAdminNotices'), 3);
80 add_action('admin_notices', array($wpadmin, 'activateWarning'));
81 add_action('admin_enqueue_scripts', array($wpadmin, 'wprsecAdminMenu'));
82 ##ALPURGECACHEFUNCTION##
83 ##ALADMINMENU##
84 }
85
86 if ((array_key_exists('bvreqmerge', $_POST)) || (array_key_exists('bvreqmerge', $_GET))) {
87 $_REQUEST = array_merge($_GET, $_POST);
88 }
89
90 #Service active check
91 if ($bvinfo->config != false) {
92 add_action('wpr_remove_bv_preload_include', array($wp_action, 'removeBVPreload'));
93 }
94
95 require_once dirname( __FILE__ ) . '/php_error_monitoring/monitoring.php';
96 WPRWPPHPErrorMonitoring::init();
97
98 if ($bvinfo->hasValidDBVersion()) {
99 if ($bvinfo->isServiceActive('activity_log')) {
100 require_once dirname( __FILE__ ) . '/wp_actlog.php';
101 $bvconfig = $bvinfo->config;
102 $actlog = new BVWPActLog($bvdb, $bvsettings, $bvinfo, $bvconfig['activity_log']);
103 $actlog->init();
104 }
105
106 if ($bvinfo->isServiceActive('maintenance_mode')) {
107 require_once dirname( __FILE__ ). '/maintenance/wp_maintenance.php';
108 $bvconfig = $bvinfo->config;
109 $maintenance = new BVWPMaintenance($bvconfig['maintenance_mode']);
110 $maintenance->init();
111 }
112
113 }
114
115 if ((array_key_exists('bvplugname', $_REQUEST)) && ($_REQUEST['bvplugname'] == "wpremote")) {
116 require_once dirname( __FILE__ ) . '/callback/base.php';
117 require_once dirname( __FILE__ ) . '/callback/response.php';
118 require_once dirname( __FILE__ ) . '/callback/request.php';
119 require_once dirname( __FILE__ ) . '/recover.php';
120
121 $pubkey = WPRAccount::sanitizeKey($_REQUEST['pubkey']);
122
123 if (array_key_exists('rcvracc', $_REQUEST)) {
124 $account = WPRRecover::find($bvsettings, $pubkey);
125 } else {
126 $account = WPRAccount::find($bvsettings, $pubkey);
127 }
128
129 $request = new BVCallbackRequest($account, $_REQUEST, $bvsettings);
130 $response = new BVCallbackResponse($request->bvb64cksize);
131
132 if ($request->authenticate() === 1) {
133 if (array_key_exists('bv_ignr_frm_cptch', $_REQUEST)) {
134 #handling of Contact Forms 7
135 add_filter('wpcf7_skip_spam_check', '__return_true', PHP_INT_MAX, 2);
136
137 #handling of Formidable plugin
138 add_filter('frm_is_field_hidden', '__return_true', PHP_INT_MAX, 3);
139
140 #handling of WP Forms plugin
141 add_filter('wpforms_process_bypass_captcha', '__return_true', PHP_INT_MAX, 3);
142
143 #handling of Forminator plugin
144 if (defined('WP_PLUGIN_DIR')) {
145 $abstractFrontActionFilePath = WP_PLUGIN_DIR . '/forminator/library/abstracts/abstract-class-front-action.php';
146 $frontActionFilePath = WP_PLUGIN_DIR . '/forminator/library/modules/custom-forms/front/front-action.php';
147
148 if (file_exists($abstractFrontActionFilePath) && file_exists($frontActionFilePath)) {
149 require_once $abstractFrontActionFilePath;
150 require_once $frontActionFilePath;
151 if (class_exists('Forminator_CForm_Front_Action')) {
152 Forminator_CForm_Front_Action::$hidden_fields[] = "bv-stripe-";
153 }
154 }
155 }
156
157 #handling of CleanTalk Antispam plugin
158 add_action('init', function() {
159 global $apbct;
160 if (isset($apbct) && is_object($apbct)) {
161 $apbct->settings['forms__contact_forms_test'] = 0;
162 }
163 });
164 } else {
165 define('WPRBASEPATH', plugin_dir_path(__FILE__));
166
167
168 require_once dirname( __FILE__ ) . '/callback/handler.php';
169
170 $params = $request->processParams($_REQUEST);
171 if ($params === false) {
172 $response->terminate($request->corruptedParamsResp());
173 }
174 $request->params = $params;
175 $callback_handler = new BVCallbackHandler($bvdb, $bvsettings, $bvsiteinfo, $request, $account, $response);
176 if ($request->is_afterload) {
177 add_action('wp_loaded', array($callback_handler, 'execute'));
178 } else if ($request->is_admin_ajax) {
179 add_action('wp_ajax_bvadm', array($callback_handler, 'bvAdmExecuteWithUser'));
180 add_action('wp_ajax_nopriv_bvadm', array($callback_handler, 'bvAdmExecuteWithoutUser'));
181 } else {
182 $callback_handler->execute();
183 }
184 }
185 } else {
186 $response->terminate($request->authFailedResp());
187 }
188 } else {
189 if ($bvinfo->hasValidDBVersion()) {
190 if ($bvinfo->isProtectModuleEnabled()) {
191 require_once dirname( __FILE__ ) . '/protect/protect.php';
192 //For backward compatibility.
193 WPRProtect_V572::$settings = new WPRWPSettings();
194 WPRProtect_V572::$db = new WPRWPDb();
195 WPRProtect_V572::$info = new WPRInfo(WPRProtect_V572::$settings);
196
197 add_action('wpr_clear_pt_config', array('WPRProtect_V572', 'uninstall'));
198
199 if ($bvinfo->isActivePlugin()) {
200 WPRProtect_V572::init(WPRProtect_V572::MODE_WP);
201 }
202 }
203
204 if ($bvinfo->isDynSyncModuleEnabled()) {
205 require_once dirname( __FILE__ ) . '/wp_dynsync.php';
206 $bvconfig = $bvinfo->config;
207 $dynsync = new BVWPDynSync($bvdb, $bvsettings, $bvconfig['dynsync']);
208 $dynsync->init();
209 }
210
211 }
212 $bv_site_settings = $bvsettings->getOption('bv_site_settings');
213 if (isset($bv_site_settings)) {
214 if (isset($bv_site_settings['wp_auto_updates'])) {
215 $wp_auto_updates = $bv_site_settings['wp_auto_updates'];
216 if (array_key_exists('block_auto_update_core', $wp_auto_updates)) {
217 add_filter('auto_update_core', '__return_false' );
218 }
219 if (array_key_exists('block_auto_update_theme', $wp_auto_updates)) {
220 add_filter('auto_update_theme', '__return_false' );
221 add_filter('themes_auto_update_enabled', '__return_false' );
222 }
223 if (array_key_exists('block_auto_update_plugin', $wp_auto_updates)) {
224 add_filter('auto_update_plugin', '__return_false' );
225 add_filter('plugins_auto_update_enabled', '__return_false' );
226 }
227 if (array_key_exists('block_auto_update_translation', $wp_auto_updates)) {
228 add_filter('auto_update_translation', '__return_false' );
229 }
230 }
231 }
232
233 if (is_admin()) {
234 add_filter('site_transient_update_plugins', array($wpadmin, 'hidePluginUpdate'));
235 }
236
237 ##THIRDPARTYCACHINGMODULE##
238 }