Support » Plugin: WHMCS Bridge » [RESOLVED] WHMCS bridge URLs double up, URLs broken

  • I actually fixed mine, posting this for people who are experiencing the same problem. i-plugins, you don’t have any contact forms for a bug report, it’s a shame 🙂 Great job on the plugin anyway!


    wordpress at
    whmcs at (or any other subdir)
    whmcs-bridge page at , configured to use the above whmcs URL.

    With plain HTTP, the plugin works fine, and links are generated like .

    When you try HTTPS though, it gets ugly: load , and all links inside it turn into https://domain.comhttps// . Many people reported this behavior, but everyone failed to notice that it only happens when your SSL mode is different from what you have in WordPress general settings, it either works in http or https – works when it matches your wordpress site name, fails otherwise.

    The bug is in the plugin’s includes/ , reported by drop9 here: . It’s a sanity check, which looks like it’s supposed to eliminate our problem instead of causing it:

    $homePage = get_option('home');
    $wordpressPageName = get_permalink($pageID);
    $wordpressPageName = str_replace($homePage,"",$wordpressPageName);

    In a nutshell, this is supposed to remove the occurrences of $homePage from $wordpressPageName to avoid duplication. I don’t know why they concatenate these two strings, but i’m no developer, maybe there’s a valid reason for that ugly hack.

    Anyway, here’s what happened to the variables in my case:


    See? the string “” does not contain the string “” , so str_replace failed to clean it up.

    $homePage here is the variable from WordPress main settings page, and $wordpressPageName is taken from the URL we are currently visiting.

    One solution would be to change the general WordPress setting from to , but this will obviously turn your entire website HTTPS. I made a hack instead (i copied the developers’ hack used for another variable just a few lines lower):

    $homePage = get_option('home');
    if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == "on")) {

    No harm done because, like i said, the same hack is used elsewhere in the same script.

    There is also a WordPress SSL module, and i-plugins mentioned that you could install it to get this fixed, but i don’t see a reason to bother.

    Works like in charm in both HTTP and HTTPS.

    Hope that helps someone!

    Regards, Nick

Viewing 2 replies - 1 through 2 (of 2 total)
  • Nick, thanks for the write-up. I’m having the same issue, but I’m not sure I understand how to apply this fix. I tried editing to no avail, where do I make the change?

    – fox

    oh, nevermind. i figured it out. thanks Nick! very helpful.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[RESOLVED] WHMCS bridge URLs double up, URLs broken’ is closed to new replies.