MR-5: Metered Paywall - #28
Conversation
# Conflicts: # wordpress/wp-content/plugins/memberful-wp/src/content_filter.php # wordpress/wp-content/plugins/memberful-wp/stylesheets/admin.css
# Conflicts: # wordpress/wp-content/plugins/memberful-wp/stylesheets/admin.css
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8cda277. Configure here.
| $result[] = strtolower( $term->name ); | ||
| } | ||
|
|
||
| return $result; |
There was a problem hiding this comment.
Term rules match names too
Medium Severity
Category and tag conditions compare saved slugs against both each term's slug and its lowercased name. A rule for one term therefore also matches a different term whose name equals that slug, so the wrong posts are included or excluded.
Reviewed by Cursor Bugbot for commit 8cda277. Configure here.


Summary
This PR adds a metered paywall on top of the existing Memberful paywall: a "free article allowance" that lets anonymous visitors and registered free members read a configurable number of matching posts within a rolling period before the paywall is shown.
What's included
{count}template, shown only while the visitor is still being sampled.Test plan
{count}button, and confirm it shows the remaining count while sampling and disappears once the meter trips.Note
High Risk
Touches content filtering, paywall gating, cookie-backed view counting, and cache-bypass behavior—misconfiguration or aggressive edge caching can leak full articles or block legitimate readers.
Overview
Adds a metered paywall on top of the global paywall: publishers get a new Metering settings tab with rolling limits for anonymous vs free-member readers, include/except rule groups (post type, category, tag, URL), optional metering of members-only posts, and a per-post exempt from metering metabox. Runtime logic in
Memberful_Metering_Accessdecides per singular GET request whether to ignore metering, allow a free sample (full post), or trip the meter; views are stored in a signed HttpOnly cookie (anonymous) or user meta (logged in), with no-store / DONOTCACHEPAGE on metered responses and 503 on prefetch when a new view would be counted.Content protection now consults that decision only for the main queried post: samples bypass the paywall; a tripped meter forces the same gating as lacking access. Listing teasers gain a path to rebuild content above the paywall divider when block parsing strips the marker.
The paywall builder can show an optional
{limit}counter (viamemberful_paywall_free_view_limit) and swap the primary CTA to free registration when a logged-out visitor hits the meter and registered limits are > 0. A newmemberful/metering-countdownblock renders remaining free reads while sampling.Admin metering-admin.js powers the interactive rule builder; the block is registered from
block-editor.phpand bundled via webpack.Reviewed by Cursor Bugbot for commit 8cda277. Bugbot is set up for automated code reviews on this repo. Configure here.