Support » Plugins and Hacks » WordPress.com Stats » [Resolved] WordPress.com Stats doesn't work via a proxy

[Resolved] WordPress.com Stats doesn't work via a proxy

  • Hi!

    When activating WordPress.com Stats behind a proxy (mandatory by some web hosting services), this doesn’t work, because the included XML-RPC class, class-IXR, isn’t written to directly support proxies.

    You can tweak class-IXR.php according to this post: http://thedeadone.net/lj/livejournal-and-wordpress/

    The trick is:

    Look for function query().

    Change (on line 640 or so) to

    $request = “POST http://{$this->server}{$this->path} HTTP/1.0$r”;

    (i.e. the http://{$this->server} is added to the line)

    A bit below that, comment out the @fsockopen calls and use the values as described. This was copied out from Mark Cunningham’s configuration, which has a proxy server at proxy.dcu.ie:3128 — adjust for your own settings.

    if ($this->timeout) {
    //$fp = @fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout);
    $fp = @fsockopen(‘proxy.dcu.ie’, 3128, $errno, $errstr, $this->timeout);
    } else {
    //$fp = @fsockopen($this->server, $this->port, $errno, $errstr);
    $fp = @fsockopen(‘proxy.dcu.ie’, 3128, $errno, $errstr);

    This definitely worked for me!

  • The topic ‘[Resolved] WordPress.com Stats doesn't work via a proxy’ is closed to new replies.
Skip to toolbar