• Resolved Beherit

    (@beherit)


    There is a problem with others plugin which use cron job – e.g. your plugin breaks cron in my plugin where I have this same schedule interval. You should change the function setRegularCron as it is in wp_schedule_event documentation:

    To schedule an hourly event in a plugin, call wp_schedule_event on activation (otherwise you will end up with a lot of scheduled events!):

    https://ww.wp.xz.cn/plugins/wp-fastest-cache/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter Beherit

    (@beherit)

    Another test – the problem is not only with function setRegularCron but with all wp_schedule_event in your plugin 🙁

    Plugin Author Emre Vona

    (@emrevona)

    I could not understand. Please contact to me via email: [email protected]

    Thread Starter Beherit

    (@beherit)

    Which part You don’t understand? You use wp_schedule_event not in accordance with documentation https://codex.ww.wp.xz.cn/Function_Reference/wp_schedule_event

    call wp_schedule_event on activation (otherwise you will end up with a lot of scheduled events!)

    You need more details? What details? I think I wrote very simple what is wrong.

    Plugin Author Emre Vona

    (@emrevona)

    Please contact to me via email: [email protected]

    Thread Starter Beherit

    (@beherit)

    For what? I give You all details. Tell mi what You need more and I will contact via email.

    Plugin Author Emre Vona

    (@emrevona)

    must I add register_activation_hook(__FILE__, ‘my_activation’); ? are you talking about it?

    Thread Starter Beherit

    (@beherit)

    You must change code where You using wp_schedule_event – wp_schedule_event should be used only on plugin activation as it is described in documentation.

    Plugin Author Emre Vona

    (@emrevona)

    now I got what activation means 🙂 If we don’t set the schedule on the activation, more than one cron jobs cannot work at the same minute?

    Thread Starter Beherit

    (@beherit)

    If we don’t set the schedule on the activation then a lot of scheduled events will just stop.

    Plugin Author Emre Vona

    (@emrevona)

    a lot of scheduled events won’t work or they are deleted from cronjobs list?

    Thread Starter Beherit

    (@beherit)

    They will not work 😉

    Plugin Author Emre Vona

    (@emrevona)

    tell me your plugin. I will make a test on my site.

    Thread Starter Beherit

    (@beherit)

    XMPP Statistics but You need ejabberd server to test it.

    Plugin Author Emre Vona

    (@emrevona)

    I tested with Crony Cronjob Manager. I added cron job via Crony Cronjob Manager and it works when my cronjob works.

    By the way, I removed setRegularCron.

    Thread Starter Beherit

    (@beherit)

    Version without setRegularCron works okey for me, thanks 🙂

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Cron job problem’ is closed to new replies.