| 1 |
<?php |
| 2 |
/** |
| 3 |
* Free vs Pro Comparison Page. |
| 4 |
* |
| 5 |
* Data-driven layout: every feature row lives in $ei_fvp_features and the |
| 6 |
* table renders by iterating. Adding / removing / regrouping a feature is |
| 7 |
* one array edit — not a hundred lines of duplicated HTML. |
| 8 |
* |
| 9 |
* Plan model (aligned with LicensePlanResolver): |
| 10 |
* FREE — Easy Invoice plugin only. |
| 11 |
* PERSONAL — Easy Invoice Pro plugin installed; no license required. |
| 12 |
* Every Personal-tier addon in AddonRegistry. |
| 13 |
* PROFESSIONAL — Personal + Professional-tier addons (requires license). |
| 14 |
* AGENCY — Personal + Professional + Agency-tier addons. |
| 15 |
* |
| 16 |
* @package EasyInvoice |
| 17 |
* @since 2.0.0 |
| 18 |
*/ |
| 19 |
|
| 20 |
if (!defined('ABSPATH')) { |
| 21 |
exit; |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* Feature rows. Each entry: |
| 26 |
* title — feature label |
| 27 |
* desc — one-line description |
| 28 |
* plans — array of plan slugs that include this feature |
| 29 |
* (free, personal, professional, agency) |
| 30 |
* highlight — true → renders with a subtle accent background |
| 31 |
*/ |
| 32 |
$ei_fvp_features = [ |
| 33 |
// ── Section: Core features (free with the Free plugin) ────────────── |
| 34 |
['title' => __('Unlimited Invoices & Quotes', 'easy-invoice'), 'desc' => __('Create as many invoices and quotes as you need — no row caps.', 'easy-invoice'), 'plans' => ['free','personal','professional','agency']], |
| 35 |
['title' => __('PDF Generation', 'easy-invoice'), 'desc' => __('Generate clean, professional PDF invoices and quotes out of the box.', 'easy-invoice'), 'plans' => ['free','personal','professional','agency']], |
| 36 |
['title' => __('Client Management', 'easy-invoice'), 'desc' => __('Store and manage every client with addresses, contact info, and history.', 'easy-invoice'), 'plans' => ['free','personal','professional','agency']], |
| 37 |
['title' => __('Tax & Discount Options', 'easy-invoice'), 'desc' => __('Add basic taxes, discounts, and fees to any invoice or quote.', 'easy-invoice'), 'plans' => ['free','personal','professional','agency']], |
| 38 |
['title' => __('Email Notifications', 'easy-invoice'), 'desc' => __('Automatically send invoices and quotes to clients via email.', 'easy-invoice'), 'plans' => ['free','personal','professional','agency']], |
| 39 |
['title' => __('PayPal Gateway', 'easy-invoice'), 'desc' => __('Accept online payments via the built-in PayPal gateway.', 'easy-invoice'), 'plans' => ['free','personal','professional','agency']], |
| 40 |
['title' => __('Email Support', 'easy-invoice'), 'desc' => __('Standard email support for product questions and bug reports.', 'easy-invoice'), 'plans' => ['free','personal','professional','agency']], |
| 41 |
|
| 42 |
// ── Section: Personal tier (free with Pro plugin, no license required) ── |
| 43 |
['title' => __('Multiple Payment Gateways', 'easy-invoice'), 'desc' => __('Stripe, Square, Mollie, Authorize.net, Paystack, Moneris — plus PayPal.', 'easy-invoice'), 'plans' => ['personal','professional','agency'], 'highlight' => true], |
| 44 |
['title' => __('Recurring Invoices & Subscriptions', 'easy-invoice'), 'desc' => __('Auto-bill on autopilot: weekly, monthly, or any custom schedule.', 'easy-invoice'), 'plans' => ['personal','professional','agency'], 'highlight' => true], |
| 45 |
['title' => __('Partial Payments & Deposits', 'easy-invoice'), 'desc' => __('Require deposits and let clients pay the balance in installments.', 'easy-invoice'), 'plans' => ['personal','professional','agency'], 'highlight' => true], |
| 46 |
['title' => __('Client Portal', 'easy-invoice'), 'desc' => __('Branded self-service area where clients view invoices and download PDFs.', 'easy-invoice'), 'plans' => ['personal','professional','agency'], 'highlight' => true], |
| 47 |
['title' => __('PDF Toolkit', 'easy-invoice'), 'desc' => __('Custom headers, footers, watermarks (PAID / DRAFT / OVERDUE), and styling.', 'easy-invoice'), 'plans' => ['personal','professional','agency'], 'highlight' => true], |
| 48 |
['title' => __('Bulk Email & Export', 'easy-invoice'), 'desc' => __('Bulk-email invoices and export selected rows to CSV / Excel / PDF.', 'easy-invoice'), 'plans' => ['personal','professional','agency'], 'highlight' => true], |
| 49 |
['title' => __('Item Library', 'easy-invoice'), 'desc' => __('Reusable catalog of services and products with one-click insert.', 'easy-invoice'), 'plans' => ['personal','professional','agency'], 'highlight' => true], |
| 50 |
['title' => __('Custom Invoice & Quote Templates','easy-invoice'), 'desc' => __('Drag-and-drop builder for pixel-perfect branded layouts.', 'easy-invoice'), 'plans' => ['personal','professional','agency'], 'highlight' => true], |
| 51 |
['title' => __('Additional Tax Lines', 'easy-invoice'), 'desc' => __('Multiple named tax lines per invoice — VAT + duty, GST + PST, federal + state.', 'easy-invoice'), 'plans' => ['personal','professional','agency'], 'highlight' => true], |
| 52 |
['title' => __('Email Enhancements', 'easy-invoice'), 'desc' => __('Branded HTML emails with CC / BCC, attached PDFs, and Reply-To.', 'easy-invoice'), 'plans' => ['personal','professional','agency'], 'highlight' => true], |
| 53 |
['title' => __('Privacy & GDPR Tools', 'easy-invoice'), 'desc' => __('Personal-data export and erasure for GDPR / CCPA compliance.', 'easy-invoice'), 'plans' => ['personal','professional','agency'], 'highlight' => true], |
| 54 |
['title' => __('Reports & Analytics', 'easy-invoice'), 'desc' => __('Visual dashboard for revenue, outstanding balances, and client performance.', 'easy-invoice'), 'plans' => ['personal','professional','agency'], 'highlight' => true], |
| 55 |
|
| 56 |
// ── Section: Professional tier ───────────────────────────────────── |
| 57 |
['title' => __('Time Tracking & Project Billing', 'easy-invoice'), 'desc' => __('Built-in start/stop timer, hourly rates, one-click conversion to invoice lines.', 'easy-invoice'), 'plans' => ['professional','agency']], |
| 58 |
['title' => __('Smart Reminders & Late Fees', 'easy-invoice'), 'desc' => __('Multi-step automated payment chase with auto-applied late fees.', 'easy-invoice'), 'plans' => ['professional','agency']], |
| 59 |
['title' => __('Priority Support', 'easy-invoice'), 'desc' => __('Faster response times and direct line to the product team.', 'easy-invoice'), 'plans' => ['professional','agency']], |
| 60 |
|
| 61 |
// ── Section: Agency tier ─────────────────────────────────────────── |
| 62 |
['title' => __('White-Label & Brand Override', 'easy-invoice'), 'desc' => __('Rebrand Easy Invoice end-to-end: plugin name, menu, PDFs, emails.', 'easy-invoice'), 'plans' => ['agency'], 'highlight' => true], |
| 63 |
['title' => __('Team Members & Audit Log', 'easy-invoice'), 'desc' => __('Scoped roles for staff plus a searchable audit log of every action.', 'easy-invoice'), 'plans' => ['agency'], 'highlight' => true], |
| 64 |
['title' => __('Webhooks & Zapier Bridge', 'easy-invoice'), 'desc' => __('Stream invoice events to any URL — Zapier, Make, n8n, your CRM, Slack.', 'easy-invoice'), 'plans' => ['agency'], 'highlight' => true], |
| 65 |
]; |
| 66 |
|
| 67 |
/** |
| 68 |
* Plan column metadata. Keeps the table header / CTA rows / checkout |
| 69 |
* links in one place so they stay aligned with the data above. |
| 70 |
*/ |
| 71 |
$ei_fvp_plans = [ |
| 72 |
'free' => [ |
| 73 |
'label' => __('Free', 'easy-invoice'), |
| 74 |
'tagline' => __('For getting started', 'easy-invoice'), |
| 75 |
'cta_text' => __('Already installed', 'easy-invoice'), |
| 76 |
'cta_url' => '', |
| 77 |
'accent' => 'text-gray-900', |
| 78 |
], |
| 79 |
'personal' => [ |
| 80 |
'label' => __('Personal', 'easy-invoice'), |
| 81 |
'tagline' => __('Free with Pro plugin', 'easy-invoice'), |
| 82 |
'cta_text' => __('Get Personal', 'easy-invoice'), |
| 83 |
'cta_url' => 'https://store.mantrabrain.com/checkout/?edd_action=add_to_cart&download_id=37777&edd_options[price_id]=1', |
| 84 |
'accent' => 'text-teal-600', |
| 85 |
], |
| 86 |
'professional' => [ |
| 87 |
'label' => __('Professional', 'easy-invoice'), |
| 88 |
'tagline' => __('For growing businesses', 'easy-invoice'), |
| 89 |
'cta_text' => __('Get Professional', 'easy-invoice'), |
| 90 |
'cta_url' => 'https://store.mantrabrain.com/checkout/?edd_action=add_to_cart&download_id=37777&edd_options[price_id]=2', |
| 91 |
'accent' => 'text-indigo-600', |
| 92 |
], |
| 93 |
'agency' => [ |
| 94 |
'label' => __('Agency', 'easy-invoice'), |
| 95 |
'tagline' => __('For agencies & resellers', 'easy-invoice'), |
| 96 |
'cta_text' => __('Get Agency', 'easy-invoice'), |
| 97 |
'cta_url' => 'https://store.mantrabrain.com/checkout/?edd_action=add_to_cart&download_id=37777&edd_options[price_id]=3', |
| 98 |
'accent' => 'text-purple-600', |
| 99 |
], |
| 100 |
]; |
| 101 |
|
| 102 |
/** Inline-renders a check (✓) or cross (✗) cell for a feature/plan pair. */ |
| 103 |
$ei_fvp_render_cell = function (array $feature, string $plan_key): void { |
| 104 |
$included = in_array($plan_key, $feature['plans'], true); |
| 105 |
if ($included): ?> |
| 106 |
<svg class="w-6 h-6 text-green-500 mx-auto" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 107 |
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path> |
| 108 |
</svg> |
| 109 |
<?php else: ?> |
| 110 |
<svg class="w-6 h-6 text-gray-300 mx-auto" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 111 |
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path> |
| 112 |
</svg> |
| 113 |
<?php endif; |
| 114 |
}; |
| 115 |
?> |
| 116 |
|
| 117 |
<section id="free-vs-pro" class="py-20 bg-gradient-to-br from-indigo-50 via-white to-purple-50"> |
| 118 |
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> |
| 119 |
|
| 120 |
<div class="text-center mb-16"> |
| 121 |
<h2 class="text-3xl md:text-4xl lg:text-5xl font-bold text-gray-900 mb-6"> |
| 122 |
<?php esc_html_e('Free vs Pro: ', 'easy-invoice'); ?> |
| 123 |
<span class="text-transparent bg-clip-text bg-gradient-to-r from-indigo-600 to-purple-600"> |
| 124 |
<?php esc_html_e('Choose What Fits Your Business', 'easy-invoice'); ?> |
| 125 |
</span> |
| 126 |
</h2> |
| 127 |
<p class="text-xl text-gray-600 max-w-3xl mx-auto leading-relaxed"> |
| 128 |
<?php esc_html_e('Personal-tier addons unlock automatically when you install Easy Invoice Pro — no license key needed. A license adds the Professional and Agency tiers.', 'easy-invoice'); ?> |
| 129 |
</p> |
| 130 |
</div> |
| 131 |
|
| 132 |
<div class="max-w-7xl mx-auto overflow-x-auto"> |
| 133 |
<table class="w-full bg-white rounded-lg shadow-lg"> |
| 134 |
|
| 135 |
<thead> |
| 136 |
<tr class="border-b"> |
| 137 |
<th class="text-left p-6 text-lg font-semibold text-gray-900"> |
| 138 |
<?php esc_html_e('Feature', 'easy-invoice'); ?> |
| 139 |
</th> |
| 140 |
<?php foreach ($ei_fvp_plans as $plan_key => $plan): ?> |
| 141 |
<th class="text-center p-6 text-lg font-semibold <?php echo esc_attr($plan['accent']); ?>"> |
| 142 |
<div class="flex flex-col items-center"> |
| 143 |
<span class="text-lg font-bold"><?php echo esc_html($plan['label']); ?></span> |
| 144 |
<span class="text-xs font-normal text-gray-500 mt-1"> |
| 145 |
<?php echo esc_html($plan['tagline']); ?> |
| 146 |
</span> |
| 147 |
</div> |
| 148 |
</th> |
| 149 |
<?php endforeach; ?> |
| 150 |
</tr> |
| 151 |
|
| 152 |
<tr class="border-b bg-gray-50"> |
| 153 |
<td class="p-6"> |
| 154 |
<div class="font-bold text-lg text-gray-900"><?php esc_html_e('Quick Start', 'easy-invoice'); ?></div> |
| 155 |
<div class="text-sm text-gray-600 mt-1"><?php esc_html_e('Choose your plan now', 'easy-invoice'); ?></div> |
| 156 |
</td> |
| 157 |
<?php foreach ($ei_fvp_plans as $plan): ?> |
| 158 |
<td class="p-6 text-center"> |
| 159 |
<?php if (empty($plan['cta_url'])): ?> |
| 160 |
<span class="text-gray-500 text-sm"><?php echo esc_html($plan['cta_text']); ?></span> |
| 161 |
<?php else: ?> |
| 162 |
<a href="<?php echo esc_url($plan['cta_url']); ?>" |
| 163 |
target="_blank" rel="noopener" |
| 164 |
class="inline-block bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-700 hover:to-purple-700 text-white hover:text-white font-bold py-3 px-6 rounded-xl transition-all duration-300 transform hover:scale-105 shadow-lg"> |
| 165 |
<?php echo esc_html($plan['cta_text']); ?> |
| 166 |
</a> |
| 167 |
<?php endif; ?> |
| 168 |
</td> |
| 169 |
<?php endforeach; ?> |
| 170 |
</tr> |
| 171 |
</thead> |
| 172 |
|
| 173 |
<tbody class="divide-y divide-gray-200"> |
| 174 |
<?php foreach ($ei_fvp_features as $feature): |
| 175 |
$row_class = !empty($feature['highlight']) ? 'bg-indigo-50/40' : ''; |
| 176 |
?> |
| 177 |
<tr class="<?php echo esc_attr($row_class); ?>"> |
| 178 |
<td class="p-6"> |
| 179 |
<div class="font-medium text-gray-900"><?php echo esc_html($feature['title']); ?></div> |
| 180 |
<div class="text-sm text-gray-500 mt-1"><?php echo esc_html($feature['desc']); ?></div> |
| 181 |
</td> |
| 182 |
<?php foreach (array_keys($ei_fvp_plans) as $plan_key): ?> |
| 183 |
<td class="p-6 text-center"> |
| 184 |
<?php $ei_fvp_render_cell($feature, $plan_key); ?> |
| 185 |
</td> |
| 186 |
<?php endforeach; ?> |
| 187 |
</tr> |
| 188 |
<?php endforeach; ?> |
| 189 |
|
| 190 |
<tr class="border-t-2 border-gray-200 bg-gray-50"> |
| 191 |
<td class="p-6"> |
| 192 |
<div class="font-bold text-lg text-gray-900"><?php esc_html_e('Ready to Get Started?', 'easy-invoice'); ?></div> |
| 193 |
<div class="text-sm text-gray-600 mt-1"><?php esc_html_e('Pick a plan and start invoicing today.', 'easy-invoice'); ?></div> |
| 194 |
</td> |
| 195 |
<?php foreach ($ei_fvp_plans as $plan): ?> |
| 196 |
<td class="p-6 text-center"> |
| 197 |
<?php if (empty($plan['cta_url'])): ?> |
| 198 |
<span class="text-gray-500 text-sm"><?php echo esc_html($plan['cta_text']); ?></span> |
| 199 |
<?php else: ?> |
| 200 |
<a href="<?php echo esc_url($plan['cta_url']); ?>" |
| 201 |
target="_blank" rel="noopener" |
| 202 |
class="inline-block bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-700 hover:to-purple-700 text-white hover:text-white font-bold py-3 px-6 rounded-xl transition-all duration-300 transform hover:scale-105 shadow-lg"> |
| 203 |
<?php echo esc_html($plan['cta_text']); ?> |
| 204 |
</a> |
| 205 |
<?php endif; ?> |
| 206 |
</td> |
| 207 |
<?php endforeach; ?> |
| 208 |
</tr> |
| 209 |
</tbody> |
| 210 |
</table> |
| 211 |
</div> |
| 212 |
|
| 213 |
</div> |
| 214 |
</section> |
| 215 |
|