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

WordPress Trac noreply at wordpress.org
Thu Sep 21 18:19:55 UTC 2017


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

 * keywords:  dev-feedback 2nd-opinion => needs-patch
 * priority:  normal => high
 * milestone:  Awaiting Review => 4.9


Comment:

 I'm able to reproduce this issue. The error detection logic does not seem
 to be reliable. More often than not when I edit a plugin's PHP file with
 any fatal error (syntax, missing function, throwing explicit exception)
 then somehow it seems PHP is just ignoring it when `activate_plugin()`
 [https://github.com/WordPress/wordpress-
 develop/blob/8436a4f11728bf1c58721ca2a953342f90df0e7c/src/wp-
 admin/includes/plugin.php#L560 does]:

 {{{#!php
 <?php
 include_once( WP_PLUGIN_DIR . '/' . $plugin );
 }}}

 I've tried switching it to an `include` or a `require` but there is no
 change. If I `file_get_contents()` on it before including it, then I see
 the file has the error in it. But when PHP actually loads it, then it
 doesn't complain. It's like PHP has a cache of the file in memory. I'm
 using VVV for testing with PHP 7.0.17.

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


More information about the wp-trac mailing list