What is a Cron Job?
Basically is a task that run automatically every X time. In our case the task is: “Send invitations to users”
Why I should use a real Cron Job?
Basically the way it works in WordPress is that you have visitors to your website and periodically one of these visits causes WordPress to check a “pending tasks list” and if the task is due, it runs.
This works in most cases scenarios but using a real cron job to trigger WordPress tasks is more reliable, especially on low traffic sites (no visitors to trigger tasks) or if you’re using a caching plugin (no trigger since a cached copy is served).
Also we have seen lately a few plugins poorly coded that breaks the wordpress cron list functionallity, blocking all the pending tasks and affecting all the plugins.
How do I set up a Cron Job?
The first thing you need to do is go to wp-config.php in the root of your site and add the following lines of code:
/** WordPress social Invitations manual cron**/ define('WSI_SERVER_CRON',true);
You can this at the end of the file right before the “That’s all, stop editing! Happy blogging.” line.
Now you need to set up the cron in your server. Each host may use a different configuration panel. You should look for a “cron job” option to configure in your host’s admin panel. Read the most common ways to add a cron for CPanel, Plesk or the crontab.
Cron job commands you can use
Below are a few examples of commands you can configure. You’ll only need to setup one on your server, so simply pick one which works on your server :
wget -q "http://MY_WSI_CRON_URL.com" curl --silent http://MY_WSI_CRON_URL.com > /dev/null lynx -source "http://MY_WSI_CRON_URL.com" > /dev/null
Remember to change MY_WSI_CRON_URL with the url you will find in the DEBUG tab of your plugin. Something like: http://local.dev/wp-cron.php?wsi_server_cron=5735ba55f9a78256567637ff72a282ba
Try setting up the cron every 5 minutes. If you choose to send emails every 20 minutes we will handle that for you.