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

Fatal error with wordpress multisite #8

Closed er2es closed 10 months ago

er2es commented 10 months ago

Describe the bug After updating from 3.7.0->3.7.1 get fatal errors on wordpress (6.4.1) multisite env. But on same server same php another wordpress site (no multisite) works fine.

To Reproduce Steps to reproduce the behavior: Upgrade from 3.7.0->3.7.1 on multisite env.

Expected behavior Plugin not cause fatal error.

Screenshots

Environment (please complete the following information):

Additional context Error logs after update: [22-Nov-2023 16:30:31 Europe/Budapest] PHP Fatal error: Uncaught Error: Class "DecaLog\Engine" not found in /var/www/html//apcu-manager/apcu-manager.php:132 Stack trace: 0 /var/www/html//wp-content/plugins/apcu-manager/apcu-manager.php(155): apcm_run() 1 /var/www/html/**/wp-admin/includes/plugin.php(2318): include_once('/var/www/html/') 2 /var/www/html//wp-admin/includes/plugin.php(663): plugin_sandbox_scrape() 3 /var/www/html//wp-admin/plugins.php(58): activate_plugin() 4 /var/www/html/**/wp-admin/network/plugins.php(13): require('/var/www/html/') 5 {main}

[22-Nov-2023 15:30:14 UTC] PHP Fatal error: Allowed memory size of 402653184 bytes exhausted (tried to allocate 4096 bytes) in /var/www/html//wp-includes/ms-network.php on line 32 [22-Nov-2023 15:30:14 UTC] PHP Fatal error: Allowed memory size of 402653184 bytes exhausted (tried to allocate 4096 bytes) in /var/www/html//wp-includes/pomo/streams.php on line 169 [22-Nov-2023 15:30:15 UTC] PHP Fatal error: Allowed memory size of 402653184 bytes exhausted (tried to allocate 4096 bytes) in /var/www/html//wp-includes/ms-network.php on line 32 [22-Nov-2023 15:30:15 UTC] PHP Fatal error: Allowed memory size of 402653184 bytes exhausted (tried to allocate 4096 bytes) in /var/www/html//wp-includes/pomo/streams.php on line 169 [22-Nov-2023 15:30:15 UTC] PHP Fatal error: Allowed memory size of 402653184 bytes exhausted (tried to allocate 4096 bytes) in /var/www/html//wp-includes/ms-network.php on line 32 [22-Nov-2023 15:30:15 UTC] PHP Fatal error: Allowed memory size of 402653184 bytes exhausted (tried to allocate 4096 bytes) in /var/www/html//wp-includes/pomo/streams.php on line 169 [22-Nov-2023 15:30:16 UTC] PHP Fatal error: Allowed memory size of 402653184 bytes exhausted (tried to allocate 262144 bytes) in /var/www/html/*****/wp-includes/class-wp-network.php on line 294

Pierre-Lannoy commented 10 months ago

Hello @er2es and thanks for the report. That's a very strange error. My first thoughts are the plugin download was corrupted or not complete… Can you try to manually update it and tell me if all needed directories are here? Thanks.

er2es commented 10 months ago

Hello @Pierre-Lannoy!

Thanks for quick reply.

So the ""DecaLog\Engine" not found" is my fault, i rename the plugin folder after the 500 error, and i forgot to rename it back ( i think) - so this is not relevant, cant reproduce.

However i debug the second part the log: "PHP Fatal error: Allowed memory size...." On our test envroiment i can reproduce this, after the plugin is activated. I think the problem is here: https://github.com/Pierre-Lannoy/wp-apcu-manager/commit/5018fc6835d8a89e845943ffd9ddf4d4c0d9762a#diff-2d61cb87c3e9ded3fd8a74e7fdf7d799aaaa59e00d2fc678c15375c362d0c35cR961 with the get_current_network_id() call. If i write '1' instead of 'get_current_network_id()' then the multisite work, otherwise get PHP Fatal error: Allowed memory size....

On the previous releases i cant find this function call (get_current_network_id()) - that's why I think this cause my problem

Pierre-Lannoy commented 10 months ago

OK. Your assumption seems right: if replacing get_current_network_id() call with a static value make the issue disappear, this call is the cause of issue. Let me investigate it…

Pierre-Lannoy commented 10 months ago

I confirm I can reproduce it. It's a bug. Currently working on a fix…

Pierre-Lannoy commented 10 months ago

Issue fixed @er2es . I will now monitor hit-rate evolution on my (multi-site) test instance and release the new version (3.7.2) before today 16:00 CET…

er2es commented 10 months ago

@Pierre-Lannoy thanks for the fix and the otherwise great plugin!

Pierre-Lannoy commented 10 months ago

You're welcome. If you like it, do not hesitate to make a review on wp.org 😉 BTW: the new version (3.7.2) is now released and distributed by wp.org directory. Can you give it a try and tell me if it fixes the mentioned issue?

er2es commented 10 months ago

I did not hesitate any longer with the rating :)

3.7.2 working fine! thanks!

Pierre-Lannoy commented 10 months ago

WOW ! Thank you so much for your feedback, and the review. Have a nice day.