| | 1597 | $blog_id = (int) $args[0]; |
| | 1598 | $username = $args[1]; |
| | 1599 | $password = $args[2]; |
| | 1600 | |
| | 1601 | if ( !$user = $this->login($username, $password) ) { |
| | 1602 | return $this->error; |
| | 1603 | } |
| | 1604 | |
| | 1605 | if( !current_user_can( 'activate_plugins' ) ) |
| | 1606 | return new IXR_Error( 401, __( 'Sorry, you cannot manage plugins.' ) ); |
| | 1607 | |
| | 1608 | do_action('xmlrpc_call', 'wp.getPluginList'); |
| | 1609 | |
| | 1610 | $plugins = get_plugins(); |
| | 1611 | $current = get_transient( 'update_plugins' ); |
| | 1612 | |
| | 1613 | foreach( (array) $plugins as $plugin_file => $plugin ) { |
| | 1614 | $new_version = $current->response[$plugin_file]->new_version |
| | 1615 | |
| | 1616 | if( is_plugin_active( $plugin_file ) ) |
| | 1617 | $plugins[$plugin_file]['active'] = true; |
| | 1618 | else |
| | 1619 | $plugins[$plugin_file]['active'] = false; |
| | 1620 | if( $new_version ) |
| | 1621 | $plugins[$plugin_file]['latest_version'] = $new_version; |
| | 1622 | else |
| | 1623 | $plugins[$plugin_file]['latest_version'] = $plugin['Version']; |
| | 1624 | } |
| | 1625 | |
| | 1626 | return $plugins; |
| | 1627 | |
| | 1628 | } |
| | 1629 | |