PDF Manager
A lightweight WordPress admin plugin for managing PDF documents through a centralized folder-based interface.
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/shahidajmeri2214/pdf-manager/archive/refs/heads/main.zipReadme
PDF Manager
A lightweight WordPress admin plugin for managing PDF documents through a centralized folder-based interface.
PDF Manager allows WordPress administrators to organize PDF files into folders and subfolders, upload new documents, replace existing PDFs, rename files, delete documents, and quickly copy public PDF URLs.
Features
- 📁 Create root folders
- 📂 Create nested subfolders
- 🌳 Hierarchical folder tree navigation
- 📄 Upload PDF documents
- 🔄 Replace existing PDF files
- ✏️ Rename folders
- ✏️ Rename PDF files
- 🗑️ Delete individual PDFs
- 🗑️ Delete folders recursively
- 🔗 Copy PDF URLs directly from the admin interface
- 📊 Display PDF file size and modification information
- 🔐 WordPress capability and nonce validation
- 📦 Supports PDF uploads up to 200 MB
- 📱 Responsive admin interface
- ⚡ Lightweight implementation without third-party JavaScript libraries
How It Works
The plugin creates a dedicated PDF storage directory inside the WordPress uploads directory:
/wp-content/uploads/pdfs/
You can organize documents using any folder structure required by the project.
Example:
pdfs/
├── oncology/
│ ├── product-guides/
│ │ ├── product-guide.pdf
│ │ └── prescribing-information.pdf
│ │
│ └── patient-resources/
│ └── patient-brochure.pdf
│
├── cardiology/
│ ├── clinical-data/
│ │ └── clinical-data.pdf
│ │
│ └── resources/
│ └── patient-resource.pdf
The resulting PDF URLs follow the WordPress uploads URL structure:
https://example.com/wp-content/uploads/pdfs/oncology/product-guides/product-guide.pdf
Admin Interface
After activating the plugin, a new PDF Manager menu appears in the WordPress administration area.
From the PDF Manager screen, users can:
- Create root folders.
- Select a folder from the folder tree.
- Create subfolders inside the selected folder.
- Upload PDF files.
- View PDFs stored inside the selected folder.
- Copy the public URL of a PDF.
- Rename folders or PDFs.
- Replace existing PDF files.
- Delete individual PDFs.
- Delete complete folders and their contents.
Installation
Method 1 — Upload Plugin ZIP
- Download or create the plugin ZIP package.
- Log in to WordPress Admin.
- Go to:
Plugins → Add New → Upload Plugin
- Upload the plugin ZIP.
- Install the plugin.
- Activate PDF Manager.
Method 2 — Manual Installation
Copy the plugin directory into:
wp-content/plugins/
The structure should look like:
wp-content/
└── plugins/
└── -pdf-manager/
├── -pdf-manager.php
└── assets/
├── pdf-manager.css
└── pdf-manager.js
Then activate the plugin from:
WordPress Admin → Plugins
Requirements
- WordPress
- PHP 7.4+
- WordPress user with the
upload_filescapability - Server configuration that supports PDF uploads
- PHP/server upload limits configured to allow files up to 200 MB
The plugin enforces a maximum PDF size of 200 MB internally. Your server's
upload_max_filesizeandpost_max_sizevalues must also permit the requested upload size.
File Structure
-pdf-manager/
├── -pdf-manager.php
└── assets/
├── pdf-manager.css
└── pdf-manager.js
-pdf-manager.php
Contains the main plugin functionality, including:
- WordPress admin menu registration
- Folder management
- PDF management
- Upload validation
- File operations
- URL generation
- Permission checks
- Nonce validation
- Admin interface rendering
assets/pdf-manager.css
Contains the styling for:
- Folder tree
- PDF management interface
- Upload controls
- Action forms
- Responsive layouts
- Folder navigation
- File tables
assets/pdf-manager.js
Provides client-side functionality for:
- Folder tree expansion/collapse
- Automatic root-folder selection
- Copy-to-clipboard functionality
- Copy button feedback
PDF Validation
The plugin only accepts valid PDF files.
During upload, it validates:
- File upload status
- File size
.pdfextension- PDF MIME type
- WordPress file type validation
The maximum allowed file size is:
200 MB
Invalid files are rejected before being moved into the managed PDF directory.
Security
The plugin includes several WordPress security mechanisms:
Capability Checks
Administrative actions require the WordPress:
upload_files
capability.
Nonce Verification
Folder and file operations use WordPress nonce verification through:
check_admin_referer()
Filename Sanitization
Uploaded and renamed filenames are sanitized using WordPress filename sanitization functions.
Path Sanitization
Folder paths are normalized and sanitized before being used for filesystem operations.
PDF Type Validation
Uploads are validated against the expected PDF MIME type rather than relying only on the file extension.
Supported Operations
| Operation | Supported |
|---|---|
| Create root folder | ✅ |
| Create subfolder | ✅ |
| Rename folder | ✅ |
| Delete folder | ✅ |
| Recursive folder deletion | ✅ |
| Upload PDF | ✅ |
| Replace PDF | ✅ |
| Rename PDF | ✅ |
| Delete PDF | ✅ |
| Copy PDF URL | ✅ |
| Nested folders | ✅ |
| PDF size display | ✅ |
| File modification date | ✅ |
Storage Approach
Unlike plugins that store files through the WordPress Media Library, PDF Manager uses a dedicated filesystem directory:
wp-content/uploads/pdfs/
This makes the plugin useful for projects where PDFs need to be maintained in a predictable folder structure and accessed through stable public URLs.
The plugin does not create WordPress Media Library attachments for managed PDFs.
Permissions
Access to the PDF Manager is controlled using the WordPress upload_files capability.
This means the plugin follows the existing WordPress user-role capability system rather than introducing a separate authentication mechanism.
For production environments, review which user roles have the upload_files capability before granting access to the PDF Manager.
URL Handling
PDF URLs are generated from the WordPress uploads directory and the managed folder structure.
Folder and filename components are URL encoded when generating the public URL.
Example:
/wp-content/uploads/pdfs/
becomes:
https://example.com/wp-content/uploads/pdfs/
Use Cases
PDF Manager is particularly useful for:
- Corporate websites
- Healthcare websites
- Pharmaceutical websites
- Product documentation
- Patient resources
- Product brochures
- Prescribing information
- Clinical documents
- Regulatory documents
- Marketing collateral
- Downloadable resources
- Large collections of structured PDF documents
Development
The plugin is intentionally lightweight and uses native WordPress APIs and PHP filesystem functions.
There are no external JavaScript dependencies.
Main technologies:
- PHP
- WordPress APIs
- WordPress Admin APIs
- WordPress Filesystem/File APIs
- JavaScript
- CSS
Version
Current Version: 1.0.0
Author
BioPharma
License
Add the appropriate license for your project before publishing this repository publicly.
For example:
MIT License
or the license applicable to your organization/project.
Disclaimer
This plugin is designed for controlled PDF document management within WordPress. Before deploying it to production, verify server upload limits, filesystem permissions, user capabilities, backups, and access requirements for the documents being managed.