public function plugins_api($false, $action, $response)
{
$contributors = array();
if (!('plugin_information' === $action)) {
return $false;
}
$plugin = isset($this->config[$response->slug]) ? $this->config[$response->slug] : false;
// wp.org only plugin.
if (!$plugin) {
return $false;
}
/*
* Fix for extended naming.
*/
$repos = $this->get_repo_slugs($plugin->repo);
$response->slug = $response->slug === $repos['extended_repo'] ? $repos['repo'] : $plugin->repo;
$response->plugin_name = $plugin->name;
$response->name = $plugin->name;
$response->author = $plugin->author;
$response->homepage = $plugin->uri;
$response->donate_link = $plugin->donate_link;
$response->version = $plugin->remote_version;
$response->sections = $plugin->sections;
$response->requires = $plugin->requires;
$response->tested = $plugin->tested;
$response->downloaded = $plugin->downloaded;
$response->last_updated = $plugin->last_updated;
$response->download_link = $plugin->download_link;
foreach ($plugin->contributors as $contributor) {
$contributors[$contributor] = '//profiles.wordpress.org/' . $contributor;
}
$response->contributors = $contributors;
if (!$this->is_private($plugin)) {
$response->num_ratings = $plugin->num_ratings;
$response->rating = $plugin->rating;
}
return $response;
}