PHP 클래스 Yoast_License_Manager

상속: implements iYoast_License_Manager
파일 보기 프로젝트 열기: yoast/license-manager 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$is_network_activated Boolean indicating whether this plugin is network activated
$prefix Used to prefix ID's, option names, etc..
$product The license

공개 메소드들

메소드 설명
__construct ( Yoast_Product $product ) Constructor
activate_license ( ) : boolean Remotely activate License
catch_post_request ( ) Check if the license form has been submitted
deactivate_license ( ) : boolean Remotely deactivate License
display_admin_notices ( ) Display license specific admin notices, namely:
get_license_expiry_date ( ) : string Gets the license expiry date
get_license_key ( ) : string Gets the license key from constant or option
get_license_status ( ) : string Get the license status
license_is_valid ( ) : boolean Checks whether the license status is active
output_script ( ) Output the script containing the YoastLicenseManager JS Object
set_license_constant_name ( string $license_constant_name ) Set the constant used to define the license
set_license_expiry_date ( $expiry_date ) Stores the license expiry date
set_license_key ( string $license_key ) Set the license key
set_license_status ( string $license_status ) Set the license status
setup_hooks ( ) Setup hooks
show_license_form ( boolean $embedded = true ) Show a form where users can enter their license key
show_license_form_heading ( )

보호된 메소드들

메소드 설명
call_license_api ( string $action ) : mixed
get_api_availability ( ) : array Get the API availability information
get_curl_version ( ) : mixed Get the current curl version, or false
get_option ( string $name ) : mixed Gets a license related option
get_options ( ) : array Get all license related options
set_notice ( string $message, $success = true ) Set a notice to display in the admin area
set_option ( string $name, mixed $value ) Set a license related option
set_options ( array $options ) Set license related options

비공개 메소드들

메소드 설명
check_api_host_availability ( ) : boolean Check if the API host address is available from this server
maybe_set_license_key_from_constant ( ) Maybe set license key from a defined constant

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( Yoast_Product $product )
$product Yoast_Product

activate_license() 공개 메소드

Remotely activate License
public activate_license ( ) : boolean
리턴 boolean True if the license is now activated, false if not

call_license_api() 보호된 메소드

protected call_license_api ( string $action ) : mixed
$action string activate|deactivate
리턴 mixed

catch_post_request() 공개 메소드

Check if the license form has been submitted
public catch_post_request ( )

deactivate_license() 공개 메소드

Remotely deactivate License
public deactivate_license ( ) : boolean
리턴 boolean True if the license is now deactivated, false if not

display_admin_notices() 공개 메소드

- License for the product isn't activated - External requests are blocked through WP_HTTP_BLOCK_EXTERNAL

get_api_availability() 보호된 메소드

Get the API availability information
protected get_api_availability ( ) : array
리턴 array

get_curl_version() 보호된 메소드

Get the current curl version, or false
protected get_curl_version ( ) : mixed
리턴 mixed

get_license_expiry_date() 공개 메소드

Gets the license expiry date
public get_license_expiry_date ( ) : string
리턴 string

get_license_key() 공개 메소드

Gets the license key from constant or option
public get_license_key ( ) : string
리턴 string $license_key

get_license_status() 공개 메소드

Get the license status
public get_license_status ( ) : string
리턴 string $license_status;

get_option() 보호된 메소드

Gets a license related option
protected get_option ( string $name ) : mixed
$name string The option name
리턴 mixed The option value

get_options() 보호된 메소드

Get all license related options
protected get_options ( ) : array
리턴 array Array of license options

license_is_valid() 공개 메소드

Checks whether the license status is active
public license_is_valid ( ) : boolean
리턴 boolean True if license is active

output_script() 공개 메소드

This takes care of disabling the 'activate' and 'deactivate' buttons
public output_script ( )

set_license_constant_name() 공개 메소드

Set the constant used to define the license
public set_license_constant_name ( string $license_constant_name )
$license_constant_name string The license constant name

set_license_expiry_date() 공개 메소드

Stores the license expiry date
public set_license_expiry_date ( $expiry_date )

set_license_key() 공개 메소드

Set the license key
public set_license_key ( string $license_key )
$license_key string

set_license_status() 공개 메소드

Set the license status
public set_license_status ( string $license_status )
$license_status string

set_notice() 보호된 메소드

Set a notice to display in the admin area
protected set_notice ( string $message, $success = true )
$message string The message to display

set_option() 보호된 메소드

Set a license related option
protected set_option ( string $name, mixed $value )
$name string The option name
$value mixed The option value

set_options() 보호된 메소드

Set license related options
protected set_options ( array $options )
$options array Array of new license options

setup_hooks() 공개 메소드

Setup hooks
public setup_hooks ( )

show_license_form() 공개 메소드

Show a form where users can enter their license key
public show_license_form ( boolean $embedded = true )
$embedded boolean Boolean indicating whether this form is embedded in another form?

show_license_form_heading() 공개 메소드

프로퍼티 상세

$is_network_activated 보호되어 있는 프로퍼티

Boolean indicating whether this plugin is network activated
protected $is_network_activated

$prefix 보호되어 있는 프로퍼티

Used to prefix ID's, option names, etc..
protected $prefix

$product 보호되어 있는 프로퍼티

The license
protected $product