Mingle Forum
[resolved] Rewrite Rules Deleted/Inserted on every request (4 posts)

  1. doublesharp
    Posted 2 years ago #


    I noticed that the WordPress rewrite rules are being rewritten to the database on every request with the Mingle Forum enabled. After a bit of digging, I discovered that it was due to the code on line 17 in wpf.class.php

    add_filter("init", array(&$this, "flush_wp_rewrite_rules"));

    The problem goes away when the rewrite function is only called when the rules are updated:

    add_filter("rewrite_rules_array", array(&$this, "flush_wp_rewrite_rules"));



  2. doublesharp
    Posted 2 years ago #

    I take that back, the new add_filter rule eats up a ton of memory, so in the meantime I have commented it out entirely to prevent the rules from being re-inserted to the database on every request. Any ideas on a better action hook to prevent this?

  3. Ciprian
    Posted 2 years ago #

    I had a problem, too, with one of my custom post type plugins, Roo Classifieds, and I fixed it by commenting out line 17.

    The filter should run on plugin activation, not on init:

    register_activation_hook( __FILE__, 'rcads_activate' );
    function rcads_activate() {
  4. cartpauj
    Plugin Author

    Posted 2 years ago #

    Good catch guys, we'll take a look at this soon. We may fire it on options save page instead of activation hook though.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.