From 572ac850500a7be2595185ff1da7febf6463cf57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Philip=20Kallehauge?= Date: Fri, 22 Sep 2017 13:37:28 +0200 Subject: [PATCH 01/31] Correct "is single" issue in WooCommerce feature --- features/woocommerce/woocommerce.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index 83346bdd05..8f5316463b 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -201,7 +201,7 @@ function ep_wc_translate_args( $query ) { /** * Do nothing for single product queries */ - if ( ! empty( $product_name ) ) { + if ( ! empty( $product_name ) || $query->is_single() ) { return; } From 09469267203cd174b9baf45b4c59ed0e4168fe1f Mon Sep 17 00:00:00 2001 From: Dustin Rue Date: Fri, 27 Oct 2017 11:48:35 -0500 Subject: [PATCH 02/31] Fix stats Report document count of the primaries, not total which includes replicas. Also reports both the index size in terms of document size as well as total disk space used by all replicas. --- bin/wp-cli.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/wp-cli.php b/bin/wp-cli.php index 1df75ba2ee..c2251b9b63 100644 --- a/bin/wp-cli.php +++ b/bin/wp-cli.php @@ -780,8 +780,9 @@ public function stats() { if (isset( $body['indices'][$current_index] ) ) { WP_CLI::log( '====== Stats for: ' . $current_index . " ======" ); - WP_CLI::log( 'Documents: ' . $body['indices'][$current_index]['total']['docs']['count'] ); - WP_CLI::log( 'Index Size: ' . size_format($body['indices'][$current_index]['total']['store']['size_in_bytes'], 2 ) ); + WP_CLI::log( 'Documents: ' . $body['indices'][$current_index]['primaries']['docs']['count'] ); + WP_CLI::log( 'Index Size: ' . size_format($body['indices'][$current_index]['primaries']['store']['size_in_bytes'], 2 ) ); + WP_CLI::log( 'Index Size (including replicas): ' . size_format($body['indices'][$current_index]['total']['store']['size_in_bytes'], 2 ) ); WP_CLI::log( '====== End Stats ======' ); } else { WP_CLI::warning( $current_index . ' is not currently indexed.' ); From eba8a245018992c358717d9ca122e9b61c890660 Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Wed, 1 Nov 2017 14:54:20 +0200 Subject: [PATCH 03/31] #961 Updated features activation handle to load on init action --- classes/class-ep-features.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/class-ep-features.php b/classes/class-ep-features.php index ca8fe99f0c..7de6f0a485 100644 --- a/classes/class-ep-features.php +++ b/classes/class-ep-features.php @@ -26,7 +26,7 @@ class EP_Features { * @since 2.1 */ public function setup() { - add_action( 'plugins_loaded', array( $this, 'handle_feature_activation' ), 12 ); + add_action( 'init', array( $this, 'handle_feature_activation' ), 1 ); add_action( 'init', array( $this, 'setup_features' ), 0 ); } From e2f1cfefe8cd2a6b188f3085d53c5a7c46f6a8a3 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 2 Nov 2017 11:20:15 -0400 Subject: [PATCH 04/31] Add 2.4 as reindex version --- elasticpress.php | 1 + 1 file changed, 1 insertion(+) diff --git a/elasticpress.php b/elasticpress.php index 804227edcf..473d31388d 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -102,6 +102,7 @@ function ep_handle_upgrades() { $reindex_versions = apply_filters( 'ep_reindex_versions', array( '2.2', '2.3.1', + '2.4', ) ); $need_upgrade_sync = false; From 5541b1a43f2919f22aa8d715bad0497d83dbe9d4 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 2 Nov 2017 11:25:12 -0400 Subject: [PATCH 05/31] Fix decaying tests --- tests/features/test-search.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/features/test-search.php b/tests/features/test-search.php index d4ca98ae00..19f8da209d 100644 --- a/tests/features/test-search.php +++ b/tests/features/test-search.php @@ -117,12 +117,12 @@ public function testSearchIndexDeleted(){ * @group search */ public function testDecayingEnabled() { - delete_site_option( 'ep_feature_requirement_statuses' ); - delete_site_option( 'ep_feature_settings' ); - - EP_Features::factory()->handle_feature_activation(); + ep_activate_feature( 'search' ); EP_Features::factory()->setup_features(); + // Need to call this since it's hooked to init + ep_search_setup(); + ep_update_feature( 'search', array( 'active' => true, 'decaying_enabled' => true, @@ -135,6 +135,7 @@ public function testDecayingEnabled() { $query = new WP_Query( array( 's' => 'test', ) ); + $this->assertTrue( isset( $this->fired_actions['ep_formatted_args'] ) ); $this->assertTrue( isset( $this->fired_actions['ep_formatted_args']['query'], @@ -154,12 +155,12 @@ public function testDecayingEnabled() { * @group search */ public function testDecayingDisabled() { - delete_site_option( 'ep_feature_requirement_statuses' ); - delete_site_option( 'ep_feature_settings' ); - - EP_Features::factory()->handle_feature_activation(); + ep_activate_feature( 'search' ); EP_Features::factory()->setup_features(); + // Need to call this since it's hooked to init + ep_search_setup(); + ep_update_feature( 'search', array( 'active' => true, 'decaying_enabled' => false, From 365c79823854c3b9eadec15763b27caaa8d3412b Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 2 Nov 2017 11:40:13 -0400 Subject: [PATCH 06/31] Setup after activate --- classes/class-ep-features.php | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/classes/class-ep-features.php b/classes/class-ep-features.php index 7de6f0a485..8d89459a26 100644 --- a/classes/class-ep-features.php +++ b/classes/class-ep-features.php @@ -14,7 +14,7 @@ class EP_Features { /** * Stores all features that have been properly included (both active and inactive) - * + * * @since 2.1 * @var array */ @@ -22,35 +22,35 @@ class EP_Features { /** * Initiate class actions - * + * * @since 2.1 */ public function setup() { add_action( 'init', array( $this, 'handle_feature_activation' ), 1 ); - add_action( 'init', array( $this, 'setup_features' ), 0 ); + add_action( 'init', array( $this, 'setup_features' ), 2 ); } /** * Registers a feature for use in ElasticPress - * + * * @param string $slug * @param array $feature_args - * + * * Supported array parameters: - * + * * "title" (string) - Pretty title for feature * "default_settings" (array) - Array of default settings. Only needed if you plan on adding custom settings * "requirements_status_cb" (callback) - Callback to a function that determines the "requirements" status of - * the given feature. 0 means everything is okay. 1 means the feature can be used but there is a warning. - * 2 means the feature cannot be active. This callback needs to return an EP_Feature_Requirements_Status + * the given feature. 0 means everything is okay. 1 means the feature can be used but there is a warning. + * 2 means the feature cannot be active. This callback needs to return an EP_Feature_Requirements_Status * object where the "code" property is one of the values above. * "setup_cb" (callback) - Callback to a function to be called on each page load when the feature is activated * "post_activation_cb" (callback) - Callback to a function to be called after a feature is first activated * "feature_box_summary_cb" (callback) - Callback to a function that outputs HTML feature box summary (short description of feature) * "feature_box_long_cb" (callback) - Callback to a function that outputs HTML feature box full description * "feature_box_settings_cb" (callback) - Callback to a function that outputs custom feature settings fields - * - * @since 2.1 + * + * @since 2.1 * @return boolean */ public function register_feature( $slug, $feature_args ) { @@ -67,7 +67,7 @@ public function register_feature( $slug, $feature_args ) { /** * Activate or deactivate a feature - * + * * @param string $slug * @param array $settings * @param bool $force @@ -80,7 +80,7 @@ public function update_feature( $slug, $settings, $force = true ) { if ( empty( $feature ) ) { return false; } - + $original_state = $feature->is_active(); if ( defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK ) { @@ -136,7 +136,7 @@ public function update_feature( $slug, $settings, $force = true ) { /** * When plugins are adjusted, we need to determine how to activate/deactivate features - * + * * @since 2.2 */ public function handle_feature_activation() { @@ -175,7 +175,7 @@ public function handle_feature_activation() { if ( false === $feature_settings ) { $registered_features = $this->registered_features; - + foreach ( $registered_features as $slug => $feature ) { if ( 0 === $feature->requirements_status()->code ) { ep_activate_feature( $slug ); @@ -278,7 +278,7 @@ public static function factory() { /** * Main function for registering new feature. Since comment above for details - * + * * @param string $slug * @param array $feature_args * @since 2.1 @@ -290,7 +290,7 @@ function ep_register_feature( $slug, $feature_args ) { /** * Update a feature - * + * * @param string $slug * @param array $settings * @param bool $force @@ -303,7 +303,7 @@ function ep_update_feature( $slug, $settings, $force = true ) { /** * Activate a feature - * + * * @param string $slug * @since 2.2 */ @@ -313,7 +313,7 @@ function ep_activate_feature( $slug ) { /** * Dectivate a feature - * + * * @param string $slug * @param bool $force * @since 2.2 From b8329e47d5197e242cbcce5f8e57f0fba51542ba Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Tue, 7 Nov 2017 11:52:57 +0200 Subject: [PATCH 07/31] Updated versions to 2.5 --- elasticpress.php | 4 ++-- readme.txt | 18 +++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/elasticpress.php b/elasticpress.php index 473d31388d..1643b31bcb 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -3,7 +3,7 @@ /** * Plugin Name: ElasticPress * Description: A fast and flexible search and query engine for WordPress. - * Version: 2.4 + * Version: 2.5 * Author: Taylor Lovett, Matt Gross, Aaron Holbrook, 10up * Author URI: http://10up.com * License: GPLv2 or later @@ -22,7 +22,7 @@ define( 'EP_URL', plugin_dir_url( __FILE__ ) ); define( 'EP_PATH', plugin_dir_path( __FILE__ ) ); -define( 'EP_VERSION', '2.4' ); +define( 'EP_VERSION', '2.5' ); /** * We compare the current ES version to this compatibility version number. Compatibility is true when: diff --git a/readme.txt b/readme.txt index 57c43240b6..02b11f1803 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Plugin URI: https://github.com/10up/ElasticPress Tags: performance, slow, search, elasticsearch, fuzzy, facet, aggregation, searching, autosuggest, suggest, elastic, advanced search, woocommerce, related posts Requires at least: 3.7.1 Tested up to: 4.9 -Stable tag: trunk +Stable tag: 2.5 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -38,13 +38,9 @@ Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usag == Changelog == -= 2.3.1, 2.3.2 = += 2.5 = -Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: - -* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. -* Fix broken upgrade sync notification. -* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. +* = 2.4 = @@ -74,6 +70,14 @@ Here is a comphrensive list of changes: * Add escaping per VIP standards. Props [jasonbahl](https://github.com/jasonbahl). * Fix WooCommerce post type warnings. += 2.3.1, 2.3.2 = + +Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: + +* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. +* Fix broken upgrade sync notification. +* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. + = 2.3 = Version 2.3 introduces the Documents feature which indexes text inside of popular file types, and adds those files types to search results. We've also officially added support for Elasticsearch 5.3. From 2a5661a5d087579eb2d61c70e713754d87a2fa05 Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Tue, 7 Nov 2017 11:56:05 +0200 Subject: [PATCH 08/31] Fixed taxonomy check issue --- classes/class-ep-api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index b4b0b3e879..5738e5a681 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -693,7 +693,7 @@ private function prepare_terms( $post ) { foreach ( $selected_taxonomies as $taxonomy ) { // We check if the $taxonomy object as name property. Backward compatibility since WP_Taxonomy introduced in WP 4.7 - if ( ! property_exists( $taxonomy, 'name' ) ) { + if ( ( ! is_object( $taxonomy ) && ! class_exists( (string) $taxonomy ) ) || ! property_exists( $taxonomy, 'name' ) ) { continue; } From fbe24649dacaa2f249172ae32825f091e8fcc4c6 Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Tue, 7 Nov 2017 11:57:41 +0200 Subject: [PATCH 09/31] Updated changelog --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 02b11f1803..1fa3316989 100644 --- a/readme.txt +++ b/readme.txt @@ -40,7 +40,7 @@ Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usag = 2.5 = -* +* Fix taxonomy check issue when ep_sync_taxonomies filter returns unexpected results = 2.4 = From 2067c40335a0828013f3b90f3ff88a32fc933bc2 Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Tue, 28 Nov 2017 19:48:23 +0200 Subject: [PATCH 10/31] Improved taxonomy check --- classes/class-ep-api.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index 5738e5a681..f54598455d 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -692,8 +692,13 @@ private function prepare_terms( $post ) { $allow_hierarchy = apply_filters( 'ep_sync_terms_allow_hierarchy', false ); foreach ( $selected_taxonomies as $taxonomy ) { + // If we get a taxonomy name, we need to convert it to taxonomy object + if ( ! is_object( $taxonomy ) && taxonomy_exists( (string) $taxonomy ) ) { + $taxonomy = get_taxonomy( $taxonomy ); + } + // We check if the $taxonomy object as name property. Backward compatibility since WP_Taxonomy introduced in WP 4.7 - if ( ( ! is_object( $taxonomy ) && ! class_exists( (string) $taxonomy ) ) || ! property_exists( $taxonomy, 'name' ) ) { + if ( ! is_a( $taxonomy, '\WP_Taxonomy' ) || ! property_exists( $taxonomy, 'name' ) ) { continue; } From cac3c420b0239b3ea24517e4531e75072615e90b Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Thu, 4 Jan 2018 15:47:08 +0200 Subject: [PATCH 11/31] Updated version to 2.4.1 --- bin/wp-cli.php | 22 ++++++++++++---------- elasticpress.php | 4 ++-- readme.txt | 19 +++++++++++++------ 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/bin/wp-cli.php b/bin/wp-cli.php index c2251b9b63..b244f7c381 100644 --- a/bin/wp-cli.php +++ b/bin/wp-cli.php @@ -1,7 +1,9 @@ $feature ) { if( $feature['active'] ) { WP_CLI::line( $key ); @@ -148,7 +150,7 @@ public function list_features( $args, $assoc_args ) { } else { WP_CLI::line( __( 'Registered features:', 'elasticpress' ) ); $features = wp_list_pluck( EP_Features::factory()->registered_features, 'slug' ); - + foreach ( $features as $feature ) { WP_CLI::line( $feature ); } @@ -507,7 +509,7 @@ private function _index_helper( $args ) { if ( $no_bulk ) { // index the posts one-by-one. not sure why someone may want to do this. $result = ep_sync_post( get_the_ID() ); - + $this->reset_transient(); do_action( 'ep_cli_post_index', get_the_ID() ); @@ -651,7 +653,7 @@ private function bulk_index( $show_bulk_errors = false ) { // decode the response $response = ep_bulk_index_posts( $body ); - + $this->reset_transient(); do_action( 'ep_cli_post_bulk_index', $this->posts ); @@ -688,7 +690,7 @@ private function bulk_index( $show_bulk_errors = false ) { /** * Formatting bulk error message recursively - * + * * @param array $message_array * @since 2.2 * @return string @@ -863,14 +865,14 @@ private function stop_the_insanity() { */ private function _connect_check() { $host = ep_get_host(); - + if ( empty( $host) ) { WP_CLI::error( __( 'There is no Elasticsearch host set up. Either add one through the dashboard or define one in wp-config.php', 'elasticpress' ) ); } elseif ( ! ep_get_elasticsearch_version( true ) ) { WP_CLI::error( __( 'Unable to reach Elasticsearch Server! Check that service is running.', 'elasticpress' ) ); } } - + /** * Reset transient while indexing * diff --git a/elasticpress.php b/elasticpress.php index 473d31388d..18cf806f10 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -3,7 +3,7 @@ /** * Plugin Name: ElasticPress * Description: A fast and flexible search and query engine for WordPress. - * Version: 2.4 + * Version: 2.4.1 * Author: Taylor Lovett, Matt Gross, Aaron Holbrook, 10up * Author URI: http://10up.com * License: GPLv2 or later @@ -22,7 +22,7 @@ define( 'EP_URL', plugin_dir_url( __FILE__ ) ); define( 'EP_PATH', plugin_dir_path( __FILE__ ) ); -define( 'EP_VERSION', '2.4' ); +define( 'EP_VERSION', '2.4.1' ); /** * We compare the current ES version to this compatibility version number. Compatibility is true when: diff --git a/readme.txt b/readme.txt index 57c43240b6..71fdea56a2 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Author URI: http://10up.com Plugin URI: https://github.com/10up/ElasticPress Tags: performance, slow, search, elasticsearch, fuzzy, facet, aggregation, searching, autosuggest, suggest, elastic, advanced search, woocommerce, related posts Requires at least: 3.7.1 -Tested up to: 4.9 +Tested up to: 4.9.1 Stable tag: trunk License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -38,13 +38,12 @@ Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usag == Changelog == -= 2.3.1, 2.3.2 = += 2.4.1 = -Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: +Version 2.4.1 is a bug fix release. Here are a listed of issues that have been resolved: -* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. -* Fix broken upgrade sync notification. -* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. +* Updated stats cli command to properly display index size. +* Updated WooCommerce feature to properly detect signle product page. = 2.4 = @@ -74,6 +73,14 @@ Here is a comphrensive list of changes: * Add escaping per VIP standards. Props [jasonbahl](https://github.com/jasonbahl). * Fix WooCommerce post type warnings. += 2.3.1, 2.3.2 = + +Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: + +* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. +* Fix broken upgrade sync notification. +* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. + = 2.3 = Version 2.3 introduces the Documents feature which indexes text inside of popular file types, and adds those files types to search results. We've also officially added support for Elasticsearch 5.3. From eaf8d30611e0286729c236ff0c7f6554a6476ca0 Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Thu, 4 Jan 2018 16:04:42 +0200 Subject: [PATCH 12/31] #985 fixed widgets setup issue --- classes/class-ep-features.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/class-ep-features.php b/classes/class-ep-features.php index 8d89459a26..88414b6d80 100644 --- a/classes/class-ep-features.php +++ b/classes/class-ep-features.php @@ -26,8 +26,8 @@ class EP_Features { * @since 2.1 */ public function setup() { - add_action( 'init', array( $this, 'handle_feature_activation' ), 1 ); - add_action( 'init', array( $this, 'setup_features' ), 2 ); + add_action( 'init', array( $this, 'handle_feature_activation' ), 0 ); + add_action( 'init', array( $this, 'setup_features' ), 0 ); } /** From d458979517a7a86d348526117bc5b20123a385be Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Thu, 4 Jan 2018 16:06:21 +0200 Subject: [PATCH 13/31] Updated readme --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 71fdea56a2..ce498a69b7 100644 --- a/readme.txt +++ b/readme.txt @@ -44,6 +44,7 @@ Version 2.4.1 is a bug fix release. Here are a listed of issues that have been r * Updated stats cli command to properly display index size. * Updated WooCommerce feature to properly detect signle product page. +* Fixed widgets setup issue. = 2.4 = From 36164eb35ce0f8ebc0e4f84f8ff720a4135639fd Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Thu, 4 Jan 2018 16:25:45 +0200 Subject: [PATCH 14/31] Added a small comment --- classes/class-ep-features.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/class-ep-features.php b/classes/class-ep-features.php index 88414b6d80..e9bfc63a8e 100644 --- a/classes/class-ep-features.php +++ b/classes/class-ep-features.php @@ -26,6 +26,7 @@ class EP_Features { * @since 2.1 */ public function setup() { + // hooks order matters, please, make sure feature activation goes before features setup add_action( 'init', array( $this, 'handle_feature_activation' ), 0 ); add_action( 'init', array( $this, 'setup_features' ), 0 ); } From a831000028b9310851216329ea52a8c918d1856d Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Thu, 4 Jan 2018 17:23:37 +0200 Subject: [PATCH 15/31] #987 added "inherit" post status if attachment post type is indexable --- classes/class-ep-config.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/classes/class-ep-config.php b/classes/class-ep-config.php index f2ac221f9f..a407cd8ef0 100644 --- a/classes/class-ep-config.php +++ b/classes/class-ep-config.php @@ -151,7 +151,14 @@ public function get_indexable_post_types() { * @return array */ public function get_indexable_post_status() { - return apply_filters( 'ep_indexable_post_status', array( 'publish' ) ); + $statuses = array( 'publish' ); + + $post_types = ep_get_indexable_post_types(); + if ( in_array( 'attachment', $post_types ) ) { + $statuses[] = 'inherit'; + } + + return apply_filters( 'ep_indexable_post_status', $statuses ); } /** From 2d457ceb45fd807c448a8361e880c2185a731a40 Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Thu, 4 Jan 2018 17:24:16 +0200 Subject: [PATCH 16/31] Updated readme --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 71fdea56a2..7a20882fb9 100644 --- a/readme.txt +++ b/readme.txt @@ -44,6 +44,7 @@ Version 2.4.1 is a bug fix release. Here are a listed of issues that have been r * Updated stats cli command to properly display index size. * Updated WooCommerce feature to properly detect signle product page. +* Added "inherit" post status if attachment post type is indexable. = 2.4 = From 6532a2e3199207bf89dd93f7f2217afdfb346d05 Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Thu, 4 Jan 2018 17:40:27 +0200 Subject: [PATCH 17/31] #989 Updated autosuggest js file to use event.target instead of event.srcElement --- features/autosuggest/assets/js/autosuggest.min.js | 2 +- features/autosuggest/assets/js/src/autosuggest.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/autosuggest/assets/js/autosuggest.min.js b/features/autosuggest/assets/js/autosuggest.min.js index 21803be6d5..80d3f958d2 100644 --- a/features/autosuggest/assets/js/autosuggest.min.js +++ b/features/autosuggest/assets/js/autosuggest.min.js @@ -1 +1 @@ -!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function i(e,t,s,o){"all"!==t&&void 0!==t&&""!==t||(t="all"),""===s&&(t="publish");var a={sort:[{_score:{order:"desc"}}],query:{multi_match:{query:e,fields:o}}};return"string"==typeof t&&"all"!==t&&(t=t.split(",")),"string"==typeof s&&(s=s.split(",")),a.post_filter={bool:{must:[{terms:{post_status:s}}]}},"all"!==t&&a.post_filter.bool.must.push({terms:{"post_type.raw":t}}),a}function u(t){return jQuery.support.cors=!0,e.ajax({url:epas.endpointUrl,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function r(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),i=n.find(".autosuggest-list");for(i.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+u+"").appendTo(i)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.children("span").get(0)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function l(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.endpointUrl&&""!==epas.endpointUrl){var c=e('.ep-autosuggest, input[type="search"], .search-field'),d=e('
    ');c.each(function(t,s){var o=e('
    '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:c.outerHeight()-1,"background-color":c.css("background-color")}),e(c).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&l()})}),c.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType,n=epas.postStatus,c=epas.searchFields;s.length>=2?u(i(s,a,n,c)).done(function(t){if(t._shards.successful>0){var s={},a=[];e.each(t.hits.hits,function(e,t){var o=t._source.post_title,n=t._source.permalink,i=t._source.post_id;s[i]||(s[i]=!0,a.push({text:o,url:n}))}),0===a.length?l():r(a,o)}else l()}):0===s.length&&l()}},200))}),window.epasAPI={hideAutosuggestBox:l,updateAutosuggestBox:r,esSearch:u,buildSearchQuery:i}}}(jQuery); \ No newline at end of file +!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function i(e,t,s,o){"all"!==t&&void 0!==t&&""!==t||(t="all"),""===s&&(t="publish");var a={sort:[{_score:{order:"desc"}}],query:{multi_match:{query:e,fields:o}}};return"string"==typeof t&&"all"!==t&&(t=t.split(",")),"string"==typeof s&&(s=s.split(",")),a.post_filter={bool:{must:[{terms:{post_status:s}}]}},"all"!==t&&a.post_filter.bool.must.push({terms:{"post_type.raw":t}}),a}function u(t){return jQuery.support.cors=!0,e.ajax({url:epas.endpointUrl,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function r(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),i=n.find(".autosuggest-list");for(i.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+u+"").appendTo(i)}e(".autosuggest-item").on("click",function(e){a(s,e.target)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.children("span").get(0)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function l(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.endpointUrl&&""!==epas.endpointUrl){var c=e('.ep-autosuggest, input[type="search"], .search-field'),d=e('
      ');c.each(function(t,s){var o=e('
      '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:c.outerHeight()-1,"background-color":c.css("background-color")}),e(c).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&l()})}),c.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType,n=epas.postStatus,c=epas.searchFields;s.length>=2?u(i(s,a,n,c)).done(function(t){if(t._shards.successful>0){var s={},a=[];e.each(t.hits.hits,function(e,t){var o=t._source.post_title,n=t._source.permalink,i=t._source.post_id;s[i]||(s[i]=!0,a.push({text:o,url:n}))}),0===a.length?l():r(a,o)}else l()}):0===s.length&&l()}},200))}),window.epasAPI={hideAutosuggestBox:l,updateAutosuggestBox:r,esSearch:u,buildSearchQuery:i}}}(jQuery); \ No newline at end of file diff --git a/features/autosuggest/assets/js/src/autosuggest.js b/features/autosuggest/assets/js/src/autosuggest.js index 1e8d683843..40eb67fc15 100644 --- a/features/autosuggest/assets/js/src/autosuggest.js +++ b/features/autosuggest/assets/js/src/autosuggest.js @@ -190,7 +190,7 @@ // Listen to items to auto-fill search box and submit form $( '.autosuggest-item' ).on( 'click', function( event ) { - selectItem( $localInput, event.srcElement ); + selectItem( $localInput, event.target ); } ); $localInput.off( 'keydown' ); From 4cf74a586789bb799b65355a0534abf4fa7045ea Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Thu, 4 Jan 2018 17:41:27 +0200 Subject: [PATCH 18/31] Updated readme --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 71fdea56a2..5aaea0b787 100644 --- a/readme.txt +++ b/readme.txt @@ -44,6 +44,7 @@ Version 2.4.1 is a bug fix release. Here are a listed of issues that have been r * Updated stats cli command to properly display index size. * Updated WooCommerce feature to properly detect signle product page. +* Updated javascript file of the autosuggest feature to use "event.target" instead of "event.srcElement". = 2.4 = From 34592aecbefeb4a8c315030a3e7d089105acc2e9 Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Wed, 10 Jan 2018 15:39:46 +0200 Subject: [PATCH 19/31] Added Content-Type header with application/json value to work properly with ES 6+ --- classes/class-ep-api.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index b4b0b3e879..5f0dcf2ebb 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -333,23 +333,25 @@ public function delete_post( $post_id, $blocking = true ) { * @return array */ public function format_request_headers() { - $headers = array(); + $headers = array( + 'Content-Type' => 'application/json', + ); // Check for ElasticPress API key and add to header if needed. if ( defined( 'EP_API_KEY' ) && EP_API_KEY ) { $headers['X-ElasticPress-API-Key'] = EP_API_KEY; } - /** - * ES Shield Username & Password - * Adds username:password basic authentication headers - * - * Define the constant ES_SHIELD in your wp-config.php - * Format: 'username:password' (colon separated) - * Example: define( 'ES_SHIELD', 'es_admin:password' ); - * - * @since 1.9 - */ + /** + * ES Shield Username & Password + * Adds username:password basic authentication headers + * + * Define the constant ES_SHIELD in your wp-config.php + * Format: 'username:password' (colon separated) + * Example: define( 'ES_SHIELD', 'es_admin:password' ); + * + * @since 1.9 + */ if ( defined( 'ES_SHIELD' ) && ES_SHIELD ) { $headers['Authorization'] = 'Basic ' . base64_encode( ES_SHIELD ); } From 601c66f84392b4f4debc5831ffe994a3955c585b Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Wed, 10 Jan 2018 15:41:35 +0200 Subject: [PATCH 20/31] Updated readme --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 02b11f1803..52381e978a 100644 --- a/readme.txt +++ b/readme.txt @@ -40,7 +40,7 @@ Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usag = 2.5 = -* +* Added "Content-Type: application/json" header to work properly with ES 6+ = 2.4 = From 7944cfdcf3aab5ca8a41d86e337b11918b3ecf23 Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Wed, 24 Jan 2018 13:20:02 +0200 Subject: [PATCH 21/31] Reverted changelog changes and version updates --- elasticpress.php | 4 ++-- readme.txt | 20 ++++++-------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/elasticpress.php b/elasticpress.php index 18cf806f10..761f27140e 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -3,7 +3,7 @@ /** * Plugin Name: ElasticPress * Description: A fast and flexible search and query engine for WordPress. - * Version: 2.4.1 + * Version: 2.4.0 * Author: Taylor Lovett, Matt Gross, Aaron Holbrook, 10up * Author URI: http://10up.com * License: GPLv2 or later @@ -22,7 +22,7 @@ define( 'EP_URL', plugin_dir_url( __FILE__ ) ); define( 'EP_PATH', plugin_dir_path( __FILE__ ) ); -define( 'EP_VERSION', '2.4.1' ); +define( 'EP_VERSION', '2.4.0' ); /** * We compare the current ES version to this compatibility version number. Compatibility is true when: diff --git a/readme.txt b/readme.txt index ce498a69b7..57c43240b6 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Author URI: http://10up.com Plugin URI: https://github.com/10up/ElasticPress Tags: performance, slow, search, elasticsearch, fuzzy, facet, aggregation, searching, autosuggest, suggest, elastic, advanced search, woocommerce, related posts Requires at least: 3.7.1 -Tested up to: 4.9.1 +Tested up to: 4.9 Stable tag: trunk License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -38,13 +38,13 @@ Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usag == Changelog == -= 2.4.1 = += 2.3.1, 2.3.2 = -Version 2.4.1 is a bug fix release. Here are a listed of issues that have been resolved: +Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: -* Updated stats cli command to properly display index size. -* Updated WooCommerce feature to properly detect signle product page. -* Fixed widgets setup issue. +* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. +* Fix broken upgrade sync notification. +* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. = 2.4 = @@ -74,14 +74,6 @@ Here is a comphrensive list of changes: * Add escaping per VIP standards. Props [jasonbahl](https://github.com/jasonbahl). * Fix WooCommerce post type warnings. -= 2.3.1, 2.3.2 = - -Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: - -* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. -* Fix broken upgrade sync notification. -* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. - = 2.3 = Version 2.3 introduces the Documents feature which indexes text inside of popular file types, and adds those files types to search results. We've also officially added support for Elasticsearch 5.3. From eda0df89e7d310f5e4a084708997c341c3602486 Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Wed, 24 Jan 2018 13:21:05 +0200 Subject: [PATCH 22/31] Reverted version updates --- elasticpress.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elasticpress.php b/elasticpress.php index 761f27140e..473d31388d 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -3,7 +3,7 @@ /** * Plugin Name: ElasticPress * Description: A fast and flexible search and query engine for WordPress. - * Version: 2.4.0 + * Version: 2.4 * Author: Taylor Lovett, Matt Gross, Aaron Holbrook, 10up * Author URI: http://10up.com * License: GPLv2 or later @@ -22,7 +22,7 @@ define( 'EP_URL', plugin_dir_url( __FILE__ ) ); define( 'EP_PATH', plugin_dir_path( __FILE__ ) ); -define( 'EP_VERSION', '2.4.0' ); +define( 'EP_VERSION', '2.4' ); /** * We compare the current ES version to this compatibility version number. Compatibility is true when: From 1418507e13c317c9a4ff074625520b1bf4f7c84e Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Wed, 24 Jan 2018 13:24:55 +0200 Subject: [PATCH 23/31] Reverted changelog changes and version updates --- elasticpress.php | 4 ++-- readme.txt | 18 +++++++----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/elasticpress.php b/elasticpress.php index 1643b31bcb..473d31388d 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -3,7 +3,7 @@ /** * Plugin Name: ElasticPress * Description: A fast and flexible search and query engine for WordPress. - * Version: 2.5 + * Version: 2.4 * Author: Taylor Lovett, Matt Gross, Aaron Holbrook, 10up * Author URI: http://10up.com * License: GPLv2 or later @@ -22,7 +22,7 @@ define( 'EP_URL', plugin_dir_url( __FILE__ ) ); define( 'EP_PATH', plugin_dir_path( __FILE__ ) ); -define( 'EP_VERSION', '2.5' ); +define( 'EP_VERSION', '2.4' ); /** * We compare the current ES version to this compatibility version number. Compatibility is true when: diff --git a/readme.txt b/readme.txt index 52381e978a..57c43240b6 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Plugin URI: https://github.com/10up/ElasticPress Tags: performance, slow, search, elasticsearch, fuzzy, facet, aggregation, searching, autosuggest, suggest, elastic, advanced search, woocommerce, related posts Requires at least: 3.7.1 Tested up to: 4.9 -Stable tag: 2.5 +Stable tag: trunk License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -38,9 +38,13 @@ Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usag == Changelog == -= 2.5 = += 2.3.1, 2.3.2 = -* Added "Content-Type: application/json" header to work properly with ES 6+ +Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: + +* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. +* Fix broken upgrade sync notification. +* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. = 2.4 = @@ -70,14 +74,6 @@ Here is a comphrensive list of changes: * Add escaping per VIP standards. Props [jasonbahl](https://github.com/jasonbahl). * Fix WooCommerce post type warnings. -= 2.3.1, 2.3.2 = - -Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: - -* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. -* Fix broken upgrade sync notification. -* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. - = 2.3 = Version 2.3 introduces the Documents feature which indexes text inside of popular file types, and adds those files types to search results. We've also officially added support for Elasticsearch 5.3. From 143708be0e110df328c4d3cb04cf0de40e4fab6a Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Wed, 24 Jan 2018 13:27:48 +0200 Subject: [PATCH 24/31] Reverted changelog changes and version updates --- elasticpress.php | 4 ++-- readme.txt | 20 ++++++-------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/elasticpress.php b/elasticpress.php index 18cf806f10..473d31388d 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -3,7 +3,7 @@ /** * Plugin Name: ElasticPress * Description: A fast and flexible search and query engine for WordPress. - * Version: 2.4.1 + * Version: 2.4 * Author: Taylor Lovett, Matt Gross, Aaron Holbrook, 10up * Author URI: http://10up.com * License: GPLv2 or later @@ -22,7 +22,7 @@ define( 'EP_URL', plugin_dir_url( __FILE__ ) ); define( 'EP_PATH', plugin_dir_path( __FILE__ ) ); -define( 'EP_VERSION', '2.4.1' ); +define( 'EP_VERSION', '2.4' ); /** * We compare the current ES version to this compatibility version number. Compatibility is true when: diff --git a/readme.txt b/readme.txt index 5aaea0b787..57c43240b6 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Author URI: http://10up.com Plugin URI: https://github.com/10up/ElasticPress Tags: performance, slow, search, elasticsearch, fuzzy, facet, aggregation, searching, autosuggest, suggest, elastic, advanced search, woocommerce, related posts Requires at least: 3.7.1 -Tested up to: 4.9.1 +Tested up to: 4.9 Stable tag: trunk License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -38,13 +38,13 @@ Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usag == Changelog == -= 2.4.1 = += 2.3.1, 2.3.2 = -Version 2.4.1 is a bug fix release. Here are a listed of issues that have been resolved: +Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: -* Updated stats cli command to properly display index size. -* Updated WooCommerce feature to properly detect signle product page. -* Updated javascript file of the autosuggest feature to use "event.target" instead of "event.srcElement". +* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. +* Fix broken upgrade sync notification. +* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. = 2.4 = @@ -74,14 +74,6 @@ Here is a comphrensive list of changes: * Add escaping per VIP standards. Props [jasonbahl](https://github.com/jasonbahl). * Fix WooCommerce post type warnings. -= 2.3.1, 2.3.2 = - -Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: - -* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. -* Fix broken upgrade sync notification. -* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. - = 2.3 = Version 2.3 introduces the Documents feature which indexes text inside of popular file types, and adds those files types to search results. We've also officially added support for Elasticsearch 5.3. From 63a4f9154a59b57a25811e8c0de0963118fc48e1 Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Wed, 24 Jan 2018 13:32:33 +0200 Subject: [PATCH 25/31] Reverted changelog changes and version updates --- elasticpress.php | 4 ++-- readme.txt | 20 ++++++-------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/elasticpress.php b/elasticpress.php index 18cf806f10..473d31388d 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -3,7 +3,7 @@ /** * Plugin Name: ElasticPress * Description: A fast and flexible search and query engine for WordPress. - * Version: 2.4.1 + * Version: 2.4 * Author: Taylor Lovett, Matt Gross, Aaron Holbrook, 10up * Author URI: http://10up.com * License: GPLv2 or later @@ -22,7 +22,7 @@ define( 'EP_URL', plugin_dir_url( __FILE__ ) ); define( 'EP_PATH', plugin_dir_path( __FILE__ ) ); -define( 'EP_VERSION', '2.4.1' ); +define( 'EP_VERSION', '2.4' ); /** * We compare the current ES version to this compatibility version number. Compatibility is true when: diff --git a/readme.txt b/readme.txt index 7a20882fb9..57c43240b6 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Author URI: http://10up.com Plugin URI: https://github.com/10up/ElasticPress Tags: performance, slow, search, elasticsearch, fuzzy, facet, aggregation, searching, autosuggest, suggest, elastic, advanced search, woocommerce, related posts Requires at least: 3.7.1 -Tested up to: 4.9.1 +Tested up to: 4.9 Stable tag: trunk License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -38,13 +38,13 @@ Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usag == Changelog == -= 2.4.1 = += 2.3.1, 2.3.2 = -Version 2.4.1 is a bug fix release. Here are a listed of issues that have been resolved: +Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: -* Updated stats cli command to properly display index size. -* Updated WooCommerce feature to properly detect signle product page. -* Added "inherit" post status if attachment post type is indexable. +* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. +* Fix broken upgrade sync notification. +* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. = 2.4 = @@ -74,14 +74,6 @@ Here is a comphrensive list of changes: * Add escaping per VIP standards. Props [jasonbahl](https://github.com/jasonbahl). * Fix WooCommerce post type warnings. -= 2.3.1, 2.3.2 = - -Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: - -* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. -* Fix broken upgrade sync notification. -* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. - = 2.3 = Version 2.3 introduces the Documents feature which indexes text inside of popular file types, and adds those files types to search results. We've also officially added support for Elasticsearch 5.3. From 605588d97465fd7331e238ed1ef6b35011d72e85 Mon Sep 17 00:00:00 2001 From: Eugene Manuilov Date: Wed, 24 Jan 2018 13:41:52 +0200 Subject: [PATCH 26/31] Reverted changelog changes and version updates --- elasticpress.php | 4 ++-- readme.txt | 18 +++++++----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/elasticpress.php b/elasticpress.php index 1643b31bcb..473d31388d 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -3,7 +3,7 @@ /** * Plugin Name: ElasticPress * Description: A fast and flexible search and query engine for WordPress. - * Version: 2.5 + * Version: 2.4 * Author: Taylor Lovett, Matt Gross, Aaron Holbrook, 10up * Author URI: http://10up.com * License: GPLv2 or later @@ -22,7 +22,7 @@ define( 'EP_URL', plugin_dir_url( __FILE__ ) ); define( 'EP_PATH', plugin_dir_path( __FILE__ ) ); -define( 'EP_VERSION', '2.5' ); +define( 'EP_VERSION', '2.4' ); /** * We compare the current ES version to this compatibility version number. Compatibility is true when: diff --git a/readme.txt b/readme.txt index 1fa3316989..57c43240b6 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Plugin URI: https://github.com/10up/ElasticPress Tags: performance, slow, search, elasticsearch, fuzzy, facet, aggregation, searching, autosuggest, suggest, elastic, advanced search, woocommerce, related posts Requires at least: 3.7.1 Tested up to: 4.9 -Stable tag: 2.5 +Stable tag: trunk License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -38,9 +38,13 @@ Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usag == Changelog == -= 2.5 = += 2.3.1, 2.3.2 = -* Fix taxonomy check issue when ep_sync_taxonomies filter returns unexpected results +Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: + +* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. +* Fix broken upgrade sync notification. +* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. = 2.4 = @@ -70,14 +74,6 @@ Here is a comphrensive list of changes: * Add escaping per VIP standards. Props [jasonbahl](https://github.com/jasonbahl). * Fix WooCommerce post type warnings. -= 2.3.1, 2.3.2 = - -Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: - -* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. -* Fix broken upgrade sync notification. -* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. - = 2.3 = Version 2.3 introduces the Documents feature which indexes text inside of popular file types, and adds those files types to search results. We've also officially added support for Elasticsearch 5.3. From afc4095a6e9afe2fd20cb389a82fe11e2b5c9d4f Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Wed, 24 Jan 2018 23:52:52 -0500 Subject: [PATCH 27/31] Fix license identifier --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 155bf80285..8b4b570750 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Supercharge WordPress with Elasticsearch.", "type": "wordpress-plugin", "keywords": ["wordpress", "plugin", "elasticsearch", "elasticpress", "search"], - "license": ["GPLv2"], + "license": ["GPL-2.0-only"], "authors": [ { "name": "Aaron Holbrook", From 9f6a1688fbdf9151bff66ae7a7bed053ad38c1a0 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Mon, 29 Jan 2018 23:11:26 -0500 Subject: [PATCH 28/31] Revert "Added inherit status to support attachments indexing." --- classes/class-ep-config.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/classes/class-ep-config.php b/classes/class-ep-config.php index a407cd8ef0..f2ac221f9f 100644 --- a/classes/class-ep-config.php +++ b/classes/class-ep-config.php @@ -151,14 +151,7 @@ public function get_indexable_post_types() { * @return array */ public function get_indexable_post_status() { - $statuses = array( 'publish' ); - - $post_types = ep_get_indexable_post_types(); - if ( in_array( 'attachment', $post_types ) ) { - $statuses[] = 'inherit'; - } - - return apply_filters( 'ep_indexable_post_status', $statuses ); + return apply_filters( 'ep_indexable_post_status', array( 'publish' ) ); } /** From 0fc1dd1b5e02b6f63f4a846490f4c9ac5b83fe3e Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Mon, 29 Jan 2018 23:24:23 -0500 Subject: [PATCH 29/31] Clean up post type code. Inspired by #986 --- classes/class-ep-wp-query-integration.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/classes/class-ep-wp-query-integration.php b/classes/class-ep-wp-query-integration.php index ab4faaf7cd..b4ec817e8d 100644 --- a/classes/class-ep-wp-query-integration.php +++ b/classes/class-ep-wp-query-integration.php @@ -247,18 +247,7 @@ public function filter_posts_request( $request, $query ) { $query_vars['post_type'] = apply_filters( 'ep_query_post_type', $query_vars['post_type'], $query ); if ( 'any' === $query_vars['post_type'] ) { - unset( $query_vars['post_type'] ); - } - - /** - * If not search and not set default to post. If not set and is search, use searchable post tpyes - */ - if ( empty( $query_vars['post_type'] ) ) { - if ( empty( $query_vars['s'] ) ) { - $query_vars['post_type'] = 'post'; - } else { - $query_vars['post_type'] = array_values( get_post_types( array( 'exclude_from_search' => false ) ) ); - } + $query_vars['post_type'] = 'post'; } if ( empty( $query_vars['post_type'] ) ) { From 77880475d6f93053ecc8db8f4d4bd87ddc92814a Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Mon, 29 Jan 2018 23:33:53 -0500 Subject: [PATCH 30/31] Prepare for 2.4.1 --- elasticpress.php | 4 ++-- readme.txt | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/elasticpress.php b/elasticpress.php index 473d31388d..18cf806f10 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -3,7 +3,7 @@ /** * Plugin Name: ElasticPress * Description: A fast and flexible search and query engine for WordPress. - * Version: 2.4 + * Version: 2.4.1 * Author: Taylor Lovett, Matt Gross, Aaron Holbrook, 10up * Author URI: http://10up.com * License: GPLv2 or later @@ -22,7 +22,7 @@ define( 'EP_URL', plugin_dir_url( __FILE__ ) ); define( 'EP_PATH', plugin_dir_path( __FILE__ ) ); -define( 'EP_VERSION', '2.4' ); +define( 'EP_VERSION', '2.4.1' ); /** * We compare the current ES version to this compatibility version number. Compatibility is true when: diff --git a/readme.txt b/readme.txt index 57c43240b6..594056f769 100644 --- a/readme.txt +++ b/readme.txt @@ -38,13 +38,14 @@ Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usag == Changelog == -= 2.3.1, 2.3.2 = += 2.4.1 = -Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: +Version 2.4.1 is a bug fix and maintenance release. Here are a listed of issues that have been resolved: -* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. -* Fix broken upgrade sync notification. -* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. +* Support Elasticsearch 6.1 and properly send Content-Type header with application/json. Props [eugene-manuilov](https://github.com/eugene-manuilov). +* Fix autosuggest event target issue bug. Props [eugene-manuilov](https://github.com/eugene-manuilov). +* Fix widget init bug. Props [eugene-manuilov](https://github.com/eugene-manuilov). +* Fix taxonomy sync parameter warning. Props [eugene-manuilov](https://github.com/eugene-manuilov). = 2.4 = @@ -74,6 +75,14 @@ Here is a comphrensive list of changes: * Add escaping per VIP standards. Props [jasonbahl](https://github.com/jasonbahl). * Fix WooCommerce post type warnings. += 2.3.1, 2.3.2 = + +Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have been resolved: + +* Cache ES plugins request. This is super important. Instead of checking the status of ES on every page load, do it every 5 minutes. If ES isn't available, show admin notification that allows you to retry the host. +* Fix broken upgrade sync notification. +* Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. + = 2.3 = Version 2.3 introduces the Documents feature which indexes text inside of popular file types, and adds those files types to search results. We've also officially added support for Elasticsearch 5.3. From 096b31507c6e63bb607d226429e381473fbc91e3 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Tue, 30 Jan 2018 15:38:03 -0500 Subject: [PATCH 31/31] ES compat --- elasticpress.php | 2 +- readme.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/elasticpress.php b/elasticpress.php index 18cf806f10..62a4b3222c 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -33,7 +33,7 @@ * * @since 2.2 */ -define( 'EP_ES_VERSION_MAX', '5.6' ); +define( 'EP_ES_VERSION_MAX', '6.1' ); define( 'EP_ES_VERSION_MIN', '1.7' ); require_once( 'classes/class-ep-config.php' ); diff --git a/readme.txt b/readme.txt index 594056f769..f062c5d16d 100644 --- a/readme.txt +++ b/readme.txt @@ -46,6 +46,7 @@ Version 2.4.1 is a bug fix and maintenance release. Here are a listed of issues * Fix autosuggest event target issue bug. Props [eugene-manuilov](https://github.com/eugene-manuilov). * Fix widget init bug. Props [eugene-manuilov](https://github.com/eugene-manuilov). * Fix taxonomy sync parameter warning. Props [eugene-manuilov](https://github.com/eugene-manuilov). +* Increase maximum Elasticsearch compatibility to 6.1 = 2.4 =