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

fix: make the link on the "you are already logged in" text go to a better spot #3957

Closed Benunc closed 5 years ago

Benunc commented 5 years ago

Bug Report

User Story

As a logged in user, I want the [give_login] shortcode's "click here to logout" link to log me out.

Current Behavior

currently that link goes to /wp-admin instead of logging the user out.

Expected Behavior

I expect it to log me out when I click that link.

Bug Type

Steps to Reproduce

  1. put the [give_login] shortcode on a page
  2. while logged in, visit that page.
  3. The text You are already logged in to the site. Click Here to logout is displayed. Clicking the link does not log you out.

Possible Solution

That link is defined here: https://github.com/impress-org/give/blob/07ca0a3a95f8d7f38c23b19d38987311730d4b30/templates/shortcode-login.php#L79

Related

https://secure.helpscout.net/conversation/762663578/33289/

Acceptance Criteria

Environment

WordPress System Info ### WordPress Environment ### Home URL: http://localgive.local Site URL: http://localgive.local WP Version: 5.0.3 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, give_subscription ### Server Environment ### Hosting Provider: DBH: localhost, SRV: localgive.local TLS Connection: Connection uses TLS 1.2 TLS Connection: Probably Okay Server Info: nginx/1.10.1 PHP Version: 7.2.0 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.60 - 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.4.0 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✔Donor Note✔Email access❌Renewal Receipt Email❌Renewal Receipt Email❌Subscription Cancelled Email❌Subscription Cancelled Email❌Subscription Completed Email❌Subscription Reminder Email✔Subscriptions Email Access Upgraded From: – Test Mode: Enabled Currency Code: USD Currency Position: Before Decimal Separator: . Thousands Separator: , Success Page: http://localgive.local/donation-confirmation/ Failure Page: http://localgive.local/donation-failed/ Donation History Page: http://localgive.local/donation-history/ Give Forms Slug: /donations/ Enabled Payment Gateways: Test Donation, Offline Donation, Stripe - Credit Card Default Payment Gateway: Stripe - Credit Card PayPal IPN Verification: Enabled PayPal IPN Notifications: N/A Donor Email Access: Enabled ### Active Give Add-ons ### Give - Authorize.net Gateway: ❌ Unlicensed – by GiveWP – 1.4.5 Give - Manual Donations: ❌ Unlicensed – by WordImpress – 1.4.1 Give - PDF Receipts: ❌ Unlicensed – by GiveWP – 2.3.2 Give - Recurring Donations: ❌ Unlicensed – by GiveWP – 1.8.3 Give - Stripe Gateway: ❌ Unlicensed – by GiveWP – 2.1.3 Give - Tributes: ❌ Unlicensed – by GiveWP – 1.5.2 ### Other Active Plugins ### Ben's Helper Functions: by BenUNC – ### Inactive Plugins ### Better Search Replace: by Delicious Brains – 1.3.2 Debug Bar: by wordpressdotorg – 1.0 Debug Bar Post Meta: by whyisjake – 0.5.5 Divi Builder: by Elegant Themes – 2.3.1 Duplicate Post: by Enrico Battocchi – 3.2.2 Elegant Themes Support: by Elegant Themes – 1.3 Fusion Builder: by ThemeFusion – 1.0.6 Fusion Core: by ThemeFusion – 3.0.6 Give - 2Checkout Gateway: by WordImpress – 1.0.2 Give - Annual Receipts: by GiveWP – 1.0.0 Give - Braintree Gateway: by WordImpress – 1.2.2 Give - CCAvenue Gateway: by GiveWP – 1.0.2 Give - Constant Contact: by WordImpress – 1.2.1 Give - ConvertKit: by WordImpress – 1.0.2 Give - Currency Switcher: by GiveWP – 1.3.0 Give - Dwolla Gateway: by WordImpress – 1.1.2 Give - Email Reports: by WordImpress – 1.1.2 Give - Fee Recovery: by WordImpress – 1.7.0 Give - Form Countdown: by WordImpress – 1.0.1 Give - Form Field Manager: by GiveWP – 1.4.0 Give - Google Analytics Donation Tracking: by GiveWP – 1.2.2 Give - Hook Helper: by Ravinder Kumar – 1.0 Give - iATS Payment Solutions: by WordImpress – 1.0.2 Give - MailChimp: by GiveWP – 1.4.3 Give - Old Meta Switcher: by WordImpress – 1.0 Give - PayFast Payment Gateway: by WordImpress – 1.0.2 Give - Paymill Gateway: by WordImpress – 1.1 Give - PayPal Pro Gateway: by WordImpress – 1.1.6 Give - Paytm Gateway: by WordImpress – 1.0 Give - PayUmoney: by WordImpress – 1.0.1 Give - Per Form Gateways: by WordImpress – 1.0.1 Give - Razorpay: by WordImpress – 1.1.3 Give - Recurring Helper: by WordImpress – 1.0 Give - Update Goal Progress: by Matt Cromwell – 1.0 Give - WePay Gateway: by WordImpress – 1.3.1 Give - WP All Import Addon: by Ben Meredith – 1.0 Give - Zapier: by WordImpress – 1.2.1 Give Stripe Cleanup.: by BenUNC – Hello Dolly: by Matt Mullenweg – 1.6 Transients Manager: by Pippin Williamson – 1.7.5 User Switching: by John Blackbourn & contributors – 1.4.0 ### Active MU Plugins ### Bypass Login: by Stephen Carnam – 1.1.0 hide-give-license-warning.php: by – Local by Flywheel Relative URL (for Live Links): by Flywheel – 1.0 ### Theme ### Name: Twenty Seventeen Version: 2.0 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
mathetos commented 5 years ago

@Benunc In the meantime, this filter is a good workaround, and this should essentially be the fix for this issue:

add_filter('give_already_logged_in_message', 'my_custom_give_logout_link' );

function my_custom_give_logout_link() {
    echo sprintf(
    /* translators: %s Redirect URL. */
        __( 'You are already logged in to the site. <a href="%s">Click here</a> to logout.', 'give' ),
        wp_logout_url()
    );
}