[wp-trac] [WordPress Trac] #21622: Validate or sandbox theme file edits before saving them (as is done for plugins)

WordPress Trac noreply at wordpress.org
Fri Sep 22 01:35:12 UTC 2017


#21622: Validate or sandbox theme file edits before saving them (as is done for
plugins)
-------------------------+------------------------------
 Reporter:  eschwartz93  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Themes       |     Version:  2.7.1
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:  administration
-------------------------+------------------------------

Comment (by westonruter):

 In [changeset:"41560"]:
 {{{
 #!CommitTicketReference repository="" revision="41560"
 Plugin Editor: Improve reliability of detecting PHP fatal errors when
 editing an active plugin.

 * Invalidate PHP opcache after file is updated to ensure `include` will
 ''include'' the written changes.
 * Define `WP_ADMIN` when activating plugin in sandbox so plugin code
 targeting admin will be loaded.
 * Do actions that get triggered when loading the admin to ensure plugin
 code runs that could cause errors on plugin editor screen (and lock out
 access).
 * Fix ability to re-activate a plugin after editing a PHP file other than
 the main plugin file, and ensure PHP fatal error will be displayed in such
 cases.
 * Consolidate duplicated code into `plugin_sandbox_scrape()` and re-use in
 `activate_plugin()`.
 * Show an error notice instead of a success notice when a file is updated
 but a plugin was deactivated due to a fatal error.
 * Update style of warning when editing an active plugin to be styled as an
 actual warning notice.

 See #12423, #21622.
 Fixes #39766.
 }}}

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


More information about the wp-trac mailing list