From b8eb0207ac6ee4cf7675f4160962c1139f3c8b4e Mon Sep 17 00:00:00 2001 From: Chop Chop Date: Mon, 18 May 2020 11:40:16 +0200 Subject: [PATCH 1/2] Reset if processing is in progress and there are errors in configuration --- doofinder/includes/class-index-interface.php | 56 ++++++++++++++------ 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/doofinder/includes/class-index-interface.php b/doofinder/includes/class-index-interface.php index 4927dd6..b23b0a7 100644 --- a/doofinder/includes/class-index-interface.php +++ b/doofinder/includes/class-index-interface.php @@ -207,6 +207,8 @@ private function are_api_keys_present() { * Generate the HTML of the indexing page. */ private function render_html_subpage() { + $status = $this->indexing_data->get( 'status' ); + ?>
@@ -214,8 +216,30 @@ private function render_html_subpage() { is_language_selected() && $this->are_api_keys_present() ) { + // We have the multilanguage plugin, but no language is selected. + if ( ! $this->is_language_selected() ) { + $this->render_html_select_language(); + + // API keys are not present. + } else if ( ! $this->are_api_keys_present() ) { + $this->render_html_missing_api_keys(); + + // Generally it should not be possible that we are in + // the middle of processing if keys are invalid, but some + // people have experienced that. Probably because of some + // DB shenanigans? In any case, if the index is being + // processed and we have no API keys that's probably and error + // so we should reset the processing. + if ( $status === 'processing' ) { + $this->indexing_data->set( 'status', 'new' ); + $this->indexing_data->save(); + + $this->render_html_indexing_reset(); + } + + // Settings are ok, we have API keys, etc. + // We can render the indexing interface. + } else { $this->render_html_wp_debug_warning(); $this->render_html_processing_status(); $this->render_html_progress_bar(); @@ -223,8 +247,6 @@ private function render_html_subpage() { $this->render_html_indexing_messages(); $this->render_html_indexing_error(); $this->render_html_index_button(); - } else { - $this->render_html_settings_error(); } ?> @@ -233,19 +255,6 @@ private function render_html_subpage() { is_language_selected() ) { - $this->render_html_select_language(); - - return; - } - - $this->render_html_missing_api_keys(); - } - /** * Render error notifying the user that they should select * a language first. @@ -273,6 +282,19 @@ private function render_html_missing_api_keys() { + +
+

+
+ + Date: Mon, 18 May 2020 12:39:53 +0200 Subject: [PATCH 2/2] New Release: v0.3.4 --- doofinder/doofinder.php | 4 ++-- doofinder/readme.txt | 7 +++++-- package.json | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/doofinder/doofinder.php b/doofinder/doofinder.php index 88dd298..a44cbcd 100644 --- a/doofinder/doofinder.php +++ b/doofinder/doofinder.php @@ -3,7 +3,7 @@ * Plugin Name: Doofinder * License: GPLv2 or later * License URI: http://www.gnu.org/licenses/gpl-2.0.html - * Version: 0.3.3 + * Version: 0.3.4 * Author: Doofinder * Description: Integrate Doofinder Search in your WordPress website. * @@ -30,7 +30,7 @@ class Doofinder_For_WordPress { * * @var string */ - public static $version = '0.3.3'; + public static $version = '0.3.4'; /** * The only instance of Doofinder_For_WordPress diff --git a/doofinder/readme.txt b/doofinder/readme.txt index 35f8042..3373d73 100644 --- a/doofinder/readme.txt +++ b/doofinder/readme.txt @@ -1,9 +1,9 @@ === Doofinder === Contributors: doofinder, chopchoporg Tags: search, autocomplete -Version: 0.3.3 +Version: 0.3.4 Requires at least: 4.1 -Tested up to: 5.2.3 +Tested up to: 5.4.1 Stable tag: trunk License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -112,6 +112,9 @@ Just send your questions to and we will try to an == Changelog == += 0.3.4 = +- Reset if processing is in progress and there are errors in configuration. + = 0.3.3 = - Prevent deleting all types from Doofinder when indexing, delete only those managed by the module. diff --git a/package.json b/package.json index 7af01e8..e9264f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "doofinder-wordpress", - "version": "0.3.3", + "version": "0.3.4", "description": "Integrate Doofinder in your WordPress site with (almost) no effort.", "main": "index.js", "scripts": {