isPluginAdmin(); } catch (Throwable $e) { // Failing closed to non-admin is deliberate. Losing the reason is // not: this runs only after something upstream already threw, so // swallowing it turns an admin-access outage into "the page shows // less" with nothing linking the two. $logger = abj_service('logging'); if (is_object($logger) && method_exists($logger, 'warnCaught')) { $logger->warnCaught('Admin-status re-check threw; failing closed to non-admin.', $e); } return false; } } /** * The weakest rungs: the current WordPress user, then network super-admin. * * @return bool */ private static function askWordPress(): bool { if (function_exists('wp_get_current_user')) { $user = ABJ_404_Solution_UserRef::fromWpUser(wp_get_current_user()); if ($user !== null && $user->isAdministrator()) { return true; } } return function_exists('is_super_admin') && is_super_admin(); } }