[wp-trac] [WordPress Trac] #39766: Plugin does not gracefully fail when editing active plugin causes fatal error

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


#39766: Plugin does not gracefully fail when editing active plugin causes fatal
error
-------------------------------------+-----------------------------
 Reporter:  ovann86                  |       Owner:  westonruter
     Type:  defect (bug)             |      Status:  closed
 Priority:  high                     |   Milestone:  4.9
Component:  Plugins                  |     Version:  4.7.2
 Severity:  normal                   |  Resolution:  fixed
 Keywords:  has-patch needs-testing  |     Focuses:  administration
-------------------------------------+-----------------------------
Changes (by westonruter):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 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/39766#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list