Hello Elliott,
if you open your website’s HTML source and search for the “23.js” file, then you’ll notice that the URL is the “/wp-content/plugins/home5/salesmet/public_html/wp-content/themes/sales-insight-theme//wp-content/uploads/custom-css-js/23.js?ver=6.7.1”. This file gives a 404 error.
A little bit further there is another file “22.css” loaded by the Simple Custom CSS & JS plugin with the “/wp-content/uploads/custom-css-js/22.css?v=1975” URL. This is the correct way the plugin loads the files: it has a random string after “?v=”, it is loaded after the WP’s “jquery” files and it is correctly loaded by the browser.
The “23.js” file was definitely added to your website by the Simple Custom CSS & JS plugin, but it is not placed there by the plugin. It is most probably linked directly from the theme’s header file. Therefore it has a wrong URL, a wrong “?ver=” string and it is placed at the wrong place.
More than that, custom code setting is “Linking type: internal”, then it will not even loaded on the website as an external file. Also the “Where in the website: footer” doesn’t fit, as it is actually loaded in the header.
I would also recommend to use the plugin’s free version or the plugin’s pro version, but downloaded from the official website. We cannot debug or help you with a plugin’s pro version that is downloaded from a shady website, which most probably adds a backdoor code in the source.
Next action: try opening the theme’s header.php file and see if the “23.js” file is linked there directly. Alternatively, look for another HTML Custom Code added to the header that would load the “23.js” file directly.
Hi Diana,
First of all, thank you for the response – I am currently using the paid version, and have not illegally downloaded or obtained it so that won’t be causing this issue – sorry for the confusion there, I was testing out different linking and sent the wrong screenshot. However I did change my domain recently and am just now noticing the error about re-activating the license, and have fixed that – that didn’t fix the error unfortunately.
Secondly, I may not have made myself clear – the error persist regardless of if the linking type is internal or external.
Thirdly (and here is where the problem is I suspect) I am linking from the themes functions.php file, but am doing that so I may register it as a script, and pass data using enqueue and localise. If I remove that, I get no error however my data doesn’t pass. My question then becomes, how can I pass my data from functions.php to my various JavaScript files?
I see you’ve already fixed the URL to the “23.js” file.
The Simple Custom CSS & JS doesn’t have the feature to pass data from PHP. One possible solution would be to add an HTML custom code with the following content:
<script id="scripts-js-extra">
var php_vars = {"getUser":null,"richlandsData":[...]};
</script>
<script src="/wp-content/uploads/custom-css-js/23.js?ver=6.7.1" id="scripts-js"></script>
though, that can be used only if the data is static.