Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#45974 closed enhancement (fixed)

wp_maintenance should use wp_die

Reported by: spacedmonkey's profile spacedmonkey Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.2 Priority: normal
Severity: normal Version: 3.0
Component: Bootstrap/Load Keywords: has-patch early
Focuses: Cc:


When maintenance mode is active, wp_die called, so the output can be filtered by plugins.

Attachments (1)

45974.diff (1.3 KB) - added by spacedmonkey 5 years ago.

Download all attachments as: .zip

Change History (11)

5 years ago

#1 @pento
5 years ago

What kind of plugins would be able to filter this output? wp_maintenance() is called before any plugins or dropins are loaded.

WP-CLI would be able to use it (for example, the enable_loading_advanced_cache_dropin filter was added for WP-CLI), similar custom loaders could do it, too.

#2 @afercia
5 years ago

  • Focuses accessibility removed

Not sure why this ticket focuses accessibility. Going to remove the focus to clean-up the accessibility report. If you feel this issue is related to web content accessibility and universal design, please do feel free to re-add it.

Last edited 5 years ago by afercia (previous) (diff)

#3 @spacedmonkey
5 years ago

  • Milestone changed from Awaiting Review to 5.2

In 5.1 wp_die received a number of improvements ( #45933 #46026 #46054 #46025 ). So using wp_die add the following improvements here.

  • Errors will be displayed in the correct format depending on the request, so xml, json, jsonp, xmlrpc and ajax request, will get the correctly formatted response.
  • WP_CLI would be able to use as @pento mentions above.
  • Error messages will be styled on look consistent with the rest of core.
  • Future improvements to wp_die will be reflected in the maintenance mode.
  • Correct cache control headers will be sent. (See #46054 )
  • As json request now handles better (see #45933), it means anything use REST API will error my gracefully (including Gutenberg).

The arguments can made for these tickets. #41655 #45975

I am making this as 5.2, in the hopes that is goes in.

#4 @SergeyBiryukov
5 years ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#5 @desrosj
5 years ago

  • Keywords early added
  • Milestone changed from 5.2 to 5.3

With 5.2 beta in 2 days, let's punt this so it can land early in 5.3 to be properly tested. @SergeyBiryukov if you are comfortable and feel that this is ready for 5.2, feel free to move back and commit.

#6 @SergeyBiryukov
5 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 45019:

Bootstrap/Load: Use wp_die() instead of hardcoded HTML in wp_maintenance(), so the output can be filtered by plugins.

Props spacedmonkey.
Fixes #45974.

#7 @SergeyBiryukov
5 years ago

  • Milestone changed from 5.3 to 5.2

With the beta delayed, moving back to 5.2.

#8 @SergeyBiryukov
5 years ago

In 45022:

PHPCS: Remove extra tab added in [45019].

See #45974.

#9 @spacedmonkey
5 years ago

  • Keywords needs-dev-note added

#10 @desrosj
4 years ago

  • Keywords needs-dev-note removed

Looks like this one never received a dev note. Going to remove needs-dev-note as the ship has already sailed.

Note: See TracTickets for help on using tickets.