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 Dec 12, 2023
2 parents 53338de + afbb9a5 commit a34c1fa
Show file tree
Hide file tree
Showing 62 changed files with 400 additions and 172 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-and-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: :php-psr
coverage: none

- name: composer install
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: :php-psr
coverage: none
ini-values: memory_limit=3G

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-with-vendor-prefixed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: :php-psr
coverage: none

- name: composer install
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cypress-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: :php-psr
tools: cs2pr
coverage: none

Expand Down Expand Up @@ -139,6 +140,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: :php-psr
tools: cs2pr
coverage: none

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: :php-psr
tools: cs2pr
coverage: none

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: :php-psr
coverage: none

- name: Install dependencies
Expand Down Expand Up @@ -109,6 +110,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: :php-psr
coverage: none

- name: Install dependencies
Expand Down
23 changes: 21 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@ All notable changes to this project will be documented in this file, per [the Ke
### Security
-->

## [5.0.1] - 2023-12-12

### Added
* Failed queries in the Index Health page will now be outputted with their error messages. Props [@felipeelia](https://github.com/felipeelia) and [@pvnanini](https://github.com/pvnanini) via [#3776](https://github.com/10up/ElasticPress/pull/3776).

### Fixed
* Queries failing due to a "request body is required" error. Props [@felipeelia](https://github.com/felipeelia) via [#3770](https://github.com/10up/ElasticPress/pull/3770).
* Fatal error when site has a bad cookie. Props [@burhandodhy](https://github.com/burhandodhy) via [#3778](https://github.com/10up/ElasticPress/pull/3778).
* Broken i18n of some strings. Props [@felipeelia](https://github.com/felipeelia) and [@iazema](https://github.com/iazema) via [#3780](https://github.com/10up/ElasticPress/pull/3780).
* PHP Warning on term archive pages when the term was not found. Props [@felipeelia](https://github.com/felipeelia) and [@Igor-Yavych](https://github.com/Igor-Yavych) via [#3777](https://github.com/10up/ElasticPress/pull/3777).
* PHP warning when using block themes. Props [@felipeelia](https://github.com/felipeelia) and [@tropicandid](https://github.com/tropicandid) via [#3781](https://github.com/10up/ElasticPress/pull/3781).
* Several typos. Props [@szepeviktor](https://github.com/szepeviktor) via [#3750](https://github.com/10up/ElasticPress/pull/3750).
* Index cleanup process - offset being zeroed too late. Props [@pknap](https://github.com/pknap) via [#3765](https://github.com/10up/ElasticPress/pull/3765).
* PHP warning in site health page. Props [@turtlepod](https://github.com/turtlepod) via [#3758](https://github.com/10up/ElasticPress/pull/3758).
* ReactDOM.render is no longer supported in React 18. Props [@burhandodhy](https://github.com/burhandodhy) and [@felipeelia](https://github.com/felipeelia) via [#3686](https://github.com/10up/ElasticPress/pull/3686).
* E2e tests with WordPress 6.4. Props [@felipeelia](https://github.com/felipeelia) via [#3771](https://github.com/10up/ElasticPress/pull/3771).
* PHP Setup in GitHub Actions. Props [@felipeelia](https://github.com/felipeelia) via [#3784](https://github.com/10up/ElasticPress/pull/3784).

## [5.0.0] - 2023-11-01

**ElasticPress 5.0.0 contains some important changes. Make sure to read these highlights before upgrading:**
Expand Down Expand Up @@ -1254,7 +1272,7 @@ Enhancements:
* Refactor CLI indexing code for simplicity.
* Limit indexed Protected Content post types removing `revision`, `oembed_cache`, `custom_css`, `user_request`, `customize_changeset`, and `wp_block`.
* Cast taxonomy slug to array in case it's already an array in `WP_Query`.
* Remove unnecessary usage of `--network-wide` CLI paramter.
* Remove unnecessary usage of `--network-wide` CLI parameter.
* Add name, nickname, and display name to fields used for user search.
* Add `clear-transient` WP CLI command.
* Don't make product categories facetable when WooCommerce feature is not active. Props [mustafauysal](https://github.com/mustafauysal).
Expand Down Expand Up @@ -1635,7 +1653,7 @@ This is a bug fix release with some filter additions.
- WooCommerce feature breaking image search in media library. Props [@Ritesh-patel](https://github.com/Ritesh-patel)
- WooCommerce order search broken
- Stop the insansity made private. Props [@sc0ttclark](https://github.com/sc0ttclark)
- Multidimensional meta querys. Props [@Ritesh-patel](https://github.com/Ritesh-patel).
- Multidimensional meta queries. Props [@Ritesh-patel](https://github.com/Ritesh-patel).
- Properly show bulk index errors in WP-CLI
- Update ep_delete_post, include $post_type argument. Props [@Ritesh-patel](https://github.com/Ritesh-patel)
- post_type product getting set in any WP_Query if tax_query is provided in WooCommerce feature. Props [@Ritesh-patel](https://github.com/Ritesh-patel)
Expand Down Expand Up @@ -2032,6 +2050,7 @@ This is a bug fix release with some filter additions.
- Initial plugin release

[Unreleased]: https://github.com/10up/ElasticPress/compare/trunk...develop
[5.0.1]: https://github.com/10up/ElasticPress/compare/5.0.0...5.0.1
[5.0.0]: https://github.com/10up/ElasticPress/compare/4.7.2...5.0.0
[4.7.2]: https://github.com/10up/ElasticPress/compare/4.7.1...4.7.2
[4.7.1]: https://github.com/10up/ElasticPress/compare/4.7.0...4.7.1
Expand Down
8 changes: 7 additions & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The following acknowledges the Maintainers for this repository, those who have C

The following individual is responsible for curating the list of issues, responding to pull requests, and ensuring regular releases happen:

[Vasken Hauri (@brandwaffle)](https://github.com/brandwaffle).
[Thorsten Ott (@tott)](https://github.com/tott) and [Felipe Elia (@felipeelia)](https://github.com/felipeelia).

## Contributors

Expand Down Expand Up @@ -223,6 +223,12 @@ Thank you to all the people who have already contributed to this repository via
[Pea Lutz (@misfist)](https://github.com/misfist),
[@apurvrdx1](https://github.com/apurvrdx1),
[Scott Buscemi (@scottbuscemi)](https://github.com/scottbuscemi),
[Viktor Szépe (@szepeviktor)](https://github.com/szepeviktor),
[Paweł Knap (@pknap)](https://github.com/pknap),
[@iazema](https://github.com/iazema),
[Igor Yavych (@Igor-Yavych)](https://github.com/Igor-Yavych),
[Deanna Steers (@tropicandid)](https://github.com/tropicandid),
[@pvnanini](https://github.com/pvnanini),
and
[@qazaqstan2025](https://github.com/qazaqstan2025).

Expand Down
4 changes: 2 additions & 2 deletions assets/js/autosuggest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const { epas } = window;
if (epas.endpointUrl && epas.endpointUrl !== '') {
init();

// Publically expose API
// Publicly expose API
window.epasAPI = {
hideAutosuggestBox,
updateAutosuggestBox,
Expand Down Expand Up @@ -594,7 +594,7 @@ function init() {
* @param {Node} input - search input field
*/
const fetchResults = async (input) => {
// retrieves the PHP-genereated query to pass to ElasticSearch
// retrieves the PHP-generated query to pass to ElasticSearch
const queryJSON = getJsonQuery();

if (queryJSON.error) {
Expand Down
7 changes: 6 additions & 1 deletion assets/js/blocks/facets/common/components/range-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ import { __ } from '@wordpress/i18n';
* @param {number} props.max Maximum value.
* @param {string} props.prefix Value prefix.
* @param {string} props.suffix Value suffix.
* @param {number[]} props.value Currnet value.
* @param {number[]} props.value Current value.
* @returns {WPElement} Component element.
*/
export default ({ clearUrl, min, max, prefix, suffix, value, ...props }) => {
// Expose the onChange() method so that Cypress can set the app state
if (window.Cypress) {
window.app = { sliderChange: props.onChange };
}

return (
<div className="ep-range-facet">
<div className="ep-range-facet__slider">
Expand Down
16 changes: 14 additions & 2 deletions assets/js/blocks/facets/meta-range/view.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
/**
* WordPress dependencies.
*/
import { render, useLayoutEffect, useMemo, useState, WPElement } from '@wordpress/element';
import {
createRoot,
render,
useLayoutEffect,
useMemo,
useState,
WPElement,
} from '@wordpress/element';
import domReady from '@wordpress/dom-ready';

/**
Expand Down Expand Up @@ -102,7 +109,12 @@ const init = () => {

block.insertAdjacentElement('afterbegin', el);

render(<App min={min} max={max} />, el);
if (typeof createRoot === 'function') {
const root = createRoot(el);
root.render(<App min={min} max={max} />);
} else {
render(<App min={min} max={max} />, el);
}
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useApiSearch } from '../../../api-search';
import { postTypeLabels } from '../../config';
import CheckboxList from '../common/checkbox-list';
import Panel from '../common/panel';
import { ActiveContraint } from '../tools/active-constraints';
import { ActiveConstraint } from '../tools/active-constraints';

/**
* Post type facet component.
Expand Down Expand Up @@ -100,7 +100,7 @@ export default ({ defaultIsOpen, label }) => {
/>

{selectedPostTypes.map((value) => (
<ActiveContraint
<ActiveConstraint
key={value}
label={postTypeLabels[value].singular}
onClick={() => onClear(value)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { currencyCode } from '../../config';
import { formatPrice } from '../../utilities';
import Panel from '../common/panel';
import RangeSlider from '../common/range-slider';
import { ActiveContraint } from '../tools/active-constraints';
import { ActiveConstraint } from '../tools/active-constraints';

/**
* Price range facet.
Expand Down Expand Up @@ -137,7 +137,7 @@ export default ({ defaultIsOpen, label }) => {
</div>

{maxArg !== null && minArg !== null && (
<ActiveContraint
<ActiveConstraint
label={sprintf(
/* translators: %1$s: Minimum price. %2$s: Maximum price. */
_x('%1$s — %2$s', 'Price range', 'elasticpress'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { __, sprintf } from '@wordpress/i18n';
*/
import { useApiSearch } from '../../../api-search';
import { useDebounce } from '../../hooks';
import { ActiveContraint } from '../tools/active-constraints';
import { ActiveConstraint } from '../tools/active-constraints';

/**
* Search field component.
Expand Down Expand Up @@ -68,7 +68,7 @@ export default () => {
onChange={onChange}
/>
{searchTerm && (
<ActiveContraint
<ActiveConstraint
label={sprintf(
/* translators: %s: Search term. */
__('“%s”', 'elasticpress'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useApiSearch } from '../../../api-search';
import { facets, postTypeLabels } from '../../config';
import CheckboxList from '../common/checkbox-list';
import Panel from '../common/panel';
import { ActiveContraint } from '../tools/active-constraints';
import { ActiveConstraint } from '../tools/active-constraints';

/**
* Taxonomy filter component.
Expand Down Expand Up @@ -146,7 +146,7 @@ export default ({ defaultIsOpen, label, postTypes, name }) => {
{selectedTerms.map(
(value) =>
labels?.[value] && (
<ActiveContraint
<ActiveConstraint
key={value}
label={labels[value]}
onClick={() => onClear(value)}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/instant-results/components/layout/results.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Internal depenencies.
* Internal dependencies.
*/
import { useEffect, useRef, WPElement } from '@wordpress/element';
import { _n, sprintf, __ } from '@wordpress/i18n';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ref = createRef();
* @param {Function} props.onClick Click handler.
* @returns {WPElement} Element.
*/
export const ActiveContraint = ({ label, onClick }) => {
export const ActiveConstraint = ({ label, onClick }) => {
if (!ref.current) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* WordPress deendencies.
* WordPress dependencies.
*/
import { WPElement } from '@wordpress/element';
import { chevronDown, chevronUp, Icon } from '@wordpress/icons';
Expand Down
4 changes: 2 additions & 2 deletions assets/js/instant-results/components/tools/sort.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* WordPress deendencies.
* WordPress dependencies.
*/
import { useMemo, WPElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

/**
* Internal deendencies.
* Internal dependencies.
*/
import { useApiSearch } from '../../../api-search';
import { sortOptions } from '../../config';
Expand Down
2 changes: 1 addition & 1 deletion assets/js/instant-results/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { useCallback, useRef } from '@wordpress/element';

/**
* Get debounced version of a function that only runs a given ammount of time
* Get debounced version of a function that only runs a given amount of time
* after the last time it was run.
*
* @param {Function} callback Function to debounce.
Expand Down
6 changes: 3 additions & 3 deletions assets/js/synonyms/components/SynonymsEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useContext, useEffect, WPElement } from '@wordpress/element';
* Internal dependencies.
*/
import { State, Dispatch } from '../context';
import AlterativesEditor from './editors/AlternativesEditor';
import AlternativesEditor from './editors/AlternativesEditor';
import SetsEditor from './editors/SetsEditor';
import SolrEditor from './editors/SolrEditor';

Expand Down Expand Up @@ -95,10 +95,10 @@ const SynonymsEditor = () => {
<p>{setsDescription}</p>
<SetsEditor sets={sets} />
</div>
<div className="synonym-editor synonym-editor__alteratives">
<div className="synonym-editor synonym-editor__alternatives">
<h2>{`${alternativesTitle} (${alternatives.length})`}</h2>
<p>{alternativesDescription}</p>
<AlterativesEditor alternatives={alternatives} />
<AlternativesEditor alternatives={alternatives} />
</div>
</>
)}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/synonyms/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const reduceSolrToState = (solr, currentState) => {
*
* @param {string} value The value.
* @param {boolean} primary Whether it's a primary.
* @returns {object} Formated token
* @returns {object} Formatted token
*/
const formatToken = (value, primary = false) => {
return {
Expand Down
4 changes: 2 additions & 2 deletions assets/js/weighting/components/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useWeightingSettings } from '../provider';
import Field from './field';

/**
* Post type propertes component.
* Post type properties component.
*
* @param {object} props Component props.
* @param {string} props.group Group.
Expand Down Expand Up @@ -42,7 +42,7 @@ export default ({ group, postType }) => {
const isMetadata = group === 'ep_metadata';

/**
* Fields that belond to this group.
* Fields that belong to this group.
*/
const defaultFields = useMemo(() => fields.filter((f) => f.group === group), [fields, group]);

Expand Down
2 changes: 1 addition & 1 deletion assets/js/weighting/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const WeightingSettingsProvider = ({
* Handle data change.
*
* @param {string} postType Post type to update.
* @param {Array} values New valus.
* @param {Array} values New values.
* @returns {void}
*/
const setWeightingForPostType = (postType, values) => {
Expand Down
4 changes: 2 additions & 2 deletions assets/js/woocommerce/admin/orders/app/components/combobox.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* WordPress depdendencies.
* WordPress dependencies.
*/
import { ReactElement, useCallback, useEffect, useMemo, useState } from '@wordpress/element';
import { _n, sprintf } from '@wordpress/i18n';
Expand All @@ -24,7 +24,7 @@ export default ({ children, id, isBusy, onSelect, ...props }) => {
/**
* Active descendant ID.
*
* @returns {string|null} Actve descendant id.
* @returns {string|null} Active descendant id.
*/
const activeDescendant = useMemo(() => {
return children[selected] ? children[selected].props.id : null;
Expand Down
Loading

0 comments on commit a34c1fa

Please sign in to comment.