/**
* Bypass Winden Pro license checks and block external requests.
*/
// 1. Always consider the Pro license active.
add_filter('pre_option_winden_license', function($value) {
return [
'key' => 'local-test-key',
'status' => \Winden\Pro\License\Enums\LicenseStatus::ACTIVATED,
'checkedAt' => current_time('mysql', true),
];
});
// 2. Block any HTTP requests to dplugins.com and return mock responses.
add_filter('pre_http_request', function($pre, $parsed_args, $url) {
if (strpos($url, 'dplugins.com') !== false) {
// Mock a successful license check response.
if (strpos($url, 'edd_action=check_license') !== false) {
return [
'response' => ['code' => 200, 'message' => 'OK'],
'body' => json_encode(['license' => 'valid']),
];
}
// Mock a “no update” response.
if (strpos($url, 'edd_action=get_version') !== false) {
return [
'response' => ['code' => 200, 'message' => 'OK'],
'body' => json_encode(['new_version' => WINDTACS_VERSION]),
];
}
// For any other request, return a generic success.
return [
'response' => ['code' => 200, 'message' => 'OK'],
'body' => json_encode(['success' => true]),
];
}
return $pre;
}, 10, 3);
// 3. Remove the update transients hooks if they still try to call out.
add_action('init', function() {
// If the Release class is already loaded, unhook its methods.
if (class_exists('Winden\Pro\Admin\Release')) {
$release_instance = new \Winden\Pro\Admin\Release();
remove_filter('pre_set_site_transient_update_plugins', [$release_instance, 'checkRelease']);
remove_filter('plugins_api', [$release_instance, 'releaseDeatil'], 10);
}
}, 20);