• Resolved sugapablo

    (@sugapablo)


    I have a wordpress website that’s adding two URLs to the admin side’s <head> that I can’t locate. In the list of <script> tags, it’s adding an “s” at the end of the domain like this:

    <script type="text/javascript" src="https://domain.tlds?ver=1.7"></script>
    <script type="text/javascript" src="https://domain.tlds?ver=1.7"></script>
    

    That should be “domain.tld” but these two lines are adding an s and then ?ver=1.7

    This is slowing down page loads on the admin side as the domain “domain.tlds” is looked for but not found.

    I have searched the entire file structure and a full database dump and cannot located the string “domain.tlds” anywhere. Something is obviously concatenating “domain.tld” and “s?ver=1.7” somewhere, but I cannot determine where.

    I’ve looked at all plugins and themes and have found not that are version 1.7.

    Where is the code that actually generated the <script> tags in the admin side? What could it be misreading?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    Any active plugin or theme could be adding content to the head section. The string you are searching for could be dynamically composed in PHP. Without knowing the variable names used, such code can be very difficult to find. A process of elimination will at least tell you the offending plugin or theme.

    Deactivate all plugins and switch your theme to twentynineteen. The offending script tags should be gone. You may need to flush your browser cache as well. Restore your normal theme, then your plugins, one at a time. Check for the reappearance of the script tags after each. When they reappear, the last activated module is the cause. You might study its source code to locate the offending PHP code, or ask the module’s developer for assistance.

    Thread Starter sugapablo

    (@sugapablo)

    @bcworkz Is there a filter that could be placed between the plugins and the head section to check for the string and replace it?

    Moderator bcworkz

    (@bcworkz)

    In a way, but not really. WP fires several actions in the head section and plugins can hook onto these to generate output. Once the plugin’s callback is called by the action hook, output goes straight to the browser. There is normally no filter between callback and browser, though a plugin dev could have provided one if they saw fit. To manage plugin output without a dev supplied filter, you need to know what action was hooked and what callback was added with what priority. With that information, the output can be prevented by removing the callback from the action list. To learn the needed information, you need to locate the plugin code that adds the callback in the first place.

    Thread Starter sugapablo

    (@sugapablo)

    OK. You pretty much confirmed what I had concluded so, thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Bad domain name generated on admin side.’ is closed to new replies.