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
344 stars 191 forks source link

Resolve pagination issue in donation history page when recurring add-on is deactivated #3556

Closed raftaar1191 closed 6 years ago

raftaar1191 commented 6 years ago

User Story

As a Donor I do not want to see any pagination is there is no second page available when recurring add-on is deactivated

Current Behavior

I currently see pagination but I click on it I get a message "It looks like you haven't made any donations."

Expected Behavior

I expect no pagination when there is no second page

Steps to Reproduce

Check the Video

Visuals

Video Link: https://screencast-o-matic.com/watch/cFjnXnFS8X

image

image

Environment

WordPress System Info ### WordPress Environment ### Home URL: http://givewp.local Site URL: http://givewp.local WP Version: 4.9.7 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: givewp.local TLS Connection: Connection uses TLS 1.2 TLS Connection: Bad Server Info: nginx/1.10.1 PHP Version: ❌ 5.5.38 - We recommend a minimum PHP version of 5.6. See: PHP Requirements in Give PHP Post Max Size: 1,000 MB PHP Time Limit: 900 PHP Max Input Vars: 3000 PHP Max Upload Size: 1,000 MB cURL Version: ❌ 7.38.0, OpenSSL/1.0.1t - We recommend a minimum cURL version of 7.40. SUHOSIN Installed: – MySQL Version: ❌ 5.5.55 - We recommend a minimum MySQL version of 5.6. See: WordPress Requirements Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ gzip: ✔ GD Graphics Library: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Give Configuration ### Give Version: 2.2.1 Give Cache: Enabled Database Updates: All DB Updates Completed. Give Cache: Enabled Give Cache: ✔New Donation✔Donation Receipt✔New Offline Donation✔Offline Donation Instructions✔New User Registration✔User Registration Information✔Email access Upgraded From: – Test Mode: Enabled Currency Code: GBP Currency Position: Before Decimal Separator: . Thousands Separator: , Success Page: http://givewp.local/donation-confirmation/ Failure Page: http://givewp.local/donation-failed/ Donation History Page: http://givewp.local/donation-history/ Give Forms Slug: /donations/ Enabled Payment Gateways: Test Donation, Offline Donation Default Payment Gateway: Test Donation PayPal IPN Verification: Enabled PayPal IPN Notifications: N/A Donor Email Access: Enabled ### Active Give Add-ons ### ### Other Active Plugins ### ### Inactive Plugins ### ARMember Lite: by Repute InfoSystems – 1.3 BuddyPress: by The BuddyPress Community – 3.0.0 Caldera Custom Fields: by Caldera Labs – 2.2.1 Caldera Forms: by Caldera Labs – 1.5.9.1 CCAvenue Payment Gateway for WooCommerce: by Nilesh Chourasia – 2.3 Charitable: by WP Charitable – 1.6.1 Debug Bar: by wordpressdotorg – 0.9 Debug Bar Console: by koopersmith – 0.3 Debug Bar Cron: by Zack Tollman, Helen Hou-Sandi – 0.1.2 Debug Bar Extender: by Thorsten Ott, Automattic – 0.5 Developer: by Automattic – 1.2.6 Duplicate Post: by Enrico Battocchi – 3.2.2 Email Cop: by Ashfame – 0.1.1 Give - 2Checkout Gateway: by WordImpress – 1.1.1 Give - Authorize.net Gateway: by WordImpress – 1.4.2 Give - AWeber: by WordImpress – 1.0.3 Give - Braintree Gateway: by WordImpress – 1.2.2 Give - CCAvenue Gateway: by WordImpress – 1.0.1 Give - ConvertKit: by WordImpress – 1.0.2 Give - Currency Switcher: by WordImpress – 1.2.2 Give - Donation Upsells for WooCommerce: by WordImpress – 1.0.2 Give - Dwolla Gateway: by WordImpress – 1.1.2 Give - Email Reports: by WordImpress – 1.1.2 Give - Fee Recovery: by WordImpress – 1.7.2 Give - Form Countdown: by WordImpress – 1.0.1 Give - Form Field Manager: by WordImpress – 1.3 Give - Gift Aid: by WordImpress – 1.1.6 Give - Google Analytics Donation Tracking: by WordImpress – 1.2.0 Give - MailChimp: by WordImpress – 1.4.1 Give - Manual Donations: by WordImpress – 1.4.1 Give - Mollie Gateway: by WordImpress – 1.1.2 Give - Paymill Gateway: by WordImpress – 1.1 Give - PayPal Pro Gateway: by WordImpress – 1.1.6 Give - PDF Receipts: by WordImpress – 2.3 Give - Razorpay: by WordImpress – 1.1.4 Give - Recurring Donations: by WordImpress – 1.7.2 Give - Stripe Gateway: by WordImpress – 2.0.10 Give - Tributes: by WordImpress – 1.5.0 Give - Zapier: by WordImpress – 1.2.1 Gravity Forms: by rocketgenius – 2.2.6 Gravity Forms Signature Add-On: by Rocketgenius – 3.4 Loco Translate: by Tim Whitlock – 2.1.4 Log Deprecated Notices: by Andrew Nacin – 0.4 Log Viewer: by Markus Fischbacher – 14.05.04 Monster Widget: by Automattic – 0.3 PHP Compatibility Checker: by WP Engine – 1.4.5 Polylang: by Frédéric Demarle – 2.3.6 qTranslate-X: by qTranslate Team – 3.4.6.8 Query Monitor: by John Blackbourn & contributors – 3.0.1 RegistrationMagic: by Registrationmagic – 3.8.4.0 Rewrite Rules Inspector: by Daniel Bachhuber, Automattic – 1.2.1 User Switching: by John Blackbourn & contributors – 1.3.1 WooCommerce: by Automattic – 3.4.4 WordPress Beta Tester: by Peter Westwood – 1.2.2 WP DSGVO Tools: by Shapepress eU – 1.5.6 WP Hide & Security Enhancer: by Nsp Code – 1.4.9.1 WPML Multilingual CMS: by OnTheGoSystems – 3.9.4 WPS Hide Login: by WPServeur, NicolasKulka, tabrisrp – 1.3.4.2 ### Active MU Plugins ### Give - Development Plugin: by Raftaar1191 – 1.0.0 Local by Flywheel Relative URL (for Live Links): by Flywheel – 1.0 ### Theme ### Name: Twenty Seventeen Version: 1.6 Author URL: https://wordpress.org/ Child Theme: No – If you're modifying Give on a parent theme you didn't build personally, then we recommend using a child theme. See: How to Create a Child Theme
raftaar1191 commented 6 years ago

Finding

purchase_count and payment_ids columns are not getting updated when deactivating the recurring add-on.

Video Link: https://screencast-o-matic.com/watch/cFjnDYFWIg

mehul0810 commented 6 years ago

@DevinWalker @mathetos I've investigated on this issue and noticed that it is some kind of mismatch in Give Core and Recurring due to which we can say the donation history results are varying by enabling/disabling the recurring add-on.

I've couple of questions before proceeding further into implementing a fix for this issue.

  1. When only Give Core is enabled and shortcode [donation_history] is used. I can see all the donations listed in the donation history (i.e. donations with all the statuses, even abandoned). Is it the correct way to display all the donations of any status in donation history? I've discussed about it with @ravinderk and we think that it should only show the donations with complete and pending in donation history.
  2. Now, with the scenario in point (1), when I enable the recurring add-on then I can see the donations with status complete only which is weird. Hence, this is the reason behind the pagination not working properly.

Hence, I would like to know your thoughts that ideally donations with which statuses should be shown in donation history. Make sure you consider Offline Donations case as well.

mathetos commented 6 years ago

I believe the Donation History page needs to show ALL donations that came through regardless of their status but there are filters at the top, so the admin can choose to see only the Complete, Pending, Abandoned, etc. I didn't look yet but is there a filter there for "Recurring Donations" as well already? If not, then perhaps it should be.

The point is, if a donation has been processed by Give, then it needs to appear there whether an add-on is active or not. It's money that the site has processed with Give, and we need to reflect that accurately at all times, including in Reporting and CSV exports, etc.

How we do that exactly is up to you all, but from a user and NGO perspective, they don't want donations to go missing or hidden just because an add-on was disabled, it needs to be there at all times.

kevinwhoffman commented 6 years ago

I see mention of both the [donation_history] shortcode on the front end and the Donations page within WP Admin, and I think the two are being confused.

On tonight's call, let's determine which donations should be visible in the shortcode versus WP Admin and how pagination is handled in both.

mehul0810 commented 6 years ago

@kevinwhoffman I need some clarification on point (1) in acceptance criteria before submitting a PR. Can we have a quick call to discuss?

mehul0810 commented 6 years ago

Slack Call Summary

Participants: @mehul0810 @kevinwhoffman Topic: Discussion on some clarification on the issue Result: We have discussed having the support of renewal donations under donation history within Give Core and after discussion came to a conclusion that we should display the renewals donations as a part of the recurring add-on as it is working now.

Updated Acceptance Criteria

kevinwhoffman commented 6 years ago

I agree with @mehul0810's criteria. We have to assume if a user wants to accept or display recurring donations then they should have the Recurring Donations add-on activated. If they choose to stop accepting recurring donations, they can simply disable them in plugin settings and leave the plugin activated to display historical donations.

mehul0810 commented 6 years ago

Slack Call Summary

Participants: @mehul0810 @ravinderk Topic: Discussion on Stats API as it is a blocker of this issue. Result: After discussion with @ravinderk, we think that fetching count of only one time donations when the recurring add-on is disabled is difficult as we don't have any scope to store it separately which we can achieve in refactoring the Stats API. So, for now, this issue will be a blocker for stats API (https://github.com/impress-org/give/issues/3195).

kevinwhoffman commented 6 years ago

Closing. It would be extremely rare that a user would encounter incorrect pagination in the [donation_history] shortcode for a site that used Recurring Donations and then disabled it.