• Resolved robghen

    (@robghen)


    Hi there, you are setting $mpr_version and making it global but then on line 208 you use $mpr_version_number:

    wp_register_style(‘MPR_namespace’, plugins_url(‘/css/settings.css’,FILE ),array(),$mpr_version_number);

    That is the one and only occurance of $mpr_version_number so believe that should be $mpr_version, right? This results in errors like:

    PHP Warning: Undefined variable $mpr_version_number in …/multisite-post-reader.php on line 208

    Thanks!

    –Rob

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Rick Hellewell

    (@rhellewellgmailcom)

    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

    Thread Starter robghen

    (@robghen)

    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!

    Plugin Author Rick Hellewell

    (@rhellewellgmailcom)

    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.

    Plugin Author Rick Hellewell

    (@rhellewellgmailcom)

    @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.

    Plugin Author Rick Hellewell

    (@rhellewellgmailcom)

    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.

    Thread Starter robghen

    (@robghen)

    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!

    Plugin Author Rick Hellewell

    (@rhellewellgmailcom)

    Urk. Fixed in version 3.01. Thanks for the catch!

    Thread Starter robghen

    (@robghen)

    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!

    Plugin Author Rick Hellewell

    (@rhellewellgmailcom)

    Thanks again. Version 3.02 with this minor fix is now available.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘mpr_version vs mpr_version_number’ is closed to new replies.