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 +18 -118 5.684.74 View file →
@@ -9,9 +9,9 @@
9 9 public $siteinfo;
10 10 public $bvinfo;
11 11 public $bvapi;
12 12
13 - const INFO_WING_VERSION = 2.3;
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 }
@@ -177,10 +147,8 @@
177 147 'uploaddir' => wp_upload_dir(),
178 148 'contentdir' => defined('WP_CONTENT_DIR') ? WP_CONTENT_DIR : null,
179 149 'contenturl' => defined('WP_CONTENT_URL') ? WP_CONTENT_URL : null,
180 150 'plugindir' => defined('WP_PLUGIN_DIR') ? WP_PLUGIN_DIR : null,
181 - 'themedir' => get_stylesheet_directory(),
182 - 'templatedir' => get_template_directory(),
183 151 'dbcharset' => defined('DB_CHARSET') ? DB_CHARSET : null,
184 152 'disallow_file_edit' => defined('DISALLOW_FILE_EDIT'),
185 153 'disallow_file_mods' => defined('DISALLOW_FILE_MODS'),
186 154 'custom_users' => defined('CUSTOM_USER_TABLE') ? CUSTOM_USER_TABLE : null,
@@ -288,12 +256,8 @@
288 256 if (defined('WPE_APIKEY')) {
289 257 $host_info['WPE_APIKEY'] = WPE_APIKEY;
290 258 }
291 259
292 - if (defined('IS_ATOMIC')) {
293 - $host_info['IS_ATOMIC'] = IS_ATOMIC;
294 - }
295 -
296 260 return $host_info;
297 261 }
298 262
299 263 public function serverConfig() {
@@ -369,47 +333,16 @@
369 333 $transient = $this->objectToArray($transient);
370 334 return array("transient" => $transient);
371 335 }
372 336
373 - function getPluginsHandler($args = array()) {
374 - $result = array_merge($this->getPlugins(), $this->getTransient('update_plugins'));
375 -
376 - if (array_key_exists('clear_filters', $args)) {
377 - $filters = $args['clear_filters'];
378 - foreach ($filters as $filter)
379 - remove_all_filters($filter);
380 - $transient_without_filters = $this->getTransient('update_plugins');
381 - $result['transient_without_filters'] = $transient_without_filters['transient'];
382 - }
383 -
384 - return $result;
337 + function getPluginsHandler() {
338 + return array_merge($this->getPlugins(), $this->getTransient('update_plugins'));
385 339 }
386 340
387 - function getThemesHandler($args = array()) {
388 - $result = array_merge($this->getThemes(), $this->getTransient('update_themes'));
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_themes');
395 - $result['transient_without_filters'] = $transient_without_filters['transient'];
396 - }
397 -
398 - return $result;
341 + function getThemesHandler() {
342 + return array_merge($this->getThemes(), $this->getTransient('update_themes'));
399 343 }
400 344
401 - function getCoreHandler() {
402 - global $wp_db_version, $wp_version;
403 -
404 - $result = $this->getTransient('update_core');
405 - $result['current_db_version'] = $this->settings->getOption('db_version');
406 - $result['latest_db_version'] = $wp_db_version;
407 - $result['wp_version'] = $wp_version;
408 -
409 - return $result;
410 - }
411 -
412 345 function getSiteInfo($args) {
413 346 $result = array();
414 347
415 348 if (array_key_exists('pre_refresh_get_options', $args)) {
@@ -424,15 +357,15 @@
424 357 if (array_key_exists('users', $args))
425 358 $result['users'] = $this->getUsersHandler($args['users']);
426 359
427 360 if (array_key_exists('plugins', $args))
428 - $result['plugins'] = $this->getPluginsHandler($args['plugins']);
361 + $result['plugins'] = $this->getPluginsHandler();
429 362
430 363 if (array_key_exists('themes', $args))
431 - $result['themes'] = $this->getThemesHandler($args['themes']);
364 + $result['themes'] = $this->getThemesHandler();
432 365
433 366 if (array_key_exists('core', $args))
434 - $result['core'] = $this->getCoreHandler();
367 + $result['core'] = $this->getTransient('update_core');
435 368
436 369 if (array_key_exists('sys', $args))
437 370 $result['sys'] = $this->getSystemInfo();
438 371
@@ -492,31 +425,8 @@
492 425
493 426 return $result;
494 427 }
495 428
496 - function getPluginFileData($plugin_file) {
497 - $result = array();
498 -
499 - if (!function_exists('get_plugin_data')) {
500 - require_once ABSPATH . 'wp-admin/includes/plugin.php';
501 - }
502 - $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_file);
503 - if ($plugin_data && isset($plugin_data['Version'])) {
504 - $result['version'] = $plugin_data['Version'];
505 - }
506 -
507 - return $result;
508 - }
509 -
510 - function fetchPluginApiData($slug, $action) {
511 - $args = array('slug' => wp_unslash($slug));
512 - $args = (object) $args;
513 - $args = apply_filters('plugins_api_args', $args, $action);
514 - $data = apply_filters('plugins_api', false, $action, $args);
515 -
516 - return $data;
517 - }
518 -
519 429 public function process($request) {
520 430 $db = $this->db;
521 431 $params = $request->params;
522 432 switch ($request->method) {
@@ -534,12 +444,8 @@
534 444 break;
535 445 case "gtsts":
536 446 $resp = $this->getStats();
537 447 break;
538 - case "gtdbvariables":
539 - $variable = (array_key_exists('variable', $params)) ? $params['variable'] : "";
540 - $resp = $this->db->showDbVariables($variable);
541 - break;
542 448 case "gtplgs":
543 449 $resp = $this->getPlugins();
544 450 break;
545 451 case "gtthms":
@@ -572,22 +478,16 @@
572 478 break;
573 479 case "gthost":
574 480 $resp = array('host_info' => $this->getHostInfo());
575 481 break;
576 - case "gtplsinfo":
577 - $resp = array("plugins_info" => array());
578 - $file_by_slug = $params["file_by_slug"];
579 - foreach ($params['slugs'] as $slug) {
580 - $data = $this->fetchPluginApiData($slug, $params['action']);
581 - if (is_object($data) && !property_exists($data, 'version') && isset($file_by_slug[$slug])) {
582 - $plugin_data = $this->getPluginFileData($file_by_slug[$slug]);
583 - $data->version = $plugin_data['version'];
584 - }
585 - $resp['plugins_info'][$slug] = $data;
586 - }
587 - break;
588 482 case "gtplinfo":
589 - $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);
590 490 $resp = array("plugins_info" => $data);
591 491 break;
592 492 case "gtpostactinfo":
593 493 $resp = $this->getPostActivateInfo($params);