How to Setup the cronjob

How to Setup the cronjob

The cronjob type is important because it updates your products and lists.

WordPress Cronjob

This is the default option. The cronjob is called by WordPress. The job will be called when the user visit your page or as server side job.
It's a good start for a small project. We recommend maximum 1000 products. 
It's always better to configure a server side job on your web server. Here you can find a short instruction: https://cinchws.com/setting-up-server-side-wordpress-cron-events/

External Cronjob

The external cronjob is running outside the WP cron system. It must be setup on your server.  
The script is collecting the data for update and execute the product updates step by step. 
You must setup the server side cronjob and call the url "url/wp-content/plugins/affiliate-toolkit/affiliate-toolkit-cron.php". 

Call the URL every 15 minutes. The cronjob will handle the execution itself. 
Here you can se a example configuration for the hoster all-inkl:

External Cronjob + Output

This is the same setup like "external cronjob" but output messages and error. 

External Cronjob via WP-CLI

If you have a lot of products and lists you can setup the execution via "WP-CLI". It is a faster process and don't overload your webserver.
The wp-cli need system admin knowledge. You also need root permissions to setup a wp-cli job.

You need to copy the file "affiliate-toolkit-wp-cli.php" from the plugin directory into a separate directory. 
You need to customize the paths in your cli.php file and configure the cli as the following example:
  1. execute command line: wp eval-file --url=url/wp-content/plugins/affiliate-toolkit/affiliate-toolkit-wp-cli.php /var/www/html/wp-content/plugins/affiliate-toolkit/affiliate-toolkit-wp-cli.php