Comments (12)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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)
- Works on multisite HOT 2
- Extract Strings for Filtering/Manipulation HOT 5
- Edd checkout uri HOT 9
- Admin notice HOT 4
- Lifetime license HOT 1
- Variable inside gettext function. HOT 1
- Child Theme
- Theme version HOT 4
- Still need to click Activate License button HOT 5
- List Site Counts (for activated license) HOT 2
- Move admin functions into a separate file HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from edd-theme-updater.