wp plugin udapted v1.5.0
This commit is contained in:
@@ -403,21 +403,13 @@ class Igny8Admin {
|
||||
// Store API key securely
|
||||
if (function_exists('igny8_store_secure_option')) {
|
||||
igny8_store_secure_option('igny8_api_key', $api_key);
|
||||
igny8_store_secure_option('igny8_access_token', $api_key);
|
||||
} else {
|
||||
update_option('igny8_api_key', $api_key);
|
||||
update_option('igny8_access_token', $api_key);
|
||||
}
|
||||
|
||||
// Store site ID
|
||||
// Store site ID and last communication timestamp
|
||||
update_option('igny8_site_id', sanitize_text_field($site_id));
|
||||
|
||||
// Store integration_id from response if provided
|
||||
$response_data = $test_response['data'] ?? array();
|
||||
$integration_id = isset($response_data['integration_id']) ? intval($response_data['integration_id']) : null;
|
||||
if ($integration_id) {
|
||||
update_option('igny8_integration_id', $integration_id);
|
||||
}
|
||||
update_option('igny8_last_communication', current_time('timestamp'));
|
||||
|
||||
add_settings_error(
|
||||
'igny8_settings',
|
||||
@@ -439,17 +431,21 @@ class Igny8Admin {
|
||||
public static function revoke_api_key() {
|
||||
if (function_exists('igny8_delete_secure_option')) {
|
||||
igny8_delete_secure_option('igny8_api_key');
|
||||
igny8_delete_secure_option('igny8_access_token');
|
||||
igny8_delete_secure_option('igny8_refresh_token');
|
||||
} else {
|
||||
delete_option('igny8_api_key');
|
||||
delete_option('igny8_access_token');
|
||||
delete_option('igny8_refresh_token');
|
||||
}
|
||||
|
||||
// Also clear token-issued timestamps
|
||||
delete_option('igny8_token_refreshed_at');
|
||||
// Clear connection data
|
||||
delete_option('igny8_site_id');
|
||||
delete_option('igny8_last_communication');
|
||||
|
||||
// Clean up deprecated options (for older installations)
|
||||
delete_option('igny8_access_token');
|
||||
delete_option('igny8_access_token_issued');
|
||||
delete_option('igny8_integration_id');
|
||||
delete_option('igny8_last_structure_sync');
|
||||
delete_option('igny8_refresh_token');
|
||||
delete_option('igny8_token_refreshed_at');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user