Keeping an eye on your WordPress site’s health is a smart move, especially if you rely on key plugins to capture leads or customer data.
One often-overlooked plugin in this regard is Fluent Forms—and if your forms stop working, you might not even know until it’s too late.
That’s where a simple custom health check can help.
Below is a snippet you can add to your theme’s functions.php
file or a small custom plugin.
It creates a new Site Health test that checks whether your Fluent Forms have received any submissions in the past 30 days.
The Code Snippet
add_filter('site_status_tests', 'site_health_checks');
function site_health_checks($tests)
{
$tests['direct']['fluent_forms_submission_check'] = array(
'label' => __('Fluent Forms Submission Check', 'twim'),
'test' => 'fluent_forms_submission_check_test',
);
return $tests;
}
function fluent_forms_submission_check_test()
{
$result = array(
'label' => __('Fluent Forms Submissions', 'twim'),
'status' => 'good',
'badge' => array(
'label' => __('Performance', 'twim'),
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
__('Checks if any Fluent Forms submissions were received in the past week.', 'twim')
),
'actions' => '',
'test' => 'fluent_forms_submission_check',
);
// Check if Fluent Forms Query Builder is available
if (!function_exists('wpFluent')) {
$result['status'] = 'critical';
$result['label'] = __('Fluent Forms is not active', 'twim');
$result['badge']['color'] = 'red';
$result['description'] = sprintf(
'<p>%s</p>',
__('The Fluent Forms plugin is not active. Please ensure Fluent Forms is installed and activated.', 'twim')
);
return $result;
}
// Define the time range for the past 30 days
$seven_days_ago = gmdate('Y-m-d H:i:s', strtotime('-30 days'));
$current_time = gmdate('Y-m-d H:i:s', current_time('timestamp'));
// Query submissions from the fluentform_submissions table
$submissions = wpFluent()->table('fluentform_submissions')
->whereBetween('created_at', [$seven_days_ago, $current_time])
->get();
// Count submissions (ensure $submissions is an array)
$total_submissions = is_array($submissions) ? count($submissions) : 0;
// If no submissions are found, set a warning
if ($total_submissions === 0) {
$result['status'] = 'critical';
$result['label'] = __('No Fluent Forms submissions in the past 30 days', 'twim');
$result['badge']['color'] = 'red';
$result['description'] = sprintf(
'<p>%s</p>',
__('No submissions were received for any Fluent Forms in the past 30 days. This may indicate an issue with form visibility, user engagement, or form functionality.', 'twim')
);
$result['actions'] = sprintf(
'<p><a href="%s">%s</a></p>',
admin_url('admin.php?page=fluent_forms'),
__('Check Fluent Forms Settings', 'twim')
);
} else {
$result['description'] = sprintf(
'<p>%s</p>',
sprintf(__('Found %d submission(s) in the past 30 days across all Fluent Forms.', 'twim'), $total_submissions)
);
}
return $result;
}
How It Works
- Registers a New Site Health Test
WordPress has a Site Health tool (found under Tools → Site Health) where you can check various performance and security metrics. The first function hooks into this system and tells WordPress,
“Hey, I’ve got a custom check you should run.” - Checks if Fluent Forms is Active
Before doing anything, it confirms the Fluent Forms plugin is installed and active. If not, it throws a critical warning. - Counts Submissions in the Past 30 Days
The code queries thefluentform_submissions
table to see if you’ve had any form entries in the past month. - Reports the Status
- If submissions exist, it reports a good status with the count.
- If no submissions are found, it flags this as critical so you can investigate.
Why This Matters
Forms are often the lifeblood of a website—whether you’re collecting leads, orders, or feedback. If your forms stop receiving submissions, you want to know fast.
With this Site Health test, you can spot problems early and take action before losing potential customers.
💡 Pro Tip:
You can adapt this code to monitor any critical data in your WordPress database—not just form submissions. Think of it as your own personal “website heartbeat monitor.”