Forum Replies Created

Viewing 3 replies - 31 through 33 (of 33 total)
  • Plugin Author Hasan CALISIR

    (@psauxit)

    Hello @coldrealms65,

    I tested your approach with the following setup on my gentoo server:

    My actual setup have PHP-FPM-USER (as a known WEBSITE-USER or PHP process owner) and WEBSERVER-USER (commonly, nginx or www-data)

    Environment:

    Web Server: NGINX, configured with FastCGI cache

    Source Path: (Original NGINX Cache Path)
    /dev/shm/fastcgi-cache-psauxit

    FUSE Mount Point (with altered permissions for PHP process owner): This FUSE mount point will be used as the NGINX Cache Path in the NPP plugin settings instead of the original.
    /dev/shm/fastcgi-cache-psauxit-mnt

    PHP Process Owner: (Also known as the WEBSITE-USER or PHP-FPM-USER)
    psauxit

    WEBSERVER-USER:
    nginx

    To complete the setup:

    1- Install bindfs via package manager: (vary on your linux distro)

    emerge --ask sys-fs/bindfs

    2- Create the new FUSE mount directory:

    mkdir /dev/shm/fastcgi-cache-psauxit-mnt

    3- Set up the bindfs mount with appropriate permissions:

    bindfs -u psauxit -g psauxit --perms=u=rwx:g=rwx:o=rx /dev/shm/fastcgi-cache-psauxit /dev/shm/fastcgi-cache-psauxit-mnt

    Alternatively make it persistent via /etc/fstab:

    bindfs#/dev/shm/fastcgi-cache-psauxit /dev/shm/fastcgi-cache-psauxit-mnt fuse force-user=psauxit,force-group=psauxit,perms=u=rwx:g=rwx:o=rx 0 0

    4- Set /dev/shm/fastcgi-cache-psauxit-mnt as a NGINX Cache Path in NPP plugin settings page and test Purge and Preload actions.

    Your approach works exceptionally well and, in my tests, it’s more stable than the original inotifywait/setfacl setup that I scripted it in bash for WP community. I was seeking a more reliable solution, as inotifywait/setfacl sometimes struggles with responding consistently to rapid file creation events during cache preloading.

    I will try to automate this approach with bash scripting as much as possible for easy NPP integration.

    This is very valuable technical feedback. Thank you!

    • This reply was modified 4 months ago by Hasan CALISIR. Reason: fix mount path

    You are welcome @karzin

    As @eyewayonline mentioned somehow this setting on plugin not work as expected and breaks some other functionality.

    I have changed the Login prevention method from “logout right after login” to “Use login filter from woocommerce”. The issue got resolved but this method prevents system to send account creation mail to the customer that also contain verification link. It is also verifying the customer automatically without pressing any verification link.

    Suprisingly manually preventing auto login after register behaviour instead of relying plugin setting solves the issue on my side. For your investigation.

    Best ~Hasan

    @eyewayonline

    The issue you described is completely reproducible on my environment.

    Hello, whenever we enter email id on register my-account form, it resets the cart and customer loose all its items in the cart. I tried to resolve the issue by enabling “Custom logout function” option available on the Advanced section, as mentioned here. But the issue is still there. Kindly assist further.

    I have changed the Login prevention method from “logout right after login” to “Use login filter from woocommerce”. The issue got resolved but this method prevents system to send account creation mail to the customer that also contain verification link. It is also verifying the customer automatically without pressing any verification link.

    I solved the issue by disabling the Prevent login after register completely on plugin settings first. Then I manually prevent login after register behaviour via adding below filter to my child theme’s functions.php ;

    add_filter( 'woocommerce_registration_auth_new_customer', '__return_false' );

    P.S. If you want to redirect the customer to checkout page right after e-mail verification completed you can use below code in your child theme’s functions.php ;

    add_action('template_redirect', 'redirect_if_activation_message_and_cart');
    function redirect_if_activation_message_and_cart() {
        // Check if it's the my account page
        if (is_account_page()) {
            // Check if the URL has the success activation message
            if (isset($_GET['alg_wc_ev_success_activation_message']) && $_GET['alg_wc_ev_success_activation_message'] === '1') {
                // Check if the WooCommerce cart is not empty
                if (!WC()->cart->is_empty()) {
                    // Redirect to the checkout page
                    wp_safe_redirect(wc_get_checkout_url());
                    exit;
                }
            }
        }
    }

    Hope this helps, great plugin!

    • This reply was modified 9 months, 3 weeks ago by Hasan CALISIR.
Viewing 3 replies - 31 through 33 (of 33 total)