WordPress.org

Ready to get started?Download WordPress

Forums

WP-Piwik
[resolved] Problem with HTTPS in proxy mode (4 posts)

  1. trick77
    Member
    Posted 1 year ago #

    Fantastic plugin André, really appreciate it!

    On my https site I had to comment one line in applyJSCodeChanges:

    function applyJSCodeChanges($strCode) {
            // Change code if js/index.php should be used
            if (self::$aryGlobalSettings['track_mode'] == 1) {
                $strCode = str_replace('piwik.js', 'js/', $strCode);
                $strCode = str_replace('piwik.php', 'js/', $strCode);
            } elseif (self::$aryGlobalSettings['track_mode'] == 2) {
                $strCode = str_replace('piwik.js', 'piwik.php', $strCode);
                $strURL = str_replace('https://', '://', self::$aryGlobalSettings['piwik_url']);
                $strURL = str_replace('http://', '://', self::$aryGlobalSettings['piwik_url']);
                $strProxy = str_replace('https://', '://', plugins_url('wp-piwik'));
                //$strProxy = str_replace('http://', '://', plugins_url('wp-piwik')); <----
                $strCode = str_replace($strURL, $strProxy, $strCode);
            }

    I don't think you can call str_replace on $strProxy twice in a row that way, you probably need an if there.

    Cheers

    http://wordpress.org/extend/plugins/wp-piwik/

  2. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for your post.

    Can you try this change, please?

    $strURL = str_replace('https://', '://', self::$aryGlobalSettings['piwik_url']);
    $strURL = str_replace('http://', '://', $strURL);
    $strProxy = str_replace('https://', '://', plugins_url('wp-piwik'));
    $strProxy = str_replace('http://', '://', $strProxy);

    If this works fine, I'll provide an update soon.

  3. trick77
    Member
    Posted 1 year ago #

    Working fine, thanks.

  4. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    Great, I'll create a fix. It will be released with 0.9.9.2.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.