Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Redo site verification UI (#4153)

hq19d77e970efd1
diff --git a/lib/plausible/verification/checks/csp.ex b/lib/plausible/verification/checks/csp.ex
index 5ed5fb9116..c4d2913b1e 100644
--- a/lib/plausible/verification/checks/csp.ex
+++ b/lib/plausible/verification/checks/csp.ex
@@ -6,7 +6,7 @@ defmodule Plausible.Verification.Checks.CSP do
use Plausible.Verification.Check
@impl true
- def friendly_name, do: "We're visiting your site to ensure that everything is working correctly"
+ def friendly_name, do: "We're visiting your site to ensure that everything is working"
@impl true
def perform(%State{assigns: %{headers: headers}} = state) do
diff --git a/lib/plausible/verification/checks/fetch_body.ex b/lib/plausible/verification/checks/fetch_body.ex
index 27315780e1..41426883fa 100644
--- a/lib/plausible/verification/checks/fetch_body.ex
+++ b/lib/plausible/verification/checks/fetch_body.ex
@@ -7,7 +7,7 @@ defmodule Plausible.Verification.Checks.FetchBody do
use Plausible.Verification.Check
@impl true
- def friendly_name, do: "We're visiting your site to ensure that everything is working correctly"
+ def friendly_name, do: "We're visiting your site to ensure that everything is working"
@impl true
def perform(%State{url: "https://" <> _ = url} = state) do
diff --git a/lib/plausible/verification/checks/scan_body.ex b/lib/plausible/verification/checks/scan_body.ex
index 1239ea8824..6ddc9b0bae 100644
--- a/lib/plausible/verification/checks/scan_body.ex
+++ b/lib/plausible/verification/checks/scan_body.ex
@@ -5,7 +5,7 @@ defmodule Plausible.Verification.Checks.ScanBody do
use Plausible.Verification.Check
@impl true
- def friendly_name, do: "We're visiting your site to ensure that everything is working correctly"
+ def friendly_name, do: "We're visiting your site to ensure that everything is working"
@impl true
def perform(%State{assigns: %{raw_body: body}} = state) when is_binary(body) do
diff --git a/lib/plausible/verification/diagnostics.ex b/lib/plausible/verification/diagnostics.ex
index c4d8b5f212..03182433aa 100644
--- a/lib/plausible/verification/diagnostics.ex
+++ b/lib/plausible/verification/diagnostics.ex
@@ -97,9 +97,9 @@ defmodule Plausible.Verification.Diagnostics do
plausible_installed?: false,
body_fetched?: false
},
- url
+ _url
) do
- error(@errors.unreachable, url: url)
+ error(@errors.unreachable)
end
def interpret(
@@ -119,9 +119,9 @@ defmodule Plausible.Verification.Diagnostics do
service_error: nil,
body_fetched?: false
},
- url
+ _url
) do
- error(@errors.unreachable, url: url)
+ error(@errors.unreachable)
end
def interpret(
@@ -325,7 +325,7 @@ defmodule Plausible.Verification.Diagnostics do
end
defp error(error, assigns) do
- message = EEx.eval_string(error.message, assigns: assigns)
- error(%{error | message: message})
+ recommendation = EEx.eval_string(error.recommendation, assigns: assigns)
+ error(%{error | recommendation: recommendation})
end
end
diff --git a/lib/plausible/verification/errors.ex b/lib/plausible/verification/errors.ex
index 0097d0f3bc..6228727bfb 100644
--- a/lib/plausible/verification/errors.ex
+++ b/lib/plausible/verification/errors.ex
@@ -18,13 +18,13 @@ defmodule Plausible.Verification.Errors do
"https://plausible.io/docs/troubleshoot-integration#does-your-site-use-a-content-security-policy-csp"
},
unreachable: %{
- message: "We couldn't reach <%= @url %>. Is your site up?",
+ message: "We couldn't reach your site",
recommendation:
"If your site is running at a different location, please manually check your integration",
url: "https://plausible.io/docs/troubleshoot-integration"
},
no_snippet: %{
- message: "We couldn't find the Plausible snippet on your site",
+ message: "We couldn't find the Plausible snippet",
recommendation: "Please insert the snippet into your site",
url: "https://plausible.io/docs/plausible-script"
},
@@ -35,28 +35,28 @@ defmodule Plausible.Verification.Errors do
url: "https://plausible.io/wordpress-analytics-plugin"
},
temporary: %{
- message: "We encountered a temporary problem verifying your website",
+ message: "We encountered a temporary problem",
recommendation: "Please try again in a few minutes or manually check your integration",
url:
"https://plausible.io/docs/troubleshoot-integration#how-to-manually-check-your-integration"
},
old_script: %{
- message: "We encountered a problem trying to verify your website",
+ message: "We couldn't verify your website",
recommendation:
- "The integration may be working but as you're running an older version of our script, we cannot verify it automatically. Please manually check your integration or update to use the latest script",
+ "You're running an older version of our script so we cannot verify it automatically. Please update to the latest script",
url:
"https://plausible.io/docs/troubleshoot-integration#are-you-using-an-older-version-of-our-script"
},
old_script_wp_no_plugin: %{
- message: "We encountered a problem trying to verify your website",
+ message: "We couldn't verify your website",
recommendation:
- "The integration may be working but as you're running an older version of our script, we cannot verify it automatically. Please install our WordPress plugin to use the built-in proxy",
+ "You're running an older version of our script so we cannot verify it. Please use our WordPress plugin instead",
url: "https://plausible.io/wordpress-analytics-plugin"
},
old_script_wp_plugin: %{
- message: "We encountered a problem trying to verify your website",
+ message: "We couldn't verify your website",
recommendation:
- "The integration may be working but as you're running an older version of our script, we cannot verify it automatically. Please disable and then enable the proxy in our WordPress plugin, then clear your WordPress cache",
+ "You're running an older version of our script so we cannot verify it. Please re-enable the proxy in our plugin",
url: "https://plausible.io/wordpress-analytics-plugin"
},
proxy_misconfigured: %{
@@ -76,7 +76,7 @@ defmodule Plausible.Verification.Errors do
url: "https://plausible.io/docs/proxy/introduction"
},
multiple_snippets: %{
- message: "We've found multiple Plausible snippets on your site.",
+ message: "We've found multiple Plausible snippets",
recommendation: "Please ensure that only one snippet is used",
url:
"https://plausible.io/docs/troubleshoot-integration#did-you-insert-multiple-plausible-snippets-into-your-site"
@@ -84,7 +84,7 @@ defmodule Plausible.Verification.Errors do
cache_wp_plugin: %{
message: "We encountered an issue with your site cache",
recommendation:
- "Please clear your WordPress cache to ensure that the latest version of your site is being displayed to all your visitors",
+ "Please clear your WordPress cache to ensure that the latest version is displayed to your visitors",
url: "https://plausible.io/wordpress-analytics-plugin"
},
cache_wp_no_plugin: %{
@@ -96,19 +96,18 @@ defmodule Plausible.Verification.Errors do
cache_general: %{
message: "We encountered an issue with your site cache",
recommendation:
- "Please clear your cache (or wait for your provider to clear it) to ensure that the latest version of your site is being displayed to all your visitors",
+ "Please clear your cache (or wait for your provider to clear it) to ensure that the latest version is displayed to your visitors",
url:
"https://plausible.io/docs/troubleshoot-integration#have-you-cleared-the-cache-of-your-site"
},
snippet_in_body: %{
- message: "Plausible snippet is placed in the body of your site",
+ message: "Plausible snippet is placed in the body",
recommendation: "Please relocate the snippet to the header of your site",
url: "https://plausible.io/docs/troubleshoot-integration"
},
different_data_domain: %{
- message: "Your data-domain is different than <%= @domain %>",
- recommendation:
- "Please ensure that the site in the data-domain attribute is an exact match to the site as you added it to your Plausible account",
+ message: "Your data-domain is different",
+ recommendation: "Please ensure that the data-domain is an exact match to <%= @domain %>",
url:
"https://plausible.io/docs/troubleshoot-integration#have-you-added-the-correct-data-domain-attribute-in-the-plausible-snippet"
},
diff --git a/lib/plausible_web/components/generic.ex b/lib/plausible_web/components/generic.ex
index ee0f074b6b..ff1908ad99 100644
--- a/lib/plausible_web/components/generic.ex
+++ b/lib/plausible_web/components/generic.ex
@@ -360,27 +360,6 @@ defmodule PlausibleWeb.Components.Generic do
attr :height, :integer, default: 100
attr :id, :string, default: "shuttle"
- def shuttle(assigns) do
- ~H"""
- <svg
- id={@id}
- class="inline fill-current text-gray-800 dark:text-white"
- xmlns="http://www.w3.org/2000/svg"
- width={@width}
- height={@height}
- version="1.1"
- x="0px"
- y="0px"
- viewBox="0 0 100 100"
- xmlSpace="preserve"
- >
- <g>
- <path d="M35.6830368,38.7263184c2.7299805,0,4.9511719-2.2211914,4.9511719-4.9511719s-2.2211914-4.9511719-4.9511719-4.9511719 c-2.7304688,0-4.9516602,2.2211914-4.9516602,4.9511719S32.9525681,38.7263184,35.6830368,38.7263184z M35.6830368,30.8239746 c1.6274414,0,2.9511719,1.3237305,2.9511719,2.9511719s-1.3237305,2.9511719-2.9511719,2.9511719 s-2.9516602-1.3237305-2.9516602-2.9511719S34.0555954,30.8239746,35.6830368,30.8239746z" /><path d="M43.4540329,27.4133301c2.1630859,0,3.9228516-1.7597656,3.9228516-3.9228516s-1.7597656-3.9228516-3.9228516-3.9228516 c-2.1625977,0-3.9223633,1.7597656-3.9223633,3.9228516S41.2914352,27.4133301,43.4540329,27.4133301z M43.4540329,21.567627 c1.0600586,0,1.9228516,0.862793,1.9228516,1.9228516s-0.862793,1.9228516-1.9228516,1.9228516 s-1.9223633-0.862793-1.9223633-1.9228516S42.3939743,21.567627,43.4540329,21.567627z" /><path d="M80.2762985,41.4973145c3.6635742,0,6.6445313-2.980957,6.6445313-6.6445313s-2.980957-6.6445313-6.6445313-6.6445313 c-3.6640625,0-6.6450195,2.980957-6.6450195,6.6445313S76.612236,41.4973145,80.2762985,41.4973145z M80.2762985,30.208252 c2.5610352,0,4.6445313,2.0834961,4.6445313,4.6445313s-2.0834961,4.6445313-4.6445313,4.6445313 s-4.6450195-2.0834961-4.6450195-4.6445313S77.7152634,30.208252,80.2762985,30.208252z" /><path d="M86.4340134,28.1555176c1.9663086,0,3.565918-1.5996094,3.565918-3.565918s-1.5996094-3.565918-3.565918-3.565918 c-1.9658203,0-3.5654297,1.5996094-3.5654297,3.565918S84.4681931,28.1555176,86.4340134,28.1555176z M86.4340134,23.0236816 c0.8632813,0,1.565918,0.7026367,1.565918,1.565918s-0.7026367,1.565918-1.565918,1.565918 s-1.5654297-0.7026367-1.5654297-1.565918S85.5707321,23.0236816,86.4340134,23.0236816z" /><path d="M79.9183884,48.1384277l-0.5896606,0.1737061c0.1333618-0.4435425,0.2112427-0.9072266,0.2112427-1.3841553 c0-0.4707031-0.0678711-0.9375-0.2045898-1.3950195c-0.78125-2.5327148-3.4887695-3.9741211-6.0366211-3.2119141 l-1.7001953,0.5170898c-0.3798828,0.1108398-0.7299805,0.1855469-1.0664063,0.2265625 c-0.003479,0.0004272-0.006897,0.000061-0.010376,0.0004883c-0.0266113,0.0028076-0.0534058-0.0014648-0.0794678,0.00354 c-0.6416626,0.0675659-1.277771,0.0505981-1.8896484-0.0645752l-4.8505859-0.8999023 c-3.8491211-0.7124023-7.8662109-0.4970703-11.6201172,0.6259766l-11.3138428,3.4025879 c-0.0564575-0.0429077-0.1116943-0.0877075-0.1778564-0.1184082l-13.7036133-6.3583984 c-0.230957-0.1069336-0.4951172-0.121582-0.7353516-0.0419922l-8.2226563,2.7250977 c-0.309082,0.1025391-0.5488281,0.3486328-0.6425781,0.6601563c-0.0942383,0.3110352-0.03125,0.6489258,0.1694336,0.9052734 l5.8516235,7.4795532l-2.1152954,0.6361694c-0.2539063,0.0761719-0.4672852,0.2504883-0.5927734,0.4838867 c-0.1254883,0.2338867-0.1533203,0.5078125-0.0766602,0.7617188l0.3309326,1.0892944 c-0.2720337,0.0733643-0.5426636,0.1504517-0.8016357,0.250061c-4.4667969,1.7197266-6.3505859,7.1894531-6.4287109,7.4213867 c-0.1542969,0.4580078,0.0415039,0.9609375,0.4648438,1.1943359c0.1640625,0.0908203,3.1762695,1.7246094,6.574707,1.7246094 c1.0532227,0,2.144043-0.1572266,3.1977539-0.5654297c0.0115356-0.0044556,0.022644-0.010437,0.0341797-0.0149536 l0.0750732,0.2472534l-1.4403076,0.4239502c-0.2548828,0.0751953-0.4692383,0.2485352-0.5961914,0.4819336 s-0.1557617,0.5073242-0.0800781,0.762207l0.2781982,0.9320679c-1.5239868-0.0391846-2.9415283,0.1781616-4.2181396,0.6724243 c-5.4560547,2.1005859-7.7651367,8.8061523-7.8608398,9.090332c-0.1176758,0.3505859-0.0327148,0.7373047,0.2211914,1.0058594 c0.2539063,0.269043,0.6376953,0.3745117,0.9916992,0.2773438c1.5864258-0.4365234,3.1904297-0.6772461,4.7919922-0.7211914 l-1.0683594,1.046875c-0.269043,0.2631836-0.3671875,0.6552734-0.2543945,1.0141602s0.4174805,0.6240234,0.7880859,0.6865234 c0.0708008,0.0117188,0.9082031,0.1474609,2.121582,0.1474609c1.3310547,0,3.1152344-0.1635742,4.8369141-0.8339844 c0.9935913-0.385376,1.942627-0.9547729,2.8378296-1.6859131l0.4258423,1.4300537 c0.1289063,0.434082,0.5268555,0.715332,0.9580078,0.715332c0.09375,0,0.1889648-0.0136719,0.2832031-0.0415039l3.6088257-1.064209 c0.5294189,0.4693604,1.2138062,0.7355957,1.9185181,0.7355957c0.2729492,0,0.5488281-0.0395508,0.8183594-0.1206055 l2.612793-0.7680664c0.6903687-0.1968994,1.2542114-0.6436157,1.6234131-1.2183228 c0.3770752,0.1716309,0.7831421,0.2798462,1.2032471,0.2798462c0.2666016,0,0.5361328-0.0366211,0.8007813-0.1132813 l2.6342773-0.7744141c0.6880493-0.2131348,1.241272-0.6553345,1.6037598-1.2210083 c0.3721924,0.1687622,0.7717285,0.2756958,1.1843262,0.2756958c0.2724609,0,0.5478516-0.0395508,0.8178711-0.1206055 l2.612793-0.7675781c0.980957-0.2804565,1.713623-1.0597534,1.9748535-2.0108032l33.9655762-10.0023804 c3.3706055-1.003418,5.6347656-4.0170898,5.6347656-7.4985352c0-0.7524414-0.1083984-1.4975586-0.3222656-2.2167969 C88.4432907,49.2814941,84.0643845,46.9157715,79.9183884,48.1384277z M26.4042282,41.6369629l10.9301758,5.0717773 l-12.3256836,3.6044922l-5.1030273-6.5224609L26.4042282,41.6369629z M63.3373337,44.0710449l2.6757202,0.4962769 l-6.4960327,2.1526489c-0.3745117,0.121582-0.7783203-0.0761719-0.9013672-0.4448242l-0.8479614-2.5335693 C59.6291428,43.6253662,61.5039597,43.730957,63.3373337,44.0710449z M52.6566696,44.645752 c1.0076294-0.3015137,2.0372925-0.5230713,3.0765381-0.6818237l0.9859619,2.9459839 c0.3779297,1.1303711,1.4384766,1.847168,2.5737305,1.8466797c0.2832031,0,0.5708008-0.0444336,0.8535156-0.1381836 l10.8579102-3.5981445c0.0090942-0.0029907,0.0158081-0.0096436,0.0247192-0.0128784 c0.3674316-0.0574341,0.7401123-0.1351929,1.1417847-0.2532349l1.7055664-0.5185547 c1.4975586-0.4467773,3.0883789,0.3989258,3.5454102,1.878418c0.078125,0.2631836,0.1181641,0.5371094,0.1181641,0.8139648 c0,0.8886719-0.4160156,1.7143555-1.1201172,2.2368164l-28.8650513,8.5059814l-0.8562622,0.2522583 c-0.2514038-0.196106-0.5341187-0.3519897-0.8377686-0.4598999c-0.0093384-0.0098267-0.0202637-0.0175781-0.0297241-0.0272827 c-0.038208-0.0392456-0.079895-0.0735474-0.1200562-0.1102905c-0.0634155-0.0580444-0.1269531-0.1153564-0.1948242-0.1671143 c-0.0471191-0.0359497-0.0963745-0.067749-0.1453857-0.1005859c-0.0665283-0.0444946-0.1335449-0.0876465-0.2033081-0.1263428 c-0.0535278-0.0297241-0.1080322-0.0564575-0.163269-0.0827026c-0.0698853-0.0332031-0.1405029-0.0636597-0.2127686-0.0911255 c-0.0580444-0.0220947-0.1160889-0.0426025-0.1754761-0.0609131c-0.0736694-0.0227051-0.1481323-0.0411987-0.2234497-0.0580444 c-0.0602417-0.0134888-0.1199341-0.0269775-0.1810303-0.0365601c-0.0789795-0.0123901-0.1585693-0.0187988-0.2385254-0.0245972 c-0.0588379-0.0043335-0.1170044-0.0105591-0.1762085-0.0112305c-0.0892334-0.0009766-0.1785889,0.0061035-0.2682495,0.0134888 c-0.0505371,0.0042114-0.1008911,0.0043335-0.1514893,0.0112305c-0.1401367,0.019043-0.2800293,0.0469971-0.4185791,0.0874023 l-2.6254883,0.7714844c-0.1715088,0.0514526-0.335022,0.1169434-0.4894409,0.1948242 c-0.1483154,0.0748291-0.2871094,0.1623535-0.4178467,0.258667c-0.0053711,0.0039673-0.0119019,0.0066528-0.0172729,0.0106812 c-0.1115723,0.083374-0.2116089,0.1785278-0.3088379,0.2757568c-0.020752,0.020752-0.0458374,0.0375366-0.0658569,0.0588379 c-0.0830688,0.0883789-0.1534424,0.1865234-0.2243042,0.2841187c-0.0264282,0.036377-0.0588379,0.0684204-0.0834961,0.105957 c-0.0002441,0.0003662-0.0006104,0.0007324-0.0008545,0.0010986c-0.008728-0.0039673-0.0183105-0.0056763-0.0270996-0.0095215 c-0.0830688-0.0366821-0.1703491-0.0613403-0.2565308-0.0900269c-0.0712891-0.0236816-0.1404419-0.0530396-0.213501-0.0710449 c-0.0961914-0.0238037-0.1952515-0.0338135-0.2938232-0.0474854c-0.0670166-0.0093384-0.1325073-0.0254517-0.2003174-0.0299683 c-0.1109619-0.0073853-0.2233276,0.0008545-0.3355103,0.0066528c-0.0574341,0.0029907-0.1143188-0.0018921-0.171875,0.0046387 c-0.1697998,0.0193481-0.3398438,0.0536499-0.5081787,0.1049194l-2.6225586,0.7709961 c-0.1702271,0.0504761-0.3327026,0.1159668-0.4865723,0.194458c-0.0361938,0.0184937-0.0670166,0.0443115-0.1022339,0.064209 c-0.114624,0.0647583-0.2285767,0.1306152-0.3320923,0.2097778c-0.0396729,0.0302734-0.0722656,0.0681152-0.1102295,0.1004028 c-0.0912476,0.0775757-0.1833496,0.1543579-0.263916,0.2424927c-0.0459595,0.0502319-0.0822754,0.1082764-0.1245728,0.1616211 c-0.0603638,0.0762329-0.1253662,0.1488647-0.1779175,0.230957c-0.4283447-0.1953125-0.90625-0.2789307-1.394104-0.2468872 c-0.0344849,0.0022583-0.0682373-0.0021362-0.1028442,0.0013428c-0.1741333,0.0176392-0.3493042,0.0509033-0.5236816,0.100708 l-2.6259766,0.7719727c-0.1636353,0.0493164-0.3181763,0.1143799-0.4664307,0.1885986 c-0.0487671,0.0244141-0.0928955,0.0542603-0.1398315,0.0811157c-0.0963745,0.0551758-0.1904907,0.1124878-0.2788086,0.1773682 c-0.0499268,0.0366821-0.0962524,0.0762939-0.1435547,0.1159058c-0.0778809,0.0652466-0.1521606,0.1329956-0.2223511,0.2055054 c-0.0435181,0.0449219-0.0854492,0.09021-0.1258545,0.1376343c-0.0662231,0.0778198-0.1264648,0.1592407-0.18396,0.2432251 c-0.03302,0.0482788-0.0672607,0.0950928-0.09729,0.1452026c-0.0593262,0.098999-0.1095581,0.2024536-0.1566162,0.3079224 c-0.0180054,0.0402222-0.0400391,0.078186-0.0561523,0.1193237c-0.0580444,0.1479492-0.1044922,0.300354-0.137207,0.4569702 c-0.007019,0.0336914-0.0078735,0.0687256-0.0136719,0.1027222c-0.0180664,0.1057129-0.0368042,0.2113647-0.0427246,0.3195801 l-0.2138062-0.7027588c0.012085-0.1270142,0.0072021-0.2562256-0.0317993-0.3841553l-1.1140137-3.6674194l-0.322998-1.0791626 c-0.0026855-0.0089111-0.0092773-0.015564-0.012207-0.024353l-0.9248047-3.0444946 c-0.0401001-0.1308594-0.1096802-0.2437134-0.1931763-0.3440552l-0.2487183-0.8175659L52.6566696,44.645752z M22.3425827,59.2571411l0.0478516,0.1574097c-0.1259155,0.0722656-0.2521362,0.1400757-0.3763428,0.1901855 c-0.253418,0.0957031-0.5390625,0.1601563-0.8525391,0.1923828c0.2495117-0.1816406,0.5009766-0.3227539,0.7504883-0.4189453 C22.0441818,59.3267212,22.1913376,59.2897949,22.3425827,59.2571411z M23.1390915,62.5144043 c-2.6728516,1.0361328-5.8369141-0.0449219-7.2880859-0.668457c0.6430664-1.4326172,2.2358398-4.3408203,4.9189453-5.3740234 c0.213562-0.0823975,0.4368286-0.1488037,0.6634521-0.2074585l0.3309937,1.0894775 c-0.1945801,0.0488892-0.3952637,0.0895996-0.5745239,0.1589966c-1.090332,0.421875-2.1020508,1.2758789-3.0068359,2.5380859 c-0.1958008,0.2734375-0.2412109,0.6269531-0.1206055,0.940918s0.3911133,0.5463867,0.7197266,0.6186523 c0.6391602,0.1396484,1.2744141,0.2109375,1.8881836,0.2109375c0.7543945,0,1.4448242-0.1166992,2.0698242-0.3535156 c0.0811157-0.0325317,0.1576538-0.0828857,0.2376709-0.1199341l0.3328857,1.0957642 C23.2537155,62.4679565,23.1967697,62.4923706,23.1390915,62.5144043z M23.5314255,72.725647l0.0012207,0.0040894 c-0.5898438,0.7407227-1.1948242,1.3237305-1.8076172,1.7416992c-0.5957031-0.9111328-1.5537109-1.5366211-2.6308594-1.7211914 c0.199707-0.1118164,0.4003906-0.2060547,0.6015625-0.2827148c1.0146484-0.387207,2.3012695-0.4477539,3.6938477-0.2143555 L23.5314255,72.725647z M21.756279,77.7346191c-1.2910156,0.5024414-2.6557617,0.6630859-3.7475586,0.6904297l1.1201172-1.0976563 c0.2788086-0.2729492,0.3730469-0.6831055,0.2421875-1.050293s-0.4633789-0.625-0.8515625-0.6601563 c-0.6420898-0.0581055-1.2861328-0.0869141-1.9301758-0.0869141c-1.2963867,0-2.5947266,0.1171875-3.8862305,0.3515625 c0.9746094-1.9414063,2.9125977-4.96875,5.9301758-6.1308594c1.1391602-0.440918,2.434082-0.6181641,3.8476563-0.5322266 l0.2842407,0.9488525c-1.3863525-0.1206055-2.680603,0.0112915-3.7837524,0.4320068 c-1.2207031,0.4672852-2.3857422,1.3544922-3.4614258,2.6357422c-0.2607422,0.3105469-0.3085938,0.7480469-0.1201172,1.1069336 c0.1879883,0.3588867,0.5737305,0.5717773,0.9785156,0.5317383l1.8959961-0.1762695 c0.0302734-0.003418,0.0610352-0.0043945,0.0913086-0.0043945c0.784668,0.0019531,1.4975586,0.4169922,1.831543,1.1416016 c0.0463867,0.0922852,0.0771484,0.1743164,0.097168,0.2583008c0.0678711,0.2875977,0.2592773,0.5307617,0.5229492,0.6635742 c0.1416016,0.0712891,0.2958984,0.1069336,0.4501953,0.1069336c0.1342773,0,0.2685547-0.0268555,0.3945313-0.0810547 c0.8795776-0.3776855,1.7250366-1.0009155,2.534668-1.8171997l0.3041992,1.0198364 C23.6381149,76.7746582,22.7172165,77.3615723,21.756279,77.7346191z M25.7430954,72.3293457 c-0.0053711-0.0239258-0.0117188-0.0478516-0.0185547-0.0712891l-1.6694336-5.5859375l0.6426392-0.1890869 c0.1815186,0.1630859,0.4124756,0.2652588,0.6615601,0.2652588c0.0947266,0,0.190918-0.0136719,0.2866211-0.0424805 l0.7924194-0.2364502l2.1046753,7.0847168l1.0675659,3.6032104l-2.2332153,0.6588745L25.7430954,72.3293457z M35.3881149,76.8781738l-2.6269531,0.7719727c-0.3734741,0.1134644-0.7839355-0.0386963-0.998291-0.3710938 c-0.0044556-0.0070801-0.0038452-0.0159912-0.0085449-0.0229492c-0.0307617-0.0463867-0.0595703-0.1108398-0.0820313-0.1914063 l-1.4168701-4.7697754l-2.2486572-7.5876465l-0.2172852-0.7382813c-0.0527344-0.4150391,0.2158203-0.8164063,0.6328125-0.9418945 l2.6118164-0.7680664c0.4311523-0.1245117,0.8818359,0.0771484,1.0400391,0.4121094l3.5966187,12.0499268l0.3242798,1.0936279 c0.0015259,0.0049438,0.0045166,0.0084229,0.0061035,0.0133667l0.0114746,0.0383911 c0.0001221,0.0003052,0.0003662,0.001709,0.0004883,0.0020752c0.0063477,0.031189,0.0131836,0.0750122,0.0131836,0.145874 c0,0.0057373,0.0036621,0.0105591,0.0037842,0.0162964C36.0345993,76.4204712,35.773613,76.7678833,35.3881149,76.8781738z M41.6283493,75.0583496l-2.6157227,0.7685547c-0.3842773,0.1107788-0.7797852-0.0397949-1.0014038-0.3787842 c-0.0003052-0.0004883-0.0002441-0.0010986-0.0005493-0.0015869c-0.0240479-0.0377808-0.0378418-0.0718384-0.053833-0.1066895 c-0.0119019-0.026001-0.0247803-0.0489502-0.0344238-0.0758057c-0.0065308-0.0221558-0.0131226-0.0442505-0.0206299-0.06604 c-0.001709-0.005127-0.0059204-0.0084839-0.0077515-0.0136108l-3.7139282-12.5259399l-0.1210938-0.4052734 c-0.0109863-0.0336914-0.0181274-0.0585327-0.0230103-0.0740356c-0.0022583-0.0072632-0.005188-0.0172729-0.0057983-0.0172729 c-0.0004883,0-0.0004883,0.0014648-0.0004883,0.0048828c-0.0610352-0.4277344,0.2119141-0.8452148,0.6318359-0.9697266 l2.6289063-0.7724609c0.40625-0.125,0.8422852,0.0654297,1.034668,0.4501953 c0.0029297,0.0058594,0.0058594,0.0112305,0.0087891,0.0170898c0.0043945,0.0102539,0.0087891,0.0205078,0.0131836,0.0302734 c0.015625,0.034668,0.0341797,0.0708008,0.0463867,0.1069336l3.8374023,12.9326172 c0.0012207,0.0040894,0.0032349,0.0079956,0.0044556,0.012085l0.0062866,0.0211182 c0.0129395,0.0390625,0.0126953,0.0739746,0.0166626,0.107666c0.0024414,0.0253906,0.0077515,0.0415649,0.0077515,0.0773926 c0,0.0050049,0.0032349,0.0092163,0.0032959,0.0142212C42.2725143,74.5970459,42.0161667,74.9381714,41.6283493,75.0583496z M48.509697,72.3605957c0.0048828,0.3955078-0.2558594,0.7475586-0.6416016,0.8579102l-2.6264648,0.7714844 c-0.3828125,0.1132813-0.7822266-0.0351563-0.9838867-0.3564453c-0.0009155-0.0015259-0.0010376-0.0028076-0.0019531-0.0043335 c-0.003479-0.0057983-0.0027466-0.0128784-0.0063477-0.0186157c-0.0113525-0.0181274-0.015686-0.0336304-0.0253296-0.0511475 c-0.026001-0.0504761-0.0529175-0.1010132-0.0684204-0.1506348c-0.0031128-0.0101929-0.0059204-0.0204468-0.0092773-0.0306396 c-0.0010376-0.0032349-0.0037231-0.0053711-0.0047607-0.008606l-3.7252197-12.5631714l-0.1323242-0.456543 c-0.0039063-0.0375977-0.0102539-0.074707-0.0185547-0.1113281c-0.0249023-0.3901367,0.2368164-0.7514648,0.6362305-0.8710938 l2.6176758-0.7695313c0.3603516-0.1015625,0.7441406,0.0283203,0.9614258,0.3271484 c0.0151367,0.0214844,0.0566406,0.078125,0.0737305,0.0981445c0.0341797,0.0678711,0.0683594,0.1425781,0.0791016,0.1674805 l3.8598633,13.0180664c0.0068359,0.0180664,0.0161133,0.0527344,0.0161133,0.1391602 C48.509697,72.3522949,48.509697,72.3562012,48.509697,72.3605957z M83.7972946,61.208252L50.2455368,71.088623 L46.943779,59.935791l33.5390625-9.8789063c3.0947266-0.909668,6.3588867,0.8496094,7.2783203,3.9257813 c0.1582031,0.5327148,0.2387695,1.0859375,0.2387695,1.6450195C87.9999313,58.2175293,86.3099899,60.4602051,83.7972946,61.208252z " /><path d="M82.1522751,50.5427246c-0.4902344,0-0.9799805,0.0712891-1.456543,0.2124023 c-0.5292969,0.1572266-0.831543,0.7133789-0.6748047,1.2431641c0.1572266,0.5292969,0.7143555,0.8310547,1.2431641,0.6748047 c1.6289063-0.4804688,3.3920898,0.496582,3.8676758,2.0874023c0.1293945,0.4335938,0.5273438,0.7138672,0.9575195,0.7138672 c0.0952148,0,0.1914063-0.0136719,0.2871094-0.0424805c0.5288086-0.1582031,0.8295898-0.715332,0.6713867-1.2446289 C86.4061813,52.0412598,84.3929977,50.5427246,82.1522751,50.5427246z" /><path d="M78.2572556,51.4729004l-2.8793945,0.847168c-0.5297852,0.15625-0.8330078,0.7119141-0.6772461,1.2416992 c0.128418,0.4355469,0.5268555,0.7182617,0.9589844,0.7182617c0.09375,0,0.1884766-0.0136719,0.2827148-0.0410156 l2.8793945-0.847168c0.5297852-0.15625,0.8330078-0.7119141,0.6772461-1.2416992 C79.3427048,51.6203613,78.784111,51.3190918,78.2572556,51.4729004z" /><path d="M72.7758102,53.0856934l-23.9584961,7.0512695c-0.5297852,0.15625-0.8330078,0.7119141-0.6772461,1.2416992 c0.128418,0.4355469,0.5268555,0.7182617,0.9589844,0.7182617c0.09375,0,0.1884766-0.0136719,0.2827148-0.0410156 l23.9584961-7.0512695c0.5297852-0.15625,0.8330078-0.7119141,0.6772461-1.2416992 C73.8607712,53.232666,73.303154,52.932373,72.7758102,53.0856934z" />
- </g>
- </svg>
- """
- end
-
defp icon_class(link_assigns) do
if String.contains?(link_assigns[:class], "text-sm") or
String.contains?(link_assigns[:class], "text-xs") do
diff --git a/lib/plausible_web/live/components/verification.ex b/lib/plausible_web/live/components/verification.ex
index e483abe6a5..85aa0a06f8 100644
--- a/lib/plausible_web/live/components/verification.ex
+++ b/lib/plausible_web/live/components/verification.ex
@@ -11,8 +11,7 @@ defmodule PlausibleWeb.Live.Components.Verification do
attr :domain, :string, required: true
attr :modal?, :boolean, default: false
- attr :message, :string,
- default: "We're visiting your site to ensure that everything is working correctly"
+ attr :message, :string, default: "We're visiting your site to ensure that everything is working"
attr :finished?, :boolean, default: false
attr :success?, :boolean, default: false
@@ -21,93 +20,87 @@ defmodule PlausibleWeb.Live.Components.Verification do
def render(assigns) do
~H"""
- <div class={[
- "bg-white dark:bg-gray-800 text-center h-96 flex flex-col",
- if(!@modal?, do: "shadow-md rounded px-8 pt-6 pb-4 mb-4 mt-16")
- ]}>
- <h2 class="text-xl font-bold dark:text-gray-100">
- <%= if @success? && @finished? do %>
- Success!
- <% else %>
- Verifying your integration
- <% end %>
- </h2>
- <h2 class="text-xl dark:text-gray-100 text-xs">
- <%= if @finished? && @success? do %>
- Your integration is working and visitors are being counted accurately
- <% else %>
- on <%= @domain %>
- <% end %>
- </h2>
+ <div
+ class={[
+ "dark:text-gray-100 text-center bg-white dark:bg-gray-800 flex flex-col",
+ if(not @modal?, do: "shadow-md rounded px-8 pt-6 pb-4 mb-4 mt-16 h-96", else: "h-72")
+ ]}
+ id="progress-indicator"
+ >
<div
- :if={!@finished? || @success?}
- class="flex justify-center w-full my-auto"
- id="progress-indicator"
+ :if={not @finished? or (not @modal? and @success?)}
+ class="mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100 dark:bg-gray-700"
>
- <div class={["block pulsating-circle", if(@modal? && @finished?, do: "hidden")]}></div>
- <Heroicons.check_circle
- :if={@modal? && @finished? && @success?}
- id="check-circle"
- solid
- class="w-24 h-24 text-green-500 pt-8"
- />
+ <div class="block pulsating-circle" }></div>
</div>
<div
- :if={@finished? && !@success?}
- class="flex justify-center pt-3 h-14 mb-4 dark:text-gray-400 "
- id="progress-indicator"
+ :if={@finished? and @success? and @modal?}
+ class="mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100 dark:bg-green-500"
+ id="check-circle"
>
- <.shuttle width={50} height={50} />
+ <Heroicons.check_badge class="h-6 w-6 text-green-600 bg-green-100 dark:bg-green-500 dark:text-green-200" />
</div>
+
<div
- id="progress"
- class={[
- "mt-2 dark:text-gray-400",
- if(!@finished?, do: "animate-pulse text-xs", else: "font-bold text-sm"),
- if(@finished? && !@success?, do: "text-red-500 dark:text-red-600")
- ]}
+ :if={@finished? and not @success?}
+ class="mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-red-100 dark:bg-red-200"
+ id="error-circle"
>
- <p id="progress-message" class="leading-normal">
- <span :if={!@finished?}><%= @message %></span>
- <span :if={@finished? && !@success? && @interpretation && @interpretation.errors}>
+ <Heroicons.exclamation_triangle class="h-6 w-6 text-red-600 bg-red-100 dark:bg-red-200 dark:text-red-800" />
+ </div>
+
+ <div class="mt-6">
+ <h3 class="font-semibold leading-6 text-xl">
+ <span :if={@finished? and @success?}>Success!</span>
+ <span :if={not @finished?}>Verifying your integration</span>
+
+ <span :if={@finished? and not @success? and @interpretation}>
<%= List.first(@interpretation.errors) %>
- <div class="text-xs dark:text-gray-400 font-normal mt-1" id="recommendations">
- <.recommendations interpretation={@interpretation} />
- </div>
</span>
- <p
- :if={@finished? && @success? && !@modal?}
- class="leading-normal animate-pulse text-xs font-normal"
- >
- Awaiting your first pageview.
- </p>
+ </h3>
+ <p :if={@finished? and @success? and @modal?} id="progress" class="mt-2">
+ Your integration is working and visitors are being counted accurately
</p>
+ <p :if={@finished? and @success? and not @modal?} id="progress" class="mt-2 animate-pulse">
+ Your integration is working. Awaiting your first pageview.
+ </p>
+ <p :if={not @finished?} class="mt-2 animate-pulse" id="progress"><%= @message %></p>
+
+ <.recommendations
+ :if={@finished? and not @success? and @interpretation}
+ interpretation={@interpretation}
+ />
</div>
- <div class="mt-auto pb-2 text-gray-600 dark:text-gray-400 text-xs w-full text-center leading-normal">
- <div :if={@finished?} class="mb-4">
- <div class="flex justify-center gap-x-4 mt-4">
- <.button_link :if={!@success?} href="#" phx-click="retry" class="text-xs font-bold">
- Verify integration again
- </.button_link>
- <.button_link
- :if={@success?}
- href={"/#{URI.encode_www_form(@domain)}?skip_to_dashboard=true"}
- class="text-xs font-bold"
- >
- Go to the dashboard
- </.button_link>
- </div>
- </div>
- <%= if ee?() && @finished? && !@success? && @attempts >= 3 do %>
+ <div :if={@finished?} class="mt-auto">
+ <.button_link :if={not @success?} href="#" phx-click="retry" class="font-bold w-full">
+ Verify integration again
+ </.button_link>
+ <.button_link
+ :if={@success?}
+ href={"/#{URI.encode_www_form(@domain)}?skip_to_dashboard=true"}
+ class="w-full font-bold mb-4"
+ >
+ Go to the dashboard
+ </.button_link>
+ </div>
+
+ <div
+ :if={
+ (not @modal? and not @success?) or
+ (@finished? and not @success?)
+ }
+ class="mt-auto text-sm"
+ >
+ <%= if ee?() and @finished? and not @success? and @attempts >= 3 do %>
Need further help with your integration? Do
<.styled_link href="https://plausible.io/contact">
contact us
</.styled_link>
<br />
<% end %>
- <%= if !@modal? && !@success? do %>
+ <%= if not @success? and not @modal? do %>
Need to see the snippet again?
<.styled_link href={"/#{URI.encode_www_form(@domain)}/snippet"}>
Click here
@@ -125,16 +118,11 @@ defmodule PlausibleWeb.Live.Components.Verification do
def recommendations(assigns) do
~H"""
- <p class="leading-normal">
+ <p class="mt-2" id="recommendations">
<span :for={recommendation <- @interpretation.recommendations} class="recommendation">
<span :if={is_binary(recommendation)}><%= recommendation %></span>
- <span :if={is_tuple(recommendation)}><%= elem(recommendation, 0) %> -</span>
- <.styled_link
- :if={is_tuple(recommendation)}
- href={elem(recommendation, 1)}
- new_tab={true}
- class="text-xs"
- >
+ <span :if={is_tuple(recommendation)}><%= elem(recommendation, 0) %>.&nbsp;</span>
+ <.styled_link :if={is_tuple(recommendation)} href={elem(recommendation, 1)} new_tab={true}>
Learn more
</.styled_link>
<br />
diff --git a/lib/plausible_web/live/verification.ex b/lib/plausible_web/live/verification.ex
index b3f810995b..f674d56889 100644
--- a/lib/plausible_web/live/verification.ex
+++ b/lib/plausible_web/live/verification.ex
@@ -128,7 +128,7 @@ defmodule PlausibleWeb.Live.Verification do
defp reset_component(socket) do
update_component(socket,
- message: "We're visiting your site to ensure that everything is working correctly",
+ message: "We're visiting your site to ensure that everything is working",
finished?: false,
success?: false,
diagnostics: nil
diff --git a/test/plausible/site/verification/checks_test.exs b/test/plausible/site/verification/checks_test.exs
index 2d44a13659..5f8724cf98 100644
--- a/test/plausible/site/verification/checks_test.exs
+++ b/test/plausible/site/verification/checks_test.exs
@@ -763,8 +763,8 @@ defmodule Plausible.Verification.ChecksTest do
end
defp assert_error(interpretation, error, assigns) do
- message = EEx.eval_string(error.message, assigns: assigns)
- assert_error(interpretation, %{error | message: message})
+ recommendation = EEx.eval_string(error.recommendation, assigns: assigns)
+ assert_error(interpretation, %{error | recommendation: recommendation})
end
defp assert_ok(interpretation) do
diff --git a/test/plausible_web/live/components/verification_test.exs b/test/plausible_web/live/components/verification_test.exs
index 68b0d94909..c94cd551fb 100644
--- a/test/plausible_web/live/components/verification_test.exs
+++ b/test/plausible_web/live/components/verification_test.exs
@@ -4,19 +4,19 @@ defmodule PlausibleWeb.Live.Components.VerificationTest do
import Plausible.Test.Support.HTML
@component PlausibleWeb.Live.Components.Verification
- @progress ~s|div#progress|
+ @progress ~s|#progress-indicator p#progress|
@pulsating_circle ~s|div#progress-indicator div.pulsating-circle|
@check_circle ~s|div#progress-indicator #check-circle|
- @shuttle ~s|div#progress-indicator svg#shuttle|
- @recommendations ~s|div#recommendations .recommendation|
+ @error_circle ~s|div#progress-indicator #error-circle|
+ @recommendations ~s|#recommendations .recommendation|
test "renders initial state" do
html = render_component(@component, domain: "example.com")
assert element_exists?(html, @progress)
assert text_of_element(html, @progress) ==
- "We're visiting your site to ensure that everything is working correctly"
+ "We're visiting your site to ensure that everything is working"
assert element_exists?(html, ~s|a[href="/example.com/snippet"]|)
assert element_exists?(html, ~s|a[href="/example.com/settings/general"]|)
@@ -26,12 +26,12 @@ defmodule PlausibleWeb.Live.Components.VerificationTest do
refute element_exists?(html, @check_circle)
end
- test "renders shuttle on error" do
+ test "renders error badge on error" do
html = render_component(@component, domain: "example.com", success?: false, finished?: true)
refute element_exists?(html, @pulsating_circle)
refute element_exists?(html, @check_circle)
refute element_exists?(html, @recommendations)
- assert element_exists?(html, @shuttle)
+ assert element_exists?(html, @error_circle)
end
test "renders diagnostic interpretation" do
@@ -51,7 +51,7 @@ defmodule PlausibleWeb.Live.Components.VerificationTest do
recommendations = html |> find(@recommendations) |> Enum.map(&text/1)
assert recommendations == [
- "If your site is running at a different location, please manually check your integration - Learn more"
+ "If your site is running at a different location, please manually check your integration.  Learn more"
]
end
@@ -64,7 +64,7 @@ defmodule PlausibleWeb.Live.Components.VerificationTest do
finished?: true
)
- assert class_of_element(html, @pulsating_circle) =~ "hidden"
+ refute element_exists?(html, @pulsating_circle)
assert element_exists?(html, @check_circle)
end
diff --git a/test/plausible_web/live/verification_test.exs b/test/plausible_web/live/verification_test.exs
index b8bead83c7..f8e69d909a 100644
--- a/test/plausible_web/live/verification_test.exs
+++ b/test/plausible_web/live/verification_test.exs
@@ -10,17 +10,17 @@ defmodule PlausibleWeb.Live.VerificationTest do
@verification_modal ~s|div#verification-modal|
@retry_button ~s|a[phx-click="retry"]|
@go_to_dashboard_button ~s|a[href$="?skip_to_dashboard=true"]|
- @progress ~s|div#progress|
+ @progress ~s|#progress-indicator p#progress|
+ @heading ~s|#progress-indicator h3|
describe "GET /:domain" do
test "static verification screen renders", %{conn: conn, site: site} do
resp = conn |> no_slowdown() |> get("/#{site.domain}") |> html_response(200)
assert text_of_element(resp, @progress) =~
- "We're visiting your site to ensure that everything is working correctly"
+ "We're visiting your site to ensure that everything is working"
assert resp =~ "Verifying your integration"
- assert resp =~ "on #{site.domain}"
assert resp =~ "Need to see the snippet again?"
assert resp =~ "Run verification later and go to Site Settings?"
refute resp =~ "modal"
@@ -46,10 +46,9 @@ defmodule PlausibleWeb.Live.VerificationTest do
{_, html} = get_lv_standalone(conn, site)
assert html =~ "Verifying your integration"
- assert html =~ "on #{site.domain}"
assert text_of_element(html, @progress) =~
- "We're visiting your site to ensure that everything is working correctly"
+ "We're visiting your site to ensure that everything is working"
end
test "eventually verifies installation", %{conn: conn, site: site} do
@@ -70,7 +69,7 @@ defmodule PlausibleWeb.Live.VerificationTest do
html = render(lv)
assert html =~ "Success!"
- assert html =~ "Your integration is working and visitors are being counted accurately"
+ assert html =~ "Your integration is working"
end
test "eventually fails to verify installation", %{conn: conn, site: site} do
@@ -85,8 +84,8 @@ defmodule PlausibleWeb.Live.VerificationTest do
{html =~ "", html}
{
- text_of_element(html, @progress) =~
- "We couldn't find the Plausible snippet on your site",
+ text_of_element(html, @heading) =~
+ "We couldn't find the Plausible snippet",
html
}
end)
@@ -123,7 +122,7 @@ defmodule PlausibleWeb.Live.VerificationTest do
assert text_of_attr(html, @verify_button, "x-on:click") =~ "open-modal"
assert text_of_element(html, @progress) =~
- "We're visiting your site to ensure that everything is working correctly"
+ "We're visiting your site to ensure that everything is working"
lv |> element(@verify_button) |> render_click()
@@ -153,8 +152,8 @@ defmodule PlausibleWeb.Live.VerificationTest do
eventually(fn ->
html = render(lv)
- {text_of_element(html, @progress) =~
- "We couldn't find the Plausible snippet on your site", html}
+ {text_of_element(html, @heading) =~
+ "We couldn't find the Plausible snippet", html}
end)
assert element_exists?(html, @retry_button)