WPIntell

Source evidence

PHP deprecated: passing null to str_replace

Fast Velocity Minify · support · 2024-11-18T10:26:00+00:00

mixedsentiment
highseverity
0.83relevance
1replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 34 rows with source links

14.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

29 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
henning22 resolved
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 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.

Comments

1 shown
Raul P. 2025-02-15T18:11:00+00:00

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.