Skip to content

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

Release 3.0.0 (#5309)

hq196ebd01f008f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3f0db87224..d5fc43bee0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.
## Unreleased
+### Added
+
+### Removed
+
+### Changed
+
+## v3.0.0 - 2025-04-11
+
### Added
- Ability to sort by and compare the `exit_rate` metric in the dashboard Exit Pages > Details report
- Add top 3 pages into the traffic spike email
@@ -71,7 +79,7 @@ All notable changes to this project will be documented in this file.
- Fix Conversion Rate metrics column disappearing from reports when "Goal is ..." filter is within a segment
- Graph tooltip now shows year when graph has data from multiple years
-## v2.1.5-rc.1 - 2025-01-17
+## v2.1.5 - 2025-02-03
### Added
diff --git a/lib/plausible/auth/user.ex b/lib/plausible/auth/user.ex
index ef4e0e373b..bae6c03517 100644
--- a/lib/plausible/auth/user.ex
+++ b/lib/plausible/auth/user.ex
@@ -47,6 +47,11 @@ defmodule Plausible.Auth.User do
has_many :owner_memberships, Plausible.Teams.Membership, where: [role: :owner]
has_many :owned_teams, through: [:owner_memberships, :team]
+ on_ce do
+ # we only need this for backfill teams migration to work; let's figure out how to safely remove later on
+ field :trial_expiry_date, :date
+ end
+
timestamps()
end
diff --git a/lib/plausible/data_migration/backfill_teams.ex b/lib/plausible/data_migration/backfill_teams.ex
index dbe1bfbb54..a74badee39 100644
--- a/lib/plausible/data_migration/backfill_teams.ex
+++ b/lib/plausible/data_migration/backfill_teams.ex
@@ -14,10 +14,21 @@ defmodule Plausible.DataMigration.BackfillTeams do
end
def run(opts \\ []) do
+ start_cloak()
+
dry_run? = Keyword.get(opts, :dry_run?, true)
Repo.transaction(fn -> backfill(dry_run?) end, timeout: :infinity)
end
+ defp start_cloak() do
+ Application.ensure_all_started(:cloak)
+ Application.ensure_all_started(:cloak_ecto)
+ Plausible.Auth.TOTP.Vault.start_link(key: totp_vault_key())
+ rescue
+ _ ->
+ :ok
+ end
+
defp backfill(dry_run?) do
# Orphaned teams
@@ -614,4 +625,10 @@ defmodule Plausible.DataMigration.BackfillTeams do
defp log(msg) do
IO.puts("[#{DateTime.utc_now(:second)}] #{msg}")
end
+
+ defp totp_vault_key() do
+ :plausible
+ |> Application.fetch_env!(Plausible.Auth.TOTP)
+ |> Keyword.fetch!(:vault_key)
+ end
end
diff --git a/lib/plausible_web/email.ex b/lib/plausible_web/email.ex
index 01b2996a0d..c822425f41 100644
--- a/lib/plausible_web/email.ex
+++ b/lib/plausible_web/email.ex
@@ -554,7 +554,7 @@ defmodule PlausibleWeb.Email do
def priority_email(%{layout: layout}) do
email = base_email(%{layout: layout})
- if Plausible.ee?() do
+ if ee?() do
put_param(email, "MessageStream", "priority")
else
email
diff --git a/lib/plausible_web/templates/email/create_site_email.html.heex b/lib/plausible_web/templates/email/create_site_email.html.heex
index 0ebe47aeb8..078087a2d3 100644
--- a/lib/plausible_web/templates/email/create_site_email.html.heex
+++ b/lib/plausible_web/templates/email/create_site_email.html.heex
@@ -1,10 +1,10 @@
You've activated
-<%= if Plausible.ee?() do %>
+<%= if ee?() do %>
your free 30-day trial of
<% end %>
{Plausible.product_name()}, a simple and privacy-friendly website analytics tool. <br /><br />
<a href={"#{plausible_url()}/sites/new"}>Click here</a>
to add your website URL, your timezone and install our one-line JavaScript snippet to start collecting visitor statistics.
-<%= if Plausible.ee?() do %>
+<%= if ee?() do %>
<br /><br />Do reply back to this email if you have any questions or need some guidance.
<% end %>
diff --git a/lib/plausible_web/templates/email/site_setup_help_email.html.heex b/lib/plausible_web/templates/email/site_setup_help_email.html.heex
index 1f361275bc..2d77b06f64 100644
--- a/lib/plausible_web/templates/email/site_setup_help_email.html.heex
+++ b/lib/plausible_web/templates/email/site_setup_help_email.html.heex
@@ -1,4 +1,4 @@
-<%= if Plausible.ee?() and Plausible.Teams.on_trial?(@site_team) do %>
+<%= if ee?() and Plausible.Teams.on_trial?(@site_team) do %>
You signed up for a free 30-day trial of Plausible, a simple and privacy-friendly website analytics tool.
<br /><br />
<% end %>
@@ -9,6 +9,6 @@ This Plausible script is 45 times smaller than Google Analytics script so you’
<br /><br /> On WordPress? We have a
<a href="https://plausible.io/wordpress-analytics-plugin">WordPress plugin</a> that makes the process simpler. We also have
<a href="https://plausible.io/docs/integration-guides">integration guides</a> for different site builders to help you start counting stats in no time.
-<%= if Plausible.ee?() do %>
+<%= if ee?() do %>
<br /><br /> Do reply back to this email if you have any questions or need some guidance.
<% end %>
diff --git a/lib/plausible_web/templates/site/new.html.heex b/lib/plausible_web/templates/site/new.html.heex
index 6b373c3779..a504d2089e 100644
--- a/lib/plausible_web/templates/site/new.html.heex
+++ b/lib/plausible_web/templates/site/new.html.heex
@@ -14,7 +14,7 @@
resource="sites"
/>
- <%= if is_nil(@current_team) or is_nil(@current_team.trial_expiry_date) do %>
+ <%= if ee?() and (is_nil(@current_team) or is_nil(@current_team.trial_expiry_date)) do %>
<div class="rounded-md bg-blue-50 dark:bg-transparent dark:border border-blue-200 p-4">
<div class="flex">
<div class="flex-shrink-0">
diff --git a/test/plausible_web/controllers/billing_controller_test.exs b/test/plausible_web/controllers/billing_controller_test.exs
index 915a108fc7..6b5e0bada8 100644
--- a/test/plausible_web/controllers/billing_controller_test.exs
+++ b/test/plausible_web/controllers/billing_controller_test.exs
@@ -162,7 +162,7 @@ defmodule PlausibleWeb.BillingControllerTest do
assert %{
"disableLogout" => true,
"email" => user.email,
- "passthrough" => "ee:#{Plausible.ee?()};user:#{user.id};team:#{team.id}",
+ "passthrough" => "ee:#{ee?()};user:#{user.id};team:#{team.id}",
"product" => @configured_enterprise_plan_paddle_plan_id,
"success" => Routes.billing_path(PlausibleWeb.Endpoint, :upgrade_success),
"theme" => "none"
@@ -337,7 +337,7 @@ defmodule PlausibleWeb.BillingControllerTest do
assert %{
"disableLogout" => true,
"email" => user.email,
- "passthrough" => "ee:#{Plausible.ee?()};user:#{user.id};team:#{team.id}",
+ "passthrough" => "ee:#{ee?()};user:#{user.id};team:#{team.id}",
"product" => @configured_enterprise_plan_paddle_plan_id,
"success" => Routes.billing_path(PlausibleWeb.Endpoint, :upgrade_success),
"theme" => "none"
diff --git a/test/plausible_web/controllers/site_controller_test.exs b/test/plausible_web/controllers/site_controller_test.exs
index 0eafd90de4..f1c41a7266 100644
--- a/test/plausible_web/controllers/site_controller_test.exs
+++ b/test/plausible_web/controllers/site_controller_test.exs
@@ -430,7 +430,7 @@ defmodule PlausibleWeb.SiteControllerTest do
assert html_response(conn, 200) =~
"This domain cannot be registered. Perhaps one of your colleagues registered it?"
- if Plausible.ee?() do
+ if ee?() do
assert html_response(conn, 200) =~ "[email protected]"
else
refute html_response(conn, 200) =~ "[email protected]"
@@ -453,7 +453,7 @@ defmodule PlausibleWeb.SiteControllerTest do
assert html_response(conn, 200) =~
"This domain cannot be registered. Perhaps one of your colleagues registered it?"
- if Plausible.ee?() do
+ if ee?() do
assert html_response(conn, 200) =~ "[email protected]"
else
refute html_response(conn, 200) =~ "[email protected]"