Updating the data cache and the data check is controlled by the WordPress Cronjob.
To ensure that the user does not have a long load time when opening the page, we used the functionality of the WordPress Cronjob to load the product data.
We load the data in the plugin independently of the current user. The user can initiate loading but the page layout is not blocked.
With the simple cronjob of WordPress, traffic must always be on the page. When e.g. only every 2 days a visitor is on the page, the reloading of the product information is only ever pushed every 2 days. This can sometimes be disturbing.
If you want to reload the cache independently of the user, you can use a “real” cronjob. This will then call your page at regular intervals (e.g., every 15 minutes).
Your host has to support Cronjobs, check with him. Alternatively, there are also providers offering Cronjobs. You can find detailed instructions on configuring here (german).
Update via WordPress
Here, if no cronjob has been set up in WordPress, the visitor receives the update. Products are only updated by means of traffic. In the plugin, the option “WordPress cronjob” must be selected in the settings.
No visitors = No product updates.
This method is ideal for small product pages with around 50 products.
Update for WordPress-Cronjob
Here is the update running, as in the previous example, over the WordPress job (ie the same setting). Unlike the first example, the update is triggered by an external cronjob. The update runs independently from the visitor.
From the product number, this variant is only slightly better but runs very reliably. In the plugin here is nothing to set up, you just have to configure WordPress properly.
For the setup you will find here an exact guide (german).
Update for Plugin-Cronjob
This method is the safest way to get more than 8000 products and lists updated daily without problems. The configuration for this is very simple.
Carry out the following steps for setting up:
- Set the cronjob type setting to “External cronjob”.
- Set up your cronjob with the interval 5 minutes and let him point to the file “<your-url.de> /wp-content/plugins/affiliate-toolkit/affiliate-toolkit-cron.php”.
- Make sure you do not block the file by .htaccess or the like (for example, in a dev environment).
More is not necessary here. The affiliate-toolkit is internal to the update interval. If the script runs for a long time or even breaks, this is no problem. The plugin continues exactly where there were problems.
With the AT it is possible to use far more than 8000 products. Some rely on far more products, you just have to configure the external Cronjob for it.
Do you have any questions? Just ask in the comments.