You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At this moment plugin incorrectly handles domain name extraction in case a non-root path is used as a home. \Plausible\Analytics\WP\Helpers::get_domain() for some reason tries to use a regular expression instead of using the standard parse_url() function:
Regular expression completely ignores the fact that there may be something after the domain name itself, effectively generating the wrong result. The most common scenario is use of the multilanguage plugins like WPML, see #160 for examples.
Since Plausible analytics strictly expects hostname for the domain name it is currently not possible to use Plausible analytics for multilingual sites. Any registration attempt results in "Oops! The API token you used is invalid" notification and attempt to use "create an API token" link causes issue because it takes invalid URL for Plausible because the value for domain is taken from the form.
I've investigated the issue, and the actual issue was that the API client would always use the hosted domain stored in the DB, resulting in the API token invalid error message. In this commit any submitted options in POST are grabbed when get_settings() is called.
Also, Plausible has supported domain names with a subdirectory structure (i.e. multilingual sites) for a while now. So parsing just the hostname is no longer needed.
At this moment plugin incorrectly handles domain name extraction in case a non-root path is used as a home.
\Plausible\Analytics\WP\Helpers::get_domain()
for some reason tries to use a regular expression instead of using the standardparse_url()
function:wordpress/src/Helpers.php
Line 261 in 18bc986
Regular expression completely ignores the fact that there may be something after the domain name itself, effectively generating the wrong result. The most common scenario is use of the multilanguage plugins like WPML, see #160 for examples.
Since Plausible analytics strictly expects hostname for the domain name it is currently not possible to use Plausible analytics for multilingual sites. Any registration attempt results in "Oops! The API token you used is invalid" notification and attempt to use "create an API token" link causes issue because it takes invalid URL for Plausible because the value for domain is taken from the form.
Correct implementation would be:
The text was updated successfully, but these errors were encountered: