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
| Property | Type | Description |
|---|---|---|
$strategy | \Gravity_Api | |
$cache | \GFCache | |
$response_factory | GF_API_Response_Factory |
Methods
| Method | Description |
|---|---|
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
| Name | Type | Default | Description |
|---|---|---|---|
$key | string |
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
| Name | Type | Default | Description |
|---|---|---|---|
$key | string | false | |
$cache | bool | true |
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
true| WP_Error
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
| Name | Type | Default | Description |
|---|---|---|---|
$new_key | string | Unhashed Gravity Forms license key. | |
$is_md5 | false |
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
| Name | Type | Default | Description |
|---|---|---|---|
$cache | bool | true | Whether to respect the cached data. |
Returns
mixed
Since: 2.5.11
Source: includes/license/class-gf-license-api-connector.php:201