Hi – thanks for the feedback.
I agree, WooCommerce is a popular plugin for turning WordPress sites into ecommerce sites. However, my focus was to create a simple and lightweight plugin that only does one thing – force visitors to log in.
It would be a slippery slope to start accommodating other third-party plugins like WooCommerce and inevitably cause Force Login to grow in size beyond what is necessary.
I recognize some sites might have special circumstances that require certain URLs to be accessible, which is why I included the whitelist and bypass filters to allow developers to easily bypass Force Login where needed.
Well done on successfully accommodating the ecommerce plugin of your choice by using the v_forcelogin_whitelist
filter to allow visitors to access those custom WooCommerce URLs.
However, might I suggest you try the v_forcelogin_bypass
filter with WooCommerce Conditional Tags instead? Something like this:
/**
* Bypass Force Login to allow for exceptions.
*
* @return bool Whether to disable Force Login. Default false.
*/
function my_forcelogin_bypass( $bypass ) {
if ( class_exists( 'WooCommerce' ) ) {
if ( is_wc_endpoint_url( 'lost-password' ) ) {
$bypass = true;
}
}
return $bypass;
}
add_filter('v_forcelogin_bypass', 'my_forcelogin_bypass', 10, 1);
Thanks for using Force Login!
Thread Starter
Anonymous User 14746719
(@anonymized-14746719)
Kevin,
Thank you very much for such a detailed and informative response.
I get why you may not want to include Woocommerce password reset support although don’t necessarily agree 🙂
It would be good, however, if perhaps something on the plugin page was mentioned specifically about plugins that modify the user / password screens. The site was completely up and running and I thought I had tested everything, until someone complained that they forgot their password and clicking the password reset link just kept forcing them back to the login page.
Even if a quick snippet was included in the FAQ section, it may help others avoid the same issue I did and then quickly point them to the bypass options you have available.
Many thanks
Mike