Frontend header rendering can exhaust memory while collecting hooked markup

Abierto
#4,674 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
php, wordpress

Línea de trabajo

Start by reading header.php around lines 87-107 and the diff of commit a4aab6352331047a851fc1926f06e53bd57901b5, which added the output-buffer collection step in 4.2.17; compare it against the 4.2.16 template. Run tests/test-neve-global-header-footer.php, especially test_header_wrapper_is_rendered_when_enabled() and the disabled-header hook tests, then try to reproduce with large hook output under a 15 MiB limit. Done looks like header rendering no longer retaining all hook markup in memory while the existing hook tests still pass.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug-report bug-report-triage crash-report

Summary

A frontend request on Neve 4.2.17 exhausted PHP memory while rendering the header. The expected behavior is for the frontend request to render without a fatal error within the site's available memory; instead, PHP reported that the 15 MiB limit was exhausted while an additional 2 MiB was being allocated. The affected request failed.

Customer context

  • Product / area: Neve theme, frontend header rendering
  • Version: 4.2.17
  • Environment: WordPress 7.1.3; PHP 8.2.35; reported PHP memory limit 15 MiB
  • Integration / third party: Not provided
  • Reported error / symptom: Allowed memory size of 15728640 bytes exhausted (tried to allocate 2097152 bytes) at header.php:107
  • Impact: 15 occurrences across one site in the telemetry window; frontend requests failed.

Reproduction notes

No manual reproduction or structured stack trace was provided. Telemetry reports the failure on a frontend request running Neve 4.2.17 at header.php:107. The site configuration, header-hook callbacks, and their output are unavailable; a comparison against v4.2.16 under the same conditions has not been performed.

Diagnosis

Conclusion

Neve 4.2.17 adds an output buffer around the header hooks and converts all captured output to a string at the reported fatal line. This creates a new in-memory retention step on the affected path and is consistent with the reported memory exhaustion. The exact callback output and memory usage before reaching this line are unknown, so the connection is strongly supported by the code path and version timing but is not a site-level reproduction.

Where this likely occurs
  • header.php — header.php template, approx. lines 87–107: starts buffering, runs the before-header, header, and after-header hooks, then collects the accumulated markup into a string.
  • Commit a4aab6352331047a851fc1926f06e53bd57901b5, included in v4.2.17, introduced this buffering path; the preceding v4.2.16 header template emitted the hook output without this collection step.
Engineering notes

The buffer is started before the hook calls and is collected whether the regular header is enabled or disabled. Thus output from callbacks, including integration callbacks, remains in memory until the collection operation. The single-site report and 15 MiB configured limit constrain the demonstrated scope; telemetry did not capture a stack trace or callback output details.

Test coverage status

tests/test-neve-global-header-footer.php — test_header_wrapper_is_rendered_when_enabled() approx. lines 295–300 and the disabled-header hook tests approx. lines 348–371 — verify rendered markup and hook retention. No relevant memory-pressure or large-hook-output coverage was found during inspection.

What to verify or explore next
  • Check whether the fatal recurs with Neve 4.2.17 when header callbacks emit substantial markup under a 15 MiB memory limit.
  • Compare frontend memory use and outcome between v4.2.16 and v4.2.17 with the same callbacks and site configuration.
  • Identify which callbacks and output were active on the reported site, if that telemetry becomes available.
Unknowns / follow-up

The callback source and size of buffered markup are unavailable. The amount of PHP memory already in use before the header template runs is also unknown.

Confidence

Confidence: 80/100

Neve 4.2.17 introduced output buffering on the reported header path, and the first fingerprint fails at the buffer-to-string operation; the webfont-loader fingerprint lacks evidence of a product defect and is omitted.

Crash telemetry

Occurrences 15
Distinct sites 1
First seen 2026-10-23 06:33 UTC
Last seen 2026-10-25 23:53 UTC
Crash location product:header.php:107
Request context frontend
Inside Themeisle SDK no
Product versions 4.2.17
WP versions 7.1.3
PHP versions 8.2.35
SDK versions 3.3.68

Source: automated crash report — neve, fingerprint 536b7af6a49954c3a01c455e52c022d8
Generated by bug-report-triage (ID: bug-report-triage_6adeed36f411c7.94695975)

Lenguaje dominante
PHP
Estrellas
307
Forks
89
Merge medio
2 d 20 h
PR fusionados (30 d)
24

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Codeinwp/neve

Todos los issues de Codeinwp/neve

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.