PluginProbe
The WP Remote WordPress Plugin / 4.79
The WP Remote WordPress Plugin v4.79
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 +22 -116 6.484.79 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.5;
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,
@@ -411,19 +361,8 @@
411 361
412 362 return $result;
413 363 }
414 364
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 365 function getSiteInfo($args) {
427 366 $result = array();
428 367
429 368 if (array_key_exists('pre_refresh_get_options', $args)) {
@@ -444,9 +383,9 @@
444 383 if (array_key_exists('themes', $args))
445 384 $result['themes'] = $this->getThemesHandler($args['themes']);
446 385
447 386 if (array_key_exists('core', $args))
448 - $result['core'] = $this->getCoreHandler();
387 + $result['core'] = $this->getTransient('update_core');
449 388
450 389 if (array_key_exists('sys', $args))
451 390 $result['sys'] = $this->getSystemInfo();
452 391
@@ -506,31 +445,8 @@
506 445
507 446 return $result;
508 447 }
509 448
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 449 public function process($request) {
534 450 $db = $this->db;
535 451 $params = $request->params;
536 452 switch ($request->method) {
@@ -548,12 +464,8 @@
548 464 break;
549 465 case "gtsts":
550 466 $resp = $this->getStats();
551 467 break;
552 - case "gtdbvariables":
553 - $variable = (array_key_exists('variable', $params)) ? $params['variable'] : "";
554 - $resp = $this->db->showDbVariables($variable);
555 - break;
556 468 case "gtplgs":
557 469 $resp = $this->getPlugins();
558 470 break;
559 471 case "gtthms":
@@ -586,22 +498,16 @@
586 498 break;
587 499 case "gthost":
588 500 $resp = array('host_info' => $this->getHostInfo());
589 501 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 502 case "gtplinfo":
603 - $data = $this->fetchPluginApiData($params['slug'], $params['action']);
503 + $args = array(
504 + 'slug' => wp_unslash($params['slug'])
505 + );
506 + $action = $params['action'];
507 + $args = (object) $args;
508 + $args = apply_filters('plugins_api_args', $args, $action);
509 + $data = apply_filters('plugins_api', false, $action, $args);
604 510 $resp = array("plugins_info" => $data);
605 511 break;
606 512 case "gtpostactinfo":
607 513 $resp = $this->getPostActivateInfo($params);