0

I work for a small company that isn't flexible in making changes on using a heavy themed webpage on Wordpress for their own reasons. They are also using a load of plugins, and it takes more than 10 seconds to load. So, I thought I should give it a try and check the generated homepage source code, after I ran the analysis that tells me that js is just a disaster. The theme they had chosen was Unero, because it works with woocommerce I suppose. The website is a small e-shop along with a blog, nothing too fancy really, we use yoast SEO too, but that might be irrelevant. I realized that there is a load of js scripts running here and there. I read that you can set everything run with async set true.

A also read that this can cause things to break between scripts, due to undefined variables and other problems I suppose. Please note that I am kinda new to js technologies and I might not know what I really should be asking, or searching for. I do my best to explain what I need to happen though.

  1. Is there a way you can override ( or overload, what is the term here?)some js on footer, after being defined on their positon (in HEAD and in BODY),setting it to async mode, by using a snippet on footer? Will this actually work?
  2. I do not want to involve any plugin general solutions, because I am afraid they will break stuff as mentioned above. Correct me if I am wrong and please suggest me something. Except if the solution IS to make a custom plugin, where I will have full control I guess.
  3. I am open on ANY suggestions, as long as it won't break the site.

I am asking here and not on Wordpress Developement or any other Stack Exchange forum, because I am looking for a solution done by hand, along with an explaination why it will work. I am a code by hand guy really, and I am not afraid to dive deeper on something, if things are gonna be done right.

21
  • Not certain what the issue is. What are you trying to achieve? Commented Feb 10, 2019 at 16:50
  • Better loading times for homepage to achieve better SEO scores, without breaking anything. Commented Feb 10, 2019 at 16:55
  • 1
    Again, how is "SEO" objectively measured? How will you know when "SEO" is "better"? That would be the first item to clearly define. Else, how can any metrics be objectively evaluated? If you are using service X to determine "SEO" that is a single definition. If service X, service Y, and your own estimation of load times of the page is used, that all should be clear. Commented Feb 10, 2019 at 17:12
  • 1
    Why do individuals visit the site? What is the first activity that a user performs when visiting the site? Why is jQuery necessary? Commented Feb 10, 2019 at 17:45
  • 1
    The simplest approach would be to create a basic HTML document which describes why the site exists. While the user is consuming that information the e-commerce portion of the site can be loaded and linked to at the main HTML document. If jQuery is not necessary, do not use jQuery. Commented Feb 10, 2019 at 17:49

1 Answer 1

1

Is there a way you can override ( or overload, what is the term here?)some js on footer, after being defined on their positon (in HEAD and in BODY),setting it to async mode, by using a snippet on footer? Will this actually work?

Answer: Yes, its possible but that could also happen with sync code. If plugin A is doing something like $('title').text('Title from A') and then the next plugin does $('title').text('Title from B')then its gonna get overridden, doesn't matter if its sync or async.

I do not want to involve any plugin general solutions, because I am afraid they will break stuff as mentioned above. Correct me if I am wrong and please suggest me something.

Answer: I am not sure what you want to do. What is your goal with this site? Do you want to untangle the mess of the plugins? That can be difficult since you have little control over the plugins and their mechanismm.

I am open on ANY suggestions, as long as it won't break the site.

Answer: One way would be to disable them one by one to see cause and effect and try to clean out that way. Another solution would to switch to more simple solution like Shopify and the third to creaate a custom solution that you have more control over.

Its quite an open question, so its kinda of hard to give a concrete answer or solution to your problem.

Sign up to request clarification or add additional context in comments.

1 Comment

I see.Very unfortunate really, not for me, but for the company. They will have to change their point of view on changing theme or WAIT for me to study a few things and actually go for a custom solution, a custom plugin maybe, to fix the mess. I mean I am embarrassed enough to waste tech experts time on asking how to approach a problem that can in fact be solved by changing a few stuff here and there and set things up from scratch on just an SSL and some credentials.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.