MR-11: Shortcodes to use BeaverBuilder shared rows just don't work - #25
MR-11: Shortcodes to use BeaverBuilder shared rows just don't work#25av3nger wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default 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 higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e23bb5e. Configure here.
| } | ||
| } | ||
|
|
||
| return TRUE; |
There was a problem hiding this comment.
Settings match can strip public modules
Medium Severity
memberful_wp_beaver_builder_settings_match treats a saved module as a match when its settings are only a subset of the exporter's merged settings. Unrelated public modules with the same type and overlapping defaults (spacers, separators, duplicate headings/buttons) can therefore be emptied from the fallback whenever an identical module sits under a Memberful-restricted row or column.
Additional Locations (1)
Triggered by team rule: Code Review Guidelines
Reviewed by Cursor Bugbot for commit e23bb5e. Configure here.
There was a problem hiding this comment.
It will only strip exact-duplicate modules from the search/excerpt fallback (never the rendered page, never leaking restricted content), and it's an unavoidable tradeoff since BB's export path drops node IDs.
# Conflicts: # wordpress/wp-content/plugins/memberful-wp/readme.txt # wordpress/wp-content/plugins/memberful-wp/src/content_filter.php # wordpress/wp-content/plugins/memberful-wp/src/global_marketing.php


Summary
This PR fixes a request-scoped side effect in the content protection filter that silently broke Beaver Builder layouts: when a protected post was rendered anywhere in a request (archive loop, widget, related-posts block), Memberful permanently removed Beaver Builder's the_content hook, so every BB layout rendered later in that same request disappeared and visitors saw raw fallback content instead.
While tracing that, several smaller defects in the same code path were found and fixed: a duplicate protection filter being registered while building the global marketing teaser, block-emitted shortcodes never executing inside marketing content, an empty teaser wrapper (plus its CSS) being output for posts with no "teasable" content, and the Sensei integration failing to unhook content protection at all.
What's included
Scope and behaviour
Test plan
All flows tested logged out on a site running Beaver Builder Pro, with global marketing + snippets enabled.
render). Before: BB's the_content hook is gone after the protected render and the BB page shows its raw fallback content. After: the hook survives (has_filter returns its original priority) and the BB layout renders.
Note
Medium Risk
Changes run on every protected
the_contentpass and global-marketing teaser builds; incorrect hook restore could still leak BB layout into paywalls or break later renders, though behavior is intended to match pre-fix output for the gated post itself.Overview
Fixes a request-scoped bug where gating a protected post removed Beaver Builder’s
the_contenthook without putting it back, so later posts in the same request (archives, widgets, related content) lost their BB layouts. The paywall path still stripsFLBuilder::render_contentwhile marketing content is built, but now captures priority, restores the hook (including a latethe_contentcallback when needed), and unifies paywall/divider return paths.Adds a new Beaver Builder integration (
beaver-builder.php): Memberful visibility on row/column/module Advanced settings (aligned with block editor), runtime node hiding by login/plan, and stripping restricted modules from BB’spost_contentfallback on save.Global marketing / filter chain: drops a broken
remove_action/add_actionat priority -10 that duplicatedmemberful_wp_protect_content; movesdo_blocksto priority 9 on the marketing filter so block-emitted shortcodes run; only outputs teaser wrapper/CSS when there is real teaser text. Sensei: passes priority 100 when unhooking content protection so that integration actually works.Reviewed by Cursor Bugbot for commit e23bb5e. Bugbot is set up for automated code reviews on this repo. Configure here.