• Resolved elliekennard

    (@elliekennard)


    This applies to any of my posts actually. Possibly only on mobile as that is where it has been observed.
    A couple of people have pointed out that when they go to a post to like it, and tap or click on the heart, the heart turns red but the message says ‘sorry, you unliked this’. If they then click on the red heart again, it goes grey but the message says ‘thanks, you liked this!’

    It first started on an ipad and was noticed then on a Samsung phone (which I was able to observe). On my own Android phone, also Samsung, it doesn’t happen for me, even for a site I am not logged in on.

    I hope you can see what’s going on.

    Thanks

    Ellie

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Alimir

    (@alimir)

    Hey @elliekennard

    Can you please go to this path:
    wp-content/plugins/wp-ulike/includes/functions/utilities.php

    then find this function:
    wp_ulike_generate_user_id

    and replace it with this one:

    function wp_ulike_generate_user_id( $user_ip ) {
    		if( wp_ulike_validate_ip(  $user_ip  ) ) {
    			return ip2long( $user_ip );
    		} else {
    			// Get non-anonymise IP address
    			$user_ip    = wp_ulike_get_user_ip();
    			$binary_val = '';
    			foreach ( unpack( 'C*', inet_pton( $user_ip ) ) as $byte ) {
    				$binary_val .= str_pad( decbin( $byte ), 8, "0", STR_PAD_LEFT );
    			}
    			return base_convert( ltrim( $binary_val, '0' ), 2, 10 );
    		}
    	}
    Plugin Author Alimir

    (@alimir)

    Hey @elliekennard
    Is this fixup worked for you?!

    • This reply was modified 3 years ago by Alimir.
    Thread Starter elliekennard

    (@elliekennard)

    Thank you Alimir. I didn’t get a chance to apply the fix that you suggested, and then I asked the people who had been having difficulties. Even without the fix, things seem to be back to normal.
    If I hear about this problem again, I will definitely implement the fix and report back.
    Once again thank you for your help, apologies for not replying sooner.

    Thread Starter elliekennard

    (@elliekennard)

    I’m trying to fix this (it’s happened again) and want to be sure that I am replacing everything that should be replaced and nothing else.
    How much of the existing text do I replace please?

    thank you

    Ellie

    Plugin Author Alimir

    (@alimir)

    Hey @elliekennard
    Please replace the whole function.

    Thread Starter elliekennard

    (@elliekennard)

    Hello again @alimir

    I’m sorry to be obtuse but I am not very adept at this. Will I replace this whole section?

    function wp_ulike_generate_user_id( $user_ip ) {
    		$client_identifier = $user_ip;
    
    		if( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ){
    			$client_identifier .= $_SERVER['HTTP_USER_AGENT'];
    		}
    		if( ! empty( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ){
    			$client_identifier .= $_SERVER['HTTP_ACCEPT_LANGUAGE'];
    		}
    
    		// Make numeric hash
    		$binhash = md5( $client_identifier, true );
    		$numhash = unpack( 'N2', $binhash );
    
    		return apply_filters( 'wp_ulike_generate_client_identifier', $numhash[1] . $numhash[2], $user_ip );
    	}
    }
    Plugin Author Alimir

    (@alimir)

    Hey @elliekennard
    Please update to the new version. ??

    Thread Starter elliekennard

    (@elliekennard)

    Hi @alimir
    I heard from a reader that the problem disappeared for a couple of posts but is back today. I updated when you sent that message above.
    ??
    Ellie

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘When a like is tapped, message says ‘Sorry you unliked this’’ is closed to new replies.