Page 1 of 1

[PATCHED]Woocommerce - Missing argument warning on WP login - temp fix

Posted: Mon Jul 17, 2017 2:34 pm
by kaspir
Are you getting an error like this when you log in WordPress, and you have install Woocommerce?

Image

There is a quick fix Alessio found and gave me. We shall edit the /wp-content/plugins/woocommerce/includes/wc-core-functions.php

Find on line #1551:

Code: Select all

function wc_maybe_store_user_agent( $user_login, $user ) {
And change to:

Code: Select all

function wc_maybe_store_user_agent( $user_login, $user = '' ) {
Save & upload.

WARNING: If you update Woocommerce plugin, your edit will be overwritten more than likely. But I'm sure Allesio will have it patched in no time from w3all plugin and thereafter, YOU SHOULD REVERT THIS CHANGE!


Happy coding. :geek:

Woocommerce - Missing argument error on WP login

Posted: Tue Jul 25, 2017 9:49 am
by axew3
Just over to setup and complete the new release, so looking about reports and looking for issues.
So, after added option for WP shortcode about phpBB posts, formatted and displayed into WP posts,
i've return over the issue:

Code: Select all

PHP Warning:  Missing argument 2 for wc_maybe_store_user_agent() in /wp-content/plugins/woocommerce/includes/wc-core-functions.php on line 1551

Woocommerce warning on WordPress login

normally, you'll may never will be noticed about this php warning, because online environments quite often (+-ever) are suppressing php errors and warnings, so you should note it only on php error logs file ...

It return warning issue not only with wp_w3all plugin, it return the same warning on several plugins.
This not mean nothing by he way.

EDITED: after lunch and a walk
Found where and why the error come out:
on class.wp.w3all-phpbb.php
inside:

Code: Select all

phpBB_user_session_set($wp_user_data){
this code (that if you remove avoid the warning to be thrown):

Code: Select all

  $current_user = wp_get_current_user(); 
     //if( $current_user->ID == 0 && !is_multisite() ){
     	if( $current_user->ID == 0  ){
        wp_set_current_user( $wp_user_data->ID, $wp_user_data->user_login );
        wp_set_auth_cookie( $wp_user_data->ID, true, $secure );
         do_action( 'wp_login', $wp_user_data->user_login);
        //wp_redirect( admin_url().'profile.php');
        // exit;
this will be resolved/fixed on next coming 1.7.4 version
...

Re: Woocommerce - Missing argument warning on WP login - temp fix

Posted: Thu Aug 03, 2017 5:31 am
by kaspir
Confirmed, updated to 1.7.4 and reverted my changed in woo commerce file, this issue is resolved in this patch. closing topic.