Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
To spot a self-hosted site you can generally look for the “version” (referring to WordPress core version).
Thanks Andrew. So, a WordPress self-hosted site will have something like “4.7.5” in the version field. What about a wordpress.com cloud-hosted site — what will it have there?
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
It’s probably easier to use a website like http://whatwpthemeisthat.com/
Thanks for the link. I tried it — it seems to not “understand” WordPress.com sites at all. Also, how will it help to detect the platform from within the plugin code?
Thanks,
You could try https://builtwith.com/, of course that doesn’t help a plugin’s code figure this out either, unless there is some sort of API it can tap into. It could at least help with corroborating some other technique you are testing. I’m not convinced there is any dead giveaway in site content. I’ve seen .com sites with the WordPress 4.8 generator tag. .org sites with Jetpack will have .com references. If you get the IP address for a domain (DNS A record) and do a whois for the IP, it should come back owned by Automattic. I’ve not done this enough to be sure this is reliable. Certainly not reliable in the case of any sort of domain forwarding scheme external to wordpress.com.
I think at best it’s an educated guess if you are limited to publicly accessible data. There may be a clue in the PHP $_SERVER data. Your plugin can collect this info, but you cannot have the data sent to you for analysis unless the user specifically opts in.