WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WP_CRON doesn't work (20 posts)

  1. tommix
    Member
    Posted 2 years ago #

    Hi, i'm trying to get wp_cron to work. But it isn't. When i list all jobs it have mine, it have good period, it returns to me linux timestamp (but not when it will run but when it was registered). But it NEVER executes action. I'm thinking maybe my config have effect on it? i'm using custom names of plugin folder and wp-content (set in wp_config.php)
    Maybe htaccess have effect on it?

    Even BackWpUP which was working always for me - stop doing schedules. So this is not my bad coding problem.

    This code is in my HTACCESS to help protect blog more.

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

  2. tommix
    Member
    Posted 2 years ago #

    Nope. HTACCESS seems to do nothing, still doesn't work withouth those lines.

  3. tommix
    Member
    Posted 2 years ago #

    Also Update cheking cron seems to work because it finds new plugin versions, so admin part of crons is working, but plugin part/functions.php doesn't.

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    I'd suggest contacting your hosts about this. I've known of hosts blocking all cron jobs.

  5. tommix
    Member
    Posted 2 years ago #

    But WP_cron is NOT standard linux cron, so how does host effects script execution? WP cron just executes actions who is set to be executed in some specific time, that's it. Also my host supports LINUX cron anyway.

    And as i said it worked some time ago, but i made changes to folder names [and billion changes to template and some plugins], as i mentioned and maybe them causing this.. i think i have to test it and if yes-report the bug.

  6. esmi
    Forum Moderator
    Posted 2 years ago #

    But WP_cron is NOT standard linux cron, so how does host effects script execution?

    Because wp-cron.php calls wp-includes/cron.php and some hosts just block all cron.php calls. Heck, some may even block calls to any file names *cron*! We've been trying to help another WP user around this kind of ridiculous bocking for the past 2 weeks and so far, we're all stumped by it. At least in this case, the hosts are upfront about this blocking policy (they claim it's a security measure) - which, unfortunately, makes them a really bad choice for hosting a WP site.

    I'd suggest that you try to open a dialogue with your hosts initially to see if they are blocking anything that might be related to cron - even WP's pseudo cron. With luck, this might just be a mistake on their part. In the meantime, start looking through your error logs (assuming you have access to them) for any clues.

  7. tommix
    Member
    Posted 2 years ago #

    Ok thanks, than i'll contact host :) Maybe it really blocks.. but i doubt.. My country hosting is not USA hosting so less clients and they do more good stuff to attract users :D

  8. esmi
    Forum Moderator
    Posted 2 years ago #

    My country hosting is not USA hosting

    Neither is the hosting of the other person I've been trying to help. ;-/

  9. tommix
    Member
    Posted 2 years ago #

    Well, hosting said they do not block anything related to cron.

  10. esmi
    Forum Moderator
    Posted 2 years ago #

    Have you checked your server's error logs?

  11. tommix
    Member
    Posted 2 years ago #

    Error log is empty, but in usage log i found many lines like this:

    "POST /wp-cron.php?doing_wp_cron=1337322293 HTTP/1.0" 302 222 "-" "WordPress/3.3.2; http://xxxxxxx.lt"

  12. esmi
    Forum Moderator
    Posted 2 years ago #

    Has anything changed on the server or site recently? My gut instinct, based on what you have said, is that this is a server issue.

  13. tommix
    Member
    Posted 2 years ago #

    Strange to see the HTTP status 302. MAy it be because i use htaccess to block (redirect) all IPs exept mine and few others to enter site... how could this efect wp? it runs locally so it should effect it.

  14. esmi
    Forum Moderator
    Posted 2 years ago #

    Ah... I'd start by getting rid of all of the redirects in .htaccess and see if that helps.

  15. tommix
    Member
    Posted 2 years ago #

    i've added my server ip to allowed list and it seems to work

    "POST /wp-cron.php?doing_wp_cron=1337345797 HTTP/1.0" 200 2 "-" "WordPress/3.3.2; http://xxxxx.lt"

    BUT cron still don't work.. actions do not execute... hrr....

  16. tommix
    Member
    Posted 2 years ago #

    Well it is bug. I renamed wp-content and plugins folder to their original names and cron worked. So WP don't even support itself :D

  17. Have you tried this bit?

    Ah... I'd start by getting rid of all of the redirects in .htaccess and see if that helps.

    Start with a minimum .htaccess file just to rule it out. It might not help, but it may narrow down the root cause of your problem.

  18. tommix
    Member
    Posted 2 years ago #

    As i said- i found the problem it was custom folder names, wordpress cron somehow relays on default folder names. after i used default names - it worked. HTACCESS is good after i added my server ip to whitelist of allowed ips.

  19. after i used default names - it worked

    Gotcha, I misunderstood. If that's done it for you, mind marking this thread resolved?

  20. tommix
    Member
    Posted 2 years ago #

    No, this is WP bug, and i did not report this cause i don't know how, so if you report - you can select it as resolved cause it's not, i want to use custom names of wp-content and plugins but now i cant'.

    EDIT: i'll make it as resolved cause after i renamed folders back to custom values cron still works..don't know why but for me is good.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags