PHP Класс Yoast_License_Manager

Наследование: implements iYoast_License_Manager
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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