'ajaxRefreshAdminNonces', 'request_uri' => $_SERVER['REQUEST_URI'] ?? '', 'user_id' => function_exists('get_current_user_id') ? get_current_user_id() : 0, ), 'Ajax_RefreshAdminNonces::handle'); try { $userIsPluginAdmin = (bool)abj_service('admin_access_policy')->isPluginAdmin(); if (!$userIsPluginAdmin) { ABJ_404_Solution_AjaxAdminEndpointSupport::safeLogAjaxFailure('AJAX unauthorized in ajaxRefreshAdminNonces.', $ctx); ABJ_404_Solution_AjaxAdminEndpointSupport::markAjaxResponseSent(); ABJ_404_Solution_AjaxResponseEmitter::sendJsonResponseAndExit(ABJ_404_Solution_AjaxErrorEnvelope::build('Unauthorized', null, false), 403); return; } if (ABJ_404_Solution_Ajax_Php::consumeRateLimit('refresh_admin_nonces', 60, 60)) { ABJ_404_Solution_AjaxAdminEndpointSupport::safeLogAjaxFailure('AJAX rate limit in ajaxRefreshAdminNonces.', $ctx); ABJ_404_Solution_AjaxAdminEndpointSupport::markAjaxResponseSent(); ABJ_404_Solution_AjaxResponseEmitter::sendJsonResponseAndExit(ABJ_404_Solution_AjaxErrorEnvelope::build( 'Rate limit exceeded. Please try again later.', null, false), 429); return; } $nonces = array(); foreach (ABJ_404_Solution_AjaxAdminEndpointSupport::adminNonceActions() as $action) { $nonces[$action] = wp_create_nonce($action); } ABJ_404_Solution_AjaxAdminEndpointSupport::markAjaxResponseSent(); ABJ_404_Solution_AjaxResponseEmitter::sendJsonResponseAndExit(array('success' => true, 'data' => array('nonces' => $nonces)), 200); } catch (Throwable $e) { ABJ_404_Solution_AjaxAdminEndpointSupport::safeLogAjaxFailure('AJAX exception in ajaxRefreshAdminNonces.', $ctx, $e); ABJ_404_Solution_AjaxAdminEndpointSupport::markAjaxResponseSent(); ABJ_404_Solution_AjaxResponseEmitter::sendJsonResponseAndExit(ABJ_404_Solution_AjaxErrorEnvelope::build( 'Server error while refreshing nonces.', null, false), 500); } } }