token token.
*/
public static function set_refresh_token( $refresh_token ) {
return update_option( self::REFRESH_TOKEN, $refresh_token );
}
/**
* Delete refresh access token.
*/
public static function delete_refresh_token() {
return delete_option( self::REFRESH_TOKEN );
}
/**
* Return device id hash.
*/
public static function get_device_id() {
$site_url = get_home_url();
$user_id = get_current_user_id();
return hash( 'sha256', "$site_url:$user_id" );
}
/**
* Return business_unit_id for connected portal.
*/
public static function get_business_unit_id() {
return get_option( self::BUSINESS_UNIT_ID );
}
/**
* Set business_unit_id for the connected portal.
*
* @param number $business_unit_id businessUnitId.
*/
public static function set_business_unit_id( $business_unit_id ) {
return update_option( self::BUSINESS_UNIT_ID, $business_unit_id );
}
/**
* Delete business_unit_id.
*/
public static function delete_business_unit_id() {
return delete_option( self::BUSINESS_UNIT_ID );
}
/**
* Set when last authorized.
*/
public static function set_last_authorize_time() {
return update_option( self::LAST_AUTHORIZE_TIME, time() );
}
/**
* Set when last deauthorized.
*/
public static function set_last_deauthorize_time() {
return update_option( self::LAST_DEAUTHORIZE_TIME, time() );
}
/**
* Set when last disconnect.
*/
public static function set_last_disconnect_time() {
return update_option( self::LAST_DISCONNECT_TIME, time() );
}
/**
* Set if the refresh token failed to be retrieved.
*
* @param string $error the error message.
*/
public static function set_refresh_token_error( $error = 'unknown' ) {
return update_option( self::REFRESH_TOKEN_ERROR, $error );
}
/**
* Get the last time authorization was performed.
*
* @return mixed The last authorization time, or false if not set.
*/
public static function get_last_authorize_time() {
return get_option( self::LAST_AUTHORIZE_TIME, false );
}
/**
* Get the last time deauthorization was performed.
*
* @return mixed The last deauthorization time, or false if not set.
*/
public static function get_last_deauthorize_time() {
return get_option( self::LAST_DEAUTHORIZE_TIME, false );
}
/**
* Get the last time a disconnect was performed.
*
* @return mixed The last disconnect time, or false if not set.
*/
public static function get_last_disconnect_time() {
return get_option( self::LAST_DISCONNECT_TIME, false );
}
/**
* Get the last error message for when retrieving the refresh token failed.
*
* @return string The error message, or 'unknown' if not set.
*/
public static function get_refresh_token_error() {
return get_option( self::REFRESH_TOKEN_ERROR, 'unknown' );
}
}
Fatal error: Uncaught Error: Class 'Leadin\data\Portal_Options' not found in /home/sportuga/public_html/wp-content/plugins/leadin/public/admin/class-connection.php:31
Stack trace:
#0 /home/sportuga/public_html/wp-content/plugins/leadin/public/class-pagehooks.php(24): Leadin\admin\Connection::is_connected()
#1 /home/sportuga/public_html/wp-content/plugins/leadin/public/class-leadin.php(23): Leadin\PageHooks->__construct()
#2 /home/sportuga/public_html/wp-content/plugins/leadin/leadin.php(79): Leadin\Leadin->__construct()
#3 /home/sportuga/public_html/wp-settings.php(517): include_once('/home/sportuga/...')
#4 /home/sportuga/public_html/wp-config.php(102): require_once('/home/sportuga/...')
#5 /home/sportuga/public_html/wp-load.php(50): require_once('/home/sportuga/...')
#6 /home/sportuga/public_html/wp-blog-header.php(13): require_once('/home/sportuga/...')
#7 /home/sportuga/public_html/index.php(17): require('/home/sportuga/...')
#8 {main}
thrown in /home/sportuga/public_html/wp-content/plugins/leadin/public/admin/class-connection.php on line 31