public function get_remote_repo_meta($repo)
{
$this->repo_api = null;
$file = 'style.css';
if (false !== stristr($repo->type, 'plugin')) {
$file = basename($repo->slug);
}
switch ($repo->type) {
case 'github_plugin':
case 'github_theme':
$this->repo_api = new GitHub_API($repo);
break;
case 'bitbucket_plugin':
case 'bitbucket_theme':
$this->repo_api = new Bitbucket_API($repo);
break;
case 'gitlab_plugin':
case 'gitlab_theme':
$this->repo_api = new GitLab_API($repo);
break;
}
if (null === $this->repo_api) {
return false;
}
$this->{$repo->type} = $repo;
$this->set_defaults($repo->type);
if ($this->repo_api->get_remote_info($file)) {
if (!apply_filters('github_updater_run_at_scale', false)) {
$this->repo_api->get_repo_meta();
$changelog = $this->get_changelog_filename($repo->type);
if ($changelog) {
$this->repo_api->get_remote_changes($changelog);
}
$this->repo_api->get_remote_readme();
}
if (!empty(self::$options['branch_switch'])) {
$this->repo_api->get_remote_branches();
}
$this->repo_api->get_remote_tag();
$repo->download_link = $this->repo_api->construct_download_link();
$this->languages = new Language_Pack($repo, $this->repo_api);
}
$this->remove_hooks();
return true;
}