Our other plugins










Nothing about this plugin or the content of this plugin or information about this plugin should be regarded as offering legal advice. The only aim of the plugin is to provide a framework which you can easily use to create licenses and assign them to your EDD downloads. You must seek legal advice to ensure your rights are protected adequately.
Software is not sold, it’s licensed. The structure and wording of the license which accompanies any software is important if it is to protect your intellectual property. A full license will usually describe the rights of the licensee, any warranties and any and limitations imposed on the licensee. In addition, a license is often specific to a jurisdiction because it may not be legal to use a clause in one jurisdiction that is legal and enforceable in another.
Easy Digital Downloads only supports ‘Terms & Conditions’. T’s &C’s are important but are only one section of a full software license. EDD may be organized this way because WordPress considers all plugins as derivative works so EDD, like other plugins, is implicitly licensed under GPL v2 just like WordPress.
Also EDD supports only one set of T’s &C’s. This assumes there is one set of terms and conditions that apply to all your products. There is an EDD plug-in which adds the ability to create terms and conditions for each download. The EDD terms and conditions can be used to store a license but this either means using one license for all your products or, if you are using the EDD ‘terms-per-product’ plugin, pasting the text of your license into each download.
With this plugin you are able to define your licenses and assign them to downloads as appropriate.
The plugin is installed the same way as any 3rd party plugin: download the plugin zip from your account after purchase; use the WordPress plugin manager to upload and install the plugin.
The end objective is to assign one of the available product licenses to a download. This screen shot shows how this is accomplished using a drop-down list contained in a meta-box provided by this plugin. The meta-box and its dropdown list will only appear on product license posts.
Each license document is a post, in fact a custom post of type ‘product-license’. The plugin uses standard features of the WordPress administration to present a list of the existing licenses. A button at the end of the list of licenses allows new product licenses to be added.
As with other lists of posts, any available action options are displayed when the mouse moves over a row in the list. In this case the options are to edit the post or delete it.
The Product Licenses list assumes the default WordPress administration styling. For example, this means columns in the list are given an equal share of the available page width. You can change the default styling by adding styles to the style.css of your theme.
Like other WordPress lists the list table is assigned a class – ‘productlicenses’ – and each column has a class of ‘column-$column_name’. In the case of this list the column classes are:
Using this information you are able to affect the styling of the table. For example to change the layout so the ‘summary’ column is able to use more of the available width than the title or category you can put this css in your theme’s style.css:
.productlicense .column-title { width: 210px; } .productlicense .column-summary { } .productlicense .column-category { width: 100px; }
Each license can be assigned to a category. The category options created when the plugin is activated are ‘open source’ and ‘commercial’.
The plugin installs six licenses to get you started:
You should review these licenses yourself and confirm confirm their wording is the same as that on, say, the Open Source Initiative site.
The plugin supports five settings. Each can be accessed and used in a product license post via a set of shortcodes or via functions in themes and templates. In addition there is a setting which allows you to enter your license key so you can receive updates automatically. The settings and related shortcodes are documented below.
License key
This is the license key you receive when you purchase the add-in. Just enter the key then save the settings. If the key is validated, a ‘deactivate’ button will appear alongside the key next time.
Copyright clause
This is the full copyright message you want to appear in the license. For us it might be:
Copyright (c) Lyquidity Solutions Limited 2013 and later years
Shortcode: [copyright]
Company name
This is your full company name. Ours is ‘Lyquidity Solutions Limited’.
Shortcode: [company]
Company tag name
It is common practice that licenses include a ‘preamble’ to define various terms and give them a tag which is used as a shorthand throughout the license. They are much like variables in a program. This setting allows you to define a tag for your company name. Our tag might be ‘LYQUIDITY SOLUTIONS’ or ‘LSL’ but it could equally well be the company name again. If a tag is not supplied the company name will be used.
Shortcode: [company-tag]
Telephone number
The telephone number to include in a license
Shortcode: [telephone]
Registered address
The address to include in a license.
Shortcode: [address]
Using license information in themes and templates
The [license] shortcode allows you to add the title of the license to your post.
This shortcode supports five attributes:
Tag
By default, the license name will be included in a <p> tag but you can change this. Here’s an example:
[license tag=’div’]
Using the ‘tag’ attribute you can arrange to enclose the title in any html tag.
Class
The enclosing html tag is also given a class attribute which defaults to ‘license’. You are able to change this using the shortcode’s ‘class’ attribute.
[license class=’myclass’]
Prefix
By default the license title generated by the shortcode has no prefix but you can change this using the shortcode’s ‘prefix’ attribute.
[license prefix=’myprefix’]
Link
By default, the generated license title is plain text but if the shortcode’s ‘link’ attribute is set to a value that will evaluate to true (such as ‘0’ or ‘yes’) the license title will be embedded in an anchor tag so will be presented as a link to the license post. This way a buyer will be able to read the full text of the license.
[license link=true|1|yes]
Name
By default the title generated by the shortcode will be the title of the license assigned to the post in which it appears or of the default license selected in the EDD settings. However you may want to use the shortcode in some place where there is no active post or because you wish to display a title and link for a license other than the default. If this is the case, the ‘name’ attribute can be used to include the slug of the post of the alternative license.
&91;license name=’eula’]
The plugin supports the following license information functions:
Assuming the plugin is active the license information functions will be available any time after the ‘plugins_loaded’ action. For example, the ‘init’ action. You can test whether the functions are available by checking for anyone of them:
if (!function_exists('\lyquidity\edd_product_licenses\get_company')) return;
Note the use of a namespace ‘\lyquidity\edd_product_licenses\’. The plugin uses a namespace to ensure function and variable names used by the plugin do not clash with names used by any other plugin. This mean you will call a function using it’s fully qualified name or by importing the namespace into any PHP code file that will call these functions:
echo \lyquidity\edd_product_licenses\get_copyright();
or
use lyquidity\edd_product_licenses; // This will appear at the top of the PHP file echo get_copyright();
For example you may want to change your receipt template to include a note of the licenses which apply to each product listed. You would do this using the download id contained in each cart item:
use lyquidity\edd_product_licenses; // This will appear at the top of the PHP file ... // Not a real function. // The $cart variable already exists in the receipt template $cart = edd_get_cart(); foreach($cart as $item) { echo get_license_title_by_download_id($item['id'], true); }
We're here to help you every step of the way. Contact Us by sending a private message or ask a question in the support forums.
We're always looking for ways to improve what we offer and so help you do business. Need something, not exactly what you are looking for … let us know, we might be able to help.
Used by a growing number of websites throughout the world - we help smooth your WordPress site use.
Comments