WP Manifestindependent plugin directory
manifest / media / pdf-manager

PDF Manager

A lightweight WordPress admin plugin for managing PDF documents through a centralized folder-based interface.

by Shahid Ajmeri · github.com/shahidajmeri2214/pdf-manager

1stars
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/shahidajmeri2214/pdf-manager/archive/refs/heads/main.zip

Readme

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:

  1. Create root folders.
  2. Select a folder from the folder tree.
  3. Create subfolders inside the selected folder.
  4. Upload PDF files.
  5. View PDFs stored inside the selected folder.
  6. Copy the public URL of a PDF.
  7. Rename folders or PDFs.
  8. Replace existing PDF files.
  9. Delete individual PDFs.
  10. Delete complete folders and their contents.

Installation

Method 1 — Upload Plugin ZIP

  1. Download or create the plugin ZIP package.
  2. Log in to WordPress Admin.
  3. Go to:
Plugins → Add New → Upload Plugin
  1. Upload the plugin ZIP.
  2. Install the plugin.
  3. 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_files capability
  • 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_filesize and post_max_size values 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
  • .pdf extension
  • 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.

Read the full README on GitHub →