PluginProbe
The WP Remote WordPress Plugin / 5.68
The WP Remote WordPress Plugin v5.68
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.68, at plugin.php

231 lines 8.2 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.68
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 ##WPCACHEMODULE##
42
43
44 $bvsettings = new WPRWPSettings();
45 $bvsiteinfo = new WPRWPSiteInfo();
46 $bvdb = new WPRWPDb();
47
48
49 $bvapi = new WPRWPAPI($bvsettings);
50 $bvinfo = new WPRInfo($bvsettings);
51 $wp_action = new WPRWPAction($bvsettings, $bvsiteinfo, $bvapi);
52
53 register_uninstall_hook(__FILE__, array('WPRWPAction', 'uninstall'));
54 register_activation_hook(__FILE__, array($wp_action, 'activate'));
55 register_deactivation_hook(__FILE__, array($wp_action, 'deactivate'));
56
57 add_action('wp_footer', array($wp_action, 'footerHandler'), 100);
58 add_action('clear_bv_services_config', array($wp_action, 'clear_bv_services_config'));
59 ##SOADDUNINSTALLACTION##
60
61 ##DISABLE_OTHER_OPTIMIZATION_PLUGINS##
62
63 ##WPCLIMODULE##
64 if (is_admin()) {
65 require_once dirname( __FILE__ ) . '/wp_admin.php';
66 $wpadmin = new WPRWPAdmin($bvsettings, $bvsiteinfo);
67 add_action('admin_init', array($wpadmin, 'initHandler'));
68 add_filter('all_plugins', array($wpadmin, 'initWhitelabel'));
69 add_filter('plugin_row_meta', array($wpadmin, 'hidePluginDetails'), 10, 2);
70 add_filter('debug_information', array($wpadmin, 'handlePluginHealthInfo'), 10, 1);
71 if ($bvsiteinfo->isMultisite()) {
72 add_action('network_admin_menu', array($wpadmin, 'menu'));
73 } else {
74 add_action('admin_menu', array($wpadmin, 'menu'));
75 }
76 add_filter('plugin_action_links', array($wpadmin, 'settingsLink'), 10, 2);
77 add_action('admin_head', array($wpadmin, 'removeAdminNotices'), 3);
78 add_action('admin_notices', array($wpadmin, 'activateWarning'));
79 add_action('admin_enqueue_scripts', array($wpadmin, 'wprsecAdminMenu'));
80 ##ALPURGECACHEFUNCTION##
81 ##ALADMINMENU##
82 }
83
84 if ((array_key_exists('bvreqmerge', $_POST)) || (array_key_exists('bvreqmerge', $_GET))) {
85 $_REQUEST = array_merge($_GET, $_POST);
86 }
87
88 require_once dirname( __FILE__ ) . '/php_error_monitoring/monitoring.php';
89 WPRWPPHPErrorMonitoring::init();
90
91 if ($bvinfo->hasValidDBVersion()) {
92 if ($bvinfo->isServiceActive('activity_log')) {
93 require_once dirname( __FILE__ ) . '/wp_actlog.php';
94 $bvconfig = $bvinfo->config;
95 $actlog = new BVWPActLog($bvdb, $bvsettings, $bvinfo, $bvconfig['activity_log']);
96 $actlog->init();
97 }
98
99 if ($bvinfo->isServiceActive('maintenance_mode')) {
100 require_once dirname( __FILE__ ). '/maintenance/wp_maintenance.php';
101 $bvconfig = $bvinfo->config;
102 $maintenance = new BVWPMaintenance($bvconfig['maintenance_mode']);
103 $maintenance->init();
104 }
105
106 }
107
108 if ((array_key_exists('bvplugname', $_REQUEST)) && ($_REQUEST['bvplugname'] == "wpremote")) {
109 require_once dirname( __FILE__ ) . '/callback/base.php';
110 require_once dirname( __FILE__ ) . '/callback/response.php';
111 require_once dirname( __FILE__ ) . '/callback/request.php';
112 require_once dirname( __FILE__ ) . '/recover.php';
113
114 $pubkey = WPRAccount::sanitizeKey($_REQUEST['pubkey']);
115
116 if (array_key_exists('rcvracc', $_REQUEST)) {
117 $account = WPRRecover::find($bvsettings, $pubkey);
118 } else {
119 $account = WPRAccount::find($bvsettings, $pubkey);
120 }
121
122 $request = new BVCallbackRequest($account, $_REQUEST, $bvsettings);
123 $response = new BVCallbackResponse($request->bvb64cksize);
124
125 if ($request->authenticate() === 1) {
126 if (array_key_exists('bv_ignr_frm_cptch', $_REQUEST)) {
127 #handling of Contact Forms 7
128 add_filter('wpcf7_skip_spam_check', '__return_true', PHP_INT_MAX, 2);
129
130 #handling of Formidable plugin
131 add_filter('frm_is_field_hidden', '__return_true', PHP_INT_MAX, 3);
132
133 #handling of WP Forms plugin
134 add_filter('wpforms_process_bypass_captcha', '__return_true', PHP_INT_MAX, 3);
135
136 #handling of Forminator plugin
137 if (defined('WP_PLUGIN_DIR')) {
138 $abstractFrontActionFilePath = WP_PLUGIN_DIR . '/forminator/library/abstracts/abstract-class-front-action.php';
139 $frontActionFilePath = WP_PLUGIN_DIR . '/forminator/library/modules/custom-forms/front/front-action.php';
140
141 if (file_exists($abstractFrontActionFilePath) && file_exists($frontActionFilePath)) {
142 require_once $abstractFrontActionFilePath;
143 require_once $frontActionFilePath;
144 if (class_exists('Forminator_CForm_Front_Action')) {
145 Forminator_CForm_Front_Action::$hidden_fields[] = "bv-stripe-";
146 }
147 }
148 }
149
150 #handling of CleanTalk Antispam plugin
151 add_action('init', function() {
152 global $apbct;
153 if (isset($apbct) && is_object($apbct)) {
154 $apbct->settings['forms__contact_forms_test'] = 0;
155 }
156 });
157 } else {
158 define('WPRBASEPATH', plugin_dir_path(__FILE__));
159
160
161 require_once dirname( __FILE__ ) . '/callback/handler.php';
162
163 $params = $request->processParams($_REQUEST);
164 if ($params === false) {
165 $response->terminate($request->corruptedParamsResp());
166 }
167 $request->params = $params;
168 $callback_handler = new BVCallbackHandler($bvdb, $bvsettings, $bvsiteinfo, $request, $account, $response);
169 if ($request->is_afterload) {
170 add_action('wp_loaded', array($callback_handler, 'execute'));
171 } else if ($request->is_admin_ajax) {
172 add_action('wp_ajax_bvadm', array($callback_handler, 'bvAdmExecuteWithUser'));
173 add_action('wp_ajax_nopriv_bvadm', array($callback_handler, 'bvAdmExecuteWithoutUser'));
174 } else {
175 $callback_handler->execute();
176 }
177 }
178 } else {
179 $response->terminate($request->authFailedResp());
180 }
181 } else {
182 if ($bvinfo->hasValidDBVersion()) {
183 if ($bvinfo->isProtectModuleEnabled()) {
184 require_once dirname( __FILE__ ) . '/protect/protect.php';
185 //For backward compatibility.
186 WPRProtect_V568::$settings = new WPRWPSettings();
187 WPRProtect_V568::$db = new WPRWPDb();
188 WPRProtect_V568::$info = new WPRInfo(WPRProtect_V568::$settings);
189
190 add_action('clear_pt_config', array('WPRProtect_V568', 'uninstall'));
191
192 if ($bvinfo->isActivePlugin()) {
193 WPRProtect_V568::init(WPRProtect_V568::MODE_WP);
194 }
195 }
196
197 if ($bvinfo->isDynSyncModuleEnabled()) {
198 require_once dirname( __FILE__ ) . '/wp_dynsync.php';
199 $bvconfig = $bvinfo->config;
200 $dynsync = new BVWPDynSync($bvdb, $bvsettings, $bvconfig['dynsync']);
201 $dynsync->init();
202 }
203
204 }
205 $bv_site_settings = $bvsettings->getOption('bv_site_settings');
206 if (isset($bv_site_settings)) {
207 if (isset($bv_site_settings['wp_auto_updates'])) {
208 $wp_auto_updates = $bv_site_settings['wp_auto_updates'];
209 if (array_key_exists('block_auto_update_core', $wp_auto_updates)) {
210 add_filter('auto_update_core', '__return_false' );
211 }
212 if (array_key_exists('block_auto_update_theme', $wp_auto_updates)) {
213 add_filter('auto_update_theme', '__return_false' );
214 add_filter('themes_auto_update_enabled', '__return_false' );
215 }
216 if (array_key_exists('block_auto_update_plugin', $wp_auto_updates)) {
217 add_filter('auto_update_plugin', '__return_false' );
218 add_filter('plugins_auto_update_enabled', '__return_false' );
219 }
220 if (array_key_exists('block_auto_update_translation', $wp_auto_updates)) {
221 add_filter('auto_update_translation', '__return_false' );
222 }
223 }
224 }
225
226 if (is_admin()) {
227 add_filter('site_transient_update_plugins', array($wpadmin, 'hidePluginUpdate'));
228 }
229
230 ##THIRDPARTYCACHINGMODULE##
231 }