PHPackages                             gbc/wn-mediafilerenamer-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. gbc/wn-mediafilerenamer-plugin

ActiveWinter-plugin[Image &amp; Media](/categories/media)

gbc/wn-mediafilerenamer-plugin
==============================

Media File Renamer plugin that sanitizes uploaded media names

v1.0.1(1y ago)041MITPHP

Since Aug 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/GregoryBrownConsultancy/wn-mediafilerenamer-plugin)[ Packagist](https://packagist.org/packages/gbc/wn-mediafilerenamer-plugin)[ RSS](/packages/gbc-wn-mediafilerenamer-plugin/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Media Files Renamer
===================

[](#media-files-renamer)

This plugin addresses an issue that has long bothered me.

When your user uploads a file to the media manager, the filename remains as is, assuming that the user will be aware of best practices when naming files.

The plugin sanitizes the name of the file before saving it in the Media Manager.

Motivation
----------

[](#motivation)

I develop sites for several types of users based on Winter. Most of my users are fairly well versed in the digital world, but, I have recently seen a large number of clients who are completely unaware of certain *best practices* when it comes to naming files.

This has been cause of several minor issues in some of my older projects, as clients upload files with spaces, upper and lower case files and the works. This inevitably leads to issues in some browsers and expected system behaviour.

As a way to mitigate this, I started implementing this functionality inside my projects, and as it became more commonly used, I decided to extract it as a plugin, and this is how this project was born.

What to expect
--------------

[](#what-to-expect)

When a user uploads a file like: `My picture with Sally.jpg` this plugin will basically sanitze the name to `my-picture-with-sally.jpg` making the file more accessible to browsers, and as a added bonus, more SEO oriented.

The plugin also has a smart feature which is, if the sanitized file already exists, it will append a `--N` to it, where `N` is a number index.

For example: If the user uploads the following files, sequentially:

1. `My picture with Sally.jpg`
2. `My Picture With Sally.jpg`
3. `my picture with sally.jpg`

which in a \*nix based system would be three distinct files, the plugin will convert the first file to:

1. `my-picture-with-sally.jpg`

When it tries to convert the second file, since the slugged name already exists, it will append a `--1` to it:

2. `my-picture-with-sally--1.jpg`

Finally, when trying to save the third file, it will also slug it to `my-picture-with-sally.jpg`, which already exists, append a `--1` and try again, which also already exists, and finally settle on

3. `my-picture-with-sally--2.jpg`

CAVEATS AND WARNINGS
--------------------

[](#caveats-and-warnings)

### This plugin works only in the media manager

[](#this-plugin-works-only-in-the-media-manager)

This plugin is designed to work with the media manager only. If you are uploading files directly to the system, this plugin will not fix your problem.

### This plugin works only with the UPLOAD media event

[](#this-plugin-works-only-with-the-upload-media-event)

This plugin treats only uploads. Already existing files will not be renamed and renaming a file will not trigger this plugin check. (I might in the future, implement such a feature, but for now, this is well within my needs).

### This plugin works only on files

[](#this-plugin-works-only-on-files)

If a user creates a folder that is not **web friendly**, this plugin will not correct the folder name. It will only correct the media file.

Again, I might in the future implement such a feature, but I have not needed such a thing.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

679d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/190893?v=4)[Gregory Brown](/maintainers/bugzbrown)[@bugzbrown](https://github.com/bugzbrown)

---

Top Contributors

[![bugzbrown](https://avatars.githubusercontent.com/u/190893?v=4)](https://github.com/bugzbrown "bugzbrown (3 commits)")

---

Tags

pluginmediaseosanitizewinterwintercms

### Embed Badge

![Health badge](/badges/gbc-wn-mediafilerenamer-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/gbc-wn-mediafilerenamer-plugin/health.svg)](https://phpackages.com/packages/gbc-wn-mediafilerenamer-plugin)
```

###  Alternatives

[wp-sync-db/wp-sync-db-media-files

WP Sync DB Media File Addon for WP Sync DB

536151.8k](/packages/wp-sync-db-wp-sync-db-media-files)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[webplusm/gallery-json-media

a filament media storing in a Json field

197.8k](/packages/webplusm-gallery-json-media)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
