• Resolved Jey Fisher

    (@jey-fisher)


    I scaned the plugin compatibility with PHP 7.2 and I got a result that I added below. Please, could you prepare the code for PHP 7.2. Thank You!

    Nextend Social Login – Errors: 6

    FILE: /nas/content/live/zliencommunity/wp-content/plugins/nextend-facebook-connect/providers/facebook/compat/Facebook/PseudoRandomString/McryptPseudoRandomStringGenerator.php
    ————
    FOUND 3 ERRORS AFFECTING 1 LINE
    ————
    53 | ERROR | Function mcrypt_create_iv() is deprecated since PHP 7.1 and removed since PHP 7.2; Use random_bytes() or OpenSSL instead
    53 | ERROR | Extension ‘mcrypt’ is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
    53 | ERROR | The constant “MCRYPT_DEV_URANDOM” is deprecated since PHP 7.1 and removed since PHP 7.2
    ————
    FILE: /nas/content/live/zliencommunity/wp-content/plugins/nextend-facebook-connect/includes/oauth2.php
    ————
    FOUND 3 ERRORS AFFECTING 1 LINE
    ————
    219 | ERROR | Function mcrypt_create_iv() is deprecated since PHP 7.1 and removed since PHP 7.2; Use random_bytes() or OpenSSL instead
    219 | ERROR | Extension ‘mcrypt’ is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
    219 | ERROR | The constant “MCRYPT_DEV_URANDOM” is deprecated since PHP 7.1 and removed since PHP 7.2

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Nextendweb

    (@nextendweb)

    Hi @jey-fisher,
    Nextend Social Login works fine on PHP 7.2. What you found are not errors, but compatibility codes for PHP 7.1 and older versions of PHP. Nothing to worry about.

    Here is the source code for details explanation:

    if (function_exists('random_bytes')) {
    	return $this->bytesToString(random_bytes(self::CSRF_LENGTH));
    }
    
    if (function_exists('mcrypt_create_iv')) {
    	/** @noinspection PhpDeprecationInspection */
    	$binaryString = mcrypt_create_iv(self::CSRF_LENGTH, MCRYPT_DEV_URANDOM);
    
    	if ($binaryString !== false) {
    		return $this->bytesToString($binaryString);
    	}
    }
    
    if (function_exists('openssl_random_pseudo_bytes')) {
    	$wasCryptographicallyStrong = false;
    
    	$binaryString = openssl_random_pseudo_bytes(self::CSRF_LENGTH, $wasCryptographicallyStrong);
    
    	if ($binaryString !== false && $wasCryptographicallyStrong === true) {
    		return $this->bytesToString($binaryString);
    	}
    }

    Thank you so mush for the speed with answer and great plugin!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.