Ajax Search Lite - Version 4.7.23

Version Description

  • Exclude posts - input validation (to prevent extra commas at the end)
  • Image parser - now correctly gets the first image from post contents/excerpts, instead of the second
Download this release

Release Info

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

Code changes from version 4.7.22 to 4.7.23

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.22
7
  Author: Ernest Marcinko
8
  Author URI: http://wp-dreams.com
9
  Text Domain: ajax-search-lite
@@ -25,8 +25,8 @@ define(
25
  str_replace('http://', 'https://', plugin_dir_url(__FILE__)) : plugin_dir_url(__FILE__)
26
  );
27
  define('ASL_URL_NP', str_replace(array("http://", "https://"), "//", plugin_dir_url(__FILE__)));
28
- define('ASL_CURRENT_VERSION', 4732);
29
- define('ASL_CURR_VER_STRING', "4.7.22");
30
  define('ASL_DEBUG', 0);
31
  define('ASL_DEMO', get_option('wd_asl_demo', 0) );
32
 
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.23
7
  Author: Ernest Marcinko
8
  Author URI: http://wp-dreams.com
9
  Text Domain: ajax-search-lite
25
  str_replace('http://', 'https://', plugin_dir_url(__FILE__)) : plugin_dir_url(__FILE__)
26
  );
27
  define('ASL_URL_NP', str_replace(array("http://", "https://"), "//", plugin_dir_url(__FILE__)));
28
+ define('ASL_CURRENT_VERSION', 4733);
29
+ define('ASL_CURR_VER_STRING', "4.7.23");
30
  define('ASL_DEBUG', 0);
31
  define('ASL_DEMO', get_option('wd_asl_demo', 0) );
32
 
includes/classes/search/search_content.class.php CHANGED
@@ -440,9 +440,18 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
440
 
441
  /*------------------------ Exclude id's -------------------------*/
442
  if ( isset( $sd['excludeposts'] ) && $sd['excludeposts'] != "" ) {
443
- $exclude_posts = "($wpdb->posts.ID NOT IN (" . $sd['excludeposts'] . "))";
 
 
 
 
 
 
 
 
 
444
  } else {
445
- $exclude_posts = "($wpdb->posts.ID NOT IN (-55))";
446
  }
447
  /*---------------------------------------------------------------*/
448
 
@@ -594,7 +603,7 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
594
  AND $post_statuses
595
  AND $term_query
596
  AND {like_query}
597
- AND $exclude_posts
598
  AND ( $wpml_query )
599
  $polylang_query
600
  {args_where}
@@ -1176,13 +1185,13 @@ if ( ! class_exists( 'wpdreams_searchContent' ) ) {
1176
  $content = $post->content;
1177
  $content = apply_filters('the_content', $content);
1178
 
1179
- $im = wpdreams_get_image_from_content( $content, 1 );
1180
  if ( is_multisite() ) {
1181
  $im = str_replace( home_url(), network_home_url(), $im );
1182
  }
1183
  break;
1184
  case "excerpt":
1185
- $im = wpdreams_get_image_from_content( $post->excerpt, 1 );
1186
  if ( is_multisite() ) {
1187
  $im = str_replace( home_url(), network_home_url(), $im );
1188
  }
440
 
441
  /*------------------------ Exclude id's -------------------------*/
442
  if ( isset( $sd['excludeposts'] ) && $sd['excludeposts'] != "" ) {
443
+ $exclude_post_ids = array_unique(
444
+ explode(',', str_replace(' ', '', $sd['excludeposts']))
445
+ );
446
+ foreach ( $exclude_post_ids as $k=>$v ) {
447
+ if ( $v == '' ) {
448
+ unset($exclude_post_ids[$k]);
449
+ }
450
+ }
451
+ if ( count($exclude_post_ids) > 0 )
452
+ $exclude_posts = " AND ($wpdb->posts.ID NOT IN (" . implode(',', $exclude_post_ids) . "))";
453
  } else {
454
+ $exclude_posts = "";
455
  }
456
  /*---------------------------------------------------------------*/
457
 
603
  AND $post_statuses
604
  AND $term_query
605
  AND {like_query}
606
+ $exclude_posts
607
  AND ( $wpml_query )
608
  $polylang_query
609
  {args_where}
1185
  $content = $post->content;
1186
  $content = apply_filters('the_content', $content);
1187
 
1188
+ $im = wpdreams_get_image_from_content( $content, 0 );
1189
  if ( is_multisite() ) {
1190
  $im = str_replace( home_url(), network_home_url(), $im );
1191
  }
1192
  break;
1193
  case "excerpt":
1194
+ $im = wpdreams_get_image_from_content( $post->excerpt, 0 );
1195
  if ( is_multisite() ) {
1196
  $im = str_replace( home_url(), network_home_url(), $im );
1197
  }
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: 5.0
7
- Stable tag: 4.7.22
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -107,6 +107,10 @@ and will let you know what to do.
107
  2. Administrator area - nice and smooth
108
 
109
  == Changelog ==
 
 
 
 
110
  = 4.7.22 =
111
  * Fixed a rapid return key trigger prevention method
112
 
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: 5.1
7
+ Stable tag: 4.7.23
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
107
  2. Administrator area - nice and smooth
108
 
109
  == Changelog ==
110
+ = 4.7.23 =
111
+ * Exclude posts - input validation (to prevent extra commas at the end)
112
+ * Image parser - now correctly gets the first image from post contents/excerpts, instead of the second
113
+
114
  = 4.7.22 =
115
  * Fixed a rapid return key trigger prevention method
116