[wp-trac] [WordPress Trac] #36455: Invalidate files in opcode cache after plug-in, theme or core update

WordPress Trac noreply at wordpress.org
Fri Jun 19 07:57:55 UTC 2020


#36455: Invalidate files in opcode cache after plug-in, theme or core update
-------------------------------------------------+-------------------------
 Reporter:  nigro.simone                         |       Owner:
                                                 |  mikeschroder
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.5
Component:  Upgrade/Install                      |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing early        |     Focuses:
  commit                                         |
-------------------------------------------------+-------------------------

Comment (by ayeshrajans):

 Based on the latest patch, I made a few improvements:

  - Moved the regex file match to happen after the static `$can_invalidate`
 value check. This will prevent the regex from being executed if WordPress
 already knows to _not_ clear the cache.

  - Removed `phtml` file extension from the list. I don't know why the
 original author added it, but I checked whole WordPress source to make
 sure we don't have any `.phtml` files.

  - Optimized the regular expression to ensure the string is terminated.
 This to prevent files like `.phpunit.result.cache` files from being
 opcache-cleared.

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


More information about the wp-trac mailing list