Skip to content

Commit

Permalink
Merge branch 'develop' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeelia committed Apr 19, 2023
2 parents 328c4d3 + 76744bc commit 35bd05f
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 23 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/no-response.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ jobs:
responseRequiredLabel: "reporter feedback" # Label indicating that a response from the original author is required
closeComment: >
This issue has been automatically closed because there has been no response
to our request for more information. With only the
information that is currently in the issue, we don't have enough information
to take action. Please reach out if you have or find the answers we need so
that we can investigate further. See [this blog post on bug reports and the
importance of repro steps](https://www.lee-dohm.com/2015/01/04/writing-good-bug-reports/)
for more information about the kind of information that may be helpful.
to our request for more information in the past 3 days. With only the
information that is currently available, we are unable to take further action on this ticket. Please reach out if you have found or find the answers we need so
that we can investigate further. When the information is ready, you can re-open this ticket to share it with us.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ All notable changes to this project will be documented in this file, per [the Ke
### Security
-->

## [4.5.2] - 2023-04-19

**Note that starting from the ElasticPress 5.0.0 release the `Users` feature will be moved to the [ElasticPress Labs](https://github.com/10up/ElasticPressLabs) plugin. The `Terms` and `Comments` features will remain in ElasticPress but will be available only if enabled via code. Check [our blog post](https://www.elasticpress.io/blog/2023/03/enabling-comments-and-terms-in-elasticpress-5-0) for more info.**

### Added
* New `ep_enable_query_integration_during_indexing` filter. Props [@rebeccahum](https://github.com/rebeccahum) via [#3445](https://github.com/10up/ElasticPress/pull/3445).

### Changed
* Automated message sent in GitHub issues after 3 days of inactivity. Props [@felipeelia](https://github.com/felipeelia) and [@brandwaffle](https://github.com/brandwaffle) via [#3448](https://github.com/10up/ElasticPress/pull/3448).

### Fixed
* Authenticated requests for autosuggest were not being properly cached while using external object cache. Props [@felipeelia](https://github.com/felipeelia) via [#3438](https://github.com/10up/ElasticPress/pull/3438).

## [4.5.1] - 2023-04-11

**Note that starting from the ElasticPress 5.0.0 release the `Users` feature will be moved to the [ElasticPress Labs](https://github.com/10up/ElasticPressLabs) plugin. The `Terms` and `Comments` features will remain in ElasticPress but will be available only if enabled via code. Check [our blog post](https://www.elasticpress.io/blog/2023/03/enabling-comments-and-terms-in-elasticpress-5-0) for more info.**
Expand Down Expand Up @@ -1792,6 +1805,7 @@ This is a bug fix release with some filter additions.
- Initial plugin release

[Unreleased]: https://github.com/10up/ElasticPress/compare/trunk...develop
[4.5.2]: https://github.com/10up/ElasticPress/compare/4.5.1...4.5.2
[4.5.1]: https://github.com/10up/ElasticPress/compare/4.5.0...4.5.1
[4.5.0]: https://github.com/10up/ElasticPress/compare/4.4.1...4.5.0
[4.4.1]: https://github.com/10up/ElasticPress/compare/4.4.0...4.4.1
Expand Down
4 changes: 2 additions & 2 deletions elasticpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: ElasticPress
* Plugin URI: https://github.com/10up/ElasticPress
* Description: A fast and flexible search and query engine for WordPress.
* Version: 4.5.1
* Version: 4.5.2
* Requires at least: 5.6
* Requires PHP: 7.0
* Author: 10up
Expand Down Expand Up @@ -32,7 +32,7 @@
define( 'EP_URL', plugin_dir_url( __FILE__ ) );
define( 'EP_PATH', plugin_dir_path( __FILE__ ) );
define( 'EP_FILE', plugin_basename( __FILE__ ) );
define( 'EP_VERSION', '4.5.1' );
define( 'EP_VERSION', '4.5.2' );

/**
* PSR-4-ish autoloading
Expand Down
2 changes: 1 addition & 1 deletion includes/classes/Feature/Autosuggest/Autosuggest.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ public function intercept_search_request( $response, $query = [], $args = [], $f
// But only fire this if we have object caching as otherwise this comes with a performance penalty.
// If we do not have object caching we cache only one value for 5 minutes in a transient.
if ( wp_using_ext_object_cache() ) {
$cache_key = md5( wp_json_encode( $query['url'] ) . wp_json_encode( $args ) );
$cache_key = md5( wp_json_encode( $query['url'] ) . wp_json_encode( $args['body'] ) );
$request = wp_cache_get( $cache_key, 'ep_autosuggest' );
if ( false === $request ) {
$request = wp_remote_request( $query['url'], $args );
Expand Down
18 changes: 16 additions & 2 deletions includes/classes/Indexable/Comment/QueryIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,25 @@ class QueryIntegration {
/**
* Sets up the appropriate actions and filters.
*
* @param string $indexable_slug Indexable slug. Optional.
*
* @since 3.6.0
*/
public function __construct() {
public function __construct( $indexable_slug = 'comment' ) {
/**
* Filter whether to enable query integration during indexing
*
* @since 4.5.2
* @hook ep_enable_query_integration_during_indexing
*
* @param {bool} $enable To allow query integration during indexing
* @param {string} $indexable_slug Indexable slug
* @return {bool} New value
*/
$allow_query_integration_during_indexing = apply_filters( 'ep_enable_query_integration_during_indexing', false, $indexable_slug );

// Check if we are currently indexing
if ( Utils\is_indexing() ) {
if ( Utils\is_indexing() && ! $allow_query_integration_during_indexing ) {
return;
}

Expand Down
14 changes: 13 additions & 1 deletion includes/classes/Indexable/Post/QueryIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,21 @@ class QueryIntegration {
* @since 3.6.0 Added $indexable_slug
*/
public function __construct( $indexable_slug = 'post' ) {
/**
* Filter whether to enable query integration during indexing
*
* @since 4.5.2
* @hook ep_enable_query_integration_during_indexing
*
* @param {bool} $enable To allow query integration during indexing
* @param {string} $indexable_slug Indexable slug
* @return {bool} New value
*/
$allow_query_integration_during_indexing = apply_filters( 'ep_enable_query_integration_during_indexing', false, $indexable_slug );

// Ensure that we are currently allowing ElasticPress to override the normal WP_Query
// Indexable->is_full_reindexing() is not available at this point yet, so using the IndexHelper version of it.
if ( \ElasticPress\IndexHelper::factory()->is_full_reindexing( $indexable_slug, get_current_blog_id() ) ) {
if ( \ElasticPress\IndexHelper::factory()->is_full_reindexing( $indexable_slug, get_current_blog_id() ) && ! $allow_query_integration_during_indexing ) {
return;
}

Expand Down
14 changes: 13 additions & 1 deletion includes/classes/Indexable/Term/QueryIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,21 @@ class QueryIntegration {
* @since 3.6.0 Added $indexable_slug
*/
public function __construct( $indexable_slug = 'term' ) {
/**
* Filter whether to enable query integration during indexing
*
* @since 4.5.2
* @hook ep_enable_query_integration_during_indexing
*
* @param {bool} $enable To allow query integration during indexing
* @param {string} $indexable_slug Indexable slug
* @return {bool} New value
*/
$allow_query_integration_during_indexing = apply_filters( 'ep_enable_query_integration_during_indexing', false, $indexable_slug );

// Ensure that we are currently allowing ElasticPress to override the normal WP_Query
// Indexable->is_full_reindexing() is not available at this point yet, so using the IndexHelper version of it.
if ( \ElasticPress\IndexHelper::factory()->is_full_reindexing( $indexable_slug, get_current_blog_id() ) ) {
if ( \ElasticPress\IndexHelper::factory()->is_full_reindexing( $indexable_slug, get_current_blog_id() ) && ! $allow_query_integration_during_indexing ) {
return;
}

Expand Down
14 changes: 13 additions & 1 deletion includes/classes/Indexable/User/QueryIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,21 @@ class QueryIntegration {
* @since 3.6.0 Added $indexable_slug
*/
public function __construct( $indexable_slug = 'user' ) {
/**
* Filter whether to enable query integration during indexing
*
* @since 4.5.2
* @hook ep_enable_query_integration_during_indexing
*
* @param {bool} $enable To allow query integration during indexing
* @param {string} $indexable_slug Indexable slug
* @return {bool} New value
*/
$allow_query_integration_during_indexing = apply_filters( 'ep_enable_query_integration_during_indexing', false, $indexable_slug );

// Ensure that we are currently allowing ElasticPress to override the normal WP_Query
// Indexable->is_full_reindexing() is not available at this point yet, so using the IndexHelper version of it.
if ( \ElasticPress\IndexHelper::factory()->is_full_reindexing( $indexable_slug ) ) {
if ( \ElasticPress\IndexHelper::factory()->is_full_reindexing( $indexable_slug ) && ! $allow_query_integration_during_indexing ) {
return;
}

Expand Down
10 changes: 5 additions & 5 deletions lang/elasticpress.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the GPL v2 or later.
msgid ""
msgstr ""
"Project-Id-Version: ElasticPress 4.5.1\n"
"Project-Id-Version: ElasticPress 4.5.2\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/elasticpress\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2023-04-11T16:41:54+00:00\n"
"POT-Creation-Date: 2023-04-19T17:08:47+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.7.1\n"
"X-Domain: elasticpress\n"
Expand Down Expand Up @@ -1432,9 +1432,9 @@ msgstr ""
msgid "Comment"
msgstr ""

#: includes/classes/Indexable/Comment/QueryIntegration.php:126
#: includes/classes/Indexable/Post/QueryIntegration.php:283
#: includes/classes/Indexable/Term/QueryIntegration.php:97
#: includes/classes/Indexable/Comment/QueryIntegration.php:140
#: includes/classes/Indexable/Post/QueryIntegration.php:295
#: includes/classes/Indexable/Term/QueryIntegration.php:109
msgid "sites is deprecated. Use site__in instead."
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "elasticpress",
"version": "4.5.1",
"version": "4.5.2",
"license": "GPL-2.0-or-later",
"description": "A fast and flexible search and query engine for WordPress.",
"devDependencies": {
Expand Down
18 changes: 17 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: 10up, tlovett1, vhauri, tott, oscarssanchez, cmmarslender
Tags: performance, slow, search, elasticsearch, fuzzy, facet, aggregation, searching, autosuggest, suggest, elastic, advanced search, woocommerce, related posts, woocommerce
Tested up to: 6.2
Stable tag: 4.5.1
Stable tag: 4.5.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -77,6 +77,22 @@ For sure! Feel free to submit ideas or feedback in general to our [GitHub repo](

== Changelog ==

= 4.5.2 - 2023-04-19 =

**Note that starting from the ElasticPress 5.0.0 release the `Users` feature will be moved to the [ElasticPress Labs](https://github.com/10up/ElasticPressLabs) plugin. The `Terms` and `Comments` features will remain in ElasticPress but will be available only if enabled via code. Check [our blog post](https://www.elasticpress.io/blog/2023/03/enabling-comments-and-terms-in-elasticpress-5-0) for more info.**

__Added:__

* New `ep_enable_query_integration_during_indexing` filter. Props [@rebeccahum](https://github.com/rebeccahum).

__Changed:__

* Automated message sent in GitHub issues after 3 days of inactivity. Props [@felipeelia](https://github.com/felipeelia) and [@brandwaffle](https://github.com/brandwaffle).

__Fixed:__

* Authenticated requests for autosuggest were not being properly cached while using external object cache. Props [@felipeelia](https://github.com/felipeelia).

= 4.5.1 - 2023-04-11 =

**Note that starting from the ElasticPress 5.0.0 release the `Users` feature will be moved to the [ElasticPress Labs](https://github.com/10up/ElasticPressLabs) plugin. The `Terms` and `Comments` features will remain in ElasticPress but will be available only if enabled via code. Check [our blog post](https://www.elasticpress.io/blog/2023/03/enabling-comments-and-terms-in-elasticpress-5-0) for more info.**
Expand Down

0 comments on commit 35bd05f

Please sign in to comment.