Home Forums New-High Fashion WooCommerce WordPress Theme crash conflict wholesale plugin

crash conflict wholesale plugin

  • Author
    Posts
  • #38679

    therockisnow
    Participant

      Hi there,

      I have 7up theme installed and use:
      New-High Fashion WooCommerce WordPress Theme
      from ThemeForest

      and with WooCommerce I have premium plugin:
      WooCommerce Wholesale Lead Capture
      https://wholesalesuiteplugin.com/

      There was conflict with theme and crashed website.
      Plugin author very kind and fixed issue.
      They say best if you know and fix for future in your theme templates function.php file

      This is what they say::

      There’s this error on the debug.log:

      2020-07-22T14:35:00+00:00 CRITICAL Uncaught ArgumentCountError: Too few arguments to function WWLC_User_Account::wwlc_wholesale_lead_login_redirect(), 1 passed in /home/bybenjic/public_html/wp-includes/class-wp-hook.php on line 287 and exactly 3 expected in /home/bybenjic/public_html/wp-content/plugins/woocommerce-wholesale-lead-capture/includes/class-wwlc-user-account.php:224
      Stack trace:
      #0 /home/bybenjic/public_html/wp-includes/class-wp-hook.php(287): WWLC_User_Account->wwlc_wholesale_lead_login_redirect(‘https://www.byb…’)
      #1 /home/bybenjic/public_html/wp-includes/plugin.php(206): WP_Hook->apply_filters(‘https://www.byb…’, Array)
      #2 /home/bybenjic/public_html/wp-content/themes/newhigh/7upframe/function/function.php(1254): apply_filters(‘login_redirect’, ‘https://www.byb…’)
      #3 /home/bybenjic/public_html/wp-content/themes/newhigh/7upframe/function/function.php(1406): s7upf_login_form()
      #4 /home/bybenjic/public_html/wp-content/themes/newhigh-child/footer.php(47): s7upf_content_form_popup()
      #5 /home/bybenjic/public_html/wp-includes/templ in /home/bybenjic/public_html/wp-content/plugins/woocommerce-wholesale-lead-capture/includes/class-wwlc-user-account.php on line 224

      After discussing this with our devs, it seems the cause of the critical error I mentioned in my previous email is with your theme.

      In the function.php file in new-high/7upframe/function/ line 2527 and 2728, they use login_redirects hooks incorrectly with fewer parameters. For your reference, please read the following documentation: https://developer.wordpress.org/reference/hooks/login_redirect/

      I’ve highlighted the line here: https://snipboard.io/JDMf7U.jpg

      I’ve fixed this issue by commenting out the line 2527 and 2728 and adding the missing parameters:

      if(empty($redirect_to)) $redirect_to = apply_filters( ‘login_redirect’,home_url(‘/’), ”, wp_get_current_user() );
      Your homepage is now loaded with correct styling. https://snipboard.io/I1afBp.jpg

      Please kindly contact your theme support about this issue as they’ll need to update this on their end as well.

      Thanks for your kindness.

    You must be logged in to reply to this topic. Click here to login or register