• Resolved john201502

    (@john201502)


    I bought the pro, but I have some questions to ask the author but I haven’t received a response after 5 days.

    I set to give every user 1000 tokens per day. but I found their token numbers had not reset or accumulated after a day.

    I want to set up a member class that can be given different tokens, but I don’t know how to write and input the code.

    I think it will be better if the author can develop the function with a setting window but not throw some code to the user. not most of the users can understand the code.

    I wish you can see my message and give me some surpports.

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hi @john201502,

    I am having a hard time replying to everyone in less than 24h, but I reply to everyone yesterday except 2-3 persons but they are not named John. Can you you reply to the support request to make sure I see it? (also make sure you used the contact form; if you send me a message somewhere else I might not have seen it).

    I set to give every user 1000 tokens per day. but I found their token numbers had not reset or accumulated after a day.

    You do this through the “Limits”? That should work, I am also using this. How did you set it up?

    I want to set up a member class that can be given different tokens, but I don’t know how to write and input the code.

    Many of my users do that through roles, as it’s the easiest way to handle this. Then, they use the code I posted here: https://meowapps.com/ai-engine/faq/#limits.

    For clarity, I repost it here:

    add_filter( 'mwai_stats_credits', function ( $credits, $userId ) {
      $user = get_userdata( $userId );
      if ( !empty( $user->roles) && is_array( $user->roles ) ) {
        foreach ( $user->roles as $role) {
          if ( $role === 'premium' ) {
            return 50;
          }
          if ( $role === 'standard' ) {
            return 10;
          }
        }
      }
      // This will be basically the default value set in the plugin settings
      // for logged-in users.
      return $credits;
    }, 10, 2);

    I think it will be better if the author can develop the function with a setting window but not throw some code to the user. not most of the users can understand the code.

    You mean the code above? Unfortunately, it’s extremely difficult to develop a nice UI to handle all the use cases possible; it would be a gigantic and complex UI, that wouldn’t be able to cover all the cases. So I have the choice: spend many months or making an UI that will be imperfect, or make it so that the plugin gives you the ability to do really everything you want very easily through code. Of course, being able to write code is important here, but I am happy to share examples, and most of them can be copy/pasted and adapted very easily. Otherwise, you could ask a dev to adapt it for you, and it would take 30mn or so.

    If this code is unclear to you, feel free to ask about it here ??

    To add it into your WordPress, I suggest using Code Snippets (https://meowapps.com/add-custom-php-code-wordpress/). You can keep your code snippets organized with a little description, so you will always know what it does.

    Thread Starter john201502

    (@john201502)

    Hi Jordy,

    Thank you for your reply.

    Which membership plugin do you recommand?I don’t know how to get the role’s name like “premium” or “standard” when I use another plugin.

    I don’t know what the 50 mean?is it 50 dollars?

    If I want to switch to tokens, it means I will have to exchange to tokens by myself?

    Is it for a month?or a day?I couldn’t see any parameter to change to 5000 token per day.

    Thanks again.

    Thread Starter john201502

    (@john201502)

    Another ploblem ,please:

    I display the status to user:

    User ID: 1
    Queries: 2
    Tokens (Units): 572 / 5000
    Dollars (Price): 0.01
    Usage: 11.44%
    Status: OK

    I want to hide the line of “Dollars (Price): 0.01”,how can I do that,please.

    Best regards.

    John

    Plugin Author Jordy Meow

    (@tigroumeow)

    You can add display_price=”false” in the shortcode ?? That will turn off that line.

    Thread Starter john201502

    (@john201502)

    I update the plugin and put the shortcode:

    [mwai_stats_current display=”debug” ?display_price=”false”][mwai_stats_current display=”usage” ?display_price=”false”]

    Nothing happen,it still show me :

    User ID: 50
    Queries: 4
    Tokens (Units): 1165 / 5000
    Dollars (Price): 0.02
    Usage: 23.3%
    Status: OK

    Plugin Author Jordy Meow

    (@tigroumeow)

    I have added this feature for you; so it’s only available in the latest version
    1.0.4
    . Are you using that one?

    Thread Starter john201502

    (@john201502)

    Thanks Jordy.

    No, I updated the plugin which is 1.0.3 now.

    So how can I update to 1.0.4?

    Could you please list all the parameter which I can hide?

    And I found the usage does not reset after a day,do I need to reset manually every day?

    Thank you so much.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘About Limits’ is closed to new replies.