flush_rewrite_rules not needed in rewrites.php
-
Hi,
Thanks for the plugin, works great.
There is an issue I found with the plugin flushing the rewrite rules on every page load, and that is also causing some of my own permalinks that were previously created to be removed from the rewrite rules.
Basically, in includes/rewrites.php, the plugin is adding a hook to call
$wp_rewrite->flush_rules();
in thewp_loaded
filter, which has an effect of causing it to flush the rewrite rules for every page load. This can be an expensive operation, as per the docs:https://codex.www.ads-software.com/Rewrite_API/flush_rules
So in includes/rewrites.php, line 82 should be removed:
https://plugins.trac.www.ads-software.com/browser/oauth2-provider/trunk/includes/rewrites.php#L82
I tested this change, and everything seems to be working fine, and my custom permalinks are no longer being removed by the flush call.
The rewrite rules for the plugin are already generated with the
rewrite_rules_array
filter hook, so there isnt really a need to call flush_rules() specifically.Thanks!
- The topic ‘flush_rewrite_rules not needed in rewrites.php’ is closed to new replies.