GravityView
2.17
The best, easiest way to display Gravity Forms entries on your website.
|
Public Member Functions | |
activate_license ( $license_key) | |
Activates license. More... | |
ajax_activate_license (array $payload) | |
AJAX request wrapper for the activate_license() method. More... | |
ajax_deactivate_license (array $payload) | |
AJAX request wrapper for the deactivate_license() method. More... | |
ajax_get_licenses_data (array $payload) | |
AJAX request wrapper for the get_licenses_data() method. More... | |
check_license ( $license_key) | |
Checks license key for validity. More... | |
check_licenses (array $license_keys) | |
Checks multiples license keys for validity. More... | |
configure_ajax_routes (array $routes) | |
Configures AJAX routes handled by this class. More... | |
deactivate_license ( $license_key, $force_removal=false) | |
Deactivates license. More... | |
display_license_info_on_plugins_page ( $plugin_name, $plugin_data) | |
Optionally adds notices to installed plugins when license is invalid or expired. More... | |
get_license_key_status_message ( $status) | |
Returns license status message based on the EDD status code. More... | |
get_licenses_data () | |
Retrieves license data from the database. More... | |
get_product_license_map ( $key_by='id') | |
Returns an object keyed by product ID and associated licenses. More... | |
get_product_licenses ( $id) | |
Returns licenses for a product. More... | |
get_site_data () | |
Retrieves site data (plugin versions, integrations, etc.) to be sent along with the license check. More... | |
init () | |
Initializes the class. More... | |
is_expired_license ( $expiry) | |
Determines if the license has expired. More... | |
mask_license_key ( $license_key) | |
Masks part of the license key. More... | |
migrate_legacy_licenses ( $force_migration=false) | |
Migrates licenses for products that do not have Foundation integrated. More... | |
modify_license_data_for_frontend_output ( $license) | |
Adds additional data to the license object for use in the frontend. More... | |
perform_remote_license_call ( $license, $edd_action) | |
Performs remote call to the EDD API. More... | |
process_hardcoded_licenses () | |
Saves new or removes existing hardcoded licenses from the license data. More... | |
recheck_all_licenses ( $skip_cache=false) | |
Rechecks all licenses and updates the database. More... | |
save_licenses_data (array $licenses_data) | |
Saves license data in the database. More... | |
update_submenu_badge_count () | |
Optionally updates the Licenses submenu badge count if any of the products are unlicensed. More... | |
Static Public Member Functions | |
static | get_instance () |
Returns class instance. More... | |
Data Fields | |
$_licenses_data | |
const | EDD_ACTION_ACTIVATE_LICENSE = 'activate_license' |
const | EDD_ACTION_CHECK_LICENSE = 'check_license' |
const | EDD_ACTION_DEACTIVATE_LICENSE = 'deactivate_license' |
const | EDD_LICENSES_API_ENDPOINT = 'https://www.gravitykit.com' |
const | EDD_LICENSES_API_VERSION = 2 |
const | HARDCODED_LICENSE_CONSTANTS = [ 'GRAVITYVIEW_LICENSE_KEY', 'GRAVITYKIT_LICENSES' ] |
Static Private Attributes | |
static | $_instance |
Definition at line 21 of file LicenseManager.php.
activate_license | ( | $license_key | ) |
Activates license.
string | $license_key | license_key |
Exception |
Definition at line 462 of file LicenseManager.php.
References Framework\get_instance(), LicenseManager\get_license_key_status_message(), LicenseManager\get_licenses_data(), LicenseManager\perform_remote_license_call(), and LicenseManager\save_licenses_data().
Referenced by LicenseManager\ajax_activate_license(), and LicenseManager\migrate_legacy_licenses().
ajax_activate_license | ( | array | $payload | ) |
AJAX request wrapper for the activate_license() method.
array | $payload |
Exception |
Definition at line 439 of file LicenseManager.php.
References LicenseManager\activate_license(), Framework\get_instance(), and LicenseManager\modify_license_data_for_frontend_output().
ajax_deactivate_license | ( | array | $payload | ) |
AJAX request wrapper for the deactivate_license() method.
array | $payload |
Exception |
Definition at line 513 of file LicenseManager.php.
References LicenseManager\deactivate_license(), Encryption\get_instance(), and LicenseManager\get_licenses_data().
ajax_get_licenses_data | ( | array | $payload | ) |
AJAX request wrapper for the get_licenses_data() method.
array | $payload |
Exception |
Definition at line 124 of file LicenseManager.php.
References Framework\get_instance(), LicenseManager\get_licenses_data(), LicenseManager\migrate_legacy_licenses(), LicenseManager\modify_license_data_for_frontend_output(), LicenseManager\process_hardcoded_licenses(), and LicenseManager\recheck_all_licenses().
check_license | ( | $license_key | ) |
Checks license key for validity.
string | $license_key |
Exception |
Definition at line 401 of file LicenseManager.php.
References LicenseManager\perform_remote_license_call().
check_licenses | ( | array | $license_keys | ) |
Checks multiples license keys for validity.
array | $license_keys |
Exception |
Definition at line 420 of file LicenseManager.php.
References LicenseManager\perform_remote_license_call().
Referenced by LicenseManager\migrate_legacy_licenses(), LicenseManager\process_hardcoded_licenses(), and LicenseManager\recheck_all_licenses().
configure_ajax_routes | ( | array | $routes | ) |
Configures AJAX routes handled by this class.
array | $routes | AJAX route to class method map. |
Definition at line 105 of file LicenseManager.php.
deactivate_license | ( | $license_key, | |
$force_removal = false |
|||
) |
Deactivates license.
string | $license_key | |
bool | $force_removal | (optional) Forces removal of license from the local licenses object even if deactivation request fails. Default: false. |
Exception |
Definition at line 547 of file LicenseManager.php.
References Arr\get(), LicenseManager\get_licenses_data(), LicenseManager\is_expired_license(), LicenseManager\perform_remote_license_call(), and LicenseManager\save_licenses_data().
Referenced by LicenseManager\ajax_deactivate_license().
display_license_info_on_plugins_page | ( | $plugin_name, | |
$plugin_data | |||
) |
Optionally adds notices to installed plugins when license is invalid or expired.
string | $plugin_name | |
array | $plugin_data |
Definition at line 868 of file LicenseManager.php.
References $url, ProductManager\get_instance(), Framework\get_instance(), and LicenseManager\get_licenses_data().
|
static |
Returns class instance.
Definition at line 55 of file LicenseManager.php.
Referenced by Framework\ajax_get_app_data(), Framework\enqueue_assets(), EDD\format_product_data(), TrustedLogin\get_config(), ProductManager\get_products_data(), Framework\init(), and ProductManager\install_product().
get_license_key_status_message | ( | $status | ) |
Returns license status message based on the EDD status code.
string | $status | EDD status code. |
Definition at line 267 of file LicenseManager.php.
Referenced by LicenseManager\activate_license().
get_licenses_data | ( | ) |
Retrieves license data from the database.
Definition at line 156 of file LicenseManager.php.
References LicenseManager\$_licenses_data, Encryption\get_instance(), and Framework\ID.
Referenced by LicenseManager\activate_license(), LicenseManager\ajax_deactivate_license(), LicenseManager\ajax_get_licenses_data(), LicenseManager\deactivate_license(), LicenseManager\display_license_info_on_plugins_page(), LicenseManager\get_product_license_map(), LicenseManager\migrate_legacy_licenses(), LicenseManager\process_hardcoded_licenses(), and LicenseManager\recheck_all_licenses().
get_product_license_map | ( | $key_by = 'id' | ) |
Returns an object keyed by product ID and associated licenses.
string | $key_by | (optional) Key (product ID or text domain) to use for the returned array. Choices: 'id' or 'text_domain'. Default: 'id'. |
Definition at line 209 of file LicenseManager.php.
References LicenseManager\get_licenses_data().
Referenced by LicenseManager\get_product_licenses().
get_product_licenses | ( | $id | ) |
Returns licenses for a product.
int | string | $id | Product ID or text domain. |
Definition at line 250 of file LicenseManager.php.
References LicenseManager\get_product_license_map().
get_site_data | ( | ) |
Retrieves site data (plugin versions, integrations, etc.) to be sent along with the license check.
Definition at line 950 of file LicenseManager.php.
References GV_PLUGIN_VERSION, Core\ID, and Arr\only().
Referenced by LicenseManager\perform_remote_license_call().
init | ( | ) |
Initializes the class.
Definition at line 70 of file LicenseManager.php.
References Framework\AJAX_ROUTER, LicenseManager\migrate_legacy_licenses(), LicenseManager\process_hardcoded_licenses(), LicenseManager\recheck_all_licenses(), and LicenseManager\update_submenu_badge_count().
is_expired_license | ( | $expiry | ) |
Determines if the license has expired.
int | string | $expiry | Unix time or 'lifetime'. |
Definition at line 1068 of file LicenseManager.php.
Referenced by LicenseManager\deactivate_license(), and LicenseManager\modify_license_data_for_frontend_output().
mask_license_key | ( | $license_key | ) |
Masks part of the license key.
string | $license_key |
Definition at line 626 of file LicenseManager.php.
Referenced by LicenseManager\modify_license_data_for_frontend_output().
migrate_legacy_licenses | ( | $force_migration = false | ) |
Migrates licenses for products that do not have Foundation integrated.
bool | $force_migration | Whether to force migration even if it was done before. |
Definition at line 722 of file LicenseManager.php.
References LicenseManager\activate_license(), LicenseManager\check_licenses(), Arr\get(), LicenseManager\get_licenses_data(), Framework\ID, and LicenseManager\save_licenses_data().
Referenced by LicenseManager\ajax_get_licenses_data(), and LicenseManager\init().
modify_license_data_for_frontend_output | ( | $license | ) |
Adds additional data to the license object for use in the frontend.
$license |
Definition at line 588 of file LicenseManager.php.
References Encryption\get_instance(), Core\get_request_unique_string(), LicenseManager\is_expired_license(), and LicenseManager\mask_license_key().
Referenced by LicenseManager\ajax_activate_license(), and LicenseManager\ajax_get_licenses_data().
perform_remote_license_call | ( | $license, | |
$edd_action | |||
) |
Performs remote call to the EDD API.
1.0
string | array | $license | |
string | $edd_action |
Exception |
Definition at line 301 of file LicenseManager.php.
References LicenseManager\get_site_data(), and Helpers\query_api().
Referenced by LicenseManager\activate_license(), LicenseManager\check_license(), LicenseManager\check_licenses(), and LicenseManager\deactivate_license().
process_hardcoded_licenses | ( | ) |
Saves new or removes existing hardcoded licenses from the license data.
Definition at line 645 of file LicenseManager.php.
References LicenseManager\check_licenses(), LicenseManager\get_licenses_data(), and LicenseManager\save_licenses_data().
Referenced by LicenseManager\ajax_get_licenses_data(), and LicenseManager\init().
recheck_all_licenses | ( | $skip_cache = false | ) |
Rechecks all licenses and updates the database.
bool | $skip_cache | Whether to skip returning products from cache. |
Definition at line 812 of file LicenseManager.php.
References LicenseManager\check_licenses(), LicenseManager\get_licenses_data(), Framework\ID, and LicenseManager\save_licenses_data().
Referenced by LicenseManager\ajax_get_licenses_data(), and LicenseManager\init().
save_licenses_data | ( | array | $licenses_data | ) |
Saves license data in the database.
array | $licenses_data |
Definition at line 181 of file LicenseManager.php.
References Encryption\get_instance(), and Framework\ID.
Referenced by LicenseManager\activate_license(), LicenseManager\deactivate_license(), LicenseManager\migrate_legacy_licenses(), LicenseManager\process_hardcoded_licenses(), and LicenseManager\recheck_all_licenses().
update_submenu_badge_count | ( | ) |
Optionally updates the Licenses submenu badge count if any of the products are unlicensed.
Definition at line 1029 of file LicenseManager.php.
References $update_count, ProductManager\get_instance(), Framework\get_instance(), and Framework\ID.
Referenced by LicenseManager\init().
|
staticprivate |
Definition at line 39 of file LicenseManager.php.
$_licenses_data |
Definition at line 46 of file LicenseManager.php.
Referenced by LicenseManager\get_licenses_data().
const EDD_ACTION_ACTIVATE_LICENSE = 'activate_license' |
Definition at line 28 of file LicenseManager.php.
const EDD_ACTION_CHECK_LICENSE = 'check_license' |
Definition at line 26 of file LicenseManager.php.
const EDD_ACTION_DEACTIVATE_LICENSE = 'deactivate_license' |
Definition at line 30 of file LicenseManager.php.
const EDD_LICENSES_API_ENDPOINT = 'https://www.gravitykit.com' |
Definition at line 22 of file LicenseManager.php.
const EDD_LICENSES_API_VERSION = 2 |
Definition at line 24 of file LicenseManager.php.
const HARDCODED_LICENSE_CONSTANTS = [ 'GRAVITYVIEW_LICENSE_KEY', 'GRAVITYKIT_LICENSES' ] |
Definition at line 32 of file LicenseManager.php.