WordPress Plugins

Media Download Links – Docs & FAQs

Plugin Name: Media File Download Link Generator Version: 1.0 Author: WEBSKR License: GPL2 Copyright: (C) 2025 WEBSKR. Unauthorized modification of author or metadata is prohibited.

Overview

This plugin adds a “Copy Download Link” button to each file in the WordPress Media Library. Clicking the button copies a direct download link (e.g., https://your-site.com/mdl-download/123/). Pasting the link in a browser triggers a file download.

Documentation

1. Installation

Follow these steps to install and activate the plugin:

  1. Download the plugin ZIP file from the authorized source.

  2. In your WordPress admin, go to Plugins > Add New > Upload Plugin.

  3. Upload the ZIP file and click “Install Now”.

  4. Activate the plugin from the Plugins page.

  5. Go to Settings > Permalinks and click “Save Changes” to enable the download endpoint.

Screenshot 2025 04 21 141950

2. Usage

The plugin adds a “Copy Download Link” button to the Media Library in two views:

  • List View: Find the button in the “Copy Download Link” column.

  • Grid View: Click a file to see the button in the attachment details.

Steps:

  1. Go to Media > Library.

  2. Select any File or Image.
  3. Click “Copy Download Link” for a file.

  4. The button turns green and shows “Link Copied!”.

  5. Paste the link (e.g., https://your-site.com/mdl-download/123/) in a browser to download the file.

Screenshot 2025 04 21 142058
Screenshot 2025 04 21 142721

3. Customization

Modify the plugin’s appearance or behavior:

  • Button Style: Edit css/mdl-admin-styles.css in the plugin folder.

  • Copy Feedback: Change the “Link Copied!” message in js/mdl-admin-scripts.js.

  • Download URL: Modify the /mdl-download/ endpoint in the mdl_add_rewrite_rules() function.

Note: Modifying the plugin may trigger an integrity warning. Contact the author for authorized changes.

4. Troubleshooting

Resolve common issues:

  • Activation Error: Check file permissions (755 for wp-content/plugins/media-download-links/). Enable WP_DEBUG in wp-config.php and check wp-content/debug.log.

  • Copy Button Not Working: Open the browser console (F12 > Console) and look for “MDL:” errors. Ensure your site uses HTTPS. Deactivate other media plugins to test.

  • Download Not Starting: Verify the URL format (e.g., /mdl-download/123/). Re-save Permalinks. Check the Network tab (F12 > Network) for headers like “Content-Disposition: attachment”. Ensure the file exists (e.g., wp-content/uploads/2025/04/file.png).

Frequently Asked Questions (FAQs)

Why doesn’t the copy button work?

This may be due to browser restrictions or plugin conflicts. Ensure your site uses HTTPS, as the clipboard API requires it. Check the console (F12 > Console) for errors like “MDL: Clipboard API failed”. Deactivate other media plugins (e.g., WP Media Folder) to test.

Why doesn’t the download start when I paste the link?

The URL must be in the format https://your-site.com/mdl-download/123/. If it doesn’t download, re-save Permalinks (Settings > Permalinks). Check if the file exists (e.g., wp-content/uploads/2025/04/file.png). Security plugins or CDNs (e.g., Cloudflare) may block the /mdl-download/ endpoint; configure them to allow it.

Can I change the author or metadata?

No. The plugin is licensed under GPL2, and unauthorized modification of author or metadata is prohibited. Changes will trigger an integrity warning in the WordPress admin. Contact the author for authorized modifications.

How do I share the plugin safely?

Share the plugin ZIP via secure channels (e.g., encrypted email, private download link). Warn recipients against modifying the author or code, as per the license terms. The plugin includes a hash check to detect unauthorized changes.

What file types are supported?

The plugin supports all media files in the Media Library, including images (PNG, JPG), PDFs, videos (MP4), audio (MP3), and ZIP files.

Support

For issues not covered here, contact the author via the plugin’s official support channel. Provide:

  • WordPress and PHP versions.

  • Console or Network tab errors (F12).

  • List of active plugins and theme.

  • Error logs from wp-content/debug.log.

Support URI: [Contact Us]