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
Post a Comment