can you share your sites URL @deejmer so I can have a look?
OK, you seem to have something active that removes the domain from the enqueued script/ styles URL’s, e.g.;
<script type='text/javascript' src='/wp-content/themes/kbmax/js/popper.min.js?ver=5.2.2'></script>
Can you disable that functionality (plugin?) to see if that changes anything?
Interesting, I don’t have any plugin doing that. I have relative URIs set in the functions.php file to these assets. Are they supposed to be written in here differently? With absolute URLs? Thanks for your quick replies!
well, can you try outputting absolute URL’s (including domain) to see if that changes things indeed?
It seemed to just pull the file in the same way, just with an absolute URL. I circled the one that I changed.
I don’t know, but this doesn’t seem to be the issue? Am I following best practices for including these scripts, and Autoptimize should just see them and aggregate them? I don’t understand what about my installation is different (if anything) than what you’d suggest.
I don’t know, but this doesn’t seem to be the issue?
not sure; the CDN might be getting in the way here. what URL do you see when CDN is off?
Oops, I made a mistake. The Absolute URL I set wasn’t correct. The path wasn’t valid. When I set it to the correct path, the CDN picked it up (domain changed from kbmaxweb4.azurewebsites.net to kbmaxweb4.azureedge.net. So it seemed to help the CDN find it. I changed another value, and now I have two getting called from the CDN. Now the only issue is, it is not getting aggregated along with the other css/js that autoptimize seems to see.
it is not getting aggregated along with the other css/js that autoptimize seems to see.
and what happens when CDN is off or if you set the CDN in AO?
I disabled the WP Super Cache plugin which was integrated with the CDN. I then removed the CDN domain path from AO. I now get no aggregation at all, and no CDN urls. I do see an error deep on the page (line 551) reading: `/* <![CDATA[ */
var autoptimize_ajax_object = {“ajaxurl”:”https:\/\/kbmaxweb4.azurewebsites.net\/wp-admin\/admin-ajax.php”,”error_msg”:”Your Autoptimize cache might not have been purged successfully, please check on the <a href=\”https:\/\/kbmaxweb4.azurewebsites.net\/wp-admin\/options-general.php?page=autoptimize style=\”white-space:nowrap;\”\”>Autoptimize settings page<\/a>.”,”dismiss_msg”:”Dismiss this notice.”,”nonce”:”39608abebf”};
/* ]]> */`
I have clicked Save Changes and Empty Cache but this message remains.
-
This reply was modified 5 years, 9 months ago by
deejmer.
that’s not an error, but an error-message that is shown if the cache purge (in the top menu) fails 🙂
that being said; I still have no idea what is going wrong there I’m afraid. could be a plugin conflict of some kind, so maybe try disabling plugins (and/ or briefly switch themes) to see if you can identify a potential culprit that way?
I can try playing with plugins. Can you confirm though, that scripts and CSS files brought in via the method I’m using in functions.php SHOULD be detected and aggregated by AO? You don’t see anything obvious that I’m doing wrong in this regard? Should work?
I’ve turned off every plugin except Advanced Custom Fields PRO (I fear teh website will stop working if I do). I still have Autoptimize enabled. It still aggregates, but only a couple of JS files. Once again, none of my explicit includes for JS or CSS. Sadface.
Last idea – Any chance that hosting WordPress on IIS/Azure would have any impact?