SearchWP Live Ajax Search - Version 1.6.2

Version Description

  • Limits the arguments passed to the query when used with the WordPress native search.
Download this release

Release Info

Developer pavlo.opanasenko
Plugin Icon 128x128 SearchWP Live Ajax Search
Version 1.6.2
Comparing to
See all releases

Code changes from version 1.6.1 to 1.6.2

includes/class-client.php CHANGED
@@ -103,17 +103,16 @@ class SearchWP_Live_Search_Client extends SearchWP_Live_Search {
103
  );
104
  } else {
105
  // native WordPress search
106
- $args = $_POST;
107
- $args['s'] = $query;
108
- if ( ! isset( $_REQUEST['post_status'] ) ) {
109
- $args['post_status'] = 'publish';
110
- }
111
- if ( ! isset( $_REQUEST['post_type'] ) ) {
112
- $args['post_type'] = get_post_types( array(
113
- 'public' => true,
114
- 'exclude_from_search' => false,
115
- ) );
116
- }
117
  }
118
 
119
  $args['posts_per_page'] = ( isset( $_REQUEST['posts_per_page'] )
103
  );
104
  } else {
105
  // native WordPress search
106
+ $args = array(
107
+ 's' => $query,
108
+ 'post_status' => 'publish',
109
+ 'post_type' => get_post_types(
110
+ array(
111
+ 'public' => true,
112
+ 'exclude_from_search' => false,
113
+ )
114
+ ),
115
+ );
 
116
  }
117
 
118
  $args['posts_per_page'] = ( isset( $_REQUEST['posts_per_page'] )
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: jchristopher
3
  Tags: search, live, ajax
4
  Requires at least: 3.9
5
  Tested up to: 5.9.1
6
- Stable tag: 1.6.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -76,6 +76,9 @@ SearchWP Live Ajax Search uses a filter — <a href="https://searchwp.com/exten
76
 
77
  == Changelog ==
78
 
 
 
 
79
  = 1.6.1 =
80
  * Fixes PHP Notice introduced in 1.6.0
81
 
3
  Tags: search, live, ajax
4
  Requires at least: 3.9
5
  Tested up to: 5.9.1
6
+ Stable tag: 1.6.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
76
 
77
  == Changelog ==
78
 
79
+ = 1.6.2 =
80
+ * Limits the arguments passed to the query when used with the WordPress native search.
81
+
82
  = 1.6.1 =
83
  * Fixes PHP Notice introduced in 1.6.0
84
 
searchwp-live-ajax-search.php CHANGED
@@ -3,14 +3,14 @@
3
  Plugin Name: SearchWP Live Ajax Search
4
  Plugin URI: https://searchwp.com/
5
  Description: Enhance your search forms with live search, powered by SearchWP (if installed)
6
- Version: 1.6.1
7
  Requires PHP: 5.6
8
  Author: SearchWP, LLC
9
  Author URI: https://searchwp.com/
10
  Text Domain: searchwp-live-ajax-search
11
  Tested up to: 5.9.1
12
 
13
- Copyright 2014-2021 SearchWP, LLC
14
 
15
  This program is free software; you can redistribute it and/or
16
  modify it under the terms of the GNU General Public License
@@ -44,7 +44,7 @@ include_once( dirname( __FILE__ ) . '/includes/class-widget.php' );
44
  class SearchWP_Live_Search {
45
  public $dir;
46
  public $url;
47
- public $version = '1.6.1';
48
  public $results = array();
49
 
50
  function __construct() {
@@ -65,7 +65,7 @@ class SearchWP_Live_Search {
65
  return;
66
  }
67
 
68
- if ( version_compare( $this->last_version, '1.6.1', '<' ) ) {
69
  update_option( 'searchwp_live_search_last_update', current_time( 'timestamp' ) );
70
  $this->after_upgrade();
71
  }
3
  Plugin Name: SearchWP Live Ajax Search
4
  Plugin URI: https://searchwp.com/
5
  Description: Enhance your search forms with live search, powered by SearchWP (if installed)
6
+ Version: 1.6.2
7
  Requires PHP: 5.6
8
  Author: SearchWP, LLC
9
  Author URI: https://searchwp.com/
10
  Text Domain: searchwp-live-ajax-search
11
  Tested up to: 5.9.1
12
 
13
+ Copyright 2014-2022 SearchWP, LLC
14
 
15
  This program is free software; you can redistribute it and/or
16
  modify it under the terms of the GNU General Public License
44
  class SearchWP_Live_Search {
45
  public $dir;
46
  public $url;
47
+ public $version = '1.6.2';
48
  public $results = array();
49
 
50
  function __construct() {
65
  return;
66
  }
67
 
68
+ if ( version_compare( $this->last_version, '1.6.2', '<' ) ) {
69
  update_option( 'searchwp_live_search_last_update', current_time( 'timestamp' ) );
70
  $this->after_upgrade();
71
  }