I commented out lines 40-42 in the file as a temporary workaround to get my site back on line. I THINK this only affects the wordpress comment form which I am not using. Hope this helps until the author gets this fixed.
These are the lines I commented.
// if ( !empty( array_intersect( $plugin_option[‘show_logged_users’], $current_user_roles ) ) ) {
// return new NCR_captcha_on_comment_form();
// }
Steve Hogan
More .. I replaced the three lines I commented out above with this code:
$test_array = array_intersect( $plugin_option[‘show_logged_users’], $current_user_roles );
if (!empty($test_array)){
return new NCR_captcha_on_comment_form();
}
And it no longer blows up FWIW. (Whether it actually behaves as the author intended is TBD.)
I believe this has something to do with the behavior of “empty” in different versions of PHP. My site is on PHP 5.6.30.
Hi guys,
yep. It looks to be an issue with how PHP empty values are handled across different versions. We’ve tested on PHP 7.x and it’s working absolutely fine. Just FYI – WordPress recommends PHP 7.1 as a minimum. https://ww.wp.xz.cn/about/requirements/
We’ll look into this see if we can find the culprit. In the meantime, please update your PHP version as per WP requirements.
Thanks,
Cristian.
Thanks Steve. I’ll see if my host can upgrade to PHP 7.
@sigersmit – You are most welcome
@cristian – You are 100% right, of course, about moving to PHP7. However, some hosting companies make this difficult for the user to initiate. Also, I’m planning on moving all of my sites to PHP7 (I run 20+ sites, most with very little traffic) and I fully expect something to blow up – probably a few plugins 🙂
Thanks for looking at this. I appreciate your hard work.
S
@stevehoganstevehogancom – PHP7 has good backwards compatible with older versions. Nothing should break. I’ve already put it on the to-do list for the team to make sure this plugin is backwards compatible down to PHP 5.4
Thanks,
Cristian.
Superb. Can’t ask for anything more. Let me know if I can help in any way.
S