Plugin Directory

Changeset 3375412


Ignore:
Timestamp:
10/09/2025 02:32:02 AM (5 months ago)
Author:
soliddigital
Message:

Update to version 1.1.0 from GitHub

Location:
path-pilot
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • path-pilot/tags/1.1.0/admin/common/settings-common.php

    r3373461 r3375412  
    151151<div class="pp-home-section pp-margin-bottom">
    152152    <h3 class="pp-section-heading"><i class="emoji-star icon-pilot-icon"></i> Interface Settings</h3>
     153   
     154    <div class="pp-home-stat pp-stat-card" style="margin-bottom: 20px;">
     155        <div class="pp-home-stat-label">Insights Only</div>
     156        <div style="margin:20px 0;">
     157            <label class="pp-toggle-switch" style="display:flex;align-items:center;gap:15px;cursor:pointer;">
     158                <input type="hidden" name="path_pilot_insights_only" value="0" />
     159                <input type="checkbox" name="path_pilot_insights_only" id="path_pilot_insights_only" value="1" <?php checked(get_option('path_pilot_insights_only', false)); ?> style="display:none;" />
     160                <div class="pp-toggle-track" style="position:relative;width:50px;height:24px;background:#e0e0e0;border-radius:12px;transition:background-color 0.3s ease;">
     161                    <div class="pp-toggle-handle" style="position:absolute;top:2px;left:2px;width:20px;height:20px;background:#fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,0.2);transition:transform 0.3s ease;"></div>
     162                </div>
     163                <span style="font-weight:500;">Hide drawer and collect data only</span>
     164            </label>
     165        </div>
     166        <div class="pp-stat-description">
     167            When enabled, Path Pilot collects visitor data and analytics in the background without showing any UI to visitors. When disabled, visitors will see the recommendations drawer.
     168        </div>
     169    </div>
     170
    153171    <div class="pp-home-stat pp-stat-card">
    154172        <div class="pp-home-stat-label">Minimum Path Hops</div>
     
    162180    </div>
    163181</div>
     182
     183<script>
     184document.addEventListener('DOMContentLoaded', function() {
     185    // Toggle switch functionality
     186    function setupToggleSwitch() {
     187        var toggle = document.getElementById('path_pilot_insights_only');
     188        var track = document.querySelector('.pp-toggle-track');
     189        var handle = document.querySelector('.pp-toggle-handle');
     190       
     191        if (!toggle || !track || !handle) return;
     192
     193        function updateToggleState() {
     194            if (toggle.checked) {
     195                track.style.backgroundColor = '#1976d2';
     196                handle.style.transform = 'translateX(26px)';
     197            } else {
     198                track.style.backgroundColor = '#e0e0e0';
     199                handle.style.transform = 'translateX(0)';
     200            }
     201        }
     202
     203        // Initialize state
     204        updateToggleState();
     205
     206        // Add click handler
     207        track.addEventListener('click', function(e) {
     208            e.preventDefault();
     209            toggle.checked = !toggle.checked;
     210            updateToggleState();
     211        });
     212
     213        // Add change handler for form submission
     214        toggle.addEventListener('change', updateToggleState);
     215    }
     216
     217    setupToggleSwitch();
     218});
     219</script>
  • path-pilot/tags/1.1.0/admin/free/settings-free.php

    r3373461 r3375412  
    55?>
    66<div class="pp-content">
     7    <?php if (isset($_GET['updated']) && $_GET['updated'] === 'true'): ?>
     8        <div class="notice notice-success is-dismissible" style="margin: 20px 0; padding: 12px 20px; background: #d4edda; border: 1px solid #c3e6cb; border-radius: 4px; color: #155724;">
     9            <strong>Settings saved successfully!</strong> Your Path Pilot configuration has been updated.
     10        </div>
     11    <?php endif; ?>
     12   
    713    <form method="post" action="<?php echo esc_url(admin_url('admin-post.php')); ?>" id="path-pilot-settings-form">
    814        <input type="hidden" name="action" value="path_pilot_save_settings">
     
    1218        do_action('path_pilot_additional_settings');
    1319        ?>
    14         <button type="submit" class="btn btn-primary" style="padding:12px 24px;font-weight:600;font-size:1rem;">Save Settings</button>
     20        <button type="submit" class="btn btn-primary" id="save-settings-btn" style="padding:12px 24px;font-weight:600;font-size:1rem;">Save Settings</button>
    1521    </form>
     22   
     23    <!-- Loading overlay -->
     24    <div id="pp-loading-overlay" style="display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);z-index:9999;justify-content:center;align-items:center;">
     25        <div style="background:#fff;padding:30px;border-radius:8px;text-align:center;box-shadow:0 4px 20px rgba(0,0,0,0.3);">
     26            <div style="width:40px;height:40px;border:4px solid #f3f3f3;border-top:4px solid #1976d2;border-radius:50%;animation:spin 1s linear infinite;margin:0 auto 15px;"></div>
     27            <div style="font-size:16px;font-weight:600;color:#333;">Saving Settings...</div>
     28        </div>
     29    </div>
     30   
     31    <style>
     32        @keyframes spin {
     33            0% { transform: rotate(0deg); }
     34            100% { transform: rotate(360deg); }
     35        }
     36    </style>
     37   
     38    <script>
     39    document.addEventListener('DOMContentLoaded', function() {
     40        var form = document.getElementById('path-pilot-settings-form');
     41        var saveBtn = document.getElementById('save-settings-btn');
     42        var overlay = document.getElementById('pp-loading-overlay');
     43       
     44        if (form && saveBtn && overlay) {
     45            form.addEventListener('submit', function(e) {
     46                // Show loading overlay
     47                overlay.style.display = 'flex';
     48               
     49                // Disable save button to prevent double submission
     50                saveBtn.disabled = true;
     51                saveBtn.textContent = 'Saving...';
     52               
     53                // Hide overlay after 30 seconds as fallback (in case redirect doesn't work)
     54                setTimeout(function() {
     55                    overlay.style.display = 'none';
     56                    saveBtn.disabled = false;
     57                    saveBtn.textContent = 'Save Settings';
     58                   
     59                    // Show error message
     60                    var errorDiv = document.createElement('div');
     61                    errorDiv.style.cssText = 'margin: 20px 0; padding: 12px 20px; background: #f8d7da; border: 1px solid #f5c6cb; border-radius: 4px; color: #721c24;';
     62                    errorDiv.innerHTML = '<strong>Request timed out.</strong> The settings may not have been saved. Please try again.';
     63                   
     64                    // Insert error message before the form
     65                    form.parentNode.insertBefore(errorDiv, form);
     66                   
     67                    // Remove error message after 10 seconds
     68                    setTimeout(function() {
     69                        if (errorDiv.parentNode) {
     70                            errorDiv.parentNode.removeChild(errorDiv);
     71                        }
     72                    }, 10000);
     73                }, 30000);
     74            });
     75        }
     76    });
     77    </script>
    1678</div>
  • path-pilot/tags/1.1.0/includes/common/class-path-pilot-admin.php

    r3373461 r3375412  
    434434        $min_hops = isset($_POST['path_pilot_min_hops']) ? max(1, min(10, absint($_POST['path_pilot_min_hops']))) : 3;
    435435
     436        // Handle the toggle switch - we get "1" when checked, nothing when unchecked
     437        $insights_only = isset($_POST['path_pilot_insights_only']) && $_POST['path_pilot_insights_only'] === '1';
     438       
     439        // Save insights_only directly (true = hide drawer, false = show drawer)
     440        update_option('path_pilot_insights_only', $insights_only);
     441
    436442        // Save allowed content types with validation
    437443        $submitted_content_types = isset($_POST['path_pilot_allowed_content_types']) && is_array($_POST['path_pilot_allowed_content_types'])
  • path-pilot/tags/1.1.0/includes/common/class-path-pilot-shared.php

    r3373461 r3375412  
    449449        $dev_mode = (bool) get_option('path_pilot_dev_mode', false);
    450450        $ready = $dev_mode ? true : (bool) get_option('path_pilot_ready', false);
     451        $insights_only = (bool) get_option('path_pilot_insights_only', false); // Default to false (show drawer)
     452        $show_drawer = !$insights_only; // Show drawer when NOT insights only
    451453        $cta_text = get_option('path_pilot_cta_text', 'Need a hand?');
    452454        $recommend_label = get_option('path_pilot_recommend_label', 'Recommended for you:');
     
    489491        Log::info('Path Pilot: wp_localize_script result = ' . ($localize_result ? 'success' : 'failed'));
    490492
    491         // Always enqueue UI/interactivity - widget should always be available
    492         // Only the chat feature is gated behind Pro license, not the widget itself
     493        // Conditionally enqueue UI/interactivity based on show_drawer setting
     494        // If drawer is disabled, we skip the UI but keep tracking active
     495        if ($show_drawer) {
    493496            Log::info('Path Pilot: Enqueuing index.js script...');
    494497            $script_url = plugins_url('scripts/index.js', $main_plugin_file);
     
    509512                    'ready' => $ready,
    510513                    'dev_mode' => $dev_mode,
     514                    'insights_only' => $insights_only,
     515                    'show_drawer' => $show_drawer,
    511516                    'cta_text' => $cta_text,
    512517                    'recommend_label' => $recommend_label,
     
    519524                ]
    520525            );
     526        } else {
     527            Log::info('Path Pilot: Drawer disabled - skipping UI scripts but keeping tracking active');
     528        }
    521529    }
    522530
  • path-pilot/tags/1.1.0/path-pilot.php

    r3373461 r3375412  
    33 * Plugin Name: Path Pilot
    44 * Description: Modern WordPress plugin for smart recommendations and analytics.
    5  * Version: 1.0.0
     5 * Version: 1.1.0
    66 * Author: Solid Digital
    77 * Author URI: https://www.soliddigital.com
     
    1313
    1414if (!defined('ABSPATH')) exit;
    15 define('PATH_PILOT_VERSION', '1.0.0');
     15define('PATH_PILOT_VERSION', '1.1.0');
    1616
    1717// This is the FREE version. Pro features are only available in the Pro build.
  • path-pilot/tags/1.1.0/readme.txt

    r3373461 r3375412  
    11=== Path Pilot ===
    22Requires at least: 6.0
    3 Tested up to: 6.8
     3Tested up to: 6.8.3
    44Requires PHP: 7.4
    5 Stable tag: 1.0.0
     5Stable tag: 1.1.0
    66License: GPLv2 or later
    77License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • path-pilot/tags/1.1.0/scripts/index.js

    r3373461 r3375412  
    88
    99  function initPathPilot() {
     10 
     11  // --- Check if drawer should be shown ---
     12  if (window.PathPilotStatus && window.PathPilotStatus.insights_only === true) {
     13    console.log('Path Pilot: Insights only mode enabled - skipping drawer initialization');
     14    return; // Exit early if insights only mode is enabled
     15  }
     16 
     17  // --- Inject icon font CSS if not present ---
     18  if (!document.querySelector('link[href*="path-pilot-icons.css"]')) {
     19    var iconFontLink = document.createElement('link');
     20    iconFontLink.rel = 'stylesheet';
     21    iconFontLink.href = (window.PathPilotStatus && window.PathPilotStatus.icon_css_url) || '/wp-content/plugins/path-pilot/assets/css/path-pilot-icons.css';
     22    document.head.appendChild(iconFontLink);
     23  }
    1024
    1125    let pathPilotNonce = window.PathPilotStatus ? window.PathPilotStatus.nonce : null;
  • path-pilot/trunk/admin/common/settings-common.php

    r3373461 r3375412  
    151151<div class="pp-home-section pp-margin-bottom">
    152152    <h3 class="pp-section-heading"><i class="emoji-star icon-pilot-icon"></i> Interface Settings</h3>
     153   
     154    <div class="pp-home-stat pp-stat-card" style="margin-bottom: 20px;">
     155        <div class="pp-home-stat-label">Insights Only</div>
     156        <div style="margin:20px 0;">
     157            <label class="pp-toggle-switch" style="display:flex;align-items:center;gap:15px;cursor:pointer;">
     158                <input type="hidden" name="path_pilot_insights_only" value="0" />
     159                <input type="checkbox" name="path_pilot_insights_only" id="path_pilot_insights_only" value="1" <?php checked(get_option('path_pilot_insights_only', false)); ?> style="display:none;" />
     160                <div class="pp-toggle-track" style="position:relative;width:50px;height:24px;background:#e0e0e0;border-radius:12px;transition:background-color 0.3s ease;">
     161                    <div class="pp-toggle-handle" style="position:absolute;top:2px;left:2px;width:20px;height:20px;background:#fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,0.2);transition:transform 0.3s ease;"></div>
     162                </div>
     163                <span style="font-weight:500;">Hide drawer and collect data only</span>
     164            </label>
     165        </div>
     166        <div class="pp-stat-description">
     167            When enabled, Path Pilot collects visitor data and analytics in the background without showing any UI to visitors. When disabled, visitors will see the recommendations drawer.
     168        </div>
     169    </div>
     170
    153171    <div class="pp-home-stat pp-stat-card">
    154172        <div class="pp-home-stat-label">Minimum Path Hops</div>
     
    162180    </div>
    163181</div>
     182
     183<script>
     184document.addEventListener('DOMContentLoaded', function() {
     185    // Toggle switch functionality
     186    function setupToggleSwitch() {
     187        var toggle = document.getElementById('path_pilot_insights_only');
     188        var track = document.querySelector('.pp-toggle-track');
     189        var handle = document.querySelector('.pp-toggle-handle');
     190       
     191        if (!toggle || !track || !handle) return;
     192
     193        function updateToggleState() {
     194            if (toggle.checked) {
     195                track.style.backgroundColor = '#1976d2';
     196                handle.style.transform = 'translateX(26px)';
     197            } else {
     198                track.style.backgroundColor = '#e0e0e0';
     199                handle.style.transform = 'translateX(0)';
     200            }
     201        }
     202
     203        // Initialize state
     204        updateToggleState();
     205
     206        // Add click handler
     207        track.addEventListener('click', function(e) {
     208            e.preventDefault();
     209            toggle.checked = !toggle.checked;
     210            updateToggleState();
     211        });
     212
     213        // Add change handler for form submission
     214        toggle.addEventListener('change', updateToggleState);
     215    }
     216
     217    setupToggleSwitch();
     218});
     219</script>
  • path-pilot/trunk/admin/free/settings-free.php

    r3373461 r3375412  
    55?>
    66<div class="pp-content">
     7    <?php if (isset($_GET['updated']) && $_GET['updated'] === 'true'): ?>
     8        <div class="notice notice-success is-dismissible" style="margin: 20px 0; padding: 12px 20px; background: #d4edda; border: 1px solid #c3e6cb; border-radius: 4px; color: #155724;">
     9            <strong>Settings saved successfully!</strong> Your Path Pilot configuration has been updated.
     10        </div>
     11    <?php endif; ?>
     12   
    713    <form method="post" action="<?php echo esc_url(admin_url('admin-post.php')); ?>" id="path-pilot-settings-form">
    814        <input type="hidden" name="action" value="path_pilot_save_settings">
     
    1218        do_action('path_pilot_additional_settings');
    1319        ?>
    14         <button type="submit" class="btn btn-primary" style="padding:12px 24px;font-weight:600;font-size:1rem;">Save Settings</button>
     20        <button type="submit" class="btn btn-primary" id="save-settings-btn" style="padding:12px 24px;font-weight:600;font-size:1rem;">Save Settings</button>
    1521    </form>
     22   
     23    <!-- Loading overlay -->
     24    <div id="pp-loading-overlay" style="display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);z-index:9999;justify-content:center;align-items:center;">
     25        <div style="background:#fff;padding:30px;border-radius:8px;text-align:center;box-shadow:0 4px 20px rgba(0,0,0,0.3);">
     26            <div style="width:40px;height:40px;border:4px solid #f3f3f3;border-top:4px solid #1976d2;border-radius:50%;animation:spin 1s linear infinite;margin:0 auto 15px;"></div>
     27            <div style="font-size:16px;font-weight:600;color:#333;">Saving Settings...</div>
     28        </div>
     29    </div>
     30   
     31    <style>
     32        @keyframes spin {
     33            0% { transform: rotate(0deg); }
     34            100% { transform: rotate(360deg); }
     35        }
     36    </style>
     37   
     38    <script>
     39    document.addEventListener('DOMContentLoaded', function() {
     40        var form = document.getElementById('path-pilot-settings-form');
     41        var saveBtn = document.getElementById('save-settings-btn');
     42        var overlay = document.getElementById('pp-loading-overlay');
     43       
     44        if (form && saveBtn && overlay) {
     45            form.addEventListener('submit', function(e) {
     46                // Show loading overlay
     47                overlay.style.display = 'flex';
     48               
     49                // Disable save button to prevent double submission
     50                saveBtn.disabled = true;
     51                saveBtn.textContent = 'Saving...';
     52               
     53                // Hide overlay after 30 seconds as fallback (in case redirect doesn't work)
     54                setTimeout(function() {
     55                    overlay.style.display = 'none';
     56                    saveBtn.disabled = false;
     57                    saveBtn.textContent = 'Save Settings';
     58                   
     59                    // Show error message
     60                    var errorDiv = document.createElement('div');
     61                    errorDiv.style.cssText = 'margin: 20px 0; padding: 12px 20px; background: #f8d7da; border: 1px solid #f5c6cb; border-radius: 4px; color: #721c24;';
     62                    errorDiv.innerHTML = '<strong>Request timed out.</strong> The settings may not have been saved. Please try again.';
     63                   
     64                    // Insert error message before the form
     65                    form.parentNode.insertBefore(errorDiv, form);
     66                   
     67                    // Remove error message after 10 seconds
     68                    setTimeout(function() {
     69                        if (errorDiv.parentNode) {
     70                            errorDiv.parentNode.removeChild(errorDiv);
     71                        }
     72                    }, 10000);
     73                }, 30000);
     74            });
     75        }
     76    });
     77    </script>
    1678</div>
  • path-pilot/trunk/includes/common/class-path-pilot-admin.php

    r3373461 r3375412  
    434434        $min_hops = isset($_POST['path_pilot_min_hops']) ? max(1, min(10, absint($_POST['path_pilot_min_hops']))) : 3;
    435435
     436        // Handle the toggle switch - we get "1" when checked, nothing when unchecked
     437        $insights_only = isset($_POST['path_pilot_insights_only']) && $_POST['path_pilot_insights_only'] === '1';
     438       
     439        // Save insights_only directly (true = hide drawer, false = show drawer)
     440        update_option('path_pilot_insights_only', $insights_only);
     441
    436442        // Save allowed content types with validation
    437443        $submitted_content_types = isset($_POST['path_pilot_allowed_content_types']) && is_array($_POST['path_pilot_allowed_content_types'])
  • path-pilot/trunk/includes/common/class-path-pilot-shared.php

    r3373461 r3375412  
    449449        $dev_mode = (bool) get_option('path_pilot_dev_mode', false);
    450450        $ready = $dev_mode ? true : (bool) get_option('path_pilot_ready', false);
     451        $insights_only = (bool) get_option('path_pilot_insights_only', false); // Default to false (show drawer)
     452        $show_drawer = !$insights_only; // Show drawer when NOT insights only
    451453        $cta_text = get_option('path_pilot_cta_text', 'Need a hand?');
    452454        $recommend_label = get_option('path_pilot_recommend_label', 'Recommended for you:');
     
    489491        Log::info('Path Pilot: wp_localize_script result = ' . ($localize_result ? 'success' : 'failed'));
    490492
    491         // Always enqueue UI/interactivity - widget should always be available
    492         // Only the chat feature is gated behind Pro license, not the widget itself
     493        // Conditionally enqueue UI/interactivity based on show_drawer setting
     494        // If drawer is disabled, we skip the UI but keep tracking active
     495        if ($show_drawer) {
    493496            Log::info('Path Pilot: Enqueuing index.js script...');
    494497            $script_url = plugins_url('scripts/index.js', $main_plugin_file);
     
    509512                    'ready' => $ready,
    510513                    'dev_mode' => $dev_mode,
     514                    'insights_only' => $insights_only,
     515                    'show_drawer' => $show_drawer,
    511516                    'cta_text' => $cta_text,
    512517                    'recommend_label' => $recommend_label,
     
    519524                ]
    520525            );
     526        } else {
     527            Log::info('Path Pilot: Drawer disabled - skipping UI scripts but keeping tracking active');
     528        }
    521529    }
    522530
  • path-pilot/trunk/path-pilot.php

    r3373461 r3375412  
    33 * Plugin Name: Path Pilot
    44 * Description: Modern WordPress plugin for smart recommendations and analytics.
    5  * Version: 1.0.0
     5 * Version: 1.1.0
    66 * Author: Solid Digital
    77 * Author URI: https://www.soliddigital.com
     
    1313
    1414if (!defined('ABSPATH')) exit;
    15 define('PATH_PILOT_VERSION', '1.0.0');
     15define('PATH_PILOT_VERSION', '1.1.0');
    1616
    1717// This is the FREE version. Pro features are only available in the Pro build.
  • path-pilot/trunk/readme.txt

    r3373461 r3375412  
    11=== Path Pilot ===
    22Requires at least: 6.0
    3 Tested up to: 6.8
     3Tested up to: 6.8.3
    44Requires PHP: 7.4
    5 Stable tag: 1.0.0
     5Stable tag: 1.1.0
    66License: GPLv2 or later
    77License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • path-pilot/trunk/scripts/index.js

    r3373461 r3375412  
    88
    99  function initPathPilot() {
     10 
     11  // --- Check if drawer should be shown ---
     12  if (window.PathPilotStatus && window.PathPilotStatus.insights_only === true) {
     13    console.log('Path Pilot: Insights only mode enabled - skipping drawer initialization');
     14    return; // Exit early if insights only mode is enabled
     15  }
     16 
     17  // --- Inject icon font CSS if not present ---
     18  if (!document.querySelector('link[href*="path-pilot-icons.css"]')) {
     19    var iconFontLink = document.createElement('link');
     20    iconFontLink.rel = 'stylesheet';
     21    iconFontLink.href = (window.PathPilotStatus && window.PathPilotStatus.icon_css_url) || '/wp-content/plugins/path-pilot/assets/css/path-pilot-icons.css';
     22    document.head.appendChild(iconFontLink);
     23  }
    1024
    1125    let pathPilotNonce = window.PathPilotStatus ? window.PathPilotStatus.nonce : null;
Note: See TracChangeset for help on using the changeset viewer.