Linux 软件免费装
Banner图

Kodlo Media Manager

开发者 kodlo
imaginary222
更新时间 2026年7月20日 21:24
捐献地址: 去捐款
PHP版本: 8.1 及以上
WordPress版本: 7.0
版权: GPL-2.0+
版权网址: 版权信息

标签

media library file upload image sizes svg filename

下载

1.7.9 1.8.6 1.8.4 1.8.5 1.7.4 1.7.5 1.7.6 1.7.8 1.8.0 1.8.1 1.8.2 1.8.3 1.7.7

详情介绍:

Turn your Media Library requirements into clear, consistent upload rules. Kodlo Media Manager adds a focused rules builder to Settings -> Media. Define which formats WordPress may accept, where each format is allowed, how large an upload may be, which image dimensions are acceptable, and how filenames should be formatted. The plugin validates uploads on the server and provides early feedback in the standard WordPress media uploader. It uses native WordPress, PHP, and browser APIs and includes no third-party libraries or external services. Why Use Kodlo Media Manager? Upload Rules Each rule combines a file extension and MIME type with one of three policies: An administrator can also set a per-format maximum file size and, for raster images, maximum width and height. Dangerous executable and active-content formats remain unavailable even if they are submitted through malformed settings data. Filename and Duplicate Controls The filename validator accepts a bounded regular-expression subset shared by PHP and JavaScript. Unsupported, malformed, or excessive patterns fall back to the plugin's safe default. Optional auto-sanitization can reshape filenames for compatible positive character-class patterns before validation; safe validation-only patterns remain available without automatic rewriting. Duplicate Guard compares exact normalized basenames rather than image contents. Every distinct filename is checked directly against Media Library attachment metadata. Short-lived hashed upload locks prevent two plugin-managed requests from claiming the same available filename at the same time, without building a filename index or custom database table. SVG Handling The internal SVG sanitizer accepts a limited set of SVG elements and attributes, removes unsupported content, rejects document types and entities, and permits only safe internal fragment references. It also applies a fixed payload ceiling before DOM parsing. SVG content must use the canonical .svg extension and image/svg+xml MIME pair. SVG sanitization is a focused upload safeguard. It does not replace appropriate WordPress capabilities, server hardening, backups, or review of untrusted content. Media Uploader Experience The browser-side guard mirrors format, filename, size, dimension, and duplicate checks to provide feedback before an upload begins. Asynchronous dimension probes and duplicate lookups share one validation barrier, use bounded batches, concurrency, and timeouts, and finish before a paused queue resumes. Invalid or unavailable duplicate responses stop affected files and explain the failure. Server-side validation remains authoritative for native uploads and sideload-based REST uploads. Warning dialogs use native button semantics, labelled dialog markup, Escape handling, managed keyboard focus, and focus restoration. Settings controls include accessible names and predictable focus movement when rules are added or removed. Default Configuration The initial rules allow ZIP globally so WordPress can upload plugin and theme packages. SVG, WebP, AVIF, MP4, WebM, PDF, DOCX, and WOFF2 start in Media Library contexts with format-specific limits, while JPG, JPEG, and PNG start blocked. These defaults are a starting point, not a universal recommendation; review them for your site's editorial workflow and hosting limits. By default, verified uploads initiated by an administrator from WordPress General Settings bypass format, filename, duplicate, size, and dimension policies so core settings such as the site icon are not unexpectedly blocked. SVG files are still sanitized. Enable General Settings Page Uploads to apply the configured policies there as well.

安装:

  1. Upload the kodlo-media-manager directory to /wp-content/plugins/, or install the plugin through the WordPress Plugins screen.
  2. Activate Kodlo Media Manager.
  3. Go to Settings -> Media.
  4. Review every default rule and adjust the policies, limits, filename pattern, and Duplicate Guard setting for your site.
  5. Test the intended administrator and contributor upload workflows before applying the rules to a production editorial team.

屏幕截图:

  • Early validation feedback in the standard WordPress media uploader.

常见问题:

Does the plugin optimize or convert uploaded files?

No. It validates configured formats, sizes, dimensions, filenames, duplicate names, and SVG content. It does not compress images, convert JPG or PNG files to WebP or AVIF, or remove unused media.

Why are JPG, JPEG, and PNG blocked by default?

The initial profile encourages a WebP or AVIF workflow. It is only a starting point. Change the applicable rule to Allowed (Media Library Only) or Allowed (Globally) if your project uses JPG, JPEG, or PNG.

Why is ZIP allowed globally by default?

WordPress handles administrator-uploaded plugin and theme ZIP packages outside the Media Library. Allowing ZIP globally keeps those native installation workflows available, while WordPress's own capability and package validation still apply. Change the rule only if your site has a different package-upload policy and you have tested the affected administration screens.

What does a maximum size of zero mean?

Zero or a blank value disables the plugin's per-format size limit for that rule. WordPress, PHP, the web server, and the hosting provider may still impose their own limits.

What is the difference between the three upload policies?

Allowed (Media Library Only) requires a verified Media Library context. Allowed (Globally) also permits the configured format in other WordPress upload contexts. Blocked (Globally) rejects the format throughout WordPress upload handling.

How does Duplicate Guard work?

It blocks exact normalized filename matches, not visually similar images or identical file contents with different names. Each distinct name is queried directly against Media Library attachment metadata. A short-lived hashed lock closes the race between lookup and storage for plugin-managed uploads. If WordPress cannot verify a name, the upload is stopped conservatively and can be retried.

Does Duplicate Guard create a filename index or change attachment data?

No. Each filename is checked directly against existing _wp_attached_file metadata. The plugin does not rewrite attachment content, add attachment metadata, or maintain a custom filename table. Concurrent plugin-managed uploads use short-lived hashed option locks that do not contain the original filename.

How does the SVG sanitizer work?

Canonical .svg uploads are parsed locally with PHP's DOM extension. The sanitizer uses element and attribute allowlists, accepts only safe internal fragment references, and rejects document types, entities, external URLs, foreign namespaces, event handlers, and other unsupported active content. Files above the fixed parser ceiling are rejected before DOM parsing.

Can I use a custom filename pattern?

Yes. Patterns must be anchored and remain within the bounded subset that the plugin can evaluate consistently in PHP and JavaScript. Groups, alternation, backreferences, engine-specific escapes, excessive lengths, invalid quantifiers, and malformed expressions are rejected in favor of the default pattern.

How does filename auto-sanitization work?

When enabled for a compatible positive character-class pattern, the plugin mirrors the active WordPress locale's accent conversions in the media uploader, transliterates supported Cyrillic characters, chooses a separator that fits the pattern, normalizes letter case when practical, and removes unsupported characters. The server applies WordPress filename sanitization once and validates WordPress's final unique filename again before storage. Patterns with required literals, negated classes, or other constructs that cannot be generated deterministically remain validation-only and automatically disable rewriting.

How are image dimensions and WordPress big-image scaling handled?

When a rule defines width or height limits, the plugin verifies the uploaded raster image dimensions. For active rules, it also adjusts WordPress's big-image threshold to reflect the configured bounds while preserving a threshold that another component has explicitly disabled.

Does the plugin affect frontend performance?

The plugin does not enqueue assets on public frontend pages. Upload validation runs only in relevant administrator or upload contexts. Duplicate Guard uses direct per-filename Media Library queries and deliberately rechecks an available name after locking and before movement, so its upload-time cost depends on upload volume, Media Library size, and database performance.

更新日志:

1.8.6 1.8.5 1.8.4