From 4c5727bbf2cc5e7a3eb80a41acd8a76c07ed5044 Mon Sep 17 00:00:00 2001 From: dgnorrod <139880719+dgnorrod@users.noreply.github.com> Date: Mon, 14 Aug 2023 13:44:35 -0400 Subject: [PATCH 01/37] New Filter ep_highlight_number_of_fragments. Add to ./includes/classes/Feature/Search/Search.php a new filter to set the maximum number of fragments to highlight. --- includes/classes/Feature/Search/Search.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/includes/classes/Feature/Search/Search.php b/includes/classes/Feature/Search/Search.php index 42a714830a..bbc40b9d3a 100644 --- a/includes/classes/Feature/Search/Search.php +++ b/includes/classes/Feature/Search/Search.php @@ -237,7 +237,15 @@ 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 5.0.0 + * @hook ep_highlight_number_of_fragments + * @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 ), ]; } From 28b5462b38f17941aa28fb3c45ecadb21850cdf4 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Thu, 31 Aug 2023 15:30:17 -0300 Subject: [PATCH 02/37] Call composer while building docs --- .github/workflows/build-docs.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 8bd69cdb4b..320514302d 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -4,6 +4,9 @@ on: push: branches: - trunk + pull_request: + branches: + - develop jobs: build: @@ -21,6 +24,9 @@ jobs: coverage: none ini-values: memory_limit=3G + - name: composer install + run: composer install + - name: Start MySQL run: | sudo systemctl start mysql.service From c2fb59f70a95871f0156406060896aa8afea8779 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Thu, 31 Aug 2023 15:32:53 -0300 Subject: [PATCH 03/37] Call composer in the correct folder --- .github/workflows/build-docs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 320514302d..8c971fe5ee 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -25,7 +25,9 @@ jobs: ini-values: memory_limit=3G - name: composer install - run: composer install + run: | + cd wp-content/plugins/elasticpress + composer install - name: Start MySQL run: | From 616d3dcb681b50e24acf4b4ab8b61201c282f0d4 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Thu, 31 Aug 2023 15:41:40 -0300 Subject: [PATCH 04/37] Bump PHP version --- .github/workflows/build-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 8c971fe5ee..848e4e29b8 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -20,7 +20,7 @@ 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 From 16ffa27cac966c9a449df310917439530a490240 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Thu, 31 Aug 2023 15:44:11 -0300 Subject: [PATCH 05/37] Only run on push to trunk --- .github/workflows/build-docs.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 848e4e29b8..df2a10e92c 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -4,9 +4,6 @@ on: push: branches: - trunk - pull_request: - branches: - - develop jobs: build: From 8bf9b4417adddfd9086f6d0730ea6659e1476f6b Mon Sep 17 00:00:00 2001 From: Renato Alves <19148962+renatonascalves@users.noreply.github.com> Date: Wed, 6 Sep 2023 11:02:33 -0300 Subject: [PATCH 06/37] Improving phpDoc --- includes/classes/Indexable.php | 5 ++--- includes/classes/Indexables.php | 2 +- includes/classes/SyncManager.php | 11 ++++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/includes/classes/Indexable.php b/includes/classes/Indexable.php index aea845cdb1..5cbb9ebc93 100644 --- a/includes/classes/Indexable.php +++ b/includes/classes/Indexable.php @@ -12,7 +12,6 @@ use ElasticPress\Elasticsearch as Elasticsearch; use ElasticPress\SyncManager as SyncManager; -use ElasticPress\QueryIntegration as QueryIntegration; 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/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/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. * From d38e9f226bc1362e31cb627d74cf313504f95579 Mon Sep 17 00:00:00 2001 From: Ben Marshall Date: Fri, 15 Sep 2023 09:42:38 -0500 Subject: [PATCH 07/37] fix(php version): added a php version check --- elasticpress.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/elasticpress.php b/elasticpress.php index 135efe44de..94eeb99dfb 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -39,6 +39,48 @@ define( 'EP_FILE', plugin_basename( __FILE__ ) ); define( 'EP_VERSION', '4.7.1' ); +/** + * Get the minimum version of PHP required by this plugin. + * + * @return string Minimum version required. + */ +function minimum_php_requirement() { + return '7.0'; +} + +/** + * Whether PHP installation meets the minimum requirements + * + * @return bool True if meets minimum requirements, false otherwise. + */ +function site_meets_php_requirements() { + return version_compare( phpversion(), minimum_php_requirement(), '>=' ); +} + +if ( ! site_meets_php_requirements() ) { + add_action( + 'admin_notices', + function() { + ?> +
+

+ +

+
+ Date: Mon, 18 Sep 2023 09:02:25 -0400 Subject: [PATCH 08/37] Corrected comments to include max_fragments parameter. --- includes/classes/Feature/Search/Search.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/classes/Feature/Search/Search.php b/includes/classes/Feature/Search/Search.php index bbc40b9d3a..0297c0191f 100644 --- a/includes/classes/Feature/Search/Search.php +++ b/includes/classes/Feature/Search/Search.php @@ -242,8 +242,9 @@ public function add_search_highlight_tags( $formatted_args, $args ) { * * @since 5.0.0 * @hook ep_highlight_number_of_fragments - * @param {string} $field Search field being setup. - * @return {int} New maximum number of fragments to highlight for the searched field. + * @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 ), ]; From 42c0fd9f368bbfca187fc617044272fb0a8be773 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Fri, 22 Sep 2023 10:24:34 -0300 Subject: [PATCH 09/37] Flag autosuggest template query as fake --- .../Feature/Autosuggest/Autosuggest.php | 18 +++++--- includes/dashboard.php | 45 ++++++------------- 2 files changed, 26 insertions(+), 37 deletions(-) diff --git a/includes/classes/Feature/Autosuggest/Autosuggest.php b/includes/classes/Feature/Autosuggest/Autosuggest.php index 844450dd15..4d53f8df2e 100644 --- a/includes/classes/Feature/Autosuggest/Autosuggest.php +++ b/includes/classes/Feature/Autosuggest/Autosuggest.php @@ -593,13 +593,19 @@ public function apply_autosuggest_weighting( $config = [] ) { public function intercept_search_request( $response, $query = [] ) { $this->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/dashboard.php b/includes/dashboard.php index 5c9b8a1def..161e9254cc 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'] ) && ! 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 ); From a3afe5f38fd738a02c34a06a370ee3af03cc2734 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Fri, 22 Sep 2023 10:36:46 -0300 Subject: [PATCH 10/37] Make sure post__not_in is translated into an array, not an object --- includes/classes/Indexable/Post/Post.php | 2 +- tests/php/indexables/TestPost.php | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/includes/classes/Indexable/Post/Post.php b/includes/classes/Indexable/Post/Post.php index 26c6ffb2c7..d98c4c7b85 100644 --- a/includes/classes/Indexable/Post/Post.php +++ b/includes/classes/Indexable/Post/Post.php @@ -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'] ), ], ], ], diff --git a/tests/php/indexables/TestPost.php b/tests/php/indexables/TestPost.php index ca9e65c7a9..44d02aa0c8 100644 --- a/tests/php/indexables/TestPost.php +++ b/tests/php/indexables/TestPost.php @@ -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 ); From df3684fa1d9cacb7dc57b819e2be566ed1c19749 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Fri, 22 Sep 2023 10:43:25 -0300 Subject: [PATCH 11/37] Fix docblock for get_option return type --- includes/utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/utils.php b/includes/utils.php index 3ffc32d646..5458f6f65b 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -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 ) { From 6bf4f76418611855fe07e684e28ad8afd41d9889 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Fri, 22 Sep 2023 10:52:16 -0300 Subject: [PATCH 12/37] New constant + reorder things --- elasticpress.php | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/elasticpress.php b/elasticpress.php index 94eeb99dfb..a7ad998d32 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -29,35 +29,14 @@ exit; // Exit if accessed directly. } -// Require Composer autoloader if it exists. -if ( file_exists( __DIR__ . '/vendor-prefixed/autoload.php' ) ) { - require_once __DIR__ . '/vendor-prefixed/autoload.php'; -} - 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.1' ); -/** - * Get the minimum version of PHP required by this plugin. - * - * @return string Minimum version required. - */ -function minimum_php_requirement() { - return '7.0'; -} +define( 'EP_PHP_VERSION_MIN', '7.0' ); -/** - * Whether PHP installation meets the minimum requirements - * - * @return bool True if meets minimum requirements, false otherwise. - */ -function site_meets_php_requirements() { - return version_compare( phpversion(), minimum_php_requirement(), '>=' ); -} - -if ( ! site_meets_php_requirements() ) { +if ( ! version_compare( phpversion(), EP_PHP_VERSION_MIN, '>=' ) ) { add_action( 'admin_notices', function() { @@ -69,7 +48,7 @@ function() { sprintf( /* translators: %s: Minimum required PHP version */ __( 'ElasticPress requires PHP version %s or later. Please upgrade PHP or disable the plugin.', 'elasticpress' ), - esc_html( minimum_php_requirement() ) + EP_PHP_VERSION_MIN ) ); ?> @@ -81,6 +60,11 @@ function() { return; } +// Require Composer autoloader if it exists. +if ( file_exists( __DIR__ . '/vendor-prefixed/autoload.php' ) ) { + require_once __DIR__ . '/vendor-prefixed/autoload.php'; +} + /** * PSR-4-ish autoloading * From ebb88bc1e14b24c4250a02476fd41da59d881c83 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Fri, 22 Sep 2023 11:29:30 -0300 Subject: [PATCH 13/37] Check if $query['request'] is an array --- includes/dashboard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/dashboard.php b/includes/dashboard.php index 161e9254cc..24285bc743 100644 --- a/includes/dashboard.php +++ b/includes/dashboard.php @@ -138,7 +138,7 @@ function filter_allowed_html( $allowedtags, $context ) { */ function log_version_query_error( $query ) { // Ignore fake requests like the autosuggest template generation - if ( ! empty( $query['request'] ) && ! empty( $query['request']['is_ep_fake_request'] ) ) { + if ( ! empty( $query['request'] ) && is_array( $query['request'] ) && ! empty( $query['request']['is_ep_fake_request'] ) ) { return; } From c411a021715c42a3cc06298af9e39084fc2398e4 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Tue, 26 Sep 2023 16:47:41 -0300 Subject: [PATCH 14/37] Do not extend a Test class --- .../features/WooCommerce/TestWooCommerce.php | 40 ++-------------- .../WooCommerce/TestWooCommerceOrders.php | 4 +- .../WooCommerce/TestWooCommerceProduct.php | 4 +- .../WooCommerce/WooCommerceBaseTestCase.php | 47 +++++++++++++++++++ 4 files changed, 56 insertions(+), 39 deletions(-) create mode 100644 tests/php/features/WooCommerce/WooCommerceBaseTestCase.php 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(); + } +} From bf3252bc1a12da260a08c4e2bb586f54862c84f8 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 27 Sep 2023 09:46:55 -0300 Subject: [PATCH 15/37] Manually enqueue facet meta range if in < WP 6.1 --- .../classes/Feature/Facets/Types/MetaRange/Block.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/includes/classes/Feature/Facets/Types/MetaRange/Block.php b/includes/classes/Feature/Facets/Types/MetaRange/Block.php index 284bcaa4e9..8c47efc1b1 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(); + /** + * Before WP 6.1, setting `viewScript` while having a `render_callback` function + * did not enqueue the script. + * + * @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' ] ); From 049089933904237cc3f24ff0ef7f946674911fad Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 27 Sep 2023 10:37:52 -0300 Subject: [PATCH 16/37] Rephrase docblock sentence Co-authored-by: Mohammed --- includes/classes/Feature/Facets/Types/MetaRange/Block.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/classes/Feature/Facets/Types/MetaRange/Block.php b/includes/classes/Feature/Facets/Types/MetaRange/Block.php index 8c47efc1b1..17f5d4fe8d 100644 --- a/includes/classes/Feature/Facets/Types/MetaRange/Block.php +++ b/includes/classes/Feature/Facets/Types/MetaRange/Block.php @@ -132,8 +132,8 @@ public function render_block( $attributes ) { $renderer = new $renderer_class(); /** - * Before WP 6.1, setting `viewScript` while having a `render_callback` function - * did not enqueue the script. + * 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 */ From 9c4a456f52e58f3e6c1160cc84b0bb3085fe50ab Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 27 Sep 2023 11:34:06 -0300 Subject: [PATCH 17/37] Bump version --- elasticpress.php | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- readme.txt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/elasticpress.php b/elasticpress.php index a7ad998d32..3274b42ebf 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 @@ -32,7 +32,7 @@ define( 'EP_URL', plugin_dir_url( __FILE__ ) ); define( 'EP_PATH', plugin_dir_path( __FILE__ ) ); define( 'EP_FILE', plugin_basename( __FILE__ ) ); -define( 'EP_VERSION', '4.7.1' ); +define( 'EP_VERSION', '4.7.2' ); define( 'EP_PHP_VERSION_MIN', '7.0' ); 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..f63f3753d6 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 From b19ee54fad774b7f3610f92210952e185a46a703 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 27 Sep 2023 12:02:50 -0300 Subject: [PATCH 18/37] Initial changelog for 4.7.2 --- CHANGELOG.md | 19 +++++++++++++++++++ CREDITS.md | 2 ++ 2 files changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d3cb21d6e..99518abbe5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,23 @@ All notable changes to this project will be documented in this file, per [the Ke ### Security --> + +## [4.7.2] - 2023-10-XX + +**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 +* >=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). + +### Fixed +* Updated phpDoc entries. Props [@renatonascalves](https://github.com/renatonascalves) via [#3635](https://github.com/10up/ElasticPress/pull/3635). +* 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` is translated into an array, not an object. Props [@felipeelia](https://github.com/felipeelia) via [#3652](https://github.com/10up/ElasticPress/pull/3652). +* Docblock for `Utils\get_option` return type. Props [@felipeelia](https://github.com/felipeelia) via [#3653](https://github.com/10up/ElasticPress/pull/3653). +* 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). + ## [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 +1943,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..92d6401c7f 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -217,6 +217,8 @@ 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) and [@qazaqstan2025](https://github.com/qazaqstan2025). From 7b0e0d79efec5f8e64b77cd2d03e699581724a43 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Thu, 28 Sep 2023 16:45:13 -0300 Subject: [PATCH 19/37] Open issues when a new WP version is released --- .github/workflows/wordpress-latest.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/wordpress-latest.yml 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 }} From 0a0392a3d1888bc1efedf4aa40fabd035f7d9e83 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Fri, 29 Sep 2023 13:01:48 -0300 Subject: [PATCH 20/37] Remove unnecessary class aliases --- elasticpress.php | 2 +- includes/classes/DeprecatedCommand.php | 2 +- includes/classes/Elasticsearch.php | 4 ++-- includes/classes/Feature.php | 4 ++-- includes/classes/Feature/Autosuggest/Autosuggest.php | 10 +++++----- includes/classes/Feature/Comments/Comments.php | 10 +++++----- includes/classes/Feature/Comments/Widget.php | 6 +----- includes/classes/Feature/Documents/Documents.php | 10 +++++----- includes/classes/Feature/Facets/Facets.php | 8 ++++---- .../classes/Feature/Facets/Types/Meta/Renderer.php | 2 +- .../Feature/Facets/Types/MetaRange/Renderer.php | 2 +- .../Feature/Facets/Types/PostType/Renderer.php | 2 +- .../Feature/Facets/Types/Taxonomy/Renderer.php | 4 ++-- .../classes/Feature/Facets/Types/Taxonomy/Widget.php | 5 ++--- .../Feature/InstantResults/InstantResults.php | 10 +++++----- .../Feature/ProtectedContent/ProtectedContent.php | 8 ++++---- .../classes/Feature/RelatedPosts/RelatedPosts.php | 7 +++---- includes/classes/Feature/RelatedPosts/Widget.php | 5 ++--- includes/classes/Feature/Search/Synonyms.php | 7 +++---- .../Feature/SearchOrdering/SearchOrdering.php | 3 +-- includes/classes/Feature/Terms/Terms.php | 8 ++++---- includes/classes/Feature/Users/Users.php | 10 +++++----- includes/classes/Features.php | 2 +- .../classes/HealthCheck/HealthCheckElasticsearch.php | 6 +++--- includes/classes/IndexHelper.php | 2 +- includes/classes/Indexable.php | 4 ++-- includes/classes/Indexable/Comment/Comment.php | 12 ++++++------ .../classes/Indexable/Comment/QueryIntegration.php | 6 +++--- includes/classes/Indexable/Comment/SyncManager.php | 4 ++-- includes/classes/Indexable/Post/DateQuery.php | 2 +- includes/classes/Indexable/Post/Post.php | 8 ++++---- includes/classes/Indexable/Post/QueryIntegration.php | 6 +++--- includes/classes/Indexable/Post/SyncManager.php | 6 +++--- includes/classes/Indexable/Term/QueryIntegration.php | 2 +- includes/classes/Indexable/Term/SyncManager.php | 4 ++-- includes/classes/Indexable/Term/Term.php | 6 +++--- includes/classes/Indexable/User/QueryIntegration.php | 5 ++--- includes/classes/Indexable/User/SyncManager.php | 4 ++-- includes/classes/Indexable/User/User.php | 8 ++++---- includes/classes/Stats.php | 2 +- includes/partials/dashboard-page.php | 6 +++--- includes/partials/stats-page.php | 5 ++--- tests/php/features/TestFacet.php | 2 +- tests/php/features/TestFacetTypeMeta.php | 2 +- tests/php/features/TestFacetTypeMetaRange.php | 2 +- tests/php/features/TestFacetTypeTaxonomy.php | 2 +- tests/php/indexables/TestPost.php | 2 +- 47 files changed, 114 insertions(+), 125 deletions(-) diff --git a/elasticpress.php b/elasticpress.php index a7ad998d32..619d80fd77 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -23,7 +23,7 @@ namespace ElasticPress; -use \WP_CLI as WP_CLI; +use \WP_CLI; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/DeprecatedCommand.php b/includes/classes/DeprecatedCommand.php index 773f1eeb61..9df5970eea 100644 --- a/includes/classes/DeprecatedCommand.php +++ b/includes/classes/DeprecatedCommand.php @@ -8,7 +8,7 @@ namespace ElasticPress; -use \WP_CLI as WP_CLI; +use \WP_CLI; if ( ! defined( 'ABSPATH' ) ) { // @codeCoverageIgnoreStart diff --git a/includes/classes/Elasticsearch.php b/includes/classes/Elasticsearch.php index 8a8836d65f..1ecedcc8f5 100644 --- a/includes/classes/Elasticsearch.php +++ b/includes/classes/Elasticsearch.php @@ -8,9 +8,9 @@ namespace ElasticPress; -use ElasticPress\Utils as Utils; +use \WP_Error; use ElasticPress\Indexables; -use \WP_Error as WP_Error; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Feature.php b/includes/classes/Feature.php index 952b20a87a..2d1d874d11 100644 --- a/includes/classes/Feature.php +++ b/includes/classes/Feature.php @@ -10,8 +10,8 @@ namespace ElasticPress; -use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus; -use ElasticPress\Utils as Utils; +use ElasticPress\FeatureRequirementsStatus; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Feature/Autosuggest/Autosuggest.php b/includes/classes/Feature/Autosuggest/Autosuggest.php index 4d53f8df2e..03424550cb 100644 --- a/includes/classes/Feature/Autosuggest/Autosuggest.php +++ b/includes/classes/Feature/Autosuggest/Autosuggest.php @@ -9,12 +9,12 @@ namespace ElasticPress\Feature\Autosuggest; -use ElasticPress\Feature as Feature; -use ElasticPress\Features as Features; -use ElasticPress\Utils as Utils; -use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus; -use ElasticPress\Indexables as Indexables; use ElasticPress\Elasticsearch; +use ElasticPress\Feature; +use ElasticPress\FeatureRequirementsStatus; +use ElasticPress\Features; +use ElasticPress\Indexables; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. 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/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/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/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 5cbb9ebc93..e66bb18f63 100644 --- a/includes/classes/Indexable.php +++ b/includes/classes/Indexable.php @@ -10,8 +10,8 @@ namespace ElasticPress; -use ElasticPress\Elasticsearch as Elasticsearch; -use ElasticPress\SyncManager as SyncManager; +use ElasticPress\Elasticsearch; +use ElasticPress\SyncManager; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. 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..8705952356 100644 --- a/includes/classes/Indexable/Comment/SyncManager.php +++ b/includes/classes/Indexable/Comment/SyncManager.php @@ -8,8 +8,8 @@ namespace ElasticPress\Indexable\Comment; -use ElasticPress\Indexables as Indexables; -use ElasticPress\Elasticsearch as Elasticsearch; +use ElasticPress\Elasticsearch; +use ElasticPress\Indexables; use ElasticPress\SyncManager as SyncManagerAbstract; if ( ! defined( 'ABSPATH' ) ) { 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 d98c4c7b85..717b26598f 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 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..2e938f8439 100644 --- a/includes/classes/Indexable/Post/SyncManager.php +++ b/includes/classes/Indexable/Post/SyncManager.php @@ -8,11 +8,11 @@ namespace ElasticPress\Indexable\Post; -use ElasticPress\Elasticsearch as Elasticsearch; -use ElasticPress\Indexables as Indexables; +use ElasticPress\Elasticsearch; +use ElasticPress\Indexables; +use ElasticPress\IndexHelper; use ElasticPress\SyncManager as SyncManagerAbstract; use ElasticPress\Utils; -use ElasticPress\IndexHelper; if ( ! defined( 'ABSPATH' ) ) { // @codeCoverageIgnoreStart 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..ed8c5ac8ee 100644 --- a/includes/classes/Indexable/Term/SyncManager.php +++ b/includes/classes/Indexable/Term/SyncManager.php @@ -8,8 +8,8 @@ namespace ElasticPress\Indexable\Term; -use ElasticPress\Indexables as Indexables; -use ElasticPress\Elasticsearch as Elasticsearch; +use ElasticPress\Elasticsearch; +use ElasticPress\Indexables; use ElasticPress\SyncManager as SyncManagerAbstract; if ( ! defined( 'ABSPATH' ) ) { 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..7b7b1a9af1 100644 --- a/includes/classes/Indexable/User/SyncManager.php +++ b/includes/classes/Indexable/User/SyncManager.php @@ -8,8 +8,8 @@ namespace ElasticPress\Indexable\User; -use ElasticPress\Indexables as Indexables; -use ElasticPress\Elasticsearch as Elasticsearch; +use ElasticPress\Elasticsearch; +use ElasticPress\Indexables; use ElasticPress\SyncManager as SyncManagerAbstract; if ( ! defined( 'ABSPATH' ) ) { 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/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/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/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/indexables/TestPost.php b/tests/php/indexables/TestPost.php index 44d02aa0c8..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 From fc084b5124bd2e838eabc644d9cf99f244a307df Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Fri, 29 Sep 2023 13:29:29 -0300 Subject: [PATCH 21/37] Remove SyncManagerAbstract references --- includes/classes/Indexable/Comment/SyncManager.php | 3 +-- includes/classes/Indexable/Post/SyncManager.php | 3 +-- includes/classes/Indexable/Term/SyncManager.php | 3 +-- includes/classes/Indexable/User/SyncManager.php | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/includes/classes/Indexable/Comment/SyncManager.php b/includes/classes/Indexable/Comment/SyncManager.php index 8705952356..0291a85310 100644 --- a/includes/classes/Indexable/Comment/SyncManager.php +++ b/includes/classes/Indexable/Comment/SyncManager.php @@ -10,7 +10,6 @@ use ElasticPress\Elasticsearch; use ElasticPress\Indexables; -use ElasticPress\SyncManager as SyncManagerAbstract; 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/SyncManager.php b/includes/classes/Indexable/Post/SyncManager.php index 2e938f8439..3da74ef0f6 100644 --- a/includes/classes/Indexable/Post/SyncManager.php +++ b/includes/classes/Indexable/Post/SyncManager.php @@ -11,7 +11,6 @@ use ElasticPress\Elasticsearch; use ElasticPress\Indexables; use ElasticPress\IndexHelper; -use ElasticPress\SyncManager as SyncManagerAbstract; use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { @@ -23,7 +22,7 @@ /** * Sync manager class */ -class SyncManager extends SyncManagerAbstract { +class SyncManager extends \ElasticPress\SyncManager { /** * Indexable slug diff --git a/includes/classes/Indexable/Term/SyncManager.php b/includes/classes/Indexable/Term/SyncManager.php index ed8c5ac8ee..29912a7849 100644 --- a/includes/classes/Indexable/Term/SyncManager.php +++ b/includes/classes/Indexable/Term/SyncManager.php @@ -10,7 +10,6 @@ use ElasticPress\Elasticsearch; use ElasticPress\Indexables; -use ElasticPress\SyncManager as SyncManagerAbstract; 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/SyncManager.php b/includes/classes/Indexable/User/SyncManager.php index 7b7b1a9af1..a7734cea0f 100644 --- a/includes/classes/Indexable/User/SyncManager.php +++ b/includes/classes/Indexable/User/SyncManager.php @@ -10,7 +10,6 @@ use ElasticPress\Elasticsearch; use ElasticPress\Indexables; -use ElasticPress\SyncManager as SyncManagerAbstract; 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 * From 8e25b33aae0e8fda9ff1246eb2bff6f8a7d0144f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Sep 2023 20:59:34 +0000 Subject: [PATCH 22/37] Bump composer/composer from 2.5.8 to 2.6.4 Bumps [composer/composer](https://github.com/composer/composer) from 2.5.8 to 2.6.4. - [Release notes](https://github.com/composer/composer/releases) - [Changelog](https://github.com/composer/composer/blob/main/CHANGELOG.md) - [Commits](https://github.com/composer/composer/compare/2.5.8...2.6.4) --- updated-dependencies: - dependency-name: composer/composer dependency-type: indirect ... Signed-off-by: dependabot[bot] --- composer.lock | 86 ++++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/composer.lock b/composer.lock index 1272bb462c..d92d46d6f2 100644 --- a/composer.lock +++ b/composer.lock @@ -512,16 +512,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 +529,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 +553,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 +566,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "2.6-dev" }, "phpstan": { "includes": [ @@ -576,7 +576,7 @@ }, "autoload": { "psr-4": { - "Composer\\": "src/Composer" + "Composer\\": "src/Composer/" } }, "notification-url": "https://packagist.org/downloads/", @@ -605,7 +605,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 +622,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 +766,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 +825,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 +843,7 @@ "type": "tidelift" } ], - "time": "2022-04-01T19:23:25+00:00" + "time": "2023-08-31T09:50:34+00:00" }, { "name": "composer/spdx-licenses", @@ -1209,16 +1210,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 +1274,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", @@ -2464,23 +2465,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 +2526,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 +2534,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 +3614,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 +3669,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", From 981ac118fdabfa895b7d132e06f877d6df03619d Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Tue, 3 Oct 2023 10:56:36 -0300 Subject: [PATCH 23/37] Add #3666 and #3671 --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99518abbe5..d3223e0cf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,13 +13,16 @@ All notable changes to this project will be documented in this file, per [the Ke ### Security --> - ## [4.7.2] - 2023-10-XX **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 * >=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 * Updated phpDoc entries. Props [@renatonascalves](https://github.com/renatonascalves) via [#3635](https://github.com/10up/ElasticPress/pull/3635). From 29396aec64242dbf64b75799c8f3f8a8439cd85d Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Tue, 3 Oct 2023 14:02:44 -0300 Subject: [PATCH 24/37] Fix ep_woocommerce_default_supported_post_types calls --- includes/classes/Feature/WooCommerce/Orders.php | 4 ++-- includes/classes/Feature/WooCommerce/Products.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/classes/Feature/WooCommerce/Orders.php b/includes/classes/Feature/WooCommerce/Orders.php index e44ca2a249..9f9a99b762 100644 --- a/includes/classes/Feature/WooCommerce/Orders.php +++ b/includes/classes/Feature/WooCommerce/Orders.php @@ -298,10 +298,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, From dcaa322da09c118a554ed35edbc1a41fced22dc6 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Tue, 3 Oct 2023 14:05:03 -0300 Subject: [PATCH 25/37] Check if the order exists --- includes/classes/Feature/WooCommerce/Orders.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/classes/Feature/WooCommerce/Orders.php b/includes/classes/Feature/WooCommerce/Orders.php index 9f9a99b762..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 From 719a58c6574477865fd941e6e692132c0a8956a6 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Tue, 3 Oct 2023 16:45:59 -0300 Subject: [PATCH 26/37] Make sure post_status is always passed as an array --- includes/classes/Indexable/Post/Post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/classes/Indexable/Post/Post.php b/includes/classes/Indexable/Post/Post.php index 717b26598f..5eece6821d 100644 --- a/includes/classes/Indexable/Post/Post.php +++ b/includes/classes/Indexable/Post/Post.php @@ -2268,7 +2268,7 @@ protected function parse_post_status( $args ) { return [ $terms_map_name => [ - 'post_status' => $post_status, + 'post_status' => array_values( $post_status ), ], ]; } From 7706d3a33cb11a949577b9af4888616d9198e5c9 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 4 Oct 2023 13:09:24 -0300 Subject: [PATCH 27/37] Only use array_values if is array --- includes/classes/Indexable/Post/Post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/classes/Indexable/Post/Post.php b/includes/classes/Indexable/Post/Post.php index 5eece6821d..55475f04ca 100644 --- a/includes/classes/Indexable/Post/Post.php +++ b/includes/classes/Indexable/Post/Post.php @@ -2268,7 +2268,7 @@ protected function parse_post_status( $args ) { return [ $terms_map_name => [ - 'post_status' => array_values( $post_status ), + 'post_status' => is_array( $post_status ) ? array_values( $post_status ) : $post_status, ], ]; } From 7bb0cb6726e0078103214d20c59be802091c41a6 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 4 Oct 2023 18:11:51 -0300 Subject: [PATCH 28/37] Fix lint and adjust `@since` tag --- includes/classes/Feature/Search/Search.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/classes/Feature/Search/Search.php b/includes/classes/Feature/Search/Search.php index 0297c0191f..7d15aaf353 100644 --- a/includes/classes/Feature/Search/Search.php +++ b/includes/classes/Feature/Search/Search.php @@ -240,10 +240,10 @@ public function add_search_highlight_tags( $formatted_args, $args ) { /** * Filter the maximum number of fragments highlighted for a searched field. * - * @since 5.0.0 + * @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. + * @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 ), From a9b9bbc10ecd350445c00e1c1fd6ca7c6a07c9d6 Mon Sep 17 00:00:00 2001 From: Jacob Peattie Date: Thu, 5 Oct 2023 14:13:46 +1100 Subject: [PATCH 29/37] Catch errors fetching results. --- assets/js/api-search/index.js | 19 +++++++++++++++---- assets/js/api-search/src/hooks.js | 13 ++++++++++--- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/assets/js/api-search/index.js b/assets/js/api-search/index.js index 5e1fee26b9..da467febd1 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,23 @@ 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( + __('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..752cb09ac3 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,19 @@ 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 ''; + } + + 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; } }) From 8ff5eac03a6bbf18b43211a4c58b077d37e222f2 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Thu, 5 Oct 2023 08:42:49 -0300 Subject: [PATCH 30/37] More PRs added to 4.7.2 --- CHANGELOG.md | 10 ++++++++-- CREDITS.md | 1 + readme.txt | 29 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3223e0cf1..6280edee74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file, per [the Ke **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). @@ -25,14 +26,19 @@ All notable changes to this project will be documented in this file, per [the Ke * Unnecessary aliases in use statements. Props [@felipeelia](https://github.com/felipeelia) via [#3671](https://github.com/10up/ElasticPress/pull/3671). ### Fixed -* Updated phpDoc entries. Props [@renatonascalves](https://github.com/renatonascalves) via [#3635](https://github.com/10up/ElasticPress/pull/3635). +* 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` is translated into an array, not an object. Props [@felipeelia](https://github.com/felipeelia) via [#3652](https://github.com/10up/ElasticPress/pull/3652). +* 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). * 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). +### 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.** diff --git a/CREDITS.md b/CREDITS.md index 92d6401c7f..f2e6fd4bab 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -219,6 +219,7 @@ Thank you to all the people who have already contributed to this repository via [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/readme.txt b/readme.txt index f63f3753d6..174b96ad36 100644 --- a/readme.txt +++ b/readme.txt @@ -81,6 +81,35 @@ For sure! Feel free to submit ideas or feedback in general to our [GitHub repo]( == Changelog == += 4.7.2 - 2023-10-XX = + +__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). +* 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). + +__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.** From 032bdfa6079b3043dccbe2196135617fd3458f77 Mon Sep 17 00:00:00 2001 From: Burhan Nasir Date: Thu, 5 Oct 2023 19:41:10 +0500 Subject: [PATCH 31/37] Fix throws error for PHP 8 --- composer.lock | 190 +++++++++++++++++++++++++------------------------- 1 file changed, 94 insertions(+), 96 deletions(-) diff --git a/composer.lock b/composer.lock index d92d46d6f2..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", @@ -1071,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": { @@ -1121,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": [ { @@ -1137,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", @@ -1893,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": { @@ -1959,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": [ { @@ -1967,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", @@ -2212,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": { @@ -2236,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", @@ -2295,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": [ { @@ -2311,7 +2312,7 @@ "type": "tidelift" } ], - "time": "2023-08-19T07:10:56+00:00" + "time": "2023-09-19T05:39:22+00:00" }, { "name": "psr/cache", @@ -3789,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", @@ -3837,9 +3838,6 @@ "psr-4": { "Symfony\\Component\\Cache\\": "" }, - "classmap": [ - "Traits/ValueWrapper.php" - ], "exclude-from-classmap": [ "/Tests/" ] @@ -3865,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": [ { @@ -3881,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", @@ -3941,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": [ { @@ -3957,7 +3958,7 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/console", @@ -4060,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", @@ -4107,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": [ { @@ -4123,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" }, @@ -4170,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": [ { @@ -4186,7 +4187,7 @@ "type": "tidelift" } ], - "time": "2023-06-01T08:30:39+00:00" + "time": "2023-01-20T17:44:14+00:00" }, { "name": "symfony/finder", @@ -4824,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": { @@ -4865,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": [ { @@ -4881,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", @@ -4964,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", @@ -5030,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": [ { @@ -5046,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" @@ -5099,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": [ { @@ -5120,7 +5118,7 @@ "type": "tidelift" } ], - "time": "2023-08-16T18:14:47+00:00" + "time": "2023-01-13T08:34:10+00:00" }, { "name": "theseer/tokenizer", @@ -5225,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" From f9bdc74397ddce2a7e1288cbb445efacad600d64 Mon Sep 17 00:00:00 2001 From: Burhan Nasir Date: Fri, 6 Oct 2023 11:25:39 +0500 Subject: [PATCH 32/37] Fix: Doc block for ep_capability and ep_network_capability filters --- includes/utils.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/utils.php b/includes/utils.php index 5458f6f65b..3a5800411a 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 `'elasticpress_manage'` + * @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' ); } From b72cf406e3718a652c7c359f6992d0ba0bb37719 Mon Sep 17 00:00:00 2001 From: Burhan Nasir Date: Fri, 6 Oct 2023 14:17:33 +0500 Subject: [PATCH 33/37] Fix default value --- includes/utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/utils.php b/includes/utils.php index 3a5800411a..64ce89047c 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -63,7 +63,7 @@ function get_capability() : string { * * @since 4.5.0 * @hook ep_capability - * @param {string} $capability Capability name. Defaults to `'elasticpress_manage'` + * @param {string} $capability Capability name. Defaults to `'manage_elasticpress'` * @return {string} New capability value */ return apply_filters( 'ep_capability', 'manage_elasticpress' ); From 3a90ba2a704dcc0a256ccb5e857d85f7713806ee Mon Sep 17 00:00:00 2001 From: Burhan Nasir Date: Fri, 6 Oct 2023 20:16:51 +0500 Subject: [PATCH 34/37] Fix: Number of expected aruguments --- includes/classes/Indexable/Post/SyncManager.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/classes/Indexable/Post/SyncManager.php b/includes/classes/Indexable/Post/SyncManager.php index 3da74ef0f6..ace0cf9637 100644 --- a/includes/classes/Indexable/Post/SyncManager.php +++ b/includes/classes/Indexable/Post/SyncManager.php @@ -53,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 ); From de15fc3aef64ab3708436964491563a9d9118117 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Tue, 10 Oct 2023 14:29:44 -0300 Subject: [PATCH 35/37] Add more PRs to 4.7.2 --- CHANGELOG.md | 3 +++ readme.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6280edee74..ea400b1029 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,9 +32,12 @@ All notable changes to this project will be documented in this file, per [the Ke * 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). diff --git a/readme.txt b/readme.txt index 174b96ad36..7d8fe109ee 100644 --- a/readme.txt +++ b/readme.txt @@ -101,9 +101,12 @@ __Fixed:__ * 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:__ From de3a3de1f810a544301d30cfb1da2836c503e699 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Tue, 10 Oct 2023 14:34:52 -0300 Subject: [PATCH 36/37] Update the .pot file --- assets/js/api-search/index.js | 1 + assets/js/api-search/src/hooks.js | 1 + lang/elasticpress.pot | 335 ++++++++++++++++-------------- 3 files changed, 179 insertions(+), 158 deletions(-) diff --git a/assets/js/api-search/index.js b/assets/js/api-search/index.js index da467febd1..b112178b01 100644 --- a/assets/js/api-search/index.js +++ b/assets/js/api-search/index.js @@ -309,6 +309,7 @@ export const ApiSearchProvider = ({ setResults(response); } catch (e) { const errorMessage = sprintf( + /* translators: Error message */ __('ElasticPress: Unable to fetch results. %s', 'elasticpress'), e.message, ); diff --git a/assets/js/api-search/src/hooks.js b/assets/js/api-search/src/hooks.js index 752cb09ac3..60a90b6e7e 100644 --- a/assets/js/api-search/src/hooks.js +++ b/assets/js/api-search/src/hooks.js @@ -64,6 +64,7 @@ export const useFetchResults = ( return ''; } + /* translators: Response status code */ throw new Error(sprintf(__('HTTP %d.', 'elasticpress'), response.status)); } 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" From 0f297cb1582e4df177c6eae58f5b8910ddc5c362 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Tue, 10 Oct 2023 14:35:32 -0300 Subject: [PATCH 37/37] Update release date --- CHANGELOG.md | 2 +- readme.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea400b1029..5d0b7d4f75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ All notable changes to this project will be documented in this file, per [the Ke ### Security --> -## [4.7.2] - 2023-10-XX +## [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.** diff --git a/readme.txt b/readme.txt index 7d8fe109ee..d014623ecb 100644 --- a/readme.txt +++ b/readme.txt @@ -81,7 +81,7 @@ For sure! Feel free to submit ideas or feedback in general to our [GitHub repo]( == Changelog == -= 4.7.2 - 2023-10-XX = += 4.7.2 - 2023-10-10 = __Added:__