PCIO VIS Media Files

By Niels Olsen

0+ active installationsVersion 1.0.0

Inventory of media files used on the site and in PCIO VIS Member Event, with a scanner, external-link warnings and an unused-uploads cleaner.

Description

PCIO VIS Media Files is an extension for PCIO VIS Member Event. It adds a Vis → Media Files screen with three lists:

Used media

  • Scan site walks published pages, posts and public custom post types and records local media URLs found in content, inline styles, srcset attributes and featured images.
  • The site logo and site icon are included.
  • External media links are not added to the list; they are recorded as warnings in the scan log.
  • Rows can be added, edited and deleted by hand.

Vis events & documents

  • Lists every WordPress attachment referenced by the Vis events table (image_id, thumb_image_id) and the documents table (wp_attachment_id), with a link to each attachment.

Unused uploads

  • Lists Media Library attachments and orphan files in the uploads folder that neither of the first two lists references.
  • Paginated (250 files per page); Select all selects only the files on the current page.
  • Move to Used media records the selected files in the used inventory (so they leave this list and appear under Used media).
  • Select files and delete them permanently. Attachments are removed with wp_delete_attachment() (including generated sizes); orphan files are removed from disk.
  • Both actions re-validate the selection against a fresh scan; all paths are confined to the uploads folder.

Scan log

  • Shows scan results newest first. External media links and other issues are highlighted as warnings/errors.

Installation

  1. Upload the pcio-vis-media-files directory to /wp-content/plugins/.
  2. Activate the plugin in Plugins. PCIO VIS Member Event must be active.
  3. Open Vis → Media Files.

The plugin creates two tables (me_media_files, me_media_scan_log). The screen uses the core Vis settings capability (vis_manage_settings), the same capability that gates the other Vis settings pages.

FAQ

Does scanning delete anything?

No. Scanning only rebuilds the inventory and the scan log. Deleting files is a separate, explicit action in the Unused uploads list.

Why is a file I know is in use listed as unused?

The scan reads published site content and the Vis tables. Media referenced only by theme settings, widgets, custom CSS or third-party plugin data may not be discovered. Review the list before deleting; the selection is re-checked against a fresh scan.

Are external images downloaded?

No. External media links are only reported in the scan log as warnings.

Screenshots

Changelog

1.0.0

  • Initial release: site media scan, used-media CRUD, Vis events/documents media list, unused uploads cleaner and scan log.