• Resolved Younes

    (@vanbom)


    Hi,

    I’m reaching out with a query regarding how Paid Memberships Pro executes cron jobs for expired membership levels, particularly those with recurring subscriptions.

    Upon reviewing the pmpro_cron_expire_memberships function, I noticed that it appears to target memberships with an end date specified (mu.enddate). However, for recurring memberships, the end date might not be explicitly defined, leading to uncertainty about how these memberships are handled during cron execution.

    Could you kindly provide some insights into how PMPro handles cron jobs for recurring memberships that have expired? I’m particularly interested in understanding the process for memberships without an explicit end date and ensuring that they are appropriately managed within the cron workflow.

    Any clarification or guidance on this matter would be greatly appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Jarryd Long

    (@jarryd-long)

    Hi there, thank you for reaching out to Paid Memberships Pro.

    A recurring membership should not have an enddate or expiration date set – this will result in the subscription being cancelled at the gateway and the member losing their membership.

    PMPro does not control recurring memberships from the plugin’s side – instead, we create a subscription at the gateway and ‘wait’ for a response from the gateway for a renewal – we then record that accordingly.

    It sounds like you are working with recurring memberships only – in this case you’d want to set up a membership level to have an initial amount and a recurring amount but disable the expiration date – members would need to checkout again if their membership/subscription has been cancelled due to the expiration date that may have cancelled it.

    You’ll then find that the gateway will take control of the payment process and notify your site via webhook or IPN (depending on the gateway) of your new payment and create an order and extend the membership accordingly.

    Thread Starter Younes

    (@vanbom)

    So, based on the information provided, it appears that Paid Memberships Pro (PMPro) does not provide a specific action hook to directly catch when a recurring membership level expires?

    Plugin Support Jarryd Long

    (@jarryd-long)

    In PMPro, a recurring membership will never ‘expire’ – it can either be cancelled by the member or admin, or experience a failed payment and the gateway will send a cancellation request to the site.

    You can then use the pmpro_after_change_membership_level to determine if the membership level has been cancelled by checking if the level is 0, they’ve cancelled.

    A basic, getting started recipe on how to use this hook can be found at https://gist.github.com/strangerstudios/cc0bd4fcdd5f70e286b5

    Thread Starter Younes

    (@vanbom)

    Thanks for sharing the code snippet! I’ll test it with a focus on adapting it to handle recurring subscription expirations. Will keep you updated on the progress.

    Plugin Support Jarryd Long

    (@jarryd-long)

    Only a pleasure. Feel free to reach out if there’s anything else we can assist with.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Query Regarding Execution of Cron for Expired Recurring Membership Levels’ is closed to new replies.