Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/pro/src/HTTP/Controllers/LicenseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function activateLicense()

$data['licenseKey'] = $licenseKey;

$data['domain'] = site_url();
$data['domain'] = is_multisite() ? network_site_url() : site_url();

$data['slug'] = PluginCommonConfig::getProPluginSlug();

Expand Down Expand Up @@ -71,7 +71,7 @@ public function deactivateLicense()

$data['licenseKey'] = $licenseData['key'];

$data['domain'] = site_url();
$data['domain'] = is_multisite() ? network_site_url() : site_url();

$this->httpClient->setHeaders([
'content-type' => 'application/json',
Expand Down
14 changes: 13 additions & 1 deletion backend/pro/src/Services/LicenseService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,19 @@ public static function setLicenseData($licenseKey, $licData)

$data['expireIn'] = $licData->expireIn;

return update_option(PluginCommonConfig::getProPluginPrefix() . 'license_data', $data, null);
if (is_multisite()) {
$networkSites = get_sites();

foreach ($networkSites as $site) {
switch_to_blog($site->blog_id);

update_option(PluginCommonConfig::getProPluginPrefix() . 'license_data', $data, null);

restore_current_blog();
}
} else {
update_option(PluginCommonConfig::getProPluginPrefix() . 'license_data', $data, null);
}
}

public static function getUpdatedInfo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function useCheckLicenseValidity(forceRequest = false) {
queryFn: () =>
proxyRequest<CheckUpdateResponse>({
bodyParams: {
domain: config.SITE_URL,
domain: config.SITE_BASE_URL,
licenseKey: config.KEY ? { encryption: 'hmac_decrypt', value: config.KEY } : ''
},
method: 'POST',
Expand Down