A follow-up to https://github.com/plausible/analytics/pull/4277, which started counting pending ownership sites towards usage on the upgrade page. However, it didn't change the logic of how a plan box is highlighted as the "recommended tier".
This PR fixes that by implementing the following logic behind the recommended tier decision:
Recommend a plan based on the usage and highest available Growth and Business plans:
take the highest growth plan available for the user and see if its usage is exceeded
if exceeded, check if the highest Business plan accommodates this usage
if even the business plan does not accommodate the usage, recommend Enterprise.
Prioritize a "Recommended" highlight pill for the plan boxes, over "Current".
The "Current" highlight will only be displayed if the currently owned tier is also recommended
Tests
[x] Automated tests have been added
Changelog
[x] This PR does not make a user-facing change
Documentation
[x] This change does not need a documentation update
Changes
A follow-up to https://github.com/plausible/analytics/pull/4277, which started counting pending ownership sites towards usage on the upgrade page. However, it didn't change the logic of how a plan box is highlighted as the "recommended tier".
This PR fixes that by implementing the following logic behind the recommended tier decision:
Tests
Changelog
Documentation
Dark mode