GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes | Private Member Functions | Private Attributes
GV_License_Handler Class Reference

Public Member Functions

 _get_edd_settings ($action= '', $license= '')
 Generate the array of settings passed to the EDD license call. More...
 
 check_license ()
 Check the GravityView license information. More...
 
 flush_related_plugins_transient ()
 When a plugin is activated or deactivated, delete the cached extensions/plugins used by get_related_plugins_and_extensions() More...
 
 get_license_message ($license_data)
 Generate the status message displayed in the license field. More...
 
 get_site_data ()
 Retrieves site data (plugin versions, integrations, etc) to be sent along with the license check. More...
 
 get_upgrade_html ($upgrades)
 Display possible upgrades for a license. More...
 
 license_call ($array=array())
 Perform the call to EDD based on the AJAX call or passed data. More...
 
 license_details ($response=array())
 Allow pure HTML in settings fields. More...
 
 refresh_license_status ()
 When the status transient expires (or is deleted on activation), re-check the status. More...
 
 settings_edd_license_activation ($field, $echo)
 
 strings ($status=NULL, $license_data=null)
 Override the text used in the GravityView EDD license Javascript. More...
 

Static Public Member Functions

static get_instance (GravityView_Settings $GFAddOn)
 
static get_related_plugins_and_extensions ($implode= '< br/>')
 Get active GravityView Extensions and Gravity Forms Add-ons to help debug issues. More...
 

Data Fields

const author = 'Katz Web Services, Inc.'
 
const item_id = 17
 Post ID on gravityview.co. More...
 
const name = 'GravityView'
 
const related_plugins_key = 'gravityview_related_plugins'
 
const status_transient_key = 'gravityview_edd-activate_valid'
 Name of the transient used to store license status for GV. More...
 
const url = 'https://gravityview.co'
 
const version = GravityView_Plugin::version
 

Static Public Attributes

static $instance
 

Private Member Functions

 __construct (GravityView_Settings $GFAddOn)
 
 _license_get_remote_response ($data, $license= '')
 Perform the call. More...
 
 add_hooks ()
 
 generate_license_box ($message, $class= '')
 Generate the status message box HTML based on the current status. More...
 
 get_license_renewal_url ($license_data)
 URL to direct license renewal, or if license key is not set, then just the account page. More...
 
 license_call_update_settings ($license_data, $data)
 Update the license after fetching it. More...
 
 setup_edd ()
 Include the EDD plugin updater class, if not exists. More...
 

Private Attributes

 $Addon
 
 $EDD_SL_Plugin_Updater
 

Detailed Description

Definition at line 3 of file class-gv-license-handler.php.

Constructor & Destructor Documentation

__construct ( GravityView_Settings  $GFAddOn)
private

Definition at line 55 of file class-gv-license-handler.php.

References add_hooks(), and setup_edd().

Member Function Documentation

_get_edd_settings (   $action = '',
  $license = '' 
)

Generate the array of settings passed to the EDD license call.

Since
1.7.4
Parameters
string$actionThe action to send to edd, such as check_license
string$licenseThe license key to have passed to EDD
Returns
array

Definition at line 374 of file class-gv-license-handler.php.

Referenced by _license_get_remote_response(), and setup_edd().

_license_get_remote_response (   $data,
  $license = '' 
)
private

Perform the call.

Returns
array|WP_Error

Definition at line 402 of file class-gv-license-handler.php.

References $url, and _get_edd_settings().

Referenced by license_call().

add_hooks ( )
private

Definition at line 64 of file class-gv-license-handler.php.

Referenced by __construct().

check_license ( )

Check the GravityView license information.

Since
1.19.3
Parameters
bool$forceWhether to force checking license, even if AJAX
Returns
void

Definition at line 93 of file class-gv-license-handler.php.

References get_site_data().

flush_related_plugins_transient ( )

When a plugin is activated or deactivated, delete the cached extensions/plugins used by get_related_plugins_and_extensions()

See also
get_related_plugins_and_extensions()
Since
1.15

Definition at line 78 of file class-gv-license-handler.php.

generate_license_box (   $message,
  $class = '' 
)
private

Generate the status message box HTML based on the current status.

Since
1.7.4
Parameters
$message
string$class
Returns
string

Definition at line 473 of file class-gv-license-handler.php.

References $class, and $output.

Referenced by get_license_message().

static get_instance ( GravityView_Settings  $GFAddOn)
static
Parameters
GravityView_Settings$GFAddOn
Returns
GV_License_Handler

Definition at line 48 of file class-gv-license-handler.php.

get_license_message (   $license_data)

Generate the status message displayed in the license field.

Since
1.7.4
Parameters
$license_data
Returns
string

Definition at line 442 of file class-gv-license-handler.php.

References $class, generate_license_box(), and strings().

Referenced by license_call(), and settings_edd_license_activation().

get_license_renewal_url (   $license_data)
private

URL to direct license renewal, or if license key is not set, then just the account page.

Since
1.13.1
Parameters
object | null$license_dataObject with license data
Returns
string Renewal or account URL

Definition at line 692 of file class-gv-license-handler.php.

Referenced by strings().

static get_related_plugins_and_extensions (   $implode = '<br />')
static

Get active GravityView Extensions and Gravity Forms Add-ons to help debug issues.

Since
1.15
Returns
string List of active extensions related to GravityView or Gravity Forms, separated by HTML line breaks

Definition at line 242 of file class-gv-license-handler.php.

Referenced by GravityView_Support_Port\_localize_script().

get_site_data ( )

Retrieves site data (plugin versions, integrations, etc) to be sent along with the license check.

Since
1.9 public
Returns
array

Definition at line 183 of file class-gv-license-handler.php.

References GravityView_Settings\get_instance(), and GravityView_Plugin\version.

Referenced by check_license().

get_upgrade_html (   $upgrades)

Display possible upgrades for a license.

Since
1.17
Parameters
array$upgradesArray of upgrade paths, returned from the GV website
Returns
string HTML list of upgrades available for the current license

Definition at line 550 of file class-gv-license-handler.php.

References $output.

Referenced by license_details().

license_call (   $array = array())

Perform the call to EDD based on the AJAX call or passed data.

Since
1.7.4
Parameters
array$array{ string $license The license key string $edd_action The EDD action to perform, like check_license string $field_id The ID of the field to check boolean $update Whether to update plugin settings. Prevent updating the data by setting an update key to false string $format If object, return the object of the license data. Else, return the JSON-encoded object }
Returns
mixed|string|void

Definition at line 609 of file class-gv-license-handler.php.

References _license_get_remote_response(), get_license_message(), GVCommon\has_cap(), license_call_update_settings(), and license_details().

license_call_update_settings (   $license_data,
  $data 
)
private

Update the license after fetching it.

Parameters
object$license_data
Returns
void

Definition at line 674 of file class-gv-license-handler.php.

Referenced by license_call().

license_details (   $response = array())

Allow pure HTML in settings fields.

Since
1.17
Parameters
array$responseLicense response
Returns
string html key of the $field

Definition at line 491 of file class-gv-license-handler.php.

References get_upgrade_html(), and strings().

Referenced by license_call().

refresh_license_status ( )

When the status transient expires (or is deleted on activation), re-check the status.

Since
1.17
Returns
void

Definition at line 150 of file class-gv-license-handler.php.

References GravityView_Settings\get_instance().

settings_edd_license_activation (   $field,
  $echo 
)
setup_edd ( )
private

Include the EDD plugin updater class, if not exists.

Since
1.7.4
Returns
void

Definition at line 349 of file class-gv-license-handler.php.

References _get_edd_settings(), GRAVITYVIEW_DIR, and GRAVITYVIEW_FILE.

Referenced by __construct().

strings (   $status = NULL,
  $license_data = null 
)

Override the text used in the GravityView EDD license Javascript.

Parameters
array | null$statusStatus to get. If empty, get all strings.
object | null$license_dataObject with license data
Returns
array Modified array of content

Definition at line 705 of file class-gv-license-handler.php.

References $strings, and get_license_renewal_url().

Referenced by get_license_message(), and license_details().

Field Documentation

$Addon
private

Definition at line 8 of file class-gv-license-handler.php.

Definition at line 36 of file class-gv-license-handler.php.

$instance
static

Definition at line 41 of file class-gv-license-handler.php.

const author = 'Katz Web Services, Inc.'

Definition at line 12 of file class-gv-license-handler.php.

const item_id = 17

Post ID on gravityview.co.

Since
1.15

Definition at line 22 of file class-gv-license-handler.php.

const name = 'GravityView'

Definition at line 10 of file class-gv-license-handler.php.

const related_plugins_key = 'gravityview_related_plugins'

Definition at line 34 of file class-gv-license-handler.php.

const status_transient_key = 'gravityview_edd-activate_valid'

Name of the transient used to store license status for GV.

Since
1.17

Definition at line 28 of file class-gv-license-handler.php.

const url = 'https://gravityview.co'

Definition at line 14 of file class-gv-license-handler.php.

const version = GravityView_Plugin::version

Definition at line 16 of file class-gv-license-handler.php.


The documentation for this class was generated from the following file: