Codeinwp / Codeinwp/templates-patterns-collection

Onboarding admin page crashes when Google font collection has fewer than five entries

Open
#510 4 comments 0 reactions 1 assignee View on GitHub

@girishpanchal30 is already working on this.

Since Aug 6, 2026.

  • #517 by @girishpanchal30 — merged
bug-report bug-report-triage crash-report
Dominant language
JavaScript
Stars
56
Forks
10
Avg merge
2d 2h
Merged PRs (30d)
6

Description

Summary

The onboarding admin page can terminate with ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 while loading Google-font styles.

Expected behavior: the onboarding page loads when the available Google font collection contains a small non-zero number of entries.

Actual behavior: the admin request crashes before the page can finish loading.

Impact: affected administrators cannot access the onboarding flow until the triggering font configuration is no longer present.

Customer context

  • Product / area: Templates Patterns Collection onboarding admin page
  • Version: 1.4.3
  • Environment: WordPress 7.0.2; PHP 8.3.32
  • Integration / third party: Google Fonts stylesheet loading
  • Reported error / symptom: ValueError: array_chunk(): Argument #2 ($length) must be greater than 0
  • Impact: 3 production occurrences across 1 site during the telemetry query window; request context was admin.

Reproduction notes

  1. Open the plugin onboarding admin screen.
  2. Arrange for the effective typography data to produce one through four unique Google font family names.
  3. Load the screen in PHP 8.3.32.

Observed in production telemetry for version 1.4.3; the exact site configuration is unavailable.

Diagnosis

Conclusion

Production telemetry provides a direct stack trace to TIOB\Admin::enqueue() at the product call to array_chunk(). The source computes the chunk length as absint( count( $this->google_fonts ) / 5 ); for one through four collected fonts, that evaluates to zero while the surrounding non-empty guard permits the call. PHP 8.3 then raises the reported ValueError. This is confirmed for the reported 1.4.3 implementation.

Where this likely occurs
  • includes/Admin.phpTIOB\Admin::enqueue() lines 724-758, especially lines 745-746. The onboarding-screen branch enqueues Google font styles and passes the computed count-based length into array_chunk().
  • includes/Admin.phpTIOB\Admin::get_font_parings() lines 1110-1135. The font-pair source can be filtered through neve_font_pairings, then Google body and heading font names are collected uniquely into $this->google_fonts.
  • includes/Admin.phpTIOB\Admin::init() lines 66-97 registers enqueue() on admin_enqueue_scripts and initializes the font collection through get_font_parings().
  • The expression was introduced in d921da08 and relocated without changing it in 5f5856dd. It remains byte-identical between tag v1.4.3 and the inspected HEAD.
Engineering notes
  • The fault is in the product repository, not the bundled Themeisle SDK; telemetry explicitly marks the SDK as outside the crash location.
  • The enclosing ! empty( $this->google_fonts ) condition excludes an empty collection but does not exclude a count below five.
  • The inspected collection comes from built-in pairs unless the available Neve filter changes it. The exact production font-pair configuration is unavailable, but the crash condition requires only a non-empty collection with fewer than five unique Google fonts.
  • The PHP runtime behavior is additionally evidenced by the production exception under PHP 8.3.32; no WordPress-core source was inspected.
Test coverage status
  • No relevant coverage was found during inspection for the small non-zero Google-font collection path or the stylesheet chunking behavior.
  • e2e-tests/specs/onboarding.spec.js lines 83-124 exercises onboarding typography rendering using the six mocked Google font pairs in e2e-tests/config/mocks.js lines 18-30, so it does not cover one through four unique fonts.
What to verify or explore next
  • May be worth reproducing the onboarding admin request with neve_font_pairings yielding one, two, three, and four unique Google font families.
  • May be worth running the onboarding Playwright suite after introducing a fixture representing a small non-zero font collection.
  • May be worth confirming behavior on supported PHP versions in addition to the reported PHP 8.3.32 environment.
Unknowns / follow-up
  • Telemetry does not include the site's effective neve_font_pairings payload or the precise admin URL, so the configuration that produced the reduced collection is unknown.
  • The available evidence does not establish whether this occurs only with filtered Neve typography pairs or through another supported configuration path.

Confidence

Confidence: 99/100

Production telemetry captures the uncaught ValueError in the product's TIOB\Admin::enqueue() at the exact array_chunk() call. Version 1.4.3 contains that expression unchanged, and its computed length is zero for a non-empty collection of one to four fonts.

Crash telemetry

Occurrences 3
Distinct sites 1
First seen 2026-08-04 18:32 UTC
Last seen 2026-08-04 23:22 UTC
Crash location product:includes/Admin.php:746
Request context admin
Inside Themeisle SDK no
Product versions 1.4.3
WP versions 7.0.2
PHP versions 8.3.32
SDK versions 3.3.59

Source: automated crash report — templates-patterns-collection, fingerprint 8f7d5b90e949269c32c3dc9662c5bdf3
Generated by bug-report-triage (ID: bug-report-triage_6a7422fe881a84.69892967)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.