Support » Plugin: Scheduled Post Trigger » Switch logic to WP cron

  • Hi Jennifer,

    I like how simple your solution is, especially compared to thousands of lines of code in other plugins. All we need is simplicity.

    However, I don’t see the reason to trigger the check and the query on every page load, which for busy sites could be hundreds of thousands of times a day, or even millions.

    Rather, there should be a separate wp cron job running every minute, and then a user visit should trigger the missed post sweep, and everything missed will get posted then. Avoiding such repetition is already a solved problem (wp cron), and it’s good practice to use it.

    The flaw in WP’s own approach is they’re afraid to publish missed schedules for some reason. They should just make it an option to publish late – it’s better than not publishing at all, but since they won’t, this plugin should instead.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jennifer Moss

    (@mossifer)

    Agreed! And the latest version does not trigger on every page load anymore, so I’ve tightened up the code a bit. But yes, this is a WP issue – and specifically for GoDaddy WP hosted users. I’d be interested to hear if other hosts have this problem, too!

    Thanks for the feedback.
    Jennifer

    Sorry, where’s this latest version? I downloaded the code before making this post and the logic there is if (is_front_page() || is_single()) { which is still quite a lot.

    Plugin Author Jennifer Moss

    (@mossifer)

    It used to load on every single page load. So yes, now it’s limited to the front page and single posts. It’s a happy medium – when I did it just home page then sites that have heavy backlinks to posts only weren’t triggering.

    Hi Jennifer,

    Sorry, but that’s a huge overkill for any busy site. We have hundreds of thousands of hits per day to those pages.

    What about an option to use cron, and if a user wants to opt out of cron, the plugin would fall back to this logic (but be upfront about it in the plugin settings)?

    Plugin Author Jennifer Moss

    (@mossifer)

    The reason I created this plugin is because the cron wasn’t working in certain environments.

    Right, OK, I see your point. I think all we’d need is something that retries via cron until it works because whatever prevents it from working is likely to go away by the next minute, or the next.

    Alternatively, a script to ping via our Linux cron that would perform this task every minute rather than on every pageload.

    Plugin Author Jennifer Moss

    (@mossifer)

    Always open to ideas – thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Switch logic to WP cron’ is closed to new replies.