On a computer with Windows 7 there is a blocking all websites except those are specified in the file C:\Windows\System32\drivers\etc\hosts which serves as "DNS" like

123.456.789.123 example.com

and DNS in network adapter settings are switched to

As I see in wp-admin/includes/theme.php, free available WP themes in admin panel on pages "Themes > Add new" and "Customize > Change > WordPress.org themes" are loaded from the url api.wordpress.org. But this url is not mentioned in the hosts file.

So how can it be possible the themes are still loaded?

If I remove in wp-includes/class-http.php inside of the function request() the lines

$proxy = new WP_HTTP_Proxy();
if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {
    // ...

nothing changes and themes continue to load, so the proxy is not used.

How themes are loaded from api.wordpress.org bypassing DNS?

  • Do you mean the computer that has blocking set up is your own computer, or do you mean it's the actual server where your WordPress install is hosted?
    – WebElaine
    Commented Jul 3, 2018 at 19:46
  • Also, be aware that any changes you might make to wp-includes/class-http.php or any other core file will be overwritten on any WP update. Don't Hack Core, as they say.
    – Pat J
    Commented Jul 3, 2018 at 21:25


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.