WordPress.org

Make WordPress Core

Opened 23 months ago

#42773 new enhancement

Plugin/Theme editor does not return sufficient information when loopback request fails

Reported by: jamesgol Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9
Component: Plugins Keywords:
Focuses: Cc:
PR Number:

Description

The sandbox feature of the theme/plugin editor in 4.9 is a step in the right direction. Unfortunately there are many situations where the loopback request fails and there is no indication back to the user why that happened. The cURL/WP_Error response is just tossed away and a generic message is sent. Will attach a patch that at least returns the error message back to the user.

Additional improvements could be made, but I don't have the time to implement them:
Have a loopback test run before the file is saved to at least be sure that is available (save the result in a transient with a 60 sec ttl)
If that loopback fails, pop up a notice that the sandboxing feature is unavailable but have a checkbox to allow the user to force the edit to save.

Attachments (1)

42773.0.diff (615 bytes) - added by jamesgol 23 months ago.

Download all attachments as: .zip

Change History (1)

@jamesgol
23 months ago

Note: See TracTickets for help on using tickets.