It’s also worth noting that the plugin failing disabled WooCommerce, which then disabled 4 other WooCommerce-related plugins I’d installed. Basically, one of the more catastrophic fails of a plugin. Is it normal for WooCommerce to be deactivated?
The reinstall of WooCommerce merited deleting the actual plugin folder, as it was still there but not visible to the WP install.
Plugin Contributor
Ewout
(@pomegranate)
First of all, I’m sorry to hear that the plugin crashed on your site.
From your description of events, I think things actually happened in a different order: Our plugin does not have the power to deactivate WooCommerce, and even when our plugin crashes that would not deactivate WooCommerce. The fact that you had an empty woocommerce plugin folder (“as it was still there but not visible to the WP install.“) makes me suspect that a WooCommerce update was incomplete for some reason, causing our plugin to execute even though WooCommerce was not really ready for it. Our plugin depends on a few core WooCommerce functions, such as the one that triggered the fatal error: wc_get_order_statuses()
.
If you can verify that WooCommerce is currently installed correctly, I think you should be able to safely activate PDF Invoices & Packing Slips.
In all of this, I am assuming that the event that triggered this issue was the last WooCommerce update (4.3.0), is that correct? Did you install plugin updates one by one, or did you install multiple updates at once? Normally, the recommended order of installing/updating plugins would be to update extensions first, and then WooCommerce (since older versions of the extensions may not be compatible with the newer WooCommerce).
Thanks for your quick response. I never had said the WooCommerce folder was empty, only that the Fatal Error seems to have triggered a destructive happening to the WooCommerce installation itself. The error message I posted came as the only warning the site was experiencing difficulty. While the site’s front end continued to work, WooCommerce was now disabled and many top menu entries that corresponded to WooCommerce shop pages and/or products also became non-functional.
The circumstance around the plugin folder was that firstly, WooCommerce was completely corrupted somehow and not showing in Active or Disabled Plugins, suddenly. Attempting to install WooCommerce returned the “can’t install, directory already exists” – prompting me to look on the server and note that despite the presence of the WooCommerce dir under Plugins, it was not recognized by WordPress.
Your plugin was the most recent installation with very few other WooCommerce add-ons, and has twice now cited as the reason for the site crash – once yesterday and once about 2 weeks ago. Neither coincided with a WordPress Update, either, though I’m seeing your suggestion about plugin/extension updates as potentially problematic. The JetPack AutoUpdate (Plugins) could be doing a bulk update that I might assume would update WooCommerce before your plugin.
Did the error message reveal anything?
Error message: Uncaught Error: Call to undefined function WPO\WC\PDF_Invoices\Documents\wc_get_order_statuses() in /www/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/class-wcpdf-invoice.php:204
Thanks again
Plugin Contributor
Ewout
(@pomegranate)
Did the error message reveal anything?
Yes – as I wrote above that error will show up if PDF invoices determines WooCommerce to be active, while if it didn’t actually completely install correctly/completely, it may not have access to that particular function (wc_get_order_statuses()
) and thus crash.
I have built in a check for this function that I will include in the next release.
Our plugin does not handle any of the update process, and under normal circumstances, one plugin crashing should not have any effect on the installation/update of another plugin.
Also, the above error will only happen if WooCommerce is not installed/loaded correctly, which leads me to conclude that it can only have happened in that order (1) WooCommerce update not completing 2) PDF invoices crashing and reporting by email 3) Other plugins deactivated due to WooCommerce not present).
Now that crash of our plugin should certainly not happen so I will make sure that in the next update it won’t, but that doesn’t explain why the WooCommerce update failed and you may want to look into what happened there. I have not worked with JetPack AutoUpdate Plugins (mostly because of the aforementioned considerations regarding plugin interdependency but also because for example X.0 updates generally are more prone to errors), so I don’t know how that plays into this.