Ajax Search Lite - Version 4.7.5

Version Description

  • A category filtering bug fixed
  • Better compatibility with ACF
Download this release

Release Info

Developer wpdreams
Plugin Icon 128x128 Ajax Search Lite
Version 4.7.5
Comparing to
See all releases

Code changes from version 4.7.4 to 4.7.5

ajax-search-lite.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Ajax Search Lite
4
  Plugin URI: http://wp-dreams.com
5
  Description: The lite version of the most powerful ajax powered search engine for WordPress.
6
- Version: 4.7.4
7
  Author: Ernest Marcinko
8
  Author URI: http://wp-dreams.com
9
  Text Domain: ajax-search-lite
@@ -21,8 +21,8 @@ define('ASL_CLASSES_PATH', plugin_dir_path(__FILE__)."/includes/classes/");
21
  define('ASL_FUNCTIONS_PATH', plugin_dir_path(__FILE__)."/includes/functions/");
22
  define('ASL_DIR', 'ajax-search-lite');
23
  define('ASL_URL', plugin_dir_url(__FILE__));
24
- define('ASL_CURRENT_VERSION', 4713);
25
- define('ASL_CURR_VER_STRING', "4.7.4");
26
  define('ASL_DEBUG', 0);
27
  define('ASL_DEMO', get_option('wd_asl_demo', 0) );
28
 
3
  Plugin Name: Ajax Search Lite
4
  Plugin URI: http://wp-dreams.com
5
  Description: The lite version of the most powerful ajax powered search engine for WordPress.
6
+ Version: 4.7.5
7
  Author: Ernest Marcinko
8
  Author URI: http://wp-dreams.com
9
  Text Domain: ajax-search-lite
21
  define('ASL_FUNCTIONS_PATH', plugin_dir_path(__FILE__)."/includes/functions/");
22
  define('ASL_DIR', 'ajax-search-lite');
23
  define('ASL_URL', plugin_dir_url(__FILE__));
24
+ define('ASL_CURRENT_VERSION', 4714);
25
+ define('ASL_CURR_VER_STRING', "4.7.5");
26
  define('ASL_DEBUG', 0);
27
  define('ASL_DEMO', get_option('wd_asl_demo', 0) );
28
 
backend/compatibility.php CHANGED
@@ -83,7 +83,14 @@ if (ASL_DEMO) $_POST = null;
83
 
84
  </fieldset>
85
  <fieldset>
86
- <legend>Database Compatibility</legend>
 
 
 
 
 
 
 
87
 
88
  <p class='infoMsg'>
89
  If you are experiencing issues with accent(diacritic) or case sensitiveness, you can force the search to try these tweaks.<br>
@@ -134,6 +141,7 @@ if (ASL_DEMO) $_POST = null;
134
  "load_mcustom_js" => $_POST['load_mcustom_js'],
135
  "detect_ajax" => $_POST['detect_ajax'],
136
  // Query options
 
137
  "db_force_case" => $_POST['db_force_case'],
138
  "db_force_unicode" => $_POST['db_force_unicode'],
139
  "db_force_utf8_like" => $_POST['db_force_utf8_like']
83
 
84
  </fieldset>
85
  <fieldset>
86
+ <legend>Query Compatibility</legend>
87
+
88
+ <div class="item">
89
+ <?php $o = new wpdreamsYesNo("use_acf_getfield", "<strong>Advacned Custom Fields</strong>: use the ACF get_field() function to get the metadata?",
90
+ $com_options['use_acf_getfield']
91
+ ); ?>
92
+ <p class='descMsg'>Will use the get_field() Advanced Custom Fields function instead of the core get_post_meta()</p>
93
+ </div>
94
 
95
  <p class='infoMsg'>
96
  If you are experiencing issues with accent(diacritic) or case sensitiveness, you can force the search to try these tweaks.<br>
141
  "load_mcustom_js" => $_POST['load_mcustom_js'],
142
  "detect_ajax" => $_POST['detect_ajax'],
143
  // Query options
144
+ 'use_acf_getfield' => $_POST['use_acf_getfield'],
145
  "db_force_case" => $_POST['db_force_case'],
146
  "db_force_unicode" => $_POST['db_force_unicode'],
147
  "db_force_utf8_like" => $_POST['db_force_utf8_like']
backend/settings/default_options.php CHANGED
@@ -29,6 +29,7 @@ function asl_do_init_options() {
29
  'load_mcustom_js' => 'yes',
30
  "detect_ajax" => 0,
31
  // DB
 
32
  'db_force_case' => 'none',
33
  'db_force_unicode' => 0,
34
  'db_force_utf8_like' => 0
29
  'load_mcustom_js' => 'yes',
30
  "detect_ajax" => 0,
31
  // DB
32
+ 'use_acf_getfield' => 0,
33
  'db_force_case' => 'none',
34
  'db_force_unicode' => 0,
35
  'db_force_utf8_like' => 0
includes/classes/search/search_content.class.php CHANGED
@@ -312,22 +312,23 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
312
  ) OR ";
313
  }
314
 
315
- $term_query = "(
316
- $empty_term_query
317
 
318
  $wpdb->posts.ID IN (
319
  SELECT DISTINCT(tr.object_id)
320
  FROM $wpdb->term_relationships AS tr
321
- WHERE
322
- tr.term_taxonomy_id NOT IN ($words)
323
- AND tr.object_id NOT IN (
324
- SELECT DISTINCT(trs.object_id)
325
- FROM $wpdb->term_relationships AS trs
326
- LEFT JOIN $wpdb->term_taxonomy as tts ON (trs.term_taxonomy_id = tts.term_taxonomy_id AND tts.taxonomy = 'category')
327
- WHERE trs.term_taxonomy_id IN ($words)
328
- )
329
- )
330
- )";
 
331
  } else {
332
  $term_query = "( $wpdb->posts.ID IN ( SELECT DISTINCT(tr.object_id) FROM wp_term_relationships AS tr WHERE tr.term_taxonomy_id IN ($words) ) )";
333
  }
@@ -560,6 +561,7 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
560
  }
561
 
562
  $performance_options = get_option('asl_performance');
 
563
 
564
  if ( is_multisite() ) {
565
  $home_url = network_home_url();
@@ -639,23 +641,35 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
639
  }
640
  break;
641
  case 'c__f':
642
- if ( $sd['titlefield_cf'] == '' ) {
643
- $r->title = get_the_title( $r->id );
644
- } else {
645
- $mykey_values = get_post_custom_values( $sd['titlefield_cf'], $r->id );
646
- if ( isset( $mykey_values[0] ) ) {
647
- $r->title = $mykey_values[0];
648
- } else {
649
- $r->title = get_the_title( $r->id );
650
- }
 
 
 
 
 
 
 
 
 
 
 
 
651
  }
652
- break;
653
  default:
654
  if ( isset($wc_prod_var_o) ) {
655
  $r->title = $wc_prod_var_o->get_title();
656
  } else {
657
  $r->title = get_the_title($r->id);
658
  }
 
659
  }
660
 
661
  if ( ! isset( $sd['striptagsexclude'] ) ) {
@@ -663,28 +677,39 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
663
  }
664
 
665
  switch ($sd['descriptionfield']) {
666
- case '1':
667
- if ( function_exists( 'qtranxf_use' ) ) {
668
- global $q_config;
669
- $r->excerpt = qtranxf_use($q_config['default_language'], $r->excerpt, false);
670
- }
671
- $_content = strip_tags( $r->excerpt, $sd['striptagsexclude'] );
672
- break;
673
- case '2':
674
- $_content = strip_tags( get_the_title( $r->id ), $sd['striptagsexclude'] );
675
- break;
676
- case 'c__f':
677
- if ( $sd['descriptionfield_cf'] == '' ) {
678
- $_content = '';
679
- } else {
680
- $mykey_values = get_post_custom_values($sd['descriptionfield_cf'], $r->id);
681
- if (isset($mykey_values[0])) {
682
- $_content = strip_tags($mykey_values[0], $sd['striptagsexclude']);
683
- } else {
684
- $_content = '';
685
- }
686
- }
687
- break;
 
 
 
 
 
 
 
 
 
 
 
688
  default: //including option '0', alias content
689
  if ( function_exists( 'qtranxf_use' ) ) {
690
  global $q_config;
312
  ) OR ";
313
  }
314
 
315
+ $term_query = " (
316
+ $empty_term_query
317
 
318
  $wpdb->posts.ID IN (
319
  SELECT DISTINCT(tr.object_id)
320
  FROM $wpdb->term_relationships AS tr
321
+ LEFT JOIN $wpdb->term_taxonomy as tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = 'category')
322
+ WHERE
323
+ tt.term_id NOT IN ($words)
324
+ AND tr.object_id NOT IN (
325
+ SELECT DISTINCT(trs.object_id)
326
+ FROM $wpdb->term_relationships AS trs
327
+ LEFT JOIN $wpdb->term_taxonomy as tts ON (trs.term_taxonomy_id = tts.term_taxonomy_id AND tts.taxonomy = 'category')
328
+ WHERE tts.term_id IN ($words)
329
+ )
330
+ )
331
+ )";
332
  } else {
333
  $term_query = "( $wpdb->posts.ID IN ( SELECT DISTINCT(tr.object_id) FROM wp_term_relationships AS tr WHERE tr.term_taxonomy_id IN ($words) ) )";
334
  }
561
  }
562
 
563
  $performance_options = get_option('asl_performance');
564
+ $comp_options = wd_asl()->o['asl_compatibility'];
565
 
566
  if ( is_multisite() ) {
567
  $home_url = network_home_url();
641
  }
642
  break;
643
  case 'c__f':
644
+ if ( $sd['titlefield_cf'] != '' ) {
645
+ if ( $comp_options['use_acf_getfield'] == 1 && function_exists('get_field') ) {
646
+ $mykey_values = get_field($sd['titlefield_cf'], $r->id, true);
647
+ if (!is_null($mykey_values) && $mykey_values != '' && $mykey_values !== false ) {
648
+ if (is_array($mykey_values)) {
649
+ if (!is_object($mykey_values[0])) {
650
+ $r->title = implode(', ', $mykey_values);
651
+ break;
652
+ }
653
+ } else {
654
+ $r->title = $mykey_values;
655
+ break;
656
+ }
657
+ }
658
+ } else {
659
+ $mykey_values = get_post_custom_values($sd['titlefield_cf'], $r->id);
660
+ if (isset($mykey_values[0])) {
661
+ $r->title = $mykey_values[0];
662
+ break;
663
+ }
664
+ }
665
  }
 
666
  default:
667
  if ( isset($wc_prod_var_o) ) {
668
  $r->title = $wc_prod_var_o->get_title();
669
  } else {
670
  $r->title = get_the_title($r->id);
671
  }
672
+ break;
673
  }
674
 
675
  if ( ! isset( $sd['striptagsexclude'] ) ) {
677
  }
678
 
679
  switch ($sd['descriptionfield']) {
680
+ case '1':
681
+ if (function_exists('qtranxf_use')) {
682
+ global $q_config;
683
+ $r->excerpt = qtranxf_use($q_config['default_language'], $r->excerpt, false);
684
+ }
685
+ $_content = strip_tags($r->excerpt, $sd['striptagsexclude']);
686
+ break;
687
+ case '2':
688
+ $_content = strip_tags(get_the_title($r->id), $sd['striptagsexclude']);
689
+ break;
690
+ case 'c__f':
691
+ if ($sd['descriptionfield_cf'] != '') {
692
+ if ($comp_options['use_acf_getfield'] == 1 && function_exists('get_field')) {
693
+ $mykey_values = get_field($sd['descriptionfield_cf'], $r->id, true);
694
+ if (!is_null($mykey_values) && $mykey_values != '' && $mykey_values !== false ) {
695
+ if ( is_array($mykey_values) ) {
696
+ if ( !is_object($mykey_values[0]) ) {
697
+ $_content = implode(', ', $mykey_values);
698
+ break;
699
+ }
700
+ } else {
701
+ $_content = $mykey_values;
702
+ break;
703
+ }
704
+ }
705
+ } else {
706
+ $mykey_values = get_post_custom_values($sd['descriptionfield_cf'], $r->id);
707
+ if (isset($mykey_values[0])) {
708
+ $_content = strip_tags($mykey_values[0], $sd['striptagsexclude']);
709
+ break;
710
+ }
711
+ }
712
+ }
713
  default: //including option '0', alias content
714
  if ( function_exists( 'qtranxf_use' ) ) {
715
  global $q_config;
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: wpdreams
3
  Donate link: http://wp-dreams.com
4
  Tags: search, better wordpress search, search plugin, relevance search, widget, Post, ajax search, search filter, wp ajax search, custom fields search, better search, ajax search plugin, wp search, wp search plugin, filter, relevant search plugin, wordpress search, Live Search, shortcode, google, autocomplete, suggest, woocommerce, woocommerce search, product, product search, custom search, ajax, suggest, autosuggest, search autocomplete, live, plugin, sidebar, product tag search, products, woocommerce tag search, WooCommerce Plugin, shop, search by sku, relevant search, highlight, term, image, custom search, ecommerce, Predictive Search, search product, shop, typehead, suggest, instant-search
5
  Requires at least: 3.5
6
- Tested up to: 4.7
7
- Stable tag: 4.7.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -106,6 +106,10 @@ and will let you know what to do.
106
 
107
  == Changelog ==
108
 
 
 
 
 
109
  = 4.7.4 =
110
  * Clicking on the input or on empty character input the plugin will open the latest successful result list
111
  * Empty space bar trigger fix
3
  Donate link: http://wp-dreams.com
4
  Tags: search, better wordpress search, search plugin, relevance search, widget, Post, ajax search, search filter, wp ajax search, custom fields search, better search, ajax search plugin, wp search, wp search plugin, filter, relevant search plugin, wordpress search, Live Search, shortcode, google, autocomplete, suggest, woocommerce, woocommerce search, product, product search, custom search, ajax, suggest, autosuggest, search autocomplete, live, plugin, sidebar, product tag search, products, woocommerce tag search, WooCommerce Plugin, shop, search by sku, relevant search, highlight, term, image, custom search, ecommerce, Predictive Search, search product, shop, typehead, suggest, instant-search
5
  Requires at least: 3.5
6
+ Tested up to: 4.8
7
+ Stable tag: 4.7.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
106
 
107
  == Changelog ==
108
 
109
+ = 4.7.5 =
110
+ * A category filtering bug fixed
111
+ * Better compatibility with ACF
112
+
113
  = 4.7.4 =
114
  * Clicking on the input or on empty character input the plugin will open the latest successful result list
115
  * Empty space bar trigger fix