Describe the bug
When the seats parameter is omitted from the $pmprosm_sponsored_account_levels array and if the sponsored seats are free, checking out for a sponsor level without creating any child accounts creates an unlimited use discount code.
An unlimited use discount code is also created if a parent account is imported from CSV.
To Reproduce
Steps to reproduce the behavior:
Setup your $pmprosm_sponsored_account_levels array. Omit seats and set seat_cost to 0
Check out for the sponsored level. Do not create any seats at checkout.
Check Memberships > Settings > Discount Codes
Observe that the discount code created has unlimited uses.
Expected behavior
Number of discount code uses is limited
Isolating the problem (mark completed items with an [x]):
[x] I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
[x] This bug happens with a default WordPress theme active, or Memberlite.
[X] I can reproduce this bug consistently using the steps above.
WordPress Environment
WP 6.2
PMPro 2.10.5
PMPro Sponsored Members 0.10.1
Describe the bug When the
seats
parameter is omitted from the$pmprosm_sponsored_account_levels
array and if the sponsored seats are free, checking out for a sponsor level without creating any child accounts creates an unlimited use discount code.An unlimited use discount code is also created if a parent account is imported from CSV.
To Reproduce Steps to reproduce the behavior:
$pmprosm_sponsored_account_levels
array. Omitseats
and setseat_cost
to0
Expected behavior Number of discount code uses is limited
Isolating the problem (mark completed items with an [x]):
WordPress Environment