PHP 7.2 Upgrade issue

Hi support,
I'm doing a live PHP7.2 upgrade test on the site in question, the upgrade itself has gone without issue, but now I'm getting a weird error plastered all over the front end of my site and I can't for the life of me figure out what's causing it, I've been through all the plugins disabling and re-enabling them one by one but nothing seems to clear the error and I wondered if you had any ideas, below is the error:
Warning: Parameter 2 to advanced_custom_search() expected to be a reference, value given in /home/roadsafetyscot/public_html/wp-includes/class-wp-hook.php on line 286
Thank you
Scott Sibson

  • Adam Czajczyk
    • Support Gorilla

    Hi Scott

    I hope you're well today!

    Do you have some plugin of a name similar to Advanced Custom Search on the site? I believe there was such plugin in the past. The message looks like the advanced_custom_search() function (which is not WP core thing) doesn't receive properly formatted parameters.

    This can be caused by number of reasons but if it started to happen only after upgrade to PHP 7.2, that would mean that either some plugin or the theme itself is not compatible with PHP 7.2. WordPRess core wouldn't issue such errors.

    You mentioned that you tried to disable plugins and it was still there. Have you tried to do it exactly this way:

    1. find out if there's any cache on server and if so, clear it and possibly disable
    2. disable absolutely all plugins on site (including any mu-plugins if there are any)
    3. switch theme to freshly installed Twenty Seventeen
    4. check if the error is still there; I got a feeling that it shouldn't be there, unless some sort of custom code was missed

    5. if the error is no longer there
    6. switch one plugin back and check again
    7. repeat 6 with another plugin until the issue shows up again

    8. if it still didn't show until you enabled all the plugins back, switch the theme back on and see again.

    Would you give it a try, please?

    Best regards,
    Adam

  • Scott
    • WPMU DEV Initiate

    Hi Adam,

    The name thing was my first thought too, but I've scowered the site and nothing jumps out, I am using Advanced Custom Fields and Search Filter PRO which are the only 2 plugins that even come close to having any resemblance to advanced_custom_search() but I tried disabling those and still got nothing. Unfortunately at the moment my colleague is adding content to the site and so I can't leave PHP7.2 installed as it will not allow her to save content etc, I did manage to get it to revert back to PHP7 (instead of PHP5.6) which appears to be working fine. As soon as she has completed her tasks I'll jump on again and test the things you mentioned above and update once I have some results.

    Thank you
    Scott

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.