How to use S3Media Linksafe – Lite

Best follow the tabs below in the order of appearance for a smooth process. If you never setup your AWS bucket/distribution before, please read this pdf first: Setup-private-download-aws-console

Install like any other plugin on WordPress:

  1. Go to Plugins > Add New
  2. Select Upload
  3. Click the Browse button and locate the zip you downloaded.
  4. Click Install Now.
  5. After installation, click Activate plugin.

After install, you find the link to S3Media LinkSafe Lite on the lefthand pane in your admin panel of WordPress:

This will be used to set the Access keys and default options before you use the Link Wizard in the text editor of your posts/pages.

Back to the tabs >>

Click the S3Media LinkSafe Lite link in the lefthand pane of your admin panel to set your AWS keys and default settings. Here everything is filled in already, but we show you step by step how to do this:

All fields have a convenient hint button that gives a short explanation how to fill in the field correctly:

In the the first part of the options, you need to fill in the Access keys and Keypairs (the latter only if you plan to download distributions):

Getting the Access Keys

After you sign up for AWS, you must create access keys for the account. You can retrieve the access key ID from the Security Credentials page, but you cannot retrieve the secret access key. If the secret access key is lost or forgotten, you need to create new access keys. Go to the Security Credentials page and sign in:

aws-security-credentials

Use your login and password to login. A new page opens with a popup box:

Continue AWS security credentials

Select Continue to Security Credentials.

In the Access Keys section, click Create New Access Key:

Create AWS access keys
When you have done that, save the Access Keys by downloading them:

download access keys

Open the file and go to the window tab that shows the S3Media Stream – options, then paste that key into the S3 Access Key – field as shown below.
Then copy the Secret Key and paste it into the S3 Secret Key – field of the S3Media Stream Options. You recognize the secret key easily since it is much longer then the access key:

You can do the same with the Key Pairs of CloudFront. If you have not signed up yet with CloudFront, sign up here logging it with your existing account and follow the instructions, it is fixed in a minute.
NOTE:
You do not need CloudFront if you do not plan to work with download distributions but it is a good idea for an international audience.

Getting the Keypairs

To set the Key Pairs, click on the tab CloudFront Key Pairs and click on Create New Key Pair:

create keypair ID

You will be asked to safe the Private Key File:

create-keypair-ID2

Download the file to a safe place. Then copy the public key:

copy-keypair-ID

and paste it in the CloudFront Key Pair ID field of the S3Media LinkSafe options.
NOTE: Do not download the Public Key.  It serves no purpose, just copy the string above that link.

Now, open the private key file. The file typically has a name like this: pk-xxxxxx.pem where xxxxx is the name of the public key. In the file you will see the private key displayed. Now, copy everything you see in the file, including the comments and paste it into the CloudFront Private Keyfile field. It should now look more or less like this:

If you forget to comments, it will not work. Make also sure that there are no spaces after each line.

The default options

To make it easy, we provided a set of default options in case you always want to use the same settings:

The Download distribution/S3 bucket field can have the following options:
Either fill in the original name of the bucket, like mybucket
or a download distribution, like http://dhkhhkhkh.cloudfront.net

You can find the correct names in the AWS console. For a bucket, login to the AWS console:
https://console.aws.amazon.com/console/

For the bucket name, click on the S3 Service. There you find a list of your existing buckets:

Copy the name and paste in in the Download distribution/S3 bucket field.

For a download distribution, click on the Cloudfront service:

This will show a list with distributions:

Select the download distribution name in the Domain Name Column and copy it.
Unfortunately, it is not possible to select and copy the full address for some unfathomable reason. So, you need do construct it like this: http://d5djz3p829xdh.cloudfront.net
In your situation, the link will be different, but download distributions names always start with a 'd' while streaming distributions start with an 's'. Do not use a streaming distriubtion. It won't work.
Paste your link in the Download distribution/S3 bucket field. We are done with the AWS console now.

URL expires (in seconds)

Here you set the expiring time for your links. This can be as long and as short as you want. On a page with little content, you can get away with 10 minutes or less (600), but keep in mind that visitors are sometimes distracted, so a time 30 minutes is in most cases better (3600).
If a link is expired before the visitor clicks, he/she gets an access denied error and needs to refresh the page to generate a new link.
NOTE: the expiring time is unrelated to the download time. Once the visitor clicks on a link, the file starts to download and when this is a big file, it will keep downloading even if the link expires in the meantime.

Plugin deactivation

If you want to keep the options stored in the databse when you deactivate the plugin for some reason, leave this option set to Keep data upon deactivation.
This is useful if you happen to have compatibility problems with another plugin and want to deactivate this plugin to check whether it has anytihng to do with it. Afterwards, you can activate it again while keeping all keys and default intact.

When you are ready, click the Save button. Now we can place our first link.
Back to the tabs >>

Working with the shortcode

The shortcode is quite easy to adapt, therefore after you inserted the first shortcode via the Link Wizard, then use that example to quickly insert a range of links in your pages and posts.

There are 5 attributes when you do not use the default options but override them:

  1. title (any regular alpha and nummerical characters)
  2. file (case sensitive name of the file you link to)
  3. path (bucket or download distribution)
  4. expireseconds (only nummercial value )
  5. target (either _blank or _parent)

For example:
[s3medialinksafe title="Adoptie" file="Adoptie-33.pdf" path="http://d1fcj8jsoer4y5.cloudfront.net" expireseconds="900" target="_blank" /].
Although the shortcode shows up here on two lines, do not use new lines or it won't work.

If you filled in all the default options, the shortcode only needs to contains 2 attributes:

  1. title
  2. file

For example:
[s3medialinksafe title="Adoptie" file="Adoptie-33.pdf" /]

NOTE: Sometimes, links to download distributions turn into real links in the editor. In that case select the link and use the break link icon.

You can wrap the shortcode in html tags like h1, h2, h3, etc... or use a div with a class or inline style to influence the look. See the demo site to view a couple of possible options.

Back to the tabs >>

12 Comments on “How to use S3Media Linksafe – Lite

  1. Where’s the download link for this? I do’t see 1 anywhere.

    • I’m sorry, we just updated the site and forgot to adapt the link. It’s back on the page now. Thanks for reporting this.

  2. I have set up everything in Amazon S3 and set up the plugin on my site. But when I try to add a link to a post and I click on “insert link”, th page just goes to the “All POsts” page – it does not add the link or anything.

    Can this be fixed?

  3. I am building a responsive website which is not Joomla or WordPress. I would like to use S3Media. Would this be at all possible without using Joomla or WordPress? Also, meanwhile I am reviewing your website for more details but would be grateful if you could respond to email?

    • Hi Jerome,
      Sorry, it is only available for WordPress and Joomla. The Joomla version can be found on http://www.footprintaddons.com.
      However, it is possible to create a custom script. Contact us if you are interested in that.

  4. after upgrading to WP 4.7 the lite plugin causes an error

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in /home/globalwelcome/public_html/wp-includes/class-wp-hook.php on line 298

    Dont know if you can suggest some code edit to repair so we can test it out and see if it will work for us?

    • Hi Dan,
      This is the problem caused by changes in a function of WordPress 4.7.
      Monday 12 December 2016 we will upload the new version with the issue resolved. Thanks for reporting the problem. 🙂

  5. That’s brilliant, thanks! Glad to report it’s installed and working perfectly.

Leave a Reply

Your email address will not be published. Required fields are marked *

Updated: February 20, 2015