Make WordPress Core

Opened 4 years ago

Last modified 4 years ago

#43335 new enhancement

Consistency for error reporting when theme is broken or not working

Reported by: bashaus Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.4
Component: Themes Keywords: close 2nd-opinion
Focuses: Cc:

Description

Even when WP_DEBUG is enabled, if a theme is missing or not appropriately configured, there is no error messaging to appropriately debug the issue. Whether this be on the frontend or in the error logs.

For example: if there's no database connection, the error message "Error Establishing a Database Connection" is displayed in a Heading 1. If no theme is found, the HTTP response body is blank.

To reproduce this issue:

  • Rename the folder of the active theme
  • Go to the homepage of the WordPress site

The recommendation of this ticket is to display an error message on the frontend and report to the error logs that rendering could not occur.

Change History (2)

#1 @ocean90
4 years ago

Related: #21931

#2 @SergeyBiryukov
4 years ago

  • Keywords close 2nd-opinion added

Hi @bashaus, welcome to WordPress Trac! Thanks for the report.

The recommendation of this ticket is to display an error message on the frontend

That's already the case, though the message is only displayed to logged-in users with switch_themes capability:

The theme directory "twentyseventeen" does not exist.

See the discussion in #21931. We could reconsider this, though I don't see any benefit in displaying the message for regular visitors, search engines, etc.

Note: See TracTickets for help on using tickets.