• Resolved Shnipsel

    (@schnipsel13)


    Hi,

    I’ve got some trouble and am not sure if it’s a bug. So I hope you can tell…

    Case:
    – “External Links” pointing to term archives of the same website.
    – When a term points to the current URL, it doesn’t get filtered. As a result, a link is created that’s pointing to the current URL.

    I was able to debug it down to SCO_TD_Parser::is_current_url(). (File: \terms-descriptions\includes\parsers\td_parser.php)

    The URL in $cur_slug starts with ‘www.’ while $term_url doesn’t, which means that is_current_url() always fails.

    For example: “www.example.com/path/” !== “example.com/path/”, so is_current_url() returns false and the parser creates the link.

    Best regards

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Vladimir Statsenko

    (@vladimirs)

    Greetings!

    Thank you for the report. I will investigate this problem.
    Could you check your $_SERVER[“SERVER_NAME”] environment variable, please?

    Sincerely,
    Vladimir

    Thread Starter Shnipsel

    (@schnipsel13)

    Hi,

    Sure, $_SERVER[‘SERVER_NAME’] is ‘www.example.com’ in this case.

    I hope it helps!

    Plugin Author Vladimir Statsenko

    (@vladimirs)

    Hi.
    This definitely makes situation more clear. $_SERVER[‘SERVER_NAME’] contains the name of the server host under which the current script is executing. This parameter is defined in server config. In your case it starts ‘www.’, so plugin considers that links on site should start with ‘www.’. So, the simplest way to fix the problem, is to change this parameter in server config. Let me know if this solution is not applicable.

    Thread Starter Shnipsel

    (@schnipsel13)

    The configured links all start with ‘www’, as well as SERVER_NAME. But the plug-in removes ‘www’ only on one side and not the other, resulting in a mismatch. I think that’s the primary problem here.

    Changing SERVER_NAME var is non-trivial on many shared or manager hosting environments.

    Plugin Author Vladimir Statsenko

    (@vladimirs)

    I’ll try to release the new version this week. And include bug fix in this release.

    Thread Starter Shnipsel

    (@schnipsel13)

    Great! I’ll have a look and verify the fix. I think it would suffice to remove the www from both strings. There might be rare cases where content on www and non-www sites differs, though. I wouldn’t mind. Perhaps you see other implications.

    Plugin Author Vladimir Statsenko

    (@vladimirs)

    Hi!

    Thank you for the contribution. This features were added in version 3.4.1.

    There is new option – ‘Convert terms in archive descriptions’, witch adds get_the_archive_description filter.

    The shortcode is added too.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Page links to itself’ is closed to new replies.