Support » Plugin: WP OPcache » Warnings in error log

  • Resolved dev999wp

    (@dev999wp)


    Hey,

    I’m using PHP8 and getting warnings in the logs using your plugin – it’s throwing the warning every request so hammering the logs.

    `” line 112PHP message: PHP Warning: Undefined array key “timestamp” in /plugins/flush-opcache/admin/class-flush-opcache-cached-files-list.php on line 112PHP message: PHP Warning: Undefined array key “timestamp” in /plugins/flush-opcache/admin/class-flush-opcache-cached-files-list.php on line 112

    Please can you try resolve at the earliest convenience.

    Many Thanks,
    D

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author nierdz

    (@mnttech)

    Hi,

    I didn’t know WP supports php 8. This is good news !
    I’ll try to reproduce this bug as soon as possible and fix it.

    Plugin Author nierdz

    (@mnttech)

    I just tried php 8.0 and I can’t reproduce this error.
    Did you try to restart php-fpm ?

    Thread Starter dev999wp

    (@dev999wp)

    Hi,

    Thanks for replying.

    It’s not an error – rather warnings in logs. You need to see your error.log file.

    On line 112 in flush-opcache/admin/class-flush-opcache-cached-files-list.php the timestamp array key is undefined. Can you please defined / set a default resolve the Undefined array key. That should solve it.

    Thanks,
    D

    fxeasy

    (@fxeasy)

    I am using PHP 8.0.3 LiteSpeed V7.8 CloudLinux 1.2 with no error, I’ve checked the error.txt. maybe a different PHP 8.x.x version or some caching plugin. please provide more details environment that will help the author.

    best regards

    Thread Starter dev999wp

    (@dev999wp)

    Environment STACK – NGINX >> PHP-FPM.

    PHP-FPM 8.0.6

    That error is saying LINE 112 in that file is not defined, which needs to be defined before usage / calling it. Hope that helps.

    I’d recommend looking into php defining array key, e.g. https://www.reddit.com/r/PHPhelp/comments/kgu9j6/elegant_way_to_avoid_undefined_array_key_warning/

    • This reply was modified 5 months ago by dev999wp.
    Plugin Author nierdz

    (@mnttech)

    Did you try to restart php-fpm ?

    The problem here is that timestamp can’t be undefined as it comes from opcache_get_status output which is an internal PHP function.

    That’s why I really insist on you try to restart php-fpm because it seems like a bug in PHP.

    Thread Starter dev999wp

    (@dev999wp)

    Yes, tried restart no difference.

    To be noted, I’m seeing this since your 4.X plugin update.

    Plugin Author nierdz

    (@mnttech)

    That’s a very weird bug… Could you run a php script like this one in your setup, save the html page and send it by email : n i e r d z @t g m a i l . c o m

    
    <?php
    
    phpinfo();
    
    echo '<pre>';
    var_dump(opcache_get_status());
    echo '</pre>';
    

    To be noted, I’m seeing this since your 4.X plugin update.

    That’s because in 3.x branch, I didn’t use this kind of information from PHP. I presume you see these warnings only on Cached files tab ?

    Plugin Author nierdz

    (@mnttech)

    Since I got no news I consider this resolved.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.