diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml
index 8bd69cdb4b..df2a10e92c 100644
--- a/.github/workflows/build-docs.yml
+++ b/.github/workflows/build-docs.yml
@@ -17,10 +17,15 @@ jobs:
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
- php-version: '8.0'
+ php-version: '8.2'
coverage: none
ini-values: memory_limit=3G
+ - name: composer install
+ run: |
+ cd wp-content/plugins/elasticpress
+ composer install
+
- name: Start MySQL
run: |
sudo systemctl start mysql.service
diff --git a/.github/workflows/wordpress-latest.yml b/.github/workflows/wordpress-latest.yml
new file mode 100644
index 0000000000..b134ea59da
--- /dev/null
+++ b/.github/workflows/wordpress-latest.yml
@@ -0,0 +1,20 @@
+name: "WordPress version checker"
+on:
+ push:
+ branches:
+ - develop
+ - trunk
+ pull_request:
+ branches:
+ - develop
+ schedule:
+ - cron: '0 0 * * 1'
+
+jobs:
+ wordpress-version-checker:
+ runs-on: ubuntu-latest
+ steps:
+ - name: WordPress version checker
+ uses: skaut/wordpress-version-checker@v1.2.0
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8d3cb21d6e..5d0b7d4f75 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,35 @@ All notable changes to this project will be documented in this file, per [the Ke
### Security
-->
+## [4.7.2] - 2023-10-10
+
+**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_highlight_number_of_fragments` filter. Props [@dgnorrod](https://github.com/dgnorrod) and [@felipeelia](https://github.com/felipeelia) via [#3681](https://github.com/10up/ElasticPress/pull/3681).
+* >=PHP 7.0 version check. Props [@bmarshall511](https://github.com/bmarshall511) and [@felipeelia](https://github.com/felipeelia) via [#3641](https://github.com/10up/ElasticPress/pull/3641).
+* GitHub action to automatically open a new issue when a new version of WordPress is released. Props [@felipeelia](https://github.com/felipeelia) via [#3666](https://github.com/10up/ElasticPress/pull/3666).
+
+### Removed
+* Unnecessary aliases in use statements. Props [@felipeelia](https://github.com/felipeelia) via [#3671](https://github.com/10up/ElasticPress/pull/3671).
+
+### Fixed
+* Calls to `ep_woocommerce_default_supported_post_types` were ignored. Props [@felipeelia](https://github.com/felipeelia) and [@MARQAS](https://github.com/MARQAS) via [#3679](https://github.com/10up/ElasticPress/pull/3679).
+* WooCommerce Orders search field disappearing when Orders Autosuggest receives an unexpected response from ElasticPress.io. Props [@JakePT](https://github.com/JakePT) and [@anjulahettige](https://github.com/anjulahettige) via [#3682](https://github.com/10up/ElasticPress/pull/3682).
+* Call composer while building docs. Props [@felipeelia](https://github.com/felipeelia) via [#3625](https://github.com/10up/ElasticPress/pull/3625).
+* Make sure `post__not_in` and `post_status` are translated into arrays, not objects. Props [@felipeelia](https://github.com/felipeelia) via [#3652](https://github.com/10up/ElasticPress/pull/3652) and [#3680](https://github.com/10up/ElasticPress/pull/3680).
+* Updated phpDoc entries. Props [@renatonascalves](https://github.com/renatonascalves) via [#3635](https://github.com/10up/ElasticPress/pull/3635).
+* Docblock for `Utils\get_option` return type. Props [@felipeelia](https://github.com/felipeelia) via [#3653](https://github.com/10up/ElasticPress/pull/3653).
+* Docblock for `ep_capability` and `ep_network_capability` filters. Props [@burhandodhy](https://github.com/burhandodhy) via [#3685](https://github.com/10up/ElasticPress/pull/3685).
+* PHP warning related to the Autosuggest template generation. Props [@felipeelia](https://github.com/felipeelia) via [#3651](https://github.com/10up/ElasticPress/pull/3651).
+* WooCommerce unit tests running multiple times. Props [@felipeelia](https://github.com/felipeelia) via [#3656](https://github.com/10up/ElasticPress/pull/3656).
+* Display the meta range facet block in versions prior to WP 6.1. Props [@felipeelia](https://github.com/felipeelia) and [@MARQAS](https://github.com/MARQAS) via [#3658](https://github.com/10up/ElasticPress/pull/3658).
+* Number of expected arguments for `add_attachment` and `edit_attachment`. Props [@burhandodhy](https://github.com/burhandodhy) via [#3690](https://github.com/10up/ElasticPress/pull/3690).
+* Error while running `composer install` on PHP 8. Props [@burhandodhy](https://github.com/burhandodhy) via [#3683](https://github.com/10up/ElasticPress/pull/3683).
+
+### Security
+* Bumped `composer/composer` from 2.5.8 to 2.6.4. Props [@dependabot](https://github.com/dependabot) via [#3672](https://github.com/10up/ElasticPress/pull/3672).
+
## [4.7.1] - 2023-08-31
**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.**
@@ -1926,6 +1955,8 @@ This is a bug fix release with some filter additions.
- Initial plugin release
[Unreleased]: https://github.com/10up/ElasticPress/compare/trunk...develop
+[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
[4.7.0]: https://github.com/10up/ElasticPress/compare/4.6.1...4.7.0
[4.6.1]: https://github.com/10up/ElasticPress/compare/4.6.0...4.6.1
[4.6.0]: https://github.com/10up/ElasticPress/compare/4.5.2...4.6.0
diff --git a/CREDITS.md b/CREDITS.md
index 794096aac2..f2e6fd4bab 100644
--- a/CREDITS.md
+++ b/CREDITS.md
@@ -217,6 +217,9 @@ Thank you to all the people who have already contributed to this repository via
[xxx (@wildberrylillet)](https://github.com/wildberrylillet)
[@tomi10up](https://github.com/tomi10up)
[Junaid Bhura (@junaidbhura)](https://github.com/junaidbhura)
+[Renato Alves (@renatonascalves)](https://github.com/renatonascalves)
+[Ben Marshall (@bmarshall511)](https://github.com/bmarshall511)
+[@dgnorrod](https://github.com/dgnorrod)
and
[@qazaqstan2025](https://github.com/qazaqstan2025).
diff --git a/assets/js/api-search/index.js b/assets/js/api-search/index.js
index 5e1fee26b9..b112178b01 100644
--- a/assets/js/api-search/index.js
+++ b/assets/js/api-search/index.js
@@ -11,6 +11,7 @@ import {
useRef,
WPElement,
} from '@wordpress/element';
+import { __, sprintf } from '@wordpress/i18n';
/**
* Internal dependencies.
@@ -298,13 +299,24 @@ export const ApiSearchProvider = ({
setIsLoading(true);
- const response = await fetchResults(urlParams);
+ try {
+ const response = await fetchResults(urlParams);
- if (!response) {
- return;
+ if (!response) {
+ return;
+ }
+
+ setResults(response);
+ } catch (e) {
+ const errorMessage = sprintf(
+ /* translators: Error message */
+ __('ElasticPress: Unable to fetch results. %s', 'elasticpress'),
+ e.message,
+ );
+
+ console.error(errorMessage); // eslint-disable-line no-console
}
- setResults(response);
setIsLoading(false);
};
diff --git a/assets/js/api-search/src/hooks.js b/assets/js/api-search/src/hooks.js
index 0b05d39265..60a90b6e7e 100644
--- a/assets/js/api-search/src/hooks.js
+++ b/assets/js/api-search/src/hooks.js
@@ -2,6 +2,7 @@
* WordPress dependencies.
*/
import { useCallback, useRef } from '@wordpress/element';
+import { __, sprintf } from '@wordpress/i18n';
/**
* Internal dependencies.
@@ -47,6 +48,7 @@ export const useFetchResults = (
};
const requestId = generateRequestId(requestIdBase);
+
if (requestId) {
headers['X-ElasticPress-Request-ID'] = requestId;
}
@@ -56,14 +58,20 @@ export const useFetchResults = (
headers,
})
.then((response) => {
- if (onAuthErrorRef.current && !response.ok) {
- onAuthErrorRef.current();
+ if (!response.ok) {
+ if (response.status === 401 && onAuthErrorRef.current) {
+ onAuthErrorRef.current();
+ return '';
+ }
+
+ /* translators: Response status code */
+ throw new Error(sprintf(__('HTTP %d.', 'elasticpress'), response.status));
}
return response.json();
})
.catch((error) => {
- if (error?.name !== 'AbortError' && !request.current) {
+ if (error?.name !== 'AbortError') {
throw error;
}
})
diff --git a/composer.lock b/composer.lock
index 1272bb462c..1323609cab 100644
--- a/composer.lock
+++ b/composer.lock
@@ -212,12 +212,12 @@
"source": {
"type": "git",
"url": "https://github.com/10up/phpcs-composer.git",
- "reference": "9c085cf0554a0b5311623548663aa9e4d8f52587"
+ "reference": "4a2f47d5ed0493836ef33ee2edad32192699fad6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/10up/phpcs-composer/zipball/9c085cf0554a0b5311623548663aa9e4d8f52587",
- "reference": "9c085cf0554a0b5311623548663aa9e4d8f52587",
+ "url": "https://api.github.com/repos/10up/phpcs-composer/zipball/4a2f47d5ed0493836ef33ee2edad32192699fad6",
+ "reference": "4a2f47d5ed0493836ef33ee2edad32192699fad6",
"shasum": ""
},
"require": {
@@ -235,15 +235,16 @@
],
"authors": [
{
- "name": "Ephraim Gregor",
- "email": "ephraim.gregor@10up.com"
+ "name": "10up",
+ "homepage": "https://10up.com/"
}
],
+ "description": "10up's PHP CodeSniffer Ruleset",
"support": {
"issues": "https://github.com/10up/phpcs-composer/issues",
- "source": "https://github.com/10up/phpcs-composer/tree/master"
+ "source": "https://github.com/10up/phpcs-composer/tree/2.0.1"
},
- "time": "2023-05-10T22:44:49+00:00"
+ "time": "2023-09-14T12:16:59+00:00"
},
{
"name": "automattic/vipwpcs",
@@ -512,16 +513,16 @@
},
{
"name": "composer/composer",
- "version": "2.5.8",
+ "version": "2.6.4",
"source": {
"type": "git",
"url": "https://github.com/composer/composer.git",
- "reference": "4c516146167d1392c8b9b269bb7c24115d262164"
+ "reference": "d75d17c16a863438027d1d96401cddcd6aa5bb60"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/composer/zipball/4c516146167d1392c8b9b269bb7c24115d262164",
- "reference": "4c516146167d1392c8b9b269bb7c24115d262164",
+ "url": "https://api.github.com/repos/composer/composer/zipball/d75d17c16a863438027d1d96401cddcd6aa5bb60",
+ "reference": "d75d17c16a863438027d1d96401cddcd6aa5bb60",
"shasum": ""
},
"require": {
@@ -529,23 +530,23 @@
"composer/class-map-generator": "^1.0",
"composer/metadata-minifier": "^1.0",
"composer/pcre": "^2.1 || ^3.1",
- "composer/semver": "^3.0",
+ "composer/semver": "^3.2.5",
"composer/spdx-licenses": "^1.5.7",
"composer/xdebug-handler": "^2.0.2 || ^3.0.3",
"justinrainbow/json-schema": "^5.2.11",
"php": "^7.2.5 || ^8.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
- "react/promise": "^2.8",
+ "react/promise": "^2.8 || ^3",
"seld/jsonlint": "^1.4",
"seld/phar-utils": "^1.2",
"seld/signal-handler": "^2.0",
- "symfony/console": "^5.4.11 || ^6.0.11",
- "symfony/filesystem": "^5.4 || ^6.0",
- "symfony/finder": "^5.4 || ^6.0",
+ "symfony/console": "^5.4.11 || ^6.0.11 || ^7",
+ "symfony/filesystem": "^5.4 || ^6.0 || ^7",
+ "symfony/finder": "^5.4 || ^6.0 || ^7",
"symfony/polyfill-php73": "^1.24",
"symfony/polyfill-php80": "^1.24",
"symfony/polyfill-php81": "^1.24",
- "symfony/process": "^5.4 || ^6.0"
+ "symfony/process": "^5.4 || ^6.0 || ^7"
},
"require-dev": {
"phpstan/phpstan": "^1.9.3",
@@ -553,7 +554,7 @@
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1",
"phpstan/phpstan-symfony": "^1.2.10",
- "symfony/phpunit-bridge": "^6.0"
+ "symfony/phpunit-bridge": "^6.0 || ^7"
},
"suggest": {
"ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages",
@@ -566,7 +567,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "2.5-dev"
+ "dev-main": "2.6-dev"
},
"phpstan": {
"includes": [
@@ -576,7 +577,7 @@
},
"autoload": {
"psr-4": {
- "Composer\\": "src/Composer"
+ "Composer\\": "src/Composer/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -605,7 +606,8 @@
"support": {
"irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/composer/issues",
- "source": "https://github.com/composer/composer/tree/2.5.8"
+ "security": "https://github.com/composer/composer/security/policy",
+ "source": "https://github.com/composer/composer/tree/2.6.4"
},
"funding": [
{
@@ -621,7 +623,7 @@
"type": "tidelift"
}
],
- "time": "2023-06-09T15:13:21+00:00"
+ "time": "2023-09-29T08:54:47+00:00"
},
{
"name": "composer/metadata-minifier",
@@ -765,16 +767,16 @@
},
{
"name": "composer/semver",
- "version": "3.3.2",
+ "version": "3.4.0",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
- "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9"
+ "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9",
- "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9",
+ "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32",
+ "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32",
"shasum": ""
},
"require": {
@@ -824,9 +826,9 @@
"versioning"
],
"support": {
- "irc": "irc://irc.freenode.org/composer",
+ "irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/semver/issues",
- "source": "https://github.com/composer/semver/tree/3.3.2"
+ "source": "https://github.com/composer/semver/tree/3.4.0"
},
"funding": [
{
@@ -842,7 +844,7 @@
"type": "tidelift"
}
],
- "time": "2022-04-01T19:23:25+00:00"
+ "time": "2023-08-31T09:50:34+00:00"
},
{
"name": "composer/spdx-licenses",
@@ -1070,30 +1072,30 @@
},
{
"name": "doctrine/instantiator",
- "version": "2.0.0",
+ "version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
- "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0"
+ "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
- "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b",
+ "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b",
"shasum": ""
},
"require": {
- "php": "^8.1"
+ "php": "^7.1 || ^8.0"
},
"require-dev": {
- "doctrine/coding-standard": "^11",
+ "doctrine/coding-standard": "^9 || ^11",
"ext-pdo": "*",
"ext-phar": "*",
- "phpbench/phpbench": "^1.2",
- "phpstan/phpstan": "^1.9.4",
- "phpstan/phpstan-phpunit": "^1.3",
- "phpunit/phpunit": "^9.5.27",
- "vimeo/psalm": "^5.4"
+ "phpbench/phpbench": "^0.16 || ^1",
+ "phpstan/phpstan": "^1.4",
+ "phpstan/phpstan-phpunit": "^1",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
+ "vimeo/psalm": "^4.30 || ^5.4"
},
"type": "library",
"autoload": {
@@ -1120,7 +1122,7 @@
],
"support": {
"issues": "https://github.com/doctrine/instantiator/issues",
- "source": "https://github.com/doctrine/instantiator/tree/2.0.0"
+ "source": "https://github.com/doctrine/instantiator/tree/1.5.0"
},
"funding": [
{
@@ -1136,7 +1138,7 @@
"type": "tidelift"
}
],
- "time": "2022-12-30T00:23:10+00:00"
+ "time": "2022-12-30T00:15:36+00:00"
},
{
"name": "json-mapper/json-mapper",
@@ -1209,16 +1211,16 @@
},
{
"name": "justinrainbow/json-schema",
- "version": "5.2.12",
+ "version": "v5.2.13",
"source": {
"type": "git",
"url": "https://github.com/justinrainbow/json-schema.git",
- "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60"
+ "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/ad87d5a5ca981228e0e205c2bc7dfb8e24559b60",
- "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60",
+ "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793",
+ "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793",
"shasum": ""
},
"require": {
@@ -1273,9 +1275,9 @@
],
"support": {
"issues": "https://github.com/justinrainbow/json-schema/issues",
- "source": "https://github.com/justinrainbow/json-schema/tree/5.2.12"
+ "source": "https://github.com/justinrainbow/json-schema/tree/v5.2.13"
},
- "time": "2022-04-13T08:02:27+00:00"
+ "time": "2023-09-26T02:20:38+00:00"
},
{
"name": "league/flysystem",
@@ -1892,16 +1894,16 @@
},
{
"name": "phpunit/php-code-coverage",
- "version": "9.2.27",
+ "version": "9.2.29",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1"
+ "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b0a88255cb70d52653d80c890bd7f38740ea50d1",
- "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76",
+ "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76",
"shasum": ""
},
"require": {
@@ -1958,7 +1960,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.27"
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29"
},
"funding": [
{
@@ -1966,7 +1968,7 @@
"type": "github"
}
],
- "time": "2023-07-26T13:44:30+00:00"
+ "time": "2023-09-19T04:57:46+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -2211,16 +2213,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "9.6.11",
+ "version": "9.6.13",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "810500e92855eba8a7a5319ae913be2da6f957b0"
+ "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/810500e92855eba8a7a5319ae913be2da6f957b0",
- "reference": "810500e92855eba8a7a5319ae913be2da6f957b0",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be",
+ "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be",
"shasum": ""
},
"require": {
@@ -2235,7 +2237,7 @@
"phar-io/manifest": "^2.0.3",
"phar-io/version": "^3.0.2",
"php": ">=7.3",
- "phpunit/php-code-coverage": "^9.2.13",
+ "phpunit/php-code-coverage": "^9.2.28",
"phpunit/php-file-iterator": "^3.0.5",
"phpunit/php-invoker": "^3.1.1",
"phpunit/php-text-template": "^2.0.3",
@@ -2294,7 +2296,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
- "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.11"
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13"
},
"funding": [
{
@@ -2310,7 +2312,7 @@
"type": "tidelift"
}
],
- "time": "2023-08-19T07:10:56+00:00"
+ "time": "2023-09-19T05:39:22+00:00"
},
{
"name": "psr/cache",
@@ -2464,23 +2466,24 @@
},
{
"name": "react/promise",
- "version": "v2.10.0",
+ "version": "v3.0.0",
"source": {
"type": "git",
"url": "https://github.com/reactphp/promise.git",
- "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38"
+ "reference": "c86753c76fd3be465d93b308f18d189f01a22be4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/reactphp/promise/zipball/f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38",
- "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38",
+ "url": "https://api.github.com/repos/reactphp/promise/zipball/c86753c76fd3be465d93b308f18d189f01a22be4",
+ "reference": "c86753c76fd3be465d93b308f18d189f01a22be4",
"shasum": ""
},
"require": {
- "php": ">=5.4.0"
+ "php": ">=7.1.0"
},
"require-dev": {
- "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36"
+ "phpstan/phpstan": "1.10.20 || 1.4.10",
+ "phpunit/phpunit": "^9.5 || ^7.5"
},
"type": "library",
"autoload": {
@@ -2524,7 +2527,7 @@
],
"support": {
"issues": "https://github.com/reactphp/promise/issues",
- "source": "https://github.com/reactphp/promise/tree/v2.10.0"
+ "source": "https://github.com/reactphp/promise/tree/v3.0.0"
},
"funding": [
{
@@ -2532,7 +2535,7 @@
"type": "open_collective"
}
],
- "time": "2023-05-02T15:15:43+00:00"
+ "time": "2023-07-11T16:12:49+00:00"
},
{
"name": "sebastian/cli-parser",
@@ -3612,16 +3615,16 @@
},
{
"name": "seld/signal-handler",
- "version": "2.0.1",
+ "version": "2.0.2",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/signal-handler.git",
- "reference": "f69d119511dc0360440cdbdaa71829c149b7be75"
+ "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Seldaek/signal-handler/zipball/f69d119511dc0360440cdbdaa71829c149b7be75",
- "reference": "f69d119511dc0360440cdbdaa71829c149b7be75",
+ "url": "https://api.github.com/repos/Seldaek/signal-handler/zipball/04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98",
+ "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98",
"shasum": ""
},
"require": {
@@ -3667,9 +3670,9 @@
],
"support": {
"issues": "https://github.com/Seldaek/signal-handler/issues",
- "source": "https://github.com/Seldaek/signal-handler/tree/2.0.1"
+ "source": "https://github.com/Seldaek/signal-handler/tree/2.0.2"
},
- "time": "2022-07-20T18:31:45+00:00"
+ "time": "2023-09-03T09:24:00+00:00"
},
{
"name": "sirbrillig/phpcs-variable-analysis",
@@ -3787,25 +3790,25 @@
},
{
"name": "symfony/cache",
- "version": "v6.2.13",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/cache.git",
- "reference": "c47f4a9e9d172359516c35490d6b649d2d44c50d"
+ "reference": "81ca309f056e836480928b20280ec52ce8369bb3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/cache/zipball/c47f4a9e9d172359516c35490d6b649d2d44c50d",
- "reference": "c47f4a9e9d172359516c35490d6b649d2d44c50d",
+ "url": "https://api.github.com/repos/symfony/cache/zipball/81ca309f056e836480928b20280ec52ce8369bb3",
+ "reference": "81ca309f056e836480928b20280ec52ce8369bb3",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.0.2",
"psr/cache": "^2.0|^3.0",
"psr/log": "^1.1|^2|^3",
"symfony/cache-contracts": "^1.1.7|^2|^3",
"symfony/service-contracts": "^1.1|^2|^3",
- "symfony/var-exporter": "^6.2.10"
+ "symfony/var-exporter": "^5.4|^6.0"
},
"conflict": {
"doctrine/dbal": "<2.13.1",
@@ -3835,9 +3838,6 @@
"psr-4": {
"Symfony\\Component\\Cache\\": ""
},
- "classmap": [
- "Traits/ValueWrapper.php"
- ],
"exclude-from-classmap": [
"/Tests/"
]
@@ -3863,7 +3863,7 @@
"psr6"
],
"support": {
- "source": "https://github.com/symfony/cache/tree/v6.2.13"
+ "source": "https://github.com/symfony/cache/tree/v6.0.19"
},
"funding": [
{
@@ -3879,30 +3879,33 @@
"type": "tidelift"
}
],
- "time": "2023-07-27T16:12:47+00:00"
+ "time": "2023-01-20T17:44:14+00:00"
},
{
"name": "symfony/cache-contracts",
- "version": "v3.3.0",
+ "version": "v3.0.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/cache-contracts.git",
- "reference": "ad945640ccc0ae6e208bcea7d7de4b39b569896b"
+ "reference": "1c0a181c9ee221afe4fa55b2d13fc63c5ae14348"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/ad945640ccc0ae6e208bcea7d7de4b39b569896b",
- "reference": "ad945640ccc0ae6e208bcea7d7de4b39b569896b",
+ "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/1c0a181c9ee221afe4fa55b2d13fc63c5ae14348",
+ "reference": "1c0a181c9ee221afe4fa55b2d13fc63c5ae14348",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.0.2",
"psr/cache": "^3.0"
},
+ "suggest": {
+ "symfony/cache-implementation": ""
+ },
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "3.4-dev"
+ "dev-main": "3.0-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -3939,7 +3942,7 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/cache-contracts/tree/v3.3.0"
+ "source": "https://github.com/symfony/cache-contracts/tree/v3.0.2"
},
"funding": [
{
@@ -3955,7 +3958,7 @@
"type": "tidelift"
}
],
- "time": "2023-05-23T14:45:45+00:00"
+ "time": "2022-01-02T09:55:41+00:00"
},
{
"name": "symfony/console",
@@ -4058,25 +4061,25 @@
},
{
"name": "symfony/deprecation-contracts",
- "version": "v3.3.0",
+ "version": "v3.0.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
- "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf"
+ "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf",
- "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c",
+ "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.0.2"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "3.4-dev"
+ "dev-main": "3.0-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -4105,7 +4108,7 @@
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0"
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2"
},
"funding": [
{
@@ -4121,24 +4124,24 @@
"type": "tidelift"
}
],
- "time": "2023-05-23T14:45:45+00:00"
+ "time": "2022-01-02T09:55:41+00:00"
},
{
"name": "symfony/filesystem",
- "version": "v6.3.1",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae"
+ "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae",
- "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/3d49eec03fda1f0fc19b7349fbbe55ebc1004214",
+ "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.0.2",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-mbstring": "~1.8"
},
@@ -4168,7 +4171,7 @@
"description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/filesystem/tree/v6.3.1"
+ "source": "https://github.com/symfony/filesystem/tree/v6.0.19"
},
"funding": [
{
@@ -4184,7 +4187,7 @@
"type": "tidelift"
}
],
- "time": "2023-06-01T08:30:39+00:00"
+ "time": "2023-01-20T17:44:14+00:00"
},
{
"name": "symfony/finder",
@@ -4822,20 +4825,20 @@
},
{
"name": "symfony/process",
- "version": "v6.3.4",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54"
+ "reference": "2114fd60f26a296cc403a7939ab91478475a33d4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/0b5c29118f2e980d455d2e34a5659f4579847c54",
- "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54",
+ "url": "https://api.github.com/repos/symfony/process/zipball/2114fd60f26a296cc403a7939ab91478475a33d4",
+ "reference": "2114fd60f26a296cc403a7939ab91478475a33d4",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.0.2"
},
"type": "library",
"autoload": {
@@ -4863,7 +4866,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/process/tree/v6.3.4"
+ "source": "https://github.com/symfony/process/tree/v6.0.19"
},
"funding": [
{
@@ -4879,7 +4882,7 @@
"type": "tidelift"
}
],
- "time": "2023-08-07T10:39:22+00:00"
+ "time": "2023-01-01T08:36:10+00:00"
},
{
"name": "symfony/service-contracts",
@@ -4962,33 +4965,32 @@
},
{
"name": "symfony/string",
- "version": "v6.3.2",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "53d1a83225002635bca3482fcbf963001313fb68"
+ "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/53d1a83225002635bca3482fcbf963001313fb68",
- "reference": "53d1a83225002635bca3482fcbf963001313fb68",
+ "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a",
+ "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.0.2",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-intl-grapheme": "~1.0",
"symfony/polyfill-intl-normalizer": "~1.0",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
- "symfony/translation-contracts": "<2.5"
+ "symfony/translation-contracts": "<2.0"
},
"require-dev": {
"symfony/error-handler": "^5.4|^6.0",
"symfony/http-client": "^5.4|^6.0",
- "symfony/intl": "^6.2",
- "symfony/translation-contracts": "^2.5|^3.0",
+ "symfony/translation-contracts": "^2.0|^3.0",
"symfony/var-exporter": "^5.4|^6.0"
},
"type": "library",
@@ -5028,7 +5030,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v6.3.2"
+ "source": "https://github.com/symfony/string/tree/v6.0.19"
},
"funding": [
{
@@ -5044,24 +5046,24 @@
"type": "tidelift"
}
],
- "time": "2023-07-05T08:41:27+00:00"
+ "time": "2023-01-01T08:36:10+00:00"
},
{
"name": "symfony/var-exporter",
- "version": "v6.3.4",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-exporter.git",
- "reference": "df1f8aac5751871b83d30bf3e2c355770f8f0691"
+ "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/var-exporter/zipball/df1f8aac5751871b83d30bf3e2c355770f8f0691",
- "reference": "df1f8aac5751871b83d30bf3e2c355770f8f0691",
+ "url": "https://api.github.com/repos/symfony/var-exporter/zipball/df56f53818c2d5d9f683f4ad2e365ba73a3b69d2",
+ "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.0.2"
},
"require-dev": {
"symfony/var-dumper": "^5.4|^6.0"
@@ -5097,12 +5099,10 @@
"export",
"hydrate",
"instantiate",
- "lazy-loading",
- "proxy",
"serialize"
],
"support": {
- "source": "https://github.com/symfony/var-exporter/tree/v6.3.4"
+ "source": "https://github.com/symfony/var-exporter/tree/v6.0.19"
},
"funding": [
{
@@ -5118,7 +5118,7 @@
"type": "tidelift"
}
],
- "time": "2023-08-16T18:14:47+00:00"
+ "time": "2023-01-13T08:34:10+00:00"
},
{
"name": "theseer/tokenizer",
@@ -5223,15 +5223,15 @@
},
{
"name": "wpackagist-plugin/woocommerce",
- "version": "8.0.3",
+ "version": "8.1.1",
"source": {
"type": "svn",
"url": "https://plugins.svn.wordpress.org/woocommerce/",
- "reference": "tags/8.0.3"
+ "reference": "tags/8.1.1"
},
"dist": {
"type": "zip",
- "url": "https://downloads.wordpress.org/plugin/woocommerce.8.0.3.zip"
+ "url": "https://downloads.wordpress.org/plugin/woocommerce.8.1.1.zip"
},
"require": {
"composer/installers": "^1.0 || ^2.0"
diff --git a/elasticpress.php b/elasticpress.php
index 135efe44de..ea56963b7b 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.7.1
+ * Version: 4.7.2
* Requires at least: 5.6
* Requires PHP: 7.0
* Author: 10up
@@ -23,22 +23,48 @@
namespace ElasticPress;
-use \WP_CLI as WP_CLI;
+use \WP_CLI;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
+define( 'EP_URL', plugin_dir_url( __FILE__ ) );
+define( 'EP_PATH', plugin_dir_path( __FILE__ ) );
+define( 'EP_FILE', plugin_basename( __FILE__ ) );
+define( 'EP_VERSION', '4.7.2' );
+
+define( 'EP_PHP_VERSION_MIN', '7.0' );
+
+if ( ! version_compare( phpversion(), EP_PHP_VERSION_MIN, '>=' ) ) {
+ add_action(
+ 'admin_notices',
+ function() {
+ ?>
+
+ autosuggest_query = $query['args']['body'];
+ $message = wp_json_encode(
+ [
+ esc_html__( 'This is a fake request to build the ElasticPress Autosuggest query. It is not really sent.', 'elasticpress' ),
+ ]
+ );
+
return [
- 'response' => [ 'code' => 200 ],
- 'body' => wp_json_encode(
- [
- esc_html__( 'This is a fake request to build the ElasticPress Autosuggest query. It is not really sent.', 'elasticpress' ),
- ]
- ),
+ 'is_ep_fake_request' => true,
+ 'body' => $message,
+ 'response' => [
+ 'code' => 200,
+ 'message' => $message,
+ ],
];
}
diff --git a/includes/classes/Feature/Comments/Comments.php b/includes/classes/Feature/Comments/Comments.php
index 66feb2e782..aa341adca2 100644
--- a/includes/classes/Feature/Comments/Comments.php
+++ b/includes/classes/Feature/Comments/Comments.php
@@ -8,11 +8,11 @@
namespace ElasticPress\Feature\Comments;
-use ElasticPress\Feature as Feature;
-use ElasticPress\Indexables as Indexables;
-use ElasticPress\Indexable as Indexable;
-use ElasticPress\Features as Features;
-use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus;
+use ElasticPress\Feature;
+use ElasticPress\FeatureRequirementsStatus;
+use ElasticPress\Features;
+use ElasticPress\Indexable;
+use ElasticPress\Indexables;
use ElasticPress\Utils;
/**
diff --git a/includes/classes/Feature/Comments/Widget.php b/includes/classes/Feature/Comments/Widget.php
index 1d2190dca0..045669cd3b 100644
--- a/includes/classes/Feature/Comments/Widget.php
+++ b/includes/classes/Feature/Comments/Widget.php
@@ -8,10 +8,6 @@
namespace ElasticPress\Feature\Comments;
-use \WP_Widget as WP_Widget;
-use ElasticPress\Features as Features;
-use ElasticPress\Utils;
-
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
@@ -19,7 +15,7 @@
/**
* Search comment widget class
*/
-class Widget extends WP_Widget {
+class Widget extends \WP_Widget {
/**
* Initialize the widget
diff --git a/includes/classes/Feature/Documents/Documents.php b/includes/classes/Feature/Documents/Documents.php
index 259021b992..b00ffe422c 100644
--- a/includes/classes/Feature/Documents/Documents.php
+++ b/includes/classes/Feature/Documents/Documents.php
@@ -7,11 +7,11 @@
namespace ElasticPress\Feature\Documents;
-use ElasticPress\Feature as Feature;
-use ElasticPress\Elasticsearch as Elasticsearch;
-use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus;
-use ElasticPress\Indexables as Indexables;
-use ElasticPress\Utils as Utils;
+use ElasticPress\Elasticsearch;
+use ElasticPress\Feature;
+use ElasticPress\FeatureRequirementsStatus;
+use ElasticPress\Indexables;
+use ElasticPress\Utils;
/**
* Documents feature class.
diff --git a/includes/classes/Feature/Facets/Facets.php b/includes/classes/Feature/Facets/Facets.php
index 159d365df3..d49652a6a5 100644
--- a/includes/classes/Feature/Facets/Facets.php
+++ b/includes/classes/Feature/Facets/Facets.php
@@ -8,10 +8,10 @@
namespace ElasticPress\Feature\Facets;
-use ElasticPress\Feature as Feature;
-use ElasticPress\Features as Features;
-use ElasticPress\Utils as Utils;
-use ElasticPress\Indexables as Indexables;
+use ElasticPress\Feature;
+use ElasticPress\Features;
+use ElasticPress\Indexables;
+use ElasticPress\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/classes/Feature/Facets/Types/Meta/Renderer.php b/includes/classes/Feature/Facets/Types/Meta/Renderer.php
index 2d4768b9e2..bf078fe541 100644
--- a/includes/classes/Feature/Facets/Types/Meta/Renderer.php
+++ b/includes/classes/Feature/Facets/Types/Meta/Renderer.php
@@ -8,7 +8,7 @@
namespace ElasticPress\Feature\Facets\Types\Meta;
-use ElasticPress\Features as Features;
+use ElasticPress\Features;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/classes/Feature/Facets/Types/MetaRange/Block.php b/includes/classes/Feature/Facets/Types/MetaRange/Block.php
index 284bcaa4e9..17f5d4fe8d 100644
--- a/includes/classes/Feature/Facets/Types/MetaRange/Block.php
+++ b/includes/classes/Feature/Facets/Types/MetaRange/Block.php
@@ -131,6 +131,16 @@ public function render_block( $attributes ) {
$renderer_class = apply_filters( 'ep_facet_renderer_class', __NAMESPACE__ . '\Renderer', 'meta-range', 'block', $attributes );
$renderer = new $renderer_class();
+ /**
+ * Prior to WP 6.1, if you set `viewScript` while using a `render_callback` function,
+ * the script was not enqueued.
+ *
+ * @see https://core.trac.wordpress.org/changeset/54367
+ */
+ if ( version_compare( get_bloginfo( 'version' ), '6.1', '<' ) ) {
+ wp_enqueue_script( 'ep-facets-meta-range-block-view-script' );
+ }
+
ob_start();
$wrapper_attributes = get_block_wrapper_attributes( [ 'class' => 'wp-block-elasticpress-facet' ] );
diff --git a/includes/classes/Feature/Facets/Types/MetaRange/Renderer.php b/includes/classes/Feature/Facets/Types/MetaRange/Renderer.php
index fd5d1d8599..3fcc1e8197 100644
--- a/includes/classes/Feature/Facets/Types/MetaRange/Renderer.php
+++ b/includes/classes/Feature/Facets/Types/MetaRange/Renderer.php
@@ -8,7 +8,7 @@
namespace ElasticPress\Feature\Facets\Types\MetaRange;
-use ElasticPress\Features as Features;
+use ElasticPress\Features;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/classes/Feature/Facets/Types/PostType/Renderer.php b/includes/classes/Feature/Facets/Types/PostType/Renderer.php
index ea93a4169b..6a371b178a 100644
--- a/includes/classes/Feature/Facets/Types/PostType/Renderer.php
+++ b/includes/classes/Feature/Facets/Types/PostType/Renderer.php
@@ -8,7 +8,7 @@
namespace ElasticPress\Feature\Facets\Types\PostType;
-use ElasticPress\Features as Features;
+use ElasticPress\Features;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/classes/Feature/Facets/Types/Taxonomy/Renderer.php b/includes/classes/Feature/Facets/Types/Taxonomy/Renderer.php
index ac854cfa14..44fb7a7dc0 100644
--- a/includes/classes/Feature/Facets/Types/Taxonomy/Renderer.php
+++ b/includes/classes/Feature/Facets/Types/Taxonomy/Renderer.php
@@ -8,8 +8,8 @@
namespace ElasticPress\Feature\Facets\Types\Taxonomy;
-use ElasticPress\Features as Features;
-use ElasticPress\Utils as Utils;
+use ElasticPress\Features;
+use ElasticPress\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/classes/Feature/Facets/Types/Taxonomy/Widget.php b/includes/classes/Feature/Facets/Types/Taxonomy/Widget.php
index 189b0e37f6..42f0de7def 100644
--- a/includes/classes/Feature/Facets/Types/Taxonomy/Widget.php
+++ b/includes/classes/Feature/Facets/Types/Taxonomy/Widget.php
@@ -7,8 +7,7 @@
namespace ElasticPress\Feature\Facets\Types\Taxonomy;
-use \WP_Widget as WP_Widget;
-use ElasticPress\Features as Features;
+use ElasticPress\Features;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
@@ -17,7 +16,7 @@
/**
* Facets widget class
*/
-class Widget extends WP_Widget {
+class Widget extends \WP_Widget {
/**
* The renderer instance.
*
diff --git a/includes/classes/Feature/InstantResults/InstantResults.php b/includes/classes/Feature/InstantResults/InstantResults.php
index ebe2bdbb72..e7c348a2ac 100644
--- a/includes/classes/Feature/InstantResults/InstantResults.php
+++ b/includes/classes/Feature/InstantResults/InstantResults.php
@@ -7,12 +7,12 @@
namespace ElasticPress\Feature\InstantResults;
-use ElasticPress\Elasticsearch as Elasticsearch;
-use ElasticPress\Feature as Feature;
+use ElasticPress\Elasticsearch;
+use ElasticPress\Feature;
use ElasticPress\FeatureRequirementsStatus;
-use ElasticPress\Features as Features;
-use ElasticPress\Indexables as Indexables;
-use ElasticPress\Utils as Utils;
+use ElasticPress\Features;
+use ElasticPress\Indexables;
+use ElasticPress\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/classes/Feature/ProtectedContent/ProtectedContent.php b/includes/classes/Feature/ProtectedContent/ProtectedContent.php
index 9a766e1d97..144c26227c 100644
--- a/includes/classes/Feature/ProtectedContent/ProtectedContent.php
+++ b/includes/classes/Feature/ProtectedContent/ProtectedContent.php
@@ -8,10 +8,10 @@
namespace ElasticPress\Feature\ProtectedContent;
-use ElasticPress\Utils as Utils;
-use ElasticPress\Feature as Feature;
-use ElasticPress\Features as Features;
-use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus;
+use ElasticPress\Feature;
+use ElasticPress\FeatureRequirementsStatus;
+use ElasticPress\Features;
+use ElasticPress\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/classes/Feature/RelatedPosts/RelatedPosts.php b/includes/classes/Feature/RelatedPosts/RelatedPosts.php
index c1f1a75ceb..ebf6deae12 100644
--- a/includes/classes/Feature/RelatedPosts/RelatedPosts.php
+++ b/includes/classes/Feature/RelatedPosts/RelatedPosts.php
@@ -8,11 +8,10 @@
namespace ElasticPress\Feature\RelatedPosts;
-use ElasticPress\Feature as Feature;
-use ElasticPress\Elasticsearch as Elasticsearch;
+use \WP_Query;
+use ElasticPress\Elasticsearch;
+use ElasticPress\Feature;
use ElasticPress\Utils;
-use ElasticPress\Post\Post as Post;
-use \WP_Query as WP_Query;
/**
* Related posts feature class
diff --git a/includes/classes/Feature/RelatedPosts/Widget.php b/includes/classes/Feature/RelatedPosts/Widget.php
index 74c1b1823d..7252a311cf 100644
--- a/includes/classes/Feature/RelatedPosts/Widget.php
+++ b/includes/classes/Feature/RelatedPosts/Widget.php
@@ -8,8 +8,7 @@
namespace ElasticPress\Feature\RelatedPosts;
-use \WP_Widget as WP_Widget;
-use ElasticPress\Features as Features;
+use ElasticPress\Features;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
@@ -18,7 +17,7 @@
/**
* Related posts widget class
*/
-class Widget extends WP_Widget {
+class Widget extends \WP_Widget {
/**
* Initialize the widget
diff --git a/includes/classes/Feature/Search/Search.php b/includes/classes/Feature/Search/Search.php
index 42a714830a..7d15aaf353 100644
--- a/includes/classes/Feature/Search/Search.php
+++ b/includes/classes/Feature/Search/Search.php
@@ -237,7 +237,16 @@ public function add_search_highlight_tags( $formatted_args, $args ) {
'pre_tags' => [ $opening_tag ],
'post_tags' => [ $closing_tag ],
'type' => 'plain',
- 'number_of_fragments' => 0,
+ /**
+ * Filter the maximum number of fragments highlighted for a searched field.
+ *
+ * @since 4.7.2
+ * @hook ep_highlight_number_of_fragments
+ * @param {int} $max_fragments Maximum number of fragments for field.
+ * @param {string} $field Search field being setup.
+ * @return {int} New maximum number of fragments to highlight for the searched field.
+ */
+ 'number_of_fragments' => apply_filters( 'ep_highlight_number_of_fragments', 0, $field ),
];
}
diff --git a/includes/classes/Feature/Search/Synonyms.php b/includes/classes/Feature/Search/Synonyms.php
index 0c3ce00c76..cf3fccec97 100644
--- a/includes/classes/Feature/Search/Synonyms.php
+++ b/includes/classes/Feature/Search/Synonyms.php
@@ -7,12 +7,11 @@
namespace ElasticPress\Feature\Search;
-use ElasticPress\Feature;
-use ElasticPress\Features;
-use ElasticPress\Indexables;
use ElasticPress\Elasticsearch;
use ElasticPress\FeatureRequirementsStatus;
-use ElasticPress\Utils as Utils;
+use ElasticPress\Features;
+use ElasticPress\Indexables;
+use ElasticPress\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/classes/Feature/SearchOrdering/SearchOrdering.php b/includes/classes/Feature/SearchOrdering/SearchOrdering.php
index 33529ed924..4550371b8d 100644
--- a/includes/classes/Feature/SearchOrdering/SearchOrdering.php
+++ b/includes/classes/Feature/SearchOrdering/SearchOrdering.php
@@ -8,9 +8,8 @@
namespace ElasticPress\Feature\SearchOrdering;
use ElasticPress\Feature;
-use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus;
+use ElasticPress\FeatureRequirementsStatus;
use ElasticPress\Features;
-use ElasticPress\Indexable\Post\Post;
use ElasticPress\Indexables;
use ElasticPress\Utils;
diff --git a/includes/classes/Feature/Terms/Terms.php b/includes/classes/Feature/Terms/Terms.php
index 46cda3ed79..c0d406557d 100644
--- a/includes/classes/Feature/Terms/Terms.php
+++ b/includes/classes/Feature/Terms/Terms.php
@@ -8,10 +8,10 @@
namespace ElasticPress\Feature\Terms;
-use ElasticPress\Feature as Feature;
-use ElasticPress\Indexables as Indexables;
-use ElasticPress\Indexable as Indexable;
-use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus;
+use ElasticPress\Feature;
+use ElasticPress\FeatureRequirementsStatus;
+use ElasticPress\Indexable;
+use ElasticPress\Indexables;
/**
* Terms feature class
diff --git a/includes/classes/Feature/Users/Users.php b/includes/classes/Feature/Users/Users.php
index 34868d2ac8..794e8d62ce 100644
--- a/includes/classes/Feature/Users/Users.php
+++ b/includes/classes/Feature/Users/Users.php
@@ -8,11 +8,11 @@
namespace ElasticPress\Feature\Users;
-use ElasticPress\Feature as Feature;
-use ElasticPress\Indexables as Indexables;
-use ElasticPress\Indexable as Indexable;
-use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus;
-use ElasticPress\Utils as Utils;
+use ElasticPress\Feature;
+use ElasticPress\FeatureRequirementsStatus;
+use ElasticPress\Indexable;
+use ElasticPress\Indexables;
+use ElasticPress\Utils;
/**
* Users feature class
diff --git a/includes/classes/Feature/WooCommerce/Orders.php b/includes/classes/Feature/WooCommerce/Orders.php
index e44ca2a249..e53e2d9a8a 100644
--- a/includes/classes/Feature/WooCommerce/Orders.php
+++ b/includes/classes/Feature/WooCommerce/Orders.php
@@ -134,6 +134,11 @@ public function allow_meta_keys( $meta ) {
* @return array
*/
public function add_order_items_search( $post_args, $post_id ) {
+ $order = wc_get_order( $post_id );
+ if ( ! $order ) {
+ return $post_args;
+ }
+
$searchable_post_types = $this->get_admin_searchable_post_types();
// Make sure it is only WooCommerce orders we touch.
@@ -144,7 +149,6 @@ public function add_order_items_search( $post_args, $post_id ) {
$post_indexable = Indexables::factory()->get( 'post' );
// Get order items.
- $order = wc_get_order( $post_id );
$item_meta = [];
foreach ( $order->get_items() as $delta => $product_item ) {
// WooCommerce 3.x uses WC_Order_Item_Product instance while 2.x an array
@@ -298,10 +302,10 @@ public function get_supported_post_types() : array {
*
* @hook ep_woocommerce_orders_supported_post_types
* @since 4.7.0
- * @param {array} $post_types Post types
+ * @param {array} $supported_post_types Post types
* @return {array} New post types
*/
- $supported_post_types = apply_filters( 'ep_woocommerce_orders_supported_post_types', $post_types );
+ $supported_post_types = apply_filters( 'ep_woocommerce_orders_supported_post_types', $supported_post_types );
$supported_post_types = array_intersect(
$supported_post_types,
diff --git a/includes/classes/Feature/WooCommerce/Products.php b/includes/classes/Feature/WooCommerce/Products.php
index b5b08217fa..36ea42f671 100644
--- a/includes/classes/Feature/WooCommerce/Products.php
+++ b/includes/classes/Feature/WooCommerce/Products.php
@@ -740,11 +740,11 @@ public function get_supported_post_types( \WP_Query $query ) : array {
*
* @hook ep_woocommerce_products_supported_post_types
* @since 4.7.0
- * @param {array} $post_types Post types
- * @param {WP_Query} $query The WP_Query object
+ * @param {array} $supported_post_types Post types
+ * @param {WP_Query} $query The WP_Query object
* @return {array} New post types
*/
- $supported_post_types = apply_filters( 'ep_woocommerce_products_supported_post_types', $post_types, $query );
+ $supported_post_types = apply_filters( 'ep_woocommerce_products_supported_post_types', $supported_post_types, $query );
$supported_post_types = array_intersect(
$supported_post_types,
diff --git a/includes/classes/Features.php b/includes/classes/Features.php
index 20349440c7..51a4c9f5e4 100644
--- a/includes/classes/Features.php
+++ b/includes/classes/Features.php
@@ -8,7 +8,7 @@
namespace ElasticPress;
-use ElasticPress\Utils as Utils;
+use ElasticPress\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/classes/HealthCheck/HealthCheckElasticsearch.php b/includes/classes/HealthCheck/HealthCheckElasticsearch.php
index 74aab0f6b5..537fc8abab 100644
--- a/includes/classes/HealthCheck/HealthCheckElasticsearch.php
+++ b/includes/classes/HealthCheck/HealthCheckElasticsearch.php
@@ -8,9 +8,9 @@
namespace ElasticPress\HealthCheck;
-use ElasticPress\HealthCheck as HealthCheck;
-use ElasticPress\Utils as Utils;
-use ElasticPress\Elasticsearch as Elasticsearch;
+use ElasticPress\Elasticsearch;
+use ElasticPress\HealthCheck;
+use ElasticPress\Utils;
if ( ! defined( 'ABSPATH' ) ) {
// @codeCoverageIgnoreStart
diff --git a/includes/classes/IndexHelper.php b/includes/classes/IndexHelper.php
index 3b7db2950f..6f759d1a1d 100644
--- a/includes/classes/IndexHelper.php
+++ b/includes/classes/IndexHelper.php
@@ -13,7 +13,7 @@
namespace ElasticPress;
-use ElasticPress\Utils as Utils;
+use ElasticPress\Utils;
/**
* Index Helper Class.
diff --git a/includes/classes/Indexable.php b/includes/classes/Indexable.php
index aea845cdb1..e66bb18f63 100644
--- a/includes/classes/Indexable.php
+++ b/includes/classes/Indexable.php
@@ -10,9 +10,8 @@
namespace ElasticPress;
-use ElasticPress\Elasticsearch as Elasticsearch;
-use ElasticPress\SyncManager as SyncManager;
-use ElasticPress\QueryIntegration as QueryIntegration;
+use ElasticPress\Elasticsearch;
+use ElasticPress\SyncManager;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
@@ -49,7 +48,7 @@ abstract class Indexable {
* Instance of QueryIntegration. This should handle integrating with a default
* WP query.
*
- * @var QueryIntegration
+ * @var object
* @since 3.0
*/
public $query_integration;
@@ -1149,7 +1148,7 @@ abstract public function prepare_document( $object_id );
* process across indexables.
*
* @param array $args Array to query DB against.
- * @return boolean
+ * @return array
*/
abstract public function query_db( $args );
diff --git a/includes/classes/Indexable/Comment/Comment.php b/includes/classes/Indexable/Comment/Comment.php
index 73392ab2a5..cfa5eb5c4a 100644
--- a/includes/classes/Indexable/Comment/Comment.php
+++ b/includes/classes/Indexable/Comment/Comment.php
@@ -8,12 +8,12 @@
namespace ElasticPress\Indexable\Comment;
-use ElasticPress\Indexable as Indexable;
-use ElasticPress\Indexables as Indexables;
-use ElasticPress\Elasticsearch as Elasticsearch;
-use ElasticPress\Indexable\Post\DateQuery as DateQuery;
-use \WP_Comment_Query as WP_Comment_Query;
-use ElasticPress\Features as Features;
+use \WP_Comment_Query;
+use ElasticPress\Elasticsearch;
+use ElasticPress\Features;
+use ElasticPress\Indexable;
+use ElasticPress\Indexable\Post\DateQuery;
+use ElasticPress\Indexables;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/classes/Indexable/Comment/QueryIntegration.php b/includes/classes/Indexable/Comment/QueryIntegration.php
index cb94d3bbae..c1f8043f45 100644
--- a/includes/classes/Indexable/Comment/QueryIntegration.php
+++ b/includes/classes/Indexable/Comment/QueryIntegration.php
@@ -8,9 +8,9 @@
namespace ElasticPress\Indexable\Comment;
-use ElasticPress\Indexables as Indexables;
-use \WP_Comment_Query as WP_Comment_Query;
-use ElasticPress\Utils as Utils;
+use \WP_Comment_Query;
+use ElasticPress\Indexables;
+use ElasticPress\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/classes/Indexable/Comment/SyncManager.php b/includes/classes/Indexable/Comment/SyncManager.php
index 719bac237f..0291a85310 100644
--- a/includes/classes/Indexable/Comment/SyncManager.php
+++ b/includes/classes/Indexable/Comment/SyncManager.php
@@ -8,9 +8,8 @@
namespace ElasticPress\Indexable\Comment;
-use ElasticPress\Indexables as Indexables;
-use ElasticPress\Elasticsearch as Elasticsearch;
-use ElasticPress\SyncManager as SyncManagerAbstract;
+use ElasticPress\Elasticsearch;
+use ElasticPress\Indexables;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
@@ -19,7 +18,7 @@
/**
* Sync manager class
*/
-class SyncManager extends SyncManagerAbstract {
+class SyncManager extends \ElasticPress\SyncManager {
/**
* Indexable slug
*
diff --git a/includes/classes/Indexable/Post/DateQuery.php b/includes/classes/Indexable/Post/DateQuery.php
index 84f76004ab..06e38f2deb 100644
--- a/includes/classes/Indexable/Post/DateQuery.php
+++ b/includes/classes/Indexable/Post/DateQuery.php
@@ -8,7 +8,7 @@
namespace ElasticPress\Indexable\Post;
-use \WP_Date_Query as WP_Date_Query;
+use \WP_Date_Query;
if ( ! defined( 'ABSPATH' ) ) {
// @codeCoverageIgnoreStart
diff --git a/includes/classes/Indexable/Post/Post.php b/includes/classes/Indexable/Post/Post.php
index 26c6ffb2c7..55475f04ca 100644
--- a/includes/classes/Indexable/Post/Post.php
+++ b/includes/classes/Indexable/Post/Post.php
@@ -8,10 +8,10 @@
namespace ElasticPress\Indexable\Post;
-use ElasticPress\Indexable as Indexable;
-use ElasticPress\Elasticsearch as Elasticsearch;
-use \WP_Query as WP_Query;
-use \WP_User as WP_User;
+use \WP_Query;
+use \WP_User;
+use ElasticPress\Elasticsearch;
+use ElasticPress\Indexable;
if ( ! defined( 'ABSPATH' ) ) {
// @codeCoverageIgnoreStart
@@ -1956,7 +1956,7 @@ protected function parse_post__not_in( $args ) {
'bool' => [
'must_not' => [
'terms' => [
- 'post_id' => (array) $args['post__not_in'],
+ 'post_id' => array_values( (array) $args['post__not_in'] ),
],
],
],
@@ -2268,7 +2268,7 @@ protected function parse_post_status( $args ) {
return [
$terms_map_name => [
- 'post_status' => $post_status,
+ 'post_status' => is_array( $post_status ) ? array_values( $post_status ) : $post_status,
],
];
}
diff --git a/includes/classes/Indexable/Post/QueryIntegration.php b/includes/classes/Indexable/Post/QueryIntegration.php
index 100a778759..e383fa17df 100644
--- a/includes/classes/Indexable/Post/QueryIntegration.php
+++ b/includes/classes/Indexable/Post/QueryIntegration.php
@@ -8,9 +8,9 @@
namespace ElasticPress\Indexable\Post;
-use ElasticPress\Indexables as Indexables;
-use \WP_Query as WP_Query;
-use ElasticPress\Utils as Utils;
+use \WP_Query;
+use ElasticPress\Indexables;
+use ElasticPress\Utils;
if ( ! defined( 'ABSPATH' ) ) {
// @codeCoverageIgnoreStart
diff --git a/includes/classes/Indexable/Post/SyncManager.php b/includes/classes/Indexable/Post/SyncManager.php
index 8c82cfa96d..ace0cf9637 100644
--- a/includes/classes/Indexable/Post/SyncManager.php
+++ b/includes/classes/Indexable/Post/SyncManager.php
@@ -8,11 +8,10 @@
namespace ElasticPress\Indexable\Post;
-use ElasticPress\Elasticsearch as Elasticsearch;
-use ElasticPress\Indexables as Indexables;
-use ElasticPress\SyncManager as SyncManagerAbstract;
-use ElasticPress\Utils;
+use ElasticPress\Elasticsearch;
+use ElasticPress\Indexables;
use ElasticPress\IndexHelper;
+use ElasticPress\Utils;
if ( ! defined( 'ABSPATH' ) ) {
// @codeCoverageIgnoreStart
@@ -23,7 +22,7 @@
/**
* Sync manager class
*/
-class SyncManager extends SyncManagerAbstract {
+class SyncManager extends \ElasticPress\SyncManager {
/**
* Indexable slug
@@ -54,9 +53,9 @@ public function setup() {
return;
}
- add_action( 'wp_insert_post', array( $this, 'action_sync_on_update' ), 999, 3 );
- add_action( 'add_attachment', array( $this, 'action_sync_on_update' ), 999, 3 );
- add_action( 'edit_attachment', array( $this, 'action_sync_on_update' ), 999, 3 );
+ add_action( 'wp_insert_post', array( $this, 'action_sync_on_update' ), 999 );
+ add_action( 'add_attachment', array( $this, 'action_sync_on_update' ), 999 );
+ add_action( 'edit_attachment', array( $this, 'action_sync_on_update' ), 999 );
add_action( 'wp_media_attach_action', array( $this, 'action_sync_on_media_attach' ), 999, 2 );
add_action( 'delete_post', array( $this, 'action_delete_post' ) );
add_action( 'updated_post_meta', array( $this, 'action_queue_meta_sync' ), 10, 4 );
diff --git a/includes/classes/Indexable/Term/QueryIntegration.php b/includes/classes/Indexable/Term/QueryIntegration.php
index e3d894602f..9977c1bb22 100644
--- a/includes/classes/Indexable/Term/QueryIntegration.php
+++ b/includes/classes/Indexable/Term/QueryIntegration.php
@@ -8,8 +8,8 @@
namespace ElasticPress\Indexable\Term;
+use \WP_Term_Query;
use ElasticPress\Indexables;
-use \WP_Term_Query as WP_Term_Query;
use ElasticPress\Utils;
if ( ! defined( 'ABSPATH' ) ) {
diff --git a/includes/classes/Indexable/Term/SyncManager.php b/includes/classes/Indexable/Term/SyncManager.php
index 9896fa92b4..29912a7849 100644
--- a/includes/classes/Indexable/Term/SyncManager.php
+++ b/includes/classes/Indexable/Term/SyncManager.php
@@ -8,9 +8,8 @@
namespace ElasticPress\Indexable\Term;
-use ElasticPress\Indexables as Indexables;
-use ElasticPress\Elasticsearch as Elasticsearch;
-use ElasticPress\SyncManager as SyncManagerAbstract;
+use ElasticPress\Elasticsearch;
+use ElasticPress\Indexables;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
@@ -19,7 +18,7 @@
/**
* Sync manager class
*/
-class SyncManager extends SyncManagerAbstract {
+class SyncManager extends \ElasticPress\SyncManager {
/**
* Indexable slug
*
diff --git a/includes/classes/Indexable/Term/Term.php b/includes/classes/Indexable/Term/Term.php
index 817139028c..14c370be71 100644
--- a/includes/classes/Indexable/Term/Term.php
+++ b/includes/classes/Indexable/Term/Term.php
@@ -8,9 +8,9 @@
namespace ElasticPress\Indexable\Term;
-use ElasticPress\Indexable as Indexable;
-use ElasticPress\Elasticsearch as Elasticsearch;
-use \WP_Term_Query as WP_Term_Query;
+use \WP_Term_Query;
+use ElasticPress\Elasticsearch;
+use ElasticPress\Indexable;
if ( ! defined( 'ABSPATH' ) ) {
// @codeCoverageIgnoreStart
diff --git a/includes/classes/Indexable/User/QueryIntegration.php b/includes/classes/Indexable/User/QueryIntegration.php
index 66809f9a4f..abefedf100 100644
--- a/includes/classes/Indexable/User/QueryIntegration.php
+++ b/includes/classes/Indexable/User/QueryIntegration.php
@@ -8,9 +8,8 @@
namespace ElasticPress\Indexable\User;
-use ElasticPress\Indexables as Indexables;
-use \WP_User_Query as WP_User_Query;
-use ElasticPress\Utils as Utils;
+use \WP_User_Query;
+use ElasticPress\Indexables;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/classes/Indexable/User/SyncManager.php b/includes/classes/Indexable/User/SyncManager.php
index 2e2aa53baf..a7734cea0f 100644
--- a/includes/classes/Indexable/User/SyncManager.php
+++ b/includes/classes/Indexable/User/SyncManager.php
@@ -8,9 +8,8 @@
namespace ElasticPress\Indexable\User;
-use ElasticPress\Indexables as Indexables;
-use ElasticPress\Elasticsearch as Elasticsearch;
-use ElasticPress\SyncManager as SyncManagerAbstract;
+use ElasticPress\Elasticsearch;
+use ElasticPress\Indexables;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
@@ -19,7 +18,7 @@
/**
* Sync manager class
*/
-class SyncManager extends SyncManagerAbstract {
+class SyncManager extends \ElasticPress\SyncManager {
/**
* Indexable slug
*
diff --git a/includes/classes/Indexable/User/User.php b/includes/classes/Indexable/User/User.php
index 8b6ab429f3..fa5dea3f83 100644
--- a/includes/classes/Indexable/User/User.php
+++ b/includes/classes/Indexable/User/User.php
@@ -8,10 +8,10 @@
namespace ElasticPress\Indexable\User;
-use ElasticPress\Indexable as Indexable;
-use ElasticPress\Elasticsearch as Elasticsearch;
-use \WP_User_Query as WP_User_Query;
-use ElasticPress\Utils as Utils;
+use \WP_User_Query;
+use ElasticPress\Elasticsearch;
+use ElasticPress\Indexable;
+use ElasticPress\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/classes/Indexables.php b/includes/classes/Indexables.php
index da5addb0e4..4cee9d7179 100644
--- a/includes/classes/Indexables.php
+++ b/includes/classes/Indexables.php
@@ -152,7 +152,7 @@ public function get_all( $global = null, $slug_only = false, $status = 'active'
/**
* Return singleton instance of class
*
- * @return object
+ * @return self
*/
public static function factory() {
static $instance = false;
diff --git a/includes/classes/Stats.php b/includes/classes/Stats.php
index a823fe55c4..a5dae9885e 100644
--- a/includes/classes/Stats.php
+++ b/includes/classes/Stats.php
@@ -8,7 +8,7 @@
namespace ElasticPress;
-use ElasticPress\Utils as Utils;
+use ElasticPress\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/classes/SyncManager.php b/includes/classes/SyncManager.php
index 119313abc0..c2187f9f24 100644
--- a/includes/classes/SyncManager.php
+++ b/includes/classes/SyncManager.php
@@ -69,8 +69,9 @@ public function __construct( $indexable_slug ) {
/**
* Add an object to the sync queue.
*
- * @param id $object_id object ID to sync
- * @since 3.1.2
+ * @since 3.1.2
+ *
+ * @param int $object_id Object ID to sync.
* @return boolean
*/
public function add_to_queue( $object_id ) {
@@ -95,8 +96,9 @@ public function add_to_queue( $object_id ) {
/**
* Remove an object from the sync queue.
*
- * @param id $object_id object ID to remove from the queue
- * @since 3.5
+ * @since 3.5
+ *
+ * @param int $object_id Object ID to remove from the queue.
* @return boolean
*/
public function remove_from_queue( $object_id ) {
@@ -147,7 +149,6 @@ public function index_sync_queue_on_redirect( $location ) {
return $location;
}
-
/**
* Sync objects in queue.
*
diff --git a/includes/dashboard.php b/includes/dashboard.php
index 5c9b8a1def..24285bc743 100644
--- a/includes/dashboard.php
+++ b/includes/dashboard.php
@@ -8,11 +8,9 @@
namespace ElasticPress\Dashboard;
-use ElasticPress\Utils as Utils;
+use ElasticPress\Utils;
use ElasticPress\Elasticsearch;
use ElasticPress\Features;
-use ElasticPress\Indexables;
-use ElasticPress\Installer;
use ElasticPress\AdminNotices;
use ElasticPress\Screen;
use ElasticPress\Stats;
@@ -139,15 +137,14 @@ function filter_allowed_html( $allowedtags, $context ) {
* @since 3.0
*/
function log_version_query_error( $query ) {
- $is_network = defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK;
+ // Ignore fake requests like the autosuggest template generation
+ if ( ! empty( $query['request'] ) && is_array( $query['request'] ) && ! empty( $query['request']['is_ep_fake_request'] ) ) {
+ return;
+ }
$logging_key = 'logging_ep_es_info';
- if ( $is_network ) {
- $logging = get_site_transient( $logging_key );
- } else {
- $logging = get_transient( $logging_key );
- }
+ $logging = Utils\get_transient( $logging_key );
// Are we logging the version query results?
if ( '1' === $logging ) {
@@ -176,15 +173,9 @@ function log_version_query_error( $query ) {
// Store the response code, and remove the flag that says
// we're logging the response code so we don't log additional
// queries.
- if ( $is_network ) {
- set_site_transient( $response_code_key, $response_code, $cache_time );
- set_site_transient( $response_error_key, $response_error, $cache_time );
- delete_site_transient( $logging_key );
- } else {
- set_transient( $response_code_key, $response_code, $cache_time );
- set_transient( $response_error_key, $response_error, $cache_time );
- delete_transient( $logging_key );
- }
+ Utils\set_transient( $response_code_key, $response_code, $cache_time );
+ Utils\set_transient( $response_error_key, $response_error, $cache_time );
+ Utils\delete_transient( $logging_key );
}
}
@@ -326,19 +317,11 @@ function maybe_notice( $force = false ) {
*/
$cache_time = apply_filters( 'ep_es_info_cache_expiration', ( 5 * MINUTE_IN_SECONDS ) );
- if ( defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK ) {
- set_site_transient(
- 'logging_ep_es_info',
- '1',
- $cache_time
- );
- } else {
- $a = set_transient(
- 'logging_ep_es_info',
- '1',
- $cache_time
- );
- }
+ Utils\set_transient(
+ 'logging_ep_es_info',
+ '1',
+ $cache_time
+ );
// Fetch ES version
Elasticsearch::factory()->get_elasticsearch_version( $force );
diff --git a/includes/partials/dashboard-page.php b/includes/partials/dashboard-page.php
index 394c3ef7a9..9ee27b4bf8 100644
--- a/includes/partials/dashboard-page.php
+++ b/includes/partials/dashboard-page.php
@@ -6,9 +6,9 @@
* @package elasticpress
*/
-use ElasticPress\Elasticsearch as Elasticsearch;
-use ElasticPress\Features as Features;
-use ElasticPress\Utils as Utils;
+use ElasticPress\Elasticsearch;
+use ElasticPress\Features;
+use ElasticPress\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/partials/stats-page.php b/includes/partials/stats-page.php
index b180bf2fcb..d86653d723 100644
--- a/includes/partials/stats-page.php
+++ b/includes/partials/stats-page.php
@@ -6,9 +6,8 @@
* @package elasticpress
*/
-use ElasticPress\Stats as Stats;
-use ElasticPress\Elasticsearch as Elasticsearch;
-use ElasticPress\Utils as Utils;
+use ElasticPress\Stats;
+use ElasticPress\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
diff --git a/includes/utils.php b/includes/utils.php
index 3ffc32d646..64ce89047c 100644
--- a/includes/utils.php
+++ b/includes/utils.php
@@ -63,8 +63,8 @@ function get_capability() : string {
*
* @since 4.5.0
* @hook ep_capability
- * @param {bool} $capability Capability name. Defaults to `'elasticpress_manage'`
- * @return {bool} New capability value
+ * @param {string} $capability Capability name. Defaults to `'manage_elasticpress'`
+ * @return {string} New capability value
*/
return apply_filters( 'ep_capability', 'manage_elasticpress' );
}
@@ -81,8 +81,8 @@ function get_network_capability() : string {
*
* @since 4.5.0
* @hook ep_network_capability
- * @param {bool} $capability Capability name. Defaults to `'manage_network_elasticpress'`
- * @return {bool} New capability value
+ * @param {string} $capability Capability name. Defaults to `'manage_network_elasticpress'`
+ * @return {string} New capability value
*/
return apply_filters( 'ep_network_capability', 'manage_network_elasticpress' );
}
@@ -602,7 +602,7 @@ function update_option( $option, $value, $autoload = null ) {
* @since 3.6.0
* @param string $option Name of the option to get.
* @param mixed $default_value Default value.
- * @return bool
+ * @return mixed
*/
function get_option( $option, $default_value = false ) {
if ( defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK ) {
diff --git a/lang/elasticpress.pot b/lang/elasticpress.pot
index 713a8487c2..9cb766bc28 100644
--- a/lang/elasticpress.pot
+++ b/lang/elasticpress.pot
@@ -2,14 +2,14 @@
# This file is distributed under the GPL v2 or later.
msgid ""
msgstr ""
-"Project-Id-Version: ElasticPress 4.7.1\n"
+"Project-Id-Version: ElasticPress 4.7.2\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/elasticpress\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"POT-Creation-Date: 2023-08-31T16:55:04+00:00\n"
+"POT-Creation-Date: 2023-10-10T17:34:33+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.8.1\n"
"X-Domain: elasticpress\n"
@@ -36,6 +36,11 @@ msgstr ""
msgid "https://10up.com"
msgstr ""
+#. translators: %s: Minimum required PHP version
+#: elasticpress.php:50
+msgid "ElasticPress requires PHP version %s or later. Please upgrade PHP or disable the plugin."
+msgstr ""
+
#: includes/classes/AdminNotices.php:126
msgid "Autosuggest feature is enabled. If documents feature is enabled, your media will also become searchable in the frontend."
msgstr ""
@@ -446,7 +451,7 @@ msgstr ""
#: includes/classes/Feature.php:368
#: includes/classes/StatusReport/ElasticPress.php:79
-#: includes/dashboard.php:689
+#: includes/dashboard.php:672
#: includes/partials/settings-page.php:39
#: assets/js/blocks/facets/common/edit.js:87
#: assets/js/blocks/facets/meta-range/edit.js:89
@@ -467,9 +472,9 @@ msgstr ""
#: includes/classes/Feature.php:374
#: includes/classes/Feature/Autosuggest/Autosuggest.php:110
#: includes/classes/Feature/InstantResults/InstantResults.php:181
-#: includes/classes/Feature/Search/Search.php:614
-#: includes/classes/Feature/Search/Search.php:631
-#: includes/classes/Feature/Search/Search.php:652
+#: includes/classes/Feature/Search/Search.php:623
+#: includes/classes/Feature/Search/Search.php:640
+#: includes/classes/Feature/Search/Search.php:661
#: includes/classes/Feature/WooCommerce/WooCommerce.php:163
msgid "Enabled"
msgstr ""
@@ -477,9 +482,9 @@ msgstr ""
#: includes/classes/Feature.php:375
#: includes/classes/Feature/Autosuggest/Autosuggest.php:111
#: includes/classes/Feature/InstantResults/InstantResults.php:184
-#: includes/classes/Feature/Search/Search.php:615
-#: includes/classes/Feature/Search/Search.php:632
-#: includes/classes/Feature/Search/Search.php:653
+#: includes/classes/Feature/Search/Search.php:624
+#: includes/classes/Feature/Search/Search.php:641
+#: includes/classes/Feature/Search/Search.php:662
#: includes/classes/Feature/WooCommerce/WooCommerce.php:164
msgid "Disabled"
msgstr ""
@@ -493,7 +498,7 @@ msgid "Save"
msgstr ""
#: includes/classes/Feature/Autosuggest/Autosuggest.php:45
-#: includes/classes/Feature/Autosuggest/Autosuggest.php:831
+#: includes/classes/Feature/Autosuggest/Autosuggest.php:837
msgid "Autosuggest"
msgstr ""
@@ -537,29 +542,29 @@ msgstr ""
msgid "This address will be exposed to the public."
msgstr ""
-#: includes/classes/Feature/Autosuggest/Autosuggest.php:600
+#: includes/classes/Feature/Autosuggest/Autosuggest.php:598
msgid "This is a fake request to build the ElasticPress Autosuggest query. It is not really sent."
msgstr ""
-#: includes/classes/Feature/Autosuggest/Autosuggest.php:617
+#: includes/classes/Feature/Autosuggest/Autosuggest.php:623
msgid "This feature modifies the site’s default user experience by presenting a list of suggestions below detected search fields as text is entered into the field."
msgstr ""
-#: includes/classes/Feature/Autosuggest/Autosuggest.php:621
+#: includes/classes/Feature/Autosuggest/Autosuggest.php:627
msgid "You aren't using ElasticPress.io so we can't be sure your host is properly secured. Autosuggest requires a publicly accessible endpoint, which can expose private content and allow data modification if improperly configured."
msgstr ""
-#: includes/classes/Feature/Autosuggest/Autosuggest.php:771
+#: includes/classes/Feature/Autosuggest/Autosuggest.php:777
msgid "Connection"
msgstr ""
#. translators: 1: tag (ElasticPress.io); 2. ; 3: tag (KB article); 4. ; 5: tag (Site Health Debug Section); 6. ;
-#: includes/classes/Feature/Autosuggest/Autosuggest.php:780
+#: includes/classes/Feature/Autosuggest/Autosuggest.php:786
msgid "You are directly connected to %1$sElasticPress.io%2$s, ensuring the most performant Autosuggest experience. %3$sLearn more about what this means%4$s or %5$sclick here for debug information%6$s."
msgstr ""
#. translators: 1. elasticpress.io logo;
-#: includes/classes/Feature/Autosuggest/Autosuggest.php:835
+#: includes/classes/Feature/Autosuggest/Autosuggest.php:841
msgid "Autosuggest By %s"
msgstr ""
@@ -585,21 +590,21 @@ msgstr ""
msgid "We could not find any results"
msgstr ""
-#: includes/classes/Feature/Comments/Widget.php:31
+#: includes/classes/Feature/Comments/Widget.php:27
msgid "A search form for comments."
msgstr ""
-#: includes/classes/Feature/Comments/Widget.php:35
+#: includes/classes/Feature/Comments/Widget.php:31
msgid "ElasticPress - Comments"
msgstr ""
-#: includes/classes/Feature/Comments/Widget.php:109
-#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:130
-#: includes/classes/Feature/RelatedPosts/Widget.php:104
+#: includes/classes/Feature/Comments/Widget.php:105
+#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:129
+#: includes/classes/Feature/RelatedPosts/Widget.php:103
msgid "Title:"
msgstr ""
-#: includes/classes/Feature/Comments/Widget.php:116
+#: includes/classes/Feature/Comments/Widget.php:112
msgid "Search for comments on:"
msgstr ""
@@ -625,8 +630,8 @@ msgid "Did you mean"
msgstr ""
#: includes/classes/Feature/DidYouMean/DidYouMean.php:229
-#: includes/classes/Feature/Search/Synonyms.php:89
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:186
+#: includes/classes/Feature/Search/Synonyms.php:88
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:185
msgid "This feature requires the \"Post Search\" feature to be enabled"
msgstr ""
@@ -662,7 +667,7 @@ msgid "No results for: "
msgstr ""
#: includes/classes/Feature/Documents/Documents.php:28
-#: includes/partials/stats-page.php:60
+#: includes/partials/stats-page.php:59
msgid "Documents"
msgstr ""
@@ -751,7 +756,7 @@ msgid "Adds filter blocks that administrators can add to the we
msgstr ""
#: includes/classes/Feature/Facets/Types/Meta/Block.php:171
-#: includes/classes/Feature/Facets/Types/MetaRange/Block.php:221
+#: includes/classes/Feature/Facets/Types/MetaRange/Block.php:231
#: includes/classes/Feature/Facets/Types/PostType/Block.php:148
#: includes/classes/Feature/Facets/Types/Taxonomy/Block.php:216
msgid "Attribute parsing is now left to block.json."
@@ -791,54 +796,54 @@ msgstr ""
msgid "Search %s"
msgstr ""
-#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:33
+#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:32
msgid "Add a facet to an archive or search results page."
msgstr ""
-#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:37
+#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:36
msgid "ElasticPress - Filter by Taxonomy"
msgstr ""
-#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:101
-#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:106
+#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:100
+#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:105
msgid "all"
msgstr ""
-#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:102
-#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:105
+#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:101
+#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:104
msgid "any"
msgstr ""
-#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:117
+#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:116
msgid "Count"
msgstr ""
-#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:118
+#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:117
msgid "Term Name"
msgstr ""
-#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:122
+#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:121
msgid "Descending"
msgstr ""
-#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:123
+#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:122
msgid "Ascending"
msgstr ""
-#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:137
+#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:136
msgid "Taxonomy:"
msgstr ""
-#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:149
+#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:148
msgid "Order Terms By:"
msgstr ""
-#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:163
+#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:162
msgid "Term Order:"
msgstr ""
#. translators: "all" or "any", depending on configuration values, 3: URL
-#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:176
+#: includes/classes/Feature/Facets/Types/Taxonomy/Widget.php:175
msgid "Faceting will filter out any content that is not tagged to all selected terms; change this to show %1$s content tagged to %2$s selected term in ElasticPress settings."
msgstr ""
@@ -865,7 +870,7 @@ msgid "ElasticPress.io plan"
msgstr ""
#: includes/classes/Feature/InstantResults/InstantResults.php:139
-#: includes/classes/Feature/Search/Search.php:637
+#: includes/classes/Feature/Search/Search.php:646
msgid "Highlight tag "
msgstr ""
@@ -939,33 +944,33 @@ msgstr ""
msgid "You aren't using ElasticPress.io so we can't be sure your Elasticsearch instance is secure."
msgstr ""
-#: includes/classes/Feature/RelatedPosts/RelatedPosts.php:29
+#: includes/classes/Feature/RelatedPosts/RelatedPosts.php:28
#: assets/js/blocks/related-posts/Edit.js:86
#: dist/js/related-posts-block-script.js:1
msgid "Related Posts"
msgstr ""
-#: includes/classes/Feature/RelatedPosts/RelatedPosts.php:31
+#: includes/classes/Feature/RelatedPosts/RelatedPosts.php:30
msgid "ElasticPress understands data in real time, so it can instantly deliver engaging and precise related content with no impact on site performance."
msgstr ""
-#: includes/classes/Feature/RelatedPosts/RelatedPosts.php:33
+#: includes/classes/Feature/RelatedPosts/RelatedPosts.php:32
msgid "https://elasticpress.zendesk.com/hc/en-us/articles/360050447492-Configuring-ElasticPress-via-the-Plugin-Dashboard#related-posts"
msgstr ""
-#: includes/classes/Feature/RelatedPosts/RelatedPosts.php:349
+#: includes/classes/Feature/RelatedPosts/RelatedPosts.php:348
msgid "Output related content using our Widget or directly in your theme using our API functions."
msgstr ""
-#: includes/classes/Feature/RelatedPosts/Widget.php:30
+#: includes/classes/Feature/RelatedPosts/Widget.php:29
msgid "Show related posts using ElasticPress. This widget will only appear on single post, page, and custom type pages."
msgstr ""
-#: includes/classes/Feature/RelatedPosts/Widget.php:34
+#: includes/classes/Feature/RelatedPosts/Widget.php:33
msgid "ElasticPress - Related Posts"
msgstr ""
-#: includes/classes/Feature/RelatedPosts/Widget.php:112
+#: includes/classes/Feature/RelatedPosts/Widget.php:111
msgid "Number of Posts to Show:"
msgstr ""
@@ -981,172 +986,172 @@ msgstr ""
msgid "https://elasticpress.zendesk.com/hc/en-us/articles/360050447492-Configuring-ElasticPress-via-the-Plugin-Dashboard#post-search"
msgstr ""
-#: includes/classes/Feature/Search/Search.php:561
+#: includes/classes/Feature/Search/Search.php:570
msgid "Overcome higher-end performance and functional limits posed by the traditional WordPress structured (SQL) database to deliver superior keyword search, instantly. ElasticPress indexes custom fields, tags, and other metadata to improve search results. Fuzzy matching accounts for misspellings and verb tenses."
msgstr ""
-#: includes/classes/Feature/Search/Search.php:612
+#: includes/classes/Feature/Search/Search.php:621
msgid "Weight results by date"
msgstr ""
-#: includes/classes/Feature/Search/Search.php:629
+#: includes/classes/Feature/Search/Search.php:638
msgid "Highlighting status"
msgstr ""
-#: includes/classes/Feature/Search/Search.php:650
+#: includes/classes/Feature/Search/Search.php:659
msgid "Excerpt highlighting"
msgstr ""
-#: includes/classes/Feature/Search/Search.php:654
+#: includes/classes/Feature/Search/Search.php:663
msgid "By default, WordPress strips HTML from content excerpts. Enable when using the_excerpt() to display search results. "
msgstr ""
-#: includes/classes/Feature/Search/Search.php:660
+#: includes/classes/Feature/Search/Search.php:669
msgid "Advanced fields and weighting settings"
msgstr ""
-#: includes/classes/Feature/Search/Search.php:661
+#: includes/classes/Feature/Search/Search.php:670
msgid "Add synonyms to your post searches"
msgstr ""
-#: includes/classes/Feature/Search/Search.php:751
+#: includes/classes/Feature/Search/Search.php:760
#: assets/js/search/editor/plugins/exclude-from-search.js:23
#: dist/js/search-editor-script.js:1
msgid "Exclude from search results"
msgstr ""
-#: includes/classes/Feature/Search/Search.php:754
+#: includes/classes/Feature/Search/Search.php:763
msgid "Excludes this media from the results of your site's search form while ElasticPress is active."
msgstr ""
-#: includes/classes/Feature/Search/Search.php:756
+#: includes/classes/Feature/Search/Search.php:765
#: assets/js/search/editor/plugins/exclude-from-search.js:24
#: dist/js/search-editor-script.js:1
msgid "Excludes this post from the results of your site's search form while ElasticPress is active."
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:173
+#: includes/classes/Feature/Search/Synonyms.php:172
msgid "ElasticPress Synonyms"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:174
+#: includes/classes/Feature/Search/Synonyms.php:173
#: includes/classes/StatusReport/Features.php:91
msgid "Synonyms"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:220
+#: includes/classes/Feature/Search/Synonyms.php:219
msgid "Successfully updated synonym filter."
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:223
+#: includes/classes/Feature/Search/Synonyms.php:222
msgid "There was an error storing your synonyms."
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:226
+#: includes/classes/Feature/Search/Synonyms.php:225
msgid "There was a problem updating the index with your synonyms. If you have not indexed your data, please run an index."
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:229
+#: includes/classes/Feature/Search/Synonyms.php:228
msgid "There was an error updating the synonym list."
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:246
+#: includes/classes/Feature/Search/Synonyms.php:245
msgid "Elasticsearch Synonyms"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:640
+#: includes/classes/Feature/Search/Synonyms.php:639
msgid "# Defined sets (equivalent synonyms)."
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:643
+#: includes/classes/Feature/Search/Synonyms.php:642
msgid "# Defined alternatives (explicit mappings)."
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:657
+#: includes/classes/Feature/Search/Synonyms.php:656
msgid "Manage Synonyms"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:658
+#: includes/classes/Feature/Search/Synonyms.php:657
msgid "Synonyms enable more flexible search results that show relevant results even without an exact match. Synonyms can be defined as a sets where all words are synonyms for each other, or as alternatives where searches for the primary word will also match the rest, but no vice versa."
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:659
+#: includes/classes/Feature/Search/Synonyms.php:658
msgid "Switch to Advanced Text Editor"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:660
+#: includes/classes/Feature/Search/Synonyms.php:659
msgid "Switch to Visual Editor"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:662
+#: includes/classes/Feature/Search/Synonyms.php:661
msgid "Sets"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:663
+#: includes/classes/Feature/Search/Synonyms.php:662
msgid "Sets are terms that will all match each other for search results. This is useful where all words are considered equivalent, such as product renaming or regional variations like sneakers, tennis shoes, trainers, and runners."
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:664
+#: includes/classes/Feature/Search/Synonyms.php:663
msgid "Comma separated list of terms"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:665
+#: includes/classes/Feature/Search/Synonyms.php:664
msgid "Add Set"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:666
+#: includes/classes/Feature/Search/Synonyms.php:665
msgid "This set must contain at least 2 terms."
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:668
+#: includes/classes/Feature/Search/Synonyms.php:667
msgid "Alternatives"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:669
+#: includes/classes/Feature/Search/Synonyms.php:668
msgid "Alternatives are terms that will also be matched when you search for the primary term. For instance, a search for shoes can also include results for sneaker, sandals, boots, and high heels."
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:670
+#: includes/classes/Feature/Search/Synonyms.php:669
msgid "Primary term"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:671
+#: includes/classes/Feature/Search/Synonyms.php:670
msgid "Comma separated list of alternatives"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:672
+#: includes/classes/Feature/Search/Synonyms.php:671
msgid "Add Alternative"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:673
+#: includes/classes/Feature/Search/Synonyms.php:672
msgid "You must enter both a primary term and at least one alternative term."
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:675
+#: includes/classes/Feature/Search/Synonyms.php:674
msgid "Advanced Synonym Editor"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:676
+#: includes/classes/Feature/Search/Synonyms.php:675
msgid "When you add Sets and Alternatives above, we reduce them to SolrSynonyms which Elasticsearch can understand. If you are an advanced user, you can edit synonyms directly using Solr synonym formatting. This is beneficial if you want to import a large dictionary of synonyms, or want to export this site's synonyms for use on another site."
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:677
+#: includes/classes/Feature/Search/Synonyms.php:676
msgid "SolrSynonym Text"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:678
+#: includes/classes/Feature/Search/Synonyms.php:677
msgid "Alternatives must have both a primary term and at least one alternative term."
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:679
+#: includes/classes/Feature/Search/Synonyms.php:678
msgid "Sets must contain at least 2 terms."
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:681
+#: includes/classes/Feature/Search/Synonyms.php:680
msgid "Remove"
msgstr ""
-#: includes/classes/Feature/Search/Synonyms.php:682
+#: includes/classes/Feature/Search/Synonyms.php:681
msgid "Update Synonyms"
msgstr ""
@@ -1195,194 +1200,194 @@ msgstr ""
msgid "Weight: "
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:55
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:54
msgid "Custom Search Results"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:57
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:56
msgid "Insert specific posts into search results for specific search queries."
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:59
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:58
msgid "https://elasticpress.zendesk.com/hc/en-us/articles/360050447492-Configuring-ElasticPress-via-the-Plugin-Dashboard#custom-search-results"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:150
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:153
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:149
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:152
msgid "Custom result updated."
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:151
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:150
msgid "Custom field updated."
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:152
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:151
msgid "Custom field deleted."
msgstr ""
#. translators: %s: date and time of the revision
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:155
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:154
msgid "Custom result restored to revision from %s"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:156
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:155
msgid "Custom result published."
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:157
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:156
msgid "Custom result saved."
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:158
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:157
msgid "Custom result submitted."
msgstr ""
#. translators: Scheduled date.
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:161
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:160
msgid "Custom result scheduled for: %1$s."
msgstr ""
#. translators: Publish box date format, see https://php.net/date
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:163
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:162
msgid "M j, Y @ G:i"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:165
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:164
msgid "Custom result draft updated."
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:197
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:196
msgid "Selected posts will be inserted into search results in the specified position."
msgstr ""
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:219
#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:220
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:221
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:327
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:326
msgid "Custom Results"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:279
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:278
msgctxt "post type general name"
msgid "Custom Search Results"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:280
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:279
msgctxt "post type singular name"
msgid "Custom Search Result"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:281
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:280
msgctxt "admin menu"
msgid "Custom Search Results"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:282
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:281
msgctxt "add new on admin bar"
msgid "Custom Search Result"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:283
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:282
msgctxt "book"
msgid "Add New"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:284
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:283
msgid "Add New Custom Search Result"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:285
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:284
msgid "New Custom Search Result"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:286
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:285
msgid "Edit Custom Search Result"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:287
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:286
msgid "View Custom Search Result"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:288
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:287
msgid "All Custom Search Results"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:289
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:288
msgid "Search Custom Search Results"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:290
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:289
msgid "Parent Custom Search Result:"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:291
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:290
#: assets/js/ordering/pointers.js:265
#: dist/js/ordering-script.js:1
msgid "No results found."
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:292
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:291
msgid "No results found in Trash."
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:297
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:296
msgid "Posts to inject into search results"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:317
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:316
msgctxt "taxonomy general name"
msgid "Custom Results"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:318
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:317
msgctxt "taxonomy singular name"
msgid "Custom Result"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:319
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:318
msgid "Search Custom Results"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:320
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:319
msgid "All Custom Results"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:321
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:320
msgid "Parent Custom Result"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:322
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:321
msgid "Parent Custom Result:"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:323
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:322
msgid "Edit Custom Result"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:324
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:323
msgid "Update Custom Result"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:325
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:324
msgid "Add New Custom Result"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:326
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:325
msgid "New Custom Result Name"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:354
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:353
msgid "Manage Results"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:628
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:627
msgid "Enter Search Query"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:642
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:641
msgid "Search Query"
msgstr ""
-#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:889
+#: includes/classes/Feature/SearchOrdering/SearchOrdering.php:888
msgid "ElasticPress Custom Search Results"
msgstr ""
@@ -1546,17 +1551,17 @@ msgid "Error while fetching the mapping version."
msgstr ""
#. translators: Sync Page URL
-#: includes/classes/Indexable/Post/SyncManager.php:422
+#: includes/classes/Indexable/Post/SyncManager.php:421
msgid "Due to the number of posts associated with its child terms, you will need to resync after editing or deleting it."
msgstr ""
#. translators: Sync Page URL
-#: includes/classes/Indexable/Post/SyncManager.php:437
+#: includes/classes/Indexable/Post/SyncManager.php:436
msgid "Due to the number of posts associated with this term, you will need to resync after editing or deleting it."
msgstr ""
#. translators: Sync Page URL
-#: includes/classes/Indexable/Post/SyncManager.php:471
+#: includes/classes/Indexable/Post/SyncManager.php:470
msgid "Depending on the number of posts associated with a term, you may need to resync after editing or deleting it."
msgstr ""
@@ -1673,7 +1678,7 @@ msgid "Elasticsearch server"
msgstr ""
#: includes/classes/QueryLogger.php:247
-#: includes/partials/stats-page.php:92
+#: includes/partials/stats-page.php:91
msgid "sync your content"
msgstr ""
@@ -2090,46 +2095,46 @@ msgstr ""
msgid "Feature registration API"
msgstr ""
-#: includes/dashboard.php:295
+#: includes/dashboard.php:286
msgid "Dashboard"
msgstr ""
-#: includes/dashboard.php:679
+#: includes/dashboard.php:662
msgid "ElasticPress Features"
msgstr ""
-#: includes/dashboard.php:680
+#: includes/dashboard.php:663
msgid "Features"
msgstr ""
-#: includes/dashboard.php:688
+#: includes/dashboard.php:671
msgid "ElasticPress Settings"
msgstr ""
-#: includes/dashboard.php:697
-#: includes/dashboard.php:698
+#: includes/dashboard.php:680
+#: includes/dashboard.php:681
msgid "Sync"
msgstr ""
-#: includes/dashboard.php:706
+#: includes/dashboard.php:689
msgid "ElasticPress Index Health"
msgstr ""
-#: includes/dashboard.php:707
-#: includes/partials/stats-page.php:35
+#: includes/dashboard.php:690
+#: includes/partials/stats-page.php:34
msgid "Index Health"
msgstr ""
-#: includes/dashboard.php:715
+#: includes/dashboard.php:698
msgid "ElasticPress Status Report"
msgstr ""
-#: includes/dashboard.php:716
+#: includes/dashboard.php:699
#: includes/partials/status-report-page.php:17
msgid "Status Report"
msgstr ""
-#: includes/dashboard.php:914
+#: includes/dashboard.php:897
msgid "ElasticPress Indexing"
msgstr ""
@@ -2296,35 +2301,49 @@ msgstr ""
msgid "Save Changes"
msgstr ""
-#: includes/partials/stats-page.php:40
+#: includes/partials/stats-page.php:39
msgid "Index list"
msgstr ""
-#: includes/partials/stats-page.php:40
+#: includes/partials/stats-page.php:39
msgid "Health"
msgstr ""
-#: includes/partials/stats-page.php:52
+#: includes/partials/stats-page.php:51
msgid "Queries & Indexing total"
msgstr ""
-#: includes/partials/stats-page.php:69
+#: includes/partials/stats-page.php:68
msgid "Total Documents"
msgstr ""
-#: includes/partials/stats-page.php:73
+#: includes/partials/stats-page.php:72
msgid "Total Size"
msgstr ""
-#: includes/partials/stats-page.php:77
+#: includes/partials/stats-page.php:76
msgid "Total Memory"
msgstr ""
#. translators: %s: Sync page link.
-#: includes/partials/stats-page.php:88
+#: includes/partials/stats-page.php:87
msgid "We could not find any data for your Elasticsearch indices. Maybe you need to %s?"
msgstr ""
+#. translators: Error message
+#: assets/js/api-search/index.js:313
+#: dist/js/instant-results-script.js:1
+#: dist/js/woocommerce-order-search-script.js:1
+msgid "ElasticPress: Unable to fetch results. %s"
+msgstr ""
+
+#. translators: Response status code
+#: assets/js/api-search/src/hooks.js:68
+#: dist/js/instant-results-script.js:1
+#: dist/js/woocommerce-order-search-script.js:1
+msgid "HTTP %d."
+msgstr ""
+
#: assets/js/blocks/comments/Edit.js:80
#: dist/js/comments-block-script.js:1
msgid "Search settings"
diff --git a/package-lock.json b/package-lock.json
index 0c0b2bf7e1..12dd8f7af2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "elasticpress",
- "version": "4.7.1",
+ "version": "4.7.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "elasticpress",
- "version": "4.7.1",
+ "version": "4.7.2",
"license": "GPL-2.0-or-later",
"dependencies": {
"@10up/component-tooltip": "^2.0.0",
diff --git a/package.json b/package.json
index 96ae7faf5c..0c4b5be022 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "elasticpress",
- "version": "4.7.1",
+ "version": "4.7.2",
"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 0c6d9bbc14..d014623ecb 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: 6.3
-Stable tag: 4.7.1
+Stable tag: 4.7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -81,6 +81,38 @@ For sure! Feel free to submit ideas or feedback in general to our [GitHub repo](
== Changelog ==
+= 4.7.2 - 2023-10-10 =
+
+__Added:__
+
+* New `ep_highlight_number_of_fragments` filter. Props [@dgnorrod](https://github.com/dgnorrod) and [@felipeelia](https://github.com/felipeelia).
+* >=PHP 7.0 version check. Props [@bmarshall511](https://github.com/bmarshall511) and [@felipeelia](https://github.com/felipeelia).
+* GitHub action to automatically open a new issue when a new version of WordPress is released. Props [@felipeelia](https://github.com/felipeelia).
+
+__Removed:__
+
+* Unnecessary aliases in use statements. Props [@felipeelia](https://github.com/felipeelia).
+
+__Fixed:__
+
+* Calls to `ep_woocommerce_default_supported_post_types` were ignored. Props [@felipeelia](https://github.com/felipeelia) and [@MARQAS](https://github.com/MARQAS).
+* WooCommerce Orders search field disappearing when Orders Autosuggest receives an unexpected response from ElasticPress.io. Props [@JakePT](https://github.com/JakePT) and [@anjulahettige](https://github.com/anjulahettige).
+* Call composer while building docs. Props [@felipeelia](https://github.com/felipeelia).
+* Make sure `post__not_in` and `post_status` are translated into arrays, not objects. Props [@felipeelia](https://github.com/felipeelia).
+* Updated phpDoc entries. Props [@renatonascalves](https://github.com/renatonascalves).
+* Docblock for `Utils\get_option` return type. Props [@felipeelia](https://github.com/felipeelia).
+* Docblock for `ep_capability` and `ep_network_capability` filters. Props [@burhandodhy](https://github.com/burhandodhy).
+* PHP warning related to the Autosuggest template generation. Props [@felipeelia](https://github.com/felipeelia).
+* WooCommerce unit tests running multiple times. Props [@felipeelia](https://github.com/felipeelia).
+* Display the meta range facet block in versions prior to WP 6.1. Props [@felipeelia](https://github.com/felipeelia) and [@MARQAS](https://github.com/MARQAS).
+* Number of expected arguments for `add_attachment` and `edit_attachment`. Props [@burhandodhy](https://github.com/burhandodhy).
+* Error while running `composer install` on PHP 8. Props [@burhandodhy](https://github.com/burhandodhy).
+
+__Security:__
+
+* Bumped `composer/composer` from 2.5.8 to 2.6.4. Props [@dependabot](https://github.com/dependabot).
+
+
= 4.7.1 - 2023-08-31 =
**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.**
diff --git a/tests/php/features/TestFacet.php b/tests/php/features/TestFacet.php
index 381ca387a7..09c2e6170d 100644
--- a/tests/php/features/TestFacet.php
+++ b/tests/php/features/TestFacet.php
@@ -7,7 +7,7 @@
namespace ElasticPressTest;
-use ElasticPress\Features as Features;
+use ElasticPress\Features;
/**
* Facet test class
diff --git a/tests/php/features/TestFacetTypeMeta.php b/tests/php/features/TestFacetTypeMeta.php
index caf3de0eeb..b49c5ea2c6 100644
--- a/tests/php/features/TestFacetTypeMeta.php
+++ b/tests/php/features/TestFacetTypeMeta.php
@@ -7,7 +7,7 @@
namespace ElasticPressTest;
-use ElasticPress\Features as Features;
+use ElasticPress\Features;
/**
* Facets\Types\Taxonomy\FacetType test class
diff --git a/tests/php/features/TestFacetTypeMetaRange.php b/tests/php/features/TestFacetTypeMetaRange.php
index d10c9402b2..340effbb96 100644
--- a/tests/php/features/TestFacetTypeMetaRange.php
+++ b/tests/php/features/TestFacetTypeMetaRange.php
@@ -8,7 +8,7 @@
namespace ElasticPressTest;
-use ElasticPress\Features as Features;
+use ElasticPress\Features;
/**
* Facets\Types\Taxonomy\FacetType test class
diff --git a/tests/php/features/TestFacetTypeTaxonomy.php b/tests/php/features/TestFacetTypeTaxonomy.php
index a62e8a92a8..352c3044fc 100644
--- a/tests/php/features/TestFacetTypeTaxonomy.php
+++ b/tests/php/features/TestFacetTypeTaxonomy.php
@@ -7,7 +7,7 @@
namespace ElasticPressTest;
-use ElasticPress\Features as Features;
+use ElasticPress\Features;
/**
* Facets\Types\Taxonomy\FacetType test class
diff --git a/tests/php/features/WooCommerce/TestWooCommerce.php b/tests/php/features/WooCommerce/TestWooCommerce.php
index 886f90ba68..aa91fdd9fb 100644
--- a/tests/php/features/WooCommerce/TestWooCommerce.php
+++ b/tests/php/features/WooCommerce/TestWooCommerce.php
@@ -9,46 +9,12 @@
use ElasticPress;
+require_once __DIR__ . '/WooCommerceBaseTestCase.php';
+
/**
* WC test class
*/
-class TestWooCommerce extends BaseTestCase {
-
- /**
- * Setup each test.
- *
- * @since 2.1
- * @group woocommerce
- */
- public function set_up() {
- global $wpdb;
- parent::set_up();
- $wpdb->suppress_errors();
-
- $admin_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
-
- wp_set_current_user( $admin_id );
-
- ElasticPress\Elasticsearch::factory()->delete_all_indices();
- ElasticPress\Indexables::factory()->get( 'post' )->put_mapping();
-
- ElasticPress\Indexables::factory()->get( 'post' )->sync_manager->sync_queue = [];
-
- $this->setup_test_post_type();
- }
-
- /**
- * Clean up after each test. Reset our mocks
- *
- * @since 2.1
- * @group woocommerce
- */
- public function tear_down() {
- parent::tear_down();
-
- $this->fired_actions = array();
- }
-
+class TestWooCommerce extends WooCommerceBaseTestCase {
/**
* Test search integration is on in general for product searches
*
diff --git a/tests/php/features/WooCommerce/TestWooCommerceOrders.php b/tests/php/features/WooCommerce/TestWooCommerceOrders.php
index 9c1eff486e..3b157d2ff6 100644
--- a/tests/php/features/WooCommerce/TestWooCommerceOrders.php
+++ b/tests/php/features/WooCommerce/TestWooCommerceOrders.php
@@ -10,10 +10,12 @@
use ElasticPress;
+require_once __DIR__ . '/WooCommerceBaseTestCase.php';
+
/**
* WC orders test class
*/
-class TestWooCommerceOrders extends TestWooCommerce {
+class TestWooCommerceOrders extends WooCommerceBaseTestCase {
/**
* Orders instance
*
diff --git a/tests/php/features/WooCommerce/TestWooCommerceProduct.php b/tests/php/features/WooCommerce/TestWooCommerceProduct.php
index b5e887f653..a3fa5acfaa 100644
--- a/tests/php/features/WooCommerce/TestWooCommerceProduct.php
+++ b/tests/php/features/WooCommerce/TestWooCommerceProduct.php
@@ -10,10 +10,12 @@
use ElasticPress;
+require_once __DIR__ . '/WooCommerceBaseTestCase.php';
+
/**
* WC products test class
*/
-class TestWooCommerceProduct extends TestWooCommerce {
+class TestWooCommerceProduct extends WooCommerceBaseTestCase {
/**
* Products instance
*
diff --git a/tests/php/features/WooCommerce/WooCommerceBaseTestCase.php b/tests/php/features/WooCommerce/WooCommerceBaseTestCase.php
new file mode 100644
index 0000000000..b035496e28
--- /dev/null
+++ b/tests/php/features/WooCommerce/WooCommerceBaseTestCase.php
@@ -0,0 +1,47 @@
+suppress_errors();
+
+ $admin_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+
+ wp_set_current_user( $admin_id );
+
+ \ElasticPress\Elasticsearch::factory()->delete_all_indices();
+ \ElasticPress\Indexables::factory()->get( 'post' )->put_mapping();
+
+ \ElasticPress\Indexables::factory()->get( 'post' )->sync_manager->sync_queue = [];
+
+ $this->setup_test_post_type();
+ }
+
+ /**
+ * Clean up after each test. Reset our mocks
+ *
+ * @group woocommerce
+ */
+ public function tear_down() {
+ parent::tear_down();
+
+ $this->fired_actions = array();
+ }
+}
diff --git a/tests/php/indexables/TestPost.php b/tests/php/indexables/TestPost.php
index ca9e65c7a9..bae444ba71 100644
--- a/tests/php/indexables/TestPost.php
+++ b/tests/php/indexables/TestPost.php
@@ -8,7 +8,7 @@
namespace ElasticPressTest;
use ElasticPress;
-use ElasticPress\Indexables as Indexables;
+use ElasticPress\Indexables;
/**
* Test post indexable class
@@ -1093,23 +1093,27 @@ public function testPostInQuery() {
}
/**
- * Test a post__not_in query
+ * Test a post__not_in query with non-sequential array indices
*
- * @since 1.5
+ * @since 4.7.2
* @group post
*/
- public function testPostNotInQuery() {
+ public function testPostNotInQueryWithNonSequentialIndices() {
$post_ids = array();
$post_ids[0] = $this->ep_factory->post->create( array( 'post_content' => 'findme test 1' ) );
$post_ids[1] = $this->ep_factory->post->create( array( 'post_content' => 'findme test 2' ) );
$post_ids[2] = $this->ep_factory->post->create( array( 'post_content' => 'findme test 3' ) );
+ $post_ids[3] = $this->ep_factory->post->create( array( 'post_content' => 'findme test 4' ) );
ElasticPress\Elasticsearch::factory()->refresh_indices();
$args = array(
's' => 'findme',
- 'post__not_in' => array( $post_ids[0] ),
+ 'post__not_in' => array(
+ 0 => $post_ids[0],
+ 2 => $post_ids[3],
+ ),
);
$query = new \WP_Query( $args );