Why Wordpress cron not running without the interaction with the website? -


i using cron job in wordpress plugin cron not run without user interaction wordpress website. there solution can run cron after 5 minutes without failure.

if using script @ schedule action

wp_schedule_single_event(time(),'your_function_name',array('arguments')); 

then function run if access page.

if want run cron job @ interval of time try setup job cpanel , in command prompt write complete path function access.

class example_cron {     public function __construct() {         $this->your_function_name();     }     function your_function_name() {         // write script here      } } $objct = new example_cron(); 

setup cron path file.it run automatically.

command setup cron:

php/usr/bin <file path>// example opt/lammp/htdocs/wp-content/plugins/<your plugin name>/<your fine name> 

thanks


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -