If the “Also aggregate inline JS?” option in Autoptimize is enabled, then the inline JS will be pulled into the autoptimize JS file linked at the end of the HTML page.
But your example code consists of two parts: a link to a JS file, which will not be pulled into the aggregated autoptimize JS file, and then an inline JS, which will be written in the aggregate autoptimized JS file.
Hi.
Is there a way for your inline file to appear before the “</body>” tag?
Yes, you need to set “Footer” for the “Where on page” option from the right menu.
I tried placing under “Footer” but inline Js still appears before the JS file of “Autoptimize plugin”.
It seems impossible to give it behind the JS file of “Autoptimize plugin”
There is no way to set the order of the JS code in relationship to other JS from other plugins. This is simply how WordPress works. A plugin can set only the order of a JS file/code only in relationship to other JS files/codes from the same plugin.
ok, I have another question, how long is the “Pro” version updated?
From the FAQ page: “With every purchase you also get support and updates for 1 year. After that you can use the plugin as long as you want, but won’t get updates and support. Before the license expires you can renew it with a 40% discount. ”
Note that with the pro version the inline JS code in the footer will still be before the Autoptimize aggregate JS file, just like with the free version.