WP Manifestindependent plugin directory
manifest / media / increase-upload-php-limits

Increase Upload PHP Limits

Role-based media upload limits with flexible PHP resource controls.

by ridhwanahsann · github.com/ridhwanahsan/increase-upload-php-limits · website

★ 0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/ridhwanahsan/increase-upload-php-limits/archive/refs/heads/main.zip

Role-based media upload limits with flexible PHP resource controls and a clean, WordPress‑native UI.

Highlights

  • Role‑based upload caps for Administrators, Editors, Authors, and others
  • Runtime PHP limits via ini_set() where available
  • Optional .htaccess writer (opt‑in) for hosts that block runtime overrides
  • Manual code generator for .htaccess and .user.ini
  • Live server status with the effective WordPress upload limit
  • Dashboard widget to quickly view current limits
  • Context‑aware recommendations for WooCommerce/Elementor sites

Requirements

  • WordPress 5.8+
  • PHP 7.4+

Installation

  1. Upload the increase-upload-php-limits folder to /wp-content/plugins/
  2. Activate via Plugins in the WordPress admin
  3. Go to “MediaBoost Settings” to configure limits

Quick Start

  1. Open “Increase Upload PHP Limits Settings”
  2. Set “Max Upload File Size” (presets: 64, 128, 228, 512, 1024, 2048 MB)
  3. Set “Max Post Size” to be equal to or larger than “Max Upload File Size”
  4. Save Changes
  5. If the Media screen still shows a lower limit, enable “Two‑in‑One Solution” to auto‑write .htaccess, or use the Manual Code Generator to apply snippets manually

How It Works

  • MediaBoost adjusts PHP limits at runtime using ini_set() during admin_init. Not all hosts allow this.
  • If runtime changes are blocked, enable the optional .htaccess writer (Apache/mod_php) or copy the generated .htaccess/.user.ini snippets to your server.
  • The upload banner in Media uses the minimum of upload_max_filesize and post_max_size. Ensure both are raised.
  • A role‑based filter enforces upload caps; for Administrators, the cap now follows the UI value. For Editors/Authors, caps apply but never exceed the UI limit.

Settings Overview

  • Max Upload File Size: Controls per‑file limits in MB
  • Max Post Size: Controls the total request size; must be ≥ upload size
  • PHP Memory Limit: Memory available per request
  • Max Execution Time: Script timeout in seconds
  • Max Input Time: Input parsing timeout in seconds
  • Max Input Vars: Maximum input variables accepted
  • Two‑in‑One Solution: Opt‑in .htaccess auto‑write if runtime is blocked
  • Opt‑in Usage Tracking: Anonymous usage data to help improve the plugin

Manual Code Generator

On the settings page, you’ll find:

  • .htaccess rules for Apache/mod_php
  • .user.ini rules for PHP‑FPM/FastCGI For Nginx, also set client_max_body_size in your Nginx configuration.

Troubleshooting

  • The Media screen still shows 128 MB
    • Set both “Max Upload File Size” and “Max Post Size” higher
    • Enable “Two‑in‑One Solution” or copy .htaccess/.user.ini snippets
    • On Nginx, configure client_max_body_size
  • Settings saved but values don’t change
    • Your host likely enforces hard caps; use server‑level config via the manual snippets or contact hosting support

Security & Best Practices

  • Settings are sanitized and clamped to safe ranges
  • Capability and nonce checks on settings save
  • Uses WordPress Filesystem API for controlled writes
  • No eval, shell exec, or direct DB queries

Compatibility

  • Recommends stronger defaults when WooCommerce or Elementor is active
  • Works on standard WordPress admin flows without custom post types or editors

Development

  • Text domain: mediaboost
  • Translations are loaded on plugins_loaded
  • Main plugin file: mediaboost.php

FAQ

Does this edit server files?
Only if you enable the optional .htaccess auto‑write. Otherwise, it uses runtime configuration and provides manual snippets.

Is this safe for shared hosting?
Yes. All inputs are sanitized, access is limited to administrators, and server writes are opt‑in.

License

GPL‑2.0‑or‑later