Plugin Directory

Changeset 3462580


Ignore:
Timestamp:
02/16/2026 01:57:34 PM (6 weeks ago)
Author:
wpdreams
Message:

4.13.5 Release

Location:
ajax-search-lite
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • ajax-search-lite/tags/4.13.5/readme.txt

    r3462566 r3462580  
    66Requires PHP: 7.4
    77Tested up to: 6.9
    8 Stable tag: 4.13.4
     8Stable tag: 4.13.5
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    138138
    139139== 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
    140147= 4.13.4 =
    141148* Added an option to limit the result title length (default 999 characters)
  • ajax-search-lite/trunk/ajax-search-lite.php

    r3377501 r3462580  
    44Plugin URI: http://wp-dreams.com
    55Description: The lite version of the most powerful ajax powered search engine for WordPress.
    6 Version: 4.13.4
     6Version: 4.13.5
    77Author: Ernest Marcinko
    88License: GPLv2
     
    3030);
    3131define('ASL_URL_NP', str_replace(array( 'http://', 'https://' ), '//', plugin_dir_url(__FILE__)));
    32 define('ASL_CURRENT_VERSION', 4780);
    33 define('ASL_CURR_VER_STRING', '4.13.4');
     32define('ASL_CURRENT_VERSION', 4781);
     33define('ASL_CURR_VER_STRING', '4.13.5');
    3434define('ASL_DEBUG', 0);
    3535
  • ajax-search-lite/trunk/backend/settings/default_options.php

    r3377501 r3462580  
    9999    // General options
    100100    $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',
    149149
    150150        // 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(
    159159            array(
    160160                'option' => 'Featured image',
     
    187187        ),
    188188
    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,
    198198
    199199        /* 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',
    233233
    234234        // 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;',
    260260
    261261        // Results Layout
    262         'resultstype_def'                => array(
     262        'resultstype_def'                   => array(
    263263            array(
    264264                'option' => 'Vertical Results',
     
    278278            ),
    279279        ),
    280         'resultstype'                    => 'vertical',
    281         'resultsposition_def'            => array(
     280        'resultstype'                       => 'vertical',
     281        'resultsposition_def'               => array(
    282282            array(
    283283                'option' => 'Hover - over content',
     
    289289            ),
    290290        ),
    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'                   => '',
    338338
    339339        // 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',
    346346
    347347        /* 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'                      => '',
    370370        // 'exclude_term_ids' => '',
    371371
    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'                   => '',
    377378
    378379        // 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',
    384385    );
    385386}
  • ajax-search-lite/trunk/backend/tabs/instance/advanced/exclude_results.php

    r3349879 r3462580  
    1717        /** @noinspection PhpUndefinedVariableInspection */
    1818        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        );
    1944        ?>
    2045    </div>
  • ajax-search-lite/trunk/includes/classes/etc/class-asl_helpers.php

    r3367932 r3462580  
    552552                    $sitepress->switch_lang($args['_wpml_lang']);
    553553                }
     554
     555                $args['wpml_display_missing_translations'] = $sd['wpml_display_missing_translations'];
    554556            }
    555557
  • ajax-search-lite/trunk/includes/classes/search/class-asl-query.php

    r3349879 r3462580  
    1313     */
    1414    class ASL_Query {
    15         public $posts;
     15        public $posts = array();
    1616
    1717        /**
     
    3838            // 1. GENERIC arguments
    3939            // ----------------------------------------------------------------
    40             's'                             => '',                  // search query
     40            's'                                 => '',                  // search query
    4141            /**
    4242             *  @param string|array search_type
     
    4949             *      attachments -> file attachments
    5050             */
    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)
     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)
    5858            // ----------------------------------------------------------------
    5959
     
    6161            // 2. POST and CUSTOM POST TYPE related arguments
    6262            // ----------------------------------------------------------------
    63             '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
     63            '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
    6767                // (title, content, excerpt, terms, permalink)
    6868                'title',
     
    7171                'terms',
    7272            ),
    73             '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
     73            '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
    8181                /*
    8282                array(
     
    8888                */
    8989            ),
    90             'post_meta_filter'              => array(      // meta_query support
     90            'post_meta_filter'                  => array(      // meta_query support
    9191                /*
    9292                array(
     
    109109                */
    110110            ),
    111             'post_date_filter'              => array(        // date_query support
     111            'post_date_filter'                  => array(        // date_query support
    112112                /*
    113113                array(
     
    121121                */
    122122            ),
    123             'post_user_filter'              => array(
     123            'post_user_filter'                  => array(
    124124                /*
    125125                'include' => (1, 2, 3, 4),  // include by IDs
     
    127127                */
    128128            ),
    129             '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
     129            '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
    135135            // 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,
    140140            // 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,
    148148            // ----------------------------------------------------------------
    149149
     
    153153            // QUERY FIELDS
    154154            // ----------------------------------------------------------------
    155             'cpt_query'                     => array(
     155            'cpt_query'                         => array(
    156156                'fields'  => '',
    157157                'join'    => '',
     
    167167             * Don't use/override these, unless you know what you are doing.
    168168             */
    169             '_id'                           => -1,
    170             '_o'                            => false,
     169            '_id'                               => -1,
     170            '_o'                                => false,
    171171            // LIMITS
    172             'limit'                         => 0, // overall results limit, if >=0, then evenly distributed between sources
    173             '_limit'                        => 0, // calculated limit based on the previous limit parameter
     172            'limit'                             => 0, // overall results limit, if >=0, then evenly distributed between sources
     173            '_limit'                            => 0, // calculated limit based on the previous limit parameter
    174174            /**
    175175             * _call_num ->
     
    178178             *  This is required to calculate the correct start of the result slicing
    179179             */
    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
    199200
    200201            /**
    201202             * Other stuff
    202203             */
    203             '_page_id'                      => 0,                // Current Page ID
     204            '_page_id'                          => 0,                // Current Page ID
    204205            /**
    205206             * Remaining Limit Modifier
     
    207208             *      Overall Limit = LIMIT * _remaining_limit_mod
    208209             */
    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 user
    212             'filters_initial'               => true,     // Only via AJAX - if the filters are on the initial state
     210            '_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
    213214        );
    214215
     
    529530            }
    530531
    531             return $results;
     532            return is_array( $results ) ? $results : array();
    532533        }
    533534
  • ajax-search-lite/trunk/includes/classes/search/class-asl-search-cpt.php

    r3377501 r3462580  
    242242                 * If the site language is used, the translation can be non-existent
    243243                 */
    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                ) {
    245248                    $wpml_query = '
    246249                    NOT EXISTS (
  • ajax-search-lite/trunk/includes/functions/functions.php

    r3377501 r3462580  
    539539     * Gets an image from the HTML content
    540540     *
    541      * @param string       $content
    542      * @param int          $number
     541     * @param mixed        $content
     542     * @param mixed        $number
    543543     * @param array|string $exclude
    544544     * @return bool|string
    545545     */
    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 === '' ) {
    548565            return false;
    549566        }
     
    564581        }
    565582
    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                        }
    588612                    }
    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                        }
    594618                    }
    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;
    608629    }
    609630}
  • ajax-search-lite/trunk/languages/ajax-search-lite.pot

    r3377501 r3462580  
    1 # Copyright (C) 2025 Ernest Marcinko
     1# Copyright (C) 2026 Ernest Marcinko
    22# This file is distributed under the GPLv2.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Ajax Search Lite 4.13.4\n"
     5"Project-Id-Version: Ajax Search Lite 4.13.5\n"
    66"Report-Msgid-Bugs-To: https://github.com/WPDreams/ajax-search-lite\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-10-11T11:40:31+00:00\n"
     12"POT-Creation-Date: 2026-02-16T13:21:24+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.11.0\n"
     14"X-Generator: WP-CLI 2.12.0\n"
    1515"X-Domain: ajax-search-lite\n"
    1616
     
    6767#. translators: Analytics integration docs
    6868#: backend/analytics.php:112
     69#, php-format
    6970msgid "To understand how this works, please read the <a href=\"%s\">Analytics Integration Documentation</a>"
    7071msgstr ""
     
    7677#. translators: %s: GA docs url
    7778#: backend/analytics.php:126
     79#, php-format
    7880msgid "Please read this <a href=\"%s\">google analytics documentation</a> to get your tracking ID."
    7981msgstr ""
     
    117119#: backend/analytics.php:300
    118120#: backend/analytics.php:328
     121#, php-format
    119122msgid "Usable variables: %s"
    120123msgstr ""
     
    605608#. translators: %s: sql docs url
    606609#: backend/tabs/compatibility/query_options.php:45
     610#, php-format
    607611msgid "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!"
    608612msgstr ""
     
    718722msgstr ""
    719723
    720 #: backend/tabs/instance/advanced/exclude_results.php:23
     724#: backend/tabs/instance/advanced/exclude_results.php:25
     725msgid "Display items, which have no translations?"
     726msgstr ""
     727
     728#: backend/tabs/instance/advanced/exclude_results.php:29
     729msgid "On main language only"
     730msgstr ""
     731
     732#: backend/tabs/instance/advanced/exclude_results.php:33
     733msgid "On all languages"
     734msgstr ""
     735
     736#: backend/tabs/instance/advanced/exclude_results.php:37
     737msgid "Off"
     738msgstr ""
     739
     740#: backend/tabs/instance/advanced/exclude_results.php:48
    721741msgid "Polylang compatibility"
    722742msgstr ""
    723743
    724 #: backend/tabs/instance/advanced/exclude_results.php:28
     744#: backend/tabs/instance/advanced/exclude_results.php:53
    725745msgid "WooCommerce related"
    726746msgstr ""
    727747
    728 #: backend/tabs/instance/advanced/exclude_results.php:31
     748#: backend/tabs/instance/advanced/exclude_results.php:56
    729749msgid "Exclude hidden search WooCommerce products from search?"
    730750msgstr ""
    731751
    732 #: backend/tabs/instance/advanced/exclude_results.php:33
     752#: backend/tabs/instance/advanced/exclude_results.php:58
    733753msgid "\"Hidden\" in this case means \"Shop only\" or \"Hidden\""
    734754msgstr ""
    735755
    736 #: backend/tabs/instance/advanced/exclude_results.php:37
     756#: backend/tabs/instance/advanced/exclude_results.php:62
    737757msgid "Exclude hidden catalog WooCommerce products from search?"
    738758msgstr ""
    739759
    740 #: backend/tabs/instance/advanced/exclude_results.php:39
     760#: backend/tabs/instance/advanced/exclude_results.php:64
    741761msgid "This case means \"Search results only\""
    742762msgstr ""
    743763
    744 #: backend/tabs/instance/advanced/exclude_results.php:43
     764#: backend/tabs/instance/advanced/exclude_results.php:68
    745765msgid "Exclude WooCommerce out of stock products?"
    746766msgstr ""
    747767
    748 #: backend/tabs/instance/advanced/exclude_results.php:48
     768#: backend/tabs/instance/advanced/exclude_results.php:73
    749769msgid "Exclude results"
    750770msgstr ""
    751771
    752 #: backend/tabs/instance/advanced/exclude_results.php:51
     772#: backend/tabs/instance/advanced/exclude_results.php:76
    753773msgid "Exclude categories"
    754774msgstr ""
    755775
    756 #: backend/tabs/instance/advanced/exclude_results.php:58
     776#: backend/tabs/instance/advanced/exclude_results.php:83
    757777msgid "Exclude Posts by ID's (comma separated post ID-s)"
    758778msgstr ""
  • ajax-search-lite/trunk/readme.txt

    r3411868 r3462580  
    66Requires PHP: 7.4
    77Tested up to: 6.9
    8 Stable tag: 4.13.4
     8Stable tag: 4.13.5
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    138138
    139139== 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
    140147= 4.13.4 =
    141148* 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  
    1717
    1818    private function getProduct( ?stdClass $result ): ?WC_Product {
     19        if ( !function_exists('wc_get_product') ) {
     20            return null;
     21        }
    1922        if ( is_null($result) || !isset($result->post_type) ) {
    2023            return null;
Note: See TracChangeset for help on using the changeset viewer.