Support » Plugin: Avatar Privacy » Issue with PHP 8.0, Deprecated: Method ReflectionParameter

  • Resolved Bjarne Oldrup

    (@oldrup)


    Hey! Thank you for sharing this plugin with the community.

    A little heads up. I’ve been testing the new PHP 8.0, and Avatar Privacy seems to have an issue with that, throwing this error:

    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/oldrupdk/oldrup.net/wp-content/plugins/avatar-privacy/vendor-scoped/level-2/dice/Dice.php on line 184

    Please let me know if I can do anything to help locate and fix this issue.

    Bjarne

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author pepe

    (@pputzer)

    Hi @oldrup! Thanks for the heads up! I have not yet tested Avatar Privacy with PHP 8.0. I plan to do that after releasing 2.4.0 (which is almost finished). The issue you encountered is in the dependency injection container Dice. There is an upstream ticket I’ve discovered. I’m hoping the upstream maintainer will fix it by the time I get to PHP 8 compatibility.

    Plugin Author pepe

    (@pputzer)

    I’ve added an issue to track PHP 8.* compatibility on GitHub.

    Thread Starter Bjarne Oldrup

    (@oldrup)

    That’s great news @pputzer. Looking forward to giving the new version a spin! 🙂

    Bjarne

    Plugin Author pepe

    (@pputzer)

    Hi @oldrup, I’ve just released Avatar Privacy 2.5.0 which should have fully supported PHP 8.0 … but of course I forgot about the upstream issue and the unit tests don’t check that.

    Thread Starter Bjarne Oldrup

    (@oldrup)

    Ah. So close! 😀

    Let me know if I can do anything to help. Have you got a PHP 8 WordPress to test on? Otherwise, I can easily provide you with a login.

    Also, don’t hesitate to get in touch if you want me to take it for a spin.

    Kind regards
    Bjarne

    Plugin Author pepe

    (@pputzer)

    Hi @oldrup, I’ve uploaded a draft of 2.5.1 to trunk, you can download it via https://wordpress.org/plugins/avatar-privacy/advanced/ and install it manually to do a test drive. (It’s running fine in MAMP PRO, when I finally got their PHP 8.0.2 package to work.)

    Thread Starter Bjarne Oldrup

    (@oldrup)

    Cool! Tested it on my WordPress 5.7, PHP 8.0.2 multisite test bench and both real gravatar images as well as the automatically generated (I used the birds), works well.

    I get no more deprecation or other errors in the backend. Good job.

    Only oddity, is a weird blank line occurring in the dashboard. I’m using firefox.. Screenshot here: https://snipboard.io/qbV3eP.jpg

    Seems to come from this:

    .php-error #adminmenuback, .php-error #adminmenuwrap {
        margin-top: 2em;
    }
    

    Looking like the php error output was triggered, but no errors were output?

    Can you reproduce? I’ve got debug info on.

    Plugin Author pepe

    (@pputzer)

    No, where do you get that from? I don’t think that markup is produced by WordPress?

    I do have a (silenced) PHP warning in my test environment (because the minified CSS file is not present in a GitHub checkout), and that’s strangely not marked as silences in PHP 8, although it still should be? (I know that there have been some chances for @ operator, but AFAIK not when used with file functions.). But with the zip file from WP.org this should not be triggered at all, because the minified file is there.

    Thread Starter Bjarne Oldrup

    (@oldrup)

    I can give the plugin a shut on another installation, just to check it isn’t something at my end.. Anyhow, it does not seem to interfere with the functionality of the plugin.

    Plugin Author pepe

    (@pputzer)

    I’m pretty certain that the markup is stemming from another plugin even if it is somehow triggered by Avatar Privacy (e.g. I can see silenced errors in Query Monitor). Do you get anything in the logs?

    Thread Starter Bjarne Oldrup

    (@oldrup)

    In the browser console logs? Nope… Clean as my cats plate.

    Plugin Author pepe

    (@pputzer)

    No, I meant the PHP error log. A stacktrace would be helpful.

    Plugin Author pepe

    (@pputzer)

    Hi @oldrup, have you found out anything more?

    Thread Starter Bjarne Oldrup

    (@oldrup)

    Hey @pepe

    Sorry for the late reply. You’ve lost me at stacktrace, sorry. But I’ve done some additional testing that might help you reproduce this minor issue. I’ve been testing on existing sites and brand new installs with a combination of PHP 8, 7.4 and multisite on/of.

    My conclusions so far, is that it has nothing to do with multisite nor PHP 8.

    The odd margin (screenshot: https://snipboard.io/qbV3eP.jpg) appears on a brand new stand alone site running php 7.4 and 2021 theme, no extra plugins besides Avartar Privacy, but ONLY with debug on in wp-config.php, like this:

    // This enables debugging.
    define( 'WP_DEBUG', true );

    Apart from that, the plugin appears to work fine. And as most people don’t have wp_debug enabled, I’m not surprised if you don’t get other reports on this.

    Please let me know if I can do anything else to troubleshoot this. If wanted, I can create a login to a dedicated install where you can take a look for yourself.

    Also I understand if you don’t want to spend more time on this, as it is such an edge/non-critical issue that hardly affects people in real life situations.

    Kind regards
    Bjarne

    Plugin Author pepe

    (@pputzer)

    I’ve been able to reproduce the issue when I’ve disabled Query Monitor. I’ll look into it.

Viewing 15 replies - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.