Changeset 3462580
- Timestamp:
- 02/16/2026 01:57:34 PM (6 weeks ago)
- Location:
- ajax-search-lite
- Files:
-
- 11 edited
-
tags/4.13.5/readme.txt (modified) (2 diffs)
-
trunk/ajax-search-lite.php (modified) (2 diffs)
-
trunk/backend/settings/default_options.php (modified) (4 diffs)
-
trunk/backend/tabs/instance/advanced/exclude_results.php (modified) (1 diff)
-
trunk/includes/classes/etc/class-asl_helpers.php (modified) (1 diff)
-
trunk/includes/classes/search/class-asl-query.php (modified) (14 diffs)
-
trunk/includes/classes/search/class-asl-search-cpt.php (modified) (1 diff)
-
trunk/includes/functions/functions.php (modified) (2 diffs)
-
trunk/languages/ajax-search-lite.pot (modified) (7 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/server/Utils/AdvancedField/Types/AbstractWooCommerceBase.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ajax-search-lite/tags/4.13.5/readme.txt
r3462566 r3462580 6 6 Requires PHP: 7.4 7 7 Tested up to: 6.9 8 Stable tag: 4.13. 48 Stable tag: 4.13.5 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 138 138 139 139 == Changelog == 140 = 4.13.5 = 141 * Added an option to control visibility for WPML non-translated content (display on main language, on all or off) 142 * Greatly improved the image parser by allowing additional data attributes and divs with these data attributes as a potential image source 143 * Fixed a deprecation warning in PHP 8.0+ 144 * Fixed an issue for a potential conflict where a null value could be returned in the get_posts hook 145 * Fixed and issue with the WooCommerce advanced field handler 146 140 147 = 4.13.4 = 141 148 * Added an option to limit the result title length (default 999 characters) -
ajax-search-lite/trunk/ajax-search-lite.php
r3377501 r3462580 4 4 Plugin URI: http://wp-dreams.com 5 5 Description: The lite version of the most powerful ajax powered search engine for WordPress. 6 Version: 4.13. 46 Version: 4.13.5 7 7 Author: Ernest Marcinko 8 8 License: GPLv2 … … 30 30 ); 31 31 define('ASL_URL_NP', str_replace(array( 'http://', 'https://' ), '//', plugin_dir_url(__FILE__))); 32 define('ASL_CURRENT_VERSION', 478 0);33 define('ASL_CURR_VER_STRING', '4.13. 4');32 define('ASL_CURRENT_VERSION', 4781); 33 define('ASL_CURR_VER_STRING', '4.13.5'); 34 34 define('ASL_DEBUG', 0); 35 35 -
ajax-search-lite/trunk/backend/settings/default_options.php
r3377501 r3462580 99 99 // General options 100 100 $options['asl_defaults'] = array( 101 'theme' => 'simple-red',102 'override_search_form' => 0,103 'override_woo_search_form' => 0,104 'keyword_logic' => 'and',105 'mob_auto_focus_menu_selector' => '#menu-toggle, .menu-toggle',106 'trigger_on_facet_change' => 1,107 'click_action' => 'results_page',108 'return_action' => 'results_page',109 'click_action_location' => 'same',110 'return_action_location' => 'same',111 'custom_redirect_url' => '?s={phrase}',112 'results_per_page' => 'auto',113 'triggerontype' => 1,114 'trigger_update_href' => 0,115 'customtypes' => array( 'post', 'page' ),116 'searchintitle' => 1,117 'searchincontent' => 1,118 'searchinexcerpt' => 1,119 'search_in_permalinks' => 0,120 'show_password_protected_posts' => 0,121 'search_in_ids' => 0,122 'search_all_cf' => 0,123 'customfields' => '',124 'post_status' => 'publish',125 'override_default_results' => 1,126 'override_method' => 'get',127 'res_live_search' => 0,128 'res_live_selector' => '#main',129 'res_live_trigger_type' => 1,130 'res_live_trigger_facet' => 1,131 'res_live_trigger_click' => 0,132 'res_live_trigger_return' => 0,133 134 'exactonly' => 0,135 'exact_match_location' => 'anywhere',136 'searchinterms' => 0,137 138 'charcount' => 0,139 'maxresults' => 10,140 'itemscount' => 4,141 'resultitemheight' => '70px',142 143 'orderby_primary' => 'relevance DESC',144 'orderby_secondary' => 'post_date DESC',145 'orderby_primary_cf' => '',146 'orderby_secondary_cf' => '',147 'orderby_primary_cf_type' => 'numeric',148 'orderby_secondary_cf_type' => 'numeric',101 'theme' => 'simple-red', 102 'override_search_form' => 0, 103 'override_woo_search_form' => 0, 104 'keyword_logic' => 'and', 105 'mob_auto_focus_menu_selector' => '#menu-toggle, .menu-toggle', 106 'trigger_on_facet_change' => 1, 107 'click_action' => 'results_page', 108 'return_action' => 'results_page', 109 'click_action_location' => 'same', 110 'return_action_location' => 'same', 111 'custom_redirect_url' => '?s={phrase}', 112 'results_per_page' => 'auto', 113 'triggerontype' => 1, 114 'trigger_update_href' => 0, 115 'customtypes' => array( 'post', 'page' ), 116 'searchintitle' => 1, 117 'searchincontent' => 1, 118 'searchinexcerpt' => 1, 119 'search_in_permalinks' => 0, 120 'show_password_protected_posts' => 0, 121 'search_in_ids' => 0, 122 'search_all_cf' => 0, 123 'customfields' => '', 124 'post_status' => 'publish', 125 'override_default_results' => 1, 126 'override_method' => 'get', 127 'res_live_search' => 0, 128 'res_live_selector' => '#main', 129 'res_live_trigger_type' => 1, 130 'res_live_trigger_facet' => 1, 131 'res_live_trigger_click' => 0, 132 'res_live_trigger_return' => 0, 133 134 'exactonly' => 0, 135 'exact_match_location' => 'anywhere', 136 'searchinterms' => 0, 137 138 'charcount' => 0, 139 'maxresults' => 10, 140 'itemscount' => 4, 141 'resultitemheight' => '70px', 142 143 'orderby_primary' => 'relevance DESC', 144 'orderby_secondary' => 'post_date DESC', 145 'orderby_primary_cf' => '', 146 'orderby_secondary_cf' => '', 147 'orderby_primary_cf_type' => 'numeric', 148 'orderby_secondary_cf_type' => 'numeric', 149 149 150 150 // General/Image 151 'show_images' => 1,152 'image_width' => 70,153 'image_height' => 70,154 'image_parser_image_number' => 1,155 'image_parser_exclude_filenames' => '',156 'image_display_mode' => 'cover',157 'image_apply_content_filter' => 0,158 'image_sources' => array(151 'show_images' => 1, 152 'image_width' => 70, 153 'image_height' => 70, 154 'image_parser_image_number' => 1, 155 'image_parser_exclude_filenames' => '', 156 'image_display_mode' => 'cover', 157 'image_apply_content_filter' => 0, 158 'image_sources' => array( 159 159 array( 160 160 'option' => 'Featured image', … … 187 187 ), 188 188 189 'image_source1' => 'featured',190 'image_source2' => 'content',191 'image_source3' => 'excerpt',192 'image_source4' => 'custom',193 'image_source5' => 'default',194 'image_default' => ASL_URL . 'img/default.jpg',195 'image_source_featured' => 'original',196 'image_custom_field' => '',197 'use_timthumb' => 1,189 'image_source1' => 'featured', 190 'image_source2' => 'content', 191 'image_source3' => 'excerpt', 192 'image_source4' => 'custom', 193 'image_source5' => 'default', 194 'image_default' => ASL_URL . 'img/default.jpg', 195 'image_source_featured' => 'original', 196 'image_custom_field' => '', 197 'use_timthumb' => 1, 198 198 199 199 /* Frontend search settings Options */ 200 'show_frontend_search_settings' => 0,201 'showexactmatches' => 1,202 'showsearchintitle' => 1,203 'showsearchincontent' => 1,204 'showcustomtypes' => '',205 'showsearchincomments' => 1,206 'showsearchinexcerpt' => 1,207 'showsearchinbpusers' => 0,208 'showsearchinbpgroups' => 0,209 'showsearchinbpforums' => 0,210 211 'exactmatchestext' => 'Exact matches only',212 'searchintitletext' => 'Search in title',213 'searchincontenttext' => 'Search in content',214 'searchincommentstext' => 'Search in comments',215 'searchinexcerpttext' => 'Search in excerpt',216 'searchinbpuserstext' => 'Search in users',217 'searchinbpgroupstext' => 'Search in groups',218 'searchinbpforumstext' => 'Search in forums',219 220 'showsearchincategories' => 0,221 'showuncategorised' => 0,222 'exsearchincategories' => '',223 'exsearchincategoriesheight' => 200,224 'showsearchintaxonomies' => 1,225 'showterms' => '',226 'showseparatefilterboxes' => 1,227 'exsearchintaxonomiestext' => 'Filter by',228 'exsearchincategoriestext' => 'Filter by Categories',229 230 'auto_populate' => 'disabled',231 'auto_populate_phrase' => '',232 'auto_populate_count' => '1',200 'show_frontend_search_settings' => 0, 201 'showexactmatches' => 1, 202 'showsearchintitle' => 1, 203 'showsearchincontent' => 1, 204 'showcustomtypes' => '', 205 'showsearchincomments' => 1, 206 'showsearchinexcerpt' => 1, 207 'showsearchinbpusers' => 0, 208 'showsearchinbpgroups' => 0, 209 'showsearchinbpforums' => 0, 210 211 'exactmatchestext' => 'Exact matches only', 212 'searchintitletext' => 'Search in title', 213 'searchincontenttext' => 'Search in content', 214 'searchincommentstext' => 'Search in comments', 215 'searchinexcerpttext' => 'Search in excerpt', 216 'searchinbpuserstext' => 'Search in users', 217 'searchinbpgroupstext' => 'Search in groups', 218 'searchinbpforumstext' => 'Search in forums', 219 220 'showsearchincategories' => 0, 221 'showuncategorised' => 0, 222 'exsearchincategories' => '', 223 'exsearchincategoriesheight' => 200, 224 'showsearchintaxonomies' => 1, 225 'showterms' => '', 226 'showseparatefilterboxes' => 1, 227 'exsearchintaxonomiestext' => 'Filter by', 228 'exsearchincategoriestext' => 'Filter by Categories', 229 230 'auto_populate' => 'disabled', 231 'auto_populate_phrase' => '', 232 'auto_populate_count' => '1', 233 233 234 234 // Box layout 235 'results_snap_to' => 'left',236 'box_width' => '100%',237 'box_width_tablet' => '100%',238 'box_width_phone' => '100%',239 'box_margin' => '||0px||0px||0px||0px||',240 'box_font' => 'Open Sans',241 'override_bg' => 0,242 'override_bg_color' => '#FFFFFF',243 'override_icon' => 0,244 'override_icon_bg_color' => '#FFFFFF',245 'override_icon_color' => '#000000',246 'override_border' => 0,247 'override_border_style' => 'border:1px none rgb(0, 0, 0);border-radius:0px 0px 0px 0px;',248 249 'results_bg_override' => 0,250 'results_bg_override_color' => '#FFFFFF',251 'results_item_bg_override' => 0,252 'results_item_bg_override_color' => '#FFFFFF',253 'results_override_border' => 0,254 'results_override_border_style' => 'border:1px none rgb(0, 0, 0);border-radius:0px 0px 0px 0px;',255 256 'settings_bg_override' => 0,257 'settings_bg_override_color' => '#FFFFFF',258 'settings_override_border' => 0,259 'settings_override_border_style' => 'border:1px none rgb(0, 0, 0);border-radius:0px 0px 0px 0px;',235 'results_snap_to' => 'left', 236 'box_width' => '100%', 237 'box_width_tablet' => '100%', 238 'box_width_phone' => '100%', 239 'box_margin' => '||0px||0px||0px||0px||', 240 'box_font' => 'Open Sans', 241 'override_bg' => 0, 242 'override_bg_color' => '#FFFFFF', 243 'override_icon' => 0, 244 'override_icon_bg_color' => '#FFFFFF', 245 'override_icon_color' => '#000000', 246 'override_border' => 0, 247 'override_border_style' => 'border:1px none rgb(0, 0, 0);border-radius:0px 0px 0px 0px;', 248 249 'results_bg_override' => 0, 250 'results_bg_override_color' => '#FFFFFF', 251 'results_item_bg_override' => 0, 252 'results_item_bg_override_color' => '#FFFFFF', 253 'results_override_border' => 0, 254 'results_override_border_style' => 'border:1px none rgb(0, 0, 0);border-radius:0px 0px 0px 0px;', 255 256 'settings_bg_override' => 0, 257 'settings_bg_override_color' => '#FFFFFF', 258 'settings_override_border' => 0, 259 'settings_override_border_style' => 'border:1px none rgb(0, 0, 0);border-radius:0px 0px 0px 0px;', 260 260 261 261 // Results Layout 262 'resultstype_def' => array(262 'resultstype_def' => array( 263 263 array( 264 264 'option' => 'Vertical Results', … … 278 278 ), 279 279 ), 280 'resultstype' => 'vertical',281 'resultsposition_def' => array(280 'resultstype' => 'vertical', 281 'resultsposition_def' => array( 282 282 array( 283 283 'option' => 'Hover - over content', … … 289 289 ), 290 290 ), 291 'resultsposition' => 'hover',292 'resultsmargintop' => '12px',293 294 'results_width' => 'auto',295 'results_width_phone' => 'auto',296 'results_width_tablet' => 'auto',297 298 'v_res_max_height' => 'none',299 300 'v_res_column_count' => 1,301 'v_res_column_min_width' => '200px',302 'v_res_column_min_width_tablet' => '200px',303 'v_res_column_min_width_phone' => '200px',304 305 'defaultsearchtext' => 'Search here..',306 'showmoreresults' => 0,307 'showmoreresultstext' => 'More results...',308 'results_click_blank' => 0,309 'scroll_to_results' => 0,310 'resultareaclickable' => 1,311 'close_on_document_click' => 1,312 'show_close_icon' => 1,313 'post_type_res_title_length' => 999,314 'showauthor' => 0,315 'showdate' => 0,316 'custom_date' => 0,317 'custom_date_format' => 'Y-m-d H:i:s',318 'showdescription' => 1,319 'descriptionlength' => 100,320 'description_context' => 1,321 'description_context_depth' => 15000,322 'noresultstext' => 'No results!',323 'didyoumeantext' => 'Did you mean:',324 'kw_highlight' => 0,325 'kw_highlight_whole_words' => 1,326 'highlight_color' => '#d9312b',327 'highlight_bg_color' => '#eee',328 329 'single_highlight' => 0,330 'single_highlightwholewords' => 1,331 'single_highlightcolor' => '#d9312b',332 'single_highlightbgcolor' => '#eee',333 'single_highlight_scroll' => 0,334 'single_highlight_offset' => 0,335 'single_highlight_selector' => '#content',336 337 'custom_css_code' => '',291 'resultsposition' => 'hover', 292 'resultsmargintop' => '12px', 293 294 'results_width' => 'auto', 295 'results_width_phone' => 'auto', 296 'results_width_tablet' => 'auto', 297 298 'v_res_max_height' => 'none', 299 300 'v_res_column_count' => 1, 301 'v_res_column_min_width' => '200px', 302 'v_res_column_min_width_tablet' => '200px', 303 'v_res_column_min_width_phone' => '200px', 304 305 'defaultsearchtext' => 'Search here..', 306 'showmoreresults' => 0, 307 'showmoreresultstext' => 'More results...', 308 'results_click_blank' => 0, 309 'scroll_to_results' => 0, 310 'resultareaclickable' => 1, 311 'close_on_document_click' => 1, 312 'show_close_icon' => 1, 313 'post_type_res_title_length' => 999, 314 'showauthor' => 0, 315 'showdate' => 0, 316 'custom_date' => 0, 317 'custom_date_format' => 'Y-m-d H:i:s', 318 'showdescription' => 1, 319 'descriptionlength' => 100, 320 'description_context' => 1, 321 'description_context_depth' => 15000, 322 'noresultstext' => 'No results!', 323 'didyoumeantext' => 'Did you mean:', 324 'kw_highlight' => 0, 325 'kw_highlight_whole_words' => 1, 326 'highlight_color' => '#d9312b', 327 'highlight_bg_color' => '#eee', 328 329 'single_highlight' => 0, 330 'single_highlightwholewords' => 1, 331 'single_highlightcolor' => '#d9312b', 332 'single_highlightbgcolor' => '#eee', 333 'single_highlight_scroll' => 0, 334 'single_highlight_offset' => 0, 335 'single_highlight_selector' => '#content', 336 337 'custom_css_code' => '', 338 338 339 339 // General/Autocomplete/KW suggestions 340 'autocomplete' => 1,341 342 'kw_suggestions' => 1,343 'kw_length' => 60,344 'kw_count' => 10,345 'kw_google_lang' => 'en',340 'autocomplete' => 1, 341 342 'kw_suggestions' => 1, 343 'kw_length' => 60, 344 'kw_count' => 10, 345 'kw_google_lang' => 'en', 346 346 347 347 /* Advanced Options */ 348 'shortcode_op' => 'remove',349 'striptagsexclude' => '',350 'runshortcode' => 1,351 'stripshortcode' => 0,352 'pageswithcategories' => 0,353 354 'primary_titlefield' => 0,355 'primary_titlefield_cf' => '',356 'primary_descriptionfield' => 0,357 'primary_descriptionfield_cf' => '',358 'secondary_titlefield' => -1,359 'secondary_titlefield_cf' => '',360 'secondary_descriptionfield' => -1,361 'secondary_descriptionfield_cf' => '',362 'advtitlefield' => "{result_field field_name='title' hash='x'}",363 'advdescriptionfield' => "{result_field field_name='content' hash='y'}",364 365 'woo_exclude_outofstock' => 0,366 'exclude_woo_hidden' => 1,367 'exclude_woo_catalog' => 0,368 'excludecategories' => '',369 'excludeposts' => '',348 'shortcode_op' => 'remove', 349 'striptagsexclude' => '', 350 'runshortcode' => 1, 351 'stripshortcode' => 0, 352 'pageswithcategories' => 0, 353 354 'primary_titlefield' => 0, 355 'primary_titlefield_cf' => '', 356 'primary_descriptionfield' => 0, 357 'primary_descriptionfield_cf' => '', 358 'secondary_titlefield' => -1, 359 'secondary_titlefield_cf' => '', 360 'secondary_descriptionfield' => -1, 361 'secondary_descriptionfield_cf' => '', 362 'advtitlefield' => "{result_field field_name='title' hash='x'}", 363 'advdescriptionfield' => "{result_field field_name='content' hash='y'}", 364 365 'woo_exclude_outofstock' => 0, 366 'exclude_woo_hidden' => 1, 367 'exclude_woo_catalog' => 0, 368 'excludecategories' => '', 369 'excludeposts' => '', 370 370 // 'exclude_term_ids' => '', 371 371 372 'wpml_compatibility' => 1, 373 'polylang_compatibility' => 1, 374 375 'kw_exceptions' => '', 376 'kw_exceptions_e' => '', 372 'wpml_compatibility' => 1, 373 'wpml_display_missing_translations' => 'on_main_language', // 'on_main_language'|'on_all_languages'|'off' 374 'polylang_compatibility' => 1, 375 376 'kw_exceptions' => '', 377 'kw_exceptions_e' => '', 377 378 378 379 // Accessibility 379 'aria_search_form_label' => 'Search form',380 'aria_settings_form_label' => 'Search settings form',381 'aria_search_input_label' => 'Search input',382 'aria_search_autocomplete_label' => 'Search autocomplete',383 'aria_magnifier_label' => 'Search magnifier',380 'aria_search_form_label' => 'Search form', 381 'aria_settings_form_label' => 'Search settings form', 382 'aria_search_input_label' => 'Search input', 383 'aria_search_autocomplete_label' => 'Search autocomplete', 384 'aria_magnifier_label' => 'Search magnifier', 384 385 ); 385 386 } -
ajax-search-lite/trunk/backend/tabs/instance/advanced/exclude_results.php
r3349879 r3462580 17 17 /** @noinspection PhpUndefinedVariableInspection */ 18 18 new wpdreamsYesNo('wpml_compatibility', __('WPML compatibility', 'ajax-search-lite'), $sd['wpml_compatibility']); 19 ?> 20 </div> 21 <div class="item<?php echo class_exists('SitePress') ? '' : ' hiddend'; ?>"> 22 <?php 23 $o = new wpdreamsCustomSelect( 24 'wpml_display_missing_translations', 25 __('Display items, which have no translations?', 'ajax-search-lite'), 26 array( 27 'selects' =>array( 28 array( 29 'option' =>__('On main language only', 'ajax-search-lite'), 30 'value' => 'on_main_language', 31 ), 32 array( 33 'option' =>__('On all languages', 'ajax-search-lite'), 34 'value' => 'on_all_languages', 35 ), 36 array( 37 'option' =>__('Off', 'ajax-search-lite'), 38 'value' => 'off', 39 ), 40 ), 41 'value' =>$sd['wpml_display_missing_translations'], 42 ) 43 ); 19 44 ?> 20 45 </div> -
ajax-search-lite/trunk/includes/classes/etc/class-asl_helpers.php
r3367932 r3462580 552 552 $sitepress->switch_lang($args['_wpml_lang']); 553 553 } 554 555 $args['wpml_display_missing_translations'] = $sd['wpml_display_missing_translations']; 554 556 } 555 557 -
ajax-search-lite/trunk/includes/classes/search/class-asl-query.php
r3349879 r3462580 13 13 */ 14 14 class ASL_Query { 15 public $posts ;15 public $posts = array(); 16 16 17 17 /** … … 38 38 // 1. GENERIC arguments 39 39 // ---------------------------------------------------------------- 40 's' => '', // search query40 's' => '', // search query 41 41 /** 42 42 * @param string|array search_type … … 49 49 * attachments -> file attachments 50 50 */ 51 'search_type' => 'cpt',52 'engine' => 'regular', // regular|index -> index only used on cpt53 'posts_per_page' => 0, // posts per page, for non ajax requests only. If 0, then get_option(posts_per_page) is used54 'page' => 1, // which page of results, starts from 155 'keyword_logic' => 'OR', // OR|AND|OREX|ANDEX56 'secondary_logic' => '', // OR|AND|OREX|none or empty string57 'min_word_length' => 0, // Minimum word length of each word to be considered as a standalone word in the phrase (removed if shorter)51 'search_type' => 'cpt', 52 'engine' => 'regular', // regular|index -> index only used on cpt 53 'posts_per_page' => 0, // posts per page, for non ajax requests only. If 0, then get_option(posts_per_page) is used 54 'page' => 1, // which page of results, starts from 1 55 'keyword_logic' => 'OR', // OR|AND|OREX|ANDEX 56 'secondary_logic' => '', // OR|AND|OREX|none or empty string 57 'min_word_length' => 0, // Minimum word length of each word to be considered as a standalone word in the phrase (removed if shorter) 58 58 // ---------------------------------------------------------------- 59 59 … … 61 61 // 2. POST and CUSTOM POST TYPE related arguments 62 62 // ---------------------------------------------------------------- 63 'post_type' => array( 'post', 'page' ), // post types to look for64 'post_status' => array( 'publish' ), // post statuses65 'has_password' => false, // password protected66 'post_fields' => array( // post fields to search within63 'post_type' => array( 'post', 'page' ), // post types to look for 64 'post_status' => array( 'publish' ), // post statuses 65 'has_password' => false, // password protected 66 'post_fields' => array( // post fields to search within 67 67 // (title, content, excerpt, terms, permalink) 68 68 'title', … … 71 71 'terms', 72 72 ), 73 'post_custom_fields_all' => 0, // search all custom fields74 'post_custom_fields' => array(), // ..or search within custom fields75 'post_in' => array(), // string|array -> limit potential results pool to array of IDs76 'post_not_in' => array(), // string|array -> explicity exclude IDs from search results77 'post_not_in2' => array(), // array -> secondary exclusion for manual override78 'post_parent' => array(), // array -> post parent IDs79 'post_parent_exclude' => array(), // array -> post parent IDs80 'post_tax_filter' => array( // taxonomy filter support73 'post_custom_fields_all' => 0, // search all custom fields 74 'post_custom_fields' => array(), // ..or search within custom fields 75 'post_in' => array(), // string|array -> limit potential results pool to array of IDs 76 'post_not_in' => array(), // string|array -> explicity exclude IDs from search results 77 'post_not_in2' => array(), // array -> secondary exclusion for manual override 78 'post_parent' => array(), // array -> post parent IDs 79 'post_parent_exclude' => array(), // array -> post parent IDs 80 'post_tax_filter' => array( // taxonomy filter support 81 81 /* 82 82 array( … … 88 88 */ 89 89 ), 90 'post_meta_filter' => array( // meta_query support90 'post_meta_filter' => array( // meta_query support 91 91 /* 92 92 array( … … 109 109 */ 110 110 ), 111 'post_date_filter' => array( // date_query support111 'post_date_filter' => array( // date_query support 112 112 /* 113 113 array( … … 121 121 */ 122 122 ), 123 'post_user_filter' => array(123 'post_user_filter' => array( 124 124 /* 125 125 'include' => (1, 2, 3, 4), // include by IDs … … 127 127 */ 128 128 ), 129 'post_primary_order' => 'relevance DESC', // CAN be a custom field name130 'post_secondary_order' => 'post_date DESC',131 'post_primary_order_metatype' => false, // false (if not meta), 'numeric', 'string'132 'post_secondary_order_metatype' => false, // false (if not meta), 'numeric', 'string'133 '_post_primary_order_metakey' => false, // gets parsed later, do not touch134 '_post_secondary_order_metakey' => false, // gets parsed later do not touch129 'post_primary_order' => 'relevance DESC', // CAN be a custom field name 130 'post_secondary_order' => 'post_date DESC', 131 'post_primary_order_metatype' => false, // false (if not meta), 'numeric', 'string' 132 'post_secondary_order_metatype' => false, // false (if not meta), 'numeric', 'string' 133 '_post_primary_order_metakey' => false, // gets parsed later, do not touch 134 '_post_secondary_order_metakey' => false, // gets parsed later do not touch 135 135 // ADVANCED 136 '_post_get_content' => false,137 '_post_get_excerpt' => false,138 '_post_allow_empty_tax_term' => true,139 '_post_use_relevance' => true,136 '_post_get_content' => false, 137 '_post_get_excerpt' => false, 138 '_post_allow_empty_tax_term' => true, 139 '_post_use_relevance' => true, 140 140 // Special post tag filtering 141 '_post_tags_active' => false,142 '_post_tags_include' => array(),143 '_post_tags_exclude' => array(),144 '_post_tags_logic' => 'OR',145 '_post_tags_empty' => 0,146 '_post_meta_logic' => 'AND',147 '_post_meta_allow_null' => 0,141 '_post_tags_active' => false, 142 '_post_tags_include' => array(), 143 '_post_tags_exclude' => array(), 144 '_post_tags_logic' => 'OR', 145 '_post_tags_empty' => 0, 146 '_post_meta_logic' => 'AND', 147 '_post_meta_allow_null' => 0, 148 148 // ---------------------------------------------------------------- 149 149 … … 153 153 // QUERY FIELDS 154 154 // ---------------------------------------------------------------- 155 'cpt_query' => array(155 'cpt_query' => array( 156 156 'fields' => '', 157 157 'join' => '', … … 167 167 * Don't use/override these, unless you know what you are doing. 168 168 */ 169 '_id' => -1,170 '_o' => false,169 '_id' => -1, 170 '_o' => false, 171 171 // LIMITS 172 'limit' => 0, // overall results limit, if >=0, then evenly distributed between sources173 '_limit' => 0, // calculated limit based on the previous limit parameter172 'limit' => 0, // overall results limit, if >=0, then evenly distributed between sources 173 '_limit' => 0, // calculated limit based on the previous limit parameter 174 174 /** 175 175 * _call_num -> … … 178 178 * This is required to calculate the correct start of the result slicing 179 179 */ 180 '_call_num' => 0, 181 'posts_limit' => 10, 182 'posts_limit_override' => 1000, // Results count on the results page 183 'posts_limit_distribute' => 0, 184 185 '_charcount' => 0, 186 '_keyword_count_limit' => 6, // Number of words in the search phrase allowed 187 '_exact_matches' => false, 188 '_exact_match_location' => 'anywhere', // anywhere, start, end 189 '_qtranslate_lang' => 'en', // qtranslatex language data 190 '_wpml_lang' => '', // WPML language 191 '_polylang_lang' => '', // Polylang language 192 '_exclude_page_parent_child' => '', // parent page exclusion data (comma separated list) 193 '_taxonomy_group_logic' => 'AND', 194 '_db_force_case' => 'none', 195 '_db_force_utf8_like' => 0, 196 '_db_force_unicode' => 0, 197 '_ajax_search' => false, // Needs to be set explicitly to TRUE in search Ajax Handler class 198 '_no_post_process' => false, // Forcefully turns off post-processing to return RAW results 180 '_call_num' => 0, 181 'posts_limit' => 10, 182 'posts_limit_override' => 1000, // Results count on the results page 183 'posts_limit_distribute' => 0, 184 185 '_charcount' => 0, 186 '_keyword_count_limit' => 6, // Number of words in the search phrase allowed 187 '_exact_matches' => false, 188 '_exact_match_location' => 'anywhere', // anywhere, start, end 189 '_qtranslate_lang' => 'en', // qtranslatex language data 190 '_wpml_lang' => '', // WPML language 191 'wpml_display_missing_translations' => '', // 'on_main_language'|'on_all_languages'|'off' 192 '_polylang_lang' => '', // Polylang language 193 '_exclude_page_parent_child' => '', // parent page exclusion data (comma separated list) 194 '_taxonomy_group_logic' => 'AND', 195 '_db_force_case' => 'none', 196 '_db_force_utf8_like' => 0, 197 '_db_force_unicode' => 0, 198 '_ajax_search' => false, // Needs to be set explicitly to TRUE in search Ajax Handler class 199 '_no_post_process' => false, // Forcefully turns off post-processing to return RAW results 199 200 200 201 /** 201 202 * Other stuff 202 203 */ 203 '_page_id' => 0, // Current Page ID204 '_page_id' => 0, // Current Page ID 204 205 /** 205 206 * Remaining Limit Modifier … … 207 208 * Overall Limit = LIMIT * _remaining_limit_mod 208 209 */ 209 '_remaining_limit_mod' => 10,210 '_show_more_results' => false, // Show more results feature enabled (only used via ajax search instance)211 'filters_changed' => false, // Only via AJAX - if the filters have been touched by the user212 'filters_initial' => true, // Only via AJAX - if the filters are on the initial state210 '_remaining_limit_mod' => 10, 211 '_show_more_results' => false, // Show more results feature enabled (only used via ajax search instance) 212 'filters_changed' => false, // Only via AJAX - if the filters have been touched by the user 213 'filters_initial' => true, // Only via AJAX - if the filters are on the initial state 213 214 ); 214 215 … … 529 530 } 530 531 531 return $results;532 return is_array( $results ) ? $results : array(); 532 533 } 533 534 -
ajax-search-lite/trunk/includes/classes/search/class-asl-search-cpt.php
r3377501 r3462580 242 242 * If the site language is used, the translation can be non-existent 243 243 */ 244 if ( $site_lang_selected ) { 244 if ( 245 $args['wpml_display_missing_translations'] === 'on_all_languages' || 246 ( $args['wpml_display_missing_translations'] === 'on_main_language' && $site_lang_selected ) 247 ) { 245 248 $wpml_query = ' 246 249 NOT EXISTS ( -
ajax-search-lite/trunk/includes/functions/functions.php
r3377501 r3462580 539 539 * Gets an image from the HTML content 540 540 * 541 * @param string$content542 * @param int$number541 * @param mixed $content 542 * @param mixed $number 543 543 * @param array|string $exclude 544 544 * @return bool|string 545 545 */ 546 function asl_get_image_from_content( string $content, int $number = 0, $exclude = array() ) { 547 if ( $content === '' || !class_exists('domDocument') ) { 546 function asl_get_image_from_content( $content, $number = 0, $exclude = array() ) { 547 if ( !is_string($content) || $content === '' || !class_exists('domDocument') ) { 548 return false; 549 } 550 551 if ( function_exists('mb_encode_numericentity') ) { 552 $encoded_content = mb_encode_numericentity( 553 htmlspecialchars_decode( 554 htmlentities( $content, ENT_NOQUOTES, 'UTF-8', false ), 555 ENT_NOQUOTES 556 ), 557 array( 0x80, 0x10FFFF, 0, ~0 ), 558 'UTF-8' 559 ); 560 } else { 561 $encoded_content = $content; 562 } 563 564 if ( $encoded_content === '' ) { 548 565 return false; 549 566 } … … 564 581 } 565 582 566 $attributes = array( 'src', 'data-src-fg' ); 567 $im = false; 568 569 $dom = new domDocument(); 570 if ( function_exists('libxml_use_internal_errors') ) { 571 libxml_use_internal_errors(true); 572 } 573 574 if ( function_exists('mb_convert_encoding') ) { 575 $dom->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8')); 576 } else { 577 $dom->loadHTML($content); 578 } 579 $dom->preserveWhiteSpace = false; // phpcs:ignore 580 $images = $dom->getElementsByTagName('img'); 581 if ( $images->length > 0 ) { 582 $get = $images->length > $number ? $number : 0; 583 for ( $i =$get;$i <$images->length;$i++ ) { 584 foreach ( $attributes as $att ) { 585 $im = $images->item($i)->getAttribute($att); 586 if ( !empty($im) ) { 587 break; 583 $elements = array( 'img', 'div' ); 584 $attributes = array( 585 'src', 586 'data-src-fg', 587 'data-img', 588 'data-image', 589 'data-thumbnail', 590 'data-thumb', 591 'data-imgsrc', 592 ); 593 $im = ''; 594 595 foreach ( $elements as $element ) { 596 $dom = new domDocument(); 597 /** 598 * The libxml_use_internal_errors & libxml_clear_errors solutions 599 * seem not to work on some servers, so we are stuck using @ operator instead. 600 */ 601 @$dom->loadHTML($encoded_content); // phpcs:ignore 602 $dom->preserveWhiteSpace = false; // phpcs:ignore 603 @$images = $dom->getElementsByTagName($element); // phpcs:ignore 604 if ( $images->length > 0 ) { 605 $get = $images->length > $number ? $number : 0; 606 for ( $i =$get;$i <$images->length;$i++ ) { 607 foreach ( $attributes as $att ) { 608 $im = $images->item($i)->getAttribute($att); 609 if ( !empty($im) ) { 610 break; 611 } 588 612 } 589 }590 foreach ( $exclude as $ex) {591 if ( strpos($im, $ex) !== false ) {592 $im = '';593 continue 2;613 foreach ( $exclude as $ex ) { 614 if ( strpos($im, $ex) !== false ) { 615 $im = ''; 616 continue 2; 617 } 594 618 } 595 } 596 break; 597 } 598 if ( function_exists('libxml_clear_errors') ) { 599 libxml_clear_errors(); 600 } 601 return $im; 602 } else { 603 if ( function_exists('libxml_clear_errors') ) { 604 libxml_clear_errors(); 605 } 606 return false; 607 } 619 break; 620 } 621 if ( $im !== '' ) { 622 return $im; 623 } 624 } 625 } 626 627 // Still no image 628 return false; 608 629 } 609 630 } -
ajax-search-lite/trunk/languages/ajax-search-lite.pot
r3377501 r3462580 1 # Copyright (C) 202 5Ernest Marcinko1 # Copyright (C) 2026 Ernest Marcinko 2 2 # This file is distributed under the GPLv2. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Ajax Search Lite 4.13. 4\n"5 "Project-Id-Version: Ajax Search Lite 4.13.5\n" 6 6 "Report-Msgid-Bugs-To: https://github.com/WPDreams/ajax-search-lite\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: 202 5-10-11T11:40:31+00:00\n"12 "POT-Creation-Date: 2026-02-16T13:21:24+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.1 1.0\n"14 "X-Generator: WP-CLI 2.12.0\n" 15 15 "X-Domain: ajax-search-lite\n" 16 16 … … 67 67 #. translators: Analytics integration docs 68 68 #: backend/analytics.php:112 69 #, php-format 69 70 msgid "To understand how this works, please read the <a href=\"%s\">Analytics Integration Documentation</a>" 70 71 msgstr "" … … 76 77 #. translators: %s: GA docs url 77 78 #: backend/analytics.php:126 79 #, php-format 78 80 msgid "Please read this <a href=\"%s\">google analytics documentation</a> to get your tracking ID." 79 81 msgstr "" … … 117 119 #: backend/analytics.php:300 118 120 #: backend/analytics.php:328 121 #, php-format 119 122 msgid "Usable variables: %s" 120 123 msgstr "" … … 605 608 #. translators: %s: sql docs url 606 609 #: backend/tabs/compatibility/query_options.php:45 610 #, php-format 607 611 msgid "If you have case/diacritic issues then please read the <a href=\"%s\" target=\"_blank\">MySql manual on collations</a> or consult a <b>database expert</b> - those issues should be treated on database level!" 608 612 msgstr "" … … 718 722 msgstr "" 719 723 720 #: backend/tabs/instance/advanced/exclude_results.php:23 724 #: backend/tabs/instance/advanced/exclude_results.php:25 725 msgid "Display items, which have no translations?" 726 msgstr "" 727 728 #: backend/tabs/instance/advanced/exclude_results.php:29 729 msgid "On main language only" 730 msgstr "" 731 732 #: backend/tabs/instance/advanced/exclude_results.php:33 733 msgid "On all languages" 734 msgstr "" 735 736 #: backend/tabs/instance/advanced/exclude_results.php:37 737 msgid "Off" 738 msgstr "" 739 740 #: backend/tabs/instance/advanced/exclude_results.php:48 721 741 msgid "Polylang compatibility" 722 742 msgstr "" 723 743 724 #: backend/tabs/instance/advanced/exclude_results.php: 28744 #: backend/tabs/instance/advanced/exclude_results.php:53 725 745 msgid "WooCommerce related" 726 746 msgstr "" 727 747 728 #: backend/tabs/instance/advanced/exclude_results.php: 31748 #: backend/tabs/instance/advanced/exclude_results.php:56 729 749 msgid "Exclude hidden search WooCommerce products from search?" 730 750 msgstr "" 731 751 732 #: backend/tabs/instance/advanced/exclude_results.php: 33752 #: backend/tabs/instance/advanced/exclude_results.php:58 733 753 msgid "\"Hidden\" in this case means \"Shop only\" or \"Hidden\"" 734 754 msgstr "" 735 755 736 #: backend/tabs/instance/advanced/exclude_results.php: 37756 #: backend/tabs/instance/advanced/exclude_results.php:62 737 757 msgid "Exclude hidden catalog WooCommerce products from search?" 738 758 msgstr "" 739 759 740 #: backend/tabs/instance/advanced/exclude_results.php: 39760 #: backend/tabs/instance/advanced/exclude_results.php:64 741 761 msgid "This case means \"Search results only\"" 742 762 msgstr "" 743 763 744 #: backend/tabs/instance/advanced/exclude_results.php: 43764 #: backend/tabs/instance/advanced/exclude_results.php:68 745 765 msgid "Exclude WooCommerce out of stock products?" 746 766 msgstr "" 747 767 748 #: backend/tabs/instance/advanced/exclude_results.php: 48768 #: backend/tabs/instance/advanced/exclude_results.php:73 749 769 msgid "Exclude results" 750 770 msgstr "" 751 771 752 #: backend/tabs/instance/advanced/exclude_results.php: 51772 #: backend/tabs/instance/advanced/exclude_results.php:76 753 773 msgid "Exclude categories" 754 774 msgstr "" 755 775 756 #: backend/tabs/instance/advanced/exclude_results.php: 58776 #: backend/tabs/instance/advanced/exclude_results.php:83 757 777 msgid "Exclude Posts by ID's (comma separated post ID-s)" 758 778 msgstr "" -
ajax-search-lite/trunk/readme.txt
r3411868 r3462580 6 6 Requires PHP: 7.4 7 7 Tested up to: 6.9 8 Stable tag: 4.13. 48 Stable tag: 4.13.5 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 138 138 139 139 == Changelog == 140 = 4.13.5 = 141 * Added an option to control visibility for WPML non-translated content (display on main language, on all or off) 142 * Greatly improved the image parser by allowing additional data attributes and divs with these data attributes as a potential image source 143 * Fixed a deprecation warning in PHP 8.0+ 144 * Fixed an issue for a potential conflict where a null value could be returned in the get_posts hook 145 * Fixed and issue with the WooCommerce advanced field handler 146 140 147 = 4.13.4 = 141 148 * Added an option to limit the result title length (default 999 characters) -
ajax-search-lite/trunk/src/server/Utils/AdvancedField/Types/AbstractWooCommerceBase.php
r3317715 r3462580 17 17 18 18 private function getProduct( ?stdClass $result ): ?WC_Product { 19 if ( !function_exists('wc_get_product') ) { 20 return null; 21 } 19 22 if ( is_null($result) || !isset($result->post_type) ) { 20 23 return null;
Note: See TracChangeset
for help on using the changeset viewer.