[WordPress] 外掛分享: Media File Limiter

首頁外掛目錄 › Media File Limiter
全新外掛
安裝啟用
尚無評分
158 天前
最後更新
問題解決
WordPress 6.8+ PHP 7.4+ v1.0 上架:2025-11-04

內容簡介

**總結:** Media File Limiter 是一個輕量且高效的外掛程式,旨在增強您的 WordPress 上傳安全性。它限制最大上傳文件大小(以MB為單位),並阻止特定危險的文件擴展名(例如 .exe、.php、.html、.js),從而防止惡意或過大的文件被上傳到您的媒體庫中。此外,它能夠在上傳過程的最早階段通過 wp_handle_upload_prefilter 鉤子操作,確保在 WordPress 處理之前就阻止危險文件。

- Media File Limiter 是用來幫助強化 WordPress 上傳安全性的輕量且高效的外掛程式。
- 可以限制最大上傳文件大小(以MB為單位),並且阻止特定危險文件擴展名的上傳,以避免惡意或過大文件進入您的媒體庫。
- 這款外掛程式與傳統文件驗證不同,它在上傳過程的最早階段通過 wp_handle_upload_prefilter 鉤子操作,確保危險文件在 WordPress 處理之前被阻止。
- 主要特點:
- 設定自訂的最大上傳文件大小(以MB為單位)。
- 定義禁止的文件擴展名(以逗號分隔)。
- 顯示當前 PHP/WordPress 上傳限制作為參考。
- 早期階段的安全執行 — 在文件到達媒體處理之前。
- 完全可翻譯並具有國際化支持(使用 media-file-limiter 文本域)。
- 兼容多站點環境。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Media File Limiter」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Media File Limiter is a lightweight and efficient plugin designed to strengthen your WordPress upload security.
It limits the maximum upload file size (in MB) and blocks specific dangerous file extensions (e.g., .exe, .php, .html, .js), preventing malicious or oversized files from being uploaded to your media library.
Unlike traditional file validation, this plugin operates at the earliest possible stage of the upload process via the wp_handle_upload_prefilter hook, ensuring that dangerous files are blocked before WordPress processes them.
Key Features
Set a custom maximum upload size (in MB).
Define forbidden file extensions (comma-separated).
Displays current PHP/WordPress upload limits for reference.
Early-stage security enforcement — before files reach media processing.
Fully translatable and internationalized (media-file-limiter text domain).
Compatible with multisite environments.
Why This Plugin?
WordPress allows large files and executable extensions under certain misconfigurations, which can lead to:
Server performance degradation.
Potential remote code execution (RCE) risks.
Media library clutter and upload errors.
Media File Limiter addresses these issues with a simple, configurable interface under the WordPress “Settings → Media Limit” page.
License
This plugin is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or any later version.
This plugin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Additional Notes
The plugin follows WordPress Coding Standards (WPCS).
All options use the Settings API (register_setting / add_settings_field).
Security first: early execution priority (wp_handle_upload_prefilter, priority 1).
Uninstall hook (register_uninstall_hook) ensures full cleanup.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon