Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Squatch Media Sync

A very simple WordPress plugin that searches through files in a specified wp-content/uploads folder and adds them to the Media Library if they do not already exist.

How It Works

  • Allows the user to select a top-level directory inside wp-content/uploads.
  • Scans the selected directory recursively, including any subdirectories.
  • Creates a temporary JSON cache containing the files found during the initial scan.
  • Processes the cached files in batches of 10 to reduce the likelihood of server timeouts during Media Library processing.
  • Adds files that are not already present in the Media Library.
  • Checks for both the original file and its WordPress-generated -scaled version before creating a new attachment.
  • Displays live progress and logging output while syncing.
  • Skips files that are already in the Media Library.
  • Skips WordPress-generated image sizes such as -300x300 or -1280x968.
  • Skips WordPress-generated -scaled files.
  • Images added to the Media Library will generate the additional image sizes defined by WordPress, the active theme, or installed plugins.

Supported File Types

The plugin works with file types supported by WordPress attachments.

Examples include:

  • Images (jpg, jpeg, png, gif, webp)
  • Documents (pdf, doc, docx)
  • Other media files that WordPress allows in the Media Library

Notes

  • The plugin does not modify or move files in the uploads directory.
  • The initial directory scan creates a JSON cache in the plugin's cache directory for batch processing.
  • Media Library processing is performed in batches of 10 files.
  • Existing Media Library attachments are skipped.
  • WordPress-generated image sizes and -scaled versions are skipped to prevent duplicate attachments.
  • It is recommended to create a backup before running a large sync.
  • This plugin is intended for administrative use and requires appropriate WordPress administrator permissions.

This is not an actively supported plugin. Use at your own risk.

About

A very simple Wordpress plugin that will search through any files in the specified wp-content/uploads/ folder and add them to the media library.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages