PluginProbe
The WP Remote WordPress Plugin / 4.74
The WP Remote WordPress Plugin v4.74
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
← All changes | callback/handler.php +17 -90 6.724.74 View file →
@@ -1,10 +1,10 @@
1 1 <?php
2 2
3 3 if (!defined('ABSPATH')) exit;
4 -if (!class_exists('WPRCallbackHandler')) :
4 +if (!class_exists('BVCallbackHandler')) :
5 5
6 - class WPRCallbackHandler {
6 + class BVCallbackHandler {
7 7 public $db;
8 8 public $settings;
9 9 public $siteinfo;
10 10 public $request;
@@ -30,13 +30,8 @@
30 30 $this->execute(array("bvadmwithuser" => true));
31 31 }
32 32
33 33 public function execute($resp = array()) {
34 - $params = $this->request->params;
35 - if (array_key_exists('disable_global_cache', $params)) {
36 - $GLOBALS['_wp_using_ext_object_cache'] = false;
37 - }
38 -
39 34 $this->routeRequest();
40 35 $resp = array(
41 36 "request_info" => $this->request->info(),
42 37 "site_info" => $this->siteinfo->info(),
@@ -46,133 +41,65 @@
46 41 );
47 42 $this->response->terminate($resp);
48 43 }
49 44
50 - public function deferExecutionUntilShutdown() {
51 - if (function_exists('error_clear_last')) {
52 - error_clear_last();
53 - }
54 - ob_start();
55 - remove_action('shutdown', 'wp_ob_end_flush_all', 1);
56 - add_action('shutdown', array($this, 'scheduleExecutionAfterShutdown'), PHP_INT_MAX);
57 - }
58 -
59 - public function scheduleExecutionAfterShutdown() {
60 - register_shutdown_function(array($this, 'executeAfterShutdown'));
61 - }
62 -
63 - public function executeAfterShutdown() {
64 - if ($this->request->keep_page_output) {
65 - $this->removeContentLengthHeader();
66 - $this->execute();
67 - return;
68 - }
69 - if ($this->shouldPreserveFrontendResponse()) {
70 - return;
71 - }
72 - $this->discardBufferedOutput();
73 - $this->clearFrontendResponseHeaders();
74 - $this->execute();
75 - }
76 -
77 - private function shouldPreserveFrontendResponse() {
78 - if ($this->hasFatalError() || headers_sent()) {
79 - return true;
80 - }
81 - if (!function_exists('http_response_code')) {
82 - return false;
83 - }
84 - $response_code = http_response_code();
85 - return $response_code !== false && $response_code !== 200;
86 - }
87 -
88 - private function hasFatalError() {
89 - $error = error_get_last();
90 - $fatal_types = array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR);
91 - return is_array($error) && in_array($error['type'], $fatal_types, true);
92 - }
93 -
94 - private function discardBufferedOutput() {
95 - while (ob_get_level() > 0) {
96 - if (!@ob_end_clean()) {
97 - break;
98 - }
99 - }
100 - }
101 -
102 - private function clearFrontendResponseHeaders() {
103 - $this->removeContentLengthHeader();
104 - header_remove('Content-Encoding');
105 - header_remove('Location');
106 - }
107 -
108 - private function removeContentLengthHeader() {
109 - if (!headers_sent()) {
110 - header_remove('Content-Length');
111 - }
112 - }
113 -
114 45 public function routeRequest() {
115 46 switch ($this->request->wing) {
116 47 case 'manage':
117 48 require_once dirname( __FILE__ ) . '/wings/manage.php';
118 - $module = new WPRManageCallback($this);
49 + $module = new BVManageCallback($this);
119 50 break;
120 51 case 'fs':
121 52 require_once dirname( __FILE__ ) . '/wings/fs.php';
122 - $module = new WPRFSCallback($this);
53 + $module = new BVFSCallback($this);
123 54 break;
124 55 case 'db':
125 56 require_once dirname( __FILE__ ) . '/wings/db.php';
126 - $module = new WPRDBCallback($this);
57 + $module = new BVDBCallback($this);
127 58 break;
128 59 case 'info':
129 60 require_once dirname( __FILE__ ) . '/wings/info.php';
130 - $module = new WPRInfoCallback($this);
61 + $module = new BVInfoCallback($this);
131 62 break;
132 63 case 'dynsync':
133 64 require_once dirname( __FILE__ ) . '/wings/dynsync.php';
134 - $module = new WPRDynSyncCallback($this);
65 + $module = new BVDynSyncCallback($this);
135 66 break;
136 67 case 'ipstr':
137 68 require_once dirname( __FILE__ ) . '/wings/ipstore.php';
138 - $module = new WPRIPStoreCallback($this);
69 + $module = new BVIPStoreCallback($this);
139 70 break;
140 71 case 'wtch':
141 72 require_once dirname( __FILE__ ) . '/wings/watch.php';
142 - $module = new WPRWatchCallback($this);
73 + $module = new BVWatchCallback($this);
143 74 break;
144 75 case 'brand':
145 76 require_once dirname( __FILE__ ) . '/wings/brand.php';
146 - $module = new WPRBrandCallback($this);
77 + $module = new BVBrandCallback($this);
147 78 break;
148 79 case 'pt':
149 80 require_once dirname( __FILE__ ) . '/wings/protect.php';
150 - $module = new WPRProtectCallback($this);
81 + $module = new BVProtectCallback($this);
151 82 break;
152 83 case 'act':
153 84 require_once dirname( __FILE__ ) . '/wings/account.php';
154 - $module = new WPRAccountCallback($this);
85 + $module = new BVAccountCallback($this);
155 86 break;
156 87 case 'fswrt':
157 88 require_once dirname( __FILE__ ) . '/wings/fs_write.php';
158 - $module = new WPRFSWriteCallback();
89 + $module = new BVFSWriteCallback();
159 90 break;
160 91 case 'actlg':
161 92 require_once dirname( __FILE__ ) . '/wings/actlog.php';
162 - $module = new WPRActLogCallback($this);
93 + $module = new BVActLogCallback($this);
163 94 break;
164 95 case 'speed':
165 96 require_once dirname( __FILE__ ) . '/wings/speed.php';
166 - $module = new WPRSpeedCallback($this);
97 + $module = new BVSpeedCallback($this);
167 98 break;
168 - case 'scrty':
169 - require_once dirname( __FILE__ ) . '/wings/security.php';
170 - $module = new WPRSecurityCallback($this);
171 - break;
172 99 default:
173 100 require_once dirname( __FILE__ ) . '/wings/misc.php';
174 - $module = new WPRMiscCallback($this);
101 + $module = new BVMiscCallback($this);
175 102 break;
176 103 }
177 104 $resp = $module->process($this->request);
178 105 if ($resp === false) {
@@ -188,5 +115,5 @@
188 115 $this->response->addStatus("callbackresponse", $resp);
189 116 return 1;
190 117 }
191 118 }
192 -endif;
119 +endif;