Skip to content

Usage tracking for test mode in Lite#2941

Open
truongwp wants to merge 5 commits intomasterfrom
test-mode-usage-tracking
Open

Usage tracking for test mode in Lite#2941
truongwp wants to merge 5 commits intomasterfrom
test-mode-usage-tracking

Conversation

@truongwp
Copy link
Copy Markdown
Contributor

@truongwp truongwp commented Feb 5, 2026

This tracks the number of times user views the test mode without the add-on installed and with the chat form.

This is tracked in the flows data with the format:

[view_test_mode] => Array
    (
        [no_addon] => 1
        [chat_form] => 2
    )

Summary by CodeRabbit

  • Enhancements
    • Test mode usage tracking now captures each form action's type for richer analytics.
    • Tracking added for chat-enabled form tests and for absent addon status to improve visibility.
    • Improved data collection during test mode to help identify patterns and optimize form behavior.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 5, 2026

Warning

Rate limit exceeded

@truongwp has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 0 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.

📝 Walkthrough

Walkthrough

Adds usage-tracking calls when rendering test mode (captures chat-form views and missing addon views) and injects hidden inputs into the test mode form mapping each form action ID to its type for submission.

Changes

Cohort / File(s) Summary
Usage tracking changes
classes/controllers/FrmTestModeController.php, classes/controllers/FrmUsageController.php
Inserted calls to FrmUsageController::update_flows_data() when rendering test mode for chat forms and when the addon is absent; changed FLOWS_ACTION_NAME constant visibility to private and updated update_flows_data docblock.
Test mode form inputs
classes/views/test-mode/container.php
Added hidden inputs (frm_testmode[form_action_types][<ID>]) that map each form action ID to its type (from post_excerpt) for submission with the test mode form.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibble on code, a quiet little tug,

I note each chat and missing plugin snug,
Hidden seeds of types I tuck in neat,
Hopping through test mode with tiny feet,
Data softly gathered — a carrot treat. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Usage tracking for test mode in Lite' accurately summarizes the main change: implementing usage tracking for test mode views when the add-on is not installed and for chat forms.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test-mode-usage-tracking

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.

@deepsource-io
Copy link
Copy Markdown

deepsource-io bot commented Feb 5, 2026

Here's the code health analysis summary for commits f1a73c6..d6425e3. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource PHP LogoPHP❌ Failure
❗ 1 occurence introduced
View Check ↗
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link
Copy Markdown
Contributor

@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

🤖 Fix all issues with AI agents
In `@classes/controllers/FrmUsageController.php`:
- Line 18: The class constant declaration "private const FLOWS_ACTION_NAME" in
FrmUsageController causes a PHP 7.0 parse error because visibility on constants
is supported only from PHP 7.1; change the declaration to a plain const
FLOWS_ACTION_NAME (remove the "private" visibility) inside the
FrmUsageController class (or alternatively update project PHP requirement to
>=7.1), ensuring all references to FLOWS_ACTION_NAME continue to work.

@truongwp truongwp removed the run tests label Feb 5, 2026
@truongwp truongwp requested a review from Crabcyborg February 5, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant