Memberships does not expire when it is supposed to

I have realized the memberships are not expiring, it has been like this since april:ish.

I have checked om my dev sight as well (localhost). Previously we had an error in the logs with one of memberships cron jobs. I think I have an open ticket with this, in connection to slow site. I dont know if this is the same issue.

I dont have it in the logs anymore and I dont have logs for more than a week. So I dont know when it disapeared.

https://static.livechatinc.com/8801096/P94WLT4GCX/12bbcf5ab75f9045b6bc2729c579a589/Ska%CC%88rmavbild%202018-06-06%20kl.%2018.30.07.png

Here is an image of one user, 4 of her memberships is stil active and it is a lot of days since they expired.

  • Cristina Krügnell
    • Site Builder, Child of Zeus

    Hello
    Some update after the conversation I had with Support Wednesday
    My dev/live site has turned of the cronJobs so nothing happened with the test for other plugins.
    When developing on my localhost i suddenly got a message that wasn't a part of my programming and I investigated it further.
    [06-Jul-2018 17:37:50 UTC] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /Users/cristina/wordpress_ny/wp-includes/wp-db.php on line 1924
    It came when the cronJob ms_cron_check_membership_status was executed
    I changed the execution time in .htaccess
    php_value max_execution_time 300
    I started the cronJob again and there was no errors
    All the members with expired members are still in active state
    :slight_frown:

    Is there another process involved in expiring memberships?
    Best regards
    /Cristina

  • Cristina Krügnell
    • Site Builder, Child of Zeus

    The results from my tests are showing it is not working. why?

    The images 1, 2, 3, 4 show the membership that I use and the members.
    Members are added through the admin interface.
    Image 5 shows that I added a log-line to your cron-job, the last line.

    I will add a new post to add the last images

  • Cristina Krügnell
    • Site Builder, Child of Zeus

    The last post just added 4 of the images.
    image 1 shows the line I have added to your code to logg
    Image 2 is the cronJobs, There is 2 cron jobs from membership that is running.
    Image 3 shows the result from the yesterday in the logs
    the cron has executed 3 times. Strange is that it gets to "done" twice with 2 min part. I also see that it takes aprox 5 min to run.

    This copy of WP on localhost is a copy of my live-site. The difference is that I have not added the php_value max_execution_time 300 to my live-site.

    Please let me know how we continue to investigate.
    Best Regards
    /Cristina

  • Cristina Krügnell
    • Site Builder, Child of Zeus

    Hello again

    I have done some further debugging and found the issue.
    All of my expired memberships end up in the dead end of not having any previous invoice.
    Either I have to do some reconfiguration or you have to do something to fix the issue on your side, it used to work before. Was that a bug that now is fixed?
    All my memberships are free.
    Please let me know how to continue.
    Best regards
    /Cristina

  • Kasia Swiderska
    • Support nomad

    Hello Cristina,

    I can see that we have access to your dev site and you have given us creds to first htaccess pop-up, however admin credentials are not working.
    I'm getting error "FEL: Ogiltigt användarnamn. "\
    Can you leave correct credentials on live chat and support agent will add them to the ticket?

    kind regards,
    Kasia

  • Cristina Krügnell
    • Site Builder, Child of Zeus

    Hello
    I have spoken with my host and got the help I need to solve the cronJob issue that we faced on my dev site.
    It is now protected by maintenance plugin instead, it was the password protection that they used that stopped the cronJobs
    To login please click on Adminpanel and use your admin-user to login then you will have access to everything.
    Best Regards
    /Cristina

  • Kasia Swiderska
    • Support nomad

    Hello Cristina,

    I checked your dev site and those members that are still not expired even its way too long after the expiration date and it doesn't look like cron issue. Because we can trigger check of the date manually and it should change the status of the membership.
    And it is not working.
    I tested this on my lab site - in case I will be able to replicate, but just after expiration date member subscription expired.

    Unfortunately on your site there is no errors in debug mode that would give any hint what is going on.

    I will give my findings to developers and also I will perform one more test to see if I will be able to narrow down where is problem.

    We will keep you posted.

    kind regards,
    Kasia

  • Cristina Krügnell
    • Site Builder, Child of Zeus

    Hello

    thank you!
    When I did some investigations on your cronJob, all my subscriptions ended up in the state of the image in my post on Mon Jul 9 2018, 5:02:41 PM: direct link to comment
    They dont have any invoices and then return().

    On dev. I have a debug.log, it is located under wp-content/ if you want to do any tests and print the result from code.
    Best regards
    /Cristina

  • Kasia Swiderska
    • Support nomad

    Hello Cristina,

    I believe I found bug after more testing on yours and my site. Seems that culprit is in add-on Multiple Memberships.
    I was testing this before on single membership per one user and expiration was working correctly - after switching on Multiple Memberships add-on I got the same issue like on your site, when memberships are showing as active despite that date of expiration past.

    I am reporting this to developers that I was able to narrow down the culprit and that it can be replicated, so it will be now easier to provide a fix. We will keep you posted about progress.

    kind regards
    Kasia

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.