Skip to main content

Gravity_Forms\Gravity_Forms\License\GF_License_API_Connector

Class GF_License_API_Connector

Connector providing methods to communicate with the License API.

Since: 2.5.11

Source: includes/license/class-gf-license-api-connector.php:20

Details

  • Kind: class
  • Namespace: Gravity_Forms\Gravity_Forms\License
  • Extends: GF_API_Connector

Properties

PropertyTypeDescription
$strategy\Gravity_Api
$cache\GFCache
$response_factoryGF_API_Response_Factory

Methods

MethodDescription
is_debug()Check if cache debug is enabled.
is_legacy_registration()If the site was registered with the legacy process.
clear_cache_for_key()Clear the cache for a given key.
check_license()Get the license info.
is_valid_license()Check if the saved license key is valid.
update_site_registration()Registers a site to the specified key, or if $new_key is blank, unlinks a key from an existing site.
maybe_purge_site_credentials()Purge site credentials if the license info contains certain errors.
get_plugins()Retrieve a list of plugins from the API.

Method Reference

is_debug()

public function is_debug()

Check if cache debug is enabled.

Returns

  • bool

Since: 2.5.11

Source: includes/license/class-gf-license-api-connector.php:50

is_legacy_registration()

public function is_legacy_registration()

If the site was registered with the legacy process.

Returns

  • bool

Since: 2.5.11

Source: includes/license/class-gf-license-api-connector.php:61

clear_cache_for_key()

public function clear_cache_for_key( $key )

Clear the cache for a given key.

Parameters

NameTypeDefaultDescription
$keystring

Since: 2.5.11

Source: includes/license/class-gf-license-api-connector.php:74

check_license()

public function check_license( $key=false, $cache=true )

Get the license info.

Parameters

NameTypeDefaultDescription
$keystringfalse
$cachebooltrue

Returns

  • GF_API_Response

Since: 2.5.11

Source: includes/license/class-gf-license-api-connector.php:88

is_valid_license()

public function is_valid_license()

Check if the saved license key is valid.

Returns

Since: 2.5.11

Source: includes/license/class-gf-license-api-connector.php:123

update_site_registration()

public function update_site_registration( $new_key, $is_md5=false )

Registers a site to the specified key, or if $new_key is blank, unlinks a key from an existing site.

Requires that the $new_key is saved in options before calling this function

Parameters

NameTypeDefaultDescription
$new_keystringUnhashed Gravity Forms license key.
$is_md5false

Returns

  • GF_License_API_Response

Since: 2.5.11 (Implement the license enforcement process.)

Source: includes/license/class-gf-license-api-connector.php:139

maybe_purge_site_credentials()

public function maybe_purge_site_credentials()

Purge site credentials if the license info contains certain errors.

Returns

  • void

Since: 2.5.11

Source: includes/license/class-gf-license-api-connector.php:171

get_plugins()

public function get_plugins( $cache=true )

Retrieve a list of plugins from the API.

Parameters

NameTypeDefaultDescription
$cachebooltrueWhether to respect the cached data.

Returns

  • mixed

Since: 2.5.11

Source: includes/license/class-gf-license-api-connector.php:201