• I currently have a support ticket in on this.

    I am not able to verify one site is registered from the other, although the other site we’re using shows both sites are registered. So we can’t make the share logins feature work.

    We’re on WordPress 5.4.2.

    The specific error being generated:

    PHP message: PHP Warning: Invalid argument supplied for foreach() in /www/wp-content/plugins/share-logins/includes/functions.php on line 379

    Line 379:

    $new_array[$new_key[0]] = $value;

    The full area around line 379:

    foreach ( $array as $key => $value ) {
    $value = $value == ‘on’ && $site_added == 1 ? 1 : 0;

    if( strpos( $key, ‘-‘) ){
    $new_key = explode( ‘-‘, $key );
    $new_array[$new_key[0]] = $value;
    }else{
    $new_array[$key] = $value;
    }
    }

    I need a resolution to this issue as soon as possible- this is one of our largest clients. I notice you’ve taken this plugin down on the WordPress repo, right after we pay for a subscription. We need support.

Viewing 1 replies (of 1 total)
  • Hi @arufasari,

    For avoid php error message.
    I have a solution. Before start foreach loop you can check. Is $array value exist or not. if $array value exist code will run foreach loop otherwise not run foreach loop.

    Code should be: //Some thing like
    if(isset($array){
    foreach ( $array as $key => $value ) {
    $value = $value == ‘on’ && $site_added == 1 ? 1 : 0;

    if( strpos( $key, ‘-‘) ){
    $new_key = explode( ‘-‘, $key );
    $new_array[$new_key[0]] = $value;
    }else{
    $new_array[$key] = $value;
    }
    }
    }

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Issues with Line 379 of share-logins/includes/functions.php’ is closed to new replies.