New Landing How can we help? Themeforest Theme Support Flexform URLs are not being generated correctly

Viewing 9 posts - 1 through 9 (of 9 total)
  • Posted in: Flexform
  • #185242
    batteryman
    Member
    Post count: 16

    I moved to a new server and all was working great. I have been on it for a few months now. I dont know when this happen but now some of the url contain my shared path..

    Should be:
    <img src="https://www.xxxxxxxx.com/xxxxx/wp-content/themes/flexform/includes/options/img/logo-left.png" alt="Left Logo" />

    but is:
    <img src="https://www.xxxxxxxx.com/var/www/shared/xxxxx/wp-content/themes/flexform/includes/options/img/logo-left.png" alt="Left Logo" />

    It is not on all links, some come out correctly. How do I fix this,

    Here is what I tried. Reloading FLexform again from a fresh download off of Themeforest, look into database on for hard coded links, reinitiated my symlink.

    Is the code not recognizing the symlink properly?

    #185248
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    We dont have this issue with our installation. Please deactivate all plugins and check for this issue.
    Thanks
    Mohammad

    #185262
    batteryman
    Member
    Post count: 16

    Hello Mohammad,

    I am not saying that you have this issue. I have had this theme installed for a long time and I have not added any plugins. Everything has been working together for a long time, about 1yr to be exact.

    It just started to happen when I switched servers. I have the wp-contents in a shared directory because I am on a scaling server now. So the wp-contents is a symlink to the shared wp-content folder which is at /var/www/shared/wp-content.

    No other plugin or wordpress are being affected by this except Flexform. Only Flexform urls contain the full server path in them.

    Where in the theme are you requesting the url path?

    #185264
    batteryman
    Member
    Post count: 16

    also just tried deactivating all plugins, Didnt work.

    #185303
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Can you please contact at hosting provider about this issue?
    Thanks
    Mohammad

    #185332
    batteryman
    Member
    Post count: 16

    Hello Mohammad,

    Its your scripts fault. I fixed it and I would consider it a bug. In the defaults.php file you are assuming that $fslashed_dir and $fslashed_abs are going to have the same base you can use them to define Redux_OPTIONS_URL to strip away the base of the server path to leave the theme path.

    flexform > includes > options > defaults.php (lines 5 & 6)

    $fslashed_dir = trailingslashit(str_replace('\\','/', dirname(__FILE__)));
    echo debug_to_console($fslashed_dir);
    //$fslashed_abs = trailingslashit(str_replace('\\','/', ABSPATH));
    $fslashed_abs = trailingslashit(str_replace('\\','/', '/var/www/shared/biafeb/'));
    echo debug_to_console($fslashed_abs);
    echo debug_to_console(ABSPATH);
    

    Which works almost every time unless you are in a situation like mine where I am using scaling servers so I put my wp-content in a static server and use a symlink to get to it. This causes the dirname(__FILE__) of the template to be different from the original dirnmae(__FILE__) set when wordpress initiated. If you notice the echos above, those are my debugging steps to figure out what was going on. Below are the results from those.

    echo debug_to_console($fslashed_dir); --> PHP: /var/www/shared/xxxxx/wp-content/themes/flexform/includes/options/
    echo debug_to_console($fslashed_abs); --> PHP: /var/www/shared/xxxxx/
    echo debug_to_console(ABSPATH); --> PHP: /home/www-upload/xxxxx/

    Check out my screenshots. I hope this helps.

    Attachments:
    You must be logged in to view attached files.
    #185350
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,

    Brilliant! I am glad that you managed to resolve the issue.

    Thanks

    Mohammad

    #185351
    batteryman
    Member
    Post count: 16

    Hello Muhammad,

    No problem. I hope that you have a solution for future releases for users who will be in a similar situation.

    Respectfully,

    Batteryman

    #185352
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,

    Sure, We will have in future.

    Thanks

    Mohammad

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register