• Hello,

    When adding/editing a license, the Expiry and Renewal dates are automatically set to $current_date_plus_1year. Why is it the case? Cannot it be optional?

    Use case, on the same install with auto-expiry:
    A client bought a 1 year Limited License for a theme, I’m querying for the license that should expire, I can show all the relevant information, everything is fine.
    The same client bought a Lifetime Premium License for a plugin, I’m querying for the license that should not expire, and yet there is still an expiry and renewal date when displaying license info (irrelevant data), and when the expiry date is reached, auto-expire is triggered.

    => unhappy client

    Can’t we just remove the following lines to avoid unnecessary assumptions?

    
    if(empty($renewed_date)){
       $renewed_date = $current_date;
    }
    if(empty($expiry_date)){
        $expiry_date = $current_date_plus_1year;
    }
    

    Best,

    @froger-me

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support mbrsolution

    (@mbrsolution)

    Hi, thank you for your suggestion. I have submitted a message to the developers to investigate further your request.

    Kind regards

    Plugin Author mra13

    (@mra13)

    The values are set to what most people want to use by default. Your use case is perfectly okay. Simply specify a value for those fields when you create the license key. The license key creation API lets you specify values for each field.

    Thread Starter Alexandre Froger

    (@frogerme)

    Hi @mra13 – thank you for the answer.

    I understand most people may want that, although it looks more like an assumption, especially given SLM is for developers – meaning: a lot of edge cases which would require flexibility rather than a boxed-in solution, even if it means the dev needs to type – oh no! – an extra value in a field.
    If one would really want to cater for that specific case, however, the best practice would simply be to pre-populate the field with today’s date and then sync the interface with javascript to adjust it accordingly when one edits the creation date.
    That would be a way to handle the use case properly, not to arbitrarily force it on save.

    Yet, even if this was too much workload, there is still a one-line solution that could bypass this forced state: a filter before save. But there is not even a hook that allows to change the values before inserting data in the DB, meaning that any manually edited license, even if they were populated with an empty expiry date through the API, would end up with an expiry date impossible to change back to empty unless there is another API call.

    I am sorry, but no matters how we look at it, it seems the problem remains :(.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Make Expiry and Renewal dates optional?’ is closed to new replies.