Automattic / newspack-custom-content-migrator

Custom migration tasks for launching and migrating Newspack sites on Atomic
5 stars 5 forks source link

Feat/lsv find and replace missing images #439

Closed eddiesshop closed 2 months ago

eddiesshop commented 8 months ago

This migrator for LSV relied on a pre-populated list of URLs and relative file paths which were found in their post content. Using the filenames from the relative file paths, the migrator attempts to find the file in the local media repository (wp-content/uploads, as well as some media archives provided by LSV).

In order to shave some execution time, I created a reusable function in Attachments.php that indexes and caches the local media library. I think this might be useful going forward, so I'd like the team to review this and provided feedback.