• Resolved dtraymond

    (@dtraymond)


    Hello,

    I’m currently using the WebP Converter plugin and have encountered an issue with proxy configurations. My WordPress setup uses proxy settings defined in the wp-config.php file, like this:

    if (!empty($_SERVER['http_proxy'])) {
    @list($proxy_host, $proxy_port) = explode(':', $_SERVER['http_proxy']);
    define('WP_PROXY_HOST', $proxy_host);
    define('WP_PROXY_PORT', $proxy_port ?? 3128);
    }

    These settings work seamlessly for WordPress’s HTTP API calls via wp_remote_get() and similar functions. However, the plugin’s PassthruExecutionDetector class uses raw cURL requests (e.g., in the if_passthru_execution_allowed() method), which bypass these proxy settings.

    Issue:
    The plugin does not use the proxy settings for its cURL requests, resulting in blocked outbound connections in environments that require a proxy.

    Proposed Solution:
    Please consider updating the if_passthru_execution_allowed() method (or similar parts of the plugin) to include support for proxy settings. For instance:

    if (defined('WP_PROXY_HOST') && defined('WP_PROXY_PORT')) {
    curl_setopt($ch, CURLOPT_PROXY, WP_PROXY_HOST);
    curl_setopt($ch, CURLOPT_PROXYPORT, WP_PROXY_PORT);

    if (defined('WP_PROXY_USERNAME') && defined('WP_PROXY_PASSWORD')) {
    curl_setopt($ch, CURLOPT_PROXYUSERPWD, WP_PROXY_USERNAME . ':' . WP_PROXY_PASSWORD);
    }
    }

    Request:

    • Could you add native support for proxy settings in the plugin’s cURL implementation?
    • Alternatively, let me know if there’s a way to extend or override the plugin functionality to achieve this without modifying the core plugin files directly.

    Thanks in advance for your help! Let me know if you need more information about my setup.

Viewing 1 replies (of 1 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hi @dtraymond,

    Thank you for your message.

    Please tell me why you think this is a problem? The plugin is designed to test the plugin from the user’s perspective. The user does not enter a proxy address, but enters the public URL of your site.

    Honestly, this is the first time someone has reported an issue related to the WP_HTTP_Proxy class. I did not consider supporting HTTP API proxy before, so I would like to understand your need better.

    Additionally, from what you wrote, I assume that you are using the Passthru image loading method. Please tell me why you chose this method instead of the recommended one?

    Best,
    Mateusz

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.