WordPress.org

Ready to get started?Download WordPress

Forums

Subscribe2
[resolved] DIgest is sending multiple times. Started yesterday out of the blue! (16 posts)

  1. Emanuel Sferios
    Member
    Posted 10 months ago #

    Hi,

    Everything has been working fine until yesterday, when some subscribers started reporting that the daily digest was being sent four times. I also received it four times. I didn't change anything.

    Emanuel

    http://wordpress.org/plugins/subscribe2/

  2. mattyrob
    Member
    Plugin Contributor

    Posted 10 months ago #

    @Emanuel,

    Because of the way the WordPress cron works this occasionally happens. To be certain you might want to reset the digest database entries by changing to per-post and saving the options and then returning your settings to your preferred digest period.

  3. Emanuel Sferios
    Member
    Posted 10 months ago #

    Didn't you by-pass the wordpress cron for me by installing some alternative cron?

  4. mattyrob
    Member
    Plugin Contributor

    Posted 10 months ago #

    @Emanuel,

    Not quite. I used a second in-built fallback version of WordPress cron as your site doesn't work well in the out-of-the-box configuration.

  5. Emanuel Sferios
    Member
    Posted 10 months ago #

    Ok I changed to per-post then changed back again. We'll see what happens tomorrow when the digest goes out. Quick question... now that I've reset the database, what will be the first post in the digest?

  6. mattyrob
    Member
    Plugin Contributor

    Posted 10 months ago #

    @Emanuel,

    After resetting the digest will include posts made since the reset. If you've got posts you really want included then you'll need to edit the publication dates on them.

  7. Emanuel Sferios
    Member
    Posted 10 months ago #

    Ok this time people are getting two digests. That's better than four, but still we haven't solved the problem.

  8. mattyrob
    Member
    Plugin Contributor

    Posted 10 months ago #

    @Emanuel,

    If you have access to cPanel I'd suggest you disable the WordPress cron totally (it relies on your site being loaded in a browser or equivalent - like being crawled by a search engine) and instead calling the cron jobs using a server task. This should be more reliable on a server where we already know there are issues getting the cron in WordPress to work.

    http://www.nextscripts.com/tutorials/how-to-deal-with-duplicates-wp-cron-scheduling-tasks-in-wordpress/

  9. Emanuel Sferios
    Member
    Posted 10 months ago #

    Ok I just did this. The only thing different I did was to delete the alternate_wp_cron line you added to my config file, before adding the disable_wp_cron line.

    I deleted this:
    define('ALTERNATE_WP_CRON', true);

    I added this:
    define('DISABLE_WP_CRON', true);

    Then I set up cron to happen every five minutes on my server using my cpanel.

    How can I test to see if this is working correctly?

    Thanks for your help.

  10. mattyrob
    Member
    Plugin Contributor

    Posted 10 months ago #

    @Emanuel,

    Install a plugin like WP-Crontrol (you might still have it on your site) and make sure that the tasks are getting called and not lapsing well into the past.

  11. Emanuel Sferios
    Member
    Posted 10 months ago #

    Yes I still have it. I'm not sure I understand what it all means. There is an error message at the top. Here is a screen shot. Can you tell me what is going on?

    http://sferios.com/docs/crontrol.png

  12. mattyrob
    Member
    Plugin Contributor

    Posted 10 months ago #

    @Emanuel,

    You might need to add the alternate cron line back into you wp-config.php file. That error message is telling you that the default cron spawning (creation of multiple processes) is failing.

    I don't consider myself a WordPress cron expert, if that works then great but if not this might be something to ask about in the core forums.

  13. Emanuel Sferios
    Member
    Posted 10 months ago #

    Ok well that worked. I don't get the error message anymore in crontrol. So now I have both these lines in my config file:

    define('ALTERNATE_WP_CRON', true);
    define('DISABLE_WP_CRON', true);

    I also set up the cron job in unix for every five minutes. In your understanding, is this what I'm supposed to do? The article you linked to above says as much, but then again the alternate_wp_cron line is not normally in the config file. Is it ok to have that line in there and also the unix cron job?

  14. Emanuel Sferios
    Member
    Posted 10 months ago #

    To clarify... the problem was that the digest was being sent multiple times. So you suggested I "disable the wordpress cron totally" and you linked to that article. The article says to put the line of code inside the config file to disable wp cron. So I did that, but then I have that line of code enabling the alternate wp cron in there. Wasn't that line *already* disabling the wp cron (and replacing it with the alternative wp cron)? And if so, what good then is the second line of code?

    Wasn't the idea to disable *all* wp cron activity and replace it with a cron on the server side? It seems to me now that I still have the alternate wp cron running, and all I did was add in a unix cron too. Won't this cause problems?

  15. mattyrob
    Member
    Plugin Contributor

    Posted 10 months ago #

    @Emanuel,

    As I said above I am not an expert in WordPRess cron but the following is my understanding. I may be wrong and you might want to check this in the main WordPRess support forum as a core dev might have different thoughts.

    The ALTERNATE_WP_CRON line neither enables or disables cron, it simply tells WordPress to use a fall back method that does not require 'spawning'.

    The DISABLE_WP_CRON line tells WordPress to not run cron events from routine web browser loads but it will still respond to direct calls to the wp-cron.php file. As such a server cron job can be configured to do this and it'll be more reliable.

  16. Emanuel Sferios
    Member
    Posted 10 months ago #

    Ah ok I understand a bit better now. Thanks. I'll see what happens tomorrow morning. If the problem isn't fixed, I'll check the main WP forum.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.