• Hello,

    I’m working on a plugin with use a cron job.

    function fftp_activate_cron() {
        // Schedule an action if it's not already scheduled
    	if ( !wp_next_scheduled( 'scheduled_task' ) ) {
    	   wp_schedule_event( time(), 'hourly' , 'scheduled_task');
        }
    
    }

    The task seems to work perfectly on localhost, in view of the classic cron job in wordpress: on page request. But the same plugin doesn’t work at all in production. I have tried on 2 different severs.

    How is it possible?

    I installed the plugin Advanced Cron Manager to understand:

    > on localhost
    at the beginnig, i get as ‘next excecution’: At next page refresh
    on a page refresh, i get the right information: In 2 minutes

    > on production
    i get: At next page refresh
    even after several page refresh

    Could it be a wrong init of the cron job which could explain the problem on production server?
    Could it be a miss configuration (wp-config.php, server, etc)?

    I am lost.
    Any idea will be appreciate.

    Thank you in advance,
    jb

Viewing 2 replies - 1 through 2 (of 2 total)
  • I don’t know if your cron settings are right, usualy cron settings depend of hosting software. We use all time free cron services like easycron.com.

    @soapoperator, did you ever get this working? We’re seeing an issue with Advanced Cron Manager is showing several cron jobs with “Next execution” as “At next page refresh” but it doesn’t seem to be going away..

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘cron job || it works on localhost, not in production’ is closed to new replies.