Open openmindculture opened 1 year ago
Tried various things
It seems that the cron schedule callback is not executed when called by cron, but if it was, it would not have sufficient permissions to generate a report.
Got some erractic inbox mails obviously sent via scheduled callback about 2 days after setting hourly schedule! New hypothesis: maybe a caching issue?
Cron scheduled as hourly: 20231009 Cron mail received: 20231011-19:11 Cron mail received: 20231011-19:52
Caching disabled: 20231011-20:41
Cron mail received: 20231011-20:50 Cron mail received: 20231011-21:50
Caching reenabled with page cache only: 20231011-21:56
W3 Total Cache Configuration before deactivation:
Not enabled: Database Cache, CDN, Reverse Proxy, Fragment Cache, Miscellaneous, Debug
Follow-up: watch inbox after reenabling, verify with different caching options, await support: https://wordpress.org/support/topic/wp-cron-callbacks-not-executed/
No more scheduled mails after reactivating page cache.
Caching changed: 20231012-1944 Page cache disabled, frontend minify disabled, object cache stays enabled, browser cache stays enabled
WordPress core update to 6.3.2 on Friday 20231013 Unchanged settings, Scheduled callback triggered mails 20131015-0350 20131015-0451 20131015-0550 20131015-0650 20131015-0850 20131015-1051 20131015-1150
received mails hourly, switch to twice daily
reenabled W3TC page cache, set interval to hourly
Oct 16, 2023, 11:24 Can’t reproduce the issue anymore. About 1 day after WordPress core update to 6.3.2 cron suddenly worked as expected without any settings changed.
I will reenable page cache now and see if it occurs again.
Oct 18: No more cron since I activated page cache.
The situation is getting even more erratic. I didn't touch any settings and didn't explicitly clear the cache; WP core and W3TC is still the same since my last comment. But since tonight 3:05 a.m. I receive scheduled report mails again. Despite the expected hourly schedule, probably due to low traffic page visitors, these are the successful callback times so far: 02:53 03:05 04:12 04:16 05:04 05:19 05:53 06:06 06:55 07:05 07:50 08:07 08:56 09:06 09:55 09:56 10:02 10:04
I have installed the same plugin on another site which also uses W3 TC page cache now.
After talking to myself in support issues, like I often do, while nobody seems to be able to help, I will test alternative solutions:
Manual call of the wp-cron.php
URL does not trigger sending a mail either:
Disable W3TC. (Possibly install WP Super Cache ...
Try above wp-cron call... does not work either!
Try the logged in plugin page: https://www.open-mind-culture.org/wp-admin/admin.php?page=contact-form-inbox-report-mailer
No mail either. So that's the problem after the latest update?
More debug info, installed and rescheduled, send on view admin page works again, at least sometimes, erratically, unless wp_mail returns false. Live testing since Monday noon, 30. October 2023:
Current status:
openmindculture_cfirm_schedule
) most of the timeswp_mail
returns false for no obvious reasonopenmindculture_cfirm_schedule
, invoked once using WP Crontrol, does not succeed in sending mailWarning (found on the UpdraftPlus backup page, K.O. page):
Warnung: WordPress has a number (5) of scheduled tasks which are overdue. Unless this is a development site, this means that the scheduler in your WordPress install is not working properly
Mail function works when called from an admin page, but does not seem to work inside a cron schedule callback.
Maybe it does and it's a permission issue that we don't get any inbox entries?
Always send a mail, with or without a report.
Set schedule interval to
hourly
for testing purposes.