| @@ -9,9 +9,9 @@ | ||
| 9 | 9 | public $siteinfo; |
| 10 | 10 | public $bvinfo; |
| 11 | 11 | public $bvapi; |
| 12 | 12 | |
| 13 | - const INFO_WING_VERSION = 1.8; | |
| 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,19 +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 | - } | |
| 55 | - | |
| 56 | - return $pdata; | |
| 57 | - } | |
| 58 | - | |
| 59 | 48 | public function getPlugins() { |
| 60 | 49 | if (!function_exists('get_plugins')) { |
| 61 | 50 | require_once (ABSPATH."wp-admin/includes/plugin.php"); |
| 62 | 51 | } |
| @@ -69,9 +58,8 @@ | ||
| 69 | 58 | 'version' => $plugin_data['Version'], |
| 70 | 59 | 'active' => is_plugin_active($plugin_file), |
| 71 | 60 | 'network' => $plugin_data['Network'] |
| 72 | 61 | ); |
| 73 | - $pdata = $this->addDBInfoToPlugin($pdata, $plugin_file); | |
| 74 | 62 | $result["plugins"][] = $pdata; |
| 75 | 63 | } |
| 76 | 64 | return $result; |
| 77 | 65 | } |
| @@ -345,46 +333,16 @@ | ||
| 345 | 333 | $transient = $this->objectToArray($transient); |
| 346 | 334 | return array("transient" => $transient); |
| 347 | 335 | } |
| 348 | 336 | |
| 349 | - function getPluginsHandler($args = array()) { | |
| 350 | - $result = array_merge($this->getPlugins(), $this->getTransient('update_plugins')); | |
| 351 | - | |
| 352 | - if (array_key_exists('clear_filters', $args)) { | |
| 353 | - $filters = $args['clear_filters']; | |
| 354 | - foreach ($filters as $filter) | |
| 355 | - remove_all_filters($filter); | |
| 356 | - $transient_without_filters = $this->getTransient('update_plugins'); | |
| 357 | - $result['transient_without_filters'] = $transient_without_filters['transient']; | |
| 358 | - } | |
| 359 | - | |
| 360 | - return $result; | |
| 337 | + function getPluginsHandler() { | |
| 338 | + return array_merge($this->getPlugins(), $this->getTransient('update_plugins')); | |
| 361 | 339 | } |
| 362 | 340 | |
| 363 | - function getThemesHandler($args = array()) { | |
| 364 | - $result = array_merge($this->getThemes(), $this->getTransient('update_themes')); | |
| 365 | - | |
| 366 | - if (array_key_exists('clear_filters', $args)) { | |
| 367 | - $filters = $args['clear_filters']; | |
| 368 | - foreach ($filters as $filter) | |
| 369 | - remove_all_filters($filter); | |
| 370 | - $transient_without_filters = $this->getTransient('update_themes'); | |
| 371 | - $result['transient_without_filters'] = $transient_without_filters['transient']; | |
| 372 | - } | |
| 373 | - | |
| 374 | - return $result; | |
| 341 | + function getThemesHandler() { | |
| 342 | + return array_merge($this->getThemes(), $this->getTransient('update_themes')); | |
| 375 | 343 | } |
| 376 | 344 | |
| 377 | - function getCoreHandler() { | |
| 378 | - global $wp_db_version; | |
| 379 | - | |
| 380 | - $result = $this->getTransient('update_core'); | |
| 381 | - $result['current_db_version'] = $this->settings->getOption('db_version'); | |
| 382 | - $result['latest_db_version'] = $wp_db_version; | |
| 383 | - | |
| 384 | - return $result; | |
| 385 | - } | |
| 386 | - | |
| 387 | 345 | function getSiteInfo($args) { |
| 388 | 346 | $result = array(); |
| 389 | 347 | |
| 390 | 348 | if (array_key_exists('pre_refresh_get_options', $args)) { |
| @@ -399,15 +357,15 @@ | ||
| 399 | 357 | if (array_key_exists('users', $args)) |
| 400 | 358 | $result['users'] = $this->getUsersHandler($args['users']); |
| 401 | 359 | |
| 402 | 360 | if (array_key_exists('plugins', $args)) |
| 403 | - $result['plugins'] = $this->getPluginsHandler($args['plugins']); | |
| 361 | + $result['plugins'] = $this->getPluginsHandler(); | |
| 404 | 362 | |
| 405 | 363 | if (array_key_exists('themes', $args)) |
| 406 | - $result['themes'] = $this->getThemesHandler($args['themes']); | |
| 364 | + $result['themes'] = $this->getThemesHandler(); | |
| 407 | 365 | |
| 408 | 366 | if (array_key_exists('core', $args)) |
| 409 | - $result['core'] = $this->getCoreHandler(); | |
| 367 | + $result['core'] = $this->getTransient('update_core'); | |
| 410 | 368 | |
| 411 | 369 | if (array_key_exists('sys', $args)) |
| 412 | 370 | $result['sys'] = $this->getSystemInfo(); |
| 413 | 371 | |
| @@ -485,12 +443,8 @@ | ||
| 485 | 443 | $resp = $this->getPosts($params['post_type'], $count); |
| 486 | 444 | break; |
| 487 | 445 | case "gtsts": |
| 488 | 446 | $resp = $this->getStats(); |
| 489 | - break; | |
| 490 | - case "gtdbvariables": | |
| 491 | - $variable = (array_key_exists('variable', $params)) ? $variable : ""; | |
| 492 | - $resp = $this->db->showDbVariables($variable); | |
| 493 | 447 | break; |
| 494 | 448 | case "gtplgs": |
| 495 | 449 | $resp = $this->getPlugins(); |
| 496 | 450 | break; |