Hi Greg,
We've been working on getting some of our more popular plugins updated for PHP 8.1; Website Membership being one of them. They should be getting an official release in the next few days, but let me know if there's anything you need to get updated ASAP and can provide a patch in the meantime.
Also, is there a free scanner/script that can identify code that won't work with PHP 8 or is is just a case of upgrading and then manually testing everything?
Nothing that we're aware of, yet.
I can let you know that the big culprit in PHP 8.1 is that a number of internal PHP functions no longer allow "null" to be used as an empty value (e.g., strlen() or str_replace() which expect strings), which can cause issues in places where "@" is used to silence notices for variables that may not exist if they then get passed to any of these functions. This is a pattern that was used historically in our code, that now needs to be shifted away from. It's simple to fix, but if you have custom code that uses that pattern it increases the likelihood that you'll get errors in PHP 8.1.
Ideally, these sections should be rewritten to explicitly check whether or not the variable exists, but if you get an error like "Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in ... on line ...", it can be fixed in a pinch by changing this:
strlen(@$_REQUEST['somevar']);
To this:
strlen($_REQUEST['somevar']??'');
(Note that ??'' should be used when the function expects a string. You'd use ??0 if expecting an integer, ??false if expecting a boolean, etc.)
Thanks,
Daniel
Technical Lead
interactivetools.com