hdlineage / Minecraft-AuthMe-Wordpress-Plugin

A Wordpress plugin that provides web integration with the AuthmeReloaded Minecraft plugin (independent of Wordpress database).
4 stars 1 forks source link

It can't run with wp5.9+PHP 8.0 #2

Open Daodanfd5 opened 2 years ago

Daodanfd5 commented 2 years ago

My wordpress is running in version 5.9. it can run in 5.9 with php7.4 and php8.1, but it can't run with php8.0 and it makes my wordpress wrong. wp5.9 + php8.1 can run. maybe it just a bit of wrong.

Neon3341 commented 2 years ago

This plugin wrote for early php like php5 or php6. So it needs an update. And i've done it) I've update the plugin for full compatibility with php 8.0+ You need to change some lines in config.php in root directory of plugin

Just change lines 36-55 to if(!isset($options['host'])) $options['host'] = ''; if(!isset($options['user'])) $options['user'] = ''; if(!isset($options['pass'])) $options['pass'] = ''; if(!isset($options['db'])) $options['db'] = ''; if(!isset($options['table'])) $options['table'] = ''; if(!isset($options['invite'])) $options['invite'] = ''; if(!isset($options['email'])) $options['email'] = ''; if(!isset($options['captcha'])) $options['captcha'] = 0; if(!isset($options['welcome'])) $options['welcome'] = 'You must have a valid invite code to register.'; if(!isset($options['form-title'])) $options['form-title'] = 'New Account Registration Form';

and change lines 137-148 to $options = get_option( 'minecraft_authme_options' ); //Authme Database Setup define('Authme_DB_NAME', $options['db'], false); define('Authme_TABLE_NAME', $options['table'], false); /** MySQL database username */ define('Authme_DB_USER', $options['user'], false); /** MySQL database password */ define('Authme_DB_PASSWORD', $options['pass'], false); /** MySQL hostname */ define('Authme_DB_HOST', $options['host'], false); //Custom Invitation Code define('Authme_INV_CODE', $options['invite'], false);

or you can download php8 compatibility version here minecraft-authme.zip