impress-org / givewp

GiveWP - The #1 Donation Plugin for WordPress. Easily accept donations and fundraise using your WordPress website.
https://givewp.com/
GNU General Public License v3.0
345 stars 191 forks source link

GiveWP version 2.7.3 has PHP Fatal error on delete #4981

Closed michaelbeil closed 4 years ago

michaelbeil commented 4 years ago

User Story

As an admin, I want to be able to delete GiveWP and don’t want to see a fatal error in the log.

Details

After updating to GiveWP version 2.7.3, I cannot delete GiveWP version 2.7.3 and see the following error:

PHP Fatal error:  Uncaught Error: Call to undefined function give_is_setting_enabled() in .../wp-content/plugins/give/uninstall.php:23
Stack trace:
#0 .../wp-admin/includes/plugin.php(1222): include()
#1 .../wp-admin/includes/plugin.php(956): uninstall_plugin('give/give.php')
#2 .../wp-admin/includes/ajax-actions.php(4545): delete_plugins(Array)
#3 .../wp-includes/class-wp-hook.php(287): wp_ajax_delete_plugin('')
#4 .../wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
#5 .../wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#6 .../wp-admin/admin-ajax.php(175): do_action('wp_ajax_delete in .../wp-content/plugins/give/uninstall.php on line 23

Expected Behavior

I should be able to delete GiveWP.

Steps to Reproduce

  1. Update to GiveWP version 2.7.3
  2. Attempt to delete GiveWP
  3. This notice is shown on the Plugins screen: Deletion failed: There has been a critical error on your website.Learn more about debugging in WordPress.
  4. View PHP Fatal error in error log

Visuals

Screen Shot deletion-failed

Additional Context

This was brought up on WordPress.org and I was able to replicate.

System Information

Details ### WordPress Environment ### Home URL: https://wpmssubdomains.local Site URL: https://wpmssubdomains.local WP Version: 5.4.2 WP Multisite: ✔ WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: ✔ Language: en_US Permalink Structure: /%year%/%monthnum%/%day%/%postname%/ Show on Front: posts Table Prefix Length: wp_ Table Prefix Length: 3 Table Prefix Status: Acceptable Admin AJAX: Accessible Registered Post Statuses: publish, future, draft, pending, private, trash, auto-draft, inherit, request-pending, request-confirmed, request-failed, request-completed, refunded, failed, revoked, cancelled, abandoned, processing, preapproval ### Server Environment ### Hosting Provider: DBH: localhost, SRV: wpmssubdomains.local TLS Connection: Server Info: nginx/1.16.0 PHP Version: 7.4.1 PHP Post Max Size: 1,000 MB PHP Time Limit: 1200 PHP Max Input Vars: 4000 PHP Max Upload Size: 1 MB cURL Version: 7.54.0, LibreSSL/2.6.5 SUHOSIN Installed: – MySQL Version: 8.0.16 Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ gzip: ❌ Your server does not support the gzopen function - this is used for file compression and decompression. GD Graphics Library: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### GiveWP Configuration ### GiveWP Version: 2.7.3 GiveWP Cache: Enabled Database Updates: All DB Updates Completed. Database Tables: ✔ wp_give_donors - 1.0✔ wp_give_donormeta - 1.0✔ wp_give_comments - 1.0✔ wp_give_commentmeta - 1.0✔ wp_give_sessions - 1.0✔ wp_give_logs - 1.0✔ wp_give_logmeta - 1.0✔ wp_give_formmeta - 1.0✔ wp_give_sequential_ordering - 1.0✔ wp_give_donationmeta - 1.0 GiveWP Cache: Enabled GiveWP Cache: ✔New Donation✔Donation Receipt✔New Offline Donation✔Offline Donation Instructions✔New User Registration✔User Registration Information✔Donation Note✔Email access Upgraded From: 2.7.2 Test Mode: Enabled Currency Code: USD Currency Position: Before Decimal Separator: . Thousands Separator: , Success Page: https://wpmssubdomains.local/donation-confirmation/ Failure Page: https://wpmssubdomains.local/donation-failed/ Donation History Page: https://wpmssubdomains.local/donation-history/ GiveWP Forms Slug: /donations/ Enabled Payment Gateways: Test Donation, Offline Donation, Stripe - Credit Card, Stripe - Checkout Default Payment Gateway: Test Donation PayPal IPN Verification: Enabled PayPal IPN Notifications: N/A Donor Email Access: Enabled Stripe Webhook Notifications: N/A ### Active GiveWP Add-ons ### ### Other Active Plugins ### Error Log Monitor: by Janis Elsts – 1.6.10 Really Simple SSL: by Really Simple Plugins – 3.3.4 ### Inactive Plugins ### Elementor: by Elementor.com – 2.9.14 GiveWP Donation Widgets for Elementor: by GiveWP – 1.1.1 Loco Translate: by Tim Whitlock – 2.4.0 Per-Form Confirmation Pages for GiveWP: by GiveWP – 1.1.1 Receipt Attachments for GiveWP: by GiveWP – 1.1.2 Say What?: by Lee Willis – 1.9.6 Simple Social Shout for GiveWP: by GiveWP – 1.1.1 Under Construction: by WebFactory Ltd – 3.80 ### Theme ### Name: Twenty Twenty Version: 1.4 Author URL: https://wordpress.org/ Child Theme: No – If you're modifying GiveWP on a parent theme you didn't build personally, then we recommend using a child theme. See: How to Create a Child Theme

Acceptance Criteria

kjohnson commented 4 years ago

@JasonTheAdams was spot on with the hunch to load the legacy service provider in uninstall.php, which is hooked into plugins_loaded and does not run during uninstall.

JasonTheAdams commented 4 years ago

Thanks, WordPress, you've done it again, hahah! So basically we just need to instantiate, register, and boot the LegacyServiceProvider in that specific context.

That sound about right, @kjohnson?