Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: display the correct percentage-based progress #4049

mathetos opened this issue Mar 15, 2019 · 5 comments


None yet
5 participants
Copy link

commented Mar 15, 2019

Bug Report

User Story

As a Give user, I want to update to Give 2.4.3 and have my forms that show a progress bar as a percent to continue showing the correct progress donated to date.

Current Behavior

Currently, any form that had donations on it and it's progress bar is set to percents reflect a 0% progress while the progress bar itself is 100% full. This happens with any version above 2.4.1.

On Give 2.4.1

On Give 2.4.3

The current workaround for this is to use a different progress display style. Others work as intended, but the percentile does not.

Expected Behavior

The form progress percentile amount and progress bar should reflect the progress correctly.

Bug Type

  • This bug describes functionality that once worked as expected in version 2.4.1


Steps to Reproduce

  1. Be on Give 2.4.1 and have a form with donations on it with a Goal set to percentile. Confirm the progress bar works as intended.
  2. Update to Give 2.4.3 and view the form. Confirm that the progress amount and percentile are both wrong.
  3. Rollback to version 2.4.1 and the progress bar will be correct again.

It's possible that you do NOT need existing donations or progress bar to replicate this issue. It could just be that the percentile progress bar is wrecked even when set for the first time when on Give 2.4.2 or 2.4.3

Acceptance Criteria

  • The progress bar reflects correctly
  • If you rollback to 2.4.1, then apply this fix, the progress bar still works correctly (meaning the fix fixes it regardless of what version you start on)
  • The fix does not negatively impact the other display types for the progress bar. It continue to show as intended in all other display types as well.
  • If the form actually has 0% progress, then the progress bar is empty (the screenshot above suggests 0% is incorrectly showing a full progress bar, but this may just be a side effect of reading the progress incorrectly).
  • Added PHPUnit tests for all goal type.


Operating System
  • Platform: Microsoft Windows
  • Version: 10
  • Name: Chrome | Firefox | Safari | IE | Edge -- all browsers
  • Version: All versions
WordPress System Info ### WordPress Environment ###

Home URL: http://givecore.test
Site URL: http://givecore.test
WP Version: 5.1.1
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: ✔
WP Cron: ✔
Language: en_US
Permalink Structure: /%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: givecore.test
TLS Connection: Connection uses TLS 1.2
TLS Connection: Probably Okay
Server Info: nginx/1.10.1
PHP Version: 7.1.4
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.6.34
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
gzip: ✔
GD Graphics Library: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Give Configuration

Give Version: 2.4.3
Give 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
Give Cache: Enabled
Give Cache: ✔New Donation✔Donation Receipt✔New Offline Donation✔Offline Donation Instructions✔New User Registration✔User Registration Information✔Donor Note✔Email access
Upgraded From: 2.4.1
Test Mode: Enabled
Currency Code: USD
Currency Position: Before
Decimal Separator: .
Thousands Separator: ,
Success Page: http://givecore.test/donation-confirmation/
Failure Page: http://givecore.test/donation-failed/
Donation History Page: http://givecore.test/donation-history/
Give Forms Slug: /donations/
Enabled Payment Gateways: Offline Donation, PayPal Standard
Default Payment Gateway: Offline Donation
PayPal IPN Verification: Enabled
PayPal IPN Notifications: N/A
Donor Email Access: Enabled

Active Give Add-ons

Functionality Plugin: Unlicensed – by WordImpress – 0.1
Give - PDF Receipts: Unlicensed – by GiveWP – 2.3.3
Give - Per Form Confirmation Message: Unlicensed – by WordImpress – 0.1
WP Rollback: Unlicensed – by WordImpress – 1.5.1

Other Active Plugins

Transients Manager: by Pippin Williamson – 1.7.5
User Switching: by John Blackbourn & contributors – 1.4.0

Inactive Plugins

Advanced Gutenberg Blocks: by maximebj – 1.8.2
Better Click To Tweet: by Ben Meredith – 5.7.1
Block Gallery: by Rich Tabor – 1.1.5
Conditional Widgets: by Jason Lemahieu and Kevin Graeme (Cooperative Extension Technology Services) – 2.2
FacetWP: by FacetWP, LLC – 3.2.7
FV Player: by –
Give -- Custom Form Grid Targets: by Matt Cromwell – 0.1
Give -- Custom Form Grid Targets: by Matt Cromwell – 0.1
Give - Annual Receipts: by GiveWP – 1.0.0
Give - MailChimp: by WordImpress – 1.4.1
Give - Manual Donations: by GiveWP – 1.4.2
Give - Per Form Gateways: by WordImpress – 1.0.1
Give - Recurring Donations: by GiveWP – 1.8.3
Give - Stripe Gateway: by GiveWP – 2.1.2
Give - Tributes: by WordImpress – 1.5.0
Kadence Blocks - Gutenberg Page Builder Toolkit: by Kadence Themes – 1.2.2
Polylang: by Frédéric Demarle – 2.5.2
Simply Show Hooks: by Stuart O'Brien, cxThemes – 1.2.1
Stackable - Gutenberg Blocks: by Gambit Technologies, Inc – 1.11
Ultimate Addons for Gutenberg: by Brainstorm Force – 1.8.0
Widget Options: by Phpbits Creative Studio – 3.7.2
WPCore Plugin Manager: by Stuart Starr – 1.9.0
WPML Multilingual CMS: by OnTheGoSystems – 4.1.2

Active MU Plugins

Bypass Login: by Stephen Carnam – 1.1.0


Name: Storefront
Version: 2.4.2
Author URL:
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

@kevinwhoffman kevinwhoffman self-assigned this Mar 15, 2019

@kevinwhoffman kevinwhoffman changed the title fix: prevent progress bars set as a percentage from showing 100% progress fix: display the correct percentage-based progress Mar 15, 2019


This comment has been minimized.

Copy link
Member Author

commented Mar 15, 2019

Just noticed that you get an actionable error on the Forms overview screen for the forms that have a goal set as percentage. This should help identify the issue:

ravinderk added a commit that referenced this issue Mar 16, 2019

fix: display the correct percentage-based progress
This bug introduced by fix of this issue: #4020

ref #4049

This comment has been minimized.

Copy link

commented Mar 16, 2019

@JasonTheAdams This bug introduced by fix of this issue: #4020

I added a commit in release/2.4.4 to fix this issue. Please test it.

@JasonTheAdams We did not have tests to catch this issue , so can you update PHP tests also:

public function test_get_goal() {


This comment has been minimized.

Copy link

commented Mar 18, 2019

@ravinderk Wrapping my head around this. It does look like you added unit tests, so what additional tests are you asking me to add?


This comment has been minimized.

Copy link

commented Mar 18, 2019

@JasonTheAdams We have four types of goal options in the core. We are testing only the amount type of goal only. We need to add test for all type of goal type to catch possible bugs.

'amount' => __( 'Amount Raised', 'give' ),


This comment has been minimized.

Copy link

commented Mar 21, 2019

Resolved in this commit: 0d7cf3a

ravinderk added a commit that referenced this issue Mar 25, 2019

fix: display the correct percentage-based progress
This bug introduced by fix of this issue: #4020

ref #4049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.