A non-numeric value encountered
I use a WONDERFUL WordPress plugin called SportsPress for another blog that I manage. This is a GREAT plugin and has worked for me very nicely for several years. However, every once in a while after applying one of their updates, it breaks “things”. The latest thing it broke was my Player Lists. The error I received was “A non-numeric value encountered in /root_path/wp-content/plugins/sportspress/includes/class-sp-player-list.php on line 226“. However, there is a really simple fix and you DO NOT need to be a developer or know anything about PHP to fix it. This has happened to me several times so I thought I’d put together a quick blog post about it to help someone else in case they ever needed it.
Step 1
Record the exact error and file path. You will need to know the file name that you need to edit. It will normally be a PHP file. In this example it was /wp-content/plugins/sportspress/includes/class-sp-player-list.php.
Step 2
Use your favorite FTP client to FTP to your WordPress blog site. I happen to like FileZilla FTP client. Navigate to the class-sp-player-list.php file and download it to your local hard drive.
Step 3
Open the file using your favorite Test Editor. I happen to like NotePadd++. Find Line 226 (noted in the error message you recorded in Step 1) and edit the code by adding (int) in front of the sp_array_value command. See the example below.
Step 4
Save the file on your local hard drive. Using your FTP client, upload the file back to its original location, in this example I uploaded the file back to the /wp-content/plugins/sportspress/includes/ directory. I suggest renaming the original file located on your WordPress blog site first just in case you ever needed to revert back.