YahnisElsts/wp-update-server

Updates for Single or Unlimited Domains

Closed this issue · 4 comments

Hi, I started using Plugin Update Checker and WP Update Server for my themes with license verification which is working great. I have a question though, by default it will update themes for unlimited domains right even if the license is same?

Yes, by default, it doesn't impose any domain or license limits. If you want to limit the number of sites that can receive updates based on the license, you will probably need to implement those restrictions yourself.

Is there a way to get the domain that the request is coming from so I can use it in my validation?

I plan to save it against a licence the first time, then deny access if a different domain tries to use the same licence.

The update checker doesn't send the site URL to the server, at least not by default. Technically, it's possible to extract it from the User-Agent header, but it's not a reliable approach. Some security plugins change the user agent to hide the WordPress version and/or site URL.

I would recommend sending the site URL yourself. In your plugin or theme, you can use the request_info_query_args filter to add custom query parameters to update requests. Here's a basic example:

$updateChecker->addFilter('request_info_query_args', 'exampleQueryArgFilter');

function exampleQueryArgFilter($queryArgs) {
	$queryArgs['licensed_site_url'] = site_url();
        return $queryArgs;
}

I wasn't sure if I was able to pass a URL within a query arg but that works great, thanks.