Automattic / Automattic/jetpack
Paid Content Block - Caching Issue for showing correct content on buttons
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
### Impacted plugin
Jetpack
### Quick summary
A user had added 3 different payment plans and payment buttons, but all the buttons were redirecting to the first payment plan only.
If they reload the page, however. then all the buttons link to the correct payment plan.
Tested this further and it looks like a page caching issue with the blocks.
See this screen record:
https://github.com/Automattic/jetpack/assets/84089207/9d8cdb1b-fa7d-4333-b785-bb932bb59c1d
As a workaround, an HE suggested that they create 3 different pages and have payment buttons linked on each of the pages. Then, on the Store page, create 3 columns with buttons that'd link to those pages.
### Steps to reproduce
Add multiple payment plans
Add each plan to a payment button on a page
Save the page
Test or preview the page
All buttons link to the same payment plan, until the page is reloaded and then each button links to its own (and the correct) payment plan.
### A clear and concise description of what you expected to happen.
Each button should link to the correct payment plan, without the need to refresh the page first.
### What actually happened
_No response_
### Impact
One
### Available workarounds?
Yes, difficult to implement
### Platform (Simple and/or Atomic)
Simple
### Logs or notes
_No response_
Contributor guide
Research direction
Start by reproducing the issue with multiple payment plans and payment buttons on one page, then trace the Jetpack Paid Content block and its page-caching behavior. The fix is complete when each button links to its own payment plan immediately after saving, previewing, or testing the page without a reload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- payments, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100