Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions classes/controllers/FrmTestModeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ private static function render_testing_mode_container() {
}

if ( ! empty( $form->options['chat'] ) ) {
// Track view test mode with chat form.
FrmUsageController::update_flows_data( 'view_test_mode', 'chat_form' );
echo '<div class="frm_note_style">' . esc_html__( 'Test Mode is currently not supported for conversational forms.', 'formidable' ) . '</div>';
return;
}
Expand Down Expand Up @@ -143,6 +145,10 @@ private static function render_testing_mode_container() {

self::include_svg();

if ( ! $enabled ) {
FrmUsageController::update_flows_data( 'view_test_mode', 'no_addon' );
}

include FrmAppHelper::plugin_path() . '/classes/views/test-mode/container.php';
}

Expand Down
2 changes: 1 addition & 1 deletion classes/controllers/FrmUsageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public static function ajax_track_flows() {
}

/**
* Updates flows data.
* Updates flows data. This increases the count of flow_data[ $key ][ $value ].
*
* @since 6.16.1
*
Expand Down
11 changes: 11 additions & 0 deletions classes/views/test-mode/container.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@
}
?>
</select>

<?php
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@truongwp This is for the add-on tracking?

Can we add a new hook here instead so we can move this logic into the add-on?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can we use $enabled to check, like we did with other test mode add-on features?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@truongwp Like the hook is only called if $enabled is true?

That would be fine.

Otherwise I'm not sure if I follow.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Crabcyborg No. I meant we won't need to add a hook there, just check if ( $enabled ) { foreach ... }. Because that file contains many test mode add-ons code.

Copy link
Copy Markdown
Contributor

@Crabcyborg Crabcyborg Jun 3, 2026

Choose a reason for hiding this comment

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

@truongwp

I just think there's a difference.

This file is intended to use the whole UI, as it's shown in Lite as disabled placeholders.

And these inputs are only used when the add-on is actually active, and have no visual benefit for being in Lite.

Since they only impact the add-on, it would be nice if we only needed to modify the add-on when we needed to make changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok. I added the hook and moved the code to the add-on.

/**
* Fires inside the enabled form actions container.
*
* @since x.x
*
* @param array $form_actions
*/
do_action( 'frm_testmode_form_actions', $form_actions );
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Variable $form_actions might not be defined


A variable has been used but not defined, which may result in warnings during program execution. This can also cause bugs since the intended usage scope of the variable is not known.

?>
</div>
</label>
</div>
Expand Down
Loading