Or you do the right thing re-write or refactor, apply the latest practice add some tests to it. This way you won’t have a black box anymore. Who knows there might be a hidden bug there that might be a huge security issue and could bite you back in the future.
JS is basically the Hydra from the Greek Mythology.
Though PHP is literally the problem had me lol.