scooterlord
Forum Replies Created
-
The query was nothing special – just a simple
new WP_Query
that retrieves all posts and then runsget_the_category()
andget_post_ancestors()
using that category.Yes, but how/why are redirection rules injected?
Hello and thanks for your continuous support.
Looks like I was doing a bad query that ended up in such a huge number of additional queries.
However, this got me interested, what does the redirection module do exactly, and why does it somehow need to be run in such occasion?
Hello again,
once more thanks for the wonderful support. I am not getting errors per-se, I am getting a lot of additional queries. In my search results page, I am trying to bring a lot of results in to populate category counts.In one of my sample searches for example, out of the 8240 queries, 2741 are done by rank-math-seo and look like the sample below:
SELECT * FROM wp_rank_math_redirections WHERE status = 'active' AND ( sources like '%a:2:{s:7:\"pattern\";s:11:\"search-main\";s:10:\"comparison\";s:5:\"exact\";}%' or sources like '%search%' or sources like '%main%' ) ORDER BY updated DESC
…or they trigger an
update_meta_cache()
like the following:SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (49144) ORDER BY meta_id ASC
As a consequence, my query is ~ 1,5-2,0s slower than expected. Using the code you are suggesting has absolutely no effect – I can still see the queries been done.
- This reply was modified 3 years, 11 months ago by scooterlord.
Hello again and thanks for the support.
Reads 11% Enable Premium Rules and 35% Enable Real-Time IP Blocklist. This totals to 101%, that’s ok though. So, I assume everything is working, correct?
NS
Hello again,
I finally managed to find some time and attend this matter.
In order for my website to work, essentially after ‘optimizing’ I had rename my ‘.user.ini’ to a different filename, leaving everything else as is. I reverted it back and was ready to investigate the PHP errors. However, to my surprise it now seems to be working, essentially, without me doing anything new! I don’t know if any updates happened in the background that led to this though.
However, you mentioned somewhere that ‘when optimized’ I should be seeing 84% for the free version – but I now see 55% for the WAF, which maybe leads me to believe that I haven’t done something properly (again!). I am posting a screenshot of my screen to see if it helps.
Hello, I apologize in advance, due to personal issues, I didn’t get the chance to work on this yet, will try to do soon and report, please don’t close this thread.
Thank you for your reply. It’s a bit late right now but will try your suggestion and report back.
Hello again,
what you are asking me to add is exactly what is causing the issue.
.htaccess
already contains the specified code.Once I add the
.user.ini
the website completely breaks – I see blank page.Also, please remove from your comment sensitive information that reveal the website!
so…any update on this one?
Thank you for your reply. Actually it was a caching issue, worked my way through it! Thanks a million!
I just sent the report.
Also added the ifmodule code in my .htaccess but still no luck. After optimization I get blank page. Renaming .user.ini restores my website.
Peter, hello again and thanks for the reply. I have asked but didn’t get a straight answer – what is an indicator of whether the WAF is active or note? How can one tell?
From what I understood it was the user.ini file that points to wordfence-waf.php, correct? If user.ini is not used, how is the plugin directed to look for the file?
I will check the guide tomorrow (too late now for this kind of thing) and will report back. In the meantime if you can answer my questions above, it will be a great convenience!
Hello again,
I wanted to elaborate a bit more on this one, since I realized what’s wrong.
My posts do not have a featured image set, nor the content itself has any photo content, so by reading the docs more carefully, it correctly show the default local seo image.
However, each of my posts might have several attachments bound to the post – so what I am trying to do is to replace the default og:image on demand only when a post has attachments on it. Reading your docs, I would expect the following filter to work, but it doesn’t. Is there any other option I am missing?
add_filter( "rank_math/opengraph/{$network}/image", function( $attachment_url ) { return $attachment_url; });
I tried both facebook and twitter without luck. Any help?
Hello and thanks for the reply.
I followed the guide, so I practically:
– Addeddefine('WFWAF_STORAGE_ENGINE', 'mysqli');
inside wordfence-waf.php
– Removed ‘wp-content/wflogs’ folder
– Switched from the Firewall menu from ‘Learning mode’ to ‘Enabled and Protecting’However, I would expect the optimization notification to disappear – however it still says click here to optimize. I guess it is not needed, but its confusing.
How can I validate that now it is actually running? Is pointing to the file made automatically even without a .user.ini file?
Thanks again and looking forward to your response.