| 1 |
<?php |
| 2 |
/** |
| 3 |
* Fomo Notifications - Dashboard Template |
| 4 |
* |
| 5 |
* @package King_Addons |
| 6 |
*/ |
| 7 |
|
| 8 |
defined('ABSPATH') || exit; |
| 9 |
|
| 10 |
$is_pro = king_addons_freemius()->can_use_premium_code(); |
| 11 |
$notifications = get_posts([ |
| 12 |
'post_type' => 'kng_fomo_notif', |
| 13 |
'posts_per_page' => 5, |
| 14 |
'orderby' => 'date', |
| 15 |
'order' => 'DESC' |
| 16 |
]); |
| 17 |
|
| 18 |
$total_notifications = wp_count_posts('kng_fomo_notif')->publish; |
| 19 |
$stats = King_Addons\Fomo_Notifications::instance()->get_total_stats(); |
| 20 |
?> |
| 21 |
|
| 22 |
<div class="kng-fomo-admin"> |
| 23 |
|
| 24 |
<!-- Navigation --> |
| 25 |
<nav class="kng-fomo-nav"> |
| 26 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-fomo')); ?>" class="kng-fomo-nav-item is-active"> |
| 27 |
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="9"></rect><rect x="14" y="3" width="7" height="5"></rect><rect x="14" y="12" width="7" height="9"></rect><rect x="3" y="16" width="7" height="5"></rect></svg> |
| 28 |
<?php esc_html_e('Dashboard', 'king-addons'); ?> |
| 29 |
</a> |
| 30 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-fomo&view=list')); ?>" class="kng-fomo-nav-item"> |
| 31 |
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg> |
| 32 |
<?php esc_html_e('Notifications', 'king-addons'); ?> |
| 33 |
</a> |
| 34 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-fomo&view=wizard')); ?>" class="kng-fomo-nav-item"> |
| 35 |
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg> |
| 36 |
<?php esc_html_e('Add New', 'king-addons'); ?> |
| 37 |
</a> |
| 38 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-fomo&view=analytics')); ?>" class="kng-fomo-nav-item"> |
| 39 |
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="20" x2="18" y2="10"></line><line x1="12" y1="20" x2="12" y2="4"></line><line x1="6" y1="20" x2="6" y2="14"></line></svg> |
| 40 |
<?php esc_html_e('Analytics', 'king-addons'); ?> |
| 41 |
</a> |
| 42 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-fomo&view=settings')); ?>" class="kng-fomo-nav-item"> |
| 43 |
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg> |
| 44 |
<?php esc_html_e('Settings', 'king-addons'); ?> |
| 45 |
</a> |
| 46 |
</nav> |
| 47 |
|
| 48 |
<!-- Hero Section --> |
| 49 |
<div class="kng-fomo-hero"> |
| 50 |
<span class="kng-fomo-hero-badge"> |
| 51 |
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon></svg> |
| 52 |
<?php esc_html_e('Social Proof & FOMO', 'king-addons'); ?> |
| 53 |
</span> |
| 54 |
<h1 class="kng-fomo-hero-title"><?php esc_html_e('Fomo Notifications', 'king-addons'); ?></h1> |
| 55 |
<p class="kng-fomo-hero-subtitle"><?php esc_html_e('Build trust and urgency with real-time social proof notifications. Show sales, reviews, signups and more.', 'king-addons'); ?></p> |
| 56 |
<div class="kng-fomo-hero-actions"> |
| 57 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-fomo&view=wizard')); ?>" class="kng-fomo-btn kng-fomo-btn--primary"> |
| 58 |
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg> |
| 59 |
<?php esc_html_e('Create Notification', 'king-addons'); ?> |
| 60 |
</a> |
| 61 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-fomo&view=list')); ?>" class="kng-fomo-btn kng-fomo-btn--secondary"> |
| 62 |
<?php esc_html_e('View All', 'king-addons'); ?> |
| 63 |
</a> |
| 64 |
</div> |
| 65 |
</div> |
| 66 |
|
| 67 |
<!-- KPIs --> |
| 68 |
<div class="kng-fomo-kpis"> |
| 69 |
<div class="kng-fomo-kpi"> |
| 70 |
<div class="kng-fomo-kpi-icon kng-fomo-kpi-icon--views"> |
| 71 |
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg> |
| 72 |
</div> |
| 73 |
<div class="kng-fomo-kpi-value" data-kpi="views"><?php echo esc_html(number_format_i18n($stats['views'])); ?></div> |
| 74 |
<div class="kng-fomo-kpi-label"><?php esc_html_e('Total Views', 'king-addons'); ?></div> |
| 75 |
<?php if ($stats['views_change'] != 0): ?> |
| 76 |
<span class="kng-fomo-kpi-change kng-fomo-kpi-change--<?php echo $stats['views_change'] > 0 ? 'up' : 'down'; ?>"> |
| 77 |
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="<?php echo $stats['views_change'] > 0 ? '18 15 12 9 6 15' : '6 9 12 15 18 9'; ?>"></polyline></svg> |
| 78 |
<?php echo esc_html(abs($stats['views_change']) . '%'); ?> |
| 79 |
</span> |
| 80 |
<?php endif; ?> |
| 81 |
</div> |
| 82 |
|
| 83 |
<div class="kng-fomo-kpi"> |
| 84 |
<div class="kng-fomo-kpi-icon kng-fomo-kpi-icon--clicks"> |
| 85 |
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 12h-4l-3 9L9 3l-3 9H2"></path></svg> |
| 86 |
</div> |
| 87 |
<div class="kng-fomo-kpi-value" data-kpi="clicks"><?php echo esc_html(number_format_i18n($stats['clicks'])); ?></div> |
| 88 |
<div class="kng-fomo-kpi-label"><?php esc_html_e('Total Clicks', 'king-addons'); ?></div> |
| 89 |
<?php if ($stats['clicks_change'] != 0): ?> |
| 90 |
<span class="kng-fomo-kpi-change kng-fomo-kpi-change--<?php echo $stats['clicks_change'] > 0 ? 'up' : 'down'; ?>"> |
| 91 |
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="<?php echo $stats['clicks_change'] > 0 ? '18 15 12 9 6 15' : '6 9 12 15 18 9'; ?>"></polyline></svg> |
| 92 |
<?php echo esc_html(abs($stats['clicks_change']) . '%'); ?> |
| 93 |
</span> |
| 94 |
<?php endif; ?> |
| 95 |
</div> |
| 96 |
|
| 97 |
<div class="kng-fomo-kpi"> |
| 98 |
<div class="kng-fomo-kpi-icon kng-fomo-kpi-icon--ctr"> |
| 99 |
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline></svg> |
| 100 |
</div> |
| 101 |
<div class="kng-fomo-kpi-value" data-kpi="ctr"><?php echo esc_html($stats['ctr'] . '%'); ?></div> |
| 102 |
<div class="kng-fomo-kpi-label"><?php esc_html_e('Click-Through Rate', 'king-addons'); ?></div> |
| 103 |
</div> |
| 104 |
|
| 105 |
<div class="kng-fomo-kpi"> |
| 106 |
<div class="kng-fomo-kpi-icon kng-fomo-kpi-icon--views"> |
| 107 |
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path><path d="M13.73 21a2 2 0 0 1-3.46 0"></path></svg> |
| 108 |
</div> |
| 109 |
<div class="kng-fomo-kpi-value"><?php echo esc_html($total_notifications); ?></div> |
| 110 |
<div class="kng-fomo-kpi-label"><?php esc_html_e('Active Notifications', 'king-addons'); ?></div> |
| 111 |
</div> |
| 112 |
</div> |
| 113 |
|
| 114 |
<!-- Integrations Grid --> |
| 115 |
<div class="kng-fomo-section"> |
| 116 |
<div class="kng-fomo-section-header"> |
| 117 |
<div> |
| 118 |
<h2 class="kng-fomo-section-title"><?php esc_html_e('Notification Types', 'king-addons'); ?></h2> |
| 119 |
<p class="kng-fomo-section-subtitle"><?php esc_html_e('Choose from multiple notification sources', 'king-addons'); ?></p> |
| 120 |
</div> |
| 121 |
</div> |
| 122 |
|
| 123 |
<div class="kng-fomo-grid kng-fomo-grid--4"> |
| 124 |
<!-- Notification Bar - Free --> |
| 125 |
<div class="kng-fomo-card kng-fomo-card--clickable"> |
| 126 |
<div class="kng-fomo-card-icon"> |
| 127 |
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="3" y1="9" x2="21" y2="9"></line></svg> |
| 128 |
</div> |
| 129 |
<h3 class="kng-fomo-card-title"><?php esc_html_e('Notification Bar', 'king-addons'); ?></h3> |
| 130 |
<p class="kng-fomo-card-desc"><?php esc_html_e('Sticky header or footer announcements', 'king-addons'); ?></p> |
| 131 |
</div> |
| 132 |
|
| 133 |
<!-- WooCommerce Sales - Free --> |
| 134 |
<div class="kng-fomo-card kng-fomo-card--clickable"> |
| 135 |
<div class="kng-fomo-card-icon"> |
| 136 |
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg> |
| 137 |
</div> |
| 138 |
<h3 class="kng-fomo-card-title"><?php esc_html_e('WooCommerce Sales', 'king-addons'); ?></h3> |
| 139 |
<p class="kng-fomo-card-desc"><?php esc_html_e('Real-time sales notifications', 'king-addons'); ?></p> |
| 140 |
</div> |
| 141 |
|
| 142 |
<!-- WordPress Comments - Free --> |
| 143 |
<div class="kng-fomo-card kng-fomo-card--clickable"> |
| 144 |
<div class="kng-fomo-card-icon"> |
| 145 |
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg> |
| 146 |
</div> |
| 147 |
<h3 class="kng-fomo-card-title"><?php esc_html_e('WordPress Comments', 'king-addons'); ?></h3> |
| 148 |
<p class="kng-fomo-card-desc"><?php esc_html_e('Show recent blog comments', 'king-addons'); ?></p> |
| 149 |
</div> |
| 150 |
|
| 151 |
<!-- WordPress.org Downloads - Free --> |
| 152 |
<div class="kng-fomo-card kng-fomo-card--clickable"> |
| 153 |
<div class="kng-fomo-card-icon"> |
| 154 |
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> |
| 155 |
</div> |
| 156 |
<h3 class="kng-fomo-card-title"><?php esc_html_e('WordPress.org Downloads', 'king-addons'); ?></h3> |
| 157 |
<p class="kng-fomo-card-desc"><?php esc_html_e('Plugin/theme download counter', 'king-addons'); ?></p> |
| 158 |
</div> |
| 159 |
|
| 160 |
<!-- Reviews - Pro --> |
| 161 |
<div class="kng-fomo-card kng-fomo-card--clickable <?php echo !$is_pro ? 'kng-fomo-card--locked' : ''; ?>"> |
| 162 |
<div class="kng-fomo-card-icon"> |
| 163 |
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg> |
| 164 |
</div> |
| 165 |
<h3 class="kng-fomo-card-title"> |
| 166 |
<?php esc_html_e('Reviews', 'king-addons'); ?> |
| 167 |
<?php if (!$is_pro): ?> |
| 168 |
<span class="kng-fomo-card-badge kng-fomo-card-badge--pro"><?php esc_html_e('Pro', 'king-addons'); ?></span> |
| 169 |
<?php endif; ?> |
| 170 |
</h3> |
| 171 |
<p class="kng-fomo-card-desc"><?php esc_html_e('Display product reviews', 'king-addons'); ?></p> |
| 172 |
</div> |
| 173 |
|
| 174 |
<!-- Email Subscriptions - Pro --> |
| 175 |
<div class="kng-fomo-card kng-fomo-card--clickable <?php echo !$is_pro ? 'kng-fomo-card--locked' : ''; ?>"> |
| 176 |
<div class="kng-fomo-card-icon"> |
| 177 |
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg> |
| 178 |
</div> |
| 179 |
<h3 class="kng-fomo-card-title"> |
| 180 |
<?php esc_html_e('Email Subscriptions', 'king-addons'); ?> |
| 181 |
<?php if (!$is_pro): ?> |
| 182 |
<span class="kng-fomo-card-badge kng-fomo-card-badge--pro"><?php esc_html_e('Pro', 'king-addons'); ?></span> |
| 183 |
<?php endif; ?> |
| 184 |
</h3> |
| 185 |
<p class="kng-fomo-card-desc"><?php esc_html_e('Newsletter signup counter', 'king-addons'); ?></p> |
| 186 |
</div> |
| 187 |
|
| 188 |
<!-- Donations - Pro --> |
| 189 |
<div class="kng-fomo-card kng-fomo-card--clickable <?php echo !$is_pro ? 'kng-fomo-card--locked' : ''; ?>"> |
| 190 |
<div class="kng-fomo-card-icon"> |
| 191 |
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg> |
| 192 |
</div> |
| 193 |
<h3 class="kng-fomo-card-title"> |
| 194 |
<?php esc_html_e('Donations', 'king-addons'); ?> |
| 195 |
<?php if (!$is_pro): ?> |
| 196 |
<span class="kng-fomo-card-badge kng-fomo-card-badge--pro"><?php esc_html_e('Pro', 'king-addons'); ?></span> |
| 197 |
<?php endif; ?> |
| 198 |
</h3> |
| 199 |
<p class="kng-fomo-card-desc"><?php esc_html_e('Show recent donations', 'king-addons'); ?></p> |
| 200 |
</div> |
| 201 |
|
| 202 |
<!-- Flashing Tab - Pro --> |
| 203 |
<div class="kng-fomo-card kng-fomo-card--clickable <?php echo !$is_pro ? 'kng-fomo-card--locked' : ''; ?>"> |
| 204 |
<div class="kng-fomo-card-icon"> |
| 205 |
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon></svg> |
| 206 |
</div> |
| 207 |
<h3 class="kng-fomo-card-title"> |
| 208 |
<?php esc_html_e('Flashing Tab', 'king-addons'); ?> |
| 209 |
<?php if (!$is_pro): ?> |
| 210 |
<span class="kng-fomo-card-badge kng-fomo-card-badge--pro"><?php esc_html_e('Pro', 'king-addons'); ?></span> |
| 211 |
<?php endif; ?> |
| 212 |
</h3> |
| 213 |
<p class="kng-fomo-card-desc"><?php esc_html_e('Browser tab attention grabber', 'king-addons'); ?></p> |
| 214 |
</div> |
| 215 |
</div> |
| 216 |
</div> |
| 217 |
|
| 218 |
<!-- Recent Notifications --> |
| 219 |
<?php if (!empty($notifications)): ?> |
| 220 |
<div class="kng-fomo-section"> |
| 221 |
<div class="kng-fomo-section-header"> |
| 222 |
<div> |
| 223 |
<h2 class="kng-fomo-section-title"><?php esc_html_e('Recent Notifications', 'king-addons'); ?></h2> |
| 224 |
<p class="kng-fomo-section-subtitle"><?php esc_html_e('Your latest notification campaigns', 'king-addons'); ?></p> |
| 225 |
</div> |
| 226 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-fomo&view=list')); ?>" class="kng-fomo-btn kng-fomo-btn--ghost kng-fomo-btn--sm"> |
| 227 |
<?php esc_html_e('View All', 'king-addons'); ?> |
| 228 |
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg> |
| 229 |
</a> |
| 230 |
</div> |
| 231 |
|
| 232 |
<div class="kng-fomo-table-wrap"> |
| 233 |
<table class="kng-fomo-table"> |
| 234 |
<thead> |
| 235 |
<tr> |
| 236 |
<th><?php esc_html_e('Notification', 'king-addons'); ?></th> |
| 237 |
<th><?php esc_html_e('Type', 'king-addons'); ?></th> |
| 238 |
<th><?php esc_html_e('Views', 'king-addons'); ?></th> |
| 239 |
<th><?php esc_html_e('Clicks', 'king-addons'); ?></th> |
| 240 |
<th><?php esc_html_e('Status', 'king-addons'); ?></th> |
| 241 |
<th></th> |
| 242 |
</tr> |
| 243 |
</thead> |
| 244 |
<tbody> |
| 245 |
<?php foreach ($notifications as $notification): |
| 246 |
$type = get_post_meta($notification->ID, '_kng_fomo_type', true); |
| 247 |
$status = get_post_meta($notification->ID, '_kng_fomo_status', true) ?: 'disabled'; |
| 248 |
$views = get_post_meta($notification->ID, '_kng_fomo_views', true) ?: 0; |
| 249 |
$clicks = get_post_meta($notification->ID, '_kng_fomo_clicks', true) ?: 0; |
| 250 |
?> |
| 251 |
<tr data-id="<?php echo esc_attr($notification->ID); ?>"> |
| 252 |
<td> |
| 253 |
<div class="kng-fomo-table-title"> |
| 254 |
<span class="kng-fomo-table-preview"> |
| 255 |
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path><path d="M13.73 21a2 2 0 0 1-3.46 0"></path></svg> |
| 256 |
</span> |
| 257 |
<?php echo esc_html($notification->post_title); ?> |
| 258 |
</div> |
| 259 |
</td> |
| 260 |
<td><?php echo esc_html(ucfirst(str_replace('_', ' ', $type))); ?></td> |
| 261 |
<td><?php echo esc_html(number_format_i18n($views)); ?></td> |
| 262 |
<td><?php echo esc_html(number_format_i18n($clicks)); ?></td> |
| 263 |
<td> |
| 264 |
<span class="kng-fomo-status kng-fomo-status--<?php echo esc_attr($status); ?>"> |
| 265 |
<span class="kng-fomo-status-dot"></span> |
| 266 |
<?php echo $status === 'enabled' ? esc_html__('Active', 'king-addons') : esc_html__('Inactive', 'king-addons'); ?> |
| 267 |
</span> |
| 268 |
</td> |
| 269 |
<td> |
| 270 |
<div class="kng-fomo-table-actions"> |
| 271 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-fomo&view=wizard&edit=' . $notification->ID)); ?>" class="kng-fomo-table-action kng-fomo-edit" title="<?php esc_attr_e('Edit', 'king-addons'); ?>"> |
| 272 |
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg> |
| 273 |
</a> |
| 274 |
<button type="button" class="kng-fomo-table-action kng-fomo-duplicate" title="<?php esc_attr_e('Duplicate', 'king-addons'); ?>"> |
| 275 |
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg> |
| 276 |
</button> |
| 277 |
<button type="button" class="kng-fomo-table-action kng-fomo-table-action--danger kng-fomo-delete" title="<?php esc_attr_e('Delete', 'king-addons'); ?>"> |
| 278 |
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg> |
| 279 |
</button> |
| 280 |
</div> |
| 281 |
</td> |
| 282 |
</tr> |
| 283 |
<?php endforeach; ?> |
| 284 |
</tbody> |
| 285 |
</table> |
| 286 |
</div> |
| 287 |
</div> |
| 288 |
<?php else: ?> |
| 289 |
<!-- Empty State --> |
| 290 |
<div class="kng-fomo-empty"> |
| 291 |
<div class="kng-fomo-empty-icon"> |
| 292 |
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path><path d="M13.73 21a2 2 0 0 1-3.46 0"></path></svg> |
| 293 |
</div> |
| 294 |
<h3 class="kng-fomo-empty-title"><?php esc_html_e('No notifications yet', 'king-addons'); ?></h3> |
| 295 |
<p class="kng-fomo-empty-desc"><?php esc_html_e('Create your first notification to start building social proof and urgency.', 'king-addons'); ?></p> |
| 296 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-fomo&view=wizard')); ?>" class="kng-fomo-btn kng-fomo-btn--primary"> |
| 297 |
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg> |
| 298 |
<?php esc_html_e('Create Your First Notification', 'king-addons'); ?> |
| 299 |
</a> |
| 300 |
</div> |
| 301 |
<?php endif; ?> |
| 302 |
|
| 303 |
<!-- Pro Upsell --> |
| 304 |
<?php if (!$is_pro): ?> |
| 305 |
<div class="kng-fomo-upsell"> |
| 306 |
<div class="kng-fomo-upsell-content"> |
| 307 |
<span class="kng-fomo-upsell-badge"> |
| 308 |
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg> |
| 309 |
<?php esc_html_e('Pro', 'king-addons'); ?> |
| 310 |
</span> |
| 311 |
<h3 class="kng-fomo-upsell-title"><?php esc_html_e('Unlock All Features', 'king-addons'); ?></h3> |
| 312 |
<p class="kng-fomo-upsell-desc"><?php esc_html_e('Get unlimited notifications, advanced analytics, reviews, donations, flashing tabs, and more with King Addons Pro.', 'king-addons'); ?></p> |
| 313 |
<div class="kng-fomo-upsell-features"> |
| 314 |
<span class="kng-fomo-upsell-feature"> |
| 315 |
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> |
| 316 |
<?php esc_html_e('Unlimited Notifications', 'king-addons'); ?> |
| 317 |
</span> |
| 318 |
<span class="kng-fomo-upsell-feature"> |
| 319 |
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> |
| 320 |
<?php esc_html_e('Reviews & Ratings', 'king-addons'); ?> |
| 321 |
</span> |
| 322 |
<span class="kng-fomo-upsell-feature"> |
| 323 |
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> |
| 324 |
<?php esc_html_e('Custom CSV Import', 'king-addons'); ?> |
| 325 |
</span> |
| 326 |
<span class="kng-fomo-upsell-feature"> |
| 327 |
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> |
| 328 |
<?php esc_html_e('Advanced Analytics', 'king-addons'); ?> |
| 329 |
</span> |
| 330 |
</div> |
| 331 |
<a href="<?php echo esc_url(king_addons_freemius()->get_upgrade_url()); ?>" class="kng-fomo-btn kng-fomo-btn--primary"> |
| 332 |
<?php esc_html_e('Upgrade to Pro', 'king-addons'); ?> |
| 333 |
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg> |
| 334 |
</a> |
| 335 |
</div> |
| 336 |
</div> |
| 337 |
<?php endif; ?> |
| 338 |
|
| 339 |
</div> |
| 340 |
|