Two bugs in limits & statistics
Bug 1: Usage message
When a user exceeds their limit the plugin is not displaying the correct usage message. It says "API processing failed, please try again".
Bug 2: Usage limit does not change when customer changes their membership plan
I created demo memberships that include a free plan and a paid plan (using Ultimate Membership Pro).
I signed up as a demo end user and bought the free plan. The plugin allowed me to use the correct amount of tokens (then displayed the incorrect message above).
Then I bought the paid plan in order to increase the tokens I can use with the chatbot, however, I was still seeing the restriction message.
I think this is the issue: you have coded the plugin to read ALL restriction conditions and restrict usage if ANY of them are true. Therefore, if a user upgrades from a low plan to a higher plan, the plugin will still apply the restriction from the low plan. I think you need to code the rule to apply usage restrictions based on the "highest plan only" and not based on all plans.
You can review this issue on my test site here: https://csnw.com. You have super admin access with this email: <span class="il">kisded</span>@yahoo.com
You can signup as a demo end user here: https://csnw.com/member-login/
You can view your Ultimate Membership Pro dashboard (as an end user) here: https://csnw.com/my-account/