Hi there,
This pull request adds a CloudFlare location provider to the UserCountry plugin.
If Piwik is behind a CloudFlare proxy, all requests have a HTTP_CF_IPCOUNTRY header containing the country code of the visitor as looked up by CloudFlare. This LocationProvider simply uses that value.
I am not sure how to get things set up for internationalization or what your requirements are on that front, so I have just hardcoded English strings for now. If you let me know what needs to be done, I will do it.
Thanks for the PR!
I don't think we want to add CloudFlare support since it only reports the "Country" which is too limited. I would recommend CF users to setup Maxmind for better accuracy.
PS: also got a NOTICE warning on the admin page
I get that it's not as accurate as GeoIP, but it's still a good deal better than the default 'browser language' provider.