Update check cron job seems not to run

I just installed MainWP 4.5.0.1 on a fresh WP Setup and also configured cron to use an external cron job on my Linux server.

In wp_config.php:

define( 'DISABLE_WP_CRON', true );

And the cron job:

*/5 * * * * /usr/bin/wget -q -O - https://my-site.example/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Cron in general works. However for mainwp_cronupdatescheck_action the “Last Run” time never updates and the action log only contains the following entries:

2023-08-21 11:05:01 [LOG] CRON :: updates check :: waiting conditionals to run.
2023-08-21 11:10:01 [LOG] CRON :: updates check :: waiting conditionals to run.
2023-08-21 11:15:01 [LOG] CRON :: updates check :: waiting conditionals to run.
2023-08-21 11:20:01 [LOG] CRON :: updates check :: waiting conditionals to run.

Any hint how to fix this?

1 Like

Hi @awelzel

Welcome to the MainWP community.

In addition to disabling cron via wp_config.php file, it also has to be disabled on the MainWP > Settings > Advanced Settings page.

And you can find our documentation for disabling WP Cron here:

Let us know if that helps.

I changed it as requested. The “Use WP Cron” is disabled and I change the crontab so it will not call the main WordPress cron runner but only the MainWP cron scripts:

* * * * * /usr/bin/wget -q -O - https://my-site.example/wp-content/plugins/mainwp/cron/updatescheck.php >/dev/null 2>&1
0 0 * * * /usr/bin/wget -q -O - https://my-site.example/wp-content/plugins/mainwp/cron/pingchilds.php >/dev/null 2>&1
* * * * * /usr/bin/wget -q -O - https://my-site.example/wp-content/plugins/mainwp/cron/checkstatuschilds.php >/dev/null 2>&1
0 * * * * /usr/bin/wget -q -O - https://my-site.example/wp-content/plugins/mainwp/cron/sitehealthmonitoring.php >/dev/null 2>&1
0 * * * * /usr/bin/wget -q -O - https://my-site.example/wp-content/plugins/mainwp/cron/stats.php >/dev/null 2>&1

However - no change. Now the same message will just appear every minute instead of every 5 minutes since the cron job runs every minute now. I only have an additional message now about site status check:

2023-08-21 19:07:01 [DEBUG] CRON :: updates check :: waiting conditionals to run.
2023-08-21 19:07:02 [INFO] CRON :: check sites status :: notice site http :: found 0
2023-08-21 19:07:05 [DEBUG] CRON :: updates check :: waiting conditionals to run.
2023-08-21 19:08:01 [DEBUG] CRON :: updates check :: waiting conditionals to run.
2023-08-21 19:08:01 [INFO] CRON :: check sites status :: notice site http :: found 0
2023-08-21 19:09:01 [DEBUG] CRON :: updates check :: waiting conditionals to run.
2023-08-21 19:09:01 [INFO] CRON :: check sites status :: notice site http :: found 0
2023-08-21 19:10:01 [DEBUG] CRON :: updates check :: waiting conditionals to run.
2023-08-21 19:10:01 [INFO] CRON :: check sites status :: notice site http :: found 0
2023-08-21 19:11:01 [INFO] CRON :: check sites status :: notice site http :: found 0
2023-08-21 19:11:01 [DEBUG] CRON :: updates check :: waiting conditionals to run.
2023-08-21 19:12:01 [DEBUG] CRON :: updates check :: waiting conditionals to run.
2023-08-21 19:12:01 [INFO] CRON :: check sites status :: notice site http :: found 0
2023-08-21 19:13:01 [INFO] CRON :: check sites status :: notice site http :: found 0

But the UI still does not show any update check execution at all:

However - this is what I expected since the problem is not that the job was not called, but that it seems to wait for something as mentioned in the log waiting conditionals to run. What “conditionals” need to be met before the update check will really get executed?

Edit:

Just for the records - I am developer and maintainer of a number of WordPress plugins (Arno Welzel (@awelzel) – WordPress user profile | WordPress.org), so I will also understand technical explanations and can also check parts in the code if this will help.

The servers runs PHP 8.1.

1 Like

A day later and now the update check displays a more useful information - Last Run was 2023-08-22 06:31 and Next Run is scheduled for 2023-08-23 06:30:

The time makes sense since I have set the “Automatic daily sync time” to 06:30.

So maybe there is a bug that a specific time for “Next Run” is only displayed if there is a time recorded for “Last Run”? It is also very confusing that the schedule says “Once very minute” for “Check for available updates” but in fact that job will only run once a day.

And why is there no “Next Run” for any of the other jobs? Either output the data or remove the whole column if it makes no sense anyway.

1 Like

Thank you for the detailed information.

Would you mind opening a private Help Desk ticket so our development team can look into it further?

And please refer to this Managers thread by its URL in the ticket.

1 Like

I just created the ticket and referred to this topic for reference. Thanks for your assistance.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.