[wp-trac] [WordPress Trac] #14530: "Cheatin', uh?" is not helpful feedback for users or developers

WordPress Trac noreply at wordpress.org
Thu Sep 3 15:13:54 UTC 2015


#14530: "Cheatin', uh?" is not helpful feedback for users or developers
-----------------------------+-----------------------
 Reporter:  shidouhikari     |       Owner:
     Type:  enhancement      |      Status:  reopened
 Priority:  normal           |   Milestone:  4.4
Component:  Role/Capability  |     Version:
 Severity:  minor            |  Resolution:
 Keywords:  has-patch        |     Focuses:  ui
-----------------------------+-----------------------

Comment (by kraftbj):

 @paulwilde - wp_die() needs a little bit of love, IMO. I overlooked it
 until after all of these patches that wp_die accepts a number of args—
 `$message`, `$title`, `$args`. It is set so if an `int` is used for title
 or args, it'll use that as the HTTP response code (or it could be set
 within the `$args` array). I haven't seen the $title arg being used
 before—only response code as the second arg—so I made a poor assumption on
 what it could handle.

 Currently `$title` is only outputted as the html title of the wp_die
 response page. I think we could expand wp_die to output the `$title` as an
 `<h1>` and the $message within a `<p>` to mimic how these patches did it.

 The immediate goal of this ticket was to give context to the Cheatin'
 message. There is so much randomness in how wp_die is used within Core.
 There's plenty of permission-style checks that do not include the Cheatin'
 message at all (and I'm not suggesting they begin to now). Even though I
 discovered it after the fact, I'm still behind this ticket resolving as it
 did to get it shipped, to be frank. It's been open five years and if this
 method got enough thumbs up to move forward, I'm all about taking it and
 iterating tomorrow. :)

 I haven't looked for or opened tickets yet, but I think we can 1. discuss
 updating wp_die to output the title within the body. 2. "fix" these
 tickets to use the title arg of wp_die instead of manually indicating html
 and 3. audit the general use of wp_die (within core, plugins) to attempt
 to unify up the messaging, reduce strings, use wp_die's backlink function
 when applicable, etc.

 I'm going to poke around a bit more before making an actual proposal to
 attempt to ensure we're not missing anything and not encouraging increased
 usage of wp_die itself (as code should handle errors as gracefully as
 possible as often as possible).

--
Ticket URL: <https://core.trac.wordpress.org/ticket/14530#comment:84>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list