WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. doublesharp
    Member
    Posted 1 year ago #

    Hi,

    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"));

    Thanks!

    http://wordpress.org/extend/plugins/mingle-forum/

  2. doublesharp
    Member
    Posted 1 year 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 Popescu
    Member
    Posted 1 year 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() {
    	flush_rewrite_rules();
    }
  4. cartpauj
    Member
    Plugin Author

    Posted 1 year 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

Tags

No tags yet.