woocommerce / woocommerce-gateway-stripe

The official Stripe Payment Gateway for WooCommerce
https://wordpress.org/plugins/woocommerce-gateway-stripe/
235 stars 206 forks source link

Disabling WooCommerce Core and then Stripe causes a Critical Error. #2542

Closed gabriel-fuentes closed 9 months ago

gabriel-fuentes commented 1 year ago

Summary:

Disabling WooCommerce Core first and then WooCommerce Stripe Payment Gateway from the plugin dashboard causes a Critical Error.

Error log:

PHP Fatal error:  Uncaught Error: Class 'WC_Stripe_Inbox_Notes' not found in \wp-content\plugins\woocommerce-gateway-stripe\woocommerce-gateway-stripe.php:724
Stack trace:
#0 \wp-includes\class-wp-hook.php(308): wcstripe_deactivated(false)
#1 \wp-includes\class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#2 \wp-includes\plugin.php(517): WP_Hook->do_action(Array)
#3 \wp-admin\includes\plugin.php(814): do_action('deactivate_wooc...', false)
#4 \wp-admin\plugins.php(209): deactivate_plugins('woocommerce-gat...', false, false)
#5 {main}
  thrown in \wp-content\plugins\woocommerce-gateway-stripe\woocommerce-gateway-stripe.php on line 724

Platform(s) Affected:

WooCommerce Stripe Payment Gateway (v-7.0.2) and WooCommerce Core (v-7.3.0).

Steps to Reproduce:

  1. Install and activate WooCommerce.
  2. Install and activate WooCommerce Stripe Payment Gateway.
  3. Disable WooCommerce.
  4. Disable WooCommerce Stripe Payment Gateway.

Expected behavior

It shouldn't cause a critical error.

Isolating the problem

Affected Forum thread

https://wordpress.org/support/topic/fatal-error-wc_stripe_inbox_notes/

WordPress Environment

``` ` WordPress Environment WordPress address (URL): http://preview/projects/woocommerce Site address (URL): http://preview/projects/woocommerce WC Version: 7.3.0 REST API Version: ✔ 7.3.0 WC Blocks Version: ✔ 9.1.5 Action Scheduler Version: ✔ 3.4.0 Log Directory Writable: ✔ WP Version: 6.1.1 WP Multisite: – WP Memory Limit: 512 MB WP Debug Mode: ✔ WP Cron: ✔ Language: en_US External object cache: – Server Environment Server Info: Apache/2.4.46 (Win64) PHP/7.3.27 mod_fcgid/2.3.10-dev PHP Version: 7.3.27 PHP Post Max Size: 32 MB PHP Time Limit: 120 PHP Max Input Vars: 2500 cURL Version: 7.70.0 OpenSSL/1.1.1k SUHOSIN Installed: – MySQL Version: 5.5.5-10.4.10-MariaDB Max Upload Size: 32 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ Database WC Database Version: 7.3.0 WC Database Prefix: wp_ Total Database Size: 1.85MB Database Data Size: 1.71MB Database Index Size: 0.14MB wp_woocommerce_sessions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_api_keys: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_order_items: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_order_itemmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_tax_rates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_actionscheduler_actions: Data: 0.01MB + Index: 0.02MB + Engine MyISAM wp_actionscheduler_claims: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_actionscheduler_groups: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_actionscheduler_logs: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_commentmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_comments: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_links: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_options: Data: 1.56MB + Index: 0.04MB + Engine MyISAM wp_postmeta: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_posts: Data: 0.01MB + Index: 0.01MB + Engine MyISAM wp_rm_fields: Data: 0.08MB + Index: 0.00MB + Engine MyISAM wp_rm_forms: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_rm_front_users: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_rm_login: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_rm_login_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_rm_notes: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_rm_paypal_fields: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_rm_paypal_logs: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_rm_reports_notifications: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_rm_rows: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_rm_rules: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_rm_sent_mails: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_rm_sessions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_rm_stats: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_rm_submissions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_rm_submission_fields: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_rm_tabs: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_rm_tasks: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_rm_task_exe_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_termmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_terms: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_term_relationships: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_term_taxonomy: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_usermeta: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_users: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine MyISAM wp_wc_admin_note_actions: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_wc_category_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_customer_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_download_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_order_coupon_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_order_product_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_order_stats: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_order_tax_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_product_attributes_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_product_download_directories: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_wc_product_meta_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_rate_limits: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_reserved_stock: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_tax_rate_classes: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_wc_webhooks: Data: 0.00MB + Index: 0.00MB + Engine MyISAM Post Type Counts attachment: 2 page: 10 post: 1 revision: 1 wporg_custom_field: 1 Security Secure connection (HTTPS): ❌ Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates. Hide errors from visitors: ✔ Active Plugins (2) WooCommerce Stripe Gateway: by WooCommerce – 7.0.2 WooCommerce: by Automattic – 7.3.0 Inactive Plugins (0) Settings API Enabled: – Force SSL: – Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – Enforce Approved Product Download Directories: ✔ Order datastore: WC_Order_Data_Store_CPT WC Pages Shop base: #11 - /shop/ Cart: #12 - /cart/ Checkout: #13 - /checkout/ My account: #14 - /my-account/ Terms and conditions: ❌ Page not set Theme Name: Storefront Version: 4.2.0 Author URL: https://woocommerce.com/ Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ✔ Templates Overrides: – Admin Enabled Features: activity-panels analytics coupons customer-effort-score-tracks experimental-products-task experimental-import-products-task experimental-fashion-sample-products shipping-smart-defaults shipping-setting-tour homescreen marketing multichannel-marketing mobile-app-banner navigation onboarding onboarding-tasks remote-inbox-notifications remote-free-extensions payment-gateway-suggestions shipping-label-banner subscriptions store-alerts transient-notices woo-mobile-welcome wc-pay-promotion wc-pay-welcome-page Disabled Features: minified-js new-product-management-experience settings Daily Cron: ✔ Next scheduled: 2023-01-20 21:02:53 +00:00 Options: ✔ Notes: 50 Onboarding: skipped Action Scheduler Complete: 15 Oldest: 2022-12-21 15:48:31 +0000 Newest: 2023-01-20 18:53:57 +0000 Pending: 1 Oldest: 2023-01-21 18:52:57 +0000 Newest: 2023-01-21 18:52:57 +0000 Status report information Generated at: 2023-01-20 18:54:16 +00:00 ````
MuhammadFaizanHaidar commented 1 year ago

Hey can we not handle this scenario by adding a following check if ( class_exists( 'WC_Stripe_Inbox_Notes' ) && WC_Stripe_Inbox_Notes::are_inbox_notes_supported() ) {} As I can see this class is in WooCommerce and when Woocommerce deactivates this function is called. I think quick fix cab be a class check.

mikkowus commented 1 year ago

I just had this error happen and now I can't install woocommerce anymore. What is the fix exactly? does anyone have a guide?

mikkowus commented 1 year ago

Scratch that. Here is some more information. I previously had woocommerce 6 installed. I managed to uninstall it but stripe would not deactivate or delete. Now, I have woocommerce 7.8 installed but now I can't activate it

mikkowus commented 1 year ago

update #3 I managed to deactivate and delete stripe after updating the woocommerce database

Grantrocks commented 8 months ago

I got the issue still.

wjrosa commented 8 months ago

I got the issue still.

Hi @Grantrocks . Can you give more details, please? Which steps did you follow to see this error?

Edusense777 commented 7 months ago

Hi - I have the same issue - a critical error message for woocommerce strip gateway, when I try to deactivate. I am on WP.Org and I realised the plugin isn't compatible. Unable to rectify my mistake by using a different plugin as need to deactivate the Stripe gateway plugin first. I am not techy at all, so completely stumped. Any guidance would be gratefully received.

wjrosa commented 7 months ago

Hi - I have the same issue - a critical error message for woocommerce strip gateway, when I try to deactivate. I am on WP.Org and I realised the plugin isn't compatible. Unable to rectify my mistake by using a different plugin as need to deactivate the Stripe gateway plugin first. I am not techy at all, so completely stumped. Any guidance would be gratefully received.

To fix the issue you need to install the latest version of the extension. Why isn't it compatible? Can you elaborate, please?

Edusense777 commented 7 months ago

Hi Wesley - thanks for taking the time to advise - you're right the solution was found in updating to the latest version. The plug-in then became compatible.

wjrosa commented 7 months ago

Hi Wesley - thanks for taking the time to advise - you're right the solution was found in updating to the latest version. The plug-in then became compatible.

That's great to read! Thanks for letting me know