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/wings/info.php +28 -142 6.624.74 View file →
@@ -1,10 +1,10 @@
1 1 <?php
2 2
3 3 if (!defined('ABSPATH')) exit;
4 -if (!class_exists('WPRInfoCallback')) :
4 +if (!class_exists('BVInfoCallback')) :
5 5
6 -class WPRInfoCallback extends WPRCallbackBase {
6 +class BVInfoCallback extends BVCallbackBase {
7 7 public $db;
8 8 public $settings;
9 9 public $siteinfo;
10 10 public $bvinfo;
@@ -9,9 +9,9 @@
9 9 public $siteinfo;
10 10 public $bvinfo;
11 11 public $bvapi;
12 12
13 - const INFO_WING_VERSION = 2.7;
13 + const INFO_WING_VERSION = 1.4;
14 14
15 15 public function __construct($callback_handler) {
16 16 $this->db = $callback_handler->db;
17 17 $this->siteinfo = $callback_handler->siteinfo;
@@ -44,27 +44,8 @@
44 44 "comments" => get_object_vars(wp_count_comments())
45 45 );
46 46 }
47 47
48 - public function addDBInfoToPlugin($pdata, $plugin_file) {
49 - switch ($plugin_file) {
50 - case "woocommerce/woocommerce.php":
51 - $pdata['current_db_version'] = $this->settings->getOption('woocommerce_db_version');
52 - $pdata['latest_db_version'] = $this->bvinfo->getLatestWooCommerceDBVersion();
53 - break;
54 - case "elementor/elementor.php":
55 - $pdata['current_db_version'] = $this->settings->getOption('elementor_version');
56 - $pdata['latest_db_version'] = $this->bvinfo->getLatestElementorDBVersion($plugin_file);
57 - break;
58 - case "elementor-pro/elementor-pro.php":
59 - $pdata['current_db_version'] = $this->settings->getOption('elementor_pro_version');
60 - $pdata['latest_db_version'] = $this->bvinfo->getLatestElementorDBVersion($plugin_file);
61 - break;
62 - }
63 -
64 - return $pdata;
65 - }
66 -
67 48 public function getPlugins() {
68 49 if (!function_exists('get_plugins')) {
69 50 require_once (ABSPATH."wp-admin/includes/plugin.php");
70 51 }
@@ -75,15 +56,10 @@
75 56 'file' => $plugin_file,
76 57 'title' => $plugin_data['Title'],
77 58 'version' => $plugin_data['Version'],
78 59 'active' => is_plugin_active($plugin_file),
79 - 'network' => $plugin_data['Network'],
80 - "plugin_uri" => $plugin_data["PluginURI"],
81 - "update_uri" => $plugin_data["UpdateURI"],
82 - "author_uri" => $plugin_data["AuthorURI"],
83 - "author" => $plugin_data["AuthorName"],
60 + 'network' => $plugin_data['Network']
84 61 );
85 - $pdata = $this->addDBInfoToPlugin($pdata, $plugin_file);
86 62 $result["plugins"][] = $pdata;
87 63 }
88 64 return $result;
89 65 }
@@ -94,13 +70,9 @@
94 70 'name' => $theme->Name,
95 71 'title' => $theme->Title,
96 72 'stylesheet' => $theme->get_stylesheet(),
97 73 'template' => $theme->Template,
98 - 'version' => $theme->Version,
99 - 'theme_uri' => $theme->get('ThemeURI'),
100 - 'author' => $theme->get('Author'),
101 - 'author_uri' => $theme->get('AuthorURI'),
102 - 'update_uri' => $theme->get('UpdateURI'),
74 + 'version' => $theme->Version
103 75 );
104 76 } else {
105 77 $pdata = array(
106 78 'name' => $theme["Name"],
@@ -106,11 +78,9 @@
106 78 'name' => $theme["Name"],
107 79 'title' => $theme["Title"],
108 80 'stylesheet' => $theme["Stylesheet"],
109 81 'template' => $theme["Template"],
110 - 'version' => $theme["Version"],
111 - 'author' => $theme['Author'],
112 - 'author_uri' => $theme['Author URI'],
82 + 'version' => $theme["Version"]
113 83 );
114 84 }
115 85 return $pdata;
116 86 }
@@ -116,14 +86,15 @@
116 86 }
117 87
118 88 public function getThemes() {
119 89 $result = array();
120 - $themes = wp_get_themes();
90 + $themes = function_exists('wp_get_themes') ? wp_get_themes() : get_themes();
121 91 foreach($themes as $theme) {
122 92 $pdata = $this->themeToArray($theme);
123 93 $result["themes"][] = $pdata;
124 94 }
125 - $pdata = $this->themeToArray(wp_get_theme());
95 + $theme = function_exists('wp_get_theme') ? wp_get_theme() : get_current_theme();
96 + $pdata = $this->themeToArray($theme);
126 97 $result["currenttheme"] = $pdata;
127 98 return $result;
128 99 }
129 100
@@ -128,14 +99,14 @@
128 99 }
129 100
130 101 public function getSystemInfo() {
131 102 $sys_info = array(
132 - 'host' => WPRHelper::getRawParam('SERVER', 'HTTP_HOST'),
103 + 'host' => $_SERVER['HTTP_HOST'],
133 104 'phpversion' => phpversion(),
134 105 'AF_INET6' => defined('AF_INET6')
135 106 );
136 107 if (array_key_exists('SERVER_ADDR', $_SERVER)) {
137 - $sys_info['serverip'] = WPRHelper::getRawParam('SERVER', 'SERVER_ADDR');
108 + $sys_info['serverip'] = $_SERVER['SERVER_ADDR'];
138 109 }
139 110 if (function_exists('get_current_user')) {
140 111 $sys_info['user'] = get_current_user();
141 112 }
@@ -176,10 +147,8 @@
176 147 'uploaddir' => wp_upload_dir(),
177 148 'contentdir' => defined('WP_CONTENT_DIR') ? WP_CONTENT_DIR : null,
178 149 'contenturl' => defined('WP_CONTENT_URL') ? WP_CONTENT_URL : null,
179 150 'plugindir' => defined('WP_PLUGIN_DIR') ? WP_PLUGIN_DIR : null,
180 - 'themedir' => get_stylesheet_directory(),
181 - 'templatedir' => get_template_directory(),
182 151 'dbcharset' => defined('DB_CHARSET') ? DB_CHARSET : null,
183 152 'disallow_file_edit' => defined('DISALLOW_FILE_EDIT'),
184 153 'disallow_file_mods' => defined('DISALLOW_FILE_MODS'),
185 154 'custom_users' => defined('CUSTOM_USER_TABLE') ? CUSTOM_USER_TABLE : null,
@@ -185,11 +154,9 @@
185 154 'custom_users' => defined('CUSTOM_USER_TABLE') ? CUSTOM_USER_TABLE : null,
186 155 'custom_usermeta' => defined('CUSTOM_USERMETA_TABLE') ? CUSTOM_USERMETA_TABLE : null,
187 156 'locale' => get_locale(),
188 157 'wp_local_string' => $wp_local_package,
189 - 'charset_collate' => $db->getCharsetCollate(),
190 - 'allowed_paths' => ini_get('open_basedir'),
191 - 'path_seprator' => PATH_SEPARATOR
158 + 'charset_collate' => $db->getCharsetCollate()
192 159 );
193 160 return $wp_info;
194 161 }
195 162
@@ -228,14 +195,8 @@
228 195 }
229 196 if (function_exists('openssl_public_decrypt')) {
230 197 $info['openssl_public_decrypt'] = "1";
231 198 }
232 - if (function_exists('openssl_encrypt')) {
233 - $info['openssl_encrypt'] = "1";
234 - }
235 - if (function_exists('openssl_decrypt')) {
236 - $info['openssl_decrypt'] = "1";
237 - }
238 199 $info['sha1'] = "1";
239 200 $info['apissl'] = "1";
240 201 if (function_exists('base64_encode')) {
241 202 $info['b64encode'] = true;
@@ -282,16 +243,9 @@
282 243 }
283 244
284 245 public function getHostInfo() {
285 246 $host_info = $_SERVER;
286 - if (function_exists('php_uname')) {
287 - $host_info['PHP_SERVER_NAME'] = php_uname();
288 - }
289 -
290 - if (isset($_SERVER['SERVER_ADDR']) && function_exists('gethostbyaddr')) {
291 - $host_info['HOST_FROM_IP'] = gethostbyaddr(WPRHelper::getRawParam('SERVER', 'SERVER_ADDR'));
292 - }
293 -
247 + $host_info['PHP_SERVER_NAME'] = php_uname('\n');
294 248 if (array_key_exists('IS_PRESSABLE', get_defined_constants())) {
295 249 $host_info['IS_PRESSABLE'] = true;
296 250 }
297 251
@@ -302,18 +256,14 @@
302 256 if (defined('WPE_APIKEY')) {
303 257 $host_info['WPE_APIKEY'] = WPE_APIKEY;
304 258 }
305 259
306 - if (defined('IS_ATOMIC')) {
307 - $host_info['IS_ATOMIC'] = IS_ATOMIC;
308 - }
309 -
310 260 return $host_info;
311 261 }
312 262
313 263 public function serverConfig() {
314 264 return array(
315 - 'software' => WPRHelper::getRawParam('SERVER', 'SERVER_SOFTWARE'),
265 + 'software' => $_SERVER['SERVER_SOFTWARE'],
316 266 'sapi' => (function_exists('php_sapi_name')) ? php_sapi_name() : false,
317 267 'has_apache_get_modules' => function_exists('apache_get_modules'),
318 268 'posix_getuid' => (function_exists('posix_getuid')) ? posix_getuid() : null,
319 269 'uid' => (function_exists('getmyuid')) ? getmyuid() : null,
@@ -383,47 +333,16 @@
383 333 $transient = $this->objectToArray($transient);
384 334 return array("transient" => $transient);
385 335 }
386 336
387 - function getPluginsHandler($args = array()) {
388 - $result = array_merge($this->getPlugins(), $this->getTransient('update_plugins'));
389 -
390 - if (array_key_exists('clear_filters', $args)) {
391 - $filters = $args['clear_filters'];
392 - foreach ($filters as $filter)
393 - remove_all_filters($filter);
394 - $transient_without_filters = $this->getTransient('update_plugins');
395 - $result['transient_without_filters'] = $transient_without_filters['transient'];
396 - }
397 -
398 - return $result;
337 + function getPluginsHandler() {
338 + return array_merge($this->getPlugins(), $this->getTransient('update_plugins'));
399 339 }
400 340
401 - function getThemesHandler($args = array()) {
402 - $result = array_merge($this->getThemes(), $this->getTransient('update_themes'));
403 -
404 - if (array_key_exists('clear_filters', $args)) {
405 - $filters = $args['clear_filters'];
406 - foreach ($filters as $filter)
407 - remove_all_filters($filter);
408 - $transient_without_filters = $this->getTransient('update_themes');
409 - $result['transient_without_filters'] = $transient_without_filters['transient'];
410 - }
411 -
412 - return $result;
341 + function getThemesHandler() {
342 + return array_merge($this->getThemes(), $this->getTransient('update_themes'));
413 343 }
414 344
415 - function getCoreHandler() {
416 - global $wp_db_version, $wp_version;
417 -
418 - $result = $this->getTransient('update_core');
419 - $result['current_db_version'] = $this->settings->getOption('db_version');
420 - $result['latest_db_version'] = $wp_db_version;
421 - $result['wp_version'] = $wp_version;
422 -
423 - return $result;
424 - }
425 -
426 345 function getSiteInfo($args) {
427 346 $result = array();
428 347
429 348 if (array_key_exists('pre_refresh_get_options', $args)) {
@@ -438,15 +357,15 @@
438 357 if (array_key_exists('users', $args))
439 358 $result['users'] = $this->getUsersHandler($args['users']);
440 359
441 360 if (array_key_exists('plugins', $args))
442 - $result['plugins'] = $this->getPluginsHandler($args['plugins']);
361 + $result['plugins'] = $this->getPluginsHandler();
443 362
444 363 if (array_key_exists('themes', $args))
445 - $result['themes'] = $this->getThemesHandler($args['themes']);
364 + $result['themes'] = $this->getThemesHandler();
446 365
447 366 if (array_key_exists('core', $args))
448 - $result['core'] = $this->getCoreHandler();
367 + $result['core'] = $this->getTransient('update_core');
449 368
450 369 if (array_key_exists('sys', $args))
451 370 $result['sys'] = $this->getSystemInfo();
452 371
@@ -506,31 +425,8 @@
506 425
507 426 return $result;
508 427 }
509 428
510 - function getPluginFileData($plugin_file) {
511 - $result = array();
512 -
513 - if (!function_exists('get_plugin_data')) {
514 - require_once ABSPATH . 'wp-admin/includes/plugin.php';
515 - }
516 - $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_file);
517 - if ($plugin_data && isset($plugin_data['Version'])) {
518 - $result['version'] = $plugin_data['Version'];
519 - }
520 -
521 - return $result;
522 - }
523 -
524 - function fetchPluginApiData($slug, $action) {
525 - $args = array('slug' => wp_unslash($slug));
526 - $args = (object) $args;
527 - $args = apply_filters('plugins_api_args', $args, $action);
528 - $data = apply_filters('plugins_api', false, $action, $args);
529 -
530 - return $data;
531 - }
532 -
533 429 public function process($request) {
534 430 $db = $this->db;
535 431 $params = $request->params;
536 432 switch ($request->method) {
@@ -548,12 +444,8 @@
548 444 break;
549 445 case "gtsts":
550 446 $resp = $this->getStats();
551 447 break;
552 - case "gtdbvariables":
553 - $variable = (array_key_exists('variable', $params)) ? $params['variable'] : "";
554 - $resp = $this->db->showDbVariables($variable);
555 - break;
556 448 case "gtplgs":
557 449 $resp = $this->getPlugins();
558 450 break;
559 451 case "gtthms":
@@ -586,22 +478,16 @@
586 478 break;
587 479 case "gthost":
588 480 $resp = array('host_info' => $this->getHostInfo());
589 481 break;
590 - case "gtplsinfo":
591 - $resp = array("plugins_info" => array());
592 - $file_by_slug = $params["file_by_slug"];
593 - foreach ($params['slugs'] as $slug) {
594 - $data = $this->fetchPluginApiData($slug, $params['action']);
595 - if (is_object($data) && !property_exists($data, 'version') && isset($file_by_slug[$slug])) {
596 - $plugin_data = $this->getPluginFileData($file_by_slug[$slug]);
597 - $data->version = $plugin_data['version'];
598 - }
599 - $resp['plugins_info'][$slug] = $data;
600 - }
601 - break;
602 482 case "gtplinfo":
603 - $data = $this->fetchPluginApiData($params['slug'], $params['action']);
483 + $args = array(
484 + 'slug' => wp_unslash($params['slug'])
485 + );
486 + $action = $params['action'];
487 + $args = (object) $args;
488 + $args = apply_filters('plugins_api_args', $args, $action);
489 + $data = apply_filters('plugins_api', false, $action, $args);
604 490 $resp = array("plugins_info" => $data);
605 491 break;
606 492 case "gtpostactinfo":
607 493 $resp = $this->getPostActivateInfo($params);