Plugin Directory

Changeset 3338334


Ignore:
Timestamp:
08/02/2025 10:31:29 PM (8 months ago)
Author:
polyplugins
Message:

Update to version 1.4.0 from GitHub

Location:
speedy-search
Files:
7 added
38 edited
1 copied

Legend:

Unmodified
Added
Removed
  • speedy-search/tags/1.4.0/css/backend/settings.css

    r3334968 r3338334  
    3131input[type="range"] {
    3232  width: 95%!important;
     33}
     34
     35.tab .warning {
     36  background-color: #FFC107;
     37  color: #333;
     38  border-top-right-radius: 5px;
     39  border-top-left-radius: 5px;
     40  padding: 8px 12px;
     41  font-weight: 700;
     42}
     43
     44.tab .danger {
     45  background-color: #DC3545;
     46  color: #333;
     47  border-top-right-radius: 5px;
     48  border-top-left-radius: 5px;
     49  padding: 8px 12px;
     50  font-weight: 700;
    3351}
    3452
  • speedy-search/tags/1.4.0/css/frontend/style.css

    r3336230 r3338334  
    213213.instant-search-result.skeleton-loading .excerpt-result {
    214214  background-color: #e0e0e0;
    215   color: transparent;
     215  color: transparent!important;
    216216  border-radius: 4px;
    217217  position: relative;
     
    233233.instant-search-result.skeleton-loading .excerpt-result {
    234234  min-height: 14px;
     235}
     236
     237/**
     238 * Advanced Search
     239 */
     240.speedy-search-container.advanced-search .instant-search-wrapper {
     241  position: unset;
    235242}
    236243
     
    275282
    276283@keyframes prixClipFix {
    277     0%   {clip-path:polygon(50% 50%,0 0,0 0,0 0,0 0,0 0)}
    278     25%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 0,100% 0,100% 0)}
    279     50%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,100% 100%,100% 100%)}
    280     75%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 100%)}
    281     100% {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 0)}
    282 }
     284  0%   {clip-path:polygon(50% 50%,0 0,0 0,0 0,0 0,0 0)}
     285  25%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 0,100% 0,100% 0)}
     286  50%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,100% 100%,100% 100%)}
     287  75%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 100%)}
     288  100% {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 0)}
     289}
  • speedy-search/tags/1.4.0/includes/classes/Backend/Admin.php

    r3336230 r3338334  
    164164
    165165    add_settings_section(
     166      'speedy_search_advanced_section_polyplugins',
     167      '',
     168      null,
     169      'speedy_search_advanced_polyplugins'
     170    );
     171
     172    add_settings_section(
    166173      'speedy_search_repo_section_polyplugins',
    167174      '',
     
    372379
    373380        add_settings_field(
     381            'advanced_enabled',                             
     382            __('Enabled?', 'speedy-search'),
     383            array($this, 'advanced_enabled_render'),
     384            'speedy_search_advanced_polyplugins',
     385            'speedy_search_advanced_section_polyplugins'
     386        );
     387
     388        add_settings_field(
     389            'advanced_title',                             
     390            __('Title', 'speedy-search'),
     391            array($this, 'advanced_title_render'),
     392            'speedy_search_advanced_polyplugins',
     393            'speedy_search_advanced_section_polyplugins'
     394        );
     395
     396        add_settings_field(
     397            'advanced_placeholder',                             
     398            __('Placeholder', 'speedy-search'),
     399            array($this, 'advanced_placeholder_render'),
     400            'speedy_search_advanced_polyplugins',
     401            'speedy_search_advanced_section_polyplugins'
     402        );
     403
     404        add_settings_field(
    374405            'repo_enabled',                             
    375406            __('Enabled?', 'speedy-search'),
     
    736767    <p><strong><?php esc_html_e('How many downloads would you like to show?', 'speedy-search'); ?></strong></p>
    737768      <?php
     769    }
     770
     771  /**
     772     * Render Advanced Enabled Field
     773     *
     774     * @return void
     775     */
     776    public function advanced_enabled_render() {
     777        $options = Utils::get_option('advanced');
     778    $option  = isset($options['enabled']) ? $options['enabled'] : false;
     779    ?>
     780    <div class="form-check form-switch">
     781      <input type="checkbox" name="speedy_search_settings_polyplugins[advanced][enabled]" class="form-check-input" role="switch" <?php checked(1, $option, true); ?> /> <?php esc_html_e('Yes', 'speedy-search'); ?>
     782    </div>
     783    <p><strong><?php esc_html_e('If enabled, pressing Enter will go to /advanced-search/ instead of the default search, unless indexing is active.', 'speedy-search'); ?><br /><?php esc_html_e('Note: This will flush rewrite rules.', 'speedy-search'); ?></strong></p>
     784    <?php
     785    }
     786
     787  /**
     788     * Render Advanced Title Field
     789     *
     790     * @return void
     791     */
     792    public function advanced_title_render() {
     793        $options = Utils::get_option('advanced');
     794    $option  = isset($options['title']) ? $options['title'] : 'Advanced Search';
     795    ?>
     796    <input type="text" name="speedy_search_settings_polyplugins[advanced][title]" value="<?php echo esc_html($option); ?>" />
     797    <p><strong><?php esc_html_e('Set the page title of advanced search.', 'speedy-search'); ?></strong></p>
     798        <?php
     799    }
     800
     801  /**
     802     * Render Advanced Placeholder Field
     803     *
     804     * @return void
     805     */
     806    public function advanced_placeholder_render() {
     807        $options = Utils::get_option('advanced');
     808    $option  = isset($options['placeholder']) ? $options['placeholder'] : 'Search...';
     809    ?>
     810    <input type="text" name="speedy_search_settings_polyplugins[advanced][placeholder]" value="<?php echo esc_html($option); ?>" />
     811    <p><strong><?php esc_html_e('Set the placeholder for the advanced search input.', 'speedy-search'); ?></strong></p>
     812        <?php
    738813    }
    739814
     
    814889                <?php endif; ?>
    815890                <li>
     891                  <a href="javascript:void(0);" data-section="advanced">
     892                    <i class="bi bi-funnel-fill"></i>
     893                    <?php esc_html_e('Advanced', 'speedy-search'); ?>
     894                  </a>
     895                </li>
     896                <li>
    816897                  <a href="javascript:void(0);" data-section="repo">
    817898                    <i class="bi bi-plug-fill"></i>
     
    868949              <?php endif; ?>
    869950
     951              <div class="tab advanced" style="display: none;">
     952                <div class="warning">
     953                  <?php esc_html_e('Due to the layout differences of various themes, this more than likely will require a developer to add and customize the snappy-search-advanced-search-form.php template in your theme.', 'speedy-search'); ?> If you need a developer you can <a href="https://www.polyplugins.com/contact/" target="_blank">hire us</a> to help.
     954                </div>
     955                <?php
     956                do_settings_sections('speedy_search_advanced_polyplugins');
     957                ?>
     958              </div>
     959
    870960              <div class="tab repo" style="display: none;">
    871961                <?php
     
    10281118        }
    10291119
     1120    if (isset($input['advanced']['enabled']) && $input['advanced']['enabled']) {
     1121      $sanitary_values['advanced']['enabled'] = $input['advanced']['enabled'] === 'on' ? true : false;
     1122
     1123      $new      = $sanitary_values['advanced']['enabled'];
     1124      $advanced = Utils::get_option('advanced');
     1125      $current  = isset($advanced['enabled']) ? $advanced['enabled'] : false;
     1126
     1127      if ($current !== $new) {
     1128        update_option('speedy_search_flush_rewrite_rules_polyplugins', true);
     1129      }
     1130    } else {
     1131      $sanitary_values['advanced']['enabled'] = false;
     1132
     1133      $new      = $sanitary_values['advanced']['enabled'];
     1134      $advanced = Utils::get_option('advanced');
     1135      $current  = isset($advanced['enabled']) ? $advanced['enabled'] : false;
     1136
     1137      if ($current !== $new) {
     1138        update_option('speedy_search_flush_rewrite_rules_polyplugins', true);
     1139      }
     1140    }
     1141
     1142    if (isset($input['advanced']['title']) && $input['advanced']['title']) {
     1143            $sanitary_values['advanced']['title'] = sanitize_text_field($input['advanced']['title']);
     1144        }
     1145
     1146    if (isset($input['advanced']['placeholder']) && $input['advanced']['placeholder']) {
     1147            $sanitary_values['advanced']['placeholder'] = sanitize_text_field($input['advanced']['placeholder']);
     1148        }
     1149
    10301150    if (isset($input['repo_enabled']) && $input['repo_enabled']) {
    10311151      $sanitary_values['repo_enabled'] = $input['repo_enabled'] === 'on' ? true : false;
  • speedy-search/tags/1.4.0/includes/classes/Backend/Background_Worker.php

    r3336230 r3338334  
    197197
    198198        $progress++;
     199
     200        Utils::update_index($type, 'progress', $progress);
    199201      }
    200 
    201       Utils::update_index($type, 'progress', $progress);
    202202    } else {
    203203      Utils::update_index($type, 'complete', true);
  • speedy-search/tags/1.4.0/includes/classes/Backend/Notices.php

    r3336230 r3338334  
    3939        $this->notice_130();
    4040      }
     41      if ($this->version == '1.4.0') {
     42        $this->notice_140();
     43      }
    4144    }
    4245  }
     
    6063  }
    6164
     65  public function notice_140() {
     66    ?>
     67    <div class="notice notice-error is-dismissible speedy-search" style="padding-bottom: 10px;">
     68      <p><?php echo esc_html__('Starting with version 1.5.0, Snappy Search will include functionality offered by our ', 'speedy-search'); ?>
     69      <a href="https://wordpress.org/plugins/admin-instant-search/" target="_blank">Admin Instant Search</a>
     70      <?php echo esc_html__(' plugin. As part of this update, the plugin will gain the ability to index WooCommerce orders, which introduces additional security considerations.', 'speedy-search'); ?>
     71      <br /><br />
     72      <?php echo esc_html__('To support this securely and efficiently, we are ', 'speedy-search'); ?><strong><?php echo esc_html__('discontinuing support for SQLite', 'speedy-search'); ?></strong><?php echo esc_html__('. Managing mixed database logic (SQLite and MySQL) adds unnecessary complexity and overhead, particularly when handling sensitive data like order information.', 'speedy-search'); ?>
     73      <br /><br />
     74      <strong?><?php echo esc_html__('Before updating to 1.5.0, please ensure your site is using MySQL.', 'speedy-search'); ?></strong>
     75      <?php echo esc_html__('If your site is still using SQLite, search functionality will be automatically disabled after the update.', 'speedy-search'); ?></p>
     76      <a href="options-general.php?page=speedy-search"><?php echo esc_html__('Switch to MySQL', 'speedy-search'); ?></a>
     77    </div>
     78    <?php
     79  }
     80
    6281  public function dismiss_notice() {
    6382    if (!isset($_POST['nonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'speedy_search_dismiss_notice_nonce')) {
  • speedy-search/tags/1.4.0/includes/classes/Frontend/Enqueue.php

    r3336230 r3338334  
    2121     */
    2222    private $version;
     23
     24  /**
     25     * The options of this plugin.
     26     *
     27     * @var array $options The options array
     28     */
     29  private $options;
     30
     31  /**
     32     * The popular options of this plugin.
     33     *
     34     * @var array $popular_options The popular options array
     35     */
     36  private $popular_options;
     37
     38  /**
     39     * The advanced options of this plugin.
     40     *
     41     * @var array $advanced_options The advanced options array
     42     */
     43  private $advanced_options;
     44
     45  /**
     46     * Is Snappy Search indexing?
     47     *
     48     * @var bool $is_indexing True if indexing, false if not
     49     */
     50  private $is_indexing;
    2351 
    2452  /**
     
    2856   */
    2957  public function __construct($plugin, $version) {
    30     $this->plugin  = $plugin;
    31     $this->version = $version;
     58    $this->options          = Utils::get_options();
     59    $this->popular_options  = isset($this->options['popular']) ? $this->options['popular'] : array();
     60    $this->advanced_options = isset($this->options['advanced']) ? $this->options['advanced'] : array();
     61    $this->is_indexing      = Utils::is_indexing();
     62    $this->plugin           = $plugin;
     63    $this->version          = $version;
    3264  }
    3365 
     
    6698   */
    6799  private function enqueue_scripts() {
    68     $options                        = get_option('speedy_search_settings_polyplugins');
    69     $selector                       = isset($options['selector']) ? $options['selector'] : '';
    70     $is_indexing                    = Utils::is_indexing();
    71     $popular_options                = Utils::get_option('popular');
    72     $popular_enabled                = isset($popular_options['enabled']) ? $popular_options['enabled'] : 0;
     100    $selector         = isset($this->options['selector']) ? $this->options['selector'] : '';
     101    $advanced_enabled = isset($this->advanced_options['enabled']) ? $this->advanced_options['enabled'] : '';
     102
     103    if ($selector) {
     104      $this->enqueue_selector_search();
     105    } else {
     106      $this->enqueue_shortcode_search();
     107    }
    73108   
    74     if ($selector) {
    75       // Fallback to default search when indexing
    76       if (!$is_indexing) {
    77         wp_enqueue_script('snappy-search-selector', plugins_url('/js/frontend/selector.js', $this->plugin), array('jquery', 'wp-i18n'), $this->version, true);
    78         wp_localize_script(
    79           'snappy-search-selector',
    80           'snappy_search_object',
    81           array(
    82             'options'  => $options,
    83             'popular'  => DB::get_top_terms_last_x_days(),
    84             'currency' => class_exists('WooCommerce') ? get_woocommerce_currency_symbol() : '',
    85           )
    86         );
    87         wp_set_script_translations('snappy-search-selector', 'speedy-search', plugin_dir_path($this->plugin) . '/languages/');
    88        
    89         if ($popular_enabled) {
    90           wp_enqueue_script('snappy-search-analytics', plugins_url('/js/frontend/analytics.js', $this->plugin), array('jquery'), $this->version, true);
    91           wp_localize_script(
    92             'snappy-search-analytics',
    93             'snappy_search_analytics_object',
    94             array(
    95               'options'  => $options,
    96               'ajax_url' => admin_url('admin-ajax.php'),
    97               'nonce'    => wp_create_nonce('speedy_search_analytics_nonce')
    98             )
    99           );
    100         }
     109    if ($advanced_enabled) {
     110      $this->enqueue_advanced_search();
     111    }
     112  }
     113 
     114  /**
     115   * Enqueue selector search
     116   *
     117   * @return void
     118   */
     119  private function enqueue_selector_search() {
     120    // Fallback to default search when indexing
     121    if (!$this->is_indexing) {
     122      wp_enqueue_script('snappy-search-selector', plugins_url('/js/frontend/selector.js', $this->plugin), array('jquery', 'wp-i18n'), $this->version, true);
     123      wp_localize_script(
     124        'snappy-search-selector',
     125        'snappy_search_object',
     126        array(
     127          'options'  => $this->options,
     128          'popular'  => DB::get_top_terms_last_x_days(),
     129          'currency' => class_exists('WooCommerce') ? get_woocommerce_currency_symbol() : '',
     130        )
     131      );
     132      wp_set_script_translations('snappy-search-selector', 'speedy-search', plugin_dir_path($this->plugin) . '/languages/');
     133     
     134      if ($this->popular_options['enabled']) {
     135        $this->enqueue_popular_search();
    101136      }
    102     } else {
    103       // Fallback to default search when indexing
    104       if (!$is_indexing) {
    105         wp_enqueue_script('snappy-search-shortcode', plugins_url('/js/frontend/shortcode.js', $this->plugin), array('jquery', 'wp-i18n'), $this->version, true);
    106         wp_localize_script(
    107           'snappy-search-shortcode',
    108           'snappy_search_object',
    109           array(
    110             'options'  => $options,
    111             'currency' => class_exists('WooCommerce') ? get_woocommerce_currency_symbol() : '',
    112           )
    113         );
    114         wp_set_script_translations('snappy-search-shortcode', 'speedy-search', plugin_dir_path($this->plugin) . '/languages/');
    115        
    116         if ($popular_enabled) {
    117           wp_enqueue_script('snappy-search-analytics', plugins_url('/js/frontend/analytics.js', $this->plugin), array('jquery'), $this->version, true);
    118           wp_localize_script(
    119             'snappy-search-analytics',
    120             'snappy_search_analytics_object',
    121             array(
    122               'options'  => $options,
    123               'ajax_url' => admin_url('admin-ajax.php'),
    124               'nonce'    => wp_create_nonce('speedy_search_analytics_nonce')
    125             )
    126           );
    127         }
     137    }
     138  }
     139 
     140  /**
     141   * Enqueue shortcode search
     142   *
     143   * @return void
     144   */
     145  private function enqueue_shortcode_search() {
     146    // Fallback to default search when indexing
     147    if (!$this->is_indexing) {
     148      wp_enqueue_script('snappy-search-shortcode', plugins_url('/js/frontend/shortcode.js', $this->plugin), array('jquery', 'wp-i18n'), $this->version, true);
     149      wp_localize_script(
     150        'snappy-search-shortcode',
     151        'snappy_search_object',
     152        array(
     153          'options'  => $this->options,
     154          'currency' => class_exists('WooCommerce') ? get_woocommerce_currency_symbol() : '',
     155        )
     156      );
     157      wp_set_script_translations('snappy-search-shortcode', 'speedy-search', plugin_dir_path($this->plugin) . '/languages/');
     158     
     159      if ($this->popular_options['enabled']) {
     160        $this->enqueue_popular_search();
    128161      }
    129162    }
    130163  }
    131164 
     165  /**
     166   * Enqueue advanced search
     167   *
     168   * @return void
     169   */
     170  private function enqueue_advanced_search() {
     171    // Fallback to default search when indexing
     172    if (!$this->is_indexing) {
     173      wp_enqueue_script('snappy-search-advanced', plugins_url('/js/frontend/advanced.js', $this->plugin), array('jquery', 'wp-i18n'), $this->version, true);
     174      wp_localize_script(
     175        'snappy-search-advanced',
     176        'snappy_search_object',
     177        array(
     178          'options'  => $this->options,
     179          'currency' => class_exists('WooCommerce') ? get_woocommerce_currency_symbol() : '',
     180        )
     181      );
     182      wp_set_script_translations('snappy-search-advanced', 'speedy-search', plugin_dir_path($this->plugin) . '/languages/');
     183     
     184      if ($this->popular_options['enabled']) {
     185        $this->enqueue_popular_search();
     186      }
     187    }
     188  }
     189 
     190  /**
     191   * Enqueue popular search
     192   *
     193   * @return void
     194   */
     195  private function enqueue_popular_search() {
     196    wp_enqueue_script('snappy-search-analytics', plugins_url('/js/frontend/analytics.js', $this->plugin), array('jquery'), $this->version, true);
     197    wp_localize_script(
     198      'snappy-search-analytics',
     199      'snappy_search_analytics_object',
     200      array(
     201        'options'  => $this->options,
     202        'ajax_url' => admin_url('admin-ajax.php'),
     203        'nonce'    => wp_create_nonce('speedy_search_analytics_nonce')
     204      )
     205    );
     206  }
     207 
    132208}
  • speedy-search/tags/1.4.0/includes/classes/Frontend_Loader.php

    r3334968 r3338334  
    33namespace PolyPlugins\Speedy_Search;
    44
     5use PolyPlugins\Speedy_Search\Frontend\Advanced_Search;
    56use PolyPlugins\Speedy_Search\Frontend\Analytics;
    67use PolyPlugins\Speedy_Search\Frontend\Enqueue;
     
    5152    $this->load_ui();
    5253    $this->load_shortcode();
     54    $this->load_advanced_search();
    5355    $this->load_analytics();
    5456  }
     
    8587 
    8688  /**
     89   * Load Advanced Search
     90   *
     91   * @return void
     92   */
     93  public function load_advanced_search() {
     94    $shortcode = new Advanced_Search($this->plugin, $this->version, $this->plugin_dir_url);
     95    $shortcode->init();
     96  }
     97 
     98  /**
    8799   * Load Analytics
    88100   *
  • speedy-search/tags/1.4.0/includes/classes/Updater.php

    r3336230 r3338334  
    6565      update_option('speedy_search_version_polyplugins', $stored_version);
    6666    }
     67
     68    if (version_compare($stored_version, '1.4.0', '<')) {
     69      $stored_version = '1.4.0';
     70
     71      $this->update_to_140();
     72
     73      update_option('speedy_search_version_polyplugins', $stored_version);
     74    }
    6775  }
    6876
     
    109117  }
    110118
     119  private function update_to_140() {
     120    update_option('speedy_search_notice_dismissed_polyplugins', false);
     121  }
     122
    111123}
  • speedy-search/tags/1.4.0/js/frontend/selector.js

    r3334968 r3338334  
    1 const { __, _x, _n, _nx } = wp.i18n;
    2 
    3 let selector          = snappy_search_object.options?.selector ?? '';
    4 let characters        = snappy_search_object.options?.characters ?? 4;
    5 let typing_delay      = snappy_search_object.options?.typing_delay ?? 300;
    6 let posts_enabled     = snappy_search_object.options?.posts?.enabled ?? false;
    7 let pages_enabled     = snappy_search_object.options?.pages?.enabled ?? false;
    8 let products_enabled  = snappy_search_object.options?.products?.enabled ?? false;
    9 let downloads_enabled = snappy_search_object.options?.downloads?.enabled ?? false;
    10 let popular           = snappy_search_object.popular ?? false;
    11 let currency          = snappy_search_object.currency ?? '$';
    12 
    131jQuery(document).ready(function ($) {
    14   if (!selector) return;
    15 
    16   const $searchInput      = $(selector);
    17   const $searchForm       = $searchInput.closest("form");
    18   const typingDelay       = typing_delay;
    19   const postTypes         = getTypes();
    20   const initialSearchForm = buildInitialSearchForm();
     2  const { __, _x, _n, _nx } = wp.i18n;
     3
     4  let selector = snappy_search_object.options?.selector ?? '';
     5
     6  if (!selector) {
     7    return;
     8  }
     9
     10  if (!$(selector).length) {
     11    return;
     12  }
     13
     14  let characters            = snappy_search_object.options?.characters ?? 4;
     15  let typing_delay          = snappy_search_object.options?.typing_delay ?? 300;
     16  let posts_enabled         = snappy_search_object.options?.posts?.enabled ?? false;
     17  let pages_enabled         = snappy_search_object.options?.pages?.enabled ?? false;
     18  let products_enabled      = snappy_search_object.options?.products?.enabled ?? false;
     19  let downloads_enabled     = snappy_search_object.options?.downloads?.enabled ?? false;
     20  let popular               = snappy_search_object.popular ?? false;
     21  let currency              = snappy_search_object.currency ?? '$';
     22
     23  const $searchInput        = $(selector);
     24  const $searchForm         = $searchInput.closest("form");
     25  const typingDelay         = typing_delay;
     26  const postTypes           = getTypes();
     27  const initialSearchForm   = buildInitialSearchForm();
    2128
    2229  init();
     
    154161            "</p>"
    155162          );
    156         console.error("Search error in " + endpoint + ":", error);
    157163      },
    158164    });
  • speedy-search/tags/1.4.0/js/frontend/shortcode.js

    r3336262 r3338334  
    1 const { __, _x, _n, _nx } = wp.i18n;
    2 
    3 let selector          = '.snappy-search-input';
    4 let characters        = snappy_search_object.options?.characters ?? 4;
    5 let typing_delay      = snappy_search_object.options?.typing_delay ?? 300;
    6 let posts_enabled     = snappy_search_object.options?.posts?.enabled ?? false;
    7 let pages_enabled     = snappy_search_object.options?.pages?.enabled ?? false;
    8 let products_enabled  = snappy_search_object.options?.products?.enabled ?? false;
    9 let downloads_enabled = snappy_search_object.options?.downloads?.enabled ?? false;
    10 let currency          = snappy_search_object.currency ?? '$';
     1
    112
    123jQuery(document).ready(function ($) {
    13   if (!selector) return;
    14 
    15   const $searchInput      = $(selector);
    16   const $searchForm       = $searchInput.closest("form");
    17   const typingDelay       = typing_delay;
    18   const postTypes         = getTypes();
    19   const initialSearchForm = buildInitialSearchForm();
     4  const { __, _x, _n, _nx } = wp.i18n;
     5
     6  let selector          = '.snappy-search-input';
     7
     8  if (!$(selector).length) {
     9    return;
     10  }
     11
     12  let characters        = snappy_search_object.options?.characters ?? 4;
     13  let typing_delay      = snappy_search_object.options?.typing_delay ?? 300;
     14  let posts_enabled     = snappy_search_object.options?.posts?.enabled ?? false;
     15  let pages_enabled     = snappy_search_object.options?.pages?.enabled ?? false;
     16  let products_enabled  = snappy_search_object.options?.products?.enabled ?? false;
     17  let downloads_enabled = snappy_search_object.options?.downloads?.enabled ?? false;
     18  let currency          = snappy_search_object.currency ?? '$';
     19
     20  const $searchInput        = $(selector);
     21  const $searchForm         = $searchInput.closest("form");
     22  const typingDelay         = typing_delay;
     23  const postTypes           = getTypes();
     24  const initialSearchForm   = buildInitialSearchForm();
    2025
    2126  init();
     
    186191        $section.empty();
    187192        $section.append("<p>" + __("An error occurred while searching.", "speedy-search") + "</p>");
    188         console.error("Search error in " + endpoint + ":", error);
    189193      }
    190194    })
  • speedy-search/tags/1.4.0/languages/speedy-search.pot

    r3336230 r3338334  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Snappy Search 1.3.0\n"
     5"Project-Id-Version: Snappy Search 1.4.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/speedy-search\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-07-29T20:50:50+00:00\n"
     12"POT-Creation-Date: 2025-08-02T21:53:03+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.11.0\n"
     
    4949msgstr ""
    5050
    51 #: includes/classes/Backend/Admin.php:175
    52 #: includes/classes/Backend/Admin.php:223
    53 #: includes/classes/Backend/Admin.php:279
    54 #: includes/classes/Backend/Admin.php:303
    55 #: includes/classes/Backend/Admin.php:327
    56 #: includes/classes/Backend/Admin.php:351
    57 #: includes/classes/Backend/Admin.php:375
     51#: includes/classes/Backend/Admin.php:182
     52#: includes/classes/Backend/Admin.php:230
     53#: includes/classes/Backend/Admin.php:286
     54#: includes/classes/Backend/Admin.php:310
     55#: includes/classes/Backend/Admin.php:334
     56#: includes/classes/Backend/Admin.php:358
     57#: includes/classes/Backend/Admin.php:382
     58#: includes/classes/Backend/Admin.php:406
    5859msgid "Enabled?"
    5960msgstr ""
    6061
    61 #: includes/classes/Backend/Admin.php:183
     62#: includes/classes/Backend/Admin.php:190
    6263msgid "Database Type"
    6364msgstr ""
    6465
    65 #: includes/classes/Backend/Admin.php:191
    66 #: includes/classes/Backend/Admin.php:255
     66#: includes/classes/Backend/Admin.php:198
     67#: includes/classes/Backend/Admin.php:262
    6768msgid "Characters"
    6869msgstr ""
    6970
    70 #: includes/classes/Backend/Admin.php:199
     71#: includes/classes/Backend/Admin.php:206
    7172msgid "Max Characters"
    7273msgstr ""
    7374
    74 #: includes/classes/Backend/Admin.php:207
     75#: includes/classes/Backend/Admin.php:214
    7576msgid "Typing Delay"
    7677msgstr ""
    7778
    78 #: includes/classes/Backend/Admin.php:215
     79#: includes/classes/Backend/Admin.php:222
    7980msgid "Selector"
    8081msgstr ""
    8182
    82 #: includes/classes/Backend/Admin.php:231
     83#: includes/classes/Backend/Admin.php:238
    8384msgid "Limit"
    8485msgstr ""
    8586
    86 #: includes/classes/Backend/Admin.php:239
     87#: includes/classes/Backend/Admin.php:246
    8788msgid "Days"
    8889msgstr ""
    8990
    90 #: includes/classes/Backend/Admin.php:247
     91#: includes/classes/Backend/Admin.php:254
    9192msgid "Tracking Delay"
    9293msgstr ""
    9394
    94 #: includes/classes/Backend/Admin.php:263
     95#: includes/classes/Backend/Admin.php:270
    9596msgid "Result Count"
    9697msgstr ""
    9798
    98 #: includes/classes/Backend/Admin.php:271
     99#: includes/classes/Backend/Admin.php:278
    99100msgid "Blacklisted Words"
    100101msgstr ""
    101102
    102 #: includes/classes/Backend/Admin.php:287
    103 #: includes/classes/Backend/Admin.php:311
    104 #: includes/classes/Backend/Admin.php:335
    105 #: includes/classes/Backend/Admin.php:359
     103#: includes/classes/Backend/Admin.php:294
     104#: includes/classes/Backend/Admin.php:318
     105#: includes/classes/Backend/Admin.php:342
     106#: includes/classes/Backend/Admin.php:366
    106107msgid "Batch"
    107108msgstr ""
    108109
    109 #: includes/classes/Backend/Admin.php:295
    110 #: includes/classes/Backend/Admin.php:319
    111 #: includes/classes/Backend/Admin.php:343
    112 #: includes/classes/Backend/Admin.php:367
     110#: includes/classes/Backend/Admin.php:302
     111#: includes/classes/Backend/Admin.php:326
     112#: includes/classes/Backend/Admin.php:350
     113#: includes/classes/Backend/Admin.php:374
    113114msgid "Result Limit"
    114115msgstr ""
    115116
    116 #: includes/classes/Backend/Admin.php:391
    117 #: includes/classes/Backend/Admin.php:474
    118 #: includes/classes/Backend/Admin.php:574
    119 #: includes/classes/Backend/Admin.php:618
    120 #: includes/classes/Backend/Admin.php:662
    121 #: includes/classes/Backend/Admin.php:706
    122 #: includes/classes/Backend/Admin.php:749
     117#: includes/classes/Backend/Admin.php:390
     118msgid "Title"
     119msgstr ""
     120
     121#: includes/classes/Backend/Admin.php:398
     122msgid "Placeholder"
     123msgstr ""
     124
     125#: includes/classes/Backend/Admin.php:422
     126#: includes/classes/Backend/Admin.php:505
     127#: includes/classes/Backend/Admin.php:605
     128#: includes/classes/Backend/Admin.php:649
     129#: includes/classes/Backend/Admin.php:693
     130#: includes/classes/Backend/Admin.php:737
     131#: includes/classes/Backend/Admin.php:781
     132#: includes/classes/Backend/Admin.php:824
    123133msgid "Yes"
    124134msgstr ""
    125135
    126 #: includes/classes/Backend/Admin.php:408
     136#: includes/classes/Backend/Admin.php:439
    127137msgid "If your server runs MySQL you can store the index inside your existing database, otherwise its stored on your filesystem."
    128138msgstr ""
    129139
    130 #: includes/classes/Backend/Admin.php:408
     140#: includes/classes/Backend/Admin.php:439
    131141msgid "Note: Changing this setting triggers a reindex."
    132142msgstr ""
    133143
    134 #: includes/classes/Backend/Admin.php:421
     144#: includes/classes/Backend/Admin.php:452
    135145msgid "How many characters to trigger Snappy Search?"
    136146msgstr ""
    137147
    138 #: includes/classes/Backend/Admin.php:434
     148#: includes/classes/Backend/Admin.php:465
    139149msgid "Maximum number of characters allowed to be searched?"
    140150msgstr ""
    141151
    142 #: includes/classes/Backend/Admin.php:447
     152#: includes/classes/Backend/Admin.php:478
    143153msgid "How many milliseconds between inputs until a search is fired?"
    144154msgstr ""
    145155
    146 #: includes/classes/Backend/Admin.php:460
     156#: includes/classes/Backend/Admin.php:491
    147157msgid "Enter your selector that you want to add the instant search to. Ex: #search"
    148158msgstr ""
    149159
    150 #: includes/classes/Backend/Admin.php:460
     160#: includes/classes/Backend/Admin.php:491
    151161msgid "Leave blank if you are using the [snappy_search_polyplugins] shortcode."
    152162msgstr ""
    153163
    154 #: includes/classes/Backend/Admin.php:476
     164#: includes/classes/Backend/Admin.php:507
    155165msgid "Enabling this will track searches and display popular search terms. This will track what users are searching, but it is not tied to individual users. Before you enable, please make sure you are in compliance with data protection regulations."
    156166msgstr ""
    157167
    158 #: includes/classes/Backend/Admin.php:490
     168#: includes/classes/Backend/Admin.php:521
    159169msgid "Number of popular search terms to show."
    160170msgstr ""
    161171
    162 #: includes/classes/Backend/Admin.php:504
     172#: includes/classes/Backend/Admin.php:535
    163173msgid "The number of days of search term history to look through for popular search terms. Note: We run a background worker that will cleanup any search term history beyond the number of days you set."
    164174msgstr ""
    165175
    166 #: includes/classes/Backend/Admin.php:518
     176#: includes/classes/Backend/Admin.php:549
    167177msgid "How many milliseconds after a user is done typing, until the search is tracked?"
    168178msgstr ""
    169179
    170 #: includes/classes/Backend/Admin.php:532
     180#: includes/classes/Backend/Admin.php:563
    171181msgid "Number of characters required for the search term to be tracked."
    172182msgstr ""
    173183
    174 #: includes/classes/Backend/Admin.php:546
     184#: includes/classes/Backend/Admin.php:577
    175185msgid "The number of found results for a search term to be considered popular. Set higher than 0 to prevent search terms with no results from showing as a popular term."
    176186msgstr ""
    177187
    178 #: includes/classes/Backend/Admin.php:560
     188#: includes/classes/Backend/Admin.php:591
    179189msgid "By default, Snappy Search only shows popular search terms that return results. To block specific terms from appearing, enter them here as a comma separated list."
    180190msgstr ""
    181191
    182 #: includes/classes/Backend/Admin.php:576
     192#: includes/classes/Backend/Admin.php:607
    183193msgid "Index and show posts in the search?"
    184194msgstr ""
    185195
    186 #: includes/classes/Backend/Admin.php:590
     196#: includes/classes/Backend/Admin.php:621
    187197msgid "How many posts should be indexed per minute?"
    188198msgstr ""
    189199
    190 #: includes/classes/Backend/Admin.php:604
     200#: includes/classes/Backend/Admin.php:635
    191201msgid "How many posts would you like to show?"
    192202msgstr ""
    193203
    194 #: includes/classes/Backend/Admin.php:620
     204#: includes/classes/Backend/Admin.php:651
    195205msgid "Index and show pages in the search?"
    196206msgstr ""
    197207
    198 #: includes/classes/Backend/Admin.php:634
     208#: includes/classes/Backend/Admin.php:665
    199209msgid "How many pages should be indexed per minute?"
    200210msgstr ""
    201211
    202 #: includes/classes/Backend/Admin.php:648
     212#: includes/classes/Backend/Admin.php:679
    203213msgid "How many pages would you like to show?"
    204214msgstr ""
    205215
    206 #: includes/classes/Backend/Admin.php:664
     216#: includes/classes/Backend/Admin.php:695
    207217msgid "Index and show products in the search?"
    208218msgstr ""
    209219
    210 #: includes/classes/Backend/Admin.php:678
     220#: includes/classes/Backend/Admin.php:709
    211221msgid "How many products should be indexed per minute?"
    212222msgstr ""
    213223
    214 #: includes/classes/Backend/Admin.php:692
     224#: includes/classes/Backend/Admin.php:723
    215225msgid "How many products would you like to show?"
    216226msgstr ""
    217227
    218 #: includes/classes/Backend/Admin.php:708
     228#: includes/classes/Backend/Admin.php:739
    219229msgid "Index and show downloads in the search?"
    220230msgstr ""
    221231
    222 #: includes/classes/Backend/Admin.php:722
     232#: includes/classes/Backend/Admin.php:753
    223233msgid "How many downloads should be indexed per minute?"
    224234msgstr ""
    225235
    226 #: includes/classes/Backend/Admin.php:736
     236#: includes/classes/Backend/Admin.php:767
    227237msgid "How many downloads would you like to show?"
    228238msgstr ""
    229239
    230 #: includes/classes/Backend/Admin.php:768
     240#: includes/classes/Backend/Admin.php:783
     241msgid "If enabled, pressing Enter will go to /advanced-search/ instead of the default search, unless indexing is active."
     242msgstr ""
     243
     244#: includes/classes/Backend/Admin.php:783
     245msgid "Note: This will flush rewrite rules."
     246msgstr ""
     247
     248#: includes/classes/Backend/Admin.php:797
     249msgid "Set the page title of advanced search."
     250msgstr ""
     251
     252#: includes/classes/Backend/Admin.php:811
     253msgid "Set the placeholder for the advanced search input."
     254msgstr ""
     255
     256#: includes/classes/Backend/Admin.php:843
    231257msgid "Snappy Search Settings"
    232258msgstr ""
    233259
    234 #: includes/classes/Backend/Admin.php:778
     260#: includes/classes/Backend/Admin.php:853
    235261msgid "General"
    236262msgstr ""
    237263
    238 #: includes/classes/Backend/Admin.php:784
     264#: includes/classes/Backend/Admin.php:859
    239265msgid "Popular"
    240266msgstr ""
    241267
    242 #: includes/classes/Backend/Admin.php:790
    243 #: js/frontend/selector.js:244
    244 #: js/frontend/shortcode.js:243
     268#: includes/classes/Backend/Admin.php:865
     269#: js/frontend/advanced.js:271
     270#: js/frontend/selector.js:250
     271#: js/frontend/shortcode.js:264
    245272msgid "Posts"
    246273msgstr ""
    247274
    248 #: includes/classes/Backend/Admin.php:796
    249 #: js/frontend/selector.js:248
    250 #: js/frontend/shortcode.js:247
     275#: includes/classes/Backend/Admin.php:871
     276#: js/frontend/advanced.js:275
     277#: js/frontend/selector.js:254
     278#: js/frontend/shortcode.js:268
    251279msgid "Pages"
    252280msgstr ""
    253281
    254 #: includes/classes/Backend/Admin.php:803
    255 #: js/frontend/selector.js:236
    256 #: js/frontend/shortcode.js:235
     282#: includes/classes/Backend/Admin.php:878
     283#: js/frontend/advanced.js:263
     284#: js/frontend/selector.js:242
     285#: js/frontend/shortcode.js:256
    257286msgid "Products"
    258287msgstr ""
    259288
    260 #: includes/classes/Backend/Admin.php:811
    261 #: js/frontend/selector.js:240
    262 #: js/frontend/shortcode.js:239
     289#: includes/classes/Backend/Admin.php:886
     290#: js/frontend/advanced.js:267
     291#: js/frontend/selector.js:246
     292#: js/frontend/shortcode.js:260
    263293msgid "Downloads"
    264294msgstr ""
    265295
    266 #: includes/classes/Backend/Admin.php:818
     296#: includes/classes/Backend/Admin.php:893
     297msgid "Advanced"
     298msgstr ""
     299
     300#: includes/classes/Backend/Admin.php:899
    267301msgid "Repo"
    268302msgstr ""
    269303
    270 #: includes/classes/Backend/Admin.php:824
     304#: includes/classes/Backend/Admin.php:905
    271305#: js/backend/settings.js:31
    272306msgid "Reindex"
    273307msgstr ""
    274308
     309#: includes/classes/Backend/Admin.php:953
     310msgid "Due to the layout differences of various themes, this more than likely will require a developer to add and customize the snappy-search-advanced-search-form.php template in your theme."
     311msgstr ""
     312
    275313#: includes/classes/Backend/Background_Worker.php:116
    276314msgid "Every Minute"
    277315msgstr ""
    278316
    279 #: includes/classes/Backend/Notices.php:47
     317#: includes/classes/Backend/Notices.php:50
    280318msgid "Speedy Search is now Snappy Search. We have change a lot including adding support for WooCommerce, EDD, and Pages. Indexes are also now updated when content is added, removed, or updated. We also added the ability to trigger reindexes and reverting the search to default when indexing. Try out the new features by visiting Snappy Search Settings."
    281319msgstr ""
    282320
    283 #: includes/classes/Backend/Notices.php:48
     321#: includes/classes/Backend/Notices.php:51
    284322msgid "Try new features"
    285323msgstr ""
    286324
    287 #: includes/classes/Backend/Notices.php:56
     325#: includes/classes/Backend/Notices.php:59
    288326msgid "Snappy Search can now use MySQL databases, which means search indexes can be stored in your existing WordPress database for better performance."
    289327msgstr ""
    290328
    291 #: includes/classes/Backend/Notices.php:57
     329#: includes/classes/Backend/Notices.php:60
     330#: includes/classes/Backend/Notices.php:76
    292331msgid "Switch to MySQL"
     332msgstr ""
     333
     334#: includes/classes/Backend/Notices.php:68
     335msgid "Starting with version 1.5.0, Snappy Search will include functionality offered by our "
     336msgstr ""
     337
     338#: includes/classes/Backend/Notices.php:70
     339msgid " plugin. As part of this update, the plugin will gain the ability to index WooCommerce orders, which introduces additional security considerations."
     340msgstr ""
     341
     342#: includes/classes/Backend/Notices.php:72
     343msgid "To support this securely and efficiently, we are "
     344msgstr ""
     345
     346#: includes/classes/Backend/Notices.php:72
     347msgid "discontinuing support for SQLite"
     348msgstr ""
     349
     350#: includes/classes/Backend/Notices.php:72
     351msgid ". Managing mixed database logic (SQLite and MySQL) adds unnecessary complexity and overhead, particularly when handling sensitive data like order information."
     352msgstr ""
     353
     354#: includes/classes/Backend/Notices.php:74
     355msgid "Before updating to 1.5.0, please ensure your site is using MySQL."
     356msgstr ""
     357
     358#: includes/classes/Backend/Notices.php:75
     359msgid "If your site is still using SQLite, search functionality will be automatically disabled after the update."
    293360msgstr ""
    294361
     
    304371msgstr ""
    305372
    306 #: templates/snappy-search-advanced-form.php:20
    307 #: templates/snappy-search-form.php:20
    308 #: templates/snappy-search-mobile-form.php:20
    309 #: js/frontend/selector.js:193
     373#: templates/snappy-search-advanced-form.php:24
     374#: templates/snappy-search-advanced-search-form.php:28
     375#: templates/snappy-search-form.php:24
     376#: templates/snappy-search-mobile-form.php:24
     377#: js/frontend/selector.js:199
    310378msgid "Popular Searches"
    311379msgstr ""
     
    351419msgstr ""
    352420
    353 #: js/frontend/selector.js:104
    354 #: js/frontend/shortcode.js:145
     421#: js/frontend/advanced.js:162
     422#: js/frontend/selector.js:111
     423#: js/frontend/shortcode.js:155
    355424msgid "No results found."
    356425msgstr ""
    357426
    358 #: js/frontend/selector.js:153
    359 #: js/frontend/shortcode.js:182
     427#: js/frontend/advanced.js:199
     428#: js/frontend/selector.js:160
     429#: js/frontend/shortcode.js:192
    360430msgid "An error occurred while searching."
    361431msgstr ""
  • speedy-search/tags/1.4.0/readme.txt

    r3336262 r3338334  
    33Tags: instant search, search, wp, snappy search, woocommerce
    44Tested up to: 6.8
    5 Stable tag: 1.3.1
     5Stable tag: 1.4.0
    66Requires PHP: 7.4
    77License: GPLv3
     
    3636* Ability to adjust the batch size for the initial index so smaller servers don't get overloaded
    3737* Limit the number of results displayed
    38 * [NEW] Popular search terms can be displayed below the search
    39 * [NEW] Add your own custom shortcode template by copying snappy-search-form.php to your theme folder
     38* [NEW] Advanced search to replace the default WordPress search
     39* Popular search terms can be displayed below the search
     40* Add your own custom shortcode template by copying snappy-search-form.php to your theme folder
    4041* Reindexer button
    4142* Shortcode [snappy_search_polyplugins placeholder="Search..."] to inject a Snappy Search form anywhere
     
    92935. Pages Settings
    93946. Products Settings
    94 7. Repo Settings
     957. Advanced Search Settings
     968. Repo Settings
    9597
    9698
    9799== Changelog ==
     100
     101= 1.4.0 =
     102* Added: Advanced Search to replace default search when pressing enter if enabled and not indexing
     103* Added: Advanced Search enabled, title, and placeholder settings
     104* Added: Template snappy-search-advanced-search-form.php
     105* Updated: Search form templates to take advantage of advanced search
     106* Updated: Translations
     107* Bugfix: Indexer looping through the same results if failed
     108* Deprecated: SQLite
    98109
    99110= 1.3.1 =
  • speedy-search/tags/1.4.0/speedy-search.php

    r3336262 r3338334  
    44 * Plugin Name: Snappy Search
    55 * Description: A fast, lightweight search plugin powered by TNTSearch, indexing posts for instant, accurate results.
    6  * Version: 1.3.1
     6 * Version: 1.4.0
    77 * Requires at least: 6.5
    88 * Requires PHP: 7.4
  • speedy-search/tags/1.4.0/templates/snappy-search-advanced-form.php

    r3336230 r3338334  
    33use PolyPlugins\Speedy_Search\Utils;
    44
    5 $is_indexing     = Utils::is_indexing();
    6 $popular_options = Utils::get_option('popular');
    7 $popular_enabled = isset($popular_options['enabled']) ? $popular_options['enabled'] : 0;
     5$is_indexing      = Utils::is_indexing();
     6$popular_options  = Utils::get_option('popular');
     7$popular_enabled  = isset($popular_options['enabled']) ? $popular_options['enabled'] : 0;
     8$advanced_options = Utils::get_option('advanced');
     9$advanced_enabled = isset($advanced_options['enabled']) ? $advanced_options['enabled'] : 0;
     10$action           = $advanced_enabled && !$is_indexing ? home_url('/advanced-search/') : home_url('/');
     11$name             = $advanced_enabled && !$is_indexing ? 'search' : 's';
    812?>
    913
    1014<div class="speedy-search-container advanced">
    11   <form role="search" method="get" class="snappy-search-form" action="<?php echo esc_url(home_url('/')); ?>">
    12     <input type="text" class="snappy-search-input" placeholder="<?php echo esc_attr($atts['placeholder']); ?>" autocomplete="off" name="s">
     15  <form role="search" method="get" class="snappy-search-form" action="<?php echo esc_url($action); ?>">
     16    <input type="text" class="snappy-search-input" placeholder="<?php echo esc_attr($atts['placeholder']); ?>" autocomplete="off" name="<?php echo esc_html($name); ?>">
    1317    <button type="button" class="snappy-search-close" aria-label="Close Search">×</button>
    1418    <span class="loader" style="display: none;"></span>
  • speedy-search/tags/1.4.0/templates/snappy-search-form.php

    r3336230 r3338334  
    33use PolyPlugins\Speedy_Search\Utils;
    44
    5 $is_indexing     = Utils::is_indexing();
    6 $popular_options = Utils::get_option('popular');
    7 $popular_enabled = isset($popular_options['enabled']) ? $popular_options['enabled'] : 0;
     5$is_indexing      = Utils::is_indexing();
     6$popular_options  = Utils::get_option('popular');
     7$popular_enabled  = isset($popular_options['enabled']) ? $popular_options['enabled'] : 0;
     8$advanced_options = Utils::get_option('advanced');
     9$advanced_enabled = isset($advanced_options['enabled']) ? $advanced_options['enabled'] : 0;
     10$action           = $advanced_enabled && !$is_indexing ? home_url('/advanced-search/') : home_url('/');
     11$name             = $advanced_enabled && !$is_indexing ? 'search' : 's';
    812?>
    913
    1014<div class="speedy-search-container desktop">
    11   <form role="search" method="get" class="snappy-search-form" action="<?php echo esc_url(home_url('/')); ?>">
    12     <input type="text" class="snappy-search-input" placeholder="<?php echo esc_attr($atts['placeholder']); ?>" autocomplete="off" name="s">
     15  <form role="search" method="get" class="snappy-search-form" action="<?php echo esc_url($action); ?>">
     16    <input type="text" class="snappy-search-input" placeholder="<?php echo esc_attr($atts['placeholder']); ?>" autocomplete="off" name="<?php echo esc_html($name); ?>">
    1317    <button type="button" class="snappy-search-close" aria-label="Close Search">×</button>
    1418    <span class="loader" style="display: none;"></span>
  • speedy-search/tags/1.4.0/templates/snappy-search-mobile-form.php

    r3336230 r3338334  
    33use PolyPlugins\Speedy_Search\Utils;
    44
    5 $is_indexing     = Utils::is_indexing();
    6 $popular_options = Utils::get_option('popular');
    7 $popular_enabled = isset($popular_options['enabled']) ? $popular_options['enabled'] : 0;
     5$is_indexing      = Utils::is_indexing();
     6$popular_options  = Utils::get_option('popular');
     7$popular_enabled  = isset($popular_options['enabled']) ? $popular_options['enabled'] : 0;
     8$advanced_options = Utils::get_option('advanced');
     9$advanced_enabled = isset($advanced_options['enabled']) ? $advanced_options['enabled'] : 0;
     10$action           = $advanced_enabled && !$is_indexing ? home_url('/advanced-search/') : home_url('/');
     11$name             = $advanced_enabled && !$is_indexing ? 'search' : 's';
    812?>
    913
    1014<div class="speedy-search-container mobile">
    11   <form role="search" method="get" class="snappy-search-form" action="<?php echo esc_url(home_url('/')); ?>">
    12     <input type="text" class="snappy-search-input" placeholder="<?php echo esc_attr($atts['placeholder']); ?>" autocomplete="off" name="s">
     15  <form role="search" method="get" class="snappy-search-form" action="<?php echo esc_url($action); ?>">
     16    <input type="text" class="snappy-search-input" placeholder="<?php echo esc_attr($atts['placeholder']); ?>" autocomplete="off" name="<?php echo esc_html($name); ?>">
    1317    <button type="button" class="snappy-search-close" aria-label="Close Search">×</button>
    1418    <span class="loader" style="display: none;"></span>
  • speedy-search/trunk/css/backend/settings.css

    r3334968 r3338334  
    3131input[type="range"] {
    3232  width: 95%!important;
     33}
     34
     35.tab .warning {
     36  background-color: #FFC107;
     37  color: #333;
     38  border-top-right-radius: 5px;
     39  border-top-left-radius: 5px;
     40  padding: 8px 12px;
     41  font-weight: 700;
     42}
     43
     44.tab .danger {
     45  background-color: #DC3545;
     46  color: #333;
     47  border-top-right-radius: 5px;
     48  border-top-left-radius: 5px;
     49  padding: 8px 12px;
     50  font-weight: 700;
    3351}
    3452
  • speedy-search/trunk/css/frontend/style.css

    r3336230 r3338334  
    213213.instant-search-result.skeleton-loading .excerpt-result {
    214214  background-color: #e0e0e0;
    215   color: transparent;
     215  color: transparent!important;
    216216  border-radius: 4px;
    217217  position: relative;
     
    233233.instant-search-result.skeleton-loading .excerpt-result {
    234234  min-height: 14px;
     235}
     236
     237/**
     238 * Advanced Search
     239 */
     240.speedy-search-container.advanced-search .instant-search-wrapper {
     241  position: unset;
    235242}
    236243
     
    275282
    276283@keyframes prixClipFix {
    277     0%   {clip-path:polygon(50% 50%,0 0,0 0,0 0,0 0,0 0)}
    278     25%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 0,100% 0,100% 0)}
    279     50%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,100% 100%,100% 100%)}
    280     75%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 100%)}
    281     100% {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 0)}
    282 }
     284  0%   {clip-path:polygon(50% 50%,0 0,0 0,0 0,0 0,0 0)}
     285  25%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 0,100% 0,100% 0)}
     286  50%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,100% 100%,100% 100%)}
     287  75%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 100%)}
     288  100% {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 0)}
     289}
  • speedy-search/trunk/includes/classes/Backend/Admin.php

    r3336230 r3338334  
    164164
    165165    add_settings_section(
     166      'speedy_search_advanced_section_polyplugins',
     167      '',
     168      null,
     169      'speedy_search_advanced_polyplugins'
     170    );
     171
     172    add_settings_section(
    166173      'speedy_search_repo_section_polyplugins',
    167174      '',
     
    372379
    373380        add_settings_field(
     381            'advanced_enabled',                             
     382            __('Enabled?', 'speedy-search'),
     383            array($this, 'advanced_enabled_render'),
     384            'speedy_search_advanced_polyplugins',
     385            'speedy_search_advanced_section_polyplugins'
     386        );
     387
     388        add_settings_field(
     389            'advanced_title',                             
     390            __('Title', 'speedy-search'),
     391            array($this, 'advanced_title_render'),
     392            'speedy_search_advanced_polyplugins',
     393            'speedy_search_advanced_section_polyplugins'
     394        );
     395
     396        add_settings_field(
     397            'advanced_placeholder',                             
     398            __('Placeholder', 'speedy-search'),
     399            array($this, 'advanced_placeholder_render'),
     400            'speedy_search_advanced_polyplugins',
     401            'speedy_search_advanced_section_polyplugins'
     402        );
     403
     404        add_settings_field(
    374405            'repo_enabled',                             
    375406            __('Enabled?', 'speedy-search'),
     
    736767    <p><strong><?php esc_html_e('How many downloads would you like to show?', 'speedy-search'); ?></strong></p>
    737768      <?php
     769    }
     770
     771  /**
     772     * Render Advanced Enabled Field
     773     *
     774     * @return void
     775     */
     776    public function advanced_enabled_render() {
     777        $options = Utils::get_option('advanced');
     778    $option  = isset($options['enabled']) ? $options['enabled'] : false;
     779    ?>
     780    <div class="form-check form-switch">
     781      <input type="checkbox" name="speedy_search_settings_polyplugins[advanced][enabled]" class="form-check-input" role="switch" <?php checked(1, $option, true); ?> /> <?php esc_html_e('Yes', 'speedy-search'); ?>
     782    </div>
     783    <p><strong><?php esc_html_e('If enabled, pressing Enter will go to /advanced-search/ instead of the default search, unless indexing is active.', 'speedy-search'); ?><br /><?php esc_html_e('Note: This will flush rewrite rules.', 'speedy-search'); ?></strong></p>
     784    <?php
     785    }
     786
     787  /**
     788     * Render Advanced Title Field
     789     *
     790     * @return void
     791     */
     792    public function advanced_title_render() {
     793        $options = Utils::get_option('advanced');
     794    $option  = isset($options['title']) ? $options['title'] : 'Advanced Search';
     795    ?>
     796    <input type="text" name="speedy_search_settings_polyplugins[advanced][title]" value="<?php echo esc_html($option); ?>" />
     797    <p><strong><?php esc_html_e('Set the page title of advanced search.', 'speedy-search'); ?></strong></p>
     798        <?php
     799    }
     800
     801  /**
     802     * Render Advanced Placeholder Field
     803     *
     804     * @return void
     805     */
     806    public function advanced_placeholder_render() {
     807        $options = Utils::get_option('advanced');
     808    $option  = isset($options['placeholder']) ? $options['placeholder'] : 'Search...';
     809    ?>
     810    <input type="text" name="speedy_search_settings_polyplugins[advanced][placeholder]" value="<?php echo esc_html($option); ?>" />
     811    <p><strong><?php esc_html_e('Set the placeholder for the advanced search input.', 'speedy-search'); ?></strong></p>
     812        <?php
    738813    }
    739814
     
    814889                <?php endif; ?>
    815890                <li>
     891                  <a href="javascript:void(0);" data-section="advanced">
     892                    <i class="bi bi-funnel-fill"></i>
     893                    <?php esc_html_e('Advanced', 'speedy-search'); ?>
     894                  </a>
     895                </li>
     896                <li>
    816897                  <a href="javascript:void(0);" data-section="repo">
    817898                    <i class="bi bi-plug-fill"></i>
     
    868949              <?php endif; ?>
    869950
     951              <div class="tab advanced" style="display: none;">
     952                <div class="warning">
     953                  <?php esc_html_e('Due to the layout differences of various themes, this more than likely will require a developer to add and customize the snappy-search-advanced-search-form.php template in your theme.', 'speedy-search'); ?> If you need a developer you can <a href="https://www.polyplugins.com/contact/" target="_blank">hire us</a> to help.
     954                </div>
     955                <?php
     956                do_settings_sections('speedy_search_advanced_polyplugins');
     957                ?>
     958              </div>
     959
    870960              <div class="tab repo" style="display: none;">
    871961                <?php
     
    10281118        }
    10291119
     1120    if (isset($input['advanced']['enabled']) && $input['advanced']['enabled']) {
     1121      $sanitary_values['advanced']['enabled'] = $input['advanced']['enabled'] === 'on' ? true : false;
     1122
     1123      $new      = $sanitary_values['advanced']['enabled'];
     1124      $advanced = Utils::get_option('advanced');
     1125      $current  = isset($advanced['enabled']) ? $advanced['enabled'] : false;
     1126
     1127      if ($current !== $new) {
     1128        update_option('speedy_search_flush_rewrite_rules_polyplugins', true);
     1129      }
     1130    } else {
     1131      $sanitary_values['advanced']['enabled'] = false;
     1132
     1133      $new      = $sanitary_values['advanced']['enabled'];
     1134      $advanced = Utils::get_option('advanced');
     1135      $current  = isset($advanced['enabled']) ? $advanced['enabled'] : false;
     1136
     1137      if ($current !== $new) {
     1138        update_option('speedy_search_flush_rewrite_rules_polyplugins', true);
     1139      }
     1140    }
     1141
     1142    if (isset($input['advanced']['title']) && $input['advanced']['title']) {
     1143            $sanitary_values['advanced']['title'] = sanitize_text_field($input['advanced']['title']);
     1144        }
     1145
     1146    if (isset($input['advanced']['placeholder']) && $input['advanced']['placeholder']) {
     1147            $sanitary_values['advanced']['placeholder'] = sanitize_text_field($input['advanced']['placeholder']);
     1148        }
     1149
    10301150    if (isset($input['repo_enabled']) && $input['repo_enabled']) {
    10311151      $sanitary_values['repo_enabled'] = $input['repo_enabled'] === 'on' ? true : false;
  • speedy-search/trunk/includes/classes/Backend/Background_Worker.php

    r3336230 r3338334  
    197197
    198198        $progress++;
     199
     200        Utils::update_index($type, 'progress', $progress);
    199201      }
    200 
    201       Utils::update_index($type, 'progress', $progress);
    202202    } else {
    203203      Utils::update_index($type, 'complete', true);
  • speedy-search/trunk/includes/classes/Backend/Notices.php

    r3336230 r3338334  
    3939        $this->notice_130();
    4040      }
     41      if ($this->version == '1.4.0') {
     42        $this->notice_140();
     43      }
    4144    }
    4245  }
     
    6063  }
    6164
     65  public function notice_140() {
     66    ?>
     67    <div class="notice notice-error is-dismissible speedy-search" style="padding-bottom: 10px;">
     68      <p><?php echo esc_html__('Starting with version 1.5.0, Snappy Search will include functionality offered by our ', 'speedy-search'); ?>
     69      <a href="https://wordpress.org/plugins/admin-instant-search/" target="_blank">Admin Instant Search</a>
     70      <?php echo esc_html__(' plugin. As part of this update, the plugin will gain the ability to index WooCommerce orders, which introduces additional security considerations.', 'speedy-search'); ?>
     71      <br /><br />
     72      <?php echo esc_html__('To support this securely and efficiently, we are ', 'speedy-search'); ?><strong><?php echo esc_html__('discontinuing support for SQLite', 'speedy-search'); ?></strong><?php echo esc_html__('. Managing mixed database logic (SQLite and MySQL) adds unnecessary complexity and overhead, particularly when handling sensitive data like order information.', 'speedy-search'); ?>
     73      <br /><br />
     74      <strong?><?php echo esc_html__('Before updating to 1.5.0, please ensure your site is using MySQL.', 'speedy-search'); ?></strong>
     75      <?php echo esc_html__('If your site is still using SQLite, search functionality will be automatically disabled after the update.', 'speedy-search'); ?></p>
     76      <a href="options-general.php?page=speedy-search"><?php echo esc_html__('Switch to MySQL', 'speedy-search'); ?></a>
     77    </div>
     78    <?php
     79  }
     80
    6281  public function dismiss_notice() {
    6382    if (!isset($_POST['nonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'speedy_search_dismiss_notice_nonce')) {
  • speedy-search/trunk/includes/classes/Frontend/Enqueue.php

    r3336230 r3338334  
    2121     */
    2222    private $version;
     23
     24  /**
     25     * The options of this plugin.
     26     *
     27     * @var array $options The options array
     28     */
     29  private $options;
     30
     31  /**
     32     * The popular options of this plugin.
     33     *
     34     * @var array $popular_options The popular options array
     35     */
     36  private $popular_options;
     37
     38  /**
     39     * The advanced options of this plugin.
     40     *
     41     * @var array $advanced_options The advanced options array
     42     */
     43  private $advanced_options;
     44
     45  /**
     46     * Is Snappy Search indexing?
     47     *
     48     * @var bool $is_indexing True if indexing, false if not
     49     */
     50  private $is_indexing;
    2351 
    2452  /**
     
    2856   */
    2957  public function __construct($plugin, $version) {
    30     $this->plugin  = $plugin;
    31     $this->version = $version;
     58    $this->options          = Utils::get_options();
     59    $this->popular_options  = isset($this->options['popular']) ? $this->options['popular'] : array();
     60    $this->advanced_options = isset($this->options['advanced']) ? $this->options['advanced'] : array();
     61    $this->is_indexing      = Utils::is_indexing();
     62    $this->plugin           = $plugin;
     63    $this->version          = $version;
    3264  }
    3365 
     
    6698   */
    6799  private function enqueue_scripts() {
    68     $options                        = get_option('speedy_search_settings_polyplugins');
    69     $selector                       = isset($options['selector']) ? $options['selector'] : '';
    70     $is_indexing                    = Utils::is_indexing();
    71     $popular_options                = Utils::get_option('popular');
    72     $popular_enabled                = isset($popular_options['enabled']) ? $popular_options['enabled'] : 0;
     100    $selector         = isset($this->options['selector']) ? $this->options['selector'] : '';
     101    $advanced_enabled = isset($this->advanced_options['enabled']) ? $this->advanced_options['enabled'] : '';
     102
     103    if ($selector) {
     104      $this->enqueue_selector_search();
     105    } else {
     106      $this->enqueue_shortcode_search();
     107    }
    73108   
    74     if ($selector) {
    75       // Fallback to default search when indexing
    76       if (!$is_indexing) {
    77         wp_enqueue_script('snappy-search-selector', plugins_url('/js/frontend/selector.js', $this->plugin), array('jquery', 'wp-i18n'), $this->version, true);
    78         wp_localize_script(
    79           'snappy-search-selector',
    80           'snappy_search_object',
    81           array(
    82             'options'  => $options,
    83             'popular'  => DB::get_top_terms_last_x_days(),
    84             'currency' => class_exists('WooCommerce') ? get_woocommerce_currency_symbol() : '',
    85           )
    86         );
    87         wp_set_script_translations('snappy-search-selector', 'speedy-search', plugin_dir_path($this->plugin) . '/languages/');
    88        
    89         if ($popular_enabled) {
    90           wp_enqueue_script('snappy-search-analytics', plugins_url('/js/frontend/analytics.js', $this->plugin), array('jquery'), $this->version, true);
    91           wp_localize_script(
    92             'snappy-search-analytics',
    93             'snappy_search_analytics_object',
    94             array(
    95               'options'  => $options,
    96               'ajax_url' => admin_url('admin-ajax.php'),
    97               'nonce'    => wp_create_nonce('speedy_search_analytics_nonce')
    98             )
    99           );
    100         }
     109    if ($advanced_enabled) {
     110      $this->enqueue_advanced_search();
     111    }
     112  }
     113 
     114  /**
     115   * Enqueue selector search
     116   *
     117   * @return void
     118   */
     119  private function enqueue_selector_search() {
     120    // Fallback to default search when indexing
     121    if (!$this->is_indexing) {
     122      wp_enqueue_script('snappy-search-selector', plugins_url('/js/frontend/selector.js', $this->plugin), array('jquery', 'wp-i18n'), $this->version, true);
     123      wp_localize_script(
     124        'snappy-search-selector',
     125        'snappy_search_object',
     126        array(
     127          'options'  => $this->options,
     128          'popular'  => DB::get_top_terms_last_x_days(),
     129          'currency' => class_exists('WooCommerce') ? get_woocommerce_currency_symbol() : '',
     130        )
     131      );
     132      wp_set_script_translations('snappy-search-selector', 'speedy-search', plugin_dir_path($this->plugin) . '/languages/');
     133     
     134      if ($this->popular_options['enabled']) {
     135        $this->enqueue_popular_search();
    101136      }
    102     } else {
    103       // Fallback to default search when indexing
    104       if (!$is_indexing) {
    105         wp_enqueue_script('snappy-search-shortcode', plugins_url('/js/frontend/shortcode.js', $this->plugin), array('jquery', 'wp-i18n'), $this->version, true);
    106         wp_localize_script(
    107           'snappy-search-shortcode',
    108           'snappy_search_object',
    109           array(
    110             'options'  => $options,
    111             'currency' => class_exists('WooCommerce') ? get_woocommerce_currency_symbol() : '',
    112           )
    113         );
    114         wp_set_script_translations('snappy-search-shortcode', 'speedy-search', plugin_dir_path($this->plugin) . '/languages/');
    115        
    116         if ($popular_enabled) {
    117           wp_enqueue_script('snappy-search-analytics', plugins_url('/js/frontend/analytics.js', $this->plugin), array('jquery'), $this->version, true);
    118           wp_localize_script(
    119             'snappy-search-analytics',
    120             'snappy_search_analytics_object',
    121             array(
    122               'options'  => $options,
    123               'ajax_url' => admin_url('admin-ajax.php'),
    124               'nonce'    => wp_create_nonce('speedy_search_analytics_nonce')
    125             )
    126           );
    127         }
     137    }
     138  }
     139 
     140  /**
     141   * Enqueue shortcode search
     142   *
     143   * @return void
     144   */
     145  private function enqueue_shortcode_search() {
     146    // Fallback to default search when indexing
     147    if (!$this->is_indexing) {
     148      wp_enqueue_script('snappy-search-shortcode', plugins_url('/js/frontend/shortcode.js', $this->plugin), array('jquery', 'wp-i18n'), $this->version, true);
     149      wp_localize_script(
     150        'snappy-search-shortcode',
     151        'snappy_search_object',
     152        array(
     153          'options'  => $this->options,
     154          'currency' => class_exists('WooCommerce') ? get_woocommerce_currency_symbol() : '',
     155        )
     156      );
     157      wp_set_script_translations('snappy-search-shortcode', 'speedy-search', plugin_dir_path($this->plugin) . '/languages/');
     158     
     159      if ($this->popular_options['enabled']) {
     160        $this->enqueue_popular_search();
    128161      }
    129162    }
    130163  }
    131164 
     165  /**
     166   * Enqueue advanced search
     167   *
     168   * @return void
     169   */
     170  private function enqueue_advanced_search() {
     171    // Fallback to default search when indexing
     172    if (!$this->is_indexing) {
     173      wp_enqueue_script('snappy-search-advanced', plugins_url('/js/frontend/advanced.js', $this->plugin), array('jquery', 'wp-i18n'), $this->version, true);
     174      wp_localize_script(
     175        'snappy-search-advanced',
     176        'snappy_search_object',
     177        array(
     178          'options'  => $this->options,
     179          'currency' => class_exists('WooCommerce') ? get_woocommerce_currency_symbol() : '',
     180        )
     181      );
     182      wp_set_script_translations('snappy-search-advanced', 'speedy-search', plugin_dir_path($this->plugin) . '/languages/');
     183     
     184      if ($this->popular_options['enabled']) {
     185        $this->enqueue_popular_search();
     186      }
     187    }
     188  }
     189 
     190  /**
     191   * Enqueue popular search
     192   *
     193   * @return void
     194   */
     195  private function enqueue_popular_search() {
     196    wp_enqueue_script('snappy-search-analytics', plugins_url('/js/frontend/analytics.js', $this->plugin), array('jquery'), $this->version, true);
     197    wp_localize_script(
     198      'snappy-search-analytics',
     199      'snappy_search_analytics_object',
     200      array(
     201        'options'  => $this->options,
     202        'ajax_url' => admin_url('admin-ajax.php'),
     203        'nonce'    => wp_create_nonce('speedy_search_analytics_nonce')
     204      )
     205    );
     206  }
     207 
    132208}
  • speedy-search/trunk/includes/classes/Frontend_Loader.php

    r3334968 r3338334  
    33namespace PolyPlugins\Speedy_Search;
    44
     5use PolyPlugins\Speedy_Search\Frontend\Advanced_Search;
    56use PolyPlugins\Speedy_Search\Frontend\Analytics;
    67use PolyPlugins\Speedy_Search\Frontend\Enqueue;
     
    5152    $this->load_ui();
    5253    $this->load_shortcode();
     54    $this->load_advanced_search();
    5355    $this->load_analytics();
    5456  }
     
    8587 
    8688  /**
     89   * Load Advanced Search
     90   *
     91   * @return void
     92   */
     93  public function load_advanced_search() {
     94    $shortcode = new Advanced_Search($this->plugin, $this->version, $this->plugin_dir_url);
     95    $shortcode->init();
     96  }
     97 
     98  /**
    8799   * Load Analytics
    88100   *
  • speedy-search/trunk/includes/classes/Updater.php

    r3336230 r3338334  
    6565      update_option('speedy_search_version_polyplugins', $stored_version);
    6666    }
     67
     68    if (version_compare($stored_version, '1.4.0', '<')) {
     69      $stored_version = '1.4.0';
     70
     71      $this->update_to_140();
     72
     73      update_option('speedy_search_version_polyplugins', $stored_version);
     74    }
    6775  }
    6876
     
    109117  }
    110118
     119  private function update_to_140() {
     120    update_option('speedy_search_notice_dismissed_polyplugins', false);
     121  }
     122
    111123}
  • speedy-search/trunk/js/frontend/selector.js

    r3334968 r3338334  
    1 const { __, _x, _n, _nx } = wp.i18n;
    2 
    3 let selector          = snappy_search_object.options?.selector ?? '';
    4 let characters        = snappy_search_object.options?.characters ?? 4;
    5 let typing_delay      = snappy_search_object.options?.typing_delay ?? 300;
    6 let posts_enabled     = snappy_search_object.options?.posts?.enabled ?? false;
    7 let pages_enabled     = snappy_search_object.options?.pages?.enabled ?? false;
    8 let products_enabled  = snappy_search_object.options?.products?.enabled ?? false;
    9 let downloads_enabled = snappy_search_object.options?.downloads?.enabled ?? false;
    10 let popular           = snappy_search_object.popular ?? false;
    11 let currency          = snappy_search_object.currency ?? '$';
    12 
    131jQuery(document).ready(function ($) {
    14   if (!selector) return;
    15 
    16   const $searchInput      = $(selector);
    17   const $searchForm       = $searchInput.closest("form");
    18   const typingDelay       = typing_delay;
    19   const postTypes         = getTypes();
    20   const initialSearchForm = buildInitialSearchForm();
     2  const { __, _x, _n, _nx } = wp.i18n;
     3
     4  let selector = snappy_search_object.options?.selector ?? '';
     5
     6  if (!selector) {
     7    return;
     8  }
     9
     10  if (!$(selector).length) {
     11    return;
     12  }
     13
     14  let characters            = snappy_search_object.options?.characters ?? 4;
     15  let typing_delay          = snappy_search_object.options?.typing_delay ?? 300;
     16  let posts_enabled         = snappy_search_object.options?.posts?.enabled ?? false;
     17  let pages_enabled         = snappy_search_object.options?.pages?.enabled ?? false;
     18  let products_enabled      = snappy_search_object.options?.products?.enabled ?? false;
     19  let downloads_enabled     = snappy_search_object.options?.downloads?.enabled ?? false;
     20  let popular               = snappy_search_object.popular ?? false;
     21  let currency              = snappy_search_object.currency ?? '$';
     22
     23  const $searchInput        = $(selector);
     24  const $searchForm         = $searchInput.closest("form");
     25  const typingDelay         = typing_delay;
     26  const postTypes           = getTypes();
     27  const initialSearchForm   = buildInitialSearchForm();
    2128
    2229  init();
     
    154161            "</p>"
    155162          );
    156         console.error("Search error in " + endpoint + ":", error);
    157163      },
    158164    });
  • speedy-search/trunk/js/frontend/shortcode.js

    r3336262 r3338334  
    1 const { __, _x, _n, _nx } = wp.i18n;
    2 
    3 let selector          = '.snappy-search-input';
    4 let characters        = snappy_search_object.options?.characters ?? 4;
    5 let typing_delay      = snappy_search_object.options?.typing_delay ?? 300;
    6 let posts_enabled     = snappy_search_object.options?.posts?.enabled ?? false;
    7 let pages_enabled     = snappy_search_object.options?.pages?.enabled ?? false;
    8 let products_enabled  = snappy_search_object.options?.products?.enabled ?? false;
    9 let downloads_enabled = snappy_search_object.options?.downloads?.enabled ?? false;
    10 let currency          = snappy_search_object.currency ?? '$';
     1
    112
    123jQuery(document).ready(function ($) {
    13   if (!selector) return;
    14 
    15   const $searchInput      = $(selector);
    16   const $searchForm       = $searchInput.closest("form");
    17   const typingDelay       = typing_delay;
    18   const postTypes         = getTypes();
    19   const initialSearchForm = buildInitialSearchForm();
     4  const { __, _x, _n, _nx } = wp.i18n;
     5
     6  let selector          = '.snappy-search-input';
     7
     8  if (!$(selector).length) {
     9    return;
     10  }
     11
     12  let characters        = snappy_search_object.options?.characters ?? 4;
     13  let typing_delay      = snappy_search_object.options?.typing_delay ?? 300;
     14  let posts_enabled     = snappy_search_object.options?.posts?.enabled ?? false;
     15  let pages_enabled     = snappy_search_object.options?.pages?.enabled ?? false;
     16  let products_enabled  = snappy_search_object.options?.products?.enabled ?? false;
     17  let downloads_enabled = snappy_search_object.options?.downloads?.enabled ?? false;
     18  let currency          = snappy_search_object.currency ?? '$';
     19
     20  const $searchInput        = $(selector);
     21  const $searchForm         = $searchInput.closest("form");
     22  const typingDelay         = typing_delay;
     23  const postTypes           = getTypes();
     24  const initialSearchForm   = buildInitialSearchForm();
    2025
    2126  init();
     
    186191        $section.empty();
    187192        $section.append("<p>" + __("An error occurred while searching.", "speedy-search") + "</p>");
    188         console.error("Search error in " + endpoint + ":", error);
    189193      }
    190194    })
  • speedy-search/trunk/languages/speedy-search.pot

    r3336230 r3338334  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Snappy Search 1.3.0\n"
     5"Project-Id-Version: Snappy Search 1.4.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/speedy-search\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-07-29T20:50:50+00:00\n"
     12"POT-Creation-Date: 2025-08-02T21:53:03+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.11.0\n"
     
    4949msgstr ""
    5050
    51 #: includes/classes/Backend/Admin.php:175
    52 #: includes/classes/Backend/Admin.php:223
    53 #: includes/classes/Backend/Admin.php:279
    54 #: includes/classes/Backend/Admin.php:303
    55 #: includes/classes/Backend/Admin.php:327
    56 #: includes/classes/Backend/Admin.php:351
    57 #: includes/classes/Backend/Admin.php:375
     51#: includes/classes/Backend/Admin.php:182
     52#: includes/classes/Backend/Admin.php:230
     53#: includes/classes/Backend/Admin.php:286
     54#: includes/classes/Backend/Admin.php:310
     55#: includes/classes/Backend/Admin.php:334
     56#: includes/classes/Backend/Admin.php:358
     57#: includes/classes/Backend/Admin.php:382
     58#: includes/classes/Backend/Admin.php:406
    5859msgid "Enabled?"
    5960msgstr ""
    6061
    61 #: includes/classes/Backend/Admin.php:183
     62#: includes/classes/Backend/Admin.php:190
    6263msgid "Database Type"
    6364msgstr ""
    6465
    65 #: includes/classes/Backend/Admin.php:191
    66 #: includes/classes/Backend/Admin.php:255
     66#: includes/classes/Backend/Admin.php:198
     67#: includes/classes/Backend/Admin.php:262
    6768msgid "Characters"
    6869msgstr ""
    6970
    70 #: includes/classes/Backend/Admin.php:199
     71#: includes/classes/Backend/Admin.php:206
    7172msgid "Max Characters"
    7273msgstr ""
    7374
    74 #: includes/classes/Backend/Admin.php:207
     75#: includes/classes/Backend/Admin.php:214
    7576msgid "Typing Delay"
    7677msgstr ""
    7778
    78 #: includes/classes/Backend/Admin.php:215
     79#: includes/classes/Backend/Admin.php:222
    7980msgid "Selector"
    8081msgstr ""
    8182
    82 #: includes/classes/Backend/Admin.php:231
     83#: includes/classes/Backend/Admin.php:238
    8384msgid "Limit"
    8485msgstr ""
    8586
    86 #: includes/classes/Backend/Admin.php:239
     87#: includes/classes/Backend/Admin.php:246
    8788msgid "Days"
    8889msgstr ""
    8990
    90 #: includes/classes/Backend/Admin.php:247
     91#: includes/classes/Backend/Admin.php:254
    9192msgid "Tracking Delay"
    9293msgstr ""
    9394
    94 #: includes/classes/Backend/Admin.php:263
     95#: includes/classes/Backend/Admin.php:270
    9596msgid "Result Count"
    9697msgstr ""
    9798
    98 #: includes/classes/Backend/Admin.php:271
     99#: includes/classes/Backend/Admin.php:278
    99100msgid "Blacklisted Words"
    100101msgstr ""
    101102
    102 #: includes/classes/Backend/Admin.php:287
    103 #: includes/classes/Backend/Admin.php:311
    104 #: includes/classes/Backend/Admin.php:335
    105 #: includes/classes/Backend/Admin.php:359
     103#: includes/classes/Backend/Admin.php:294
     104#: includes/classes/Backend/Admin.php:318
     105#: includes/classes/Backend/Admin.php:342
     106#: includes/classes/Backend/Admin.php:366
    106107msgid "Batch"
    107108msgstr ""
    108109
    109 #: includes/classes/Backend/Admin.php:295
    110 #: includes/classes/Backend/Admin.php:319
    111 #: includes/classes/Backend/Admin.php:343
    112 #: includes/classes/Backend/Admin.php:367
     110#: includes/classes/Backend/Admin.php:302
     111#: includes/classes/Backend/Admin.php:326
     112#: includes/classes/Backend/Admin.php:350
     113#: includes/classes/Backend/Admin.php:374
    113114msgid "Result Limit"
    114115msgstr ""
    115116
    116 #: includes/classes/Backend/Admin.php:391
    117 #: includes/classes/Backend/Admin.php:474
    118 #: includes/classes/Backend/Admin.php:574
    119 #: includes/classes/Backend/Admin.php:618
    120 #: includes/classes/Backend/Admin.php:662
    121 #: includes/classes/Backend/Admin.php:706
    122 #: includes/classes/Backend/Admin.php:749
     117#: includes/classes/Backend/Admin.php:390
     118msgid "Title"
     119msgstr ""
     120
     121#: includes/classes/Backend/Admin.php:398
     122msgid "Placeholder"
     123msgstr ""
     124
     125#: includes/classes/Backend/Admin.php:422
     126#: includes/classes/Backend/Admin.php:505
     127#: includes/classes/Backend/Admin.php:605
     128#: includes/classes/Backend/Admin.php:649
     129#: includes/classes/Backend/Admin.php:693
     130#: includes/classes/Backend/Admin.php:737
     131#: includes/classes/Backend/Admin.php:781
     132#: includes/classes/Backend/Admin.php:824
    123133msgid "Yes"
    124134msgstr ""
    125135
    126 #: includes/classes/Backend/Admin.php:408
     136#: includes/classes/Backend/Admin.php:439
    127137msgid "If your server runs MySQL you can store the index inside your existing database, otherwise its stored on your filesystem."
    128138msgstr ""
    129139
    130 #: includes/classes/Backend/Admin.php:408
     140#: includes/classes/Backend/Admin.php:439
    131141msgid "Note: Changing this setting triggers a reindex."
    132142msgstr ""
    133143
    134 #: includes/classes/Backend/Admin.php:421
     144#: includes/classes/Backend/Admin.php:452
    135145msgid "How many characters to trigger Snappy Search?"
    136146msgstr ""
    137147
    138 #: includes/classes/Backend/Admin.php:434
     148#: includes/classes/Backend/Admin.php:465
    139149msgid "Maximum number of characters allowed to be searched?"
    140150msgstr ""
    141151
    142 #: includes/classes/Backend/Admin.php:447
     152#: includes/classes/Backend/Admin.php:478
    143153msgid "How many milliseconds between inputs until a search is fired?"
    144154msgstr ""
    145155
    146 #: includes/classes/Backend/Admin.php:460
     156#: includes/classes/Backend/Admin.php:491
    147157msgid "Enter your selector that you want to add the instant search to. Ex: #search"
    148158msgstr ""
    149159
    150 #: includes/classes/Backend/Admin.php:460
     160#: includes/classes/Backend/Admin.php:491
    151161msgid "Leave blank if you are using the [snappy_search_polyplugins] shortcode."
    152162msgstr ""
    153163
    154 #: includes/classes/Backend/Admin.php:476
     164#: includes/classes/Backend/Admin.php:507
    155165msgid "Enabling this will track searches and display popular search terms. This will track what users are searching, but it is not tied to individual users. Before you enable, please make sure you are in compliance with data protection regulations."
    156166msgstr ""
    157167
    158 #: includes/classes/Backend/Admin.php:490
     168#: includes/classes/Backend/Admin.php:521
    159169msgid "Number of popular search terms to show."
    160170msgstr ""
    161171
    162 #: includes/classes/Backend/Admin.php:504
     172#: includes/classes/Backend/Admin.php:535
    163173msgid "The number of days of search term history to look through for popular search terms. Note: We run a background worker that will cleanup any search term history beyond the number of days you set."
    164174msgstr ""
    165175
    166 #: includes/classes/Backend/Admin.php:518
     176#: includes/classes/Backend/Admin.php:549
    167177msgid "How many milliseconds after a user is done typing, until the search is tracked?"
    168178msgstr ""
    169179
    170 #: includes/classes/Backend/Admin.php:532
     180#: includes/classes/Backend/Admin.php:563
    171181msgid "Number of characters required for the search term to be tracked."
    172182msgstr ""
    173183
    174 #: includes/classes/Backend/Admin.php:546
     184#: includes/classes/Backend/Admin.php:577
    175185msgid "The number of found results for a search term to be considered popular. Set higher than 0 to prevent search terms with no results from showing as a popular term."
    176186msgstr ""
    177187
    178 #: includes/classes/Backend/Admin.php:560
     188#: includes/classes/Backend/Admin.php:591
    179189msgid "By default, Snappy Search only shows popular search terms that return results. To block specific terms from appearing, enter them here as a comma separated list."
    180190msgstr ""
    181191
    182 #: includes/classes/Backend/Admin.php:576
     192#: includes/classes/Backend/Admin.php:607
    183193msgid "Index and show posts in the search?"
    184194msgstr ""
    185195
    186 #: includes/classes/Backend/Admin.php:590
     196#: includes/classes/Backend/Admin.php:621
    187197msgid "How many posts should be indexed per minute?"
    188198msgstr ""
    189199
    190 #: includes/classes/Backend/Admin.php:604
     200#: includes/classes/Backend/Admin.php:635
    191201msgid "How many posts would you like to show?"
    192202msgstr ""
    193203
    194 #: includes/classes/Backend/Admin.php:620
     204#: includes/classes/Backend/Admin.php:651
    195205msgid "Index and show pages in the search?"
    196206msgstr ""
    197207
    198 #: includes/classes/Backend/Admin.php:634
     208#: includes/classes/Backend/Admin.php:665
    199209msgid "How many pages should be indexed per minute?"
    200210msgstr ""
    201211
    202 #: includes/classes/Backend/Admin.php:648
     212#: includes/classes/Backend/Admin.php:679
    203213msgid "How many pages would you like to show?"
    204214msgstr ""
    205215
    206 #: includes/classes/Backend/Admin.php:664
     216#: includes/classes/Backend/Admin.php:695
    207217msgid "Index and show products in the search?"
    208218msgstr ""
    209219
    210 #: includes/classes/Backend/Admin.php:678
     220#: includes/classes/Backend/Admin.php:709
    211221msgid "How many products should be indexed per minute?"
    212222msgstr ""
    213223
    214 #: includes/classes/Backend/Admin.php:692
     224#: includes/classes/Backend/Admin.php:723
    215225msgid "How many products would you like to show?"
    216226msgstr ""
    217227
    218 #: includes/classes/Backend/Admin.php:708
     228#: includes/classes/Backend/Admin.php:739
    219229msgid "Index and show downloads in the search?"
    220230msgstr ""
    221231
    222 #: includes/classes/Backend/Admin.php:722
     232#: includes/classes/Backend/Admin.php:753
    223233msgid "How many downloads should be indexed per minute?"
    224234msgstr ""
    225235
    226 #: includes/classes/Backend/Admin.php:736
     236#: includes/classes/Backend/Admin.php:767
    227237msgid "How many downloads would you like to show?"
    228238msgstr ""
    229239
    230 #: includes/classes/Backend/Admin.php:768
     240#: includes/classes/Backend/Admin.php:783
     241msgid "If enabled, pressing Enter will go to /advanced-search/ instead of the default search, unless indexing is active."
     242msgstr ""
     243
     244#: includes/classes/Backend/Admin.php:783
     245msgid "Note: This will flush rewrite rules."
     246msgstr ""
     247
     248#: includes/classes/Backend/Admin.php:797
     249msgid "Set the page title of advanced search."
     250msgstr ""
     251
     252#: includes/classes/Backend/Admin.php:811
     253msgid "Set the placeholder for the advanced search input."
     254msgstr ""
     255
     256#: includes/classes/Backend/Admin.php:843
    231257msgid "Snappy Search Settings"
    232258msgstr ""
    233259
    234 #: includes/classes/Backend/Admin.php:778
     260#: includes/classes/Backend/Admin.php:853
    235261msgid "General"
    236262msgstr ""
    237263
    238 #: includes/classes/Backend/Admin.php:784
     264#: includes/classes/Backend/Admin.php:859
    239265msgid "Popular"
    240266msgstr ""
    241267
    242 #: includes/classes/Backend/Admin.php:790
    243 #: js/frontend/selector.js:244
    244 #: js/frontend/shortcode.js:243
     268#: includes/classes/Backend/Admin.php:865
     269#: js/frontend/advanced.js:271
     270#: js/frontend/selector.js:250
     271#: js/frontend/shortcode.js:264
    245272msgid "Posts"
    246273msgstr ""
    247274
    248 #: includes/classes/Backend/Admin.php:796
    249 #: js/frontend/selector.js:248
    250 #: js/frontend/shortcode.js:247
     275#: includes/classes/Backend/Admin.php:871
     276#: js/frontend/advanced.js:275
     277#: js/frontend/selector.js:254
     278#: js/frontend/shortcode.js:268
    251279msgid "Pages"
    252280msgstr ""
    253281
    254 #: includes/classes/Backend/Admin.php:803
    255 #: js/frontend/selector.js:236
    256 #: js/frontend/shortcode.js:235
     282#: includes/classes/Backend/Admin.php:878
     283#: js/frontend/advanced.js:263
     284#: js/frontend/selector.js:242
     285#: js/frontend/shortcode.js:256
    257286msgid "Products"
    258287msgstr ""
    259288
    260 #: includes/classes/Backend/Admin.php:811
    261 #: js/frontend/selector.js:240
    262 #: js/frontend/shortcode.js:239
     289#: includes/classes/Backend/Admin.php:886
     290#: js/frontend/advanced.js:267
     291#: js/frontend/selector.js:246
     292#: js/frontend/shortcode.js:260
    263293msgid "Downloads"
    264294msgstr ""
    265295
    266 #: includes/classes/Backend/Admin.php:818
     296#: includes/classes/Backend/Admin.php:893
     297msgid "Advanced"
     298msgstr ""
     299
     300#: includes/classes/Backend/Admin.php:899
    267301msgid "Repo"
    268302msgstr ""
    269303
    270 #: includes/classes/Backend/Admin.php:824
     304#: includes/classes/Backend/Admin.php:905
    271305#: js/backend/settings.js:31
    272306msgid "Reindex"
    273307msgstr ""
    274308
     309#: includes/classes/Backend/Admin.php:953
     310msgid "Due to the layout differences of various themes, this more than likely will require a developer to add and customize the snappy-search-advanced-search-form.php template in your theme."
     311msgstr ""
     312
    275313#: includes/classes/Backend/Background_Worker.php:116
    276314msgid "Every Minute"
    277315msgstr ""
    278316
    279 #: includes/classes/Backend/Notices.php:47
     317#: includes/classes/Backend/Notices.php:50
    280318msgid "Speedy Search is now Snappy Search. We have change a lot including adding support for WooCommerce, EDD, and Pages. Indexes are also now updated when content is added, removed, or updated. We also added the ability to trigger reindexes and reverting the search to default when indexing. Try out the new features by visiting Snappy Search Settings."
    281319msgstr ""
    282320
    283 #: includes/classes/Backend/Notices.php:48
     321#: includes/classes/Backend/Notices.php:51
    284322msgid "Try new features"
    285323msgstr ""
    286324
    287 #: includes/classes/Backend/Notices.php:56
     325#: includes/classes/Backend/Notices.php:59
    288326msgid "Snappy Search can now use MySQL databases, which means search indexes can be stored in your existing WordPress database for better performance."
    289327msgstr ""
    290328
    291 #: includes/classes/Backend/Notices.php:57
     329#: includes/classes/Backend/Notices.php:60
     330#: includes/classes/Backend/Notices.php:76
    292331msgid "Switch to MySQL"
     332msgstr ""
     333
     334#: includes/classes/Backend/Notices.php:68
     335msgid "Starting with version 1.5.0, Snappy Search will include functionality offered by our "
     336msgstr ""
     337
     338#: includes/classes/Backend/Notices.php:70
     339msgid " plugin. As part of this update, the plugin will gain the ability to index WooCommerce orders, which introduces additional security considerations."
     340msgstr ""
     341
     342#: includes/classes/Backend/Notices.php:72
     343msgid "To support this securely and efficiently, we are "
     344msgstr ""
     345
     346#: includes/classes/Backend/Notices.php:72
     347msgid "discontinuing support for SQLite"
     348msgstr ""
     349
     350#: includes/classes/Backend/Notices.php:72
     351msgid ". Managing mixed database logic (SQLite and MySQL) adds unnecessary complexity and overhead, particularly when handling sensitive data like order information."
     352msgstr ""
     353
     354#: includes/classes/Backend/Notices.php:74
     355msgid "Before updating to 1.5.0, please ensure your site is using MySQL."
     356msgstr ""
     357
     358#: includes/classes/Backend/Notices.php:75
     359msgid "If your site is still using SQLite, search functionality will be automatically disabled after the update."
    293360msgstr ""
    294361
     
    304371msgstr ""
    305372
    306 #: templates/snappy-search-advanced-form.php:20
    307 #: templates/snappy-search-form.php:20
    308 #: templates/snappy-search-mobile-form.php:20
    309 #: js/frontend/selector.js:193
     373#: templates/snappy-search-advanced-form.php:24
     374#: templates/snappy-search-advanced-search-form.php:28
     375#: templates/snappy-search-form.php:24
     376#: templates/snappy-search-mobile-form.php:24
     377#: js/frontend/selector.js:199
    310378msgid "Popular Searches"
    311379msgstr ""
     
    351419msgstr ""
    352420
    353 #: js/frontend/selector.js:104
    354 #: js/frontend/shortcode.js:145
     421#: js/frontend/advanced.js:162
     422#: js/frontend/selector.js:111
     423#: js/frontend/shortcode.js:155
    355424msgid "No results found."
    356425msgstr ""
    357426
    358 #: js/frontend/selector.js:153
    359 #: js/frontend/shortcode.js:182
     427#: js/frontend/advanced.js:199
     428#: js/frontend/selector.js:160
     429#: js/frontend/shortcode.js:192
    360430msgid "An error occurred while searching."
    361431msgstr ""
  • speedy-search/trunk/readme.txt

    r3336262 r3338334  
    33Tags: instant search, search, wp, snappy search, woocommerce
    44Tested up to: 6.8
    5 Stable tag: 1.3.1
     5Stable tag: 1.4.0
    66Requires PHP: 7.4
    77License: GPLv3
     
    3636* Ability to adjust the batch size for the initial index so smaller servers don't get overloaded
    3737* Limit the number of results displayed
    38 * [NEW] Popular search terms can be displayed below the search
    39 * [NEW] Add your own custom shortcode template by copying snappy-search-form.php to your theme folder
     38* [NEW] Advanced search to replace the default WordPress search
     39* Popular search terms can be displayed below the search
     40* Add your own custom shortcode template by copying snappy-search-form.php to your theme folder
    4041* Reindexer button
    4142* Shortcode [snappy_search_polyplugins placeholder="Search..."] to inject a Snappy Search form anywhere
     
    92935. Pages Settings
    93946. Products Settings
    94 7. Repo Settings
     957. Advanced Search Settings
     968. Repo Settings
    9597
    9698
    9799== Changelog ==
     100
     101= 1.4.0 =
     102* Added: Advanced Search to replace default search when pressing enter if enabled and not indexing
     103* Added: Advanced Search enabled, title, and placeholder settings
     104* Added: Template snappy-search-advanced-search-form.php
     105* Updated: Search form templates to take advantage of advanced search
     106* Updated: Translations
     107* Bugfix: Indexer looping through the same results if failed
     108* Deprecated: SQLite
    98109
    99110= 1.3.1 =
  • speedy-search/trunk/speedy-search.php

    r3336262 r3338334  
    44 * Plugin Name: Snappy Search
    55 * Description: A fast, lightweight search plugin powered by TNTSearch, indexing posts for instant, accurate results.
    6  * Version: 1.3.1
     6 * Version: 1.4.0
    77 * Requires at least: 6.5
    88 * Requires PHP: 7.4
  • speedy-search/trunk/templates/snappy-search-advanced-form.php

    r3336230 r3338334  
    33use PolyPlugins\Speedy_Search\Utils;
    44
    5 $is_indexing     = Utils::is_indexing();
    6 $popular_options = Utils::get_option('popular');
    7 $popular_enabled = isset($popular_options['enabled']) ? $popular_options['enabled'] : 0;
     5$is_indexing      = Utils::is_indexing();
     6$popular_options  = Utils::get_option('popular');
     7$popular_enabled  = isset($popular_options['enabled']) ? $popular_options['enabled'] : 0;
     8$advanced_options = Utils::get_option('advanced');
     9$advanced_enabled = isset($advanced_options['enabled']) ? $advanced_options['enabled'] : 0;
     10$action           = $advanced_enabled && !$is_indexing ? home_url('/advanced-search/') : home_url('/');
     11$name             = $advanced_enabled && !$is_indexing ? 'search' : 's';
    812?>
    913
    1014<div class="speedy-search-container advanced">
    11   <form role="search" method="get" class="snappy-search-form" action="<?php echo esc_url(home_url('/')); ?>">
    12     <input type="text" class="snappy-search-input" placeholder="<?php echo esc_attr($atts['placeholder']); ?>" autocomplete="off" name="s">
     15  <form role="search" method="get" class="snappy-search-form" action="<?php echo esc_url($action); ?>">
     16    <input type="text" class="snappy-search-input" placeholder="<?php echo esc_attr($atts['placeholder']); ?>" autocomplete="off" name="<?php echo esc_html($name); ?>">
    1317    <button type="button" class="snappy-search-close" aria-label="Close Search">×</button>
    1418    <span class="loader" style="display: none;"></span>
  • speedy-search/trunk/templates/snappy-search-form.php

    r3336230 r3338334  
    33use PolyPlugins\Speedy_Search\Utils;
    44
    5 $is_indexing     = Utils::is_indexing();
    6 $popular_options = Utils::get_option('popular');
    7 $popular_enabled = isset($popular_options['enabled']) ? $popular_options['enabled'] : 0;
     5$is_indexing      = Utils::is_indexing();
     6$popular_options  = Utils::get_option('popular');
     7$popular_enabled  = isset($popular_options['enabled']) ? $popular_options['enabled'] : 0;
     8$advanced_options = Utils::get_option('advanced');
     9$advanced_enabled = isset($advanced_options['enabled']) ? $advanced_options['enabled'] : 0;
     10$action           = $advanced_enabled && !$is_indexing ? home_url('/advanced-search/') : home_url('/');
     11$name             = $advanced_enabled && !$is_indexing ? 'search' : 's';
    812?>
    913
    1014<div class="speedy-search-container desktop">
    11   <form role="search" method="get" class="snappy-search-form" action="<?php echo esc_url(home_url('/')); ?>">
    12     <input type="text" class="snappy-search-input" placeholder="<?php echo esc_attr($atts['placeholder']); ?>" autocomplete="off" name="s">
     15  <form role="search" method="get" class="snappy-search-form" action="<?php echo esc_url($action); ?>">
     16    <input type="text" class="snappy-search-input" placeholder="<?php echo esc_attr($atts['placeholder']); ?>" autocomplete="off" name="<?php echo esc_html($name); ?>">
    1317    <button type="button" class="snappy-search-close" aria-label="Close Search">×</button>
    1418    <span class="loader" style="display: none;"></span>
  • speedy-search/trunk/templates/snappy-search-mobile-form.php

    r3336230 r3338334  
    33use PolyPlugins\Speedy_Search\Utils;
    44
    5 $is_indexing     = Utils::is_indexing();
    6 $popular_options = Utils::get_option('popular');
    7 $popular_enabled = isset($popular_options['enabled']) ? $popular_options['enabled'] : 0;
     5$is_indexing      = Utils::is_indexing();
     6$popular_options  = Utils::get_option('popular');
     7$popular_enabled  = isset($popular_options['enabled']) ? $popular_options['enabled'] : 0;
     8$advanced_options = Utils::get_option('advanced');
     9$advanced_enabled = isset($advanced_options['enabled']) ? $advanced_options['enabled'] : 0;
     10$action           = $advanced_enabled && !$is_indexing ? home_url('/advanced-search/') : home_url('/');
     11$name             = $advanced_enabled && !$is_indexing ? 'search' : 's';
    812?>
    913
    1014<div class="speedy-search-container mobile">
    11   <form role="search" method="get" class="snappy-search-form" action="<?php echo esc_url(home_url('/')); ?>">
    12     <input type="text" class="snappy-search-input" placeholder="<?php echo esc_attr($atts['placeholder']); ?>" autocomplete="off" name="s">
     15  <form role="search" method="get" class="snappy-search-form" action="<?php echo esc_url($action); ?>">
     16    <input type="text" class="snappy-search-input" placeholder="<?php echo esc_attr($atts['placeholder']); ?>" autocomplete="off" name="<?php echo esc_html($name); ?>">
    1317    <button type="button" class="snappy-search-close" aria-label="Close Search">×</button>
    1418    <span class="loader" style="display: none;"></span>
Note: See TracChangeset for help on using the changeset viewer.