Jalal:
I don’t know if your issue is related, but we recently started having some severe problems with the Media Library that had similar symptoms.
In our case this started with a customer who has downloadable products (PDF map files) that are sold in a WooCommerce shop. When we first moved them to this site we imported some 200 PDF files into the wp-content/uploads/woocommerce_uploads directories. After that, the customer had added another 100+ PDFs to the Media Library. This was OK till the end of last year.
At that time the Media Library starting taking a long time to come up and at times would fail to do so. We found that the Media Library was trying to generate thumbnails for a number of PDF files even though there were already thumbnail images there, and that those processes were timing out and showing a “Client Disconnect” error. It would continue to try to processes these PDF files every time we went to the Media Library, either directly or via WooCommerce.
One way we sorted this out was to watch the files currently in the /tmp directory on the system. Using a “watch ls -l /tmp” command we could see these PDFs being processed and could tell which ones they were.
We moved all of the PDF files to the WooCommerce directories and applied the code to stop processing of PDF thumbnails (which seems to only work with new files. That didn’t solve the problem and we found no way to tell WordPress to stop processing those PDF files, including the ones in the woocommerce_uploads directories.
We suspect the problem came up due to some very large PDF files and the update to process them into thumbnails. We also have noticed this problem starting to come up in some other sites, some with 1000 or more PDF files and that don’t have WooCommerce installed.
So, we were about one more PDF away from having some major Web sites become unmanageable and ended up having to add a feature to one of our plugins to provide a “File Library” separate from the Media Library and move all of the PDFs to that. That of course solved the problem, but didn’t fix the core issue. We now have to do the same with a number of other sites to keep them from failing and of course re-train the customers.
I checked in the bug reports but can’t find any that relate to this specifically. I’m interested in any other people having this specific problem before I file a new bug report.