Ivory Search – WordPress Search Plugin - Version 4.4.2

Version Description

  • Improved - Ajax search results scrolls with search form.
  • Added - is_search_form_autocomplete filter to remove autocomplete from search field.
  • Added - Retains 'lang' parameter in the search results query string.
  • Fixed - Ivory Search Widget title was not getting removed.
  • Fixed - Database error occurred due to hardcode prefix.
  • Fixed - Search more than 9 terms with OR condition.
  • Fixed - Shortcodes are displaying in the AJAX search results.
  • Fixed - "Search button displays ajax search results" option does not work for the AJAX search form without button.
  • Fixed - AJAX search not working on some mobiles.
Download this release

Release Info

Developer vinod dalvi
Plugin Icon 128x128 Ivory Search – WordPress Search Plugin
Version 4.4.2
Comparing to
See all releases

Code changes from version 4.4.1 to 4.4.2

add-search-to-menu.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Ivory Search
4
  * Plugin URI: https://ivorysearch.com
5
  * Description: The WordPress Search plugin that includes Search Form Customizer, WooCommerce Search, Image Search, Search Shortcode, AJAX Search & Live Search support!
6
- * Version: 4.4.1
7
  * Author: Ivory Search
8
  * Author URI: https://ivorysearch.com/
9
  * License: GPL2+
@@ -106,7 +106,8 @@ final class Ivory_Search {
106
  */
107
  private function define_constants() {
108
 
109
- define( 'IS_VERSION', '4.4.1' );
 
110
  define( 'IS_PLUGIN_FILE', __FILE__ );
111
  define( 'IS_PLUGIN_BASE', plugin_basename( IS_PLUGIN_FILE ) );
112
  define( 'IS_PLUGIN_DIR', plugin_dir_path( IS_PLUGIN_FILE ) );
3
  * Plugin Name: Ivory Search
4
  * Plugin URI: https://ivorysearch.com
5
  * Description: The WordPress Search plugin that includes Search Form Customizer, WooCommerce Search, Image Search, Search Shortcode, AJAX Search & Live Search support!
6
+ * Version: 4.4.2
7
  * Author: Ivory Search
8
  * Author URI: https://ivorysearch.com/
9
  * License: GPL2+
106
  */
107
  private function define_constants() {
108
 
109
+ define( 'IS_VERSION', '4.4.2' );
110
+
111
  define( 'IS_PLUGIN_FILE', __FILE__ );
112
  define( 'IS_PLUGIN_BASE', plugin_basename( IS_PLUGIN_FILE ) );
113
  define( 'IS_PLUGIN_DIR', plugin_dir_path( IS_PLUGIN_FILE ) );
admin/css/ivory-search-admin.css CHANGED
@@ -3,9 +3,9 @@ br {
3
  }
4
 
5
  .title_tooltip {
6
- border: 1px solid #f7e58f;
7
  color: #444;
8
- background: #ffffdf;
9
  box-shadow: 0 2px 3px #999;
10
  position: absolute;
11
  padding: 5px;
3
  }
4
 
5
  .title_tooltip {
6
+ border: 1px solid #e0e0e0;
7
  color: #444;
8
+ background: #FFF;
9
  box-shadow: 0 2px 3px #999;
10
  position: absolute;
11
  padding: 5px;
includes/class-is-search-form.php CHANGED
@@ -432,6 +432,9 @@ class IS_Search_Form {
432
  if ( ! isset( $_includes['post_type_url'] ) && isset( $_includes['post_type'] ) && count( $_includes['post_type'] ) < 2 ) {
433
  $result = preg_replace('/<\/form>/', '<input type="hidden" name="post_type" value="' . reset( $_includes['post_type'] ) . '" /></form>', $result );
434
  }
 
 
 
435
 
436
  $result = apply_filters( 'is_default_search_form', $result );
437
 
@@ -472,7 +475,8 @@ class IS_Search_Form {
472
  $classes = apply_filters( 'is_search_form_classes', $classes );
473
 
474
  $result = '<form '.$data_attrs.' class="is-search-form '. $classes .'" action="' . home_url('/') . '" method="get" role="search" >';
475
- $result .= '<label><input type="text" name="s" value="' . get_search_query() . '" class="is-search-input" placeholder="' . esc_attr( $placeholder_text ) . '" autocomplete="off" />';
 
476
  // AJAX Loader.
477
  if ( isset( $_ajax['enable_ajax'] ) ) {
478
  $loader_image = isset( $settings['loader-image'] ) ? $settings['loader-image'] : IS_PLUGIN_URI . 'public/images/spinner.gif';
@@ -494,6 +498,10 @@ class IS_Search_Form {
494
  if ( ! isset( $_includes['post_type_url'] ) && isset( $_includes['post_type'] ) && count( $_includes['post_type'] ) < 2 ) {
495
  $result .= '<input type="hidden" name="post_type" value="' . reset( $_includes['post_type'] ) . '" />';
496
  }
 
 
 
 
497
  $result .= '</form>';
498
 
499
  $result = apply_filters( 'is_custom_search_form', $result );
432
  if ( ! isset( $_includes['post_type_url'] ) && isset( $_includes['post_type'] ) && count( $_includes['post_type'] ) < 2 ) {
433
  $result = preg_replace('/<\/form>/', '<input type="hidden" name="post_type" value="' . reset( $_includes['post_type'] ) . '" /></form>', $result );
434
  }
435
+ if ( isset( $_GET['lang'] ) ) {
436
+ $result = preg_replace('/<\/form>/', '<input type="hidden" name="lang" value="' . $_GET['lang'] . '" /></form>', $result );
437
+ }
438
 
439
  $result = apply_filters( 'is_default_search_form', $result );
440
 
475
  $classes = apply_filters( 'is_search_form_classes', $classes );
476
 
477
  $result = '<form '.$data_attrs.' class="is-search-form '. $classes .'" action="' . home_url('/') . '" method="get" role="search" >';
478
+ $autocomplete = apply_filters( 'is_search_form_autocomplete', 'autocomplete="off"' );
479
+ $result .= '<label><input type="text" name="s" value="' . get_search_query() . '" class="is-search-input" placeholder="' . esc_attr( $placeholder_text ) . '" '.$autocomplete.' />';
480
  // AJAX Loader.
481
  if ( isset( $_ajax['enable_ajax'] ) ) {
482
  $loader_image = isset( $settings['loader-image'] ) ? $settings['loader-image'] : IS_PLUGIN_URI . 'public/images/spinner.gif';
498
  if ( ! isset( $_includes['post_type_url'] ) && isset( $_includes['post_type'] ) && count( $_includes['post_type'] ) < 2 ) {
499
  $result .= '<input type="hidden" name="post_type" value="' . reset( $_includes['post_type'] ) . '" />';
500
  }
501
+
502
+ if ( isset( $_GET['lang'] ) ) {
503
+ $result .= '<input type="hidden" name="lang" value="' . $_GET['lang'] . '" />';
504
+ }
505
  $result .= '</form>';
506
 
507
  $result = apply_filters( 'is_custom_search_form', $result );
includes/class-is-widget.php CHANGED
@@ -44,7 +44,7 @@ class IS_Widget extends WP_Widget {
44
  * @param array $instance Previously saved values from database.
45
  */
46
  public function form( $instance ) {
47
- $title = ! empty( $instance['title'] ) ? $instance['title'] : esc_html__( 'Ivory Search', 'ivory-search' );
48
  $search_form = ! empty( $instance['search_form'] ) ? $instance['search_form'] : 0;
49
  ?>
50
  <p>
44
  * @param array $instance Previously saved values from database.
45
  */
46
  public function form( $instance ) {
47
+ $title = ! empty( $instance['title'] ) ? $instance['title'] : '';
48
  $search_form = ! empty( $instance['search_form'] ) ? $instance['search_form'] : 0;
49
  ?>
50
  <p>
languages/default.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Ivory Search\n"
4
- "POT-Creation-Date: 2019-09-25 18:58+0530\n"
5
- "PO-Revision-Date: 2019-09-25 18:58+0530\n"
6
  "Last-Translator: \n"
7
  "Language-Team: Ivory Search <admin@ivorysearch.com>\n"
8
  "Language: en_US\n"
@@ -56,7 +56,6 @@ msgstr ""
56
 
57
  #: ../admin/class-is-admin.php:204 ../admin/class-is-admin.php:437
58
  #: ../includes/class-is-admin-public.php:106 ../includes/class-is-widget.php:13
59
- #: ../includes/class-is-widget.php:47
60
  msgid "Ivory Search"
61
  msgstr ""
62
 
@@ -511,7 +510,7 @@ msgid "Enable Search Form Customization"
511
  msgstr ""
512
 
513
  #: ../admin/class-is-editor.php:653 ../admin/class-is-editor.php:1070
514
- #: ../includes/class-is-search-form.php:507
515
  msgid "Customizer"
516
  msgstr ""
517
 
@@ -1125,7 +1124,7 @@ msgstr ""
1125
  #: ../admin/class-is-list-table.php:158
1126
  #: ../admin/class-is-settings-fields.php:334
1127
  #: ../admin/class-is-settings-fields.php:366
1128
- #: ../includes/class-is-search-form.php:503 ../includes/class-is-widget.php:71
1129
  msgid "Edit"
1130
  msgstr ""
1131
 
@@ -1438,7 +1437,7 @@ msgid "Rate Ivory Search"
1438
  msgstr ""
1439
 
1440
  #: ../includes/class-is-admin-public.php:170
1441
- #: ../includes/class-is-search-form.php:445
1442
  msgid "Search..."
1443
  msgstr ""
1444
 
@@ -1447,7 +1446,7 @@ msgid "Text Box Placeholder"
1447
  msgstr ""
1448
 
1449
  #: ../includes/class-is-admin-public.php:183
1450
- #: ../includes/class-is-search-form.php:446
1451
  msgid "Search"
1452
  msgstr ""
1453
 
@@ -1539,14 +1538,14 @@ msgstr ""
1539
  msgid "<i>Categories:</i> "
1540
  msgstr ""
1541
 
1542
- #: ../public/class-is-ajax.php:761
1543
  msgid "In stock"
1544
  msgstr ""
1545
 
1546
- #: ../public/class-is-ajax.php:761
1547
  msgid "Out of stock"
1548
  msgstr ""
1549
 
1550
- #: ../public/class-is-ajax.php:828
1551
  msgid "Sale!"
1552
  msgstr ""
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Ivory Search\n"
4
+ "POT-Creation-Date: 2019-11-22 18:25+0530\n"
5
+ "PO-Revision-Date: 2019-11-22 18:25+0530\n"
6
  "Last-Translator: \n"
7
  "Language-Team: Ivory Search <admin@ivorysearch.com>\n"
8
  "Language: en_US\n"
56
 
57
  #: ../admin/class-is-admin.php:204 ../admin/class-is-admin.php:437
58
  #: ../includes/class-is-admin-public.php:106 ../includes/class-is-widget.php:13
 
59
  msgid "Ivory Search"
60
  msgstr ""
61
 
510
  msgstr ""
511
 
512
  #: ../admin/class-is-editor.php:653 ../admin/class-is-editor.php:1070
513
+ #: ../includes/class-is-search-form.php:515
514
  msgid "Customizer"
515
  msgstr ""
516
 
1124
  #: ../admin/class-is-list-table.php:158
1125
  #: ../admin/class-is-settings-fields.php:334
1126
  #: ../admin/class-is-settings-fields.php:366
1127
+ #: ../includes/class-is-search-form.php:511 ../includes/class-is-widget.php:71
1128
  msgid "Edit"
1129
  msgstr ""
1130
 
1437
  msgstr ""
1438
 
1439
  #: ../includes/class-is-admin-public.php:170
1440
+ #: ../includes/class-is-search-form.php:448
1441
  msgid "Search..."
1442
  msgstr ""
1443
 
1446
  msgstr ""
1447
 
1448
  #: ../includes/class-is-admin-public.php:183
1449
+ #: ../includes/class-is-search-form.php:449
1450
  msgid "Search"
1451
  msgstr ""
1452
 
1538
  msgid "<i>Categories:</i> "
1539
  msgstr ""
1540
 
1541
+ #: ../public/class-is-ajax.php:760
1542
  msgid "In stock"
1543
  msgstr ""
1544
 
1545
+ #: ../public/class-is-ajax.php:760
1546
  msgid "Out of stock"
1547
  msgstr ""
1548
 
1549
+ #: ../public/class-is-ajax.php:827
1550
  msgid "Sale!"
1551
  msgstr ""
public/class-is-ajax.php CHANGED
@@ -729,12 +729,11 @@ class IS_Ajax {
729
  $content = get_the_excerpt( $post->ID );
730
  }
731
 
732
- $content = wp_trim_words( $content, $excerpt_length, '...' );
733
-
734
- // Removes WPBakery plugin shortcodes
735
- $patterns = "/\[[\/]?vc_[^\]]*\]/";
736
  $replacements = "";
737
- $content = preg_replace( $patterns, $replacements, $content );
 
738
  ?>
739
  <div class="is-ajax-result-description">
740
  <?php echo $content; ?>
729
  $content = get_the_excerpt( $post->ID );
730
  }
731
 
732
+ // Removes all shortcodes
733
+ $patterns = "/\[[\/]?[\s\S][^\]]*\]/";
 
 
734
  $replacements = "";
735
+ $content = preg_replace( $patterns, $replacements, $content, -1 );
736
+ $content = wp_trim_words( $content, $excerpt_length, '...' );
737
  ?>
738
  <div class="is-ajax-result-description">
739
  <?php echo $content; ?>
public/class-is-public.php CHANGED
@@ -610,6 +610,10 @@ class IS_Public
610
  if ( empty($q['search_terms']) || is_admin() && !(defined( 'DOING_AJAX' ) && DOING_AJAX) || !isset( $q['_is_includes'] ) ) {
611
  return $search;
612
  // skip processing
 
 
 
 
613
  }
614
 
615
  $terms_relation_type = ( isset( $q['_is_settings']['term_rel'] ) && 'OR' === $q['_is_settings']['term_rel'] ? 'OR' : 'AND' );
@@ -771,7 +775,7 @@ class IS_Public
771
  $search .= " AND ( ";
772
  foreach ( $q['_is_excludes']['tax_query'] as $value ) {
773
  $search .= $AND;
774
- $search .= "( wp_posts.ID NOT IN ( SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id IN ( " . implode( ',', $value ) . ") ) )";
775
  $AND = " AND ";
776
  }
777
  $search .= ")";
610
  if ( empty($q['search_terms']) || is_admin() && !(defined( 'DOING_AJAX' ) && DOING_AJAX) || !isset( $q['_is_includes'] ) ) {
611
  return $search;
612
  // skip processing
613
+ } else {
614
+ if ( is_array( $q['search_terms'] ) && 1 == count( $q['search_terms'] ) ) {
615
+ $q['search_terms'] = explode( ' ', $q['search_terms'][0] );
616
+ }
617
  }
618
 
619
  $terms_relation_type = ( isset( $q['_is_settings']['term_rel'] ) && 'OR' === $q['_is_settings']['term_rel'] ? 'OR' : 'AND' );
775
  $search .= " AND ( ";
776
  foreach ( $q['_is_excludes']['tax_query'] as $value ) {
777
  $search .= $AND;
778
+ $search .= "( {$wpdb->posts}.ID NOT IN ( SELECT {$wpdb->term_relationships}.object_id FROM {$wpdb->term_relationships} WHERE {$wpdb->term_relationships}.term_taxonomy_id IN ( " . implode( ',', $value ) . ") ) )";
779
  $AND = " AND ";
780
  }
781
  $search .= ")";
public/js/ivory-ajax-search.js CHANGED
@@ -70,18 +70,20 @@
70
  });
71
 
72
  $('.is-disable-submit .is-search-submit').on('click', function(event) {
73
- $(this).parent().find('.is-search-input').trigger("keypress");
74
  event.stopPropagation();
75
  event.preventDefault();
76
  return false;
77
  });
78
 
79
- $('.is-ajax-search .is-search-input').on('keyup', function(event) {
80
- if ( 8 === event.which || 46 === event.which || 32 === event.which ) {
81
- $(this).trigger("keypress");
82
- }
 
83
  });
84
 
 
85
  $( document ).on('click', '.is-show-more-results', function(event) {
86
 
87
  $(this).find('.is-show-more-results-text').hide();
@@ -95,7 +97,7 @@
95
  is_ajax_process_request( self, page );
96
  });
97
 
98
- $(window).resize(function(){
99
  $('.is-ajax-search').each(function(index, el) {
100
  var form_id = $( el ).attr( 'data-form-id' );
101
  var pos = $( el ).offset();
@@ -117,11 +119,11 @@
117
  });
118
 
119
  $('.is-ajax-search .is-search-input').on('paste', function() {
120
- $(this).trigger("keypress");
121
  });
122
 
123
  $('.is-ajax-search').each(function(index, el) {
124
- $( el ).find('.is-search-input').on('keypress', function( event ) {
125
  if ( 32 !== event.which ) {
126
  var self = this;
127
  window.clearTimeout( _ref );
@@ -232,7 +234,7 @@
232
  error: function( XMLHttpRequest, textStatus, errorThrown ) {
233
  console.log(XMLHttpRequest.statusText);
234
  if ( 'abort' !== XMLHttpRequest.statusText ) {
235
- alert( "Error occurred" );
236
  }
237
  }
238
  });
70
  });
71
 
72
  $('.is-disable-submit .is-search-submit').on('click', function(event) {
73
+ $(this).parent().find('.is-search-input').trigger("keyup");
74
  event.stopPropagation();
75
  event.preventDefault();
76
  return false;
77
  });
78
 
79
+ $('form.is-disable-submit').on('submit', function(event) {
80
+ $(this).find('.is-search-input').trigger("keyup");
81
+ event.stopPropagation();
82
+ event.preventDefault();
83
+ return false;
84
  });
85
 
86
+
87
  $( document ).on('click', '.is-show-more-results', function(event) {
88
 
89
  $(this).find('.is-show-more-results-text').hide();
97
  is_ajax_process_request( self, page );
98
  });
99
 
100
+ $(window).on('resize scroll', function(){
101
  $('.is-ajax-search').each(function(index, el) {
102
  var form_id = $( el ).attr( 'data-form-id' );
103
  var pos = $( el ).offset();
119
  });
120
 
121
  $('.is-ajax-search .is-search-input').on('paste', function() {
122
+ $(this).trigger("keyup");
123
  });
124
 
125
  $('.is-ajax-search').each(function(index, el) {
126
+ $( el ).find('.is-search-input').on('keyup', function( event ) {
127
  if ( 32 !== event.which ) {
128
  var self = this;
129
  window.clearTimeout( _ref );
234
  error: function( XMLHttpRequest, textStatus, errorThrown ) {
235
  console.log(XMLHttpRequest.statusText);
236
  if ( 'abort' !== XMLHttpRequest.statusText ) {
237
+ console.log( "AJAX request aborted" );
238
  }
239
  }
240
  });
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: search, woocommerce search, image search, ajax search, search shortcode, l
5
  Requires at least: 3.9
6
  Tested up to: 5.3
7
  Requires PHP: 5.2.4
8
- Stable tag: 4.4.1
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -192,6 +192,17 @@ Yes we do. We try our best to help free users with customisation requests and we
192
 
193
  == Changelog ==
194
 
 
 
 
 
 
 
 
 
 
 
 
195
  = 4.4.1 =
196
  * Fixed - Menu search popup was not working in the plugin free version.
197
  * Fixed - Search results text highlight issue.
5
  Requires at least: 3.9
6
  Tested up to: 5.3
7
  Requires PHP: 5.2.4
8
+ Stable tag: 4.4.2
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
192
 
193
  == Changelog ==
194
 
195
+ = 4.4.2 =
196
+ * Improved - Ajax search results scrolls with search form.
197
+ * Added - is_search_form_autocomplete filter to remove autocomplete from search field.
198
+ * Added - Retains 'lang' parameter in the search results query string.
199
+ * Fixed - Ivory Search Widget title was not getting removed.
200
+ * Fixed - Database error occurred due to hardcode prefix.
201
+ * Fixed - Search more than 9 terms with OR condition.
202
+ * Fixed - Shortcodes are displaying in the AJAX search results.
203
+ * Fixed - "Search button displays ajax search results" option does not work for the AJAX search form without button.
204
+ * Fixed - AJAX search not working on some mobiles.
205
+
206
  = 4.4.1 =
207
  * Fixed - Menu search popup was not working in the plugin free version.
208
  * Fixed - Search results text highlight issue.