• Resolved melissakfreeman

    (@melissakfreeman)


    Hi,

    I’ve been happily using Capability Manager Enhanced with WooCommerce, up until version 2.3.6 of WooCommerce was released.

    Now, with Capability Manager Enhanced activated, a user with less than Contributor permission gets a white screen on login.

    I have tested WooCommerce with CME deactivated, and once CME is deactivated, a user with Subscriber permission logs in fine. When CME is activated again, the same user gets a white screen (the white screen of death).

    Could you please look in to why this has become a problem? WooCommerce is one of the most popular WP plugins. It is a shame not to be able to use CME with it.

    Melissa

    https://www.ads-software.com/plugins/capability-manager-enhanced/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Kevin Behrens

    (@kevinb)

    Here’s what I’ve been able to recreate:

    1. If the Contributor role is modified (by CME or any other means) to exclude the edit_posts capability, WooCommerce blocks all access to wp-admin, redirecting to the Account page defined in Woo settings.
    2. Users with the default Subscriber role (also lacking edit_posts) are also blocked from wp-admin.
    3. The wp-admin blockage is applied by WC_Admin::prevent_admin_access(), via a wp_safe_redirect() call. If the Account page has not yet been configured, wp_safe_redirect() is called with a nullstring url argument. This is the cause of the white screen.
    4. The activation status of the Capability Manager Enhanced plugin has no effect on the white screen condition.

    The logic of requiring the edit_posts capability is problematic for installations that are customized with users who should access custom post types but not posts. You’ll have to take that up with Woo support.

    I would expect the Woo team to provide a fix for the nullstring redirect issue, though they may give it a low priority since the error only occurs with incomplete WooCommerce configuration. For now, it’s possible to work around the white screen in code by adding a filter to ‘woocommerce_get_myaccount_page_permalink’, changing a nullstring redirect value to site_url(”).

    Plugin Author Kevin Behrens

    (@kevinb)

    Another workaround strategy is to filter both ‘woocommerce_prevent_admin_access’ and ‘woocommerce_disable_admin_bar’, returning a value of false.

    Thread Starter melissakfreeman

    (@melissakfreeman)

    Hi Kevin,

    Thankyou very much for investigating this issue. I really appreciate it. The Woo team have been really unhelpful (basically dismissive) so far. I will pass on your findings.

    Best regards,

    Melissa.

    Hi,

    there’s an issue with WC from 2.3.6 on, where users without edit_posts capability get redirected from wp-admin to my-account after login. This happens IF you have set a page as my-account. If you do not, you get a blank page like you describe.

    You can check if you have a page set to my-account. If you don’t have any set, what you are experiencing is the issue above resulting in a valid but blank page and not a white death page (php error/timeout).

    If this is it, it’s explained here: update-causes-wp-admin-redirect-to-my-account

    Plugin Author Kevin Behrens

    (@kevinb)

    The redirect to Account page is intentional in the Woo code. If you want to prevent it, hook into the filters I mentioned, returning false.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Conflict with WooCommerce 2.3.6 ?’ is closed to new replies.