This WordPress plugin specifically has code that works in PHP 7.4 but throws fatal errors in PHP 8.
This plugin adds an endpoint at /wp-json/wp-example-test-php8-plugin/v1/site-title
, which returns the currently set Site Title.
The PHP 8 specific code is only loaded when you visit this endpoint, so when testing with PHP 8 the site will function properly unless you visit this endpoint.
When you visit the endpoint using PHP 7.4, you may see a number of warnings displayed on the screen.
Typically on a production site, warnings like these are not displayed to the user but on a development site they can be very helpful to identify issues early.
If you scroll to the bottom of the page, you should see the Site Title.
When you visit the endpoint using PHP 8, you should see a fatal error.
Your goal is to fix these PHP 8 errors.