Add Proxy Support for cURL in WebP Converter Plugin
-
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’sPassthruExecutionDetector
class uses raw cURL requests (e.g., in theif_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 theif_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.
- You must be logged in to reply to this topic.