The site was made a long time ago, then it was reworked, at first everything worked on prototype, then a part was rewritten to jQuery, but the prototype still remained, because some services were rewritten into scrap because of their volume. Now 2 frameworks work together.

Also on the site a lot of different lotions, well, there for scrolling sliders, etc.

The code is so messed up that it’s already terribly awkward to enter the main file, naturally no one remembers what the script is for, initially everything fell onto the main page and almost all js is loaded onto the main page and all the others.

How now to understand which js files are no longer needed, which are not used, so that without harm to the site, because it is possible that the file is used on any one page, but it is loaded into each page. This is terrible, and I would like to restore order + improve the quality of the html template + speed up the page.

  • @trec I once answered a similar question, try search, unfortunately I could not find it quickly (yes, such a pebble in the garden is not palivny :)) - Zowie

2 answers 2

To rewrite or revise the pages, one by one, slowly noting the necessary functions and rewriting them into normal code. And then by the method of elimination, what is left can be demolished. As an option, it’s pretty hard to dig in the code itself, these rakes have already been passed, I forget what I wrote in a month, and find the right one with a comment. If everything is really bad, it is better to start from scratch.

    I do not see any alternative options, except for how to look at code sections and delete unnecessary ones. That is, do everything manually.

    • Well, finding files that are not referenced is not a difficult task. But finding files referenced in <script> is, but the code is not called from there - it is somewhat more difficult. - alexlz