Make WordPress Core

Opened 18 years ago

Closed 17 years ago

#6185 closed defect (bug) (wontfix)

Make dead_db()'s terse message more useful

Reported by: pishmishy's profile pishmishy Owned by: pishmishy's profile pishmishy
Milestone: Priority: normal
Severity: normal Version: 2.5
Component: General Keywords: database error has-patch
Focuses: Cc:

Description

I'm not sure why a terse output was desired from dead_db. The terse message isn't particularly helpful unless you know what problems can occur when trying to establish a database connection.

Attached patch removes the terse unfriendly message and uses wp_die() in all cases.

Attachments (1)

6185.patch (1.2 KB) - added by pishmishy 17 years ago.
Tidies up and documents terse error message

Download all attachments as: .zip

Change History (18)

#1 @pishmishy
18 years ago

  • Status changed from new to assigned

(As a useful note, #3471 gives some related background)

#2 @Nazgul
18 years ago

I think the terse output is there to prevent potentially leaking connection info to visitors when the DB server is down.

#3 @pishmishy
18 years ago

The message output by wp_die() discloses the same information as the terse message.

#4 @ryan
18 years ago

We also don't want WP branded messages. If a site is down, that message shows up in all kinds of places with our name on it.

#5 @westi
18 years ago

No the $wpdb->error message has the db host in it

-1 to the current patch.

With regard to #3471 - are we not returning the correct headers any more?

#6 @pishmishy
18 years ago

Doesn't appear to be branded in my version. The only mentions of WordPress are in the page's title, which can be fixed, and a link to the support forums.

#7 follow-up: @pishmishy
18 years ago

#3471 has nothing to do with this particular problem - just wanted to mention it as a note for myself.

I could replace the message passed to wp_die() if that's the only problem so far :-)

#8 in reply to: ↑ 7 ; follow-up: @Nazgul
18 years ago

Replying to pishmishy:

I could replace the message passed to wp_die() if that's the only problem so far :-)

Not the only one so far. ryan also noted this one:

We also don't want WP branded messages. If a site is down, that message shows up in all kinds of places with our name on it.

#9 in reply to: ↑ 8 @pishmishy
18 years ago

Replying to Nazgul:

Not the only one so far. ryan also noted this one:

I think I addressed that one. We could remove the link to the forums if it's felt necessary.

#10 @westi
18 years ago

The whole idea is that a viewer of an admin page gets a useful error message from WordPress and a viewer of a blog page gets a very plain db error message without any WordPress branding or linkage.

#11 @DD32
18 years ago

Basically, the point of the bland error page was to prevent general users associating a "Database Down" message with that of a WordPress message.

Eg, Digg; Everytime a poorly hosted WordPress install gets submitted, MySQL overloads itself, and WordPress cant connect, it flashes up a "WordPress database down" page, Everyones reaction? "Its another WordPress blog, of course it doesnt work, its absolutly useless", Yes; those people who say that should know better, but the simple fact is, they dont.

Its all about changing the general users view of what wordpress is, You dont want to associate negitive things like that with WordPress.

In its current form, a simple "Database Down" message which doesnt mention the hosting software, makes more sense, it gets whats wrong out there, and doesnt associate it with WordPress.

I'd nearly suggest mentioning MySQL in the error message myself..

#12 @pishmishy
18 years ago

  • Summary changed from Simplify dead_db() to use only wp_die() to Make dead_db()'s terse message more useful

I've created a new patch which I hope addresses mine and everyone else's concerns. I don't care much for mentioning WordPress in the error message either but I do want to provide a more helpful message to users.

#13 @Nazgul
18 years ago

The terse message should be directed at a passing visitor, not at the blog "owner".

The blog owner gets to see a more detailed message when he tries to go into the admin.

#14 @pishmishy
18 years ago

Now I've got even more questions :-) ...

If it's intended for visitors and not the user why do we even go as far as mentioning a database problem?

What about users who don't type the admin URL, and only know to follow the wp_loginout() link? I'm sure this is the case for most of my users (who admittedly are far from experts)

Why aren't we passing the terse message to wp_die()

#15 @darkdragon
18 years ago

The answer to your question is to make wp_die() themeable, so that, the custom solution is not needed.

@pishmishy
17 years ago

Tidies up and documents terse error message

#16 @pishmishy
17 years ago

I'm not sure we can/should theme wp_die(), we want this function to depend on as little as possible. I've added a new proposed patch that at least tidies up the code and returns the terse message through wp_die() rather than by including HTML all over again.

#17 @ryan
17 years ago

  • Milestone 2.9 deleted
  • Resolution set to wontfix
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.