CARVIEW |
Opened 3 weeks ago
Last modified 8 hours ago
#64009 new defect (bug)
wp_die() status code global updates (parent ticket)
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
Just detailing an issue that was originally raised back in #12529 where across the code base there are multiple instances of the wp_die()
function not including a status code. This causes all of these function calls to be logged as a 500
error. However as this is not always the case, this ticket aims to resolve this historical issue within the codebase by suggesting updated status codes for each request. As there are multiple areas that this will cover, I have broken this down into multiple tickets covering the various components here on trac. As of such I will create tickets covering each of the following areas:
- Media: 4 files - 12 changes
- Menus: 3 files - 4 changes
- Network and Sites: 15 files - 42 changes
- Options: 9 files - 10 changes
- Plugins: 4 files - 14 changes
- Posts, Post Types: 6 files - 20 changes
- REST API: 2 files - 133 changes
- Themes: 3 files - 5 changes
- Upgrade/Install: 3 files - 26 changes
- Users: 4 files - 8 changes
There are also other files I have taken a look through, and I have not categorised into components yet, so will update this ticket once I have them ready.
In regards to each of the tickets created I will be going into a more thorough breakdown of the function usage across each of the files. Also please note this work does not try to change every instance of wp_die()
, but those that could benefit from a more apprioriate response code.
Historical tickets related to this issue:
Change History (5)
#1
@callumbw95
3 weeks ago
#2
@johnbillion
3 weeks ago
- Version trunk deleted
I'm generally in favour of these changes.
One thing to note is that if any of the wp_die()
calls relate to a private item that exists but is not accessible to the user then the status code must not expose its existence. For example private posts, archived sites on a network, or non-public post types must not return a 403
.
#3
@johnjamesjacoby
2 weeks ago
+1, agree with @johnbillion
#4
@callumbw95
8 days ago
Hey all,
Please find an updated list of the child tickets, and their PR's to make this easier to find across Trac. 😃
Component | Trac Ticket | PR |
Media | #64010 | 9966 |
Menus | #64011 | 9967 |
Network and Sites | #64021 | 9993 |
Options | #64023 | 9994 |
Plugins | #64024 | 9996 |
Posts, Post Types | #64025 | 9997 |
REST API | #64032 | 10015 |
Themes | #64057 | 10096 |
Upgrade/Install | #64058 | 10097 |
Users | #64059 | 10098 |
I believe I have managed to not expose anything with the status codes as mentioned by @johnbillion but I will need another set of eyes to double check each of these tickets please.
Media Component Ticket: 64010