I’ve been asked to bring an OtoberCMS site into WordPress so that the client can self-maintain going forward. I know. WP is not the most efficient, but the client is able to maintain it much easier.
The images are in a nested directory and many have duplicate names (ie thumb__700_400_0_0_crop.jpg).
As an example, a sampling of current directories look like:
- public_html
- storage
- app
- media
- file001.pdf
- file002.pdf
- file003.pdf
- partner-images
- file001.png
- file002.png
- file003.png
- site-images
- file001.png
- file002.png
- file003.png
- Team Member Photos
- file001.png
- file002.png
- file003.png
- cropped-images
- file001-100-352-1412-GABELDEEGOOK.png
- file002-127-495-1320-GABELDEEGOOK.png
- file003-201-376-2253-GABELDEEGOOK.png
- temp-image
- file001.png
- Videos
- file001.mp4
- file002.mp4
- uploads
- public
- 0a0
– e22- bc6
- thumb__200_200_0_0_crop.jpg
- thumb__400_400_0_0_crop.jpg
- 0ba
– 578- e83
- thumb__500_276_0_0_crop.png
- 2e0
– c2b- 661
- thumb__700_0_0_0_auto.jpg
- thumb__1920_1080_0_0_crop.jpg
– f8d
-7b0 - thumb__200_200_0_0_crop.png
- thumb__400_400_0_0_crop.png
- 4be
– 0da- e37
- thumb__500_276_0_0_crop.jpg
There are nearly 100 folders (plus subfolders) in the ./app/uploads/public/ directory and 480+ folders in the ./storage/temp/public/ directory. I found a way to flatten the directory, but I’d like to be able to keep them from being overwritten, perhaps by using the file structure to create a unique name (ie 0a0-e22-bc6-thumb__200_200_0_0_crop.jpg). I may never use any of these thumbs, but I don’t want to lose them in case one becomes important.
In addition to this nested issue, the original images used to create all the thumbnails look to be in:
- public_html/themes/theme_name/assets/
– img
– filename001.png
– filename002.png
– etc
– pdfs
– filename004.pdf
– filename005.pdf
– videos
– filename005.mp4
– filename006.mp4
Frustratingly, not every video or pdf from the ./storage/app/media/ or ./storage/app/uploads/ directories has a match in this assets folder, so I can’t trust that there aren’t images, pdfs, or videos that I’ll need from the ../storage/app/media/ directories. I want to keep the current names of the originals, but I may never need the thumbs from the app/media/ or app/uploads/.
Is there another way for me to approach this that would be smarter? Or should I flatten-around-and-figure-it-out?
Thanks!
Looking for insight as to whether I’ve picked a good approach.
Chadwick Self is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.