Skip to content

Conversation

@bcotrim
Copy link
Contributor

@bcotrim bcotrim commented Oct 24, 2025

Related issues

Proposed Changes

  • Modified error message display in dialog boxes to show only the first line of error messages
  • Added import for simplifyErrorForDisplay utility function from src/lib/error-formatting.ts
  • Applied simplifyErrorForDisplay to error messages in showErrorMessageBox function
  • Prevents extremely tall dialog windows that can exceed screen height (e.g., 1600px vertical resolution)

Testing Instructions

  • On a site with the 2025 theme installed
  • Change WP version to 5.8.12 (modify the source code to allow that)
  • Change WP version to latest
  • Verify that the error dialog now shows only the first line of the error message instead of full stack traces
  • Confirm the dialog window height is reasonable and the close button is accessible
  • Verify that the "Open Studio Logs" button still provides access to full error details

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@bcotrim bcotrim self-assigned this Oct 24, 2025
@bcotrim bcotrim requested a review from a team October 24, 2025 10:43
@github-actions
Copy link
Contributor

github-actions bot commented Oct 24, 2025

📊 Performance Test Results

Comparing a7353c2 vs trunk

site-editor

Metric trunk a7353c2 Diff Change
load 9644.00 ms 11036.00 ms +1392.00 ms 🔴 14.4%

site-startup

Metric trunk a7353c2 Diff Change
siteCreation 14037.00 ms 14021.00 ms -16.00 ms 🟢 -0.1%
siteStartup 3958.00 ms 4918.00 ms +960.00 ms 🔴 24.3%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change

Copy link
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bcotrim for fixing this! All the errors now will have the short value now 🙌 . I have tested it, and it works as expected. I can see the first line in the dialog and the whole error in the logs. LGTM! :shipit:

Dialog Error log
Image Image

Copy link
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @bcotrim, I have been able to reproduce a similar error reported in the task and I still see the long height in the dialog.

What I have done is:

  1. On a site with the 2025 theme installed
  2. Change WP version to 5.8.12 (I modified the source code to allow that)
  3. Change WP version to latest
  4. Error displayed
Error changing WP version
CleanShot 2025-10-24 at 13 23 13@2x

This is the stack trace of the error in the logs:

Error trace
[2025-10-24T11:27:01.130Z][erro][ren1] Error changing WordPress version: Error: PHP.run() failed with exit code 255. 

=== Stdout ===
#!/usr/bin/env php


Deprecated: Return type of WP_Hook::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 498



Deprecated: Return type of WP_Hook::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 511



Deprecated: Return type of WP_Hook::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 524



Deprecated: Return type of WP_Hook::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 537



Deprecated: Return type of WP_Hook::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 548



Deprecated: Return type of WP_Hook::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 440



Deprecated: Return type of WP_Hook::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 454



Deprecated: Return type of WP_Hook::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 468



Deprecated: Return type of WP_Hook::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 485



Fatal error: Uncaught Error: Cannot access private property WP_SQLite_DB::$allow_unsafe_unquoted_parameters in /wordpress/wp-includes/wp-db.php:648
Stack trace:
#0 /wordpress/wp-includes/wp-db.php(648): wpdb->__get('allow_unsafe_un...')
#1 /wordpress/wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(386): wpdb->__get('allow_unsafe_un...')
#2 /wordpress/wp-includes/option.php(171): WP_SQLite_DB->prepare('SELECT option_v...', 'WPLANG')
#3 /wordpress/wp-includes/l10n.php(63): get_option('WPLANG')
#4 /wordpress/wp-includes/l10n.php(137): get_locale()
#5 /wordpress/wp-includes/l10n.php(828): determine_locale()
#6 /wordpress/wp-settings.php(516): load_default_textdomain()
#7 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1374): require('/wordpress/wp-s...')
#8 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1293): WP_CLI\Runner->load_wordpress()
#9 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#10 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/bootstrap.php(84): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#11 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/wp-cli.php(35): WP_CLI\bootstrap()
#12 phar:///tmp/wp-cli.phar/php/boot-phar.php(20): include('phar:///tmp/wp-...')
#13 /tmp/wp-cli.phar(4): include('phar:///tmp/wp-...')
#14 /tmp/run-cli.php(25): require('/tmp/wp-cli.pha...')
#15 {main}
thrown in /wordpress/wp-includes/wp-db.php on line 648



Fatal error: Uncaught Error: Cannot access private property WP_SQLite_DB::$allow_unsafe_unquoted_parameters in /wordpress/wp-includes/wp-db.php:648
Stack trace:
#0 /wordpress/wp-includes/wp-db.php(648): wpdb->__get('allow_unsafe_un...')
#1 /wordpress/wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(386): wpdb->__get('allow_unsafe_un...')
#2 /wordpress/wp-includes/option.php(171): WP_SQLite_DB->prepare('SELECT option_v...', 'WPLANG')
#3 /wordpress/wp-includes/l10n.php(63): get_option('WPLANG')
#4 /wordpress/wp-includes/l10n.php(137): get_locale()
#5 /wordpress/wp-includes/l10n.php(828): determine_locale()
#6 /wordpress/wp-includes/class-wp-fatal-error-handler.php(46): load_default_textdomain()
#7 [internal function]: WP_Fatal_Error_Handler->handle()
#8 {main}
thrown in /wordpress/wp-includes/wp-db.php on line 648

=== Stderr ===
PHP Deprecated: Return type of WP_Hook::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 498
PHP Deprecated: Return type of WP_Hook::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 511
PHP Deprecated: Return type of WP_Hook::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 524
PHP Deprecated: Return type of WP_Hook::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 537
PHP Deprecated: Return type of WP_Hook::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 548
PHP Deprecated: Return type of WP_Hook::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 440
PHP Deprecated: Return type of WP_Hook::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 454
PHP Deprecated: Return type of WP_Hook::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 468
PHP Deprecated: Return type of WP_Hook::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wordpress/wp-includes/class-wp-hook.php on line 485
PHP Fatal error: Uncaught Error: Cannot access private property WP_SQLite_DB::$allow_unsafe_unquoted_parameters in /wordpress/wp-includes/wp-db.php:648
Stack trace:
#0 /wordpress/wp-includes/wp-db.php(648): wpdb->__get('allow_unsafe_un...')
#1 /wordpress/wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(386): wpdb->__get('allow_unsafe_un...')
#2 /wordpress/wp-includes/option.php(171): WP_SQLite_DB->prepare('SELECT option_v...', 'WPLANG')
#3 /wordpress/wp-includes/l10n.php(63): get_option('WPLANG')
#4 /wordpress/wp-includes/l10n.php(137): get_locale()
#5 /wordpress/wp-includes/l10n.php(828): determine_locale()
#6 /wordpress/wp-settings.php(516): load_default_textdomain()
#7 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1374): require('/wordpress/wp-s...')
#8 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1293): WP_CLI\Runner->load_wordpress()
#9 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#10 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/bootstrap.php(84): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#11 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/wp-cli.php(35): WP_CLI\bootstrap()
#12 phar:///tmp/wp-cli.phar/php/boot-phar.php(20): include('phar:///tmp/wp-...')
#13 /tmp/wp-cli.phar(4): include('phar:///tmp/wp-...')
#14 /tmp/run-cli.php(25): require('/tmp/wp-cli.pha...')
#15 {main}
thrown in /wordpress/wp-includes/wp-db.php on line 648
PHP Fatal error: Uncaught Error: Cannot access private property WP_SQLite_DB::$allow_unsafe_unquoted_parameters in /wordpress/wp-includes/wp-db.php:648
Stack trace:
#0 /wordpress/wp-includes/wp-db.php(648): wpdb->__get('allow_unsafe_un...')
#1 /wordpress/wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(386): wpdb->__get('allow_unsafe_un...')
#2 /wordpress/wp-includes/option.php(171): WP_SQLite_DB->prepare('SELECT option_v...', 'WPLANG')
#3 /wordpress/wp-includes/l10n.php(63): get_option('WPLANG')
#4 /wordpress/wp-includes/l10n.php(137): get_locale()
#5 /wordpress/wp-includes/l10n.php(828): determine_locale()
#6 /wordpress/wp-includes/class-wp-fatal-error-handler.php(46): load_default_textdomain()
#7 [internal function]: WP_Fatal_Error_Handler->handle()
#8 {main}
thrown in /wordpress/wp-includes/wp-db.php on line 648

at onSiteEdit (http://localhost:5173/src/modules/site-settings/edit-site-details.tsx:110:19)

@bcotrim
Copy link
Contributor Author

bcotrim commented Oct 24, 2025

@epeicher thanks for finding that error, nice catch!
I've updated the testing instructions to follow your steps 🙇
I've addressed the issue, can you take another look, please?

@bcotrim bcotrim requested a review from epeicher October 24, 2025 13:19
Copy link
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bcotrim for fixing that! I have tested again with the same site, and I can see the error nicely formatted, while the logs contain the full trace. LGTM! :shipit:

CleanShot 2025-10-24 at 15 27 54@2x

@bcotrim bcotrim merged commit e767d4f into trunk Oct 24, 2025
13 checks passed
@bcotrim bcotrim deleted the stu-905-extreme-window-height-for-long-errors branch October 24, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants