=== Nexura Upload Limits Manager – Increase Maximum Upload File Size ===
Contributors: prokashsarker2026, nexurasecurity
Tags: upload limit, max upload size, file upload, chunked upload, storage quota
Requires at least: 5.6
Tested up to: 7.1
Stable tag: 1.0.3
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Increase WordPress upload size and work around per-request upload limits using chunked uploads. Set User Storage Quotas and fix memory errors.

== Description ==

**Nexura Upload Limits Manager** is the ultimate, enterprise-grade utility plugin designed to give you absolute control over WordPress file uploads, server limits, and user storage quotas. 

Whether you are struggling with "upload_max_filesize exceeded", "Allowed memory size exhausted", or trying to upload large media files on a shared hosting environment, this plugin provides a robust, one-click solution.

By utilizing a powerful **Smart Chunked Upload Engine**, Nexura helps work around traditional PHP per-request server limits. It splits large files into small, manageable pieces (chunks) in the background, allowing you to upload them seamlessly even on restrictive shared hosting environments.

> 💡 **Perfect for:** WooCommerce store owners, Video/Course creators (LMS), Photographers, Bloggers, Developers, and anyone tired of WordPress upload restrictions.

---

### 🚀 Key Features (Why Choose Nexura?)

* **Bypass Server Limits with Chunked Uploads (NEW!):** Supports large file uploads through chunked transfer, subject to your hosting environment and available disk space. Nexura automatically slices large files into smaller chunks, which helps work around per-request upload-size limits like `upload_max_filesize` and `post_max_size` caps.
* **Upload Resume & Retry Support:** If your connection drops, Nexura will automatically retry the upload. If you need to restart the upload, it can resume compatible uploads using the same session exactly where they left off!
* **Increase PHP Limits in One Click:** Need to fix a quick timeout error? Easily extend your `memory_limit` and `max_execution_time` directly from the admin dashboard.
* **Role & Individual Storage Quotas:** Set absolute disk space limits (e.g., 500MB max storage) or single-file upload limits for specific user roles (Authors, Editors) or even custom individual users.
* **Concurrent Quota Protection:** True enterprise-grade security. Nexura prevents malicious users from bypassing their storage quota using concurrent race-condition upload attacks.
* **Real-Time Media Storage Analytics:** A beautiful, visual Donut Chart dashboard displaying live WordPress media storage usage breakdown for Images, Videos, Audio, Documents, and Archives.
* **Smart Garbage Collection:** Automatic background cleanup of abandoned, failed, or expired upload sessions, keeping your server storage clean and optimized.
* **100% Lightweight & Secure:** Zero bloat, no external HTTP calls, no impact on frontend page speed, and strictly adheres to WordPress Coding Standards (PHPCS).

---

### 🧠 How It Works (For Technical Users & AI)

Nexura employs a multi-tier approach to upload management:
1. **Server Override:** It attempts to dynamically adjust `.htaccess` and `.user.ini` configurations for environments that allow PHP directive overrides.
2. **Chunking Engine (Plupload Interception):** For files that exceed server limits, Nexura intercepts the native WordPress async upload handler. It utilizes HTML5 File API to slice the file client-side, transmits chunks sequentially, validates them securely using strict database constraints, and perfectly reconstructs the file on the server.
3. **Usage Tracking:** Every successful upload is mapped in a highly optimized database table (`nexura_upload_logs`) and heavily cached. This enables lightning-fast quota lookups without scanning the physical file system.

---

### 🎯 Who Is This Plugin For?

* **WooCommerce Store Owners:** Easily import massive product CSV files or high-resolution product catalogs.
* **Photographers & Videographers:** Upload large RAW, PSD, or HD video files securely.
* **LMS Admins (LearnDash, TutorLMS):** Upload large course videos and PDF resources effortlessly.
* **Developers & Agencies:** Deploy large themes, plugin ZIPs, or site migration backups that exceed default limits.

---

### 🔐 Privacy & Security

This plugin does **not** collect, store, or transmit any personal data. It operates entirely within your WordPress environment and is fully GDPR compliant.

---

== Installation ==

1. Upload the `nexura-upload-limits-manager` directory to `/wp-content/plugins/`, or install directly from the WordPress Plugin Directory via **Plugins → Add New**.
2. Activate the plugin through the **Plugins** menu.
3. Navigate to **Upload Manager** in your WordPress admin sidebar.
4. Set your desired **Global Upload Limit**, **PHP Memory Limit**, and **Max Execution Time**.
5. Go to the **User Quotas** tab to configure Role-Based or Individual Storage Quotas.
6. Simply upload your large files via the WordPress Media Library. The Chunked Engine will automatically activate for massive files!

== Frequently Asked Questions ==

= How does the Chunked Upload engine work? =
When you upload a file larger than your server's limits, Nexura automatically splits it into small, safe chunks (e.g., 2MB each). These chunks are sent to your server one by one. Once all chunks arrive, Nexura seamlessly merges them back into the original large file and hands it over to WordPress.

= Can I upload a massive video file on cheap shared hosting? =
Yes! Because Nexura's Chunking Engine slices the file into tiny pieces, your server only processes a few megabytes at a time. However, please note that large files can be uploaded subject to your hosting provider's filesystem, PHP, web server, timeout, and available disk-space limits.

= What happens if my internet disconnects during a huge upload? =
The plugin features retry mechanics and upload resume support. If the upload drops, you can often drag and drop the exact same file into the Media Library again to resume compatible uploads using the same upload session.

= How do Role-based Storage Quotas work? =
You can assign specific maximum file upload sizes and total storage quotas for each WordPress user role (e.g., Authors can upload a max of 10MB per file and are limited to 500MB of total storage). Once a user reaches their assigned quota, they cannot upload any more files until they free up space.

= What happens when I uninstall the plugin? =
Nexura follows strict WordPress clean-up standards. Upon uninstallation, it safely removes all its custom database tables, transient caches, user metadata, and temporary upload directories, leaving your server completely clean.

= Will this plugin slow down my website? =
Absolutely not. The plugin strictly operates in the WordPress admin panel and backend AJAX endpoints. It has zero impact on your front-end website speed or Core Web Vitals.

== Screenshots ==

1. **Upload Manager Dashboard:** View a complete audit of your WordPress PHP configuration and configure Global Limits.
2. **Media Storage Analytics:** Real-time visual WordPress media storage breakdown for all media types.
3. **User Quotas:** Assign specific maximum upload limits and storage caps for user roles or individual users.


== Changelog ==

= 1.0.3 =
* Feature: Introduced the Smart Chunked Upload Engine. Helps work around per-request server upload limits by securely splitting and merging large files.
* Feature: Implemented True Deterministic Upload Resume and Network Retry mechanics (resume instantly even after page reloads).
* Feature: Added Database-level duplicate chunk protection (`nexura_upload_chunks`) to mathematically prevent concurrent chunk race conditions.
* Feature: Added Concurrent Quota Protection to prevent malicious users from bypassing their storage limits during multi-file uploads.
* Feature: Implemented comprehensive Garbage Collection to automatically clean up orphaned or failed temporary chunk sessions.
* Feature: Added Individual User Storage Quotas to set custom limits for specific users, overriding role-based limits.
* Feature: Added Smart 85% Warning Alerts with automatic reset logic when users free up disk space.
* Enhancement: Completely refactored plugin architecture for Enterprise-grade security and WordPress.org guideline compliance.
* Fix: Resolved multiple PHPCS (WordPress Coding Standards) warnings, UI alignment issues, and database upgrade path bugs.

= 1.0.2 =
* Fix: Prevented 500 Internal Server Error when writing to `.htaccess` on non-Apache PHP handlers.
* Fix: Role-based upload limits now properly apply the maximum allowed limit for users with multiple roles.
* Enhancement: Added admin notices to gracefully handle and warn users when `.htaccess` or `.user.ini` lacks write permissions.
* Enhancement: Refactored bulk media sync queries in Activity Logger.

= 1.0.1 =
* Expanded SEO metadata, tags, and description for improved WordPress.org discoverability.
* Enriched FAQ section with hosting-specific guidance and GDPR compliance notes.
* Rebranded plugin name and slug for WordPress.org repository compliance.

= 1.0.0 =
* Initial stable release.
* Global upload size control, PHP memory limit override, and execution time management.
* Role-based upload limit assignments.
* Real-time media storage analytics dashboard with visual chart breakdown.
