• I am using Ozh’s ClickCounter Plugin. I do have to go.php file copied to my blog’s root directory.

    Clicks are counted however the redirection no longer works. Is this maybe due to the changed way of handling permalinks in WP 2.0? Anybody encountered the same difficulties?

    If you want to give it a try you can manually invoke the go.php script by going to:

    http://www.rottmann.net/blog/go.php?http://www.wordpress.org

    You will see that the go.php script no longer works. For the sake of completeness here is the content of the go.php script. I have not touched any of the original code.

    <?php
    require('./wp-blog-header.php');
    // IMPORTANT :
    // if you don't put this file in your blog root (where your index.php is)
    // then modify the path to wp-blog-header.php above

    header('Expires: Mon, 23 Mar 1972 07:00:00 GMT'); header('Cache-Control: no-cache, must-revalidate'); header('Pragma: no-cache');

    // IMPORTANT :
    // same notice as above. This is to ensure the redirection still works even
    // if you deactivate the plugin.
    if (!function_exists("wp_ozh_click_increment")) {
    require('./wp-content/plugins/wp_ozh_clickcounter.php');
    }

    if ($_SERVER["QUERY_STRING"]) {
    $url = $_SERVER["QUERY_STRING"];
    $test= wp_ozh_click_increment($url);

    if ($is_IIS) {
    header("Refresh: 0;url=$url");
    } else {
    header("Location: $url");
    }

    } else {
    echo "Hmmm ? ";
    echo "<a href=\"" . get_settings('siteurl') . "\">Back to Blog</a> !";
    }
    ?>

    Your help is greatly appreciated.

Viewing 15 replies - 1 through 15 (of 26 total)
  • Thread Starter ralfrottmann

    (@ralfrottmann)

    It appears to me that the $is_IIS variable seems to be no longer available in WordPress 2.0. I have altered the go.php script as follows and it seems to work again:

    if ($is_IIS) {
    header(“Refresh: 0;url=$url”);
    } else {
    header(“Refresh: 0;url=$url”);
    // header(“Location: $url”);
    }`

    So effectively I put the “IIS way” of redirecting a browser (Refresh: 0; url=$url) into the else branch of the $is_IIS condition.

    Can anybody confirm similar observations? The Click Counter plugin is listed as one which should work seamlessly with WP 2.0 though…

    Thread Starter ralfrottmann

    (@ralfrottmann)

    Things are getting more weird… as the above seems to solve the issue, it appears to me that IE 6 no longer redirects while Firefox does. Any idea?

    Thread Starter ralfrottmann

    (@ralfrottmann)

    Tried to nail it down further. It now appears that things no longer work due to changes in the

    wp-blog-header.php

    file.

    If I uncomment the require('./wp-blog-header.php');line in the go.php (and obviously also the calls to wp_ozh_click_increment()) everything works fine.

    Any help is greatly appreciated!

    Thread Starter ralfrottmann

    (@ralfrottmann)

    As there seems to be not too much of an idea what causes Click Counter to break in Wp 2.0 I wonder:

    ==> Is there anybody out here who has a ***working*** WP 2.0 install with Ozh’s Click Counter 1.01?

    This would help me identifying whether I am the only one having difficulties or whether others experience the same issue.

    So if you run WP 2.0 and Ozh’s Click Counter plugin and do not see any issues with the go.php script, please post an answer to this thread!

    Thanks in advance.

    Not what you wanted to hear, but I have a non working wp2.0 with ozh click counter.

    Really? I’m using apache too… I copied your go.php and tried again, still no go. It converts my links but as soon as I click a link I get a blank page:

    Exampel:
    http://www.zulan.se/go.php?http://www.hereinreality.com/resolutions.html

    Thread Starter ralfrottmann

    (@ralfrottmann)

    Thanks for replying.
    Click Counter is listed as one of the working with WP 2.0 plugins on the wordpress.org update pages. However it seems as if I am not the only one having problems with WP 2.0 and go.php .

    Viper007Bond, have you also updated your wp-blog-header.php in blogroot?

    If I uncomment the first require() statement in go.php thinks work fine. (However counting stops for obvious reasons).

    Maybe it’s a specific combination of php/webserver settings which break it.

    Make a PHP file and put this in it:

    <?php header('Location: http://www.google.com/'); ?>

    Upload it to your server and browse to it. If it redirects you to Google, edit it put this in it instead:

    <?php phpinfo(); ?>

    Then link me to it.

    Viper007Bond, have you also updated your wp-blog-header.php in blogroot?

    Yeah, it’s the WP2 copy.

    It redirected to google fine. Heres the link to phpinfo

    http://www.zulan.se/test.php

    Hmm, odd, $_SERVER["QUERY_STRING"] is getting set properly (look at the very bottom):

    http://www.zulan.se/test.php?blahblahblah

    Try adding this to the top of go.php:

    error_reporting(E_ALL);

    Ok, I have added it on row 1 in go.php.

    Doesnt it need to be under the <?php row?

    Er, after the <?php. 😉

    Got it, I changed it… Sorry for beeing such a noob…

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘ClickCounter Plugin no longer works (WP 2.0)’ is closed to new replies.