I have a crazy bug I cannot figure out. I recently upgraded to PHP 8.2 and Wordpress 6.3. At about the same time, I was trying to prevent spam registrations, so I added reCaptcha to the login and registration page via WordFence plugin (and later disabled that). Somewhere amidst my insufficent testing, our site lost the ability to let new users regisiter, and I am not sure what change it happened after, because I made a ton of changes all at once (I know... bad habit.)
I have looked through all of the code, and if I write wp query for the users_can_register option, I get the correct value, but the get_option() function returns an empty string, so registration is disabled and I cannot reenable it. I cannot get the wp-admin General Settings page to display or save the checkbox for "Anyone can Register" (and yet, the option value IS set to 1 in the database).
I can only figure some other plugin is messing with what get_option('users_can_register') returns. We added a bunch of error logging to the wordpress core files in those functions, and I still am just stumped.
Can anyone help me think of another place to look? We have tried disabling all plugins and using the Twenty Twentythree theme, and it still has the same problem. Oh, at one point I tried downgrading to WP 6.2.2 using a plugin, and that didn't fix it either. I reinstalled WP 6.3.
I should note that I may still have some deprecation errors in various plugins related to PHP 8 that need to be fixed but I don't think they have anything to do with getting the wp_option value. The get_option value returns the correct value for every other wp_option we test (e.g. blogname, etc). The problem does not happen on my local machine in my MAMP testing environment, so I think something is corrupted in production... but what?
Also, my block editor for pages and posts broke when I upgraded and I had to fix it by installing the Gutenberg plugin.
What else could it be?
Tried: -disabling plugins -2023 theme -error logging added to wp-admin/options.php and options-general.php -writing a PHP page to test the get_option calls directly for the users_can_regiter key and others
- checked error logs
- cleared cache
- this is Elastic Beanstalk default nginx platform on AWS
- deployed new code bundle on same EC2 instance
- can provide a list of other installed plugins, including WordFence, W3TC, Event Espresso (highly customized), and more.
Thanks!