You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
Use the following commands to manage reviews:
@coderabbitai resume to resume automatic reviews.
@coderabbitai review to trigger a single review.
Use the checkboxes below for quick actions:
▶️ Resume reviews
🔍 Trigger review
📝 Walkthrough
Walkthrough
Adds a gated-content form action with token generation/storage/validation, DB table and migrations, admin UI/JS and styles, shortcode rendering, query hooks to unlock private/passworded posts, hook wiring, and unit/integration tests.
Changes
Gated Content Form Action Feature
Layer / File(s)
Summary
Core Data Models and Action classes/models/FrmGatedItem.php, classes/models/FrmGatedToken.php, classes/models/FrmGatedContentAction.php
Value objects for gated items and tokens, plus FrmGatedContentAction implementing the gated_content form action, post selectors, shortcodes, and settings sanitization.
Token Generation & Validation System classes/helpers/FrmGatedTokenHelper.php
Generates 32-character raw tokens, hashes and persists rows, manages per-request/transient caches, validates tokens via URL→cookie→user→filter chain, handles cookies and membership caching, and provides cleanup.
Adds frm_gated_tokens table and bumps plugin DB version to 106; uninstall drops the table.
Post Access Control & Query Filtering classes/controllers/FrmGatedContentController.php
Includes private posts in main singular queries when a token validates, unlocks password-protected posts for a validated token (bypasses password check only for that post), strips access_code via redirect, and forces 404 for unauthorized private posts; clears caches on action updates/deletes.
Admin UI for configuring gated items, item row template, shortcode reference, autocomplete for large post lists, and styles for layout and copy controls.
Client-side Admin Logic js/src/admin/admin.js
Manages dynamic gated-content item rows: type activation, reindexing, deterministic per-row IDs, file-field filtering, and shortcode copy UX with fallback.
Tests that action triggers generate tokens and respect configured events (e.g., payment-success).
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~60 minutes
Suggested labels
run tests
Suggested reviewers
garretlaxton
Crabcyborg
Poem
🐰 I hopped through tokens, keys in paw,
I tucked a shortcode by the door,
Private posts now find a way,
Links and tokens lead the day,
A rabbit cheers the code once more.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name
Status
Explanation
Resolution
Title check
❓ Inconclusive
The title 'Rock gated content' is vague and generic, using unclear phrasing that does not convey specific information about the changeset despite implementing substantial gated content functionality.
Consider revising the title to be more descriptive, such as 'Add gated content feature with token validation' or 'Implement gated content access control system' to better communicate the main changes.
✅ Passed checks (4 passed)
Check name
Status
Explanation
Description Check
✅ Passed
Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage
✅ Passed
Docstring coverage is 95.51% which is sufficient. The required threshold is 80.00%.
Linked Issues check
✅ Passed
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
✅ Passed
Check skipped because no linked issues were found for this pull request.
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches🧪 Generate unit tests (beta)
Create PR with unit tests
Commit unit tests in branch rock-gated-content
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
We reviewed changes in 4d7b13f...cdd8856 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
The reason will be displayed to describe this comment to others. Learn more.
`shortcode` has a cyclomatic complexity of 19 with "High" risk
A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related PR: https://github.com/Strategy11/formidable-pro/pull/6451
Summary by CodeRabbit
New Features
Tests
Chores