wordpress it seem not reset opcache after plug-in/theme/core update.
For solve this issue i have set in the php.ini
opcache.validate_timestamps=1
all work correctly but validate_timestamps
when it's enabled, PHP will check the file timestamp each request with a performance degradation. When it's disabled, PHP files are NEVER checked for updated code. When wordpress updating code, new code files can get mixed with old ones, the results are unknown. It's unsafe as hell.
Why wordpress not perform an opcache_reset()
after each update?
alternatively... if I can call opcache_reset
on action upgrader_process_complete
, eg.:
if( extension_loaded('Zend OPcache') ){
add_action('upgrader_process_complete', 'opcache_reset', 1000, 0);
}
it is correct?