WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Role Scoper] flush_rewrite_rules in plugin init causes DNS timeout (3 posts)

  1. belg4mit
    Member
    Posted 1 year ago #

    If flush_rewrite_rules() is included in an init action, my plugin's permalink rules are followed, but I experience various DNS timeouts in the dashboard like when searching for new plugins and get the following:

    An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.

    But if I flush as part of plugin activation as per the codex, the permalink changes do not take effect, although I do not get timeouts.

    A plugin with just the following is enough to cause the problem:

    add_action('init', 'sfs_foo');
    function sfs_foo() {
      flush_rewrite_rules();
    }

    Suggestions on how to fix this?

    UPDATE: It seems to only occur when Role Scoper is activated.

  2. belg4mit
    Member
    Posted 1 year ago #

    Any thoughts on this? I just discovered a rather serious consequence of this unfortunate misbehavior: since DNS resolution is unreliable, Akismet is unable to vet comments.

  3. belg4mit
    Member
    Posted 1 year ago #

    I may have found a solution, a soft flush i.e;
    flush_rewrite_rules(false);

Topic Closed

This topic has been closed to new replies.

About this Topic