Support » Plugin: WP OPcache » New WP auto-update feature and WP OPcache

  • Resolved utrenkner

    (@utrenkner)


    I just read the release notes for WP 5.5 Beta 1 and was glad to see the new auto-update feature which will allow to – well – auto-update plugins/themes.

    Does anyone here know:

    • whether or not the new auto-update feature will include an opcache_reset option?
    • or else: whether WP OPcache will be triggered when auto-updates take place, i.e. would this plugin be able to prevent the nasty errors stemming from outdated opcache after plugin auto-updates?
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author nierdz

    (@mnttech)

    I just watched in code of 5.5beta1 and there is a function called wp_opcache_invalidate which appeared in 5.5 but this function does not seem to be used to clean up opcache after an update. I could be wrong cause I’m not really familiar with WP core and it’s a total mess…

    By the way, if this is confirmed I like your idea of hooking in auto-update to clean opcache. I didn’t look into this yet cause I didn’t find any documentation about it but as soon as it’s well documented, I’ll add this new hook (hopefully a hook will be added).

    Thread Starter utrenkner

    (@utrenkner)

    Now, I also took a look at the WP core code. It seems that new opcache-related code was introduced 2 weeks ago. They do not reset the whole opcache but rather use PHP’s opcache_invalidate function to selectively invalidate the opcache for individual files that have changed.

    Without such a mechanism auto-updates would be too risky to implement. But to me it looks like the new functionality works also on standard updates.

    The key commit including some explanation can be found here: https://github.com/WordPress/WordPress/commit/dd11076dc7867c985ab683462051929990105fbc

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘New WP auto-update feature and WP OPcache’ is closed to new replies.