• Resolved simplistik

    (@simplistik)


    You HAVE to remove

    global $wp_rewrite;
    $wp_rewrite->flush_rules()

    from lines 353 and 354, this is causing WP to re-generate the rules every time someone hits the site, which needlessly increments the options, which in turn bloats the database, and completely destroys the performance of websites.

    This is a nicely designed plugin, but you have to remove those lines.

    https://www.ads-software.com/plugins/custom-post-type-maker/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jorn Bakhuys

    (@jornbakhuys)

    Thank you simplistik.
    I will try and look into that this week. I will keep you posted.

    Plugin Author Jorn Bakhuys

    (@jornbakhuys)

    Hi simplistik.
    The plugin has been updated with your changes.

    Thread Starter simplistik

    (@simplistik)

    Good job man, thanks for the timely response ??

    If we have been using this plugin for a while is there a way to clean the DB of these extras?

    Thread Starter simplistik

    (@simplistik)

    Fortunately anything that calls from the options table isn’t dependent on the id, so you can actually “dump” your options table and recreate it. I put together this relatively easy workflow for my company to fix the inflated increment.

    1. Save your DB. Personally, you can just save the wp_options (or whatever you’ve prefixed it with).
    2. Completely Optional: I recommend just removing any transient data from the DB, since it’s all temporary and won’t affect your site, you can do that by running this MySQL query:

    DELETE FROM wp_options WHERE option_name LIKE '%transient%';

    3. Run this MySQL query which will re-increment your table:

    SET @count = 0;
    UPDATE wp_options SET option_id = @count:= @count + 1;

    4. Reset the options increment, run this MySQL query:

    ALTER TABLE wp_options AUTO_INCREMENT = 1;

    Note: wp_options might (should) change depending on what you’ve prefixed your tables with.

    @simplistik – thank you!

    In what page I have to remove?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘$wp_rewrite->flush_rules() needs to be removed’ is closed to new replies.