EnlighterJS / Plugin.WordPress

:package: Official WordPress Plugin of EnlighterJS
http://wordpress.org/plugins/enlighter/
GNU General Public License v2.0
118 stars 17 forks source link

Resource Has to be Manually Loaded in Footer #252

Closed jrg94 closed 4 years ago

jrg94 commented 4 years ago

Love the plugin! I've been using it for a couple years now. I just switched my theme, and I'm running into an issue where the JS resource isn't loading in:

(index):1222 Error: EnlighterJS resources not loaded yet!
(anonymous) @ (index):1222
(anonymous) @ (index):1222

I have since added the call to the local script in the footer of my theme. Obviously, this isn't sustainable unless I make a child theme. Would love to get this sorted out if possible!

Also, double loading the script does slow my site down a hair:

GTMetrix Site Performance

I have since replaced the URL in the footer, so they're consistent:

<script type="text/javascript" src="/wp-content/plugins/enlighter/resources/enlighterjs/enlighterjs.min.js?ver=4.1"></script>

Here's my site: https://therenegadecoder.com

AndiDittrich commented 4 years ago

please disable your "optimization plugin" which adds the async defer attributes .... (please read the mdn docs about this attributes and what they are doing )

jrg94 commented 4 years ago

Hmm, I'm not running any optimization plugins as far as I know (besides ShortPixel):

List of Plugins

I'm wondering if my new theme does this natively.

AndiDittrich commented 4 years ago

disable one-by-one to find it

btw. maybe this functionality is added by your WordPress Theme

jrg94 commented 4 years ago

Yup, it's the theme itself. I had my suspicions since I've removed significantly more plugins than I've added after switching the theme. Any tips for how to deal with this beyond what I already did?

AndiDittrich commented 4 years ago

normally, pre-build/public availabke themes are offering options to control these settings - if not you should ask the theme authors for assistance

jrg94 commented 4 years ago

Sounds great! Thanks for your help.