Skip to content

MR-33: Add subscription view shortcode#17

Open
av3nger wants to merge 2 commits into
feature/MR-9-expiry-bannerfrom
feature/MR-33-sub-view-shortcode
Open

MR-33: Add subscription view shortcode#17
av3nger wants to merge 2 commits into
feature/MR-9-expiry-bannerfrom
feature/MR-33-sub-view-shortcode

Conversation

@av3nger

@av3nger av3nger commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR adds a shortcode and URL helper for the subscriptions section of a member's Memberful account, and points the expiry banner's "Renew" link at it so members land directly on their subscriptions instead of the account landing page.

What's included

  • New memberful_subscriptions_url() helper (custom-domain aware) for …/account/subscriptions.
  • New [memberful_subscriptions_link] shortcode, mirroring [memberful_account_link].
  • Expiry banner: the Renew link now uses memberful_subscriptions_url() instead of memberful_account_url().

Test plan

  • Add [memberful_subscriptions_link]Manage subscriptions[/memberful_subscriptions_link] to a page and confirm it links to …/account/subscriptions (and respects a configured custom domain).
  • Trigger the expiry banner and confirm the Renew now link now lands on the subscriptions section.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@av3nger, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 53 minutes and 17 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: TheCodeCompany/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 81f77b1e-9cf5-4d95-a16e-12e5988121bc

📥 Commits

Reviewing files that changed from the base of the PR and between 9108743 and d852448.

📒 Files selected for processing (1)
  • wordpress/wp-content/plugins/memberful-wp/src/shortcodes.php
📝 Walkthrough

Walkthrough

The PR adds a new helper function to generate subscriptions URLs, refactors the expiry banner to use it for renewal links, and introduces a new WordPress shortcode for embedding subscriptions links in content.

Changes

Subscriptions URL and integration points

Layer / File(s) Summary
URL helper for subscriptions
wordpress/wp-content/plugins/memberful-wp/src/urls.php
New memberful_subscriptions_url() function generates a URL to the Memberful account/subscriptions route, respecting an optional format parameter and defaulting to HTML.
Expiry banner refactoring to use subscriptions URL
wordpress/wp-content/plugins/memberful-wp/src/expiry_banner.php
memberful_wp_render_expiry_banner() now calls memberful_subscriptions_url() to build the renewal link. The message builder signature changes from account_url to renew_url and escapes the URL when constructing the renewal hyperlink.
New subscriptions link shortcode
wordpress/wp-content/plugins/memberful-wp/src/shortcodes.php
Registers memberful_subscriptions_link shortcode with a handler that outputs an anchor element linking to the subscriptions URL and renders nested shortcode content.

🔗 A helper emerges with care,
Two paths now share the URL they bear,
Subscriptions bloom in shortcode's place,
While banners renew with newfound grace. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a subscription view shortcode as described in the PR objectives and changeset.
Description check ✅ Passed The description is directly related to the changeset, clearly explaining the new shortcode, URL helper, and expiry banner updates with a detailed test plan.
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 feature/MR-33-sub-view-shortcode

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@wordpress/wp-content/plugins/memberful-wp/src/shortcodes.php`:
- Around line 64-66: The shortcode function
memberful_wp_shortcode_subscriptions_link outputs an unescaped URL into an
anchor href; update memberful_wp_shortcode_subscriptions_link to pass the result
of memberful_subscriptions_url() through esc_url() before concatenating into the
returned string (i.e., use esc_url( memberful_subscriptions_url() ) for the
href) while preserving the existing do_shortcode($content) and role attribute.
- Line 4: Update the plugin readme to document the new shortcode and the
renew-link behavior change: add an entry describing the
memberful_subscriptions_link shortcode and its usage, mention the handler
function memberful_wp_shortcode_subscriptions_link as the implementation, and
explicitly note the changed renew-link behavior so users know how subscription
renewal links now behave; ensure the readme includes examples, expected output,
and any shortcode attributes or prerequisites introduced by this PR.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: TheCodeCompany/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2963c367-1388-46e7-87be-542a38ce92d8

📥 Commits

Reviewing files that changed from the base of the PR and between 33715d2 and 9108743.

📒 Files selected for processing (3)
  • wordpress/wp-content/plugins/memberful-wp/src/expiry_banner.php
  • wordpress/wp-content/plugins/memberful-wp/src/shortcodes.php
  • wordpress/wp-content/plugins/memberful-wp/src/urls.php

Comment thread wordpress/wp-content/plugins/memberful-wp/src/shortcodes.php
Comment thread wordpress/wp-content/plugins/memberful-wp/src/shortcodes.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants