Support » Fixing WordPress » Letters being added to end of plugin JS/CSS files

  • Resolved robhsc

    (@robhsc)


    Hi,

    I’m having a really unusual problem with a multisite I have setup. It is setup using a subdomain installation and everything seems to be working correctly on all sites, apart from any stylesheets, scripts or images from plugins are getting a letter added onto the end of the domain name. For example:

    <link rel="dns-prefetch" href="//domain.co.uks">

    <link rel="stylesheet" id="contact-form-7-css" href="http://domain.co.uks?ver=4.9" type="text/css" media="all">

    <img src="http://domain.comg" />

    I’ve had a look into the SiteURL and home URL and all seems OK.

    Could anyone help?

    Thanks

    Rob

    • This topic was modified 3 years, 4 months ago by robhsc.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi Rob,

    Those letters after the .uks are the version numbers that at automatically added by WordPress. It is done for cache busting so the latest files are automatically being loaded and not an older version of your CSS or JS. The instructions to remove the version numbers be found on here.

    https://www.codementor.io/tips/8369241717/remove-version-number-from-css-js-in-wordpress-theme

    Thread Starter robhsc

    (@robhsc)

    Hi Rich,

    Thanks for the quick reply.

    I actually meant the letters before the version number, so in the domain TLD. In the above example it should be using .com and .co.uk. Also as you can see it’s actually stripped out the actual files names of the CSS and JS files, leaving just the domain and version.

    Thanks

    Rob

    Hi Rob,

    I can’t seem to recreate the error in Chrome. All of the images I checked seemed to be working as expected. Are you using a domain mapping plugin? What does the enqueue script look like for Contact Form 7?

    -Rich

    Thread Starter robhsc

    (@robhsc)

    Hi Rich,

    I’ve just checked in Chrome and I’m still getting the following output:

    <link rel='stylesheet' id='contact-form-7-css' href='http://sporf.socialchaindev.co.uks?ver=4.9' type='text/css' media='all' />

    <script type='text/javascript' src='http://sporf.socialchaindev.co.uks?ver=4.9'></script>

    I don’t think it’s specifically related to Contact Form 7 as when I log in to admin most of the other plugins aren’t being displayed or working correctly. I think they are missing CSS and JS files.

    However the enqueue script is in this file: https://github.com/wp-plugins/contact-form-7/blob/master/includes/controller.php

    I am using https://wordpress.org/plugins/wordpress-mu-domain-mapping/ for the domain mapping. I have a feeling it’s something to do with this.

    Thanks

    Rob

    Thread Starter robhsc

    (@robhsc)

    I’ve managed to fix this now.

    I’ve switched off the domain mapping plugin and used the native mapping feature which was included from WP 4.5+.

    I’ve also had to set the Site Address (URL), the Siteurl and the Home to the mapped domain name. Previously I had it on the subdomain from the primary site.

    Thanks

    Rob

    Hi Rob,

    I am glad you were able to fix it. On the multisites that I am using domain mapping I have used the WPMU Domain mapping and it works fairly well, but that is a paid plugin.

    -Rich

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Letters being added to end of plugin JS/CSS files’ is closed to new replies.