Lets do a test to determine if the issue is installation-wide or an issue with the plugin only. Temporarily add the following code to your theme’s functions.php and page.php template as noted. Do not place the template code within other PHP blocks, take care to ensure it is inserted within regular HTML content. Change [email protected]
to your actual email address in the functions.php code.
// add to functions.php at the very bottom of the file
function do_this_in_5_min() {
error_log('The 5 min. scheduled event has executed.');
wp_mail('[email protected]', 'Subject - Scheduled event test', 'Content - the 5 min. scheduled event has executed.');
}
add_action( 'my_new_event','do_this_in_5_min' );
<?php
// Add to page.php
// this will schedule a new event on EVERY page visit!
wp_schedule_single_event( time() + 300, 'my_new_event' );
// time() + 300 = five min. from now.
?>
Load any page that uses the page.php template to schedule a new task, then comment out the wp_schedule_single_event() line to stop additional events from being scheduled (add //
to the front of the line). After 5 minutes have passed, view something in WP to trigger the task, which both emails you and logs a message in the error log.
Check your error log to see if the message was logged, demonstrating that scheduled tasks do in fact work. Check your email account for a similar message. Remember that emails can take a while to get delivered and that they could land in your spam folder. If you get the email, then we know that your installation can send out emails.
If those check out, there is likely a problem with the cart abandonment plugin itself. Take up the issue with its devs through their official support channel.
Edited test code instructions, didn’t think through my initial post.
-
This reply was modified 5 years ago by bcworkz.