From 647d88b926650ab6bfdbe7211997dd1886ae9cd8 Mon Sep 17 00:00:00 2001 From: Oscar Sanchez S Date: Wed, 16 Mar 2022 15:17:59 -0600 Subject: [PATCH 1/8] Revert "Remove old code that removed nested meta queries" This reverts commit 951110aa706b78ccfd663d24af07b630378e4cac. --- includes/classes/Indexable.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/includes/classes/Indexable.php b/includes/classes/Indexable.php index 6c06bffe54..62c03e00c6 100644 --- a/includes/classes/Indexable.php +++ b/includes/classes/Indexable.php @@ -756,6 +756,30 @@ public function build_meta_query( $meta_queries ) { foreach ( $meta_queries as $single_meta_query ) { + /** + * There is a strange case where meta_query looks like this: + * array( + * "something" => array( + * array( + * 'key' => ... + * ... + * ) + * ) + * ) + * + * Somehow WordPress (WooCommerce) handles that case so we need to as well. + * + * @since 2.1 + */ + if ( is_array( $single_meta_query ) && empty( $single_meta_query['key'] ) ) { + reset( $single_meta_query ); + $first_key = key( $single_meta_query ); + + if ( is_array( $single_meta_query[ $first_key ] ) ) { + $single_meta_query = $single_meta_query[ $first_key ]; + } + } + if ( ! empty( $single_meta_query['key'] ) ) { $terms_obj = false; From 27910d31259ec4dd68c6eb10e7c255d853f23e6a Mon Sep 17 00:00:00 2001 From: Oscar Sanchez S Date: Wed, 16 Mar 2022 16:03:55 -0600 Subject: [PATCH 2/8] Release 4.0.1 --- CHANGELOG.md | 6 ++++++ CREDITS.md | 1 + elasticpress.php | 2 +- package-lock.json | 4 ++-- package.json | 2 +- readme.txt | 9 ++++++++- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de67e521e7..9386dbb69c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file, per [the Ke ## [Unreleased] +## [4.0.1] - 2022-03-16 +**This is a security release. Please update to the latest version of ElasticPress if the WooCommerce + Protected Content features are activated.** + +### Fixed +- Orders belonging to all users loaded in the My Account WooCommerce page. Props [@tomburtless](https://github.com/tomburtless) via [#2658](https://github.com/10up/ElasticPress/pull/2658). + ## [4.0.0] - 2022-03-08 **ElasticPress 4.0 contains some important changes. Make sure to read these highlights before upgrading:** diff --git a/CREDITS.md b/CREDITS.md index 8a2b114b9b..c896235585 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -170,6 +170,7 @@ Thank you to all the people who have already contributed to this repository via [Dian Fishekqi (@dianfishekqi)](https://github.com/dianfishekqi), [@beazuadmin](https://github.com/beazuadmin), [Jonathan Netek](https://www.linkedin.com/in/jonathan-netek/), +[@tomburtless](https://github.com/tomburtless), and [@qazaqstan2025](https://github.com/qazaqstan2025). diff --git a/elasticpress.php b/elasticpress.php index f1634bf9c7..372aeb2a14 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -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.0.0 + * Version: 4.0.1 * Requires at least: 5.6 * Requires PHP: 7.0 * Author: 10up diff --git a/package-lock.json b/package-lock.json index 222c782435..e3c3d32da5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "elasticpress", - "version": "4.0.0", + "version": "4.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "elasticpress", - "version": "4.0.0", + "version": "4.0.1", "license": "GPL-2.0-or-later", "dependencies": { "@10up/component-tooltip": "^2.0.0", diff --git a/package.json b/package.json index 8e90b195a4..4613f0379f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "elasticpress", - "version": "4.0.0", + "version": "4.0.1", "license": "GPL-2.0-or-later", "description": "A fast and flexible search and query engine for WordPress.", "devDependencies": { diff --git a/readme.txt b/readme.txt index ba65f98415..b9103d31b9 100644 --- a/readme.txt +++ b/readme.txt @@ -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: 5.9.1 -Stable tag: 4.0.0 +Stable tag: 4.0.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -51,6 +51,13 @@ Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usag == Changelog == += 4.0.1 - 2022-03-16 = + +**This is a security release. Please update to the latest version of ElasticPress if the WooCommerce + Protected Content features are activated.** + +Fixed: +* Orders belonging to all users loaded in the My Account WooCommerce page. Props [@tomburtless](https://github.com/tomburtless). + = 4.0.0 - 2022-03-08 = **ElasticPress 4.0 contains some important changes. Make sure to read these highlights before upgrading:** From b14a4c2421d6d1da5f5b4e6ac8d7e24e06212471 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 16 Mar 2022 19:09:22 -0300 Subject: [PATCH 3/8] Update props and credits --- CHANGELOG.md | 2 +- CREDITS.md | 2 +- readme.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9386dbb69c..844d404573 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file, per [the Ke **This is a security release. Please update to the latest version of ElasticPress if the WooCommerce + Protected Content features are activated.** ### Fixed -- Orders belonging to all users loaded in the My Account WooCommerce page. Props [@tomburtless](https://github.com/tomburtless) via [#2658](https://github.com/10up/ElasticPress/pull/2658). +- Orders belonging to all users loaded in the My Account WooCommerce page. Props [@tomburtless](https://github.com/tomburtless) and [@oscarssanchez](https://github.com/oscarssanchez) via [#2658](https://github.com/10up/ElasticPress/pull/2658). ## [4.0.0] - 2022-03-08 diff --git a/CREDITS.md b/CREDITS.md index c896235585..98b3a7c76b 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -170,7 +170,7 @@ Thank you to all the people who have already contributed to this repository via [Dian Fishekqi (@dianfishekqi)](https://github.com/dianfishekqi), [@beazuadmin](https://github.com/beazuadmin), [Jonathan Netek](https://www.linkedin.com/in/jonathan-netek/), -[@tomburtless](https://github.com/tomburtless), +[Tom Burtless (@tomburtless)](https://github.com/tomburtless), and [@qazaqstan2025](https://github.com/qazaqstan2025). diff --git a/readme.txt b/readme.txt index b9103d31b9..c9df0fa2aa 100644 --- a/readme.txt +++ b/readme.txt @@ -56,7 +56,7 @@ Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usag **This is a security release. Please update to the latest version of ElasticPress if the WooCommerce + Protected Content features are activated.** Fixed: -* Orders belonging to all users loaded in the My Account WooCommerce page. Props [@tomburtless](https://github.com/tomburtless). +* Orders belonging to all users loaded in the My Account WooCommerce page. Props [@tomburtless](https://github.com/tomburtless) and [@tomburtless](https://github.com/tomburtless) and [@oscarssanchez](https://github.com/oscarssanchez). = 4.0.0 - 2022-03-08 = From bc93186dab1c0369aec75d8361f981d5d87ee0c0 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 16 Mar 2022 19:13:56 -0300 Subject: [PATCH 4/8] Fix credits --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index c9df0fa2aa..11c8f417bc 100644 --- a/readme.txt +++ b/readme.txt @@ -56,7 +56,7 @@ Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usag **This is a security release. Please update to the latest version of ElasticPress if the WooCommerce + Protected Content features are activated.** Fixed: -* Orders belonging to all users loaded in the My Account WooCommerce page. Props [@tomburtless](https://github.com/tomburtless) and [@tomburtless](https://github.com/tomburtless) and [@oscarssanchez](https://github.com/oscarssanchez). +* Orders belonging to all users loaded in the My Account WooCommerce page. Props [@tomburtless](https://github.com/tomburtless) and [@oscarssanchez](https://github.com/oscarssanchez). = 4.0.0 - 2022-03-08 = From d0429952aa3ea8f3fc2fbdf675b77eb0a6c7e693 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 16 Mar 2022 19:15:19 -0300 Subject: [PATCH 5/8] Update version message --- CHANGELOG.md | 2 +- readme.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 844d404573..4d00751afc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file, per [the Ke ## [Unreleased] ## [4.0.1] - 2022-03-16 -**This is a security release. Please update to the latest version of ElasticPress if the WooCommerce + Protected Content features are activated.** +**This is a security release affecting users running ElasticPress 4.0 with both the WooCommerce and Protected Content Features activated. Please update to the latest version of ElasticPress if the WooCommerce and Protected Content features are activated and you're using ElasticPress 4.0.** ### Fixed - Orders belonging to all users loaded in the My Account WooCommerce page. Props [@tomburtless](https://github.com/tomburtless) and [@oscarssanchez](https://github.com/oscarssanchez) via [#2658](https://github.com/10up/ElasticPress/pull/2658). diff --git a/readme.txt b/readme.txt index 11c8f417bc..6a80f45863 100644 --- a/readme.txt +++ b/readme.txt @@ -53,7 +53,7 @@ Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usag = 4.0.1 - 2022-03-16 = -**This is a security release. Please update to the latest version of ElasticPress if the WooCommerce + Protected Content features are activated.** +**This is a security release affecting users running ElasticPress 4.0 with both the WooCommerce and Protected Content Features activated. Please update to the latest version of ElasticPress if the WooCommerce and Protected Content features are activated and you're using ElasticPress 4.0.** Fixed: * Orders belonging to all users loaded in the My Account WooCommerce page. Props [@tomburtless](https://github.com/tomburtless) and [@oscarssanchez](https://github.com/oscarssanchez). From b3421cb93e4091bc7b084dda0cd8448967b046d9 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 16 Mar 2022 19:36:48 -0300 Subject: [PATCH 6/8] List the item as security instead of simply fix --- CHANGELOG.md | 2 +- readme.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d00751afc..1c482f0499 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file, per [the Ke ## [4.0.1] - 2022-03-16 **This is a security release affecting users running ElasticPress 4.0 with both the WooCommerce and Protected Content Features activated. Please update to the latest version of ElasticPress if the WooCommerce and Protected Content features are activated and you're using ElasticPress 4.0.** -### Fixed +### Security - Orders belonging to all users loaded in the My Account WooCommerce page. Props [@tomburtless](https://github.com/tomburtless) and [@oscarssanchez](https://github.com/oscarssanchez) via [#2658](https://github.com/10up/ElasticPress/pull/2658). ## [4.0.0] - 2022-03-08 diff --git a/readme.txt b/readme.txt index 6a80f45863..4acc1984fe 100644 --- a/readme.txt +++ b/readme.txt @@ -55,7 +55,7 @@ Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usag **This is a security release affecting users running ElasticPress 4.0 with both the WooCommerce and Protected Content Features activated. Please update to the latest version of ElasticPress if the WooCommerce and Protected Content features are activated and you're using ElasticPress 4.0.** -Fixed: +Security: * Orders belonging to all users loaded in the My Account WooCommerce page. Props [@tomburtless](https://github.com/tomburtless) and [@oscarssanchez](https://github.com/oscarssanchez). = 4.0.0 - 2022-03-08 = From 30edfbd0f59b57ea40f4e0761997c2a1a0d29adf Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 16 Mar 2022 19:38:14 -0300 Subject: [PATCH 7/8] Update EP_VERSION --- elasticpress.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elasticpress.php b/elasticpress.php index 372aeb2a14..52794f850d 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -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.0.0' ); +define( 'EP_VERSION', '4.0.1' ); /** * PSR-4-ish autoloading From 30c2304dbfcdebca53fa7ff7590d681f8601afa8 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 16 Mar 2022 19:39:24 -0300 Subject: [PATCH 8/8] Add link to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c482f0499..627e0dd379 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1315,6 +1315,7 @@ This is a bug fix release with some filter additions. - Initial plugin release [Unreleased]: https://github.com/10up/ElasticPress/compare/trunk...develop +[4.0.1]: https://github.com/10up/ElasticPress/compare/4.0.0...4.0.1 [4.0.0]: https://github.com/10up/ElasticPress/compare/3.6.6...4.0.0 [3.6.6]: https://github.com/10up/ElasticPress/compare/3.6.5...3.6.6 [4.0.0-beta.1]: https://github.com/10up/ElasticPress/compare/3.6.5...4.0.0-beta.1