Skip to content

Commit

Permalink
Minor verification improvements (#4175)
Browse files Browse the repository at this point in the history
* Handle long domains in verification recommendations

* Accept 200 callback status from WP sites
  • Loading branch information
aerosol authored Jun 3, 2024
1 parent 57e28f0 commit 12ddec6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
10 changes: 6 additions & 4 deletions lib/plausible/verification/diagnostics.ex
Original file line number Diff line number Diff line change
Expand Up @@ -216,26 +216,28 @@ defmodule Plausible.Verification.Diagnostics do
def interpret(
%__MODULE__{
plausible_installed?: true,
callback_status: 202,
callback_status: callback_status,
snippet_found_after_busting_cache?: true,
wordpress_likely?: true,
wordpress_plugin?: true
},
_url
) do
)
when callback_status in [200, 202] do
error(@errors.cache_wp_plugin)
end

def interpret(
%__MODULE__{
plausible_installed?: true,
callback_status: 202,
callback_status: callback_status,
snippet_found_after_busting_cache?: true,
wordpress_likely?: true,
wordpress_plugin?: false
},
_url
) do
)
when callback_status in [200, 202] do
error(@errors.cache_wp_no_plugin)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/plausible/verification/errors.ex
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ defmodule Plausible.Verification.Errors do
},
different_data_domain: %{
message: "Your data-domain is different",
recommendation: "Please ensure that the data-domain is an exact match to <%= @domain %>",
recommendation: "Please ensure that the data-domain matches <%= @domain %> exactly",
url:
"https://plausible.io/docs/troubleshoot-integration#have-you-added-the-correct-data-domain-attribute-in-the-plausible-snippet"
},
Expand Down
6 changes: 5 additions & 1 deletion lib/plausible_web/live/components/verification.ex
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ defmodule PlausibleWeb.Live.Components.Verification do
</p>
<p :if={not @finished?} class="mt-2 animate-pulse" id="progress"><%= @message %></p>
<p :if={@finished? and not @success? and @interpretation} class="mt-2" id="recommendation">
<p
:if={@finished? and not @success? and @interpretation}
class="mt-2 text-ellipsis overflow-hidden"
id="recommendation"
>
<span><%= List.first(@interpretation.recommendations).text %>.&nbsp;</span>
<.styled_link href={List.first(@interpretation.recommendations).url} new_tab={true}>
Learn more
Expand Down

0 comments on commit 12ddec6

Please sign in to comment.