• durangod2

    (@durangod2)


    Hi, perfect plugin thanks for making it. ??

    I only found two issues. One is that your delete key link does not delete the key, it is not working.

    The other thing i found is that when someone manually creates a code you need to force it to uppercase. My code did not work because it was in lowercase. I noticed when i used the auto create that it created them all in upper case.

    The input form to create a code is correct, it shows upper case, and the input form to register is ok it also shows upper case.. But the code is stored as lowercase, because it shows as lowercase on the list.

    Other than that it works just as i wanted.
    Thanks
    Dave

    UPDATE: correction, the delete works for self created keys but it does not work for the 999999 INVITATION default key or the auto created keys.

    https://www.ads-software.com/plugins/baw-invitation-codes/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    regarding the ability to delete the pregenerated “INVITATION” and random gernerated keys.

    I just explored the plugin code. There is a bug in the “back-end.php” on line 201.
    the line
    $code = isset( $_GET['code'] ) ? sanitize_key( $_GET['code']) : false;
    should actually be
    $code = isset( $_GET['code'] ) ? strtoupper(sanitize_key( $_GET['code'])) : false;

    It seem there are a few places where the “strtoupper()” is missing and causing trouble.

    Thread Starter durangod2

    (@durangod2)

    Hi sdenec,

    thanks so much for your reply, im adding the code now…

    yes that fixed the del issue ??

    appreciate it ??

    Thread Starter durangod2

    (@durangod2)

    now i just have to find where the maunaul code creation is so i can add uppercase to that too

    Thread Starter durangod2

    (@durangod2)

    found it…

    the creation code is here

    function create_invitation_code( $code, $count = 1 ) {
    	$baweic_options = get_option( 'baweic_options' );
    
    	$count = (int) $count>0 ? $count : 1;
    	$code = strtoupper(sanitize_key( $code ));
    	if ( isset( $baweic_options['codes'][ $code ] ) || ! trim( $code ) ) {
    		return false;
    	} else {
    		$baweic_options['codes'][ $code ] = array( 'maxcount' => $count, 'leftcount' => $count, 'users' => '' );
    		update_option( 'baweic_options', $baweic_options );
    		return true;
    	}
    }

    i modified this line to add strtoupper

    $code = strtoupper(sanitize_key( $code ));

    now when you create a code it will be upper case too….

    it wont help with already created codes youll just have to mod them in the db or delete them in the db but everything else created will be uppercase.

    Thread Starter durangod2

    (@durangod2)

    also if you need to edit it in the db its in wp_options table, you will need to export a sql and do a search to see which id but the invitations are all stored together as an array i believe.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Only two issues i found’ is closed to new replies.