Wordpress

Mailpoet Cron

by ,


We have by far the largest RPM repository with dynamic stable NGINX modules and VMODs for Varnish 4.1 and 6.0 LTS. If you want to install NGINX, Varnish and lots of useful modules for them, this is your one stop repository to get all performance related software.
You have to maintain an active subscription in order to be able to use the repository!

MailPoet developers decided for everyone that the real Linux crons brings more issues than it solves. What?

This is quite outrageous in my opinion. The true performance can be achieved ny using proper server setup and their plugin does something weird. Let’s fix Mailpoet to use Linux cron and not something custom solution they made up out of nowhere.

Disable custom Mailpoet cron

In wp-content/plugins/mailpoet/lib/Config/Initializer.php, disable comment this line:

$this->setupCronTrigger();

So it looks like this:

//$this->setupCronTrigger();

Setup Linux cron for Mailpoet

First, create the actual PHP file which will call Mailpoet cron:

<?php

// Let's load WordPress
require( 'wp-load.php' );

\MailPoet\Cron\Triggers\WordPress::run();

Next, create a Linux cron job which calls it:

* * * * * /usr/bin/php /var/www/html/mailpoet.php

That’s it. Now you can sit back and relax knowing that some crazy custom cron solution is not causing load on your server.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.