OddOneOut / bwp-recaptcha

A WordPress plugin that utilizes the popular anti-spam library, reCAPTCHA, to help your blog stay clear of spams.
http://betterwp.net/wordpress-plugins/bwp-recaptcha/
8 stars 4 forks source link

PHP 7.1/7.2 incompatibility #30

Open eehmke opened 6 years ago

eehmke commented 6 years ago

Wordpress version: 4.9.4 PHP version: 7.1 Plugin Better WordPress reCAPTCHA version 2.0.3 Plugin PHP Compatibility Checker version 1.4.5

The compatibility checker reports these warnings and errors:

FILE: /var/www/mysite/wp-content/plugins/bwp-recaptcha/includes/class-bwp-recaptcha.php

FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE

1572 | WARNING | Function create_function() is deprecated since PHP 7.2; Use an anonymous function instead

FILE: /var/www/mysite/wp-content/plugins/bwp-recaptcha/includes/provider/recaptcha/recaptchalib.php

FOUND 4 ERRORS AFFECTING 3 LINES

210 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2 211 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2 213 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead 213 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead

FILE: /var/www/mysite/wp-content/plugins/bwp-recaptcha/bwp-recaptcha.php

FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE

40 | WARNING | Function create_function() is deprecated since PHP 7.2; Use an anonymous function instead

FILE: /var/www/mysite/wp-content/plugins/bwp-recaptcha/vendor/kminh/bwp-framework/src/phpunit/unit-testcase.php

FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES

70 | WARNING | Function create_function() is deprecated since PHP 7.2; Use an anonymous function instead 71 | WARNING | Function create_function() is deprecated since PHP 7.2; Use an anonymous function instead

btwatts commented 4 years ago

My live site was giving me problems with this.

Solution (in the live code in my case);

Change line 40 of bwp-recaptcha.php to:

add_filter('bwp_capt_init_priority', function() {return 9;});