WordPress plugin intelligence profile

CodeCaste Media and Safe SVG File Upload Rules

Set upload size limits, block file types, and safely allow SVG uploads. Works with the Media Library, file managers and other plugins.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 7.1
Current version1.0.0
WordPress coverageTested up to WordPress 7.1
Minimum stackWP 6.0 · PHP 7.4
Directory statusactive
Last directory update3 Nov 20269h ago
Active installationsNewAdoption metric — not a quality score
WordPress.org ratingNo WordPress.org ratings yet
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records CodeCaste Media and Safe SVG File Upload Rules version 1.0.0 as active, updated 9h ago and tested up to WordPress 7.1.

Overview

About this plugin

CodeCaste Media and Safe SVG File Upload Rules lets you decide which files can be uploaded to your site and how big they can be. You set the rules once, and they are applied everywhere files can come in.

What you can do

  • Set one size limit for all files. For example, nothing larger than 5 MB.
  • Give a file type its own limit. For example, 2 MB for PNG, 50 MB for MP4 and 10 MB for PDF.
  • Block a file type completely. Any file with that extension is refused, whatever its size.
  • Allow SVG files safely. WordPress blocks SVG by default because SVG files can hide harmful code. Turn SVG on and the plugin cleans every SVG before it is saved.
  • Clear error messages. When a file is refused, the person uploading sees the reason, such as the file being too large or its type being blocked.

Where the rules apply

The same rules are used for:

  • The Media Library and the “Add Media” button
  • The WordPress REST API ( /wp/v2/media )
  • Files added by importers and other code
  • File manager plugins such as WP File Manager
  • Other plugins that accept uploads in their own way, such as form builders and page builders

This means a file cannot slip past your limits just because it was uploaded through a different plugin. If you prefer not to check other plugins, you can turn that part off in the settings.

Why you might want this

  • Stop very large files from filling up your hosting space.
  • Stop team members or visitors from uploading file types you do not want.
  • Use SVG logos and icons without opening your site to attacks.
  • Keep all upload rules in one place instead of one setting per plugin.

Light and simple

No extra database tables and no background tasks. Settings are stored in the normal WordPress options.

Getting started

Set the default limit

Open Media upload restrictions, go to the General tab, choose a maximum file size and click Save settings. This limit applies to every file type that has no rule of its own.

Add a rule for one file type

  • Open the Extension rules tab.
  • Under Add extension rule, pick the file type (for example pdf ).
  • Enter its maximum size, or switch on Block this extension to refuse it completely.
  • Click Add rule.

You can edit, switch off or delete a rule at any time from the Configured rules list.

Allow SVG files

On the Extension rules tab, switch on Allow SVG uploads and choose a maximum SVG size. Every SVG is cleaned before it is saved. SVG stays off until you turn it on.

For developers

Other plugins and themes can use the same rules.

Functions

  • gupc_evaluate_upload( array $file, string $route = 'custom_adapter' ) checks a file and returns a result object with the reason and message.
  • gupc_is_upload_allowed( array $file, string $route = 'custom_adapter' ) returns true or false.
  • gupc_get_effective_limit( string $extension ) returns the size limit in bytes for a file type (0 means blocked).

Always check that the function exists first, for example if ( function_exists( 'gupc_is_upload_allowed' ) ).

Hooks

  • gupc_pre_evaluate_decision (filter): replace a decision before the rules run.
  • gupc_upload_evaluated (action): runs after every decision, for logging.
  • gupc_register_adapters (action): register your own upload adapter that implements GlobalUploadPolicyController\Adapters\Upload_Adapter_Interface.
  • gupc_skip_request_guard (filter): skip the check for a request from another plugin.
  • gupc_request_guard_skip_fields (filter): list upload field names the check should ignore.
  • gupc_file_manager_ajax_actions (filter): add the AJAX action name of another file manager.
WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • file size
  • media
  • security
  • svg
  • upload
Compatibility & maintenance

Compatibility & maintenance

Tested with WP 7.1

Marked as tested with the current WordPress 7.1 release.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to7.1
Minimum requirementsWordPress 6.0 · PHP 7.4
Update activity3 Nov 20269h ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.