• Resolved theNathanBaker

    (@thenathanbaker)


    If I set an expiration date (either for a month access to a course, or even membership plan) I’m having issue with the expiration going into effect when it is suppose to.

    Admittedly the issue could be because my testing method is flawed.

    I am using MAMP to test the plugin and its functions. MAMP gets the server date and time from the machine itself. So I am changing the date of my computer into the future to see if everything will work the way I intend it to. (i.e. things expire when supposed to)

    The problem is that nothing expires on time. It usually takes 2-3 months after the expiration date for something to register as “expired”. I’ve tried to find the code that dictates what is checked to trigger the expiration going into effect and not having any luck.

    Any idea what is happening? Is it my environment/testing method?

    Would everything actually work as it is supposed to on a live server?

    Thanks in advance for all the help!

Viewing 1 replies (of 1 total)
  • @thenathanbaker,

    I honestly can’t speak for you testing method. I don’t use MAMP. If it does work exactly as you say it should it should be working.

    More than likely the issue is that our expirations (and many other background processes in LifterLMS) are powered by WP_CRON

    WP_CRON is very imperfect and relies on TRAFFIC TO YOUR SITE to spawn the background processes. This is not a problem on live websites when visitors are visiting your site, consuming content, completing lessons, etc… but it is a problem on a local site where you may be the only visitor.

    One way to test this is to understand how it works. It needs traffic and the processes are delayed.

    Install WP Crontrol: https://ww.wp.xz.cn/plugins/wp-crontrol/

    Use the admin interfaces to see all the scheduled actions (look for stuff with “llms_” as the prefix.

    time travel with your MAMP and then visit your site on the front end. You’ll see that crons get stuck and they’ll say next run is “NOW”. Refresh until that cron actually executes and then your expirations should occur.

    Please be patient. This is NOT PERFECT because of the way WP CRON works. It’s not a bug in LifterLMS it’s just that testing time-specific things on cron jobs is difficult.

    You’re not encountering a bug (I don’t think).

Viewing 1 replies (of 1 total)

The topic ‘Possible expiration date bug?’ is closed to new replies.