Delightful Download Plugin Doku

da das Open Source Delightful Plugin zwar im Quellcode noch auf zu finden ist, aber dort keine liegt, habe ich die mir heruntergeladene Doku mal aufbereitet und stelle sie hier zur Verfügung. Die Doku ist in englischer Sprache und erklärt Shortcodes und Attribute. Ich habe die Möglichkeit und Wildcard, eine Beschreibung zum Download einzugeben, ergänzt, sowie einige Ausgabeformate (box, link) und die Listenausgabe angepasst.

Zum Quellcode auf Github:

Delightful downloads Documentation

General

Can I manually upload files via FTP/SFTP?
Yes, simply upload them to your server anywhere within the WordPress file structure (usually wp-content/uploads/). Once uploaded, you can enter the file URL into the Add New Download screen.

How do I increase the maximum file upload size?

Please refer to this tutorial on how to increase the maximum file size in WordPress.

How do I add additional allowed file types to the file uploader?

Please refer to this tutorial on how to add additional file types to WordPress.

Usage

How do I output a single download link?

Use the shortcode [ddownload id="123"]. Replace the ID with the desired download ID, which can be found in the All Downloads screen.

How do I output a single download file size?

Use the shortcode [[ddownload_size id=“123″]]. Replace the ID with the desired download ID, which can be found in the All Downloads screen.

How do I output the number of times a single file has been downloaded?

Use the shortcode [[ddownload_count id=“123″]]. Replace the ID with the desired download ID, which can be found in the All Downloads screen.

How do I output a list of download links?

Use the shortcode [ddownload_list].

How do I output the number of times all of my files have been download?

Use the shortcode [[ddownload_total_count]].

Troubleshooting

Why when I click a download link does the download count not update?

This is usually caused by being logged in as an admin. Downloads by admin users are not automatically logged, however you can change this behaviour in the Settings screen under the Statistics tab.

If using the [[ddownload_total_count]] shortcode, the count is also cached by default and will only update every few minutes based on the Cache Duration, which is set in the Settings screen under the Advanced tab.

Why do I receive a 403 Forbidden error when I try to access a file directly?

Delightful Downloads automatically blocks direct access to files stored within the wp-content/uploads/delightful-downloads/ directory. To access the file you must use the [ddownload id="123"] shortcode.

Why do my files download with the incorrect file extension?

This is caused when WordPress does not know the file type your are serving to users. Please refer to this tutorial on how to add additional file types to WordPress.

Why do my remote files open directly in the browser?

When serving remote files it is not possible to set the correct headers which force a file to be downloaded, instead the browser will attempt to open them.

Why do my files show a file size of unknown?

This is caused when the file does not exist at the location specified or is inaccessible due to incorrect permissions.

———————————–Shortcodes———————-

[[ddownload_count]]

You can output the number of times a download has been downloaded using the [[ddownload_count]] shortcode. You must supply a download ID and optional attributes can be supplied to further customise the output. To output a download count using the default settings: [[ddownload_count id=“123″]]

You can find the ID of a download in the All Downloads screen.

All Downloads Screen

Attributes

The following are optional attributes that will modify the output.

format

Format the number (10000 becomes 10,000). Default: true.

[[ddownload_count id=“123″ format=“false“]]

————————————–

[[ddownload_filesize]]

You can output the file size of a download using the [[ddownload_filesize]] shortcode. You must supply a download ID and optional attributes can be supplied to further customise the output. To output a file size using the default settings: [[ddownload_filesize id=“123″]]

You can find the ID of a download in the All Downloads screen.

All Downloads Screen

Attributes

The following are optional attributes that will modify the output.

format

Format the number (100000 becomes 97.66 KB). Default: true.

[[ddownload_filesize id=“123″ format=“false“]]

———————————————–

[ddownload_list]

You can output a list of downloads using the [ddownload_list] shortcode. Optional attributes can be supplied to customise the output. To output all published downloads, sorted by title in ascending order: [ddownload_list]

Attributes

The following are optional attributes that will modify the output.

cache

Cache the results. The amount of time the results are cached for can be set in the Settings screen under the Advanced tab. Default: true.

categories

Show only downloads within specified categories. Comma separated list of category slugs. Default: blank.

exclude_categories

Exclude downloads within specified categories. Comma separated list of category slugs. Default: blank.

exclude_tags

Exclude downloads within specified tags. Comma separated list of tag slugs. Default: blank.

limit

Limit the number of downloads to display. Set to 0 to show all results. Default: 0.

order

The order in which results are displayed. Set to either ASC or DESC. Default: ASC.

orderby

The option in which results should be sorted by. The available options are title, date, count (Download count), filesize, random. Default: title.

relation

When using both categories and tags together this attribute specifies the relationship between the two. The options are AND (Must be in all), OR (Must be in at least one). Default: AND.

style

The output style that should be used to display the list of downloads. The default options are title, title_date, title_downloads, title_filesize. Custom list styles can also be added, as detailed here.

tags

Show only downloads within specified tags. Comma separated list of tag slugs. Default: blank.

———————————————————-

[[ddownload_total_count]]

You can output the total number of downloads for all files using the [[ddownload_total_count]] shortcode. Optional attributes can be supplied to further customise the output. To output the total download count with the default settings: [[ddownload_total_count]]

Attributes

The following are optional attributes that will modify the output.

cache

Cache the results. The amount of time the results are cached for can be set in the Settings screen under the Advanced tab. Default: true.

[[ddownload_total_count cache=“false“]]

days

Show the total download count over the last number of days. Set to 0 for all time. Default: 0.

[[ddownload_total_count days=“7″]]

format

Format the number (10000 becomes 10,000). Default: true.

[[ddownload_total_count format=“false“]]

————————————————————

[ddownload]

You can easily output a single download using the [ddownload] shortcode. You must supply a download ID and optional attributes can be supplied to modify the output. To output a download using the default settings: [ddownload id="123"]

You can find the ID of a download in the All Downloads screen.

All Downloads Screen

When no optional attributes are supplied Delightful Downloads will use the default values which can be configured in the Settings screen under the Shortcodes tab.

Settings Screen Shortcodes Tab

Attributes

The following optional attributes will modify the output on a per-download basis.

text

Set the text to display on links/buttons. You may use wildcards to dynamically enter data.

[ddownload id="123" text="Download my File"]

style

Set which output style to use. The default output styles are link, button or plain text. Custom output styles can also be added, as detailed here.

[ddownload id="123" style="link"]

button

Set which button to use if the style attribute is set to button. The default buttons are black, blue, grey, green, purple, red and yellow. Custom buttons can also be added, as detailed here.

[ddownload id="123" style="button" button="red"]

class

Add any custom CSS classes to the output.

[ddownload id="123" class="custom-class button-large"]

Examples

A link output with the file size displayed:

[ddownload id="123" style="link" text="Download (%filesize%)"]

A button output with the download count displayed:

[ddownload id="123" style="button" text="Download (%count%)"]

——————————————————————————-

Wildcards

Wildcards allow you to dynamically enter data associated with a download. The available wildcards are:

%count%

The number of times the download has been downloaded.

%date%

The date the download was published.

%ext%

The file extension.

%filename%

The file name of the download.

%filesize%

The file size of the download.

%id%

The unique identifier of the download.

%mime%

The mime type of the download.

%title%

The title of the download entered in the Add Download screen.

%description%

The ecxerpt of description of the download entered in the Add Download screen

%url%

The URL to the download file.

Where To Use Them

Wildcards can generate dynamic data in the following places:

The text attribute of the [ddownload] shortcode. Examples:

[ddownload text="Download - %date%"] [ddownload text="Download (%filesize%)"] [ddownload text="Download (Downloaded: %count%)"]

The Default Text field in the Settings screen under the Shortcodes tab.

Settings Screen Default Text

When registering custom list styles, as detailed in this how to.

(Post ID:1401, erstellt am: 22.03.2020 10:16:18 von: Patrick Bärenfänger)

Zusammenfassung
  1. If using the [[ddownload_total_count]] shortcode, the count is also cached by default and will only update every few minutes based on the Cache Duration, which is set in the Settings screen under the Advanced tab.
  2. To output a download count using the default settings: [[ddownload_count id="123"]] You can find the ID of a download in the All Downloads screen.
  3. To output a download using the default settings: [[ddownload id="123"]] You can find the ID of a download in the All Downloads screen.
Verwandte Beiträge
Über den Autor:
Patrick Bärenfänger ist Ihr Experte für IT-Sicherheit und IT-Systeme mit TÜV-Zertifizierungen als IT-Security Manager und -Auditor und über 33 Jahren IT-Erfahrung. Er bietet Ihnen professionelle Dienstleistungen in den Bereichen: Ausbildung und Zertifizierung von Systemkoordinierenden, Infrastruktur-Analyse und -Optimierung zur Azure-Cloud-Migration, IT-Systemprüfungen und Notfallplan/Risiko-Analyse nach anerkannten Standards BSI-Grundschutz und IDW PS330 und Anwendung der künstlichen Intelligenz in der Praxis.

Kommentare

Schreiben Sie einen Kommentar

Ihre E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert