PHPackages                             devuri/wp-filename-hasher - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. devuri/wp-filename-hasher

ActiveWordpress-plugin[File &amp; Storage](/categories/file-storage)

devuri/wp-filename-hasher
=========================

Automatically renames uploaded files/images in WordPress to a unique hashed filename.

v0.1.6(1y ago)17[2 PRs](https://github.com/devuri/wp-filename-hasher/pulls)GPL-2.0-onlyPHPPHP ^7.3 || ^7.4 || ^8.0 || ^8.1CI passing

Since Jul 21Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/devuri/wp-filename-hasher)[ Packagist](https://packagist.org/packages/devuri/wp-filename-hasher)[ RSS](/packages/devuri-wp-filename-hasher/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (8)Versions (11)Used By (0)

File Name Hasher Plugin
=======================

[](#file-name-hasher-plugin)

Description
-----------

[](#description)

The `File Name Hasher` plugin automatically renames uploaded files (images and PDFs) in WordPress to unique, hashed filenames. This helps to avoid conflicts with existing filenames and enhances security by generating unpredictable names for uploaded files.

Features
--------

[](#features)

- Automatically renames uploaded images and PDFs to hashed filenames.
- Ensures unique filenames for each uploaded file.
- Enhances security by making filenames unpredictable.
- Only hashes specific file types (images and PDFs), leaving other file types with their original names.

Installation
------------

[](#installation)

1. Download the `File Name Hasher` plugin.
2. Extract the plugin files to the `wp-content/plugins/` directory of your WordPress installation.
3. Activate the plugin through the 'Plugins' menu in WordPress.

Usage
-----

[](#usage)

Once activated, the plugin will automatically rename any image or PDF uploaded through the WordPress media uploader. No further configuration is required.

How It Works
------------

[](#how-it-works)

1. **Initialization**: The plugin hooks into the `wp_handle_upload_prefilter` filter during its construction.
2. **File Type Check**: When a file is uploaded, the plugin checks the file's extension to see if it matches one of the allowed file types (images and PDFs).
3. **Renaming Process**: If the file type is allowed:
    - The plugin generates a unique ID using `random_bytes`.
    - The unique ID is hashed using the SHA-256 algorithm.
    - The hashed ID is combined with the original file extension to create the new filename.
    - The original filename is replaced with the new hashed filename.
4. **File Upload**: The file is uploaded with the new hashed filename.
5. **Tracking Hashed Files**: The plugin keeps track of all hashed filenames during the current session, allowing you to check if a file has already been renamed.

Example
-------

[](#example)

An image uploaded with the original name `example.jpg` might be renamed to something like `3d4b2f4c8d9e1a6b2f3a123456789abc123456789abc123456789abc12345678.jpg`.

License
-------

[](#license)

This plugin is open-source and licensed under the [GPL-2.0-or-later](https://www.gnu.org/licenses/gpl-2.0.html) license.

Support
-------

[](#support)

For any issues or feature requests, please open an issue on the plugin's [GitHub repository](https://github.com/your-repo/filename-hasher).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance58

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% 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

Every ~7 days

Total

6

Last Release

628d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8fd19f958b007ec6588d0a5ca2fe78e107edd652f286b836d36b5d1781d573a5?d=identicon)[devuri](/maintainers/devuri)

---

Top Contributors

[![devuri](https://avatars.githubusercontent.com/u/4777400?v=4)](https://github.com/devuri "devuri (48 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

wordpresswordpress-pluginwpwp-plugin

###  Code Quality

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/devuri-wp-filename-hasher/health.svg)

```
[![Health](https://phpackages.com/badges/devuri-wp-filename-hasher/health.svg)](https://phpackages.com/packages/devuri-wp-filename-hasher)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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