Givewp: feat(admin-tool): Create new "Dry Run" functionality to test importing donation

Created on 28 Nov 2017  ยท  4Comments  ยท  Source: impress-org/givewp

Issue Overview

The Importer Test Mode doesn't work in Give 1.8.16

Expected Behavior

When "Test mode" is enabled, it should not import the donations, but show only the summary screen.

Current Behavior

The donations ARE imported.

Steps to Reproduce (for bugs)

  1. Ask me for a sample CSV that I've been working with.
  2. Upload that CSV
  3. Set the options for the import as follows:
    image

  4. Run the import and the donations will be imported

WordPress Environment

### WordPress Environment ###

Home URL: http://giveimporttest.dev
Site URL: http://giveimporttest.dev
WP Version: 4.9
WP Multisite: โ€“
WP Memory Limit: 512 MB
WP Debug Mode: โœ”
WP Cron: โœ”
Language: en_US
Permalink Structure: /%year%/%monthnum%/%day%/%postname%/
Show on Front: posts
Table Prefix Length: 3
Table Prefix Status: Acceptable
Admin AJAX: Inaccessible
Registered Post Statuses: publish, future, draft, pending, private, trash, auto-draft, inherit, refunded, failed, revoked, cancelled, abandoned, processing, preapproval

### Server Environment ###

Hosting Provider: DBH: 127.0.0.1, SRV: giveimporttest.dev
TLS Connection: Connection uses TLS 1.2
TLS Connection: Probably Okay
Server Info: Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.5.24
PHP Version: โŒ 5.5.24 - We recommend a minimum PHP version of 5.6. See: PHP Requirements in Give
PHP Post Max Size: 512 MB
PHP Time Limit: 600
PHP Max Input Vars: 5000
PHP Max Upload Size: 512 MB
cURL Version: 7.40.0, OpenSSL/1.0.1l
SUHOSIN Installed: โ€“
MySQL Version: 5.6.24
Default Timezone is UTC: โœ”
fsockopen/cURL: โœ”
SoapClient: โœ”
DOMDocument: โœ”
gzip: โœ”
GD Graphics Library: โœ”
Multibyte String: โœ”
Remote Post: โœ”
Remote Get: โœ”

### Give Configuration ###

Give Version: 1.8.16
Upgraded From: โ€“
Test Mode: Enabled
Currency Code: USD
Currency Position: Before
Decimal Separator: .
Thousands Separator: ,
Success Page: http://giveimporttest.dev/donation-confirmation/
Failure Page: http://giveimporttest.dev/donation-failed/
Donation History Page: http://giveimporttest.dev/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
Admin Email Notifications: Enabled
Donor Email Access: Enabled

### Session Configuration ###

Give Use Sessions: Enabled
Session: Disabled

### Active Give Add-ons ###


### Other Active Plugins ###

Debug Bar: by wordpressdotorg โ€“ 0.9
Debug Bar Console: by koopersmith โ€“ 0.3
Debug Bar List Script & Style Dependencies: by Per Soderlind โ€“ 1.1
Debug Bar Post Meta: by whyisjake โ€“ 0.5.4
Give - Hook Helper: by Ravinder Kumar โ€“ 1.0
Query Monitor: by John Blackbourn โ€“ 2.17.0
Transients Manager: by Pippin Williamson โ€“ 1.7.3

### Inactive Plugins ###


### Theme ###

Name: Twenty Sixteen
Version: 1.4
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

All 4 comments

It's confusing that it's called "Test mode" then. It should be called something like "Dry run" - let's discuss @raftaar1191 before you continue working on this one.

@raftaar1191 after discussing with @mathetos here's how to proceed on this issue:

Testing Mode and New "Dry Run" Feature

Step 1

Shift the functionality you developed into a new "Dry Run" feature which allows you to "test" how an import will work to view duplicates and what items will be created before actually _importing_ any data.

Add new "Dry Run" Checkbox

importer-dry-run-checkbox

Notice: I also changed the button text and touched up the styles. Please add this as well to the UI.

Change description of "Test Mode" option

Description should be:

Choose whether you would like the imported donations to be created in test mode or not.

Note: This option should be _disabled_ by default.

Step 2

Add a new "Dry Run" summary page.

When a "Dry Run" is performed the end result should be a summary page like so:

importer-dry-run

  1. No data is created
  2. Report is accurate reflection of live import
  3. Admin can easily run actual import or tweak CSV and try dry run again

For now, I am entering the donations in the DB and once it gets completed I will again delete all the donation entry

Will create another issue that will be refracting the Importer donation Dry run in which no entry will be added to DB

I'm bumping this to 2.0 milestone.

Was this page helpful?
0 / 5 - 0 ratings