Skip to content

Conversation

@danieliser
Copy link
Member

Summary

Implements comprehensive upsell enhancement system with intelligent priority-based trigger selection inspired by the Review Request module pattern.

Priority System

4 Priority Groups (highest to lowest):

  1. Milestone Achievements (pri: 100) - Celebration messages for user success
  2. Conversion Extrapolation (pri: 80) - Data-driven "you could have X more" messaging
  3. Integration Detected (pri: 60) - Contextual plugin-based messages
  4. Generic Upgrade (pri: 40) - Fallback messages

New Milestone Triggers

  • 🎉 First form conversion: Celebration message with 300-500% increase stat
  • 📈 High engagement tiers: 1K, 5K, 10K+ popup views with analytics pitch
  • 90-day cooldown: Prevents message fatigue while allowing seasonal re-engagement
  • Natural progression: Celebration → extrapolation → integration → generic

New Extrapolation Messages

  • 💰 Ecommerce users: "You've tracked X form submissions. With Pro+ Exit Intent, you could capture ~Y more!"
    • Uses 33% extrapolation based on industry averages
    • Requires minimum 3 submissions for credibility
  • 🎓 LMS users: "You've tracked X form submissions. With Pro+ LMS targeting, you could capture ~Y more!"
    • Uses 40% extrapolation for education sector
    • Requires minimum 3 submissions
  • Accurate terminology: Uses "form submissions" not "conversions/enrollments" (free plugin doesn't track specific conversion types - that's what Pro is for!)

Milestone Cooldown System

  • 90-day cooldown period for milestone re-showing (seasonal re-engagement)
  • Tracks via user meta: _pum_last_milestone_trigger, _pum_last_milestone_at
  • Prevents showing same milestone repeatedly within cooldown
  • Allows different milestones to show as user progresses
  • Non-milestone messages (integration, generic) unaffected by cooldown

Technical Implementation

  • New methods:
    • get_notice_bar_triggers() - Priority-based trigger definition system
    • get_current_notice_bar_trigger() - Intelligent trigger selection with cooldown logic
    • get_form_conversion_count() - Helper with graceful fallback
    • rsort_by_priority() - Consistent priority sorting
  • Integration:
    • Connects to FormConversionTracking service (gracefully degrades if not available)
    • Uses existing popup view count for engagement milestones
    • All messages use generate_upgrade_url() for UTM tracking
  • Backward compatibility:
    • Deprecated old helper methods with @deprecated tags
    • Maintains existing integration detection logic
    • Fallback to generic messages ensures no user sees empty notice bar

Impact

  • Success-triggered messaging instead of frustration-based upsells
  • Data-driven value propositions with concrete numbers
  • Contextual relevance based on actual user behavior and installed plugins
  • Foundation for A/B testing (priority system makes message variants easy to test)
  • Milestone celebration creates positive emotional association with upgrade
  • Accurate terminology that doesn't over-promise on free plugin tracking
  • Quarterly re-engagement prevents message fatigue (90-day cooldown)

Testing Scenarios

  • 0 form submissions: Should skip milestone triggers, show integration or generic
  • 1 form submission: Should show celebration message
  • 1 form submission (repeat visit within 90 days): Should skip to next trigger (cooldown working)
  • 1 form submission (after 90 days): Should re-show celebration (cooldown expired)
  • 3+ form submissions + ecommerce: Should show extrapolation message
  • Popup view milestones: Test 1K, 5K, 10K+ view thresholds
  • Fallback behavior: Verify generic messages work when no triggers match
  • Pro vs Free users: Verify Pro users see Pro+ messages, Free users see Pro messages

Files Changed

  • classes/Upsell.php - Complete refactor of message generation system (2 commits)

Commits

  1. b283d213 - feat: add priority-based notice bar with milestone and extrapolation messaging
  2. 68c51ed5 - fix: improve messaging accuracy and add milestone cooldown system

🤖 Ready for CodeRabbit review

Add complete HappyForms integration following the established three-component pattern:

**Core JavaScript Integration:**
- Event listener for 'happyforms.submitted' custom event
- Form instance ID tracking for multi-form support
- Popup ID injection on popup open

**Core PHP Integration:**
- Hook: `happyforms_submission_success` action
- Detection: HappyForms_Core class check
- Form retrieval via 'happyform' CPT
- Defensive hook callbacks (no strict types)

**Changes:**
- assets/js/src/integration/happyforms.js (new)
- classes/Integration/Form/HappyForms.php (new)
- classes/Integrations.php (registration)
- assets/js/src/integration/index.js (import)

**Pattern Compliance:**
✅ Defensive hook callbacks
✅ Form instance ID tracking
✅ Proper phpcs:ignore comments
✅ WordPress coding standards
…messaging

Implements comprehensive upsell enhancement system with 4 priority groups:

**Priority System:**
- Milestone Achievements (pri: 100) - Celebration messages for success
- Conversion Extrapolation (pri: 80) - Data-driven "you could have X more"
- Integration Detected (pri: 60) - Contextual plugin-based messages
- Generic Upgrade (pri: 40) - Fallback messages

**New Milestone Triggers:**
- First form conversion celebration (🎉 with 300-500% increase stat)
- High engagement tiers (1K, 5K, 10K+ popup views with analytics pitch)

**New Extrapolation Messages:**
- Ecommerce: "You've tracked X conversions, capture ~Y more with Exit Intent"
- LMS: "You've tracked X enrollments, capture ~Y more with LMS targeting"
- Uses 33% extrapolation for ecommerce, 40% for LMS

**Integration:**
- Connects to FormConversionTracking service for milestone data
- Uses existing popup view count for engagement milestones
- Maintains backward compatibility with existing integration detection

**Technical Changes:**
- Added get_notice_bar_triggers() with Review Request pattern
- Added get_current_notice_bar_trigger() for priority selection
- Added get_form_conversion_count() helper with graceful fallback
- Added rsort_by_priority() for consistent sorting
- Deprecated get_integration_messages(), get_pro_integration_message(), get_free_upgrade_message()
- All messages use generate_upgrade_url() for UTM tracking

**Impact:**
- Success-triggered messaging (not frustration-based)
- Data-driven value propositions with concrete numbers
- Foundation for future A/B testing and message optimization
**Messaging Accuracy:**
- Changed "conversions" → "form submissions" (free plugin doesn't track specific conversion types)
- Changed "enrollments" → "form submissions" for LMS (specific tracking is Pro feature)
- Updated translator comments to reflect accurate terminology

**Milestone Cooldown:**
- Added 90-day cooldown for milestone achievement messages (seasonal re-engagement)
- Tracks last shown milestone via user meta: _pum_last_milestone_trigger, _pum_last_milestone_at
- Prevents showing same milestone repeatedly within cooldown period
- Allows different milestones to show (e.g., first form → high engagement)
- Non-milestone messages (integration detected, generic upgrade) unaffected

**Impact:**
- More accurate messaging that doesn't over-promise on free plugin tracking
- Quarterly milestone re-engagement prevents message fatigue
- Natural progression: celebration → extrapolation → generic
@coderabbitai
Copy link

coderabbitai bot commented Jan 11, 2026

Warning

Rate limit exceeded

@danieliser has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 22 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between cceae66 and 68c51ed.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • assets/js/src/integration/happyforms.js
  • assets/js/src/integration/index.js
  • classes/Integration/Form/HappyForms.php
  • classes/Integrations.php
  • classes/Upsell.php

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.

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