Skip to content

Commit 47c2987

Browse files
committed
Merge branch 'feature/upgrade-page' into main
2 parents 76a8062 + e34d14f commit 47c2987

5 files changed

Lines changed: 74 additions & 21 deletions

File tree

admin/common/admin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ function path_pilot_display_analytics($pages_coverage = 0, $days_active = 0, $pa
398398
<div class="pp-home-stat-value"><?php echo $conversion_rate; ?>%</div>
399399
<?php if ($conversion_rate > 0): ?>
400400
<div class="pp-stat-trend pp-trend-up">
401-
<i class="emoji-hot"></i> <?php echo $conversion_count; ?> total conversions
401+
<i class="emoji-hot icon-pilot-icon"></i> <?php echo $conversion_count; ?> total conversions
402402
</div>
403403
<?php else: ?>
404404
<div class="pp-stat-waiting">No conversions tracked yet</div>
@@ -426,7 +426,7 @@ function path_pilot_display_analytics($pages_coverage = 0, $days_active = 0, $pa
426426
<div class="pp-home-stat-value"><?php echo $avg_path_length; ?> pages</div>
427427
<?php if ($avg_path_length > 1): ?>
428428
<div class="pp-stat-trend pp-trend-up">
429-
<i class="emoji-hot"></i> Visitors exploring multiple pages
429+
<i class="emoji-hot icon-pilot-icon"></i> Visitors exploring multiple pages
430430
</div>
431431
<?php endif; ?>
432432
<?php else: ?>

admin/common/settings-common.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
?>
2121

2222
<div class="pp-home-section pp-margin-bottom pp-content-types-section">
23-
<h3 class="pp-section-heading"><i class="emoji-gear"></i> Content Types for Recommendations</h3>
23+
<h3 class="pp-section-heading"><i class="emoji-gear icon-pilot-icon"></i> Content Types for Recommendations</h3>
2424
<div class="pp-home-protip">
2525
<i class="icon-pilot-icon"></i>
2626
<strong>Pro Tip:</strong> Select which types of content can appear in recommendations and AI chat responses. This affects both the drawer recommendations and AI chat suggestions.
@@ -67,7 +67,7 @@
6767
</div>
6868

6969
<div class="pp-home-section pp-margin-bottom pp-goal-pages-section">
70-
<h3 class="pp-section-heading"><i class="emoji-target"></i> Goal Pages</h3>
70+
<h3 class="pp-section-heading"><i class="emoji-target icon-pilot-icon"></i> Goal Pages</h3>
7171
<div class="pp-home-protip">
7272
<i class="icon-pilot-icon"></i>
7373
<strong>Pro Tip:</strong> Select pages that represent key objectives for your users. Path Pilot will recommend paths that guide users towards these goals.
@@ -108,7 +108,7 @@
108108
</div>
109109

110110
<div class="pp-home-section pp-margin-bottom pp-conversion-pages-section">
111-
<h3 class="pp-section-heading"><i class="emoji-star"></i> Conversion Pages</h3>
111+
<h3 class="pp-section-heading"><i class="emoji-star icon-pilot-icon"></i> Conversion Pages</h3>
112112
<div class="pp-home-protip">
113113
<i class="icon-pilot-icon"></i>
114114
<strong>Pro Tip:</strong> Select pages that signify a completed action, like a "Thank You" page after a form submission or a purchase confirmation. These will be tracked as explicit conversions.
@@ -169,7 +169,7 @@ function setupSearch(searchInputId, listSelector) {
169169
</script>
170170

171171
<div class="pp-home-section pp-margin-bottom">
172-
<h3 class="pp-section-heading"><i class="emoji-cool"></i> Interface Settings</h3>
172+
<h3 class="pp-section-heading"><i class="emoji-star icon-pilot-icon"></i> Interface Settings</h3>
173173
<div class="pp-home-stat pp-stat-card">
174174
<div class="pp-home-stat-label">Minimum Path Hops</div>
175175
<div style="margin:20px 0;">

admin/free/upgrade-free.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
namespace Path_Pilot;
3+
4+
if (!defined('ABSPATH')) exit;
5+
6+
$upgrade_url = Path_Pilot_Admin::UPGRADE_URL;
7+
?>
8+
<div class="pp-home-section pp-margin-bottom">
9+
<h3 class="pp-section-heading"><i class="icon-pilot-icon" aria-hidden="true"></i> Upgrade to Path Pilot Pro</h3>
10+
<div><img src="<?php echo esc_url( plugins_url( 'assets/images/pp-hero.webp', dirname( dirname( dirname( __FILE__ ) ) ) . '/path-pilot.php' ) ); ?>" alt="Path Pilot Pro Features" style="width:100%;"></div>
11+
<p class="pp-stat-description" style="max-width:800px;">
12+
<strong>More conversions. Smarter recommendations. Faster answers.</strong> Pro adds AI chat, intelligent path suggestions, and conversion analytics so visitors find what they need and take action.
13+
</p>
14+
15+
<div class="pp-stats-grid" style="margin:16px auto 24px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); max-width: 1000px;">
16+
<div class="pp-home-stat pp-stat-card">
17+
<div class="pp-home-stat-label">AI Chat Assistant</div>
18+
<div class="pp-stat-description" style="margin-top:6px; font-size:1.25rem; line-height:1.35; font-weight:600; padding-top:0; border-top:0;">Instant, accurate answers trained on your content.</div>
19+
</div>
20+
<div class="pp-home-stat pp-stat-card">
21+
<div class="pp-home-stat-label">Pro Recommendations</div>
22+
<div class="pp-stat-description" style="margin-top:6px; font-size:1.25rem; line-height:1.35; font-weight:600; padding-top:0; border-top:0;">Smarter suggestions powered by multi‑hop journey analysis.</div>
23+
</div><!--
24+
<div class="pp-home-stat pp-stat-card">
25+
<div class="pp-home-stat-label">Conversion Analytics</div>
26+
<div class="pp-stat-description">See journeys, drop‑offs, and what drives conversions.</div>
27+
</div>-->
28+
<div class="pp-home-stat pp-stat-card">
29+
<div class="pp-home-stat-label">Priority Updates & Support</div>
30+
<div class="pp-stat-description" style="margin-top:6px; font-size:1.25rem; line-height:1.35; font-weight:600; padding-top:0; border-top:0;">New features first and premium support from the team.</div>
31+
</div>
32+
</div>
33+
34+
<div style="margin-top:24px; text-align:center;">
35+
<a href="<?php echo esc_url($upgrade_url); ?>" target="_blank" class="btn btn-pro" style="background:#d63638; border-color:#d63638; color:#fff; font-size:18px; padding:12px 24px;">Upgrade Now</a>
36+
</div>
37+
</div>
38+

assets/images/pp-hero.webp

808 KB
Loading

includes/common/class-path-pilot-admin.php

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class Path_Pilot_Admin {
88
// Define constants
9-
const UPGRADE_URL = 'https://pathpilot.app/'; // Centralized upgrade URL
9+
const UPGRADE_URL = 'https://buy.stripe.com/4gM8wQ3L05gL3ms2Me9EI00'; // Centralized upgrade URL
1010

1111
public function __construct() {
1212
add_action('admin_enqueue_scripts', [$this, 'enqueue_admin_css']);
@@ -101,19 +101,13 @@ public function admin_menu() {
101101

102102
// Add the upgrade link as a submenu item
103103
if (!Path_Pilot::is_pro()) {
104-
// Since we can't directly make menu links open in a new tab,
105-
// and the callback of the page is applied only after headers are sent
106-
// we have to use a separate filter to do the redirect
107104
add_submenu_page(
108105
'path-pilot',
109106
'Upgrade to Pro',
110107
'<span class="path-pilot-upgrade-link">Upgrade</span>',
111108
'manage_options',
112109
'path-pilot-upgrade',
113-
function() {
114-
// NOOP
115-
// Redirect must be handled before headers are sent in admin_init
116-
}
110+
array($this, 'render_upgrade_page')
117111
);
118112

119113
}
@@ -223,7 +217,7 @@ public function render_home_page() {
223217
</div>
224218
</div>
225219
<div class="pp-home-section pp-home-news">
226-
<h3 class="pp-section-heading"><i class="emoji-hot"></i> What's New</h3>
220+
<h3 class="pp-section-heading"><i class="emoji-hot icon-pilot-icon"></i> What's New</h3>
227221
<ul class="pp-home-news-list">
228222
<?php
229223
if (count($news_items) > 0) {
@@ -243,13 +237,13 @@ public function render_home_page() {
243237
</div>
244238
</div>
245239
<div class="pp-home-section pp-margin-bottom">
246-
<h3 class="pp-section-heading"><i class="emoji-warm"></i> Recommendation Engine</h3>
240+
<h3 class="pp-section-heading"><i class="emoji-warm icon-pilot-icon"></i> Recommendation Engine</h3>
247241

248242
<div class="pp-home-protip"><i class="icon-pilot-icon"></i> <strong>Pro Tip:</strong> Path Pilot learns from real visitor behavior. The more traffic your site gets, the smarter the recommendations become!</div>
249243

250244
<!-- Temperature readiness indicator -->
251245
<div class="pp-temp-indicator pp-temp-<?php echo esc_attr($temp_level); ?> pp-margin-bottom">
252-
<div class="pp-temp-indicator-icon emoji-<?php echo esc_attr($temp_data['emoji']); ?>"><?php echo $temp_data['emoji_fallback']; ?></div>
246+
<div class="pp-temp-indicator-icon emoji-<?php echo esc_attr($temp_data['emoji']); ?> icon-pilot-icon"><?php echo $temp_data['emoji_fallback']; ?></div>
253247
<div class="pp-temp-indicator-label"><?php echo esc_html($temp_data['label']); ?></div>
254248
<div class="pp-temp-indicator-desc"><?php echo esc_html($temp_data['description']); ?></div>
255249
<div class="pp-temp-indicator-progress">
@@ -424,7 +418,7 @@ public function render_reports_page() {
424418
<div class="pp-content">
425419
<!-- Top Paths Section -->
426420
<div class="pp-home-section pp-margin-bottom">
427-
<h3 class="pp-section-heading"><i class="emoji-hot"></i> Top Conversion Paths</h3>
421+
<h3 class="pp-section-heading"><i class="emoji-hot icon-pilot-icon"></i> Top Conversion Paths</h3>
428422

429423
<div class="pp-home-protip">
430424
<i class="icon-pilot-icon"></i>
@@ -467,7 +461,7 @@ public function render_reports_page() {
467461

468462
<!-- Recent Paths Section -->
469463
<div class="pp-home-section pp-margin-bottom">
470-
<h3 class="pp-section-heading"><i class="emoji-cool"></i> Recent Visitor Paths</h3>
464+
<h3 class="pp-section-heading"><i class="emoji-cool icon-pilot-icon"></i> Recent Visitor Paths</h3>
471465

472466
<?php
473467
$recent_count = isset($_GET['recent_count']) ? intval($_GET['recent_count']) : 10;
@@ -623,12 +617,33 @@ public function save_settings() {
623617
public function handle_upgrade_redirect($value) {
624618
global $pagenow;
625619
$page = (isset($_REQUEST['page']) ? $_REQUEST['page'] : false);
626-
if($pagenow == 'admin.php' && $page == 'path-pilot-upgrade'){
620+
// Preserve optional redirect behavior only when explicitly requested
621+
if ($pagenow == 'admin.php' && $page == 'path-pilot-upgrade' && isset($_GET['pp_redirect']) && $_GET['pp_redirect'] === '1') {
627622
wp_redirect(self::UPGRADE_URL);
628623
exit;
629624
}
630625
}
631626

627+
/**
628+
* Render the free upgrade page explaining Pro benefits
629+
*/
630+
public function render_upgrade_page() {
631+
// Include admin CSS
632+
wp_enqueue_style('path-pilot-admin-style');
633+
634+
// Wrapper to match existing admin layout
635+
echo '<div class="pp-admin-wrap"><div class="pp-content">';
636+
do_action('path_pilot_show_pro_status_message');
637+
638+
// Include the upgrade template
639+
include_once(plugin_dir_path(dirname(__DIR__)) . 'admin/free/upgrade-free.php');
640+
641+
echo '</div></div>';
642+
643+
// Footer
644+
include_once(plugin_dir_path(dirname(__DIR__)) . 'admin/common/footer.php');
645+
}
646+
632647
/**
633648
* Renders the statistics section on the home page
634649
*/
@@ -817,7 +832,7 @@ public function render_analytics_page() {
817832
}
818833
?>
819834
<div class="pp-home-section pp-margin-bottom">
820-
<h3 class="pp-section-heading"><i class="emoji-chart"></i> Daily Performance (Last 30 Days)</h3>
835+
<h3 class="pp-section-heading"><i class="emoji-chart icon-pilot-icon"></i> Daily Performance (Last 30 Days)</h3>
821836
<canvas id="pp-daily-stats-chart" height="120"></canvas>
822837
</div>
823838
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>

0 commit comments

Comments
 (0)