Linux 软件免费装
Banner图

TechnologyWisdom Upload Guard

开发者 technologywisdom
更新时间 2026年8月3日 19:29
WordPress版本: 7.0
版权: GPL-2.0+
版权网址: 版权信息

标签

media library file upload user roles file size upload restrictions

下载

1.0.0

详情介绍:

TechnologyWisdom Upload Guard gives administrators fine-grained control over media uploads in WordPress by enforcing restrictions based on user roles. You can define: Users with multiple roles receive the strictest combined limits. MIME types are validated with WordPress filetype checks (not only the browser-reported type). A dedicated Guest setting applies to visitors who are not logged in (for example file fields on public forms). For Contact Form 7, Upload Guard rules override the form’s filetypes list. Key Features Note: Allowing SVG is optional and risky unless you also use a trusted SVG sanitizer. If you upload a plugin ZIP via Plugins → Add New, that ZIP is blocked unless ZIP is allowed for your admin role in Upload Guard settings.

安装:

  1. Upload the plugin folder to /wp-content/plugins/technologywisdom-upload-guard/
  2. Activate the plugin through the Plugins menu in WordPress
  3. Go to TechnologyWisdom Upload Guard in the admin menu
  4. Enable a role and configure its upload rules
  5. Save changes

屏幕截图:

  • Screenshot 2: Provides helpful guidance and usage instructions for the plugin

常见问题:

Does this affect existing media files?

No. The plugin only validates new uploads.

Does it work with the Media Library and post uploads?

Yes. It hooks into WordPress’s core upload handling and works everywhere uploads are processed.

Does Upload Guard override Contact Form 7 filetypes?

Yes. Upload Guard rules override the form’s filetypes list (e.g. only PNG if that is all you allow here). CF7 may allow broad types such as audio/*|video/*|image/*, but Guest/role rules still apply — so JPG, audio, or video are blocked when only PNG is allowed.

Why does Contact Form 7 say “The uploaded file is too large” when Upload Guard allows 20 MB?

That message comes from Contact Form 7’s own limit: option (default is often 1 MB, e.g. limit:1mb). When Guest/role limits are enabled, Upload Guard overrides that CF7 size limit. A 17 MB file is allowed if Upload Guard Max Size is 20 MB (and PHP upload_max_filesize / post_max_size are high enough).

Do image width/height limits apply to contact forms?

Yes. Max Width / Max Height are checked for Contact Form 7, other form plugins, custom front-end file inputs, and Media Library uploads.

Can I restrict uploads for guests / form file fields?

Yes. Enable the Guest (not logged in) card in settings. Only the file types (and size/dimension limits) you allow there will upload for visitors — for example on contact form file fields. Upload Guard rules override the form’s filetypes list and size limit.

Can I restrict uploads for specific roles only?

Yes. Each role has its own configurable rules. Leave fields empty to apply no restriction.

Why can’t I upload a plugin ZIP from the admin?

If Upload Guard is enabled for your role and ZIP is not in the allowed MIME list, WordPress will block the ZIP. Allow ZIP for the Administrator role (or temporarily disable that role’s limits) before installing plugins via ZIP upload.

What happens if a user uploads a restricted file?

The upload is blocked and a clear error message is shown.

Does it support SVG uploads?

Yes, if SVG is allowed in the role’s MIME settings. SVG can contain scripts — only enable it together with a trusted SVG sanitizer plugin.

更新日志:

1.0.0