Revert "API ISsues fixes pluigna dn app, plugin v udapte 1.4.0"
This reverts commit a361dea528.
This commit is contained in:
@@ -79,11 +79,10 @@ class Igny8RestAPI {
|
||||
));
|
||||
|
||||
// Plugin status endpoint - returns connection status and API key info
|
||||
// SECURITY: Requires API key authentication
|
||||
register_rest_route('igny8/v1', '/status', array(
|
||||
'methods' => 'GET',
|
||||
'callback' => array($this, 'get_status'),
|
||||
'permission_callback' => array($this, 'check_permission'), // Requires API key
|
||||
'permission_callback' => '__return_true', // Public endpoint for health checks
|
||||
));
|
||||
|
||||
// API key verification endpoint - requires valid API key in header
|
||||
@@ -398,10 +397,6 @@ class Igny8RestAPI {
|
||||
* @return WP_REST_Response
|
||||
*/
|
||||
public function get_status($request) {
|
||||
// If we reach here, API key was validated by check_permission
|
||||
// Update last health check timestamp
|
||||
update_option('igny8_last_api_health_check', time());
|
||||
|
||||
$api = new Igny8API();
|
||||
$api_key = function_exists('igny8_get_secure_option') ? igny8_get_secure_option('igny8_api_key') : get_option('igny8_api_key');
|
||||
$connection_enabled = igny8_is_connection_enabled();
|
||||
@@ -409,11 +404,10 @@ class Igny8RestAPI {
|
||||
$data = array(
|
||||
'connected' => !empty($api_key) && $api->is_authenticated(),
|
||||
'has_api_key' => !empty($api_key),
|
||||
'api_key_validated' => true, // Since check_permission passed
|
||||
'communication_enabled' => $connection_enabled,
|
||||
'plugin_version' => defined('IGNY8_BRIDGE_VERSION') ? IGNY8_BRIDGE_VERSION : '1.0.0',
|
||||
'wordpress_version' => get_bloginfo('version'),
|
||||
'last_health_check' => time(),
|
||||
'last_health_check' => get_option('igny8_last_api_health_check', 0),
|
||||
'health' => (!empty($api_key) && $connection_enabled) ? 'healthy' : 'not_configured'
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user