Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensive use of flush_rewrite_rules() breaks WPML / ACF compatibility #1432

Closed
klubdergutenseiten-user opened this issue Jan 17, 2024 · 2 comments
Assignees
Labels

Comments

@klubdergutenseiten-user

Hey there,
we have had a very strange behaviour, where one of our customers experienced a 500 Internal Server error, everytime the user updated a custom options page (created using ACF-Options page) in a non-default language (using WPML). After heavy investigation, it came across my mind, that the htaccess file is being modified once the options page is opened (wtf?).

After further investigation I found out, it was due to flush_rewrite_rules() being called extensivley.

The pattern in: extras.php
doesn't look very neat to me. I checked and the transients are set multiple times, so the flush_rewrite_rules are called very often (which is also a performance issue at this point).

Would you be able to reconsider using the flush_rewrite_rules() on every 'init' action call or at leaste provide an option / setting to opt-out with this? I tried to think of a different solution / hook when to call flush_rewrite_rules() for your case, but I have no deep understanding of when you would need to refresh the rules.

Expected behavior

  • don't refresh the rewrite rules, when opening any admin-view

Actual behavior

  • flush_rewrite_rules is called (and breaks other unexpected behaivour)

System information (see Podlove > Support menu)

Temporary fix:

regards,
flo

@eteubert eteubert self-assigned this Jan 19, 2024
@eteubert eteubert added the bug label Jan 19, 2024
@eteubert
Copy link
Member

Hi, I faintly remember this. I will need to check every place where podlove_needs_to_flush_rewrite_rules is set. Should at least be possible to only set it after changing values, not on opening certain settings pages 🤔

@klubdergutenseiten-user
Copy link
Author

Thanks man, you fixed it very quick. I already tried it on our staging environment and it works like a charm. Thank you very much, for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants