Skip to content

Commit

Permalink
Merge pull request #189 from alleyinteractive/release/0.5.1
Browse files Browse the repository at this point in the history
Release/0.5.1
  • Loading branch information
mboynes authored Aug 20, 2024
2 parents e2c86d5 + be42d9a commit f817b90
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 5 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ add_filter(
Changelog
---------

### 0.5.1

* Adds `sp_api_request_url` filter to filter the API url.
* Fixes indexing error when using SP_DEBUG
* Fixes possible fatal where 'sp' is set as a query_var but is not an array
* Fixes CLI display of page size when page size is greater than 999

### 0.5

* **POSSIBLE BREAKING CHANGE**: Moves SearchPress integration to the `posts_pre_query`.
Expand Down
2 changes: 1 addition & 1 deletion bin/wp-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public function index( $args, $assoc_args ) {

WP_CLI::log(
sprintf(
'Indexing %1$s, %2$d at a time, starting on page %3$d',
'Indexing %1$s, %2$s at a time, starting on page %3$d',
$limit_text,
number_format( $assoc_args['bulk'] ),
absint( $assoc_args['page'] )
Expand Down
7 changes: 7 additions & 0 deletions lib/class-sp-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,13 @@ public function request( $url = '', $method = 'GET', $body = '', $request_params
'body' => $body,
)
);
/**
* Filters the API URL directly before the request is made.
*
* @param string $url The URL of the request.
* @param array $request_params The request params.
*/
$url = apply_filters( 'sp_api_request_url', $url, $request_params );

$result = sp_remote_request( $url, $request_params );

Expand Down
3 changes: 2 additions & 1 deletion lib/class-sp-debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ public static function split() {
*/
public static function debug_sp_post_pre_index( $data ) {
do_action( 'sp_debug', '[SP_Post] Post JSON', wp_json_encode( $data ) );
return $data;
}
}
add_action( 'sp_debug', array( 'SP_Debug', 'debug' ), 10, 2 );
add_action( 'sp_post_pre_index', array( 'SP_Debug', 'debug_sp_post_pre_index' ), 999 );
add_filter( 'sp_post_pre_index', array( 'SP_Debug', 'debug_sp_post_pre_index' ), 999 );

SP_Debug::init();
2 changes: 1 addition & 1 deletion lib/class-sp-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public function force_search_template( &$wp_query ) {
$this->sp = get_query_var( 'sp' );

// If this is a search, but not a keyword search, we have to fake it.
if ( ! $wp_query->is_search() && ! empty( $this->sp ) && 1 === intval( $this->sp['force'] ) ) {
if ( ! $wp_query->is_search() && isset( $this->sp['force'] ) && 1 === intval( $this->sp['force'] ) ) {
// First, we'll set the search string to something phony.
$wp_query->set( 's', '1441f19754335ca4638bfdf1aea00c6d' );
$wp_query->is_search = true;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "searchpress",
"version": "0.5.0",
"version": "0.5.1",
"main": "Gruntfile.js",
"author": "Matthew Boynes"
}
2 changes: 1 addition & 1 deletion searchpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: SearchPress
* Plugin URI: http://searchpress.org
* Description: Elasticsearch integration for WordPress.
* Version: 0.5
* Version: 0.5.1
* Author: Matthew Boynes, Alley Interactive
* Author URI: https://alley.com
*
Expand Down

0 comments on commit f817b90

Please sign in to comment.