• Resolved henning22

    (@henning22)


    Hi there,
    there is a PHP deprecated message that is spamming my logfile since a long time. Could you please have a look on how to fix this. The message is:

    PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in [ROOT_PATH_HERE]/wp-content/plugins/fast-velocity-minify/inc/frontend.php on line 1075

    In the mentioned line I found this code:

    add fvm_footer scripts, if enabled
    if(fvm_can_minify_js()) {
    $fm = fvm_add_footer_function($fm);
    }
    $hm = str_replace(array(”, ”), ”, $hm);
    $hm_late = str_replace(array(”, ”), ”, $hm_late);
    $fm = str_replace(”, ”, $fm);
    // this is line 1075

    The function fvm_add_footer_function (defined in line 2193 in \wp-content\plugins\fast-velocity-minify\inc\common.php) returns nothing (void), so I am pretty sure this is the cause of the deprecated message.

    Best regards,
    Henning

Viewing 1 replies (of 1 total)
  • Plugin Author Raul P.

    (@alignak)

    Hi, it’s been a while because I only work on this on my free time, and I haven’t had time for the project in a long time.

    Normally, PHP Deprecated errors, only show up if you specifically enable error logging at that level, and it doesn’t affect the normal usage of sites in production (live sites). You should probably not have that level of error enabled on production sites, but it’s up to you.

    That error also appears to mean, that you don’t have the correct wp_footer hook on your theme, or at least on some page templates, else it shouldn’t show up (it’s supposed to be there).

    That being said, it doesn’t change the fact that the error should be accounted for and fixed, so I have pushed a quick release to sort it out.

    I don’t have much time for this plugin at the moment, but it is maintained.

Viewing 1 replies (of 1 total)

The topic ‘PHP deprecated: passing null to str_replace’ is closed to new replies.