Currently, the plugin loops through all the selected suggestion sources (categories, titles etc..) and grabs the first matching keyword from this list.
The problem is that the list is not re-organized after each source suggestion.
Example issue
There is a category "nsfw'" and a post titled "Woman". User selected post titles and post categories as suggestion in this exact order.
- User types in "wsfn"
- The suggestions array will be [woman, nsfw] because post titles were the first in source list
- Plugin suggest results for the first element, even though the similar_text() function would rank "nsfw" higher
Solution
The list must be reorganized again after the suggestions.
Currently, the plugin loops through all the selected suggestion sources (categories, titles etc..) and grabs the first matching keyword from this list.
The problem is that the list is not re-organized after each source suggestion.
Example issue
There is a category "nsfw'" and a post titled "Woman". User selected post titles and post categories as suggestion in this exact order.
Solution
The list must be reorganized again after the suggestions.