OK, I’ve a support ticket open with SiteGround for an issue: “failed to open stream: Too many open files”. I’m working to get more information for support now (trying to get a debug backtrace).
It was certainly the page load when I clicked deactivate on SiteGround Optimizer when all the plugins deactivated. We’ve activated/deactivated other plugins without issue since then. My guess right now is deactivate function runs early on WordPress load (I presume – makes sense) and the clearing of the cache by you resulted in too many file handles being used before any plugins were loaded. Then as WordPress tried to load the active plugins, and each returned an error rather than the file, it proceeded to disable each.
PHP Warning: fopen(/home/customer/www/domain.com/public_html/wp-content/plugins/woocommerce/woocommerce.php): failed to open stream: Too many open files in /home/customer/www/domain.com/public_html/wp-includes/functions.php on line 6109
This also leads me to believe the issue is unrelated to any plugins I have installed.
I think WordPress could mitigate against this by doing a test fopen
on a known file before loading plugins. I might open an issue when I understand more.
You could mitigate against it by finishing your deactivate code with a check on a known file and run die()
if you encounter an error.