Download the PHP package duckdev/freemius-plugin-licensing without Composer

On this page you can find all versions of the php package duckdev/freemius-plugin-licensing. 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 freemius-plugin-licensing

Freemius Plugin Licensing

A lite, UI-free Freemius SDK for Duck Dev WordPress plugins. The library handles license activation, deactivation, update delivery, and addon listing by talking to the Freemius API directly. It deliberately ships no admin screens — host plugins build their own UI and call into this library for the underlying logic.

📖 Full documentation: docs.duckdev.com/wp-libraries/freemius-plugin-licensing/overview

Requirements

Installation

The library autoloads under the DuckDev\Freemius\ namespace via PSR-4.

Architecture

The library is organised as a small dependency-injection container wired up by the entry class DuckDev\Freemius\Freemius. The folder layout mirrors the namespace:

Each service receives its collaborators by constructor injection, so they can be unit-tested without WordPress in the loop. Hook registration happens inside boot() (called once by the container), so simply instantiating the container has no side effects.

Usage

Initialization

Initialise the container by calling Freemius::get_instance() with your Freemius product ID and an arguments array:

The supported arguments are:

Key Type Description
slug string Unique Freemius slug for the plugin.
main_file string Absolute path to the plugin's main file (used for plugin_basename() and get_plugin_data()).
public_key string Freemius public key (pk_…). Required for plugin-scoped endpoints (addons, info).
is_premium bool Whether this build is the premium edition. Update hooks only register when true. Default false.
has_addons bool Whether the product has addons to list. Default false.

The first call to get_instance() creates the container and registers WordPress hooks. Subsequent calls for the same plugin ID return the existing instance (the second argument is ignored after the first call).

License Activation

activate() returns true / false from the option update on success, or a WP_Error when the key is empty, the plugin is not the premium build, the API call fails, or the response does not include an install ID.

License Deactivation

deactivate() refuses to proceed when the stored UID does not match the current site — that means the activation was moved to another host, and we let the new host appear unlicensed rather than silently freeing the original seat.

Reading the Current Activation

get_activation() always returns an Activation value object — use is_empty() to detect the no-activation case.

Updates

Update hooks are registered automatically during boot() for premium builds. There is no manual integration needed — WordPress will check for, display, and apply updates through its standard pipeline.

To force a refresh from the host plugin's UI:

Addons

Each entry is enriched with a link field (Freemius checkout URL) and an is_premium boolean. Use the duckdev_freemius_format_addon_data filter to add or rewrite fields per addon.

Hooks

Actions

Hook Arguments When
duckdev_freemius_license_activated array $activation, bool $success After a successful activation.
duckdev_freemius_license_deactivated array $activation, bool $success After a successful deactivation.

Filters

Hook Arguments Use
duckdev_freemius_api_request_args array $args, string $method, string $url, array $data, array $headers Tweak the request arguments before they reach wp_remote_request().
duckdev_freemius_api_request_verify_ssl bool $verify, Client $client Disable SSL verification (typically only in local dev).
duckdev_freemius_format_addon_data array $addon, Addon $service Rewrite or augment each addon entry before it is returned.

Security Notes

License

GPL-2.0+


All versions of freemius-plugin-licensing with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
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 duckdev/freemius-plugin-licensing contains the following files

Loading the files please wait ...