JosephGabito / subway-2.0

Subway is a plugin for WordPress that allows you to hide the content of your website to non-logged in visitors and only displays them to logged in users.
http://dunhakdis.com
2 stars 1 forks source link

Doesn't work with woocommerce lost-password endpoint #20

Closed cycomarcooo closed 7 years ago

cycomarcooo commented 7 years ago

Woocommerce lost-password endpoint is not whitelisted. Should be useful to add a check like this one inside PageRedirect::index() :

// Check if woocommerce lost-password page.
if ( class_exists( 'WooCommerce' ) ) {
    if ( is_wc_endpoint_url( 'lost-password' ) ) {
        return;
    }
}
codehaiku commented 7 years ago

hi, cyco! That's actually a clever way to check if the page is woocommerce lost password page. Subway should work with WooCommerce lost password page by default, the user just need to add the ID of 'my-accounts' page to the Subway public pages ID.

But I'll add that so that users won't be needing to add the accounts page ID manually, can you pull request?

Thanks!

cycomarcooo commented 7 years ago

Hi, you are right about the my-account ID but it allows access to all endpoints (not very critical if the use is not logged-in by the way). I'll create a pull request asap.

codehaiku commented 7 years ago

@cycomarcooo I'm going to mark this close for the meantime. Just pull request anytime 👍

Thank you!