flush_rewrite_rules() being called on every request
-
Hi there,
I was having issues with random 404s and opened up a support ticket with them (https://ww.wp.xz.cn/support/topic/random-404-with-polylang).
We have figured out the issue, but support over there pointed out that my site (www.wformation.com) was calling flush_rewrite_rules() on every requests.
This is a very expensive call and it goes against best practices as mentionned in (https://codex.ww.wp.xz.cn/Function_Reference/flush_rewrite_rules).
I was able to figure out that that function was being called at lease twice on every call by Hyyan WooCommerce Polylang Integration, in wp-content/plugins/woo-poly-integration/src/Hyyan/WPI/Endpoint.php
This is the code in question:
public function rewriteEndpoints() { $this->addEndpoints(); flush_rewrite_rules(); }Is there any way around this? Does it really have to do that?
Please advise.
The topic ‘flush_rewrite_rules() being called on every request’ is closed to new replies.