Suspend/unsuspend user based on WP membership status

Suspending and unsuspending users will be the easy part. The trick is to figure out which Woocommerce actions to hook into.

It looks like the woocommerce_subscription_status_updated action should work. That hook passes three parameter: $subscription, $new_status, $old_status. The status parameters are strings, so their value should be fairly self-explanatory. The $subscription parameter is a WC_Subscription object. I’m assuming that it contains details that let you find the user ID that the subscription is associated with. I’d have to take a look at it to confirm though.