Skip to content

Commit 5f4eb39

Browse files
authored
Merge pull request #3717 from 10up/release/5.0.0
[Release] Version 5.0.0
2 parents 47aa554 + c1bca99 commit 5f4eb39

File tree

14 files changed

+1236
-602
lines changed

14 files changed

+1236
-602
lines changed

Diff for: .wordpress-org/screenshot-1.png

-35.6 KB
Loading

Diff for: .wordpress-org/screenshot-2.png

39.3 KB
Loading

Diff for: .wordpress-org/screenshot-3.png

6.1 KB
Loading

Diff for: CHANGELOG.md

+78
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,83 @@ All notable changes to this project will be documented in this file, per [the Ke
1313
### Security
1414
-->
1515

16+
## [5.0.0] - 2023-11-01
17+
18+
**ElasticPress 5.0.0 contains some important changes. Make sure to read these highlights before upgrading:**
19+
- This version does not require a full reindex but it is recommended, especially for websites using synonyms containing spaces. See [#3610](https://.github.com/10up/ElasticPress/pull/3610).
20+
- Meta keys are not indexed by default anymore. The new Weighting Dashboard allows admin users to mark meta fields as indexables. The new `ep_prepare_meta_allowed_keys` filter allows to add meta keys programmatically. See [#3068](https://github.com/10up/ElasticPress/pull/3068).
21+
- Features now have their fields declared in JSON. Custom features may need to implement the `set_settings_schema()` method to work. See [#3655](https://github.com/10up/ElasticPress/pull/3655).
22+
- The `Users` feature was moved to the [ElasticPress Labs](https://github.com/10up/ElasticPressLabs) plugin and is no longer available in this plugin. If you use this feature, make sure to install and configure EP Labs before upgrading. See [#3670](https://github.com/10up/ElasticPress/pull/3670).
23+
- The `Terms` and `Comments` features are now hidden by default for sites that do not have them active yet. Check [our blog post](https://www.elasticpress.io/blog/2023/03/enabling-comments-and-terms-in-elasticpress-5-0) for more info. See [#3691](https://github.com/10up/ElasticPress/pull/3691).
24+
- New minimum versions (see [#3668](https://github.com/10up/ElasticPress/pull/3668)) are:
25+
||Min|Max|
26+
|---|:---:|:---:|
27+
|Elasticsearch|5.2|Unset|
28+
|WordPress|6.0+|latest|
29+
|PHP|7.4+|latest|
30+
31+
### Added
32+
* New Sync page. Props [@JakePT](https://github.com/JakePT), [@felipeelia](https://github.com/felipeelia), [@apurvrdx1](https://github.com/apurvrdx1), [@brandwaffle](https://github.com/brandwaffle), [@anjulahettige](https://github.com/anjulahettige), [@burhandodhy](https://github.com/burhandodhy), and [@MARQAS](https://github.com/MARQAS) via [#3657](https://github.com/10up/ElasticPress/pull/3657) and [#3735](https://github.com/10up/ElasticPress/pull/3735).
33+
* New feature settings screen. Props [@JakePT](https://github.com/JakePT), [@felipeelia](https://github.com/felipeelia), [@apurvrdx1](https://github.com/apurvrdx1), [@brandwaffle](https://github.com/brandwaffle), and [@anjulahettige](https://github.com/anjulahettige) via [#3712](https://github.com/10up/ElasticPress/pull/3712).
34+
* New weighting dashboard with support for making meta fields searchable. Props [@JakePT](https://github.com/JakePT), [@mehidi258](https://github.com/mehidi258), and [@felipeelia](https://github.com/felipeelia) via [#3068](https://github.com/10up/ElasticPress/pull/3068).
35+
* New Date Filter Block. Props [@burhandodhy](https://github.com/burhandodhy), [@JakePT](https://github.com/JakePT), and [@felipeelia](https://github.com/felipeelia) via [#3700](https://github.com/10up/ElasticPress/pull/3700).
36+
* Sync history to the Sync page. Props [@JakePT](https://github.com/JakePT), [@felipeelia](https://github.com/felipeelia), [@apurvrdx1](https://github.com/apurvrdx1), [@brandwaffle](https://github.com/brandwaffle), and [@anjulahettige](https://github.com/anjulahettige) via [#3664](https://github.com/10up/ElasticPress/pull/3664).
37+
* Final status of syncs (success, with errors, failed, or aborted.) Props [@felipeelia](https://github.com/felipeelia) and [@JakePT](https://github.com/JakePT) via [#3669](https://github.com/10up/ElasticPress/pull/3669).
38+
* REST API endpoint at `elasticpress/v1/features` for updating feature settings. Props [@JakePT](https://github.com/JakePT) via [#3676](https://github.com/10up/ElasticPress/pull/3676).
39+
* New `ElasticsearchErrorInterpreter` class. Props [@felipeelia](https://github.com/felipeelia) via [#3661](https://github.com/10up/ElasticPress/pull/3661).
40+
* New `default_search` analyzer to differentiate what is applied during sync and search time. Props [@felipeelia](https://github.com/felipeelia) and [@MARQAS](https://github.com/MARQAS) via [#3610](https://github.com/10up/ElasticPress/pull/3610) and [#3703](https://github.com/10up/ElasticPress/pull/3703).
41+
* The sync page now describes what triggered the current sync, and previous syncs. Props [@JakePT](https://github.com/JakePT) via [#3722](https://github.com/10up/ElasticPress/pull/3722).
42+
* Weighting and Synonyms Dashboards to multisites. Props [@felipeelia](https://github.com/felipeelia) via [#3724](https://github.com/10up/ElasticPress/pull/3724).
43+
* No-cache headers to sync calls. Props [@felipeelia](https://github.com/felipeelia) via [#3731](https://github.com/10up/ElasticPress/pull/3731).
44+
45+
### Changed
46+
* Abstracted Sync page logic into a provider pattern. Props [@JakePT](https://github.com/JakePT) via [#3630](https://github.com/10up/ElasticPress/pull/3630).
47+
* Moved syncing from an `admin-ajax.php` callback to a custom REST API endpoint with support for additional arguments. Props [@JakePT](https://github.com/JakePT) via [#3643](https://github.com/10up/ElasticPress/pull/3643).
48+
* Store previous syncs info, changed option name from `ep_last_index` to `ep_sync_history`. Props [@felipeelia](https://github.com/felipeelia) and [@JakePT](https://github.com/JakePT) via [#3647](https://github.com/10up/ElasticPress/pull/3647).
49+
* Features settings declared as JSON. Props [@felipeelia](https://github.com/felipeelia) and [@JakePT](https://github.com/JakePT) via [#3655](https://github.com/10up/ElasticPress/pull/3655).
50+
* Tweaked layout and notifications style on the Status Report screen for consistency with the updated Sync page. Props [@JakePT](https://github.com/JakePT) via [#3662](https://github.com/10up/ElasticPress/pull/3662).
51+
* Moved REST API endpoint definitions to controller classes. Props [@JakePT](https://github.com/JakePT) via [#3650](https://github.com/10up/ElasticPress/pull/3650).
52+
* SyncManager array queues are now indexed by the blog ID. Props [@sathyapulse](https://github.com/sathyapulse) and [@felipeelia](https://github.com/felipeelia) via [#3689](https://github.com/10up/ElasticPress/pull/3689).
53+
* Comments and Terms are now hidden by default. Props [@felipeelia](https://github.com/felipeelia) via [#3691](https://github.com/10up/ElasticPress/pull/3691).
54+
* WooCommerce-related hooks are now removed when switching to a site that does not have WC active. Props [@felipeelia](https://github.com/felipeelia) and [@MARQAS](https://github.com/MARQAS) via [#3688](https://github.com/10up/ElasticPress/pull/3688).
55+
* Run e2e tests against the minimum supported WordPress version. Props [@felipeelia](https://github.com/felipeelia) via [#3540](https://github.com/10up/ElasticPress/pull/3540).
56+
* Several tweaks in the Features settings API. Props [@JakePT](https://github.com/JakePT) via [#3708](https://github.com/10up/ElasticPress/pull/3708) and [#3709](https://github.com/10up/ElasticPress/pull/3709).
57+
* EP Settings are now reverted if it is not possible to connect to the new ES Server. Props [@felipeelia](https://github.com/felipeelia), [@burhandodhy](https://github.com/burhandodhy), and [@scottbuscemi](https://github.com/scottbuscemi) via [#3684](https://github.com/10up/ElasticPress/pull/3684).
58+
* Node packages updated. Props [@felipeelia](https://github.com/felipeelia) via [#3706](https://github.com/10up/ElasticPress/pull/3706).
59+
* Updated the labels of feature settings and options for consistency and clarity. Props [@JakePT](https://github.com/JakePT) via [#3721](https://github.com/10up/ElasticPress/pull/3721).
60+
* Depending on the requirements, some feature settings are now saved to be applied after a full sync. Props [@felipeelia](https://github.com/felipeelia) and [@JakePT](https://github.com/JakePT) via [#3720](https://github.com/10up/ElasticPress/pull/3720).
61+
* Minimum requirements. Props [@felipeelia](https://github.com/felipeelia) and [@brandwaffle](https://github.com/brandwaffle) via [#3668](https://github.com/10up/ElasticPress/pull/3668).
62+
* Old features will have their settings displayed based on their default setting values. Props [@felipeelia](https://github.com/felipeelia) and [@JakePT](https://github.com/JakePT) via [#3728](https://github.com/10up/ElasticPress/pull/3728).
63+
* Radio and checkbox settings were changed from booleans to strings. Props [@felipeelia](https://github.com/felipeelia) and [@JakePT](https://github.com/JakePT) via [#3730](https://github.com/10up/ElasticPress/pull/3730).
64+
* The troubleshooting article link was updated. Props [@felipeelia](https://github.com/felipeelia) and [@anjulahettige](https://github.com/anjulahettige) via [#3748](https://github.com/10up/ElasticPress/pull/3748).
65+
66+
### Deprecated
67+
* The `IndexHelper::get_last_index` method was replaced by `IndexHelper::get_last_sync`. See [#3647](https://github.com/10up/ElasticPress/pull/3647).
68+
* The `FailedQueries::maybe_suggest_solution_for_es` method was replaced by `ElasticsearchErrorInterpreter::maybe_suggest_solution_for_es`. See [#3661](https://github.com/10up/ElasticPress/pull/3661).
69+
* `Weighting::render_settings_section`, `Weighting::handle_save`, `Weighting::redirect`, and `Weighting::save_weighting_configuration` were deprecated in favor of React components. See [#3068](https://github.com/10up/ElasticPress/pull/3068).
70+
71+
### Removed
72+
* Users-related files from the main plugin. Props [@felipeelia](https://github.com/felipeelia) via [#3670](https://github.com/10up/ElasticPress/pull/3670).
73+
* Removed mapping files related to older versions of Elasticsearch. Props [@MARQAS](https://github.com/MARQAS) via [#3704](https://github.com/10up/ElasticPress/pull/3704).
74+
75+
### Fixed
76+
* Docblock for the `ep_facet_renderer_class` filter. Props [@misfist](https://github.com/misfist) via [#3696](https://github.com/10up/ElasticPress/pull/3696).
77+
* Instant Results console warning. Props [@burhandodhy](https://github.com/burhandodhy) via [#3687](https://github.com/10up/ElasticPress/pull/3687).
78+
* Total fields limit message interpretation. Props [@felipeelia](https://github.com/felipeelia) [@JakePT](https://github.com/JakePT) via [#3702](https://github.com/10up/ElasticPress/pull/3702).
79+
* End to end tests intermittent failures. Props [@felipeelia](https://github.com/felipeelia) via [#3572](https://github.com/10up/ElasticPress/pull/3572).
80+
* React warning on Sync page. Props [@burhandodhy](https://github.com/burhandodhy) via [#3718](https://github.com/10up/ElasticPress/pull/3718).
81+
* Content was not showing properly on the tooltop on install page. Props [@burhandodhy](https://github.com/burhandodhy) via [#3725](https://github.com/10up/ElasticPress/pull/3725).
82+
* Redirect to correct sync url after enabling feature that requires a new sync. Props [@burhandodhy](https://github.com/burhandodhy) via [#3726](https://github.com/10up/ElasticPress/pull/3726).
83+
* Post type setting wasn't respected during sync. Props [@burhandodhy](https://github.com/burhandodhy) via [#3727](https://github.com/10up/ElasticPress/pull/3727).
84+
* Fix a JS error appearing when sync requests are intentionally stopped. Props [@burhandodhy](https://github.com/burhandodhy) via [#3736](https://github.com/10up/ElasticPress/pull/3736).
85+
* Features description copy. Props [@felipeelia](https://github.com/felipeelia), [@burhandodhy](https://github.com/burhandodhy), and [@MARQAS](https://github.com/MARQAS) via [#3737](https://github.com/10up/ElasticPress/pull/3737).
86+
* Endpoint URL field is not a URL type field. Props [@burhandodhy](https://github.com/burhandodhy) via [#3733](https://github.com/10up/ElasticPress/pull/3733).
87+
* WooCommerce feature not autoactivating. Props [@felipeelia](https://github.com/felipeelia) via [#3739](https://github.com/10up/ElasticPress/pull/3739).
88+
* Elasticsearch errors interpretation. Props [@felipeelia](https://github.com/felipeelia) via [#3741](https://github.com/10up/ElasticPress/pull/3741).
89+
* Deactivating a feature via WP-CLI also takes into account draft states. Props [@felipeelia](https://github.com/felipeelia) via [#3749](https://github.com/10up/ElasticPress/pull/3749).
90+
91+
### Security
92+
1693
## [4.7.2] - 2023-10-10
1794

1895
**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.**
@@ -1955,6 +2032,7 @@ This is a bug fix release with some filter additions.
19552032
- Initial plugin release
19562033

19572034
[Unreleased]: https://github.com/10up/ElasticPress/compare/trunk...develop
2035+
[5.0.0]: https://github.com/10up/ElasticPress/compare/4.7.2...5.0.0
19582036
[4.7.2]: https://github.com/10up/ElasticPress/compare/4.7.1...4.7.2
19592037
[4.7.1]: https://github.com/10up/ElasticPress/compare/4.7.0...4.7.1
19602038
[4.7.0]: https://github.com/10up/ElasticPress/compare/4.6.1...4.7.0

Diff for: CREDITS.md

+12-9
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,18 @@ Thank you to all the people who have already contributed to this repository via
211211
[Mayank Chugh (@iamchughmayank)](https://github.com/iamchughmayank),
212212
[Boyan Bratvanov (@bratvanov)](https://github.com/bratvanov),
213213
[Alexander Z (@TorlockC)](https://github.com/TorlockC),
214-
[Nabi (@navidabdi)](https://github.com/navidabdi)
215-
[Dmitry Seleznyov (@selim13)](https://github.com/selim13)
216-
[Martin Widmann (@mwidmann)](https://github.com/mwidmann)
217-
[xxx (@wildberrylillet)](https://github.com/wildberrylillet)
218-
[@tomi10up](https://github.com/tomi10up)
219-
[Junaid Bhura (@junaidbhura)](https://github.com/junaidbhura)
220-
[Renato Alves (@renatonascalves)](https://github.com/renatonascalves)
221-
[Ben Marshall (@bmarshall511)](https://github.com/bmarshall511)
222-
[@dgnorrod](https://github.com/dgnorrod)
214+
[Nabi (@navidabdi)](https://github.com/navidabdi),
215+
[Dmitry Seleznyov (@selim13)](https://github.com/selim13),
216+
[Martin Widmann (@mwidmann)](https://github.com/mwidmann),
217+
[xxx (@wildberrylillet)](https://github.com/wildberrylillet),
218+
[@tomi10up](https://github.com/tomi10up),
219+
[Junaid Bhura (@junaidbhura)](https://github.com/junaidbhura),
220+
[Renato Alves (@renatonascalves)](https://github.com/renatonascalves),
221+
[Ben Marshall (@bmarshall511)](https://github.com/bmarshall511),
222+
[@dgnorrod](https://github.com/dgnorrod),
223+
[Pea Lutz (@misfist)](https://github.com/misfist),
224+
[@apurvrdx1](https://github.com/apurvrdx1),
225+
[Scott Buscemi (@scottbuscemi)](https://github.com/scottbuscemi),
223226
and
224227
[@qazaqstan2025](https://github.com/qazaqstan2025).
225228

Diff for: assets/css/woocommerce/admin/orders.css

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
@import "components/combobox.css";
22
@import "components/suggestion.css";
33

4-
#posts-filter .search-box {
5-
position: relative;
4+
#posts-filter,
5+
#wc-orders-filter {
6+
7+
& .search-box {
8+
position: relative;
9+
}
610
}
711

812
#ep-woocommerce-order-search {

Diff for: assets/js/features/components/control.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ export default ({
8484
*/
8585
const requiredFeatureNotice =
8686
name === 'active'
87-
? __('The %s feature must be enabled to use this feature.', 'elasticpress')
88-
: __('The %s feature must be enabled to use the following setting.', 'elasticpress');
87+
? /* translators: Feature name */
88+
__('The %s feature must be enabled to use this feature.', 'elasticpress')
89+
: /* translators: Feature name */
90+
__('The %s feature must be enabled to use the following setting.', 'elasticpress');
8991

9092
/**
9193
* The notice to display if a sync is required.

Diff for: assets/js/instant-results/components/facets/price-range-facet.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* WordPress dependencies.
33
*/
44
import { useLayoutEffect, useState, WPElement } from '@wordpress/element';
5-
import { __, sprintf } from '@wordpress/i18n';
5+
import { _x, sprintf } from '@wordpress/i18n';
66

77
/**
88
* Internal dependencies.
@@ -140,7 +140,7 @@ export default ({ defaultIsOpen, label }) => {
140140
<ActiveContraint
141141
label={sprintf(
142142
/* translators: %1$s: Minimum price. %2$s: Maximum price. */
143-
__('%1$s — %2$s', 'elasticpress'),
143+
_x('%1$s — %2$s', 'Price range', 'elasticpress'),
144144
minPrice,
145145
maxPrice,
146146
)}

Diff for: assets/js/sync-ui/components/previous-sync.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import classnames from 'classnames';
99
import { Icon } from '@wordpress/components';
1010
import { useMemo, WPElement } from '@wordpress/element';
1111
import { dateI18n } from '@wordpress/date';
12-
import { __, _n, sprintf } from '@wordpress/i18n';
12+
import { __, _n, _x, sprintf } from '@wordpress/i18n';
1313

1414
/**
1515
* Internal dependencies.
@@ -44,6 +44,7 @@ export default ({ failures, method, stateDatetime, status, trigger }) => {
4444
case 'with_errors':
4545
return failures
4646
? sprintf(
47+
/* translators: number of errors */
4748
_n(
4849
'Completed with %d error.',
4950
'Completed with %d errors.',
@@ -109,8 +110,9 @@ export default ({ failures, method, stateDatetime, status, trigger }) => {
109110
<div className="ep-previous-sync__title">
110111
{why
111112
? sprintf(
112-
/* translators: %1$s Sync date and time. %2%s sync trigger. */ __(
113+
/* translators: %1$s Sync date and time. %2%s sync trigger. */ _x(
113114
'%1$s — %2$s',
115+
'Sync info',
114116
'elasticpress',
115117
),
116118
when,

Diff for: assets/js/weighting/components/group.js

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export default ({ group, postType }) => {
107107
const isCustomField = customFields.some((f) => f.key === key);
108108

109109
if (isDefaultField || isCustomField) {
110+
/* translators: Field name */
110111
createNotice('info', sprintf(__('%s is already being synced.', 'elasticpress'), toAdd));
111112
return;
112113
}

Diff for: assets/js/woocommerce/admin/orders/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const AuthenticatedApiSearchProvider = ({ children }) => {
103103
* @returns {void}
104104
*/
105105
const init = async () => {
106-
const form = document.getElementById('posts-filter');
106+
const form = document.querySelector('#posts-filter, #wc-orders-filter');
107107
const input = form.s;
108108

109109
if (!input) {

Diff for: includes/classes/Feature/WooCommerce/OrdersAutosuggest.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,14 @@ public function rest_api_init() {
135135
* @param string $hook_suffix The current admin page.
136136
*/
137137
public function enqueue_admin_assets( $hook_suffix ) {
138-
if ( 'edit.php' !== $hook_suffix ) {
138+
if ( ! in_array( $hook_suffix, [ 'edit.php', 'woocommerce_page_wc-orders' ], true ) ) {
139139
return;
140140
}
141141

142-
if ( ! isset( $_GET['post_type'] ) || 'shop_order' !== $_GET['post_type'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
143-
return;
142+
if ( 'edit.php' === $hook_suffix ) {
143+
if ( ! isset( $_GET['post_type'] ) || 'shop_order' !== $_GET['post_type'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
144+
return;
145+
}
144146
}
145147

146148
wp_enqueue_style(

0 commit comments

Comments
 (0)