Plugin Directory

Changeset 3377501


Ignore:
Timestamp:
10/13/2025 12:14:39 PM (6 months ago)
Author:
wpdreams
Message:

4.13.4 pre release diff check

Location:
ajax-search-lite/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • ajax-search-lite/trunk/ajax-search-lite.php

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

    r3349879 r3377501  
    7575            <p>Available post types</p><ul id="sortable' . esc_attr(self::$_instancenumber) . '" class="connectedSortable">';
    7676            foreach ( $this->types as $k => $v ) {
    77                 if ( !wd_in_array_r($v, $this->selected) ) {
     77                if ( !wd_in_array_r($k, $this->selected) ) {
    7878                    echo '<li class="ui-state-default ui-left" style="background: #ddd;">
    7979                          <label>' . esc_attr($k) . '</label>
  • ajax-search-lite/trunk/backend/settings/default_options.php

    r3349879 r3377501  
    311311        'close_on_document_click'        => 1,
    312312        'show_close_icon'                => 1,
     313        'post_type_res_title_length'     => 999,
    313314        'showauthor'                     => 0,
    314315        'showdate'                       => 0,
  • ajax-search-lite/trunk/backend/tabs/instance/layout/results_layout.php

    r3349879 r3377501  
    192192<div class="item">
    193193    <?php
     194    new wpdreamsTextSmall('post_type_res_title_length', __('Result title length', 'ajax-search-lite'), $sd['post_type_res_title_length']);
     195    ?>
     196</div>
     197<div class="item">
     198    <?php
    194199    new wpdreamsYesNo('showauthor', __('Show author in results?', 'ajax-search-lite'), $sd['showauthor']);
    195200    ?>
  • ajax-search-lite/trunk/includes/classes/search/class-asl-search-cpt.php

    r3349879 r3377501  
    13781378                }
    13791379
     1380                if ( $r->title !== '' && ( MB::strlen( $r->title ) > intval($sd['post_type_res_title_length']) ) ) {
     1381                    $r->title = wd_substr_at_word($r->title, intval($sd['post_type_res_title_length']));
     1382                }
     1383
    13801384                if ( ! isset( $sd['striptagsexclude'] ) ) {
    13811385                    $sd['striptagsexclude'] = '<a><span>';
  • ajax-search-lite/trunk/includes/functions/functions.php

    r3349879 r3377501  
    33
    44use WPDRMS\ASL\Utils\Polylang\StringTranslations;
     5use WPDRMS\ASL\Utils\Str;
    56
    67if ( !function_exists('w_isset_def') ) {
     
    5657if ( !function_exists('wpdreams_parse_params') ) {
    5758    function wpdreams_parse_params( $params ) {
    58         foreach ( $params as $k =>$v ) {
    59             $_tmp = explode('classname-', $k);
    60             if ( $_tmp !== null && count($_tmp) >1 ) {
    61                 ob_start();
    62                 $c = new $v('0', '0', $params[ $_tmp[1] ]);
    63                 ob_get_clean();
    64                 $params[ 'selected-' . $_tmp[1] ] = $c->getSelected();
    65             }
    66             $_tmp = null;
    67             $_tmp = explode('wpdfont-', $k);
    68             if ( $_tmp !== null && count($_tmp) >1 ) {
    69                 ob_start();
    70                 $c = new $v('0', '0', $params[ $_tmp[1] ]);
    71                 ob_get_clean();
    72                 $params[ 'import-' . $_tmp[1] ] = $c->getImport();
     59        if ( !is_array($params) ) {
     60            return $params;
     61        }
     62        foreach ( $params as $k => $v ) {
     63            $value           = sanitize_text_field(wp_unslash($v));
     64            $allowed_classes = array(
     65                'wpdreamsCategories',
     66                'wpdreamsCustomFields',
     67                'wpdreamsCustomPostTypes',
     68                'wpdreamsCustomPostTypesEditable',
     69            );
     70
     71            if ( str_starts_with($k, 'classname-') && in_array($value, $allowed_classes, true) ) {
     72                $_tmp = explode('classname-', $k);
     73                if ( $_tmp !== null && count($_tmp) > 1 && isset($params[ $_tmp[1] ]) ) {
     74                    ob_start();
     75                    $c = new $value('0', '0', Str::anyToString($params[ $_tmp[1] ]) );
     76                    ob_get_clean();
     77                    $params[ 'selected-' . $_tmp[1] ] = $c->getSelected();
     78                }
    7379            }
    7480        }
     
    453459
    454460if ( !function_exists('wd_substr_at_word') ) {
    455     function wd_substr_at_word( $text, $length ) {
    456         if ( strlen($text) <= $length ) {
     461    /**
     462     * Substring cut off at word endings
     463     *
     464     * @param $text
     465     * @param $length
     466     * @param $suffix
     467     * @param $tolerance
     468     * @return string
     469     */
     470    function wd_substr_at_word( $text, $length, $suffix = ' ...', $tolerance = 8 ) {
     471
     472        if ( function_exists('mb_strlen') &&
     473            function_exists('mb_strrpos') &&
     474            function_exists('mb_substr')
     475        ) {
     476            $fn_strlen  = 'mb_strlen';
     477            $fn_strrpos = 'mb_strrpos';
     478            $fn_substr  = 'mb_substr';
     479        } else {
     480            $fn_strlen  = 'strlen';
     481            $fn_strrpos = 'strrpos';
     482            $fn_substr  = 'substr';
     483        }
     484
     485        if ( $fn_strlen($text) <= $length ) {
    457486            return $text;
    458487        }
    459         $blog_charset = get_bloginfo('charset');
    460         $charset      = $blog_charset !== '' ? $blog_charset : 'UTF-8';
    461         $s            = mb_substr($text, 0, $length, $charset);
    462         return mb_substr($s, 0, strrpos($s, ' '), $charset);
     488
     489        $s = $fn_substr($text, 0, $length);
     490        $s = $fn_substr($s, 0, $fn_strrpos($s, ' '));
     491
     492        // In case of a long mash-up, it will not let overflow the length
     493        if ( $fn_strlen($s) > ( $length + $tolerance ) ) {
     494            $s = $fn_substr($s, 0, ( $length + $tolerance ));
     495        }
     496
     497        if ( $suffix !== '' && $fn_strlen($s) !== $fn_strlen($text) ) {
     498            $s .= $suffix;
     499        }
     500
     501        return $s;
    463502    }
    464503}
  • ajax-search-lite/trunk/includes/views/asl.shortcode.settings.php

    r3349879 r3377501  
    144144                </div>
    145145                <div class="asl_option_label">
    146                     <?php echo esc_attr(asl_icl_t('Search filter for post type: ' . $v[1], $v[1])); ?>
     146                    <?php echo esc_html(asl_icl_t('Search filter for post type: ' . $v[1], $v[1])); ?>
    147147                </div>
    148148            </div>
  • ajax-search-lite/trunk/languages/ajax-search-lite.pot

    r3367932 r3377501  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Ajax Search Lite 4.13.3\n"
     5"Project-Id-Version: Ajax Search Lite 4.13.4\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-09-25T14:47:21+00:00\n"
     12"POT-Creation-Date: 2025-10-11T11:40:31+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.11.0\n"
     
    16301630
    16311631#: backend/tabs/instance/layout/results_layout.php:194
     1632msgid "Result title length"
     1633msgstr ""
     1634
     1635#: backend/tabs/instance/layout/results_layout.php:199
    16321636msgid "Show author in results?"
    16331637msgstr ""
    16341638
    1635 #: backend/tabs/instance/layout/results_layout.php:199
     1639#: backend/tabs/instance/layout/results_layout.php:204
    16361640msgid "Show date in results?"
    16371641msgstr ""
    16381642
    1639 #: backend/tabs/instance/layout/results_layout.php:205
     1643#: backend/tabs/instance/layout/results_layout.php:210
    16401644msgid "Use custom date format?"
    16411645msgstr ""
    16421646
    1643 #: backend/tabs/instance/layout/results_layout.php:214
     1647#: backend/tabs/instance/layout/results_layout.php:219
    16441648msgid " format"
    16451649msgstr ""
    16461650
    1647 #: backend/tabs/instance/layout/results_layout.php:224
     1651#: backend/tabs/instance/layout/results_layout.php:229
    16481652msgid "If turned OFF, it will use WordPress defaults. Default custom value: Y-m-d H:i:s"
    16491653msgstr ""
    16501654
    1651 #: backend/tabs/instance/layout/results_layout.php:229
     1655#: backend/tabs/instance/layout/results_layout.php:234
    16521656msgid "Show description in results?"
    16531657msgstr ""
    16541658
    1655 #: backend/tabs/instance/layout/results_layout.php:234
     1659#: backend/tabs/instance/layout/results_layout.php:239
    16561660msgid "Display the description context?"
    16571661msgstr ""
    16581662
    1659 #: backend/tabs/instance/layout/results_layout.php:235
     1663#: backend/tabs/instance/layout/results_layout.php:240
    16601664msgid " ..depth"
    16611665msgstr ""
    16621666
    1663 #: backend/tabs/instance/layout/results_layout.php:243
     1667#: backend/tabs/instance/layout/results_layout.php:248
    16641668msgid "Will display the description from around the search phrase, not from the beginning."
    16651669msgstr ""
    16661670
    1667 #: backend/tabs/instance/layout/results_layout.php:248
     1671#: backend/tabs/instance/layout/results_layout.php:253
    16681672msgid "Description length"
    16691673msgstr ""
Note: See TracChangeset for help on using the changeset viewer.