Tweak cron log message#3146
Conversation
📝 WalkthroughWalkthroughAdded FrmTransLiteSubscription::get_active_subscriptions() to fetch subscriptions with status 'active' or 'future_cancel', and updated run_payment_cron() log messages from "Stripe Cron Message" to "Overdue Subscription Cron Message" for the initial subscriptions-found line and each per-subscription log. ChangesSubscription cron and query
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Jun 12, 2026 6:32p.m. | Review ↗ | |
| JavaScript | Jun 12, 2026 6:32p.m. | Review ↗ |
Important
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.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
stripe/controllers/FrmTransLiteAppController.php (1)
66-68: ⚡ Quick winConsider short-circuiting the active subscriptions query.
The current logic calls
get_active_subscriptions()even when$overdue_subscriptionsis non-empty. Since the early return only happens when both conditions are true, you could optimize by checking if overdue subscriptions exist first:if ( ! $overdue_subscriptions && ! $frm_sub->get_active_subscriptions() ) { return; }Could be optimized to:
if ( ! $overdue_subscriptions ) { if ( ! $frm_sub->get_active_subscriptions() ) { return; } }This avoids querying active subscriptions when there are already overdue subscriptions to process.
⚡ Proposed optimization
-if ( ! $overdue_subscriptions && ! $frm_sub->get_active_subscriptions() ) { - return; -} +if ( ! $overdue_subscriptions ) { + if ( ! $frm_sub->get_active_subscriptions() ) { + return; + } +}🤖 Prompt for 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. In `@stripe/controllers/FrmTransLiteAppController.php` around lines 66 - 68, Change the conditional so you short-circuit the call to FrmSubscription::get_active_subscriptions(): check $overdue_subscriptions first and only call $frm_sub->get_active_subscriptions() when $overdue_subscriptions is empty; i.e., replace the single combined if ( ! $overdue_subscriptions && ! $frm_sub->get_active_subscriptions() ) return; with a two-step check that returns early if $overdue_subscriptions is empty and $frm_sub->get_active_subscriptions() also returns false, thereby avoiding unnecessary calls to get_active_subscriptions().
🤖 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.
Nitpick comments:
In `@stripe/controllers/FrmTransLiteAppController.php`:
- Around line 66-68: Change the conditional so you short-circuit the call to
FrmSubscription::get_active_subscriptions(): check $overdue_subscriptions first
and only call $frm_sub->get_active_subscriptions() when $overdue_subscriptions
is empty; i.e., replace the single combined if ( ! $overdue_subscriptions && !
$frm_sub->get_active_subscriptions() ) return; with a two-step check that
returns early if $overdue_subscriptions is empty and
$frm_sub->get_active_subscriptions() also returns false, thereby avoiding
unnecessary calls to get_active_subscriptions().
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d535c834-5953-4eae-894f-503fafb0d0ac
📒 Files selected for processing (2)
stripe/controllers/FrmTransLiteAppController.phpstripe/models/FrmTransLiteSubscription.php
Summary by CodeRabbit