int, 'total_cr' => int|null] * int $gf_range_start — SSR-resolved window start (utime), pinned to AJAX (#1) * int $gf_range_end — SSR-resolved window end (utime), pinned to AJAX (#1) * * @var array $funnels * @var int $max_funnels * @var bool $is_pro * @var array $active_funnel_steps * @var array $active_funnel_summary * @var int $gf_range_start * @var int $gf_range_end */ if (!defined('ABSPATH')) { exit; } $funnel_count = is_array($funnels) ? count($funnels) : 0; $locked = $max_funnels <= 0; // Free tier — never rendered via this partial for Pro // Heading (title + subtitle) and actions (usage pill + Add CTA) now live in the // postbox header — see wp_slimstat_admin::register_goals_funnels_header_hooks(). if ($locked) : ?>
= $max_funnels; // Template cards — shared by the empty state and the "See templates" reveal that // keeps templates reachable after the first funnel exists (#7). Each `key` must // match a FUNNEL_TEMPLATES entry in admin/assets/js/goals-funnels.js. Strings // are wrapped in __() inline so the WP i18n extractor still finds them. $template_cards = [ [ 'key' => 'woocommerce_purchase', 'title' => __('WooCommerce purchase', 'wp-slimstat'), 'body' => __('Product → Cart → Checkout → Order received', 'wp-slimstat'), ], [ 'key' => 'checkout_completion', 'title' => __('Checkout completion', 'wp-slimstat'), 'body' => __('Cart → Checkout → Order received', 'wp-slimstat'), ], [ 'key' => 'landing_to_contact', 'title' => __('Landing to contact', 'wp-slimstat'), 'body' => __('Landing → Contact (most form plugins don\'t redirect to thank-you)', 'wp-slimstat'), ], [ 'key' => 'pricing_to_checkout', 'title' => __('Homepage to pricing to checkout', 'wp-slimstat'), 'body' => __('Homepage → Pricing → Checkout', 'wp-slimstat'), ], [ 'key' => 'landing_to_thanks', 'title' => __('Landing to thank-you (advanced)', 'wp-slimstat'), 'body' => __('Landing → Form → Thank-you (only if you redirect after submit)', 'wp-slimstat'), ], [ // The "build from scratch" entry is the primary call to action, not a // prefab template — render it as a solid blue button (like the Goals // empty-state CTA) instead of a muted dashed card, while keeping it in // the template grid. (#15) 'key' => 'blank', 'title' => __('+ Add funnel', 'wp-slimstat'), 'body' => '', 'modifier' => 'slimstat-gf-template-card--cta', ], ]; ?>

1) : ?>
$f) : $is_active = (0 === $idx); ?>
$f) : $is_active = (0 === $idx); $panel_id = 'slimstat-gf-panel-' . $idx; $steps = $is_active ? $active_funnel_steps : []; $summary = $is_active ? $active_funnel_summary : ['step_count' => count($f['steps'] ?? []), 'total_cr' => null]; ?>
>