• Resolved Fred17

    (@f14m07)


    Hi Franky,
    I still have the malfunction of my site because of the deprogramming at my insue of eme_cron_send_queued in the WP-cron.
    I have not yet found the cause of the disappearance of this task and I was wondering if I could add a hook in the functions file of my theme. The hook would be :

    add_action( 'eme_', 'mon_test_cron' );
    function mon_test_cron() {
    if (!wp_next_scheduled('eme_cron_send_queued')){
        wp_schedule_event(time(), '5min', 'eme_cron_send_queued');
    }
    }

    I need to replace ’eme_’ with the correct eme function, for example when a member logs in to the site or after they have made a booking.

    This way I can be sure that ’eme_cron_send_queued’ is planned correctly.

    Is it a good idea? What do you think of this?

    Frédéric

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Franky

    (@liedekef)

    I’m still baffled by this. EME calls eme_plan_queue_mails at the end of plugin update, which takes care of all that. I really don’t understand why in your case the schedule keeps disappearing. I even added code in case no schedule is set but queueing activated, to set it to “hourly” then. I’ll go over all that again … but feel free to evaluate that code too and challenge me on how I do it 🙂
    What I do know is that the wordpress cron system is inherently unreliable (due to the way they store cron entries: all in 1 option value, meaning several accesses to the same option can override changes made by another). But that doesn’t help you of course …

    Can it be a caching plugin is causing issues with cron?

    Thread Starter Fred17

    (@f14m07)

    I’m also baffled by this. I use wp-optimise for catching.
    I have tightened up my user profiles and only a second administrator can access this setting. In the code that I have proposed, this allows me to bypass the difficulty and I also get an email to identify the time of the difficulty. I also use CRON Logger which allows me to find the time of the last execution of eme_cron_send_queued. I can now better understand when it happens but not why!
    I hooked my hook to eme_insert_rsvp_action. Maybe you have a better hook for me?

    /* Ajout du control du CRON */
    add_action( 'eme_insert_rsvp_action', 'mon_test_cron' );
    function mon_test_cron() {
    if (!wp_next_scheduled('eme_cron_send_queued')){
        wp_schedule_event(time(), '5min', 'eme_cron_send_queued');
        wp_mail('frederic.moriniere@gmail.com','CRON reprogrammé','eme_cron_send_queued reprogrammé');
    }
    }

    I tested by removing eme_cron_send_queued from the crontab and simulating a new reservation. The task is now restored.
    When I have the phenomenon again I might know more.

    Plugin Author Franky

    (@liedekef)

    While I don’t think WP would be happy if doing that too much, that should work. I don’t have any better hook for that (maybe other plugins do).
    I’ll close this here for now, but feel free to reopen if you have tracked down the cause.
    Just to be sure: did this happen when you upgraded to 2.2.69 or at a unspecified time?

    Thread Starter Fred17

    (@f14m07)

    There is no link with the upgrade.

    Plugin Author Franky

    (@liedekef)

    Then something else is interfering with the wordpress cron settings. EME only changes the cron on 2 occasions: when (de)activating EME or when saving the EME options concerning queueing.

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

The topic ‘mail scheduling’ is closed to new replies.