WPTT / theme-sniffer

Theme Sniffer plugin using sniffs.
MIT License
270 stars 3 forks source link

Validate contributors list #120

Closed timelsass closed 5 years ago

timelsass commented 5 years ago

Feature Request:

We should check the contributors field for wp.org usernames and throw and error when the usernames listed aren't valid so the author can remove and/or fix them.

dingo-d commented 5 years ago

I'm not sure if there is an API call for that on wordpress.org. I've looked at the documentation but couldn't find anything about it: https://codex.wordpress.org/WordPress.org_API

timelsass commented 5 years ago

yeah i don't think there's a specific endpoint, but we could do something like wp_remote_get (https://profiles.wordpress.org/$contributor_name ) and check if response gets redirect to wp.org (profile doesn't exist)

timelsass commented 5 years ago

actually that seems like the right thing to do anyways since the readme parser is doing that for plugins - taking the user and wrapping it in html with a link built like that.

dingo-d commented 5 years ago

I've asked on slack, and will see what Otto will say about it, since he's kinda maintaining all the wp.org api and infrastructure regarding plugins and the site 🙂

dingo-d commented 5 years ago

Apparently you were right, it's just checking the profiles. So if the status_code is 302, that means that the user doesn't exits and we can report it as an error :+1:

timelsass commented 5 years ago

https://github.com/WPTRT/theme-sniffer/pull/139 would resolve this issue here: https://github.com/WPTRT/theme-sniffer/pull/139/commits/106ae5083eacadc112776de5349f90c1acfb3540#diff-1e9e424eeea5b20d355b43982e53089b

dingo-d commented 5 years ago

I've merged this, so the issue can be closed. Thanks!