Download the PHP package stellarwp/uplink without Composer

On this page you can find all versions of the php package stellarwp/uplink. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package uplink

StellarWP Uplink

CI Static Analysis

Installation

It's recommended that you install Uplink as a project dependency via Composer:

We actually recommend that this library gets included in your project using Strauss.

Luckily, adding Strauss to your composer.json is only slightly more complicated than adding a typical dependency, so checkout our strauss docs.

Initialize the library

Initializing the StellarWP Uplink library should be done within the plugins_loaded action, preferably at priority 0.

Translation

Package is using __( 'Invalid request: nonce field is expired. Please try again.', '%TEXTDOMAIN%' ) function for translation. In order to change domain placeholder '%TEXTDOMAIN%' to your plugin translation domain run

or

and prompt the plugin domain You can also add lines below to your composer file in order to run command automatically

Embedding a license in your plugin

StellarWP Uplink plugins are downloaded with an embedded license key so that users do not need to manually enter the key when activating their plugin. To make this possible, the class must be in a specific location so that the licensing server can find it.

The file should match the following - keeping the KEY constant set to a blank string, or, if you want a default license key, set it to that.:

Registering a plugin

Registers a plugin for licensing and updates.

Registering a service

Registers a service for licensing. Since services require a plugin, we pull version and class information from the plugin.

Render license key form on your settings page

In order to render license key form just add the following to your settings page, tab, etc.

⚠️ This will render license key fields for all of your registered plugins/services in the same Uplink/Container instance.

To render a single product's license key, use the following:

Example: Register settings page and render license fields

Register a settings page for a plugin if you need it

Add lines below to your settings page. This will render license key form with titles and a submit button

License Authorization

⚠️ Your auth_url is set on the Origins table on the Stellar Licensing server! You must first request to have this added before proceeding.

There may be certain functionality you wish to make available when you know a license is authorized.

This library provides the tools to fetch and store unique tokens, working together with the Uplink Origin plugin.

After following the instructions at the top to define a Config::set_token_auth_prefix(), this will enable the following functionality:

  1. The ability to render a "Connect" button anywhere in your plugin while the user is in wp-admin, using the provided function below.
  2. The button will display "Disconnect" once they are authorized, which deletes the locally stored Token.
  3. The ability for the customer's site to accept specific Query Variables in wp-admin, that will store the generated Token, and an optional new License Key for a Product Slug.
  4. Check if a license is authorized, either in the License Validation payload, or manually.

⚠️ Generating a Token requires manual configuration on your Origin site using the Uplink Origin Plugin.

Render Authorize Button

💡 Note: the button is only rendered if the following conditions are met:

  1. You have an auth_url set on the StellarWP Licensing Server.
  2. The current user is a Super Admin (can be changed with a WP filter).
  3. This is not a multisite installation, or...
  4. If multisite and using subfolders, only on the root network dashboard.
  5. If multisite and NOT using subfolders and on a subsite AND a token doesn't already exist at the network level, in which case it needs to be managed at the network.

You can also pass in a custom license domain, which can be fetched on the Uplink Origin side from the uplink_domain query variable:

💡 The button is very customizable with filters, see Authorize_Button_Controller.php.

Manually Check if a License is Remotely Authorized

This connects to the licensing server to check in real time if the license is authorized. Use sparingly.

Manually Fetch Auth URL

If for some reason you need to fetch your auth_url manually, you can do so by:

💡 Auth URL connections are cached for one day using transients.

Callback Redirect

The Callback Redirect generated by the Origin looks something like this, where uplinksample.lndo.site is your customer's website:

The Origin is responsible for asking StellarWP Licensing to generate a token and redirect back to where the customer originally clicked on the button.

The following Query Variables are available for reference:

💡 Note: This data automatically gets stored when detected, using the admin_init hook!

  1. uplink_token - The unique UUIDv4 token generated by StellarWP Licensing.
  2. _uplink_nonce - The original nonce sent with the callback URL, as part of the "Connect" button.
  3. uplink_license (optional) - Whether we should also update or set a License Key.
  4. uplink_slug (optional) - The Product or Service Slug that we're updating the license for.

⚠️ uplink_slug MUST be supplied if uplink_license is!


All versions of uplink with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
ext-json Version *
stellarwp/container-contract Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stellarwp/uplink contains the following files

Loading the files please wait ....