wp-calypso
wp-calypso copied to clipboard
Stats: Update "billable_monthly_views" by excluding the purchased plan quantity
Related to https://github.com/Automattic/red-team/issues/15
Proposed Changes
- Use
billable_monthly_views
by excluding the purchased plan quantity from the API end to determine the purchasable Stats commercial tiers.
Why are these changes being made?
- Use the calculated count from the API rather than do it locally.
Testing Instructions
- Apply the Diff D152811-code and follow its testing instructions.
- Prepare a self-hosted site with only a Jetpack Complete plan.
- Modify the variable
$billable_monthly_views
from the API end code to109999
. - Spin this change up with the Calypso Live link.
- Navigate to the Stats commercial purchase page:
/stats/purchase/{site-slug}?productType=commercial
. - Ensure the first purchase tier is
10K
.
- Modify the variable
$billable_monthly_views
from the API end code to110000
. - Reload the purchase page.
- Ensure the first purchase tier is
100K
.
Pre-merge Checklist
- [ ] Has the general commit checklist been followed? (PCYsg-hS-p2)
- [ ] Have you written new tests for your changes?
- [ ] Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
- [ ] Have you checked for TypeScript, React or other console errors?
- [ ] Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
- [ ] Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
- [ ] For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?