Can I disable the WP-cron and run a server cron and still use your plugin?

By | 2018-11-19T21:17:02+00:00 November 19th, 2018|Categories: Plugin settings|Tags: , , |

Some of our users prefer to disable the WordPress cron for performance reasons by adding following line to their wp-config.php file:

define(‘DISABLE_WP_CRON’, true);

Following by adding a job to there own crontab that looks something like the row below in order to fire-up the WP-cron on a set interval.

PATH=/bin:/usr/bin:/usr/local/bin */1 * * * * wp cron event run –due-now –path=/app/public/ –allow-root > /app/public/wp-content/cron.log 2>&1

Although our plugin is able to cope with this set-up it might have some unwanted effects. Our plugin creates it’s product feeds in batches to not stress your website or run into time-out/memory issues. The batches are launched by the WP-cron. Every time one of the batches has finished it creates a new job in the WP-cron which almost immediately starts the next batch. When the WP-cron has been disabled this job sits idle until the manually configured job starts the batch.

Imagine you have 10.000 products in your feed and configured your cronjob to run every 10 minutes than you would need 13 batches times 10 minutes. It would take over two hours for the product feed to finish. This could be problematic when in those two hours the channel (Google Shopping, Facebook or a CSS) is coming by to download your (half-finished) product feed.

That is why we always advise our plugin users to enable the WP-Cron.