0]) : esc_html(number_format_i18n($value));
};
$aiflt_range_url = static function ($days) {
return add_query_arg('range', $days, aiflt_admin_url('leak-scan'));
};
?>
-
-
-
3
' . esc_html__('turn on visitor consent', 'ai-flash-tune') . ''
);
?>
__('Tracking works', 'ai-flash-tune'),
'quiet' => __('No recent visits', 'ai-flash-tune'),
'waiting' => __('Waiting for visits', 'ai-flash-tune'),
'off' => __('Tracking is off', 'ai-flash-tune'),
];
$aiflt_state = $aiflt_scan['tracking']['state'];
?>
0
? ($aiflt_scan['revenue'] - $aiflt_scan['previous_revenue']) / $aiflt_scan['previous_revenue'] * 100
: null;
AIFLT_UI::stat(
__('Revenue', 'ai-flash-tune'),
$aiflt_money($aiflt_scan['revenue']),
$aiflt_rev_change !== null ? AIFLT_UI::delta($aiflt_rev_change) : esc_html__('paid orders', 'ai-flash-tune')
);
AIFLT_UI::stat(__('Orders', 'ai-flash-tune'), esc_html(number_format_i18n($aiflt_scan['orders'])), esc_html__('paid in this period', 'ai-flash-tune'));
$aiflt_conv_note = esc_html__('No earlier period yet', 'ai-flash-tune');
if ($aiflt_scan['previous_conversion'] !== null) {
$aiflt_pts = round($aiflt_scan['conversion'] - $aiflt_scan['previous_conversion'], 1);
$aiflt_conv_note = '
' . esc_html(sprintf(
/* translators: %s: change in percentage points, with sign */
__('%s pts vs previous period', 'ai-flash-tune'),
($aiflt_pts >= 0 ? '+' : '') . number_format_i18n($aiflt_pts, 1)
)) . '';
}
AIFLT_UI::stat(__('Conversion', 'ai-flash-tune'), esc_html(number_format_i18n($aiflt_scan['conversion'], 1)) . '%', $aiflt_conv_note);
AIFLT_UI::stat(__('Average order', 'ai-flash-tune'), $aiflt_scan['orders'] > 0 ? $aiflt_money($aiflt_scan['aov']) : '—', esc_html__('per paid order', 'ai-flash-tune'));
AIFLT_UI::stat(
__('Left in carts', 'ai-flash-tune'),
$aiflt_money($aiflt_scan['abandoned_value']),
/* translators: %s: number of carts */
esc_html(sprintf(_n('%s cart', '%s carts', $aiflt_scan['abandoned_count'], 'ai-flash-tune'), number_format_i18n($aiflt_scan['abandoned_count']))),
$aiflt_scan['abandoned_value'] > 0 ? 'leak' : ''
);
AIFLT_UI::stat(
__('Recovered', 'ai-flash-tune'),
$aiflt_money((float) ($aiflt_rec['revenue'] ?? 0)),
empty($aiflt_scan['reminders_on'])
? '
' . esc_html__('Turn on reminders', 'ai-flash-tune') . ''
/* translators: %s: number of carts */
: esc_html(sprintf(_n('%s cart won back', '%s carts won back', (int) ($aiflt_rec['recovered'] ?? 0), 'ai-flash-tune'), number_format_i18n((int) ($aiflt_rec['recovered'] ?? 0)))),
!empty($aiflt_rec['recovered']) ? 'good' : ''
);
?>
$aiflt_step) : ?>
-
>
= 100 ? __('high', 'ai-flash-tune') : ($aiflt_scan['sessions'] >= AIFLT_Leak_Scan::MIN_SESSIONS ? __('medium', 'ai-flash-tune') : __('low', 'ai-flash-tune')),
$aiflt_scan['sessions'] >= 100 ? __('Enough to act on.', 'ai-flash-tune') : __('Treat it as a direction and check again in two weeks.', 'ai-flash-tune')
));
?>