Fragen\GitHub_Updater\API::get_dot_org_data PHP Method

get_dot_org_data() protected method

Query wp.org for plugin information.
protected get_dot_org_data ( ) : array | boolean | mixed | string | WP_Error
return array | boolean | mixed | string | WP_Error
    protected function get_dot_org_data()
    {
        $slug = $this->type->repo;
        $response = isset($this->response['dot_org']) ? $this->response['dot_org'] : false;
        if (!$response) {
            $response = wp_remote_get('https://api.wordpress.org/plugins/info/1.0/' . $slug);
            if (is_wp_error($response)) {
                return false;
            }
            $wp_repo_body = unserialize($response['body']);
            $response = is_object($wp_repo_body) ? 'in dot org' : 'not in dot org';
            $this->set_transient('dot_org', $response);
        }
        $response = 'in dot org' === $response ? true : false;
        return $response;
    }