-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add query arg to requested .php file #549
Comments
|
I know it has been some time since my initial post - but thank you for the response! Hope this makes sense, and that you can point me in the right direction! |
I don't think that's really possible with GitHub. To do it securely, you need to validate the license on the server, not just in the plugin. And you can't run your custom license validation code on GitHub's API servers, so that's not going to work. Technically, you could try something like giving each licensed user their own API token, but I don't know how practical that would be (does GitHub even allow generating arbitrarily many tokens?). |
I feared you would say that, but thanks for the quick response. I honestly don't know if GitHub allows that. |
I just started using the plugin-update-checker, the thing is that there is already licens management in my plugin and for that to work I have to add a query arg to to the file specified in the buildUpdateChecker function, I need this because the existing license management is handled in that file.
For context: I'm executing the below code from my main plugin file, without using any hooks as recommended in the getting started section.
Here is the old way of how I send the license_key with the requested file.
`if ( ! function_exists( 'remote_get_info' ) ) {
function remote_get_info( $info_url, $license_key, $args = array() ) {
}`
I have tried to add it directly to the url like this:
$myUpdateChecker = PucFactory::buildUpdateChecker( 'link-to-file.php?license_key=' . urlencode( 'the-license-key-value' ), __FILE__, 'my-plugin-slug' );
And I have tried using the addQueryArgFilter function like this:
`$myUpdateChecker->addQueryArgFilter( function ($args) {
$args['license_key'] = urlencode( 'the-license-key-value' );
} );`
This might very well just be me not properly understanding the plugin-update-checker. But can someone point me in the correct direction of achieving something similar to what I was doing with the remote_get_info function.
The text was updated successfully, but these errors were encountered: