PHP 8.x compatibility issues
-
According to PHPCS
Steps
- Install dependencies (via composer – composer require [dependencyname]):
- squizlabs/php_codesniffer
- phpcompatibility/php-compatibility
- phpcompatibility/phpcompatibility-wp
- dealerdirect/phpcodesniffer-composer-installer
- Run
./vendor/bin/phpcs -p . --standard=PHPCompatibility --runtime-set testVersion 8.0 --extensions=php
- The report throws this list of compatibility issues with PHP 8.x:
FILE: web/content/plugins/lumturio-wp-monitor/lumturio.php ------------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 11 ERRORS AFFECTING 3 LINES ------------------------------------------------------------------------------------------------------------------------------------------------------- 281 | ERROR | Function mcrypt_get_iv_size() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead 281 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead 281 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2 281 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2 282 | ERROR | Function mcrypt_create_iv() is deprecated since PHP 7.1 and removed since PHP 7.2; Use random_bytes() or OpenSSL instead 282 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead 282 | ERROR | The constant "MCRYPT_RAND" is deprecated since PHP 7.1 and removed since PHP 7.2 286 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead 286 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead 286 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2 286 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2 -------------------------------------------------------------------------------------------------------------------------------------------------------
Is there an upto-date version of plugin without Mcrypt dependency to run on PHP 8.x+?
- Install dependencies (via composer – composer require [dependencyname]):
- The topic ‘PHP 8.x compatibility issues’ is closed to new replies.