Pierre-Lannoy / wp-apcu-manager

APCu statistics and management right in the WordPress admin dashboard.
https://perfops.one/
GNU General Public License v3.0
6 stars 5 forks source link

activating/deactivating plugin using wpcli throws warnings #2

Closed tricarte closed 1 year ago

tricarte commented 2 years ago

Not actually a bug!

When the plugin is activated/deactivated using wpcli, it throws warnings saying that "Warning: apcu_cache_info(): No APC info available". Of course this is due to apcu info being not available to PHP cli sapi. Commands still work as expected, they just throw warnings. Some functions in class-apcu.php suppress warnings with "@" and check the returned array is actually an array such as name() but some do not such as reset() and get_all_objects().

Pierre-Lannoy commented 2 years ago

Hello @tricarte ! Thanks for the hint. Of course, you're right: if APCu is not enabled in cli conf (and it's quite common), there are some warnings. As you mentioned it has no influence on the operation of the plugin, but it's really uggly. I will try to fix it for the next release. Thanks again :)