Identifying redundant JS files

Is there any way of identifying redundant js files other than via a plugin? It would be useful if the migration script gave the option to remove these files.

2 Likes

If you have shell access you can migrate and then find files older than one day…
find . -type f -mtime +1
and optionally delete them
find . -type f -mtime +1 -exec rm -f {} \;

Only in wp-includes and wp-admin :grinning:

1 Like

Thanks, Simone, but I don’t have shell access - all sites on shared hosting.

I was hoping that the CP developers might look into removing redundant WP files at the time the migration script runs.

Unfortunately someone has seen fit to move my post from the original thread so I’ve lost context… (this practice makes the forums harder to follow)

1 Like

Hey @robf,

I think the split of the thread made sense as it highlights it for us to see it so and it doesn’t get lost in the other thread. I will add this as an issue on Github and we can hopefully take a look at.

1 Like

Yes, separate issues should have separate threads.

This post should have been split out of the original thread also, or quoted, in order to preserve the context:

We have done this in the past, the list of files to remove is actually in ClassicPress core as part of the “upgrade” routine. Sounds like the list needs to be updated and we can get the updated list using Shield Security.

2 Likes

Indeed. I replied directly to @anon95694377 's post in the original thread before my reply was moved so saw no need to quote it… If I’d started a new thread myself I would have quoted it. I’m pretty familiar with forums having run several previously both on the internet and BBS’s as a SysOp on Fidonet and other networks back in the 90s

That’s great, thanks @james and @wadestriebel

I’m not using Shield myself as it would almost certainly conflict with my preferred security plugin, BPSpro, so catching rogue files at the time of migration would be ideal.

Would it be possible to build this functionality into the upgrade script (for new CP versions rather than just upgrade from WP) too?

1 Like

Yes, this will “just work” because upgrades and migrations use the same code path.

We are due for another release of ClassicPress soon with some minor fixes and this will be a good thing to include.

7 Likes

Moved to a GitHub issue for the upcoming v1.1.0 release:

If someone can post a list of the new files to remove on that issue, that would be helpful. I am closing this thread and we can continue discussion there.

2 Likes