wpackagist icon indicating copy to clipboard operation
wpackagist copied to clipboard

Include package description and authors in packages.json

Open tyrann0us opened this issue 4 years ago • 0 comments

Would it be possible to add a packages's (plugin/theme) description and authors to the generated packages.json file?

The WordPress API exposes these information. E.g. the v1.2 plugin API returns the following for https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request[slug]=akismet:

{
  "name":"Akismet Anti-Spam",
  […]
  "author":"<a href=\"https:\/\/automattic.com\/wordpress-plugins\/\">Automattic<\/a>",
  "author_profile":"https:\/\/profiles.wordpress.org\/automattic",
  […]
  "sections":{
    "description":"<p>Akismet checks your comments and contact form submissions against our global database of spam to prevent your site from publishing malicious content. […]",
    […]
  },
  […]
}

Also @Rarst's WPorg Client (which you use) seem to support these fields.

It would probably require some cleanup (remove HTML tags from author field) and truncation (only use one sentence for description) but because these fields would end up in the project's composer.lock file it would provide useful information about the package. For the required structure of the fields refer to the corresponding properties in https://getcomposer.org/schema.json.

What do you think? Thanks!

tyrann0us avatar Jan 06 '20 13:01 tyrann0us