Thanks. I suspect you are using PHP version 8.x, which gives warnings about trying to check a variable that doesn’t exist. PHP 7.x didn’t care.
That version number on the wp_register_style is just there to add a version number to the style call to help ‘bust’ CSS caching. Only really useful during my debugging the code.
I probably should go through all the code to get rid of the checking of undeclared variables to keep PHP 8.x happy (there’s probably others). Since those are ‘warnings’, they shouldn’t ‘kill’ your site unless you have non-standard debug/error logging enabled
Thanks Rick, you are correct that we are using php 8.x. And, yes, the site works but just generates a large volume of error logs so definitely not fatal. Just FYI, in addition to the mpr_version_number errors here is a complete list of the other plugin errors I am seeing being logged:
Undefined array key “excludesites” in …/multisite-post-reader.php on line 252
Undefined array key “excludesites” in …/multisite-post-reader.php on line 358
Undefined array key “nodate” in …/multisite-post-reader.php on line 532
Undefined array key “showall” in …/multisite-post-reader.php on line 466
Undefined array key “showall” in …/multisite-post-reader.php on line 539
Undefined array key “tag” in …/multisite-post-reader.php on line 479
Undefined array key “type” in …/multisite-post-reader.php on line 475
Undefined variable $days in …/multisite-post-reader.php on line 460
Thanks!
Been working on the update to remove all of those warnings by making the code PHP 8x compatible. Getting close to finishing – just testing all of the options.
But then suddenly wondered if there were any new features or other enhancements that might be useful?
If you (or anyone) think of any possible new features/enhancements, create a new topic here and put ‘feature request’ in the title.
@robghen – do you want to beta test the updated version? The updated version seems to be working OK on my test site, but testing elsewhere is always a good idea.
If so, contact me via the contact form at my cellarweb (dot) com site. Let me know either way.
I have just uploaded/released version 3.00, which fixes a lot of things (see the readme file), including the warning error messages because of using PHP version 8.x.
This update also resolves your issues. Thanks for your patience.
Thanks, Rick. This update has resolved the original errors but I am seeing one new error:
PHP Fatal error: Uncaught Error: Call to undefined function int() in …/wp-content/plugins/multisite-post-reader/multisite-post-reader.php:305
I see 3 places in that file where you use “int(…)” but perhaps those should be “(int) …”?
Thanks!
Urk. Fixed in version 3.01. Thanks for the catch!
Great, all the errors seem to be gone now. Just FYI, there is one final warning which may or many not be expected:
PHP Warning: Array to string conversion in …/multisite-post-reader/multisite-post-reader.php on line 394
Since this is just a warning I’m not going to worry about it but I suppose an explicit “(string)” cast could eliminate the warning if anyone cared.
Thanks for the quick fixes!
Thanks again. Version 3.02 with this minor fix is now available.