CB
Forum Replies Created
-
PHP: 8.3
WordPress: 6.9When I first posted the question, I had clicked on the “Add new (raw HTML)” button, which opens a window to paste the HTML in it. In a test, I noticed that no footer was added, but that the proper invisible (machine-readable) unsubscribe link was added.
I have since moved to creating a template using the composer and the HTML block, which makes it easier to have the full footer, with unsubscribe/manage links.
Thank you.It turned out it was a Cloudflare Transform Rule that was meant for search query strings only (starting with “s=”), but for which I created a faulty logic. All is fixed now.
Thanks for taking your time to clarify this
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Need help fine tuning the Did you mean featureThe Relevanssi “Did you mean” works like the Google one and only offers the best suggestion.
It all makes total sense to me now, thank you.
customize the function
require some rewriting of the code
I’ll see if I can come up with a solution for multiple suggestions, but…
As it is, the function does a great job! I re-ran many of the logged “unsuccessful” searches and it does an amazing job as far as suggesting the right word, I’d say something like >90% of the attempts.
I only had a small issue with expressions. Though 99% or entries in the dictionary are single words, I have a small set of 2- or 3-word phrases, like “come on”, but searching for anything with a space character resulted in an odd output. To circumvent that, I added an if condition to the
index.phpexcluding queries with an space from invoking the DYM shortcode.My final setup, for those searching for a solution to a similar situation, that is, adding Did You Mean functionality to a dictionary or dictionary-like website:
In the child theme’s
functions.php:// Add Did You Mean? functionality to search by Relevanssi // Discussion: https://ww.wp.xz.cn/support/topic/need-help-fine-tuning-the-did-you-mean-feature/ add_shortcode( 'rlv_didyoumean', function() { $didyoumean = ''; if ( function_exists( 'relevanssi_didyoumean' ) ) { $didyoumean = relevanssi_didyoumean( get_search_query( false ), '<p>Você quis dizer: ', '?</p>', 1, false ); } return $didyoumean; } ); // Get suggestions from words with 1 or more results add_filter( 'relevanssi_get_words_having', function() { return 0; } );In the
index.php(which in the Twenty-Twenty theme handles search results):// Invoke Did You Mean shortcode, by Relevanssi // But only if query does not contain a space character $query_str = get_search_query( false ); if (preg_match("/\s/", urldecode($query_str) ) == false){ echo do_shortcode( '[rlv_didyoumean]' ); }Thank you very much, @msaari for this great plugin and your generous support. I appreciate the time you devoted to guide me through this.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Need help fine tuning the Did you mean featureonly has about 100 words
Sorry, that of course is the limit in the log viewer. I’ve just downloaded the log CSV file, and filtering for hits greater than 0 I got a bit less than 4,000 successful hits for a month (September).
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Need help fine tuning the Did you mean featureThank you. So far, what worked is adding the filter
relevanssi_get_words_havingbut with a value of 0 instead of 1. The logic is based on greater than, right? So greater than 0 returns suggestions with at least 1 search hit, which is what I want. However, I can’t make it return more than 1 word. So a search for the word “ug” would return correctly:Did you mean: up?While a search for “ut” returns:
Did you mean: it?“up” has just one search hit, while it has 4 hits. So it seems to order by number of hits and only return the first result. Is there a way to change that and make it return:
Did you mean: up, it, ...?As a side note re: performance, this is a small website, and with logging enabled for over a year, it only has about 100 words logged as successful searches, so I guess returning suggestions with only 1 hit shouldn’t be a big weight on the system, right?
- This reply was modified 2 years, 8 months ago by CB.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Need help fine tuning the Did you mean featurefunction set to
falsein the shortcode?Oh, yes, I had removed
falsewhen trying stuff, but fixed this now and it’s working without the double. Thanks.Add this to your theme functions.php, do a search, then remove the line.
The idea here is to remove the cache for the suggestions, and start it anew? Or just to make the function look at the whole cache?
As far as performance goes, this is a test and I’d set my caching plugin to cache the results, so it *may* be worth trying, no? I’m also adding rate-limiting to search queries if it all works, to avoid bots running random queries.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Need help fine tuning the Did you mean featureThere the number 5 is the minimum number of results. Change that to 1.
I had tried that, and because it didn’t solve my issue, I then tried adding the filter. I’ve now removed the filter and changed that back from 5 to 1, but it doesn’t change things.
Could you please show me the template?
Please see: https://pastebin.com/Uz5XtquC
remove all stopwords
Yes, I removed them in the initial setup.
Thank you for your time and support.
- This reply was modified 2 years, 8 months ago by CB.
Forum: Requests and Feedback
In reply to: Página desconfiguradaOlá Jucinei,
Esta é a comunidade internacional do WordPress, cuja língua padrão é o inglês. Para ajuda em português você pode levar sua dúvida para um dos fóruns em
Thank you. The snipped worked as provided.
You’re right, @jibsoux. That’s a good way to fully reset it. Thanks for the tip.
you can no longer see the Buy Now button
Hello @mauroguitar,
I’m sorry but all my courses are free and I don’t think I ever set a Buy Now button.
I suggest you open another topic with your issue. But before you do that, you may want to do some investigation to see if other plugins might be affecting it.
In my case, the issues that arose after upgrading past 4.1.1. was that newer versions make use of REST API, which is being blocked for non-authenticated users by another plugin (Clearfy).
Forum: Plugins
In reply to: [EWWW Image Optimizer] Lazy load not working on mobileAdding iframe to the Lazy Loading exceptions did work for Youtube, but images were still missing. I turned Lazy Loading off for now, will try to investigate this a bit further. Perhaps it might have to do with recent WordPress updates? I don’t have in this installation any plugin that explicitly does LL.
Forum: Plugins
In reply to: [EWWW Image Optimizer] Lazy load not working on mobileI’m having a similar issue. On an old iPad (original iPad Air) not only images are not loading with lazy loading enabled, but also YouTube embeds. Rolling back to older versions of Ewww, I was able to see Youtube embeds back on version 6.1.0, but not the images, except, sometimes, for the first one. I must say that I’m using Lazy Loading along with WebP conversion and JS Rewriting (site on Cloudflare). As soon as I turn off Lazy Loading, images and Youtube embeds work fine on iPad. In my case, no errors on Chrome console when Lazy Loading is on (or otherwise).