lifterlms icon indicating copy to clipboard operation
lifterlms copied to clipboard

ThriveCart Upsells Affecting Membership Access

Open nrherron92 opened this issue 1 year ago • 5 comments

Reproduction Steps

  • HS-208650
  • Test student on staging made purchase of 3 memberships through user's ThriveCart integration
  • Only 2 (now one because 1 was cancelled) of the 3 memberships is showing up on the user's end as being enrolled or in their reporting as being enrolled
  • However, the user is listed as enrolled in the membership student management as unspecified trigger
  • I can't recreate this with just LifterLMS's system.
  • Staging site in ticket -- credentials in 1pass

Expected Behavior

  • When user is enrolled in a membership it should provide access on front end along with adding the membership to reporting

Actual Behavior

  • One of the memberships won't display to the user

Error Messages / Logs

  • Include any relevant error messages or log files
<!-- Paste error logs / backtraces below this line -->

System and Environment Information

System Report
Wordpress
-------------------------------------------

Home Url: [removed]
Site Url: [removed]
Login Url: https://my.sitedistrict.com/sso/avaiya-dev.sitedistrict.com/login?requrl=https%3A%2F%2Favaiya-dev.sitedistrict.com
Version: 6.1.1
Debug Mode: Yes
Debug Log: Yes
Debug Display: Yes
Locale: en_US
Multisite: No
Page For Posts: Blog (#5239263) [[removed]/blog/]
Page On Front: Avaiya Media Home Page (#5239221) [[removed]/]
Permalink Structure: /%postname%/
Show On Front: page
Wp Cron: No


Settings
-------------------------------------------

Version: 7.0.1
Db Version: 7.0.1
Course Catalog: Courses (#5211167) [[removed]/courses/]
Membership Catalog: Membership Catalog (#5243022) [[removed]/memberships/]
Student Dashboard: Dashboard (#5243024) [[removed]/dashboard/]
Checkout Page: Purchase (#5243023) [[removed]/purchase/]
Course Catalog Per Page: 9
Course Catalog Sorting: menu_order
Membership Catalog Per Page: 9
Membership Catalog Sorting: title,ASC
Site Membership: Not Set
Courses Endpoint: my-courses
Edit Endpoint: edit-account
Lost Password Endpoint: lost-password
Vouchers Endpoint: 
Autogenerate Username: no
Password Strength Meter: no
Minimum Password Strength: 
Terms Required: no
Terms Page: Not Set
Checkout Names: 
Checkout Address: 
Checkout Phone: 
Checkout Email Confirmation: no
Open Registration: no
Registration Names: 
Registration Address: 
Registration Phone: 
Registration Voucher: 
Registration Email Confirmation: no
Account Names: 
Account Address: 
Account Phone: 
Account Email Confirmation: no
Confirmation Endpoint: confirm-payment
Force Ssl Checkout: no
Country: US
Currency: USD
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Decimals: 2
Trim Zero Decimals: no
Recurring Payments: no
Email From Address: [removed]
Email From Name: [removed]
Email Footer Text: 
Email Header Image: 5232464
Cert Bg Width: 
Cert Bg Height: 
Cert Legacy Compat: 


Constants
-------------------------------------------

LLMS_REMOVE_ALL_DATA: undefined
LLMS_REST_DISABLE: undefined
LLMS_SITE_FEATURE_RECURRING_PAYMENTS: undefined
LLMS_SITE_IS_CLONE: undefined


Gateways
-------------------------------------------

Manual: Disabled
Manual Logging: 
Manual Order: 1


Server
-------------------------------------------

Mysql Version: 10.3.17
Php Curl: Yes
Php Default Timezone: UTC
Php Fsockopen: Yes
Php Max Input Vars: 5000
Php Max Upload Size: 500 MB
Php Memory Limit: 768M
Php Post Max Size: 500M
Php Soap: Yes
Php Suhosin: No
Php Time Limt: 600s
Php Version: 8.0.17
Software: nginx/1.18.0
Wp Memory Limit: 768M


Browser
-------------------------------------------

HTTP USER AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/111.0


Theme
-------------------------------------------

Name: Avaiya 2018
Version: 3.2.4
Themeuri: http://my.studiopress.com/themes/magazine/
Authoruri: http://www.viwickam.com
Template: genesis
Child Theme: Yes
Llms Support: No


Plugins
-------------------------------------------

Beaver Builder Plugin (Pro Version): 2.6.2.3
Classic Editor: 1.6.2
Code Snippets: 3.2.2
Column Shortcodes: 1.0.1
Easy Social Share Buttons for WordPress: 8.8
Easy WP SMTP: 2.0.1
Extra Shortcodes for WP eStore: 5.1.9
Genesis 404: 1.5.0
Genesis Dambuster: 1.11.0
Google Analytics for WordPress by MonsterInsights: 8.12.1
Gravity Forms: 2.7.1
LifterLMS: 7.0.1
LifterLMS Labs: 1.6.0
Page-list: 5.3
Pixel Caffeine: 2.3.3
Redirection: 5.3.9
Search Exclude: 1.3.1
Smart Slider 3: 3.5.1.13
Smush Pro: 3.12.5
Widget Context: 1.3.2
WP-Sweep: 1.1.5
WP Affiliate Platform: 6.2.2
WPCode Lite: 2.0.7
WPMU DEV Dashboard: 4.11.18
Yoast SEO: 20.1


Integrations
-------------------------------------------

BbPress: No
BuddyPress: No


Template Overrides
-------------------------------------------




This issue has be recreated:

  • [ ] Locally
  • [x] On a staging site
  • [x] On a production website
  • [x] With only LifterLMS and a default theme

Browser, Device, and Operating System Information

  • Browser name and version
  • Operating System name and version
  • Device name and version (if applicable)

nrherron92 avatar Feb 23 '23 15:02 nrherron92

Ok the thing is that the user is actually enrolled into the wanted membership but something else doesn't work. To put it simple: when someone enrolls into a membership we "store" the enrollment the same way we store it for the courses (a). But for memberships we also add another data directly stored as user meta which is called _llms_restricted_levels (b).

Now, on the front end, to check whether or not the user is enrolled into a membership - and also whether or not apply the membership restrictions - we rely on (a). But there's other stuff, like the memberships shown on the dashboard that rely on (b). Same thing happens on some reporting pages:

  • Reporting -> Memberships -> selected membership -> Students relies on (a)
  • Reporting -> Students - Memberships column (count) relies on (b)
  • Reporting -> Students -> selected student -> Memberships relies on (b)

While the students table on a membership edit page relies on (a) as well.

This data inconsistency might be a specific case for the user. Can you ask them to provide you with a dump of only one table? It would be interesting to have their wp_usermeta table dump.

eri-trabiccolo avatar Feb 24 '23 17:02 eri-trabiccolo

I can certainly try.

nrherron92 avatar Feb 24 '23 17:02 nrherron92

@eri-trabiccolo table dump attached to ticket

nrherron92 avatar Feb 27 '23 15:02 nrherron92

@nrherron92 Thanks! So yeah the user meta _llms_restricted_levels only has the id of one of the two memberships the student is actually enrolled into. I checked the code and there's nothing that justifies this in a simple way. The only thing is that this meta is set after the user is enrolled so what can be happened is that right after the enrollment but before the meta was set an error occurred - whatever error: e.g. memory limit? db error? Logs on website start from a too much recent date (after the enrollment occurred) so we can't say anything about that. I don't see why the thrive cart integration could have produced the issue (it uses our rest-api, right?, and I cannot reproduce it). So it might be a glitch, at this stage, we cannot say anything else:

  • we cannot reproduce the issue enrolling an user with our rest-api
  • the code itself works fine
  • we cannot analyze any error logs around the enrollment date

I would suggest to customer manually un-enroll and re-enroll the user: that fixes) the issue with that student. and possibly keep the logs enabled for a while to monitor the situation.

eri-trabiccolo avatar Feb 27 '23 17:02 eri-trabiccolo

@eri-trabiccolo HS-208650 is updated with logs from ThriveCart. In summary, they couldn't find anything wrong based on their logs. The web host didn't send any logs, but they said they did not find any errors, warnings or notices around the same time the orders were placed.

dominiquemariano avatar May 24 '23 09:05 dominiquemariano