Skip to content

Conversation

@xecdev
Copy link
Collaborator

@xecdev xecdev commented Sep 7, 2025

As per title

Summary by CodeRabbit

  • New Features
    • Unlock paid content without reloading the page.
  • Improvements
    • Paywall payment dialog now closes automatically after completion.
  • Chores
    • Upgraded PayButton dependency to v5.0.2 for compatibility and reliability.
  • Documentation
    • Updated version to 4.0.0 across README and headers; added 4.0.0 changelog and refreshed upgrade notice.

@coderabbitai
Copy link

coderabbitai bot commented Sep 7, 2025

Walkthrough

Version and dependency metadata updated: plugin header bumped to 4.0.0, README changelog and upgrade notice added for 4.0.0 (no-reload unlocks, auto-closing payment dialog, PayButton client v5.0.2). Script version strings updated to v5.0.2 in admin and public asset enqueues. No API or behavioral code changes.

Changes

Cohort / File(s) Summary
Documentation & release metadata
README.txt
Stable tag bumped to 4.0.0; new 4.0.0 changelog entry (no-reload content unlocks, auto-closing payment dialog, PayButton client upgraded to v5.0.2); Upgrade Notice updated to 4.0.0.
Plugin header
paybutton.php
Plugin header version changed from 3.3.0 to 4.0.0; no functional/API changes.
Asset enqueue version bumps
includes/class-paybutton-admin.php, includes/class-paybutton-public.php
The version argument for the paybutton-core script changed from '1.0' to '5.0.2' in admin and public enqueue methods; enqueue parameters and logic otherwise unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch my nose—four springs anew,
No reload hops, the content flew.
Dialogs close with gentle cheer,
My client leapt to five-oh-two here.
A rabbit’s clap, a tiny thump—🥕🐇

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-readme-for-4.0.0

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

@xecdev xecdev requested a review from Klakurka September 7, 2025 03:16
@xecdev xecdev self-assigned this Sep 7, 2025
@xecdev xecdev added the documentation Improvements or additions to documentation label Sep 7, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
README.txt (2)

77-81: Changelog entry reads well; consider noting any BC considerations.

If no template/JS API changes are expected, add a short “No breaking changes” note to set expectations. If there are behavioral tweaks (auto-close), briefly mention any callbacks/events that changed.


136-137: Make the Upgrade Notice more actionable.

Suggest clarifying what’s new and any admin steps (e.g., clear caches), since users see only this in the updater UI.

Apply this minimal tweak:

-= 4.0.0 =
-Upgrade to version 4.0.0 for improved compatibility and reliability.
+= 4.0.0 =
+Upgrade for no-reload content unlocks, auto-closing payment dialog, and the embedded PayButton client v5.0.2. After updating, clear site/server caches to ensure new assets load.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0d0450a and 592eac0.

📒 Files selected for processing (2)
  • README.txt (3 hunks)
  • paybutton.php (1 hunks)
🔇 Additional comments (1)
paybutton.php (1)

5-5: Version bump aligned; ensure release tagging.

Header shows 4.0.0. Looks good alongside README’s stable tag.

Before merging, please:

  • Create a Git tag v4.0.0 and a WordPress.org SVN tag 4.0.0.
  • Confirm the plugin assets (banner/README) are present in the 4.0.0 tag.

Comment on lines +8 to +9
Stable tag: 4.0.0
PayButton Client: 5.0.2
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Stable tag and client version bump look good; verify the enqueued asset actually uses 5.0.2.

Run to confirm what version is enqueued/bundled:


🏁 Script executed:

#!/bin/bash
# Find PayButton client references and versions
rg -nP -C2 '(wp_enqueue_script|wp_register_script)\s*\(|paybutton(\.min)?\.js|PayButton Client|5\.0\.2'
# If bundled, list files that look like the client build
fd -t f -i 'paybutton*.js' | xargs -I{} sh -c 'echo "=== {} ==="; head -n 3 "{}"; echo'

Length of output: 59717


Update enqueued PayButton script version to 5.0.2

  • In includes/class-paybutton-public.php, change the version argument on the wp_enqueue_script call for assets/js/paybutton.js (from '1.0' to '5.0.2').
  • In includes/class-paybutton-admin.php, do the same for the admin enqueue of assets/js/paybutton.js (change '1.0' to '5.0.2').
🤖 Prompt for AI Agents
In README.txt around lines 8-9 and in includes/class-paybutton-public.php and
includes/class-paybutton-admin.php (search for wp_enqueue_script calls for
assets/js/paybutton.js), update the version argument from '1.0' to '5.0.2' so
the enqueued script version matches the PayButton Client; locate the
wp_enqueue_script(...) calls in both public and admin classes and change the
version parameter to '5.0.2', then run a quick test to confirm cache-busting
works as expected.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
includes/class-paybutton-public.php (2)

69-75: Centralize PayButton client version to avoid drift

Define a single constant and reuse it in admin/public enqueues to keep README, code, and assets in sync.

Apply within this file:

-            '5.0.2',
+            PAYBUTTON_CLIENT_VERSION,

Add once (e.g., in paybutton.php bootstrap):

if ( ! defined( 'PAYBUTTON_CLIENT_VERSION' ) ) {
    define( 'PAYBUTTON_CLIENT_VERSION', '5.0.2' );
}

69-75: Consider loading core in footer for better page performance

If nothing depends on paybutton-core in the head, enqueue it in the footer.

-            false
+            true

Please verify no head-time consumers of paybutton-core exist.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 592eac0 and 385447a.

📒 Files selected for processing (2)
  • includes/class-paybutton-admin.php (1 hunks)
  • includes/class-paybutton-public.php (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • includes/class-paybutton-admin.php
🧰 Additional context used
🧬 Code graph analysis (1)
includes/class-paybutton-public.php (1)
assets/js/paybutton.js (1)
  • function(){} (1-1)
🔇 Additional comments (1)
includes/class-paybutton-public.php (1)

69-75: LGTM: version bump to 5.0.2 for cache-busting

The enqueue change looks correct and aligns with the release notes.

@Klakurka Klakurka merged commit 2f337c9 into master Sep 7, 2025
1 check passed
@coderabbitai coderabbitai bot mentioned this pull request Dec 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants