SSL Labs ScoreSecurityHeaders.io Score

Log in to participate

There is no cost to join RicheyWeb, and membership is a requirement to submit bug reports and participate in the support forums.

× Extension Discussions

is scripts down regex not working right???

More
7 months 4 weeks ago - 7 months 4 weeks ago #863 by lip420
lip420 created the topic: is scripts down regex not working right???
unless i am confused it doesn't make sense. it says if set to YES only the items below will be moved. my 2 items below won't move unless i set it to NO. yes/no doesn't seem to make a difference other than being an on/off button it doesn't matter if i change the url's...

and what exactly is the proper way to enter a url via regex pattern? googled it but no clear answer.

i have a review extension that is on one page that is not working with scripts down enabled.

these are the files from the source:
<script src="/components/com_jlexreview/assets/jquery.min.js" type="text/javascript"></script>
<script src="http://www.mysite.com/components/com_jlexreview/assets/jlexreview.min.js?v=3.5.5" type="text/javascript"></script>
<script src="/components/com_jlexreview/assets/script.js?t=3.6.1" type="text/javascript"></script>
<script src="/media/jui/js/jquery.min.js?dc44d5cb9c79e51318ff2c0c2cdd569c" type="text/javascript"></script>
Last Edit: 7 months 4 weeks ago by lip420.

Please Log in or Create an account to join the conversation.

More
7 months 4 weeks ago #864 by michael
michael replied the topic: is scripts down regex not working right???
Any particular reason you're loading jquery twice? Nevermind - I don't want to know....

Regex is pretty well documented everywhere.

My extension looks at ONLY the src attribute when matching a regex pattern. If the pattern matches any part of the src attribute - it's a match and subject to being moved (or not moved)

The simplest way to define an item is by just putting in the path and escaping the necessary characters, which are usually only "/" and "." (forward slash and dot)

So, using your first jquery.min.js line as an example - to prevent (or force) it to be moved:

\/component\/com_jlexreview\/assets\/jquery\.min\.js

Every forward slash is escaped, and every period is escaped.

It's not necessary to match the whole line though.

You could match both jquery.min.js scripts with:

jquery\.min\.js

To escape everything loaded by and from your component:

com_jlexreview

that would match the first 3 scripts because they all contain com_jlexreview

Regex is super powerful. Spend some time on this site if you want to learn more:

regexone.com/

Please Log in or Create an account to join the conversation.

More
7 months 4 weeks ago #865 by michael
michael replied the topic: is scripts down regex not working right???
Also - ScriptsDown isn't for everyone. Some sites and extensions are not written in a way that lends itself to having scripts at the bottom of the page.

It takes a lot of care and feeding to really benefit from ScriptsDown. I rarely use it on my own sites, because it takes so much maintenance if you're using 3rd party extensions.

Please Log in or Create an account to join the conversation.

More
7 months 4 weeks ago - 7 months 4 weeks ago #867 by lip420
lip420 replied the topic: is scripts down regex not working right???
Thanks! I have no idea why it is loaded twice. I have gone back and forth between trying to change that component and this one to make it work. Yours is a lot simpler.
Last Edit: 7 months 4 weeks ago by lip420.

Please Log in or Create an account to join the conversation.

More
7 months 4 weeks ago #868 by michael
michael replied the topic: is scripts down regex not working right???
Well...it's being loaded twice because com_jlexreview doesn't load the Joomla version of jQuery, it loads its own. It's a bad omen when an extension loads a separate version of a library provided by the core.

Please Log in or Create an account to join the conversation.

More
7 months 4 weeks ago #870 by lip420
lip420 replied the topic: is scripts down regex not working right???
O.k. thanks. The more I worked on that extension the more I began to think some things weren't right with it. Lots of css and js files. I ran into problems and then tried to reinstall it with the original package, but that didn't work. Developer who stopped replying to my inquires after a year ran out wouldn't help and says I need to buy a new license.

Again that was for what I already paid for not a new package. That was Jlex review. I don't recommend it. Do you have any experience with other review extensions?

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to add attachements.
  • Not Allowed: to edit your message.
Kunena Forum