EOT is correct but after passing that time, user not demoted

System is creating an EOT for all new users correctly - great.
When their EOT passes, the admin panel in WP shows the user’s Registration time, EOT and last login accurately - great.

But when a user passes their EOT, they remain at Level 1 rather than being demoted to Level 0.

Our EOT behavior is set to:

  1. “Yes enable the Auto-EOT system through WP-Cron”
  2. “Demote - convert them to a free subscriber”
  3. “Grace period of 20000 seconds”

When checking our enabled logging, I see in the auto-eot-system.log shows the last entry was in Feb 2017!?
Why wouldn’t the auto-eot-system.log be logging new members here?
The reg-handler-api.log does show new users though.

If I create this file and directory: wp-content/mu-plugins/s2-eot-role.php:
Using this rule, will this work?

<?php
add_filter('ws_plugin__s2member_force_demotion_role', function(){ return 's2member_level0'; });

Is your cron jobs works fine?

Should be. How would I check it?
I can see there is a wp-cron.php file active on the server.

Same behaviour when you set an EOT manually?
Maybe an issue with time zones?

Thanks @TheHotte84 – appears to work exactly the same way. How would I check if my WP-cron job is working properly?

If you set EOT manually and it was not executed wp-cron seems to have a problem. Maybe try https://wordpress.org/plugins/wp-crontrol/ to test wp-cron functionality.

Thansk, @TheHotte84 – I installed as directed and after clicking to “Run Now”, I see this:

Successfully executed the cron event ws_plugin__s2member_auto_eot_system__schedule.

The DISABLE_WP_CRON constant is set to true. WP-Cron spawning is disabled.

Hook Name: ws_plugin__s2member_auto_eot_system__schedule
Arguments: None
Actions: c_ws_plugin__s2member_auto_eots::auto_eot_system()
Next Run : 2017-05-19 14:48:18 (now)	
Recurrence: 10 minutes
Actions: Edit | Run Now | Delete 

Everything seeeeeeems OK?

I am not a expert but wp-cron default behaviour seems to be disabled. What you want is to enable it i guess. Search for define(‘DISABLE_WP_CRON’, ‘true’); in wp-config.php. Is it set? If so set it to false or comment it out. That should enable wp-cron default behaviour and EOT should process correctly.

See http://www.inmotionhosting.com/support/website/wordpress/disabling-the-wp-cronphp-in-wordpress

Hope that helps!

BTW: Have your EOTs process correctly after running wp-cron manually?

SUCCESS!!
Thanks @TheHotte84

I commented out:
define('DISABLE_WP_CRON', 'true');
in wp-config.php.

I left the system to run the EOT on an existing user and it successfully demoted the user to Level 0 – great!

In my WP admin users pane, I monitored the user about to expire and it showed the EOT time correctly and the user Level 1.

After the EOT passed and the cron had run automatically as scheduled, the EOT field became blank and the user was demoted to Level 0.

Can anyone tell me if it is correct behaviour for the EOT field to display as blank after expiry/demotion?

Thank all - great!

Yes it is correct. The EOT tells s2member to demote the user at a specific time. When the demotion is processed there is no need for EOT anymore.

Thanks @TheHotte84 – I guess removing the EOT makes sense.

It would be great to know when a particular user’s expiration date was, as we could manually market to those users to have them re-subscribe :slight_smile: