Changeset 3338334
- Timestamp:
- 08/02/2025 10:31:29 PM (8 months ago)
- Location:
- speedy-search
- Files:
-
- 7 added
- 38 edited
- 1 copied
-
assets/screenshot-2.jpg (modified) (previous)
-
assets/screenshot-3.jpg (modified) (previous)
-
assets/screenshot-4.jpg (modified) (previous)
-
assets/screenshot-5.jpg (modified) (previous)
-
assets/screenshot-6.jpg (modified) (previous)
-
assets/screenshot-7.jpg (modified) (previous)
-
assets/screenshot-8.jpg (added)
-
tags/1.4.0 (copied) (copied from speedy-search/trunk)
-
tags/1.4.0/css/backend/settings.css (modified) (1 diff)
-
tags/1.4.0/css/frontend/style.css (modified) (3 diffs)
-
tags/1.4.0/includes/classes/Backend/Admin.php (modified) (6 diffs)
-
tags/1.4.0/includes/classes/Backend/Background_Worker.php (modified) (1 diff)
-
tags/1.4.0/includes/classes/Backend/Notices.php (modified) (2 diffs)
-
tags/1.4.0/includes/classes/Frontend/Advanced_Search.php (added)
-
tags/1.4.0/includes/classes/Frontend/Enqueue.php (modified) (3 diffs)
-
tags/1.4.0/includes/classes/Frontend_Loader.php (modified) (3 diffs)
-
tags/1.4.0/includes/classes/Updater.php (modified) (2 diffs)
-
tags/1.4.0/js/frontend/advanced.js (added)
-
tags/1.4.0/js/frontend/selector.js (modified) (2 diffs)
-
tags/1.4.0/js/frontend/shortcode.js (modified) (2 diffs)
-
tags/1.4.0/languages/speedy-search.pot (modified) (5 diffs)
-
tags/1.4.0/readme.txt (modified) (3 diffs)
-
tags/1.4.0/speedy-search.php (modified) (1 diff)
-
tags/1.4.0/templates/snappy-search-advanced-form.php (modified) (1 diff)
-
tags/1.4.0/templates/snappy-search-advanced-search-form.php (added)
-
tags/1.4.0/templates/snappy-search-form.php (modified) (1 diff)
-
tags/1.4.0/templates/snappy-search-mobile-form.php (modified) (1 diff)
-
trunk/css/backend/settings.css (modified) (1 diff)
-
trunk/css/frontend/style.css (modified) (3 diffs)
-
trunk/includes/classes/Backend/Admin.php (modified) (6 diffs)
-
trunk/includes/classes/Backend/Background_Worker.php (modified) (1 diff)
-
trunk/includes/classes/Backend/Notices.php (modified) (2 diffs)
-
trunk/includes/classes/Frontend/Advanced_Search.php (added)
-
trunk/includes/classes/Frontend/Enqueue.php (modified) (3 diffs)
-
trunk/includes/classes/Frontend_Loader.php (modified) (3 diffs)
-
trunk/includes/classes/Updater.php (modified) (2 diffs)
-
trunk/js/frontend/advanced.js (added)
-
trunk/js/frontend/selector.js (modified) (2 diffs)
-
trunk/js/frontend/shortcode.js (modified) (2 diffs)
-
trunk/languages/speedy-search.pot (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/speedy-search.php (modified) (1 diff)
-
trunk/templates/snappy-search-advanced-form.php (modified) (1 diff)
-
trunk/templates/snappy-search-advanced-search-form.php (added)
-
trunk/templates/snappy-search-form.php (modified) (1 diff)
-
trunk/templates/snappy-search-mobile-form.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
speedy-search/tags/1.4.0/css/backend/settings.css
r3334968 r3338334 31 31 input[type="range"] { 32 32 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; 33 51 } 34 52 -
speedy-search/tags/1.4.0/css/frontend/style.css
r3336230 r3338334 213 213 .instant-search-result.skeleton-loading .excerpt-result { 214 214 background-color: #e0e0e0; 215 color: transparent ;215 color: transparent!important; 216 216 border-radius: 4px; 217 217 position: relative; … … 233 233 .instant-search-result.skeleton-loading .excerpt-result { 234 234 min-height: 14px; 235 } 236 237 /** 238 * Advanced Search 239 */ 240 .speedy-search-container.advanced-search .instant-search-wrapper { 241 position: unset; 235 242 } 236 243 … … 275 282 276 283 @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 164 164 165 165 add_settings_section( 166 'speedy_search_advanced_section_polyplugins', 167 '', 168 null, 169 'speedy_search_advanced_polyplugins' 170 ); 171 172 add_settings_section( 166 173 'speedy_search_repo_section_polyplugins', 167 174 '', … … 372 379 373 380 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( 374 405 'repo_enabled', 375 406 __('Enabled?', 'speedy-search'), … … 736 767 <p><strong><?php esc_html_e('How many downloads would you like to show?', 'speedy-search'); ?></strong></p> 737 768 <?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 738 813 } 739 814 … … 814 889 <?php endif; ?> 815 890 <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> 816 897 <a href="javascript:void(0);" data-section="repo"> 817 898 <i class="bi bi-plug-fill"></i> … … 868 949 <?php endif; ?> 869 950 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 870 960 <div class="tab repo" style="display: none;"> 871 961 <?php … … 1028 1118 } 1029 1119 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 1030 1150 if (isset($input['repo_enabled']) && $input['repo_enabled']) { 1031 1151 $sanitary_values['repo_enabled'] = $input['repo_enabled'] === 'on' ? true : false; -
speedy-search/tags/1.4.0/includes/classes/Backend/Background_Worker.php
r3336230 r3338334 197 197 198 198 $progress++; 199 200 Utils::update_index($type, 'progress', $progress); 199 201 } 200 201 Utils::update_index($type, 'progress', $progress);202 202 } else { 203 203 Utils::update_index($type, 'complete', true); -
speedy-search/tags/1.4.0/includes/classes/Backend/Notices.php
r3336230 r3338334 39 39 $this->notice_130(); 40 40 } 41 if ($this->version == '1.4.0') { 42 $this->notice_140(); 43 } 41 44 } 42 45 } … … 60 63 } 61 64 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 62 81 public function dismiss_notice() { 63 82 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 21 21 */ 22 22 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; 23 51 24 52 /** … … 28 56 */ 29 57 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; 32 64 } 33 65 … … 66 98 */ 67 99 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 } 73 108 74 if ($ selector) {75 // Fallback to default search when indexing76 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(); 101 136 } 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(); 128 161 } 129 162 } 130 163 } 131 164 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 132 208 } -
speedy-search/tags/1.4.0/includes/classes/Frontend_Loader.php
r3334968 r3338334 3 3 namespace PolyPlugins\Speedy_Search; 4 4 5 use PolyPlugins\Speedy_Search\Frontend\Advanced_Search; 5 6 use PolyPlugins\Speedy_Search\Frontend\Analytics; 6 7 use PolyPlugins\Speedy_Search\Frontend\Enqueue; … … 51 52 $this->load_ui(); 52 53 $this->load_shortcode(); 54 $this->load_advanced_search(); 53 55 $this->load_analytics(); 54 56 } … … 85 87 86 88 /** 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 /** 87 99 * Load Analytics 88 100 * -
speedy-search/tags/1.4.0/includes/classes/Updater.php
r3336230 r3338334 65 65 update_option('speedy_search_version_polyplugins', $stored_version); 66 66 } 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 } 67 75 } 68 76 … … 109 117 } 110 118 119 private function update_to_140() { 120 update_option('speedy_search_notice_dismissed_polyplugins', false); 121 } 122 111 123 } -
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 13 1 jQuery(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(); 21 28 22 29 init(); … … 154 161 "</p>" 155 162 ); 156 console.error("Search error in " + endpoint + ":", error);157 163 }, 158 164 }); -
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 11 2 12 3 jQuery(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(); 20 25 21 26 init(); … … 186 191 $section.empty(); 187 192 $section.append("<p>" + __("An error occurred while searching.", "speedy-search") + "</p>"); 188 console.error("Search error in " + endpoint + ":", error);189 193 } 190 194 }) -
speedy-search/tags/1.4.0/languages/speedy-search.pot
r3336230 r3338334 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Snappy Search 1. 3.0\n"5 "Project-Id-Version: Snappy Search 1.4.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/speedy-search\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-0 7-29T20:50:50+00:00\n"12 "POT-Creation-Date: 2025-08-02T21:53:03+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.11.0\n" … … 49 49 msgstr "" 50 50 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 58 59 msgid "Enabled?" 59 60 msgstr "" 60 61 61 #: includes/classes/Backend/Admin.php:1 8362 #: includes/classes/Backend/Admin.php:190 62 63 msgid "Database Type" 63 64 msgstr "" 64 65 65 #: includes/classes/Backend/Admin.php:19 166 #: includes/classes/Backend/Admin.php:2 5566 #: includes/classes/Backend/Admin.php:198 67 #: includes/classes/Backend/Admin.php:262 67 68 msgid "Characters" 68 69 msgstr "" 69 70 70 #: includes/classes/Backend/Admin.php: 19971 #: includes/classes/Backend/Admin.php:206 71 72 msgid "Max Characters" 72 73 msgstr "" 73 74 74 #: includes/classes/Backend/Admin.php:2 0775 #: includes/classes/Backend/Admin.php:214 75 76 msgid "Typing Delay" 76 77 msgstr "" 77 78 78 #: includes/classes/Backend/Admin.php:2 1579 #: includes/classes/Backend/Admin.php:222 79 80 msgid "Selector" 80 81 msgstr "" 81 82 82 #: includes/classes/Backend/Admin.php:23 183 #: includes/classes/Backend/Admin.php:238 83 84 msgid "Limit" 84 85 msgstr "" 85 86 86 #: includes/classes/Backend/Admin.php:2 3987 #: includes/classes/Backend/Admin.php:246 87 88 msgid "Days" 88 89 msgstr "" 89 90 90 #: includes/classes/Backend/Admin.php:2 4791 #: includes/classes/Backend/Admin.php:254 91 92 msgid "Tracking Delay" 92 93 msgstr "" 93 94 94 #: includes/classes/Backend/Admin.php:2 6395 #: includes/classes/Backend/Admin.php:270 95 96 msgid "Result Count" 96 97 msgstr "" 97 98 98 #: includes/classes/Backend/Admin.php:27 199 #: includes/classes/Backend/Admin.php:278 99 100 msgid "Blacklisted Words" 100 101 msgstr "" 101 102 102 #: includes/classes/Backend/Admin.php:2 87103 #: includes/classes/Backend/Admin.php:31 1104 #: includes/classes/Backend/Admin.php:3 35105 #: includes/classes/Backend/Admin.php:3 59103 #: 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 106 107 msgid "Batch" 107 108 msgstr "" 108 109 109 #: includes/classes/Backend/Admin.php: 295110 #: includes/classes/Backend/Admin.php:3 19111 #: includes/classes/Backend/Admin.php:3 43112 #: includes/classes/Backend/Admin.php:3 67110 #: 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 113 114 msgid "Result Limit" 114 115 msgstr "" 115 116 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 118 msgid "Title" 119 msgstr "" 120 121 #: includes/classes/Backend/Admin.php:398 122 msgid "Placeholder" 123 msgstr "" 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 123 133 msgid "Yes" 124 134 msgstr "" 125 135 126 #: includes/classes/Backend/Admin.php:4 08136 #: includes/classes/Backend/Admin.php:439 127 137 msgid "If your server runs MySQL you can store the index inside your existing database, otherwise its stored on your filesystem." 128 138 msgstr "" 129 139 130 #: includes/classes/Backend/Admin.php:4 08140 #: includes/classes/Backend/Admin.php:439 131 141 msgid "Note: Changing this setting triggers a reindex." 132 142 msgstr "" 133 143 134 #: includes/classes/Backend/Admin.php:4 21144 #: includes/classes/Backend/Admin.php:452 135 145 msgid "How many characters to trigger Snappy Search?" 136 146 msgstr "" 137 147 138 #: includes/classes/Backend/Admin.php:4 34148 #: includes/classes/Backend/Admin.php:465 139 149 msgid "Maximum number of characters allowed to be searched?" 140 150 msgstr "" 141 151 142 #: includes/classes/Backend/Admin.php:4 47152 #: includes/classes/Backend/Admin.php:478 143 153 msgid "How many milliseconds between inputs until a search is fired?" 144 154 msgstr "" 145 155 146 #: includes/classes/Backend/Admin.php:4 60156 #: includes/classes/Backend/Admin.php:491 147 157 msgid "Enter your selector that you want to add the instant search to. Ex: #search" 148 158 msgstr "" 149 159 150 #: includes/classes/Backend/Admin.php:4 60160 #: includes/classes/Backend/Admin.php:491 151 161 msgid "Leave blank if you are using the [snappy_search_polyplugins] shortcode." 152 162 msgstr "" 153 163 154 #: includes/classes/Backend/Admin.php: 476164 #: includes/classes/Backend/Admin.php:507 155 165 msgid "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." 156 166 msgstr "" 157 167 158 #: includes/classes/Backend/Admin.php: 490168 #: includes/classes/Backend/Admin.php:521 159 169 msgid "Number of popular search terms to show." 160 170 msgstr "" 161 171 162 #: includes/classes/Backend/Admin.php:5 04172 #: includes/classes/Backend/Admin.php:535 163 173 msgid "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." 164 174 msgstr "" 165 175 166 #: includes/classes/Backend/Admin.php:5 18176 #: includes/classes/Backend/Admin.php:549 167 177 msgid "How many milliseconds after a user is done typing, until the search is tracked?" 168 178 msgstr "" 169 179 170 #: includes/classes/Backend/Admin.php:5 32180 #: includes/classes/Backend/Admin.php:563 171 181 msgid "Number of characters required for the search term to be tracked." 172 182 msgstr "" 173 183 174 #: includes/classes/Backend/Admin.php:5 46184 #: includes/classes/Backend/Admin.php:577 175 185 msgid "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." 176 186 msgstr "" 177 187 178 #: includes/classes/Backend/Admin.php:5 60188 #: includes/classes/Backend/Admin.php:591 179 189 msgid "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." 180 190 msgstr "" 181 191 182 #: includes/classes/Backend/Admin.php: 576192 #: includes/classes/Backend/Admin.php:607 183 193 msgid "Index and show posts in the search?" 184 194 msgstr "" 185 195 186 #: includes/classes/Backend/Admin.php: 590196 #: includes/classes/Backend/Admin.php:621 187 197 msgid "How many posts should be indexed per minute?" 188 198 msgstr "" 189 199 190 #: includes/classes/Backend/Admin.php:6 04200 #: includes/classes/Backend/Admin.php:635 191 201 msgid "How many posts would you like to show?" 192 202 msgstr "" 193 203 194 #: includes/classes/Backend/Admin.php:6 20204 #: includes/classes/Backend/Admin.php:651 195 205 msgid "Index and show pages in the search?" 196 206 msgstr "" 197 207 198 #: includes/classes/Backend/Admin.php:6 34208 #: includes/classes/Backend/Admin.php:665 199 209 msgid "How many pages should be indexed per minute?" 200 210 msgstr "" 201 211 202 #: includes/classes/Backend/Admin.php:6 48212 #: includes/classes/Backend/Admin.php:679 203 213 msgid "How many pages would you like to show?" 204 214 msgstr "" 205 215 206 #: includes/classes/Backend/Admin.php:6 64216 #: includes/classes/Backend/Admin.php:695 207 217 msgid "Index and show products in the search?" 208 218 msgstr "" 209 219 210 #: includes/classes/Backend/Admin.php: 678220 #: includes/classes/Backend/Admin.php:709 211 221 msgid "How many products should be indexed per minute?" 212 222 msgstr "" 213 223 214 #: includes/classes/Backend/Admin.php: 692224 #: includes/classes/Backend/Admin.php:723 215 225 msgid "How many products would you like to show?" 216 226 msgstr "" 217 227 218 #: includes/classes/Backend/Admin.php:7 08228 #: includes/classes/Backend/Admin.php:739 219 229 msgid "Index and show downloads in the search?" 220 230 msgstr "" 221 231 222 #: includes/classes/Backend/Admin.php:7 22232 #: includes/classes/Backend/Admin.php:753 223 233 msgid "How many downloads should be indexed per minute?" 224 234 msgstr "" 225 235 226 #: includes/classes/Backend/Admin.php:7 36236 #: includes/classes/Backend/Admin.php:767 227 237 msgid "How many downloads would you like to show?" 228 238 msgstr "" 229 239 230 #: includes/classes/Backend/Admin.php:768 240 #: includes/classes/Backend/Admin.php:783 241 msgid "If enabled, pressing Enter will go to /advanced-search/ instead of the default search, unless indexing is active." 242 msgstr "" 243 244 #: includes/classes/Backend/Admin.php:783 245 msgid "Note: This will flush rewrite rules." 246 msgstr "" 247 248 #: includes/classes/Backend/Admin.php:797 249 msgid "Set the page title of advanced search." 250 msgstr "" 251 252 #: includes/classes/Backend/Admin.php:811 253 msgid "Set the placeholder for the advanced search input." 254 msgstr "" 255 256 #: includes/classes/Backend/Admin.php:843 231 257 msgid "Snappy Search Settings" 232 258 msgstr "" 233 259 234 #: includes/classes/Backend/Admin.php: 778260 #: includes/classes/Backend/Admin.php:853 235 261 msgid "General" 236 262 msgstr "" 237 263 238 #: includes/classes/Backend/Admin.php: 784264 #: includes/classes/Backend/Admin.php:859 239 265 msgid "Popular" 240 266 msgstr "" 241 267 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 245 272 msgid "Posts" 246 273 msgstr "" 247 274 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 251 279 msgid "Pages" 252 280 msgstr "" 253 281 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 257 286 msgid "Products" 258 287 msgstr "" 259 288 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 263 293 msgid "Downloads" 264 294 msgstr "" 265 295 266 #: includes/classes/Backend/Admin.php:818 296 #: includes/classes/Backend/Admin.php:893 297 msgid "Advanced" 298 msgstr "" 299 300 #: includes/classes/Backend/Admin.php:899 267 301 msgid "Repo" 268 302 msgstr "" 269 303 270 #: includes/classes/Backend/Admin.php: 824304 #: includes/classes/Backend/Admin.php:905 271 305 #: js/backend/settings.js:31 272 306 msgid "Reindex" 273 307 msgstr "" 274 308 309 #: includes/classes/Backend/Admin.php:953 310 msgid "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." 311 msgstr "" 312 275 313 #: includes/classes/Backend/Background_Worker.php:116 276 314 msgid "Every Minute" 277 315 msgstr "" 278 316 279 #: includes/classes/Backend/Notices.php: 47317 #: includes/classes/Backend/Notices.php:50 280 318 msgid "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." 281 319 msgstr "" 282 320 283 #: includes/classes/Backend/Notices.php: 48321 #: includes/classes/Backend/Notices.php:51 284 322 msgid "Try new features" 285 323 msgstr "" 286 324 287 #: includes/classes/Backend/Notices.php:5 6325 #: includes/classes/Backend/Notices.php:59 288 326 msgid "Snappy Search can now use MySQL databases, which means search indexes can be stored in your existing WordPress database for better performance." 289 327 msgstr "" 290 328 291 #: includes/classes/Backend/Notices.php:57 329 #: includes/classes/Backend/Notices.php:60 330 #: includes/classes/Backend/Notices.php:76 292 331 msgid "Switch to MySQL" 332 msgstr "" 333 334 #: includes/classes/Backend/Notices.php:68 335 msgid "Starting with version 1.5.0, Snappy Search will include functionality offered by our " 336 msgstr "" 337 338 #: includes/classes/Backend/Notices.php:70 339 msgid " plugin. As part of this update, the plugin will gain the ability to index WooCommerce orders, which introduces additional security considerations." 340 msgstr "" 341 342 #: includes/classes/Backend/Notices.php:72 343 msgid "To support this securely and efficiently, we are " 344 msgstr "" 345 346 #: includes/classes/Backend/Notices.php:72 347 msgid "discontinuing support for SQLite" 348 msgstr "" 349 350 #: includes/classes/Backend/Notices.php:72 351 msgid ". Managing mixed database logic (SQLite and MySQL) adds unnecessary complexity and overhead, particularly when handling sensitive data like order information." 352 msgstr "" 353 354 #: includes/classes/Backend/Notices.php:74 355 msgid "Before updating to 1.5.0, please ensure your site is using MySQL." 356 msgstr "" 357 358 #: includes/classes/Backend/Notices.php:75 359 msgid "If your site is still using SQLite, search functionality will be automatically disabled after the update." 293 360 msgstr "" 294 361 … … 304 371 msgstr "" 305 372 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 310 378 msgid "Popular Searches" 311 379 msgstr "" … … 351 419 msgstr "" 352 420 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 355 424 msgid "No results found." 356 425 msgstr "" 357 426 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 360 430 msgid "An error occurred while searching." 361 431 msgstr "" -
speedy-search/tags/1.4.0/readme.txt
r3336262 r3338334 3 3 Tags: instant search, search, wp, snappy search, woocommerce 4 4 Tested up to: 6.8 5 Stable tag: 1. 3.15 Stable tag: 1.4.0 6 6 Requires PHP: 7.4 7 7 License: GPLv3 … … 36 36 * Ability to adjust the batch size for the initial index so smaller servers don't get overloaded 37 37 * 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 40 41 * Reindexer button 41 42 * Shortcode [snappy_search_polyplugins placeholder="Search..."] to inject a Snappy Search form anywhere … … 92 93 5. Pages Settings 93 94 6. Products Settings 94 7. Repo Settings 95 7. Advanced Search Settings 96 8. Repo Settings 95 97 96 98 97 99 == 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 98 109 99 110 = 1.3.1 = -
speedy-search/tags/1.4.0/speedy-search.php
r3336262 r3338334 4 4 * Plugin Name: Snappy Search 5 5 * Description: A fast, lightweight search plugin powered by TNTSearch, indexing posts for instant, accurate results. 6 * Version: 1. 3.16 * Version: 1.4.0 7 7 * Requires at least: 6.5 8 8 * Requires PHP: 7.4 -
speedy-search/tags/1.4.0/templates/snappy-search-advanced-form.php
r3336230 r3338334 3 3 use PolyPlugins\Speedy_Search\Utils; 4 4 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'; 8 12 ?> 9 13 10 14 <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); ?>"> 13 17 <button type="button" class="snappy-search-close" aria-label="Close Search">×</button> 14 18 <span class="loader" style="display: none;"></span> -
speedy-search/tags/1.4.0/templates/snappy-search-form.php
r3336230 r3338334 3 3 use PolyPlugins\Speedy_Search\Utils; 4 4 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'; 8 12 ?> 9 13 10 14 <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); ?>"> 13 17 <button type="button" class="snappy-search-close" aria-label="Close Search">×</button> 14 18 <span class="loader" style="display: none;"></span> -
speedy-search/tags/1.4.0/templates/snappy-search-mobile-form.php
r3336230 r3338334 3 3 use PolyPlugins\Speedy_Search\Utils; 4 4 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'; 8 12 ?> 9 13 10 14 <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); ?>"> 13 17 <button type="button" class="snappy-search-close" aria-label="Close Search">×</button> 14 18 <span class="loader" style="display: none;"></span> -
speedy-search/trunk/css/backend/settings.css
r3334968 r3338334 31 31 input[type="range"] { 32 32 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; 33 51 } 34 52 -
speedy-search/trunk/css/frontend/style.css
r3336230 r3338334 213 213 .instant-search-result.skeleton-loading .excerpt-result { 214 214 background-color: #e0e0e0; 215 color: transparent ;215 color: transparent!important; 216 216 border-radius: 4px; 217 217 position: relative; … … 233 233 .instant-search-result.skeleton-loading .excerpt-result { 234 234 min-height: 14px; 235 } 236 237 /** 238 * Advanced Search 239 */ 240 .speedy-search-container.advanced-search .instant-search-wrapper { 241 position: unset; 235 242 } 236 243 … … 275 282 276 283 @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 164 164 165 165 add_settings_section( 166 'speedy_search_advanced_section_polyplugins', 167 '', 168 null, 169 'speedy_search_advanced_polyplugins' 170 ); 171 172 add_settings_section( 166 173 'speedy_search_repo_section_polyplugins', 167 174 '', … … 372 379 373 380 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( 374 405 'repo_enabled', 375 406 __('Enabled?', 'speedy-search'), … … 736 767 <p><strong><?php esc_html_e('How many downloads would you like to show?', 'speedy-search'); ?></strong></p> 737 768 <?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 738 813 } 739 814 … … 814 889 <?php endif; ?> 815 890 <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> 816 897 <a href="javascript:void(0);" data-section="repo"> 817 898 <i class="bi bi-plug-fill"></i> … … 868 949 <?php endif; ?> 869 950 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 870 960 <div class="tab repo" style="display: none;"> 871 961 <?php … … 1028 1118 } 1029 1119 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 1030 1150 if (isset($input['repo_enabled']) && $input['repo_enabled']) { 1031 1151 $sanitary_values['repo_enabled'] = $input['repo_enabled'] === 'on' ? true : false; -
speedy-search/trunk/includes/classes/Backend/Background_Worker.php
r3336230 r3338334 197 197 198 198 $progress++; 199 200 Utils::update_index($type, 'progress', $progress); 199 201 } 200 201 Utils::update_index($type, 'progress', $progress);202 202 } else { 203 203 Utils::update_index($type, 'complete', true); -
speedy-search/trunk/includes/classes/Backend/Notices.php
r3336230 r3338334 39 39 $this->notice_130(); 40 40 } 41 if ($this->version == '1.4.0') { 42 $this->notice_140(); 43 } 41 44 } 42 45 } … … 60 63 } 61 64 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 62 81 public function dismiss_notice() { 63 82 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 21 21 */ 22 22 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; 23 51 24 52 /** … … 28 56 */ 29 57 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; 32 64 } 33 65 … … 66 98 */ 67 99 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 } 73 108 74 if ($ selector) {75 // Fallback to default search when indexing76 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(); 101 136 } 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(); 128 161 } 129 162 } 130 163 } 131 164 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 132 208 } -
speedy-search/trunk/includes/classes/Frontend_Loader.php
r3334968 r3338334 3 3 namespace PolyPlugins\Speedy_Search; 4 4 5 use PolyPlugins\Speedy_Search\Frontend\Advanced_Search; 5 6 use PolyPlugins\Speedy_Search\Frontend\Analytics; 6 7 use PolyPlugins\Speedy_Search\Frontend\Enqueue; … … 51 52 $this->load_ui(); 52 53 $this->load_shortcode(); 54 $this->load_advanced_search(); 53 55 $this->load_analytics(); 54 56 } … … 85 87 86 88 /** 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 /** 87 99 * Load Analytics 88 100 * -
speedy-search/trunk/includes/classes/Updater.php
r3336230 r3338334 65 65 update_option('speedy_search_version_polyplugins', $stored_version); 66 66 } 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 } 67 75 } 68 76 … … 109 117 } 110 118 119 private function update_to_140() { 120 update_option('speedy_search_notice_dismissed_polyplugins', false); 121 } 122 111 123 } -
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 13 1 jQuery(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(); 21 28 22 29 init(); … … 154 161 "</p>" 155 162 ); 156 console.error("Search error in " + endpoint + ":", error);157 163 }, 158 164 }); -
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 11 2 12 3 jQuery(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(); 20 25 21 26 init(); … … 186 191 $section.empty(); 187 192 $section.append("<p>" + __("An error occurred while searching.", "speedy-search") + "</p>"); 188 console.error("Search error in " + endpoint + ":", error);189 193 } 190 194 }) -
speedy-search/trunk/languages/speedy-search.pot
r3336230 r3338334 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Snappy Search 1. 3.0\n"5 "Project-Id-Version: Snappy Search 1.4.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/speedy-search\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-0 7-29T20:50:50+00:00\n"12 "POT-Creation-Date: 2025-08-02T21:53:03+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.11.0\n" … … 49 49 msgstr "" 50 50 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 58 59 msgid "Enabled?" 59 60 msgstr "" 60 61 61 #: includes/classes/Backend/Admin.php:1 8362 #: includes/classes/Backend/Admin.php:190 62 63 msgid "Database Type" 63 64 msgstr "" 64 65 65 #: includes/classes/Backend/Admin.php:19 166 #: includes/classes/Backend/Admin.php:2 5566 #: includes/classes/Backend/Admin.php:198 67 #: includes/classes/Backend/Admin.php:262 67 68 msgid "Characters" 68 69 msgstr "" 69 70 70 #: includes/classes/Backend/Admin.php: 19971 #: includes/classes/Backend/Admin.php:206 71 72 msgid "Max Characters" 72 73 msgstr "" 73 74 74 #: includes/classes/Backend/Admin.php:2 0775 #: includes/classes/Backend/Admin.php:214 75 76 msgid "Typing Delay" 76 77 msgstr "" 77 78 78 #: includes/classes/Backend/Admin.php:2 1579 #: includes/classes/Backend/Admin.php:222 79 80 msgid "Selector" 80 81 msgstr "" 81 82 82 #: includes/classes/Backend/Admin.php:23 183 #: includes/classes/Backend/Admin.php:238 83 84 msgid "Limit" 84 85 msgstr "" 85 86 86 #: includes/classes/Backend/Admin.php:2 3987 #: includes/classes/Backend/Admin.php:246 87 88 msgid "Days" 88 89 msgstr "" 89 90 90 #: includes/classes/Backend/Admin.php:2 4791 #: includes/classes/Backend/Admin.php:254 91 92 msgid "Tracking Delay" 92 93 msgstr "" 93 94 94 #: includes/classes/Backend/Admin.php:2 6395 #: includes/classes/Backend/Admin.php:270 95 96 msgid "Result Count" 96 97 msgstr "" 97 98 98 #: includes/classes/Backend/Admin.php:27 199 #: includes/classes/Backend/Admin.php:278 99 100 msgid "Blacklisted Words" 100 101 msgstr "" 101 102 102 #: includes/classes/Backend/Admin.php:2 87103 #: includes/classes/Backend/Admin.php:31 1104 #: includes/classes/Backend/Admin.php:3 35105 #: includes/classes/Backend/Admin.php:3 59103 #: 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 106 107 msgid "Batch" 107 108 msgstr "" 108 109 109 #: includes/classes/Backend/Admin.php: 295110 #: includes/classes/Backend/Admin.php:3 19111 #: includes/classes/Backend/Admin.php:3 43112 #: includes/classes/Backend/Admin.php:3 67110 #: 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 113 114 msgid "Result Limit" 114 115 msgstr "" 115 116 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 118 msgid "Title" 119 msgstr "" 120 121 #: includes/classes/Backend/Admin.php:398 122 msgid "Placeholder" 123 msgstr "" 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 123 133 msgid "Yes" 124 134 msgstr "" 125 135 126 #: includes/classes/Backend/Admin.php:4 08136 #: includes/classes/Backend/Admin.php:439 127 137 msgid "If your server runs MySQL you can store the index inside your existing database, otherwise its stored on your filesystem." 128 138 msgstr "" 129 139 130 #: includes/classes/Backend/Admin.php:4 08140 #: includes/classes/Backend/Admin.php:439 131 141 msgid "Note: Changing this setting triggers a reindex." 132 142 msgstr "" 133 143 134 #: includes/classes/Backend/Admin.php:4 21144 #: includes/classes/Backend/Admin.php:452 135 145 msgid "How many characters to trigger Snappy Search?" 136 146 msgstr "" 137 147 138 #: includes/classes/Backend/Admin.php:4 34148 #: includes/classes/Backend/Admin.php:465 139 149 msgid "Maximum number of characters allowed to be searched?" 140 150 msgstr "" 141 151 142 #: includes/classes/Backend/Admin.php:4 47152 #: includes/classes/Backend/Admin.php:478 143 153 msgid "How many milliseconds between inputs until a search is fired?" 144 154 msgstr "" 145 155 146 #: includes/classes/Backend/Admin.php:4 60156 #: includes/classes/Backend/Admin.php:491 147 157 msgid "Enter your selector that you want to add the instant search to. Ex: #search" 148 158 msgstr "" 149 159 150 #: includes/classes/Backend/Admin.php:4 60160 #: includes/classes/Backend/Admin.php:491 151 161 msgid "Leave blank if you are using the [snappy_search_polyplugins] shortcode." 152 162 msgstr "" 153 163 154 #: includes/classes/Backend/Admin.php: 476164 #: includes/classes/Backend/Admin.php:507 155 165 msgid "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." 156 166 msgstr "" 157 167 158 #: includes/classes/Backend/Admin.php: 490168 #: includes/classes/Backend/Admin.php:521 159 169 msgid "Number of popular search terms to show." 160 170 msgstr "" 161 171 162 #: includes/classes/Backend/Admin.php:5 04172 #: includes/classes/Backend/Admin.php:535 163 173 msgid "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." 164 174 msgstr "" 165 175 166 #: includes/classes/Backend/Admin.php:5 18176 #: includes/classes/Backend/Admin.php:549 167 177 msgid "How many milliseconds after a user is done typing, until the search is tracked?" 168 178 msgstr "" 169 179 170 #: includes/classes/Backend/Admin.php:5 32180 #: includes/classes/Backend/Admin.php:563 171 181 msgid "Number of characters required for the search term to be tracked." 172 182 msgstr "" 173 183 174 #: includes/classes/Backend/Admin.php:5 46184 #: includes/classes/Backend/Admin.php:577 175 185 msgid "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." 176 186 msgstr "" 177 187 178 #: includes/classes/Backend/Admin.php:5 60188 #: includes/classes/Backend/Admin.php:591 179 189 msgid "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." 180 190 msgstr "" 181 191 182 #: includes/classes/Backend/Admin.php: 576192 #: includes/classes/Backend/Admin.php:607 183 193 msgid "Index and show posts in the search?" 184 194 msgstr "" 185 195 186 #: includes/classes/Backend/Admin.php: 590196 #: includes/classes/Backend/Admin.php:621 187 197 msgid "How many posts should be indexed per minute?" 188 198 msgstr "" 189 199 190 #: includes/classes/Backend/Admin.php:6 04200 #: includes/classes/Backend/Admin.php:635 191 201 msgid "How many posts would you like to show?" 192 202 msgstr "" 193 203 194 #: includes/classes/Backend/Admin.php:6 20204 #: includes/classes/Backend/Admin.php:651 195 205 msgid "Index and show pages in the search?" 196 206 msgstr "" 197 207 198 #: includes/classes/Backend/Admin.php:6 34208 #: includes/classes/Backend/Admin.php:665 199 209 msgid "How many pages should be indexed per minute?" 200 210 msgstr "" 201 211 202 #: includes/classes/Backend/Admin.php:6 48212 #: includes/classes/Backend/Admin.php:679 203 213 msgid "How many pages would you like to show?" 204 214 msgstr "" 205 215 206 #: includes/classes/Backend/Admin.php:6 64216 #: includes/classes/Backend/Admin.php:695 207 217 msgid "Index and show products in the search?" 208 218 msgstr "" 209 219 210 #: includes/classes/Backend/Admin.php: 678220 #: includes/classes/Backend/Admin.php:709 211 221 msgid "How many products should be indexed per minute?" 212 222 msgstr "" 213 223 214 #: includes/classes/Backend/Admin.php: 692224 #: includes/classes/Backend/Admin.php:723 215 225 msgid "How many products would you like to show?" 216 226 msgstr "" 217 227 218 #: includes/classes/Backend/Admin.php:7 08228 #: includes/classes/Backend/Admin.php:739 219 229 msgid "Index and show downloads in the search?" 220 230 msgstr "" 221 231 222 #: includes/classes/Backend/Admin.php:7 22232 #: includes/classes/Backend/Admin.php:753 223 233 msgid "How many downloads should be indexed per minute?" 224 234 msgstr "" 225 235 226 #: includes/classes/Backend/Admin.php:7 36236 #: includes/classes/Backend/Admin.php:767 227 237 msgid "How many downloads would you like to show?" 228 238 msgstr "" 229 239 230 #: includes/classes/Backend/Admin.php:768 240 #: includes/classes/Backend/Admin.php:783 241 msgid "If enabled, pressing Enter will go to /advanced-search/ instead of the default search, unless indexing is active." 242 msgstr "" 243 244 #: includes/classes/Backend/Admin.php:783 245 msgid "Note: This will flush rewrite rules." 246 msgstr "" 247 248 #: includes/classes/Backend/Admin.php:797 249 msgid "Set the page title of advanced search." 250 msgstr "" 251 252 #: includes/classes/Backend/Admin.php:811 253 msgid "Set the placeholder for the advanced search input." 254 msgstr "" 255 256 #: includes/classes/Backend/Admin.php:843 231 257 msgid "Snappy Search Settings" 232 258 msgstr "" 233 259 234 #: includes/classes/Backend/Admin.php: 778260 #: includes/classes/Backend/Admin.php:853 235 261 msgid "General" 236 262 msgstr "" 237 263 238 #: includes/classes/Backend/Admin.php: 784264 #: includes/classes/Backend/Admin.php:859 239 265 msgid "Popular" 240 266 msgstr "" 241 267 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 245 272 msgid "Posts" 246 273 msgstr "" 247 274 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 251 279 msgid "Pages" 252 280 msgstr "" 253 281 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 257 286 msgid "Products" 258 287 msgstr "" 259 288 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 263 293 msgid "Downloads" 264 294 msgstr "" 265 295 266 #: includes/classes/Backend/Admin.php:818 296 #: includes/classes/Backend/Admin.php:893 297 msgid "Advanced" 298 msgstr "" 299 300 #: includes/classes/Backend/Admin.php:899 267 301 msgid "Repo" 268 302 msgstr "" 269 303 270 #: includes/classes/Backend/Admin.php: 824304 #: includes/classes/Backend/Admin.php:905 271 305 #: js/backend/settings.js:31 272 306 msgid "Reindex" 273 307 msgstr "" 274 308 309 #: includes/classes/Backend/Admin.php:953 310 msgid "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." 311 msgstr "" 312 275 313 #: includes/classes/Backend/Background_Worker.php:116 276 314 msgid "Every Minute" 277 315 msgstr "" 278 316 279 #: includes/classes/Backend/Notices.php: 47317 #: includes/classes/Backend/Notices.php:50 280 318 msgid "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." 281 319 msgstr "" 282 320 283 #: includes/classes/Backend/Notices.php: 48321 #: includes/classes/Backend/Notices.php:51 284 322 msgid "Try new features" 285 323 msgstr "" 286 324 287 #: includes/classes/Backend/Notices.php:5 6325 #: includes/classes/Backend/Notices.php:59 288 326 msgid "Snappy Search can now use MySQL databases, which means search indexes can be stored in your existing WordPress database for better performance." 289 327 msgstr "" 290 328 291 #: includes/classes/Backend/Notices.php:57 329 #: includes/classes/Backend/Notices.php:60 330 #: includes/classes/Backend/Notices.php:76 292 331 msgid "Switch to MySQL" 332 msgstr "" 333 334 #: includes/classes/Backend/Notices.php:68 335 msgid "Starting with version 1.5.0, Snappy Search will include functionality offered by our " 336 msgstr "" 337 338 #: includes/classes/Backend/Notices.php:70 339 msgid " plugin. As part of this update, the plugin will gain the ability to index WooCommerce orders, which introduces additional security considerations." 340 msgstr "" 341 342 #: includes/classes/Backend/Notices.php:72 343 msgid "To support this securely and efficiently, we are " 344 msgstr "" 345 346 #: includes/classes/Backend/Notices.php:72 347 msgid "discontinuing support for SQLite" 348 msgstr "" 349 350 #: includes/classes/Backend/Notices.php:72 351 msgid ". Managing mixed database logic (SQLite and MySQL) adds unnecessary complexity and overhead, particularly when handling sensitive data like order information." 352 msgstr "" 353 354 #: includes/classes/Backend/Notices.php:74 355 msgid "Before updating to 1.5.0, please ensure your site is using MySQL." 356 msgstr "" 357 358 #: includes/classes/Backend/Notices.php:75 359 msgid "If your site is still using SQLite, search functionality will be automatically disabled after the update." 293 360 msgstr "" 294 361 … … 304 371 msgstr "" 305 372 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 310 378 msgid "Popular Searches" 311 379 msgstr "" … … 351 419 msgstr "" 352 420 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 355 424 msgid "No results found." 356 425 msgstr "" 357 426 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 360 430 msgid "An error occurred while searching." 361 431 msgstr "" -
speedy-search/trunk/readme.txt
r3336262 r3338334 3 3 Tags: instant search, search, wp, snappy search, woocommerce 4 4 Tested up to: 6.8 5 Stable tag: 1. 3.15 Stable tag: 1.4.0 6 6 Requires PHP: 7.4 7 7 License: GPLv3 … … 36 36 * Ability to adjust the batch size for the initial index so smaller servers don't get overloaded 37 37 * 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 40 41 * Reindexer button 41 42 * Shortcode [snappy_search_polyplugins placeholder="Search..."] to inject a Snappy Search form anywhere … … 92 93 5. Pages Settings 93 94 6. Products Settings 94 7. Repo Settings 95 7. Advanced Search Settings 96 8. Repo Settings 95 97 96 98 97 99 == 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 98 109 99 110 = 1.3.1 = -
speedy-search/trunk/speedy-search.php
r3336262 r3338334 4 4 * Plugin Name: Snappy Search 5 5 * Description: A fast, lightweight search plugin powered by TNTSearch, indexing posts for instant, accurate results. 6 * Version: 1. 3.16 * Version: 1.4.0 7 7 * Requires at least: 6.5 8 8 * Requires PHP: 7.4 -
speedy-search/trunk/templates/snappy-search-advanced-form.php
r3336230 r3338334 3 3 use PolyPlugins\Speedy_Search\Utils; 4 4 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'; 8 12 ?> 9 13 10 14 <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); ?>"> 13 17 <button type="button" class="snappy-search-close" aria-label="Close Search">×</button> 14 18 <span class="loader" style="display: none;"></span> -
speedy-search/trunk/templates/snappy-search-form.php
r3336230 r3338334 3 3 use PolyPlugins\Speedy_Search\Utils; 4 4 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'; 8 12 ?> 9 13 10 14 <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); ?>"> 13 17 <button type="button" class="snappy-search-close" aria-label="Close Search">×</button> 14 18 <span class="loader" style="display: none;"></span> -
speedy-search/trunk/templates/snappy-search-mobile-form.php
r3336230 r3338334 3 3 use PolyPlugins\Speedy_Search\Utils; 4 4 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'; 8 12 ?> 9 13 10 14 <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); ?>"> 13 17 <button type="button" class="snappy-search-close" aria-label="Close Search">×</button> 14 18 <span class="loader" style="display: none;"></span>
Note: See TracChangeset
for help on using the changeset viewer.