• Resolved fatokuda

    (@fatokuda)


    From the instructions in this post:

    https://webberzone.com/support/knowledgebase/top-10-maintenance-options/

    Can you give me the specific code to insert into the function.php file? (sorry I’m not familiar with php)
    I want to change from 180 days to 30 days which is enough.

    I want to limit the number of databases because 180 days is too much for my website, causing access time to slow down significantly.
    And in the wp-config.php file, this line is required for it to work, right? define( ‘DISABLE_WP_CRON’, true );
    If set to false will it work?

    Thank you author for the great plugin, I’ve been using it for many years now

    <font _mstmutation=”1″></font>

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Ajay

    (@ajay)

    I updated the article with the custom code. However, you do need to have WP Cron active. What are you doing to replace WP Cron?

    Thread Starter fatokuda

    (@fatokuda)

    Thank you for your support, I usually turn off wp-cron to increase website performance, but I turned it back on
    I added this code to the function.php file

    // custom_tptn_maintenance_days
    function custom_tptn_maintenance_days( $days ) {
    return 30;
    }
    add_filter( 'tptn_maintenance_days', 'custom_tptn_maintenance_days' );
    define( 'TOP_TEN_STORE_DATA', 30 );

    and I checked both the UTC+0 time and the site time in the maintenance settings of the top 10. But it doesn’t seem to work, I don’t know where I went wrong

    • This reply was modified 6 months, 2 weeks ago by fatokuda.
    • This reply was modified 6 months, 2 weeks ago by fatokuda.
    Plugin Author Ajay

    (@ajay)

    All that does is change the days for truncating the data in the daily table.

    Are you able to install WP Crontrol plugin and see if you find the tptn cron job in there?

    Thread Starter fatokuda

    (@fatokuda)

    Yes, I checked and it activates every day, but the wp_top_ten_daily table data is increasing, is there any mistake in the code above ?? please help, thanks you

    Data older than 30 days has not been deleted

    • This reply was modified 6 months, 2 weeks ago by fatokuda.
    Plugin Author Ajay

    (@ajay)

    Can you try one last thing please?

    What do you see in the settings page > Maintenance tab? Does it say 180 days or 30 days in the explanation?

    And, can you then disabled it, save the settings and then renable it and save the settings.

    Thread Starter fatokuda

    (@fatokuda)

    I turned it off, saved, then turned it back on and saved again. But the description still says 180 days. I ran cron immediately but nothing happened

    Plugin Author Ajay

    (@ajay)

    Thanks for this. Let me run a few tests. I’m wondering if the constant needs to be in the theme or wp-config.php

    Thread Starter fatokuda

    (@fatokuda)

    Thank you, if that doesn’t work, I’ll just have to delete it manually using SQL code

    Plugin Author Ajay

    (@ajay)

    @fatokuda

    I added this to my wp-config file. You don’t need any other code above.

    define( 'TOP_TEN_STORE_DATA', 30 );

    However, I think there might be a deeper bug in the cron that I am testing out.

    I’ve filed an issue: https://github.com/WebberZone/top-10/issues/163

    Thread Starter fatokuda

    (@fatokuda)

    Yes, I will continue to follow it

    Plugin Author Ajay

    (@ajay)

    I was able to fix the issue with the cron. It works if you put the constant in your wp-config file in my tests.

    I’ve put out a beta release, which you can download, go to Plugins > Add New and upload the zip file there.

    https://github.com/WebberZone/top-10/releases/tag/v3.3.4-beta1

    Thread Starter fatokuda

    (@fatokuda)

    Thank you very much, it worked fine

    Plugin Author Ajay

    (@ajay)

    Thank you for confirming. I’ll get this pushed into a new release.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘I want to customize maintenance mode’ is closed to new replies.