Giter Club home page Giter Club logo

Comments (12)

stevengliebe avatar stevengliebe commented on July 2, 2024

A link to edd.shop/checkout-page/?edd_license_key=&download_id= will do it, so that's three bits of information that would need to be passed in.

The API's license check returns expiration date so that's handy to show too. When expiration is within 30 days or already passed, we draw more attention to the renewal button and show a notice on Dashboard, Updates, Themes and Theme License. The date and status is checked remotely once daily when one of these pages is accessed (and on every load for the Theme License page) to make sure it's accurate locally (in case they renewed or something else changed). This should help capture more renewals versus email notice alone. You know how reliable email is.

Here's some code for whatever it's worth. It could use some refactoring.

https://github.com/churchthemes/church-theme-framework/blob/master/includes/admin/edd-license.php

from edd-theme-updater.

samikeijonen avatar samikeijonen commented on July 2, 2024

Thanks for hopping in. I look into it. I think we can pull this together in a nice format which we can all find usefull.

from edd-theme-updater.

stevengliebe avatar stevengliebe commented on July 2, 2024

That'd be great. It's all very possible now. I don't think expiration was returned with earlier versions of the API so I was thrilled to be able to use it.

from edd-theme-updater.

devinsays avatar devinsays commented on July 2, 2024

I think it would be best to have the API generate the renewal link. That would simplify all the logic in the updater. Perhaps EDD licensing could add that in? Then shops could set the time period for when it appears in the JSON response.

I added a temporary version that simply links back to the shop url.

from edd-theme-updater.

samikeijonen avatar samikeijonen commented on July 2, 2024

I'll ask Pippin if he add renewal link in API.

@devinsays I made small changes in your version. Do you want be to fork your repo and get them here.

For example I added how many sites are active in that license. License key is active. Expires 11 June, 2015. Activated sites 1 / 1.

from edd-theme-updater.

samikeijonen avatar samikeijonen commented on July 2, 2024

This is how I updated to file.

https://gist.github.com/samikeijonen/be0ead5baa143524c171

I changed at least these.

theme_name not slug: https://gist.github.com/samikeijonen/be0ead5baa143524c171#file-theme-updater-php-L31

All inside admin_init hook and check for valid license:
https://gist.github.com/samikeijonen/be0ead5baa143524c171#file-theme-updater-php-L50

This should be prefix, not themename:
https://gist.github.com/samikeijonen/be0ead5baa143524c171#file-theme-updater-php-L79

Show messages conditionally:
https://gist.github.com/samikeijonen/be0ead5baa143524c171#file-theme-updater-php-L121
https://gist.github.com/samikeijonen/be0ead5baa143524c171#file-theme-updater-php-L129

Take sample word out:
https://gist.github.com/samikeijonen/be0ead5baa143524c171#file-theme-updater-php-L273

Get site count:
https://gist.github.com/samikeijonen/be0ead5baa143524c171#file-theme-updater-php-L129

And some small indents so that code looks more pretty.

from edd-theme-updater.

devinsays avatar devinsays commented on July 2, 2024

Some great suggestions! I'd take a pull request if you want to send one- but also easy enough for me to update.

Should it be $data['theme_name'] and not $data['theme_slug']? I haven't tested (or tried one with spaces) but will look into it.

from edd-theme-updater.

samikeijonen avatar samikeijonen commented on July 2, 2024

Okay I'll hold on for pull request. Let's try to keep this repo as good as it can ever be for automatic updates.

from edd-theme-updater.

devinsays avatar devinsays commented on July 2, 2024

I rolled in a couple of these:
151be7f

Let's use separate issues moving forward for individual improvements.

I opened an issue for site counts:
#4

I haven't addressed yet:

  • theme_name not slug
  • this should be prefix, not themename
  • show messages conditionally

I believe we're approaching messages in a slightly different way. I'm attempting to put all the messaging in the "description".

Feel free grab the latest fork and send pull requests as you see fit.

from edd-theme-updater.

samikeijonen avatar samikeijonen commented on July 2, 2024

I got this answer for using theme-slug or Theme Name.

https://easydigitaldownloads.com/support/topic/theme-slug-or-theme-name-in-updater/

from edd-theme-updater.

devinsays avatar devinsays commented on July 2, 2024

In this latest commit (8698735), I've added a "download_id" param in the config. If a license key is also entered and the license is expired, a renewal link will be generated and displayed.

This link can be overridden with a custom one if "renew_url" is in the config. I can't think of many cases where this might be done- but perhaps someone has a custom splash page for renewals or a different permalink structure.

If neither param is entered, the renewal link will just be remote_api_url.

@samikeijonen Would love help testing this + the updates for strings.

from edd-theme-updater.

samikeijonen avatar samikeijonen commented on July 2, 2024

I definitely test this out but I'm more or less offline next 3 days. I'll check everything next week.

from edd-theme-updater.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.