#17975 closed defect (bug) (fixed)
_default_wp_die_handler css referencing logic is fragile and doesn't always work
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.3 |
| Component: | General | Version: | 3.2 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: |
Description
The logic for determining where the install and install-rtl css files are in the default wp_die handler is fragile and breaks relatively easily.
For example calling wp_die in sunrise.php in a multisite install when someone accesses anywhere except for the root of a site.
The best solution to this is to move the CSS inline and remove all the wp-admin determining logic from the code.
Attachments (5)
Change History (24)
Added a patch with type="text/css" for the <style> tag because I'm a pedant.
- Resolution set to fixed
- Status changed from new to closed
In [18534]:
comment:4
SergeyBiryukov — 22 months ago
- Milestone changed from Future Release to 3.3
- Resolution fixed deleted
- Status changed from closed to reopened
This has removed some styles which are used by the config creater, The installer error pages might also be affected.
Specifically, h1 styling, list styling, button styling and the fonts don't seem right, Simplest way to see this is to attempt an install with incorrect credentials, the next page uses the most missing styles.
Once I've started going through this, I've got at least another 100 lines of CSS which the installer uses.
My suggestion here is to re-instate the wp-admin guessing, or at least part of it, If we can tell for 100% certaintity the location of the CSS files, use them, otherwise fall back to the minimal inline styles.
POC patch coming up..
Another reason why the installer can't just have all the CSS inline, the Go back button backgrounds are set via CSS backgrounds, causing the admin path needing to be known anyway.
An alternate suggestion would be to pass the admin stylesheet in via the $args, and fallback to the inline styles if thats not provided.. but feels like that'd break too under certain conditions.
maybe the installer should not use wp_die to displayerror messages and instead display the itself?
maybe the installer should not use wp_die to displayerror messages and instead display the itself?
I completely agree with you there actually, the validation errors should be inline, and i'll be attacking that in a seperate ticket shortly i think.
That being said, The wp_die() instance I was refering to there comes directly from wpdb, and I expect a number of plugins which utilise wp_die() expect the h1 and button stylings at least.
The suggested patch from me could be vastly simplified, instead, if it just checked for admin_url() being valid and enqueued the stylesheet then perhaps..
comment:10
follow-up:
↓ 11
dd32 — 21 months ago
The wp_die styling changes have also affected The "no configuration file exists" screen along with the Database upgrade screen.
comment:11
in reply to:
↑ 10
SergeyBiryukov — 21 months ago
comment:12
ocean90 — 19 months ago
- Keywords 2nd-opinion added; 3.3-early westi-likes commit removed
Related: #18866
comment:13
ocean90 — 19 months ago
- Keywords needs-refresh dev-feedback added; has-patch 2nd-opinion removed
Closed as a dup #18866.
comment:14
ocean90 — 18 months ago
Question is stylesheet or inline style?
Styles for installation screens were revamped in [19297].
The only regression is that "Create a Configuration File" is now a link rather than a button, the rest seems good.
SergeyBiryukov — 18 months ago
comment:16
westi — 18 months ago
- Keywords needs-patch added; needs-refresh dev-feedback removed
17975-create-config-button-style.diff fixed the create a config button for me.
If everyone is happy with this patch I think we can then close off this ticket.
17975.button.patch is a slightly updated olleicua's patch from #18866. Removed unneeded vendor prefixes for border-radius as per azaozz's comment in #18576.
17975-create-config-button-style.diff seems to be more comprehensive and matches 3.2 style better.
comment:18
westi — 18 months ago
- Resolution set to fixed
- Status changed from reopened to closed
In [19417]:
comment:19
dd32 — 14 months ago
In [20209]:

type="text/css" for validation